@vellumai/assistant 0.3.3 → 0.3.5
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/Dockerfile +2 -0
- package/README.md +45 -18
- package/package.json +1 -1
- package/scripts/ipc/generate-swift.ts +13 -0
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +100 -0
- package/src/__tests__/approval-hardcoded-copy-guard.test.ts +41 -0
- package/src/__tests__/approval-message-composer.test.ts +253 -0
- package/src/__tests__/call-domain.test.ts +12 -2
- package/src/__tests__/call-orchestrator.test.ts +391 -1
- package/src/__tests__/call-routes-http.test.ts +27 -2
- package/src/__tests__/channel-approval-routes.test.ts +397 -135
- package/src/__tests__/channel-approvals.test.ts +99 -3
- package/src/__tests__/channel-delivery-store.test.ts +30 -4
- package/src/__tests__/channel-guardian.test.ts +261 -22
- package/src/__tests__/channel-readiness-service.test.ts +257 -0
- package/src/__tests__/config-schema.test.ts +2 -1
- package/src/__tests__/credential-security-invariants.test.ts +1 -0
- package/src/__tests__/daemon-lifecycle.test.ts +636 -0
- package/src/__tests__/dictation-mode-detection.test.ts +63 -0
- package/src/__tests__/entity-search.test.ts +615 -0
- package/src/__tests__/gateway-only-enforcement.test.ts +19 -13
- package/src/__tests__/handlers-twilio-config.test.ts +480 -0
- package/src/__tests__/ipc-snapshot.test.ts +63 -0
- package/src/__tests__/messaging-send-tool.test.ts +65 -0
- package/src/__tests__/run-orchestrator-assistant-events.test.ts +4 -0
- package/src/__tests__/run-orchestrator.test.ts +22 -0
- package/src/__tests__/secret-scanner.test.ts +223 -0
- package/src/__tests__/session-runtime-assembly.test.ts +85 -1
- package/src/__tests__/shell-parser-property.test.ts +357 -2
- package/src/__tests__/sms-messaging-provider.test.ts +125 -0
- package/src/__tests__/system-prompt.test.ts +25 -1
- package/src/__tests__/tool-executor-lifecycle-events.test.ts +34 -1
- package/src/__tests__/twilio-routes.test.ts +39 -3
- package/src/__tests__/twitter-cli-error-shaping.test.ts +2 -2
- package/src/__tests__/user-reference.test.ts +68 -0
- package/src/__tests__/web-search.test.ts +1 -1
- package/src/__tests__/work-item-output.test.ts +110 -0
- package/src/calls/call-domain.ts +8 -5
- package/src/calls/call-orchestrator.ts +85 -22
- package/src/calls/twilio-config.ts +17 -11
- package/src/calls/twilio-rest.ts +276 -0
- package/src/calls/twilio-routes.ts +39 -1
- package/src/cli/map.ts +6 -0
- package/src/commands/__tests__/cc-command-registry.test.ts +67 -0
- package/src/commands/cc-command-registry.ts +14 -1
- package/src/config/bundled-skills/claude-code/TOOLS.json +10 -3
- package/src/config/bundled-skills/knowledge-graph/SKILL.md +15 -0
- package/src/config/bundled-skills/knowledge-graph/TOOLS.json +56 -0
- package/src/config/bundled-skills/knowledge-graph/tools/graph-query.ts +185 -0
- package/src/config/bundled-skills/media-processing/SKILL.md +199 -0
- package/src/config/bundled-skills/media-processing/TOOLS.json +320 -0
- package/src/config/bundled-skills/media-processing/services/capability-registry.ts +137 -0
- package/src/config/bundled-skills/media-processing/services/event-detection-service.ts +280 -0
- package/src/config/bundled-skills/media-processing/services/feedback-aggregation.ts +144 -0
- package/src/config/bundled-skills/media-processing/services/feedback-store.ts +136 -0
- package/src/config/bundled-skills/media-processing/services/processing-pipeline.ts +261 -0
- package/src/config/bundled-skills/media-processing/services/retrieval-service.ts +95 -0
- package/src/config/bundled-skills/media-processing/services/timeline-service.ts +267 -0
- package/src/config/bundled-skills/media-processing/tools/analyze-keyframes.ts +301 -0
- package/src/config/bundled-skills/media-processing/tools/detect-events.ts +110 -0
- package/src/config/bundled-skills/media-processing/tools/extract-keyframes.ts +190 -0
- package/src/config/bundled-skills/media-processing/tools/generate-clip.ts +195 -0
- package/src/config/bundled-skills/media-processing/tools/ingest-media.ts +197 -0
- package/src/config/bundled-skills/media-processing/tools/media-diagnostics.ts +166 -0
- package/src/config/bundled-skills/media-processing/tools/media-status.ts +75 -0
- package/src/config/bundled-skills/media-processing/tools/query-media-events.ts +300 -0
- package/src/config/bundled-skills/media-processing/tools/recalibrate.ts +235 -0
- package/src/config/bundled-skills/media-processing/tools/select-tracking-profile.ts +142 -0
- package/src/config/bundled-skills/media-processing/tools/submit-feedback.ts +150 -0
- package/src/config/bundled-skills/messaging/SKILL.md +24 -5
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +5 -1
- package/src/config/bundled-skills/phone-calls/SKILL.md +2 -2
- package/src/config/bundled-skills/twitter/SKILL.md +19 -3
- package/src/config/defaults.ts +2 -1
- package/src/config/schema.ts +9 -3
- package/src/config/skills.ts +5 -32
- package/src/config/system-prompt.ts +40 -0
- package/src/config/templates/IDENTITY.md +2 -2
- package/src/config/user-reference.ts +29 -0
- package/src/config/vellum-skills/catalog.json +58 -0
- package/src/config/vellum-skills/google-oauth-setup/SKILL.md +3 -3
- package/src/config/vellum-skills/slack-oauth-setup/SKILL.md +3 -3
- package/src/config/vellum-skills/sms-setup/SKILL.md +118 -0
- package/src/config/vellum-skills/telegram-setup/SKILL.md +6 -1
- package/src/config/vellum-skills/twilio-setup/SKILL.md +76 -6
- package/src/daemon/auth-manager.ts +103 -0
- package/src/daemon/computer-use-session.ts +8 -1
- package/src/daemon/config-watcher.ts +253 -0
- package/src/daemon/handlers/config.ts +819 -22
- package/src/daemon/handlers/dictation.ts +182 -0
- package/src/daemon/handlers/identity.ts +14 -23
- package/src/daemon/handlers/index.ts +2 -0
- package/src/daemon/handlers/sessions.ts +2 -0
- package/src/daemon/handlers/shared.ts +3 -0
- package/src/daemon/handlers/skills.ts +6 -7
- package/src/daemon/handlers/work-items.ts +15 -7
- package/src/daemon/ipc-contract-inventory.json +10 -0
- package/src/daemon/ipc-contract.ts +114 -4
- package/src/daemon/ipc-handler.ts +87 -0
- package/src/daemon/lifecycle.ts +18 -4
- package/src/daemon/ride-shotgun-handler.ts +11 -1
- package/src/daemon/server.ts +111 -504
- package/src/daemon/session-agent-loop.ts +10 -15
- package/src/daemon/session-runtime-assembly.ts +115 -44
- package/src/daemon/session-tool-setup.ts +2 -0
- package/src/daemon/session.ts +19 -2
- package/src/inbound/public-ingress-urls.ts +3 -3
- package/src/memory/channel-guardian-store.ts +2 -1
- package/src/memory/db-connection.ts +28 -0
- package/src/memory/db-init.ts +1163 -0
- package/src/memory/db.ts +2 -2007
- package/src/memory/embedding-backend.ts +79 -11
- package/src/memory/indexer.ts +2 -0
- package/src/memory/job-handlers/media-processing.ts +100 -0
- package/src/memory/job-utils.ts +64 -4
- package/src/memory/jobs-store.ts +2 -1
- package/src/memory/jobs-worker.ts +11 -1
- package/src/memory/media-store.ts +759 -0
- package/src/memory/recall-cache.ts +107 -0
- package/src/memory/retriever.ts +36 -2
- package/src/memory/schema-migration.ts +984 -0
- package/src/memory/schema.ts +99 -0
- package/src/memory/search/entity.ts +208 -25
- package/src/memory/search/ranking.ts +6 -1
- package/src/memory/search/types.ts +26 -0
- package/src/messaging/provider-types.ts +2 -0
- package/src/messaging/providers/sms/adapter.ts +204 -0
- package/src/messaging/providers/sms/client.ts +93 -0
- package/src/messaging/providers/sms/types.ts +7 -0
- package/src/permissions/checker.ts +16 -2
- package/src/permissions/prompter.ts +14 -3
- package/src/permissions/trust-store.ts +7 -0
- package/src/runtime/approval-message-composer.ts +143 -0
- package/src/runtime/channel-approvals.ts +29 -7
- package/src/runtime/channel-guardian-service.ts +44 -18
- package/src/runtime/channel-readiness-service.ts +292 -0
- package/src/runtime/channel-readiness-types.ts +29 -0
- package/src/runtime/gateway-client.ts +2 -1
- package/src/runtime/http-server.ts +65 -28
- package/src/runtime/http-types.ts +3 -0
- package/src/runtime/routes/call-routes.ts +2 -1
- package/src/runtime/routes/channel-routes.ts +237 -103
- package/src/runtime/routes/run-routes.ts +7 -1
- package/src/runtime/run-orchestrator.ts +43 -3
- package/src/security/secret-scanner.ts +218 -0
- package/src/skills/frontmatter.ts +63 -0
- package/src/skills/slash-commands.ts +23 -0
- package/src/skills/vellum-catalog-remote.ts +107 -0
- package/src/tools/assets/materialize.ts +2 -2
- package/src/tools/browser/auto-navigate.ts +132 -24
- package/src/tools/browser/browser-manager.ts +67 -61
- package/src/tools/calls/call-start.ts +1 -0
- package/src/tools/claude-code/claude-code.ts +55 -3
- package/src/tools/credentials/vault.ts +1 -1
- package/src/tools/execution-target.ts +11 -1
- package/src/tools/executor.ts +10 -2
- package/src/tools/network/web-search.ts +1 -1
- package/src/tools/skills/vellum-catalog.ts +61 -156
- package/src/tools/terminal/parser.ts +21 -5
- package/src/tools/types.ts +2 -0
- package/src/twitter/router.ts +1 -1
- package/src/util/platform.ts +43 -1
- package/src/util/retry.ts +4 -4
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"tools": [
|
|
4
|
+
{
|
|
5
|
+
"name": "ingest_media",
|
|
6
|
+
"description": "Ingest a media file (video, audio, or image) for processing. Validates the file, detects MIME type, extracts duration for video/audio, registers the asset with content-hash dedup, and enqueues an initial processing job.",
|
|
7
|
+
"category": "media",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"input_schema": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"file_path": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Absolute path to a local media file (video, audio, or image)"
|
|
15
|
+
},
|
|
16
|
+
"title": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Optional human-readable title for the media asset. Defaults to the filename."
|
|
19
|
+
},
|
|
20
|
+
"metadata": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"description": "Optional JSON metadata to attach to the asset (e.g., pipeline config, source info)"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["file_path"]
|
|
26
|
+
},
|
|
27
|
+
"executor": "tools/ingest-media.ts",
|
|
28
|
+
"execution_target": "host"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "media_status",
|
|
32
|
+
"description": "Query the processing status of one or more media assets, including per-stage progress details.",
|
|
33
|
+
"category": "media",
|
|
34
|
+
"risk": "low",
|
|
35
|
+
"input_schema": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"properties": {
|
|
38
|
+
"asset_id": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "ID of a specific media asset to query"
|
|
41
|
+
},
|
|
42
|
+
"file_path": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "File path to look up a media asset by its original path"
|
|
45
|
+
},
|
|
46
|
+
"status_filter": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": ["registered", "processing", "indexed", "failed"],
|
|
49
|
+
"description": "Filter assets by processing status"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"executor": "tools/media-status.ts",
|
|
54
|
+
"execution_target": "host"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "extract_keyframes",
|
|
58
|
+
"description": "Extract keyframes from a video asset at regular intervals using ffmpeg. Stores frame images and registers each in the database for subsequent vision analysis.",
|
|
59
|
+
"category": "media",
|
|
60
|
+
"risk": "low",
|
|
61
|
+
"input_schema": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"asset_id": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "ID of the media asset (must be a video)"
|
|
67
|
+
},
|
|
68
|
+
"interval_seconds": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"description": "Interval between keyframes in seconds. Default: 3"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"required": ["asset_id"]
|
|
74
|
+
},
|
|
75
|
+
"executor": "tools/extract-keyframes.ts",
|
|
76
|
+
"execution_target": "host"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "analyze_keyframes",
|
|
80
|
+
"description": "Analyze extracted keyframes using Claude VLM (vision language model). Produces structured scene descriptions with subjects, actions, and context for each frame. Supports resumability — skips already-analyzed frames.",
|
|
81
|
+
"category": "media",
|
|
82
|
+
"risk": "medium",
|
|
83
|
+
"input_schema": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {
|
|
86
|
+
"asset_id": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "ID of the media asset whose keyframes to analyze"
|
|
89
|
+
},
|
|
90
|
+
"analysis_type": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Type of analysis to perform. Default: 'scene_description'"
|
|
93
|
+
},
|
|
94
|
+
"batch_size": {
|
|
95
|
+
"type": "number",
|
|
96
|
+
"description": "Number of keyframes to process per batch. Default: 10"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": ["asset_id"]
|
|
100
|
+
},
|
|
101
|
+
"executor": "tools/analyze-keyframes.ts",
|
|
102
|
+
"execution_target": "host"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "detect_events",
|
|
106
|
+
"description": "Detect events from a media asset's timeline segments using configurable detection rules with weighted confidence ranking. Supports built-in rule types: segment_transition (field changes between adjacent segments), short_segment (segments below a duration threshold), and attribute_match (regex matching on segment attributes). If no rules are provided, sensible defaults are used based on the event type.",
|
|
107
|
+
"category": "media",
|
|
108
|
+
"risk": "low",
|
|
109
|
+
"input_schema": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"asset_id": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "ID of the media asset to detect events in"
|
|
115
|
+
},
|
|
116
|
+
"event_type": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Type label for detected events (e.g., 'turnover', 'scene_change', 'highlight')"
|
|
119
|
+
},
|
|
120
|
+
"detection_rules": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"description": "Optional array of detection rule objects. Each rule has: ruleType (string: 'segment_transition', 'short_segment', or 'attribute_match'), params (object with rule-specific parameters), and weight (number: contribution to confidence score). If omitted, defaults are used based on event_type.",
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"ruleType": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "Rule type: 'segment_transition', 'short_segment', or 'attribute_match'"
|
|
129
|
+
},
|
|
130
|
+
"params": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"description": "Rule-specific parameters (e.g., { field: 'subjects' }, { maxDurationSeconds: 5 }, { field: 'actions', pattern: 'steal|turnover' })"
|
|
133
|
+
},
|
|
134
|
+
"weight": {
|
|
135
|
+
"type": "number",
|
|
136
|
+
"description": "Weight for this rule's contribution to the confidence score"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"required": ["ruleType", "params", "weight"]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"required": ["asset_id", "event_type"]
|
|
144
|
+
},
|
|
145
|
+
"executor": "tools/detect-events.ts",
|
|
146
|
+
"execution_target": "host"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "query_media_events",
|
|
150
|
+
"description": "Query media events using natural language. Parses the query into structured filters (event type, count, confidence threshold, time range) and retrieves matching events ranked by confidence. Supports domain-specific keyword mapping (e.g., 'turnovers' → eventType='turnover').",
|
|
151
|
+
"category": "media",
|
|
152
|
+
"risk": "low",
|
|
153
|
+
"input_schema": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"query": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Natural language query describing the events to find (e.g., 'top 5 turnovers', 'high confidence goals in the first half')"
|
|
159
|
+
},
|
|
160
|
+
"asset_id": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "ID of the media asset to search within"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"required": ["query", "asset_id"]
|
|
166
|
+
},
|
|
167
|
+
"executor": "tools/query-media-events.ts",
|
|
168
|
+
"execution_target": "host"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "select_tracking_profile",
|
|
172
|
+
"description": "Select and persist a tracking profile for a media asset. When called without capabilities, returns available capabilities organized by tier (ready, beta, experimental). When called with capabilities, validates them against the registry and stores the profile. The capability tier system is generic and extensible across domains.",
|
|
173
|
+
"category": "media",
|
|
174
|
+
"risk": "low",
|
|
175
|
+
"input_schema": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"asset_id": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"description": "ID of the media asset to configure tracking for"
|
|
181
|
+
},
|
|
182
|
+
"capabilities": {
|
|
183
|
+
"type": "array",
|
|
184
|
+
"items": { "type": "string" },
|
|
185
|
+
"description": "Optional array of capability names to enable (e.g., ['turnover', 'field_goal']). If omitted, returns the available capabilities for selection."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": ["asset_id"]
|
|
189
|
+
},
|
|
190
|
+
"executor": "tools/select-tracking-profile.ts",
|
|
191
|
+
"execution_target": "host"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "generate_clip",
|
|
195
|
+
"description": "Extract a video clip from a media asset using ffmpeg. Applies configurable pre/post-roll padding (clamped to file boundaries), outputs the clip as a temporary file, and registers it as an attachment for in-chat delivery.",
|
|
196
|
+
"category": "media",
|
|
197
|
+
"risk": "low",
|
|
198
|
+
"input_schema": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"properties": {
|
|
201
|
+
"asset_id": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"description": "ID of the media asset (must be a video)"
|
|
204
|
+
},
|
|
205
|
+
"start_time": {
|
|
206
|
+
"type": "number",
|
|
207
|
+
"description": "Start time of the clip in seconds"
|
|
208
|
+
},
|
|
209
|
+
"end_time": {
|
|
210
|
+
"type": "number",
|
|
211
|
+
"description": "End time of the clip in seconds"
|
|
212
|
+
},
|
|
213
|
+
"pre_roll": {
|
|
214
|
+
"type": "number",
|
|
215
|
+
"description": "Seconds of padding before start_time. Default: 3"
|
|
216
|
+
},
|
|
217
|
+
"post_roll": {
|
|
218
|
+
"type": "number",
|
|
219
|
+
"description": "Seconds of padding after end_time. Default: 2"
|
|
220
|
+
},
|
|
221
|
+
"output_format": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"enum": ["mp4", "webm", "mov"],
|
|
224
|
+
"description": "Output video format. Default: 'mp4'"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"required": ["asset_id", "start_time", "end_time"]
|
|
228
|
+
},
|
|
229
|
+
"executor": "tools/generate-clip.ts",
|
|
230
|
+
"execution_target": "host"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "submit_feedback",
|
|
234
|
+
"description": "Submit feedback on a detected media event. Supports four feedback types: 'correct' (confirms accuracy), 'incorrect' (marks false positive), 'boundary_edit' (adjusts start/end times), and 'missed' (reports an event the system failed to detect, creating a new event). Works for any event type.",
|
|
235
|
+
"category": "media",
|
|
236
|
+
"risk": "low",
|
|
237
|
+
"input_schema": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"properties": {
|
|
240
|
+
"event_id": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"description": "ID of the event to provide feedback on. Required for all types except 'missed'."
|
|
243
|
+
},
|
|
244
|
+
"feedback_type": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"enum": ["correct", "incorrect", "boundary_edit", "missed"],
|
|
247
|
+
"description": "Type of feedback: correct, incorrect, boundary_edit, or missed"
|
|
248
|
+
},
|
|
249
|
+
"corrected_start_time": {
|
|
250
|
+
"type": "number",
|
|
251
|
+
"description": "Corrected start time in seconds (for boundary_edit feedback)"
|
|
252
|
+
},
|
|
253
|
+
"corrected_end_time": {
|
|
254
|
+
"type": "number",
|
|
255
|
+
"description": "Corrected end time in seconds (for boundary_edit feedback)"
|
|
256
|
+
},
|
|
257
|
+
"notes": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"description": "Optional free-text notes about the feedback"
|
|
260
|
+
},
|
|
261
|
+
"asset_id": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"description": "ID of the media asset (required for 'missed' type)"
|
|
264
|
+
},
|
|
265
|
+
"event_type": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"description": "Event type label for the missed event (required for 'missed' type)"
|
|
268
|
+
},
|
|
269
|
+
"start_time": {
|
|
270
|
+
"type": "number",
|
|
271
|
+
"description": "Start time in seconds for the missed event (required for 'missed' type)"
|
|
272
|
+
},
|
|
273
|
+
"end_time": {
|
|
274
|
+
"type": "number",
|
|
275
|
+
"description": "End time in seconds for the missed event (required for 'missed' type)"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"required": ["feedback_type"]
|
|
279
|
+
},
|
|
280
|
+
"executor": "tools/submit-feedback.ts",
|
|
281
|
+
"execution_target": "host"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "media_diagnostics",
|
|
285
|
+
"description": "Get a diagnostic report for a media asset including processing stats, per-stage timing, failure reasons, cost estimation, and feedback summary.",
|
|
286
|
+
"category": "media",
|
|
287
|
+
"risk": "low",
|
|
288
|
+
"input_schema": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"properties": {
|
|
291
|
+
"asset_id": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"description": "ID of the media asset to diagnose"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"required": ["asset_id"]
|
|
297
|
+
},
|
|
298
|
+
"executor": "tools/media-diagnostics.ts",
|
|
299
|
+
"execution_target": "host"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "recalibrate",
|
|
303
|
+
"description": "Recalibrate event detection for a media asset based on accumulated feedback. Analyzes correction patterns (false positive rates, missed events, boundary adjustments), re-ranks existing events by adjusting confidence scores, and returns a summary of adjustments made. Works for any event type.",
|
|
304
|
+
"category": "media",
|
|
305
|
+
"risk": "low",
|
|
306
|
+
"input_schema": {
|
|
307
|
+
"type": "object",
|
|
308
|
+
"properties": {
|
|
309
|
+
"asset_id": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"description": "ID of the media asset to recalibrate"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"required": ["asset_id"]
|
|
315
|
+
},
|
|
316
|
+
"executor": "tools/recalibrate.ts",
|
|
317
|
+
"execution_target": "host"
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic capability registry with tier-based classification.
|
|
3
|
+
*
|
|
4
|
+
* The registry is domain-agnostic: any domain (sports, surveillance, lecture
|
|
5
|
+
* recording, etc.) can register its own capabilities. Basketball-specific
|
|
6
|
+
* capabilities are registered as one example via `registerDefaults()`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { CapabilityTier } from '../../../../memory/media-store.js';
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Types
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
export interface Capability {
|
|
16
|
+
/** Unique name used as the key in tracking profiles (e.g. 'turnover'). */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Human-readable description of what this capability detects/tracks. */
|
|
19
|
+
description: string;
|
|
20
|
+
/** Maturity tier governing confidence disclaimers and default inclusion. */
|
|
21
|
+
tier: CapabilityTier;
|
|
22
|
+
/** Domain this capability belongs to (e.g. 'basketball', 'surveillance'). */
|
|
23
|
+
domain: string;
|
|
24
|
+
/** Granularity level (e.g. 'team', 'per-player'). */
|
|
25
|
+
granularity?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Registry (singleton in-memory Map)
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
const registry = new Map<string, Capability>();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Register a capability. Overwrites any existing capability with the same name.
|
|
36
|
+
*/
|
|
37
|
+
export function registerCapability(cap: Capability): void {
|
|
38
|
+
registry.set(cap.name, cap);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get all registered capabilities, optionally filtered by domain.
|
|
43
|
+
*/
|
|
44
|
+
export function getCapabilities(domain?: string): Capability[] {
|
|
45
|
+
const all = Array.from(registry.values());
|
|
46
|
+
if (!domain) return all;
|
|
47
|
+
return all.filter((c) => c.domain === domain);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get capabilities filtered by tier.
|
|
52
|
+
*/
|
|
53
|
+
export function getCapabilitiesByTier(tier: CapabilityTier): Capability[] {
|
|
54
|
+
return Array.from(registry.values()).filter((c) => c.tier === tier);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Look up a single capability by name.
|
|
59
|
+
*/
|
|
60
|
+
export function getCapabilityByName(name: string): Capability | undefined {
|
|
61
|
+
return registry.get(name);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get all unique domain names in the registry.
|
|
66
|
+
*/
|
|
67
|
+
export function getRegisteredDomains(): string[] {
|
|
68
|
+
const domains = new Set<string>();
|
|
69
|
+
for (const cap of registry.values()) {
|
|
70
|
+
domains.add(cap.domain);
|
|
71
|
+
}
|
|
72
|
+
return Array.from(domains);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Default registrations — basketball as one example domain
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Register the default basketball capabilities as an example domain.
|
|
81
|
+
* Other domains should call `registerCapability()` with their own entries.
|
|
82
|
+
*/
|
|
83
|
+
export function registerDefaults(): void {
|
|
84
|
+
// Ready tier: production-quality detection
|
|
85
|
+
registerCapability({
|
|
86
|
+
name: 'turnover',
|
|
87
|
+
description: 'Team-level turnover detection',
|
|
88
|
+
tier: 'ready',
|
|
89
|
+
domain: 'basketball',
|
|
90
|
+
granularity: 'team',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Beta tier: functional but may have accuracy gaps
|
|
94
|
+
registerCapability({
|
|
95
|
+
name: 'field_goal',
|
|
96
|
+
description: 'Team-level field goal detection',
|
|
97
|
+
tier: 'beta',
|
|
98
|
+
domain: 'basketball',
|
|
99
|
+
granularity: 'team',
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
registerCapability({
|
|
103
|
+
name: 'rebound',
|
|
104
|
+
description: 'Team-level rebound detection',
|
|
105
|
+
tier: 'beta',
|
|
106
|
+
domain: 'basketball',
|
|
107
|
+
granularity: 'team',
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
registerCapability({
|
|
111
|
+
name: 'turnover_per_player',
|
|
112
|
+
description: 'Per-player turnover attribution',
|
|
113
|
+
tier: 'beta',
|
|
114
|
+
domain: 'basketball',
|
|
115
|
+
granularity: 'per-player',
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Experimental tier: early-stage, expect noise
|
|
119
|
+
registerCapability({
|
|
120
|
+
name: 'field_goal_per_player',
|
|
121
|
+
description: 'Per-player field goal attribution',
|
|
122
|
+
tier: 'experimental',
|
|
123
|
+
domain: 'basketball',
|
|
124
|
+
granularity: 'per-player',
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
registerCapability({
|
|
128
|
+
name: 'rebound_per_player',
|
|
129
|
+
description: 'Per-player rebound attribution',
|
|
130
|
+
tier: 'experimental',
|
|
131
|
+
domain: 'basketball',
|
|
132
|
+
granularity: 'per-player',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Auto-register defaults on first import
|
|
137
|
+
registerDefaults();
|