feat(asset-read): rewrite read_asset as a reader registry and Operations (#498)

Replace the monolithic agent read_asset tool with a reader registry in
@shumai/core/src/asset-read (model3d, image, video, document) behind a
shared pipeline that handles access checks, version stacks, annotations,
render tasks, and waiting.

- Add read_asset and get_asset_render Operations (agent surface only).
  Renders that outlast the caller's wait budget return "pending" with the
  workflow task ID; the read request is stored on the task payload so
  get_asset_render works across restarts and instances (requester only).
- Add workflowService.waitFor and presign expiry support.
- Keep agent output compatible via an agent tool extension (s3KeyOnly,
  image blocks, session image details); autofill keeps its team-scoped tool.
- Cap video frames at 20 per call; add the get_asset_render agent toggle.
This commit is contained in:
Yiling-J
2026-10-27 08:09:10 +08:00
committed by GitHub
parent e44938cb8f
commit 155fb95a0e
40 changed files with 3787 additions and 2229 deletions
+3 -1
View File
@@ -61,7 +61,7 @@ describe('operation-backed agent tools', () => {
})
describe('tool definitions', () => {
it('keeps the existing tool names and adds list_projects', () => {
it('keeps the existing tool names and adds list_projects and get_asset_render', () => {
expect(
buildOperationTools(ctx)
.map((t) => t.name)
@@ -69,9 +69,11 @@ describe('operation-backed agent tools', () => {
).toEqual([
'create_folder',
'delete_asset',
'get_asset_render',
'list_assets',
'list_projects',
'move_assets',
'read_asset',
'rename_asset',
])
})