mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
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:
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 () => {
|
||||
|
||||
Reference in new issue
Block a user