* feat(webui): add simplified mobile-friendly layout for file and share lists
* refactor(webui): switch mobile file list layout to 1-column grid
* feat(webui): show foldertree by default in child sidebar and add close button
* feat(webui): add collapsible section headers and fix folder card full-width on mobile
* feat(webui): improve mobile breadcrumb bar with middle truncation and dual ellipsis
* fix(webui): unify breadcrumb DOM structure across desktop and mobile
* fix(webui): remove unused breadcrumbs variable in BreadcrumbNav
* fix(webui): complete and confirm file uploads on mobile and handle errors properly
* fix(webui): remove active scale animation on mobile FAB to stabilize dropdown menu anchor
* refactor(webui): use PresignedUrl type from dtos for uploadFiles and eliminate any cast
* fix(webui): scope folder card max width to desktop with responsive md:max-w-[340px]
* feat(transcode): add hardware-accelerated video transcoding support
* feat(transcode): use encoder quality modes and source-capped maxrate for video transcode
* fix(transcode): scale max bitrate for downsampled preview framerates
* fix(transcode): propagate videoBitRate in getMediaInfoActivity and update auto description
* feat(project): add recent viewed files section to project folder tree
* feat(webui): disable toolbar buttons and context menu in recents page
* test(core): optimize recents cap test execution time
* feat(webui): show hint text in recents page top toolbar
* feat(webui): rename recents section to Recently Viewed
* refactor(core): consolidate recents methods into AssetService
* fix(api): forward pagination parameters in folder children endpoint (#349)
* fix(project-recents): scope views and disable recents mutations
* fix(api): allow recent views in demo mode
* fix(api): limit demo recent view exception to post
* feat(auth): add admin password reset CLI command and reset password web UI
* fix(auth): invalidate previous reset tokens and use AsyncLocalStorage for link capture
* feat(kanban): allow editors to change task status and default reporter to creator
* fix(kanban): hide create task button for reviewers and eliminate duplicate error toast
* fix(webui): update sidebar selection styling, kanban active state, and pointer cursors
* feat(webui): move dashboard to left sidebar and prevent mount animation
* fix(e2e): update create-project test to click Home button in sidebar
* feat(kanban): implement AI-native kanban database models, services, and REST APIs
* feat(webui): implement team kanban board and task management
* style(webui): increase kanban dialog widths and form container
* fix(webui): ensure kanban dialogs override sm:max-w-lg base class
* style(webui): set edit task dialog max width to 5xl
* chore: untrack kanban plan markdown files
* feat(webui): update kanban page layout to 2 columns and refine task activity UI
* fix(webui): constrain kanban column and board heights for vertical scrolling
* feat(kanban): unify task status transition into updateTask API and allow unconstrained human task transitions
* fix(webui): add optimistic updates to kanban drag-and-drop to eliminate flash
* refactor(webui): remove client-side search box from kanban header
* feat(kanban): redesign task dialog comments area and add attachment support
* refactor(webui): remove top status action bar from task info dialog
* fix(webui): narrow query cache predicate and add defensive guards for kanban drag optimistic update
* feat(kanban): add drag-and-drop task reordering with fractional indexing (#331)
* feat(kanban): add drag-and-drop task reordering with fractional indexing
* fix(kanban): improve card drop zones, snap indicators, and column highlight
* fix(kanban): enable card droppables only during active drag
* fix(kanban): refine hover styles and drop indicators for column boundaries
* fix(kanban): unify bottom drop indicator and fix top indicator clipping
* fix(kanban): ensure full column highlight and full coverage drop target
* minor change
* feat(kanban): allow agent tasks free drag-and-drop and enforce status change permissions (#332)
* refactor(kanban): rename task_type_agentic translation keys to task_type_agent
* feat(kanban): refactor task type enum to isAgentTask boolean (#333)
* refactor(kanban): remove phase 2 agent execution logic and streamline phase 1 kanban
* feat(kanban): add notifications and audit logging for kanban (#334)
* feat(kanban): redesign config area layout and add parent tasks multi-selector (#335)
* feat(webui): redesign kanban task dialog config area
* feat(kanban): simplify task dependencies with parent tasks multi-selector
* refactor(kanban): remove unused links routes and legacy dependency methods
* feat(kanban): connect assets and kanban tasks with many-to-many relationship (#336)
* feat(kanban): connect assets and kanban tasks with many-to-many relationship
* feat(kanban): improve asset picker layout, infinite scrolling, and breadcrumb icon styling
* fix(kanban): ensure asset picker scrollarea is scrollable with min-h-0 and shrink-0 flex styling
* fix(kanban): hide recently deleted in folder tree picker and adjust header padding
* fix(kanban): use lucide files icon instead of paperclip for linked assets
* feat(kanban): improve task deletion, goal sidebar interaction, and card styling (#337)
* feat(kanban): improve task deletion, goal sidebar interaction, and card styling
* feat(kanban): move agent task badge after priority and update to orange style
* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions (#338)
* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions
* style(kanban): rotate kanban icon 180 degrees in sidebar and top nav
* style(kanban): remove rotate-180 from SquareKanban icons
* feat(kanban): add unassigned goal record and fix all tasks count (#339)
* feat(kanban): add unassigned goal record and fix all tasks count
* feat(kanban): toggle task count with three-dot action button on goal card hover
* fix(ci): pin bun version to 1.3.14 across CI and Docker (#340)
* fix(webui): truncate goal name to max 2 lines in kanban sidebar (#341)
* fix(quota): exclude agents from quota rules and usage records
* refactor(quota): remove agent_skill_call_count resource type and related logic
* chore(db): replace manual migration with prisma-generated migration
* feat(quota): add database-backed resource quota system
* feat(webui): add resource quota management in team settings (#319)
* feat(webui): add resource quota settings in team management
* refactor(webui): update quotas list to full row layout and restrict skill/mcp to select list
* feat(quota): refactor quota system to 2-level rules and records
* fix(webui): fix overflow and scroll area in quota usage records dialog
* fix(webui): ensure quota records scroll area has explicit max height
* feat(webui): improve quota cards interaction and restrict editable fields in edit mode
* fix(quota): serialize initial records, validate merged updates, and reset on dimension changes (#320)
* feat(quota): replace network quota with agent tools quota (#321)
* feat(webui): show remaining time until next refresh in quota usage records
* fix(webui): rename bash quota resource to Agent Bash Calls
* refactor(quota): remove unused reserved field from quota records
* refactor(quota): remove quota rule cache (#322)
* feat(authz): enforce project-aware roles for agent/skill/mcp permissions
Introduce a shared resolveEffectiveRole helper that mirrors AuthzService
precedence rules (projectMember.role override -> team role for team-scoped
members -> restricted), and route all agent/skill/mcp runtime permission
checks through it. Previously these checks used the raw teamMember.role,
which let project-only members execute team-level agents/skills/MCP tools
and ignored per-project role overrides.
Changes:
- authz: add resolveEffectiveRole(teamId, projectId, userId, db) and
refactor hasPermission to use it (behavior-preserving)
- chat/asset/agent-activity: gate agent usage by the effective project role
- read_skill: enforce skill permission via effective role (projectId
threaded from the agent session)
- mcp-service: checkPermission and buildAgentTools filter by effective
role; un-permitted servers' tools are no longer advertised to the model
- agent activity: only advertise skills the user's effective role permits
- listProjectMembers: filter included agent bots by the requester's
effective project role
- new GET /projects/:projectId/chat-agents API returning chat agents
scoped to the project and the user's effective role; WebUI chat selector
now uses it (settings keeps the team-level API)
- tests: effective-role resolver, chat/mention/MCP/skill project-role
matrices, listProjectChatAgents, listProjectMembers filter, API route
* fix(agent): forward projectId to getAgentChatContextActivity in agentChat workflow
The agentChat workflow called getAgentChatContextActivity without passing
projectId from the task payload, so project-scoped members (scope:
'project') resolved a null effective role in the activity and were denied
with 'Insufficient role to use agent' even though the chat selector and
chat.ts both authorized them. Forward payload.projectId so the activity
enforces the user's effective project role, and assert the forwarding in
the workflow unit test (fails without the fix).
* feat(agent): add permission controls for chat agents
* refactor(agent): extract shared agent permission helpers
Consolidate the duplicated role-hierarchy logic into
packages/core/src/agent/permissions.ts:
- getRoleLevel(): numeric level for a team role (fail closed at 0)
- getAgentRequiredLevel(): required level for an agent permission
(defaults to reviewer/1)
- getAllowedAgentRoles(): inclusive role set for filtering
The typed Record over TeamMemberRole makes the mapping exhaustive,
so adding a new role fails compilation until all sites are updated.
Used by ChatService.startOrContinueChat, AssetService comment
mentions, getAgentChatContextActivity, AgentService.listAgents, and
TeamService.getTeamMembers, replacing four inline copies of the
hierarchy and the allowed-roles conditionals.
Also fix the API permission-denial test to mock HTTPException(403)
and assert a 403 response instead of a generic Error/500, matching
real authzService behavior.
* test(agent): fix flaky comment DAG tests by spacing ULID id generation
ULID ids have 1ms timestamp granularity; back-to-back comment creates
frequently land in the same millisecond, in which case Prisma ULIDs sort
by their random suffix instead of creation order. The DAG spine in
initializeAgentSessionActivity chains top-level comments by id, so a
shuffled order produces paths that omit preceding comments, making the
path-to-root assertions flaky (~80% of full-file runs locally).
Add a 2ms sleep between consecutive comment creates in the affected
tests, guaranteeing strictly increasing ULID timestamps. A 2ms delay is
sufficient because the next create always fires at least 2ms after the
previous ULID was generated. Production is unaffected: real comments
arrive seconds apart via separate requests.
* feat(version-stack): add manage versions dialog and version removal
* fix(webui): remove ellipsis and add pointer cursor to manage versions button
* fix(version-stack): handle symlink deduplication and name sync for share links
* refactor(version-stack): extract shared symlink dedup helper
The 'repoint first symlink per share folder, delete duplicates with
fileCount decrement' logic was triplicated across createVersionStack,
reparentAssets, and reparentFileToFile with subtle variations. Extract
it into dedupeSymlinksToTarget() in packages/core/src/asset/symlink.ts
and call it from all three sites (behavior unchanged), with a dedicated
test suite covering the edge cases.
* feat(agent): add nested agents.md support across backend and webui
* fix(webui): update agentsmd route paths and unnest folder agentsmd route
* fix(agent): flush agents.md autosave on close and address review feedback
- Flush pending debounced AGENTS.md autosave on close/unmount so edits
made within 750ms of navigating away are no longer silently lost
- Serialize autosaves through a promise chain so an older in-flight
request can never overwrite newer content on the server
- Internationalize the hardcoded "Failed to save" and
"Loading AGENTS.md..." strings (en + zh)
- Validate that AGENTS.md is only stored on folder/root assets in
AssetService, preventing bogus virtual paths for file assets
- Cap updateAgentsMd content at 100k chars via Zod validation
- Remove unused getAgentsMd/updateAgentsMd response DTO schemas
- Drop unused teamId prop from AgentsMdEditor
- Add tests: non-folder asset rejection, oversized content 400,
and agent-chat workflow assetId passthrough
* refactor(db): isolate AGENTS.md content in dedicated 1:1 AssetAgentMd table
* style(webui): unify top bar button hover styles and add wand icon to agentsmd button
* style(webui): update agentsmd button state colors and remove presence dot
* fix(webui): fix close button overflow and stabilize debounced autosave in agentsmd editor
* fix(webui): update debounce to 1s and await pending save before closing agentsmd editor
* feat(webui): add terminal AGENTS.md breadcrumb on agentsmd editor page
* fix(webui): use ScrollArea for markdown editor scrolling
* feat(webui): replace legacy markdown editor with new lexical wysiwyg editor
* refactor(webui): organize markdown editor files into components/markdown-editor folder
* feat(webui): redesign select and multi-select metadata fields with search box and dynamic option creation
* fix(webui): stabilize select popover placement and preserve field visibility in store
* refactor(webui): enforce 2-row collapsed height and whitespace-pre-wrap on LongTextField
* feat(agent): support dynamic newOption in select and selectMulti metadata fields
* fix(metadata): address code review feedback on selectMulti item validation and WebUI option deduplication
* feat(webui): redesign select and multi-select metadata fields with search box and dynamic option creation
* fix(webui): stabilize select popover placement and preserve field visibility in store
* refactor(webui): enforce 2-row collapsed height and whitespace-pre-wrap on LongTextField
* feat(agent): type-safe CREATION_CONTEXT metadata on create_file/create_version
Build the create_file and create_version tool metadata parameter from the
project's CREATION_CONTEXT fields at harness creation time, instead of the
schemaless key-value map that required the agent to call list_autofill_fields
first.
- Thread projectId from the chat workflow into createAgentSession and build
a strict, all-required (nullable) metadata schema via fieldsToTypeBoxSchema
(additionalProperties: false, option IDs enforced via enum).
- Remove the list_autofill_fields tool and its activity case.
- Reject metadata keys that are not CREATION_CONTEXT fields of the target
project with a clear non-retryable error telling the agent to omit metadata.
- Skip null metadata values when persisting (create_file/create_version and
the autofill workflow).
- Switch the touched schemas from @sinclair/typebox 0.34 to typebox v1 to
match the harness validator.
* refactor(agent): migrate remaining tools from @sinclair/typebox 0.34 to typebox v1
All agent tool schemas now use the same typebox v1 package as the harness
validator; drop the @sinclair/typebox 0.34 dependency from @shumai/agent.
* test(agent): reproduce null coercion in harness tool validation
The pi-ai harness (<=0.82.1) coerces null values in [string, null] unions to
'' during tool argument validation for typebox v1 schemas. A valid create_file
call with path: null + data: {...} therefore arrives at execute with path: ''
and fails with 'Provide exactly one of path or data'. Null metadata values
(the 'unknown' sentinel) are likewise turned into ''.
This test reproduces both failures. It is expected to fail until
@earendil-works/pi-ai is upgraded to >=0.84.0 (#7328), which preserves values
that already match a union arm.
* fix(agent): patch pi-ai 0.82.1 to preserve null in nullable union tool args
Apply the upstream fix for earendil-works/pi#7328 (PR #7373) via a bun
patch instead of upgrading pi-ai. coerceWithUnionSchema now returns the
original value when it already validates against any union member,
instead of coercing null in [string, null] unions into "".
Fixes the create_file false "Provide exactly one of path or data" error
when the model passes path: null with data. Reproduced by
packages/agent/src/reproduce-tool-null-coercion.test.ts, which now passes.
* fix(docker): copy bun patch dir before frozen-lockfile install
The pi-ai patchedDependencies entry makes bun install --frozen-lockfile
fail in the builder stage because patches/ was not present in the image
yet. Copy it alongside package.json/bun.lock so the patch applies.
* refactor(agent): simplify metadata guidance in system prompt and error message
Shorten the create_file/create_version metadata instructions in the system
prompt and reword the invalid-metadata-key error to not reference
CREATION_CONTEXT internals. Update the matching test assertion.
* feat(metadata): replace aiAutofill boolean with autofillSource enum
* fix(agent): validate creation-context metadata and make writes transactional
Address code review feedback on the autofillSource migration:
- Update the agent system prompt to reference the 'metadata' parameter of
create_file/create_version instead of the removed 'context' parameter,
which was being silently discarded by the activity
- Write metadata inside the caller's transaction via the new
metadataService.updateAssetMetadataInTx, keeping metadata rows atomic
with asset creation instead of opening a separate non-atomic transaction
- Reject metadata keys that are not defined CREATION_CONTEXT fields of the
project with a non-retryable ApplicationFailure before creating the asset
- Remove dead agentContext handling from autofillAiActivity and its tests,
and drop the unused ai_autofill i18n keys (paraglide recompiled)
- Derive the DTO autofillSource enum from the AutofillSource const instead
of a hardcoded z.enum to prevent drift
* docs(mcp): add MCP support documentation
* docs(readme): simplify MCP feature description
* docs(mcp): fix inaccuracies in MCP servers documentation
- Clarify that discovery runs on refresh, OAuth completion, or first
tool call, not automatically at server creation
- Note that advanced settings (transport, auth, permission, direct
tools) are configured in the edit dialog after creation
- Correct agent assignment UI description: switch toggle, not checkbox
* docs(mcp): explain proxy vs direct tool configuration
Add a dedicated section covering the three tool states (Off / Proxy /
Direct), what the mcp proxy tool does and why it exists, and when and
why to use direct tools, including the context-token trade-off.
* feat(webui): render pdf pages via live canvas with selectable text
Replace the rasterize-to-PNG pipeline in the PDF viewer with direct
canvas rendering that tracks the current zoom, so text stays crisp when
zoomed in, and overlay a pdf.js TextLayer that makes text natively
selectable when not in draw mode.
- pdf-viewer: render pages onto a live canvas at a zoom-proportional
scale (debounced, memory-capped) instead of a fixed 2x PNG snapshot
- pdf-viewer: add pdf.js TextLayer overlay per page, transformed in
lockstep with the Konva stage so spans stay aligned while panning
and zooming
- drawing-canvas: accept an optional live canvas element and force a
layer redraw when it is swapped
- add text-layer.css with the minimal pdf.js text layer styles
- add e2e spec verifying text selection in view mode and that draw
mode routes drags to the canvas
* fix(webui): show pdf text selection highlight above the page canvas
The pdf.js text layer was stacked below the opaque Konva page canvas, so
the native selection highlight was painted underneath it and invisible
(selection itself worked). Move the overlay above the canvas and gate its
pointer-events on draw mode: auto when not drawing (select text), none in
draw mode so drags reach the Konva stage below (draw markup).
Verified with screenshot pixel analysis: the selected region now renders
the highlight (blue) where it was pure grayscale before.
* fix(webui): transparent selection background for pdf text layer br elements
* fix(webui): stop pdf text selection over-selecting in empty space
The text layer container was user-selectable (user-select: auto), so when
a drag's caret moved into empty space Chromium targeted the container and
extended the selection to a container-content boundary, selecting across
rows (e.g. dragging from line 1 into the gap selected lines 1-2).
Make the container user-select: none while keeping the text spans
user-select: text, so the caret clamps to the nearest selectable text and
the selection stays put when dragging into empty space.
* fix(webui): deselect pdf text when clicking empty space
With user-select: none on the text layer container, Chromium no longer
clears the selection when clicking non-selectable areas. Clear it manually
on mousedown over the container or <br> (not a text span) so clicking
empty space between lines or outside text deselects, matching native
behavior.
* fix(webui): add content-only pinch-zoom and two-finger pan to media viewers
Intercept trackpad pinch (ctrl+wheel), touchscreen pinch (two touches),
and two-finger move inside the image, video, and PDF viewers so they
transform only the media content instead of triggering browser page
zoom (matching Frame.io behavior).
- New shared pan-zoom math (zoomAtPoint, fitScale, isZoomed) and a
usePanZoomGestures hook using native non-passive wheel/touch listeners
with touch-action: none on the media container.
- Plain wheel / two-finger scroll pans the content, but only once the
user has zoomed in; drag-pan is gated the same way.
- Image and PDF viewers no longer reset zoom to fit on container resizes
while the user has manually zoomed (matches the video viewer).
- DrawingCanvas ignores multi-touch moves so single-pointer pan/draw
doesn't fight the pinch handler; the video viewer keeps play/pause on
the container div to avoid double-toggling when the overlay is active.
Includes unit tests for the pan-zoom math.
* fix(webui): disable click-drag pan for pdf and video viewers
When zoomed, PDF and video previously panned on left-button (or
single-finger touch) drag via the shared DrawingCanvas. That conflicts
with left-click semantics: PDF wants the drag for text selection and
video reserves the click for play/pause.
Remove the gated onPan from both viewers so the Konva overlay stays
pointer-events:none when not drawing - clicks pass straight through
(video click-to-play now works cleanly at any zoom) - while panning
remains available via mouse wheel and two-finger gestures. Image keeps
drag-pan.