@escapeaihq/client-core 0.8.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -4
- package/dist/adapters/capabilities.d.ts +10 -0
- package/dist/adapters/capabilities.d.ts.map +1 -0
- package/dist/adapters/capabilities.js +2 -0
- package/dist/adapters/capabilities.js.map +1 -0
- package/dist/adapters/chatAdapter.d.ts +38 -0
- package/dist/adapters/chatAdapter.d.ts.map +1 -0
- package/dist/adapters/chatAdapter.js +88 -0
- package/dist/adapters/chatAdapter.js.map +1 -0
- package/dist/adapters/directorAdapter.d.ts +62 -0
- package/dist/adapters/directorAdapter.d.ts.map +1 -0
- package/dist/adapters/directorAdapter.js +71 -0
- package/dist/adapters/directorAdapter.js.map +1 -0
- package/dist/adapters/imageAdapter.d.ts +44 -0
- package/dist/adapters/imageAdapter.d.ts.map +1 -0
- package/dist/adapters/imageAdapter.js +73 -0
- package/dist/adapters/imageAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +47 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +41 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/registry.d.ts +98 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +106 -0
- package/dist/adapters/registry.js.map +1 -0
- package/dist/adapters/worldAdapter.d.ts +142 -0
- package/dist/adapters/worldAdapter.d.ts.map +1 -0
- package/dist/adapters/worldAdapter.js +164 -0
- package/dist/adapters/worldAdapter.js.map +1 -0
- package/dist/admin.d.ts +200 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +124 -0
- package/dist/admin.js.map +1 -0
- package/dist/api.d.ts +1299 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +683 -95
- package/dist/api.js.map +1 -1
- package/dist/audio.d.ts +33 -1
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +4 -1
- package/dist/audio.js.map +1 -1
- package/dist/castProjection.d.ts +35 -0
- package/dist/castProjection.d.ts.map +1 -0
- package/dist/castProjection.js +80 -0
- package/dist/castProjection.js.map +1 -0
- package/dist/conversation/binding.d.ts +62 -0
- package/dist/conversation/binding.d.ts.map +1 -0
- package/dist/conversation/binding.js +51 -0
- package/dist/conversation/binding.js.map +1 -0
- package/dist/conversation/controller.d.ts +209 -0
- package/dist/conversation/controller.d.ts.map +1 -0
- package/dist/conversation/controller.js +342 -0
- package/dist/conversation/controller.js.map +1 -0
- package/dist/conversation/effectiveModel.d.ts +62 -0
- package/dist/conversation/effectiveModel.d.ts.map +1 -0
- package/dist/conversation/effectiveModel.js +73 -0
- package/dist/conversation/effectiveModel.js.map +1 -0
- package/dist/conversation/index.d.ts +27 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/index.js +27 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/conversation/participant.d.ts +66 -0
- package/dist/conversation/participant.d.ts.map +1 -0
- package/dist/conversation/participant.js +36 -0
- package/dist/conversation/participant.js.map +1 -0
- package/dist/conversation/presence.d.ts +56 -0
- package/dist/conversation/presence.d.ts.map +1 -0
- package/dist/conversation/presence.js +34 -0
- package/dist/conversation/presence.js.map +1 -0
- package/dist/conversation/presenceBus.d.ts +42 -0
- package/dist/conversation/presenceBus.d.ts.map +1 -0
- package/dist/conversation/presenceBus.js +81 -0
- package/dist/conversation/presenceBus.js.map +1 -0
- package/dist/conversation/presenceRegistry.d.ts +49 -0
- package/dist/conversation/presenceRegistry.d.ts.map +1 -0
- package/dist/conversation/presenceRegistry.js +59 -0
- package/dist/conversation/presenceRegistry.js.map +1 -0
- package/dist/conversation/roster.d.ts +72 -0
- package/dist/conversation/roster.d.ts.map +1 -0
- package/dist/conversation/roster.js +69 -0
- package/dist/conversation/roster.js.map +1 -0
- package/dist/conversation/rosterProjection.d.ts +52 -0
- package/dist/conversation/rosterProjection.d.ts.map +1 -0
- package/dist/conversation/rosterProjection.js +74 -0
- package/dist/conversation/rosterProjection.js.map +1 -0
- package/dist/conversation/router.d.ts +74 -0
- package/dist/conversation/router.d.ts.map +1 -0
- package/dist/conversation/router.js +58 -0
- package/dist/conversation/router.js.map +1 -0
- package/dist/conversation/runtime.d.ts +64 -0
- package/dist/conversation/runtime.d.ts.map +1 -0
- package/dist/conversation/runtime.js +172 -0
- package/dist/conversation/runtime.js.map +1 -0
- package/dist/conversation/types.d.ts +99 -0
- package/dist/conversation/types.d.ts.map +1 -0
- package/dist/conversation/types.js +13 -0
- package/dist/conversation/types.js.map +1 -0
- package/dist/conversation/voice.d.ts +185 -0
- package/dist/conversation/voice.d.ts.map +1 -0
- package/dist/conversation/voice.js +307 -0
- package/dist/conversation/voice.js.map +1 -0
- package/dist/graphSchema.d.ts +260 -0
- package/dist/graphSchema.d.ts.map +1 -0
- package/dist/graphSchema.js +354 -0
- package/dist/graphSchema.js.map +1 -0
- package/dist/http.d.ts +20 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +57 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/platformAssistant.d.ts +155 -0
- package/dist/platformAssistant.d.ts.map +1 -0
- package/dist/platformAssistant.js +256 -0
- package/dist/platformAssistant.js.map +1 -0
- package/dist/reactor/abortUtils.d.ts +16 -0
- package/dist/reactor/abortUtils.d.ts.map +1 -0
- package/dist/reactor/abortUtils.js +26 -0
- package/dist/reactor/abortUtils.js.map +1 -0
- package/dist/reactor/applyScenePrompt.d.ts +75 -0
- package/dist/reactor/applyScenePrompt.d.ts.map +1 -0
- package/dist/reactor/applyScenePrompt.js +60 -0
- package/dist/reactor/applyScenePrompt.js.map +1 -0
- package/dist/reactor/chunkDistribution.d.ts +43 -0
- package/dist/reactor/chunkDistribution.d.ts.map +1 -0
- package/dist/reactor/chunkDistribution.js +85 -0
- package/dist/reactor/chunkDistribution.js.map +1 -0
- package/dist/reactor/heliosCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/heliosCommandDispatcher.js +10 -15
- package/dist/reactor/heliosCommandDispatcher.js.map +1 -1
- package/dist/reactor/index.d.ts +4 -0
- package/dist/reactor/index.d.ts.map +1 -1
- package/dist/reactor/index.js +7 -0
- package/dist/reactor/index.js.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.d.ts +103 -0
- package/dist/reactor/longLiveCommandDispatcher.d.ts.map +1 -0
- package/dist/reactor/longLiveCommandDispatcher.js +87 -0
- package/dist/reactor/longLiveCommandDispatcher.js.map +1 -0
- package/dist/reactor/sceneEntry.d.ts +40 -6
- package/dist/reactor/sceneEntry.d.ts.map +1 -1
- package/dist/reactor/sceneEntry.js +63 -24
- package/dist/reactor/sceneEntry.js.map +1 -1
- package/dist/reactor/scenesFromEnrichment.d.ts.map +1 -1
- package/dist/reactor/scenesFromEnrichment.js +2 -66
- package/dist/reactor/scenesFromEnrichment.js.map +1 -1
- package/dist/reactor/seedImageOrchestrator.d.ts +42 -2
- package/dist/reactor/seedImageOrchestrator.d.ts.map +1 -1
- package/dist/reactor/seedImageOrchestrator.js +173 -4
- package/dist/reactor/seedImageOrchestrator.js.map +1 -1
- package/dist/reactor/storyTimeline.d.ts +44 -0
- package/dist/reactor/storyTimeline.d.ts.map +1 -0
- package/dist/reactor/storyTimeline.js +95 -0
- package/dist/reactor/storyTimeline.js.map +1 -0
- package/dist/storyGraph.d.ts +70 -0
- package/dist/storyGraph.d.ts.map +1 -0
- package/dist/storyGraph.js +178 -0
- package/dist/storyGraph.js.map +1 -0
- package/dist/timeFormat.d.ts +10 -0
- package/dist/timeFormat.d.ts.map +1 -1
- package/dist/timeFormat.js +12 -0
- package/dist/timeFormat.js.map +1 -1
- package/dist/toolSchemas.d.ts +370 -0
- package/dist/toolSchemas.d.ts.map +1 -0
- package/dist/toolSchemas.js +182 -0
- package/dist/toolSchemas.js.map +1 -0
- package/dist/vision/VisionPublisher.d.ts +115 -0
- package/dist/vision/VisionPublisher.d.ts.map +1 -0
- package/dist/vision/VisionPublisher.js +475 -0
- package/dist/vision/VisionPublisher.js.map +1 -0
- package/dist/vision/VisionSourceController.d.ts +127 -0
- package/dist/vision/VisionSourceController.d.ts.map +1 -0
- package/dist/vision/VisionSourceController.js +284 -0
- package/dist/vision/VisionSourceController.js.map +1 -0
- package/dist/vision/credentials.d.ts +22 -0
- package/dist/vision/credentials.d.ts.map +1 -0
- package/dist/vision/credentials.js +34 -0
- package/dist/vision/credentials.js.map +1 -0
- package/dist/vision/index.d.ts +18 -0
- package/dist/vision/index.d.ts.map +1 -0
- package/dist/vision/index.js +13 -0
- package/dist/vision/index.js.map +1 -0
- package/dist/vision/sourceKinds.d.ts +65 -0
- package/dist/vision/sourceKinds.d.ts.map +1 -0
- package/dist/vision/sourceKinds.js +26 -0
- package/dist/vision/sourceKinds.js.map +1 -0
- package/dist/vision/startVisionPublisher.d.ts +38 -0
- package/dist/vision/startVisionPublisher.d.ts.map +1 -0
- package/dist/vision/startVisionPublisher.js +44 -0
- package/dist/vision/startVisionPublisher.js.map +1 -0
- package/dist/vision/types.d.ts +95 -0
- package/dist/vision/types.d.ts.map +1 -0
- package/dist/vision/types.js +12 -0
- package/dist/vision/types.js.map +1 -0
- package/dist/vision/visionScheduler.d.ts +63 -0
- package/dist/vision/visionScheduler.d.ts.map +1 -0
- package/dist/vision/visionScheduler.js +67 -0
- package/dist/vision/visionScheduler.js.map +1 -0
- package/dist/websocket.d.ts +195 -0
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +179 -1
- package/dist/websocket.js.map +1 -1
- package/package.json +11 -1
- package/src/__tests__/adapters-capabilities.test.ts +46 -0
- package/src/__tests__/adapters-chat.test.ts +172 -0
- package/src/__tests__/adapters-director.test.ts +95 -0
- package/src/__tests__/adapters-image.test.ts +133 -0
- package/src/__tests__/adapters-platform.test.ts +95 -0
- package/src/__tests__/adapters-registry.test.ts +189 -0
- package/src/__tests__/adapters-world.test.ts +296 -0
- package/src/__tests__/admin.test.ts +312 -0
- package/src/__tests__/adventures-party.test.ts +219 -0
- package/src/__tests__/adventures.test.ts +282 -0
- package/src/__tests__/api-pollers.test.ts +104 -0
- package/src/__tests__/api.clip-lookup.test.ts +64 -0
- package/src/__tests__/api.list-images-filters.test.ts +103 -0
- package/src/__tests__/api.test.ts +470 -0
- package/src/__tests__/audio.test.ts +65 -0
- package/src/__tests__/cast.test.ts +95 -0
- package/src/__tests__/castProjection.test.ts +167 -0
- package/src/__tests__/chat-auth.test.ts +91 -0
- package/src/__tests__/conversation/controller.test.ts +697 -0
- package/src/__tests__/conversation/effectiveModel.test.ts +169 -0
- package/src/__tests__/conversation/headlessRenderer.ts +46 -0
- package/src/__tests__/conversation/presenceBus.test.ts +236 -0
- package/src/__tests__/conversation/presenceRegistry.test.ts +73 -0
- package/src/__tests__/conversation/roster.test.ts +100 -0
- package/src/__tests__/conversation/rosterProjection.test.ts +142 -0
- package/src/__tests__/conversation/router.test.ts +81 -0
- package/src/__tests__/conversation/runtime.test.ts +206 -0
- package/src/__tests__/conversation/voice.test.ts +440 -0
- package/src/__tests__/documents.test.ts +360 -0
- package/src/__tests__/graphSchema.test.ts +326 -0
- package/src/__tests__/longLiveCommandDispatcher.test.ts +185 -0
- package/src/__tests__/platformAssistant.test.ts +484 -0
- package/src/__tests__/reactor/applyScenePrompt.test.ts +192 -0
- package/src/__tests__/reactor/heliosCommandDispatcher.test.ts +4 -3
- package/src/__tests__/reactor/sceneEntry.test.ts +134 -10
- package/src/__tests__/reactor/seedImageOrchestrator.test.ts +51 -16
- package/src/__tests__/reactor/storyTimeline.test.ts +186 -0
- package/src/__tests__/regeneration.test.ts +486 -0
- package/src/__tests__/stories.test.ts +171 -0
- package/src/__tests__/storyGraph.test.ts +134 -0
- package/src/__tests__/timeFormat.test.ts +22 -1
- package/src/__tests__/toolSchemas.test.ts +57 -0
- package/src/__tests__/tools-wrappers.test.ts +272 -0
- package/src/__tests__/videoGraph.test.ts +94 -0
- package/src/__tests__/websocket-vision.test.ts +265 -0
- package/src/__tests__/websocket.test.ts +213 -0
- package/src/adapters/capabilities.ts +24 -0
- package/src/adapters/chatAdapter.ts +114 -0
- package/src/adapters/directorAdapter.ts +126 -0
- package/src/adapters/imageAdapter.ts +100 -0
- package/src/adapters/index.ts +67 -0
- package/src/adapters/registry.ts +159 -0
- package/src/adapters/worldAdapter.ts +272 -0
- package/src/admin.ts +310 -0
- package/src/api.ts +1890 -162
- package/src/audio.ts +35 -0
- package/src/castProjection.ts +95 -0
- package/src/conversation/binding.ts +81 -0
- package/src/conversation/controller.ts +439 -0
- package/src/conversation/effectiveModel.ts +111 -0
- package/src/conversation/index.ts +27 -0
- package/src/conversation/participant.ts +71 -0
- package/src/conversation/presence.ts +60 -0
- package/src/conversation/presenceBus.ts +109 -0
- package/src/conversation/presenceRegistry.ts +83 -0
- package/src/conversation/roster.ts +111 -0
- package/src/conversation/rosterProjection.ts +98 -0
- package/src/conversation/router.ts +96 -0
- package/src/conversation/runtime.ts +188 -0
- package/src/conversation/types.ts +100 -0
- package/src/conversation/voice.ts +402 -0
- package/src/graphSchema.ts +532 -0
- package/src/http.ts +72 -0
- package/src/index.ts +12 -0
- package/src/platformAssistant.ts +347 -0
- package/src/reactor/abortUtils.ts +22 -0
- package/src/reactor/applyScenePrompt.ts +136 -0
- package/src/reactor/chunkDistribution.ts +98 -0
- package/src/reactor/heliosCommandDispatcher.ts +10 -18
- package/src/reactor/index.ts +7 -0
- package/src/reactor/longLiveCommandDispatcher.ts +156 -0
- package/src/reactor/sceneEntry.ts +104 -33
- package/src/reactor/scenesFromEnrichment.ts +11 -76
- package/src/reactor/seedImageOrchestrator.ts +200 -4
- package/src/reactor/storyTimeline.ts +127 -0
- package/src/storyGraph.ts +298 -0
- package/src/timeFormat.ts +13 -0
- package/src/toolSchemas.ts +225 -0
- package/src/vision/VisionPublisher.ts +553 -0
- package/src/vision/VisionSourceController.ts +354 -0
- package/src/vision/__tests__/VisionPublisher.kvs.test.ts +244 -0
- package/src/vision/__tests__/VisionPublisher.test.ts +301 -0
- package/src/vision/__tests__/VisionSourceController.test.ts +719 -0
- package/src/vision/__tests__/startVisionPublisher.test.ts +251 -0
- package/src/vision/__tests__/toVisionRtcCredentials.test.ts +113 -0
- package/src/vision/__tests__/visionScheduler.test.ts +149 -0
- package/src/vision/credentials.ts +39 -0
- package/src/vision/index.ts +44 -0
- package/src/vision/sourceKinds.ts +75 -0
- package/src/vision/startVisionPublisher.ts +64 -0
- package/src/vision/types.ts +101 -0
- package/src/vision/visionScheduler.ts +102 -0
- package/src/websocket.ts +334 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent tool-schema TypeScript mirror.
|
|
3
|
+
*
|
|
4
|
+
* This is the framework-agnostic TS view of the SERVER-SIDE RAG tool
|
|
5
|
+
* vocabulary whose canonical (single-source-of-truth) definition lives in
|
|
6
|
+
* the backend at `shared/tool_schemas.py` (Agent OS Phase 5 / P3). The Python
|
|
7
|
+
* module derives Bedrock Converse tool specs from Pydantic request models;
|
|
8
|
+
* this file mirrors the same 12 tool names, descriptions, and request field
|
|
9
|
+
* shapes so frontend code can introspect the agent's tool surface (e.g. for
|
|
10
|
+
* UI affordances, debugging panels, or future browser-defined-tool routing)
|
|
11
|
+
* without copy-pasting strings into each consumer.
|
|
12
|
+
*
|
|
13
|
+
* SCOPE: these are the *server-side* tools the agent executes inline
|
|
14
|
+
* (semantic_search, extract_image, generate_character, …). They are a
|
|
15
|
+
* DIFFERENT vocabulary from the Helios *browser-side* tools encoded in
|
|
16
|
+
* `reactor/heliosTools.ts` (`BEDROCK_TOOL_SCHEMAS`: set_scene, swap_seed, …).
|
|
17
|
+
* The two do not converge; both are intentionally separate tool surfaces.
|
|
18
|
+
*
|
|
19
|
+
* KEEP IN SYNC: when the backend's `shared/tool_schemas.py` adds/removes a
|
|
20
|
+
* tool or changes a field, mirror it here. This file is the seed that lets
|
|
21
|
+
* the web clients stop hand-copying tool metadata; the backend remains the
|
|
22
|
+
* source of truth. There is no codegen yet (tracked in the backend
|
|
23
|
+
* `specs/technical-debt.md`).
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** JSON-schema-ish primitive types we expose for request fields. */
|
|
27
|
+
export type ToolFieldType = 'string' | 'number' | 'integer' | 'boolean';
|
|
28
|
+
|
|
29
|
+
/** Description of a single request field on a tool. */
|
|
30
|
+
export interface ToolRequestField {
|
|
31
|
+
/** Field name as the backend Pydantic model expects it (camelCase). */
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly type: ToolFieldType;
|
|
34
|
+
/** Whether the backend model requires this field. */
|
|
35
|
+
readonly required: boolean;
|
|
36
|
+
/** Allowed values when the field is a constrained enum. */
|
|
37
|
+
readonly enum?: readonly string[];
|
|
38
|
+
readonly description: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A single agent tool's framework-agnostic metadata. */
|
|
42
|
+
export interface AgentToolSchema {
|
|
43
|
+
/** Tool name (matches the backend Bedrock toolSpec name). */
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly description: string;
|
|
46
|
+
/** HTTP method the backend endpoint uses (mirrors ToolSchema.http_method). */
|
|
47
|
+
readonly httpMethod: 'GET' | 'POST';
|
|
48
|
+
/** Backend endpoint path the tool maps to. */
|
|
49
|
+
readonly endpoint: string;
|
|
50
|
+
readonly fields: readonly ToolRequestField[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The 12 server-side agent tools, mirroring `shared/tool_schemas.py`.
|
|
55
|
+
*
|
|
56
|
+
* Frozen at the type level via `as const` so consumers get literal
|
|
57
|
+
* `name`/`enum` types and cannot mutate the shared constant.
|
|
58
|
+
*/
|
|
59
|
+
export const AGENT_TOOL_SCHEMAS = [
|
|
60
|
+
{
|
|
61
|
+
name: 'list_videos',
|
|
62
|
+
description:
|
|
63
|
+
'List all ingested videos with metadata, download URLs, and durations.',
|
|
64
|
+
httpMethod: 'GET',
|
|
65
|
+
endpoint: '/api/v1/ingestion/videos',
|
|
66
|
+
fields: [
|
|
67
|
+
{ name: 'prefix', type: 'string', required: false, description: 'Optional prefix to filter objects by directory path' },
|
|
68
|
+
{ name: 'pageSize', type: 'integer', required: false, description: 'Maximum number of videos to return per page (1-100)' },
|
|
69
|
+
{ name: 'continuationToken', type: 'string', required: false, description: 'Token from previous response to continue pagination' },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'semantic_search',
|
|
74
|
+
description:
|
|
75
|
+
'Hybrid semantic search across captions, entities, and vectors.',
|
|
76
|
+
httpMethod: 'POST',
|
|
77
|
+
endpoint: '/api/v1/tools/semantic-search',
|
|
78
|
+
fields: [
|
|
79
|
+
{ name: 'query', type: 'string', required: false, description: 'Natural language query' },
|
|
80
|
+
{ name: 'videoId', type: 'string', required: false, description: 'Video to scope the search' },
|
|
81
|
+
{ name: 'k', type: 'integer', required: false, description: 'Maximum records to return (1-50)' },
|
|
82
|
+
{ name: 'offset', type: 'integer', required: false, description: 'Number of matches to skip before returning results' },
|
|
83
|
+
{ name: 'scope', type: 'string', required: false, enum: ['shots', 'videos', 'hybrid'], description: 'Search scope: shots, videos, or hybrid' },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'events_for_range',
|
|
88
|
+
description: 'Retrieve segments overlapping a provided time range.',
|
|
89
|
+
httpMethod: 'POST',
|
|
90
|
+
endpoint: '/api/v1/tools/events-for-range',
|
|
91
|
+
fields: [
|
|
92
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
93
|
+
{ name: 't0', type: 'number', required: true, description: 'Start time in seconds' },
|
|
94
|
+
{ name: 't1', type: 'number', required: true, description: 'End time in seconds' },
|
|
95
|
+
{ name: 'offset', type: 'integer', required: false, description: 'Number of segments to skip' },
|
|
96
|
+
{ name: 'limit', type: 'integer', required: false, description: 'Maximum number of segments to return (1-200)' },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'clip_lookup',
|
|
101
|
+
description: 'Return a signed URL for the requested clip window.',
|
|
102
|
+
httpMethod: 'POST',
|
|
103
|
+
endpoint: '/api/v1/tools/clip-lookup',
|
|
104
|
+
fields: [
|
|
105
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
106
|
+
{ name: 't0', type: 'number', required: true, description: 'Start time in seconds' },
|
|
107
|
+
{ name: 't1', type: 'number', required: true, description: 'End time in seconds' },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'entity_timeline',
|
|
112
|
+
description: 'Find occurrences of an entity across the timeline.',
|
|
113
|
+
httpMethod: 'POST',
|
|
114
|
+
endpoint: '/api/v1/tools/entity-timeline',
|
|
115
|
+
fields: [
|
|
116
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
117
|
+
{ name: 'entity', type: 'string', required: true, description: 'Entity name to locate' },
|
|
118
|
+
{ name: 't0', type: 'number', required: false, description: 'Optional start bound' },
|
|
119
|
+
{ name: 't1', type: 'number', required: false, description: 'Optional end bound' },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'scene_neighbors',
|
|
124
|
+
description: 'Traverse graph neighbors for a shot within a video.',
|
|
125
|
+
httpMethod: 'POST',
|
|
126
|
+
endpoint: '/api/v1/tools/scene-neighbors',
|
|
127
|
+
fields: [
|
|
128
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
129
|
+
{ name: 'shotId', type: 'string', required: true, description: 'Shot identifier' },
|
|
130
|
+
{ name: 'depth', type: 'integer', required: false, description: 'Traversal depth (1-3)' },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'dialog_search',
|
|
135
|
+
description:
|
|
136
|
+
'Search spoken dialog/transcript text within a video by keyword or phrase.',
|
|
137
|
+
httpMethod: 'POST',
|
|
138
|
+
endpoint: '/api/v1/tools/dialog-search',
|
|
139
|
+
fields: [
|
|
140
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
141
|
+
{ name: 'query', type: 'string', required: true, description: 'Search query for dialog text' },
|
|
142
|
+
{ name: 'limit', type: 'integer', required: false, description: 'Maximum results to return (1-100)' },
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'get_transcript',
|
|
147
|
+
description:
|
|
148
|
+
'Retrieve the full transcript of spoken dialog for a video, optionally filtered by time range.',
|
|
149
|
+
httpMethod: 'POST',
|
|
150
|
+
endpoint: '/api/v1/tools/get-transcript',
|
|
151
|
+
fields: [
|
|
152
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
153
|
+
{ name: 't0', type: 'number', required: false, description: 'Optional start time filter' },
|
|
154
|
+
{ name: 't1', type: 'number', required: false, description: 'Optional end time filter' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'speaker_dialog',
|
|
159
|
+
description:
|
|
160
|
+
'Retrieve all dialog spoken by a specific character in a video.',
|
|
161
|
+
httpMethod: 'POST',
|
|
162
|
+
endpoint: '/api/v1/tools/speaker-dialog',
|
|
163
|
+
fields: [
|
|
164
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
165
|
+
{ name: 'entity', type: 'string', required: true, description: 'Character/entity name' },
|
|
166
|
+
{ name: 't0', type: 'number', required: false, description: 'Optional start time filter' },
|
|
167
|
+
{ name: 't1', type: 'number', required: false, description: 'Optional end time filter' },
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'extract_image',
|
|
172
|
+
description:
|
|
173
|
+
'Extract and show an actual frame from the video without AI modification. Provide the entity parameter to locate a relevant scene; optionally provide a timestamp.',
|
|
174
|
+
httpMethod: 'POST',
|
|
175
|
+
endpoint: '/api/v1/tools/extract-image',
|
|
176
|
+
fields: [
|
|
177
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
178
|
+
{ name: 'entity', type: 'string', required: true, description: 'Name of a character, object, location, or visual element to locate' },
|
|
179
|
+
{ name: 'timestamp', type: 'number', required: false, description: 'Optional specific timestamp (seconds) to extract the frame from' },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'regenerate_image',
|
|
184
|
+
description:
|
|
185
|
+
'Generate an AI-modified image based on a video frame. Use only for creative transformations. The entity locates a scene; the prompt controls the transformation.',
|
|
186
|
+
httpMethod: 'POST',
|
|
187
|
+
endpoint: '/api/v1/tools/regenerate-image',
|
|
188
|
+
fields: [
|
|
189
|
+
{ name: 'videoId', type: 'string', required: true, description: 'Video identifier' },
|
|
190
|
+
{ name: 'entity', type: 'string', required: true, description: 'Name of a character, object, location, or visual element to locate' },
|
|
191
|
+
{ name: 'prompt', type: 'string', required: true, description: 'Text prompt describing what to generate from the frame' },
|
|
192
|
+
{ name: 'timestamp', type: 'number', required: false, description: 'Optional specific timestamp (seconds) to extract the frame from' },
|
|
193
|
+
{ name: 'model', type: 'string', required: false, description: 'Optional Gemini model override' },
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'generate_character',
|
|
198
|
+
description:
|
|
199
|
+
'Generate a clean 2D rest-pose character image for viseme bundle generation. Provide videoId+entity to extract a frame, or sourceImageId to start from an existing tracked image.',
|
|
200
|
+
httpMethod: 'POST',
|
|
201
|
+
endpoint: '/api/v1/tools/generate-character',
|
|
202
|
+
fields: [
|
|
203
|
+
{ name: 'videoId', type: 'string', required: false, description: 'Video to extract a reference frame from' },
|
|
204
|
+
{ name: 'entity', type: 'string', required: false, description: 'Character/entity name to locate in the video' },
|
|
205
|
+
{ name: 'timestamp', type: 'number', required: false, description: 'Optional timestamp for frame extraction' },
|
|
206
|
+
{ name: 'sourceImageId', type: 'string', required: false, description: 'ID of an existing tracked image to use as reference' },
|
|
207
|
+
{ name: 'style', type: 'string', required: false, description: "Style hint (e.g., 'anime', 'pixel art', 'cartoon')" },
|
|
208
|
+
{ name: 'model', type: 'string', required: false, description: 'Optional Gemini model override' },
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
] as const satisfies readonly AgentToolSchema[];
|
|
212
|
+
|
|
213
|
+
/** Union of the 12 server-side tool names (literal type). */
|
|
214
|
+
export type AgentToolName = (typeof AGENT_TOOL_SCHEMAS)[number]['name'];
|
|
215
|
+
|
|
216
|
+
/** Look up a single tool schema by name. Returns undefined if unknown. */
|
|
217
|
+
export function getAgentToolSchema(
|
|
218
|
+
name: string,
|
|
219
|
+
): AgentToolSchema | undefined {
|
|
220
|
+
return AGENT_TOOL_SCHEMAS.find((tool) => tool.name === name);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** All 12 tool names, in canonical order. */
|
|
224
|
+
export const AGENT_TOOL_NAMES: readonly AgentToolName[] =
|
|
225
|
+
AGENT_TOOL_SCHEMAS.map((tool) => tool.name);
|