fix(artifacts): render artifacts from the checked path and serve raw files once

- show_artifact returns the validated path as tool metadata; the chat card
  renders from it and maps repo paths with getWorkspaceFilePath, so local
  repos and moved sessions load the right file
- serve .htm as text/html
- raw file route stats and reads once and adds ETag/Last-Modified with 304
- reuse isPathWithinRoot from utils/fs-safe
- move readShowArtifactCall to frontend/src/lib/artifactTool
This commit is contained in:
Chris Scott committed 2026-10-12 16:43:04 -04:00
1 parent f7b2ffb865
commit 5e2452172c
26 files changed
+489 -58

No files matched your search

@@ -310,7 +310,7 @@ describe('ocm-manager plugin', () => {
expect(result.content).toBe(
'Showing the artifact "Formation odds" from /workspace/repos/app/report.html in the Manager chat. It renders the current file contents, so after editing the file the user can reload the view; call show_artifact again only to show a different file.',
)
expect(result.metadata).toBeUndefined()
expect(result.metadata).toEqual({ path: '/workspace/repos/app/report.html' })
})
it('surfaces the resolve error when the artifact path is rejected', async () => {