feat(files): advanced agent file management — editor, import, proposals in chat (CLEAN-112) - #110
Merged
maksymhryzodub-prog merged 9 commits intoSep 24, 2026
Conversation
API: kind/editable classification, UTF-8-safe slices, createOnly/ifUnmodifiedSince saves, bulk delete/export bodies, limits route, open-link JWT + hardened raw stream, workspace archive service and import routes. Admin: Monaco editor (lazy, client-only), auto-loading slices, tabs and drafts in the store, Open full, binary panel, save-conflict dialog. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… file tools (CLEAN-112) API: FileChangeProposal model + migration, proposal service with capped diffs, proposal routes, bridle proposal/proposal_update events, transcript carries proposals; list/read/write/create/import tools with confirm-by-proposalId. Admin: import dialog (stage → plan → merge/replace → result), proposal store and data layer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tion and tabs (CLEAN-112) Admin: proposal store, ProposalCard with bounded inline diff and Apply / Edit before applying / Skip, transcript merge, ?proposal= editor flow with side-by-side DiffView, Explorer (filter, checkboxes, size/modified, bulk download/delete), New file, tabs util. App: read-only ProposalCard, store and mapper handlers, en/ru strings. Rancher's direct file tools move to the file slice behind proposals; docs/agent-tools.md records the confirm-by-proposal convention. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…EAN-112) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…by link (CLEAN-112) The private-range check resolved the host once and fetch resolved it again, which a DNS-rebinding host could split. The download now connects to the address that passed the check, refuses redirects and credentials in the link, and still validates TLS against the hostname. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Wider explorer column (360-420px, 460px on xl), narrower size/date columns, tighter indent steps, full path on folder hover. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An agent with the Owner role could PUT/DELETE files or apply an import over REST with its own token and skip the proposal card. Those routes now answer 403 to agent tokens and point at write_agent_file / create_agent_file / import_agent_files; people at the console are unaffected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…in specs (CLEAN-112) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: CLEAN-112
[ADMIN][APP]Spec:
specs/017-advanced-file-management/(spec, plan, research, data-model, contracts, quickstart, tasks)What changes
Files tab (admin)
text/plainwithnosniff+CSP: sandbox(never renders agent-written HTML/JS on the API origin).Ctrl/⌘+S, Ln/Col, drafts and tabs kept in the store, 412 conflict dialog on save.sessions/skipped unless included, result + Restart now / Later.⌘P), size/modified columns, checkboxes with bulk Download / Delete (refuses to empty the workspace without a second ack), New file, tabs with unsaved dots, "Agent copy is newer — Sync now" pill.Agent tools (api) — topic Agent workspace:
list_agent_files,read_agent_file,write_agent_file,create_agent_file,import_agent_files. Writes are confirm-by-proposal: the first call creates aFileChangeProposaland writes nothing; the confirming call carriesconfirm: trueand theproposalId. The direct list/read/write tools inrancher.tool.tsare removed (the file slice owns them now). Documented indocs/agent-tools.md.Chat cards (bridle, admin + app) — new hub→browser events
proposal/proposal_updatepublished by the API into the active turn (CLEAN-74 pattern, no runtime change); the transcript endpoint returnsproposalsfor reload. Admin card: inline diff, Apply / Edit before applying / Skip,?proposal=editor flow with side-by-side diff, Restart now / Later. App card: read-only twin, strings inen.json+ generatedru.json.Limits live in one module (
file.limits.ts, envRANCH_FILES_*) and are served byGET /agents/:id/files/limits: inline diff ≤ 200 changed lines / 100 KB, no diff above 1 MiB, set cards list ≤ 50 rows, archives ≤ 100 MB / 2000 entries / 25 MB per file.Twin consoles
bridle: touched in both consoles (admin renders the actionable card; app renders the same card read-only — the write tools are operator-only and the app has no Files tab).templateFilekeeps its own plain viewer.Data
FileChangeProposal+ migration20260923140000_file_change_proposal(additive, cascades with the agent).imports/<agentId>/<importId>.zip(staged archives, swept after 60 min) andproposals/<id>/content.Verification
jest src/slices/agent/file src/slices/bridle src/slices/mcp— 404 tests green (incl. the boot-time tool metadata contract);tscclean.bun test slices65 green;nuxt typecheckclean;nuxt buildOK — Monaco is in its own chunks (core 2.65 MB + LSP client 1.17 MB + per-language workers, TS worker 6.9 MB) and is onlyimport()ed from the Files-tab chunk.bun test slices+nuxt typecheckclean;bun run i18n:checkin sync.specs/017-advanced-file-management/quickstart.mdlists each step.Tools checklist (docs/agent-tools.md)
destructive: true+confirmon write/create/importIFileGateway,WorkspaceArchiveService,FileProposalService)file.tool.spec.ts,file.tool.proposals.spec.ts)import_agent_filessays so🤖 Generated with Claude Code