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

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
2026-10-26 15:07:10 +08:00
parent d904395202
commit 4581058e0d
40 changed files with 3787 additions and 2229 deletions
+17
View File
@@ -359,10 +359,27 @@ declare global {
screenshot?: ScreenshotSpec
imageAnnotation?: ImageAnnotationSpec
pdfPages?: PdfPagesSpec
/** Render that produced this result, if any (set by the read_asset pipeline). */
assetRead?: AssetReadRequest
watermark?: WatermarkTaskPayload
recoveryAttempts?: number
}
/**
* Records which reader started a render so the read can be completed later from the task
* alone (see `get_asset_render`), on any server instance.
*/
export interface AssetReadRequest {
reader: 'model3d' | 'image' | 'video' | 'document'
/** The reader's validated options. */
options?: Record<string, unknown>
annotationId?: string
/** Reader-private values computed while planning (e.g. the resolved 3D angle). */
context?: Record<string, unknown>
/** User who requested the read; undefined for system agents (autofill). */
requestedBy?: string
}
export interface WorkflowTaskOutput {
error?: string
recoveryAttempts?: number