Skip to content

feat(amicode): file-reference resolution — click file paths in chat to open in editor - #143

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
aaron/file-resolve-clean
Aug 8, 2026
Merged

jeonghun-jj-lee merged 1 commit into
local/amicodefrom
aaron/file-resolve-clean

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Resolves relative paths against vault mounts (first-hit precedence). Extracts and rewrites file references in markdown responses. Skill chips, read-tool loaded-file rows, and edit/write trigger filenames are now clickable (open in editor via the VS Code bridge).

Server

GET /amicode/resolve-file?path=<text> — resolves path-like strings to absolute on-disk paths. Tiers: absolute → ~ → mount-prefixed → relative first-hit → typed-prefix bare filenames. Same loopback gate as the vault browser; resolves only, never reads.

Refactors scanMounts into a structured listMounts() (returns {id, kind, writable, dir}[]) that the resolver walks for first-hit resolution.

Client

markdown-file-refs.ts — app-injected resolver registry with bounded (500, FIFO) cache and in-flight dedupe. Transient fetch failures stay uncached so the next render retries.

markFileLinks() in markdown.tsx — wraps resolved path-pills in file:// anchors and rewrites dead relative authored links. Gated on data-new-layout.

Wiring

  • AmicodeFileRefBridge mounted in SelectedServerProviders — registers the resolver per-call via pickVaultServer
  • OpenableFilename in tool cards — edit/write/read filenames are clickable buttons
  • AmicoSkillChip gains path prop — opens SKILL.md source on click
  • openFileInEditor(abs) bridge posts to the VS Code extension host

Tests

  • amicode-file-resolve.test.ts: 9 pass
  • markdown-file-refs.test.ts: 5 pass
  • Full turbo typecheck: 30/30 packages clean

Co-authored-by: Aaron Trowbridge aaron.j.trowbridge@gmail.com

…o open in editor

Resolves relative paths against vault mounts (first-hit precedence).
Extracts and rewrites file references in markdown responses.
Skill chips, read-tool loaded-file rows, and edit/write trigger
filenames are now clickable (open in editor via the VS Code bridge).

Server: GET /amicode/resolve-file resolves path-like strings to
absolute on-disk paths (tiers: absolute → ~ → mount-prefixed →
relative first-hit → typed-prefix bare filenames). Same loopback
gate as the vault browser.

Client: markdown-file-refs.ts provides an app-injected resolver
registry with bounded (500, FIFO) cache and in-flight dedupe.
markFileLinks() in markdown.tsx wraps resolved path-pills in
file:// anchors and rewrites dead relative authored links.

Co-authored-by: Aaron Trowbridge <aaron.j.trowbridge@gmail.com>
@jeonghun-jj-lee
jeonghun-jj-lee merged commit c1e4862 into local/amicode Aug 8, 2026
1 of 4 checks passed
jeonghun-jj-lee added a commit that referenced this pull request Aug 12, 2026
…micode#349) (#191)

The file-reference resolution feature (PR #143, c1e4862) accidentally
removed the [data-slot="question-text-form"] CSS rules that gave the
kind:"text" question textarea its border, background, radius, and
min-height. Without them the textarea renders transparent and borderless
— effectively invisible to the user.

Restores the two rule blocks (v2 design tokens + legacy compat) and adds
a regression test that asserts the selectors remain present.

Closes harmoniqs/amicode#349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant