mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user