@sogni-ai/sogni-protocol 1.0.0-alpha.10

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.
Files changed (95) hide show
  1. package/README.md +89 -0
  2. package/catalogs/audio-models.json +34 -0
  3. package/catalogs/quality-presets.json +30 -0
  4. package/catalogs/seedance-reference-limits.json +9 -0
  5. package/enums/chat-run-status.json +12 -0
  6. package/enums/chat-run-waiting-reasons.json +10 -0
  7. package/enums/token-types.json +7 -0
  8. package/enums/tool-names.json +85 -0
  9. package/manifests/app-tools.json +297 -0
  10. package/manifests/composition-tools.json +228 -0
  11. package/manifests/generation-tools.json +1275 -0
  12. package/manifests/openai-tools.json +1830 -0
  13. package/package.json +44 -0
  14. package/prompts/tools/add_subtitles.json +12 -0
  15. package/prompts/tools/analyze_image.json +12 -0
  16. package/prompts/tools/analyze_video.json +11 -0
  17. package/prompts/tools/animate_photo.json +13 -0
  18. package/prompts/tools/apply_style.json +11 -0
  19. package/prompts/tools/ask_clarifying_question.json +10 -0
  20. package/prompts/tools/change_angle.json +11 -0
  21. package/prompts/tools/compose_instrumental.json +11 -0
  22. package/prompts/tools/compose_lyrics.json +12 -0
  23. package/prompts/tools/compose_script.json +21 -0
  24. package/prompts/tools/compose_workflow.json +17 -0
  25. package/prompts/tools/compose_workflow_template.json +23 -0
  26. package/prompts/tools/create_asset_manifest.json +9 -0
  27. package/prompts/tools/dance_montage.json +9 -0
  28. package/prompts/tools/edit_image.json +11 -0
  29. package/prompts/tools/enhance_prompt.json +20 -0
  30. package/prompts/tools/extend_video.json +11 -0
  31. package/prompts/tools/extract_metadata.json +9 -0
  32. package/prompts/tools/finalize_response.json +10 -0
  33. package/prompts/tools/generate_image.json +11 -0
  34. package/prompts/tools/generate_music.json +7 -0
  35. package/prompts/tools/generate_video.json +10 -0
  36. package/prompts/tools/inspect_asset.json +10 -0
  37. package/prompts/tools/label_asset.json +13 -0
  38. package/prompts/tools/manage_memory.json +12 -0
  39. package/prompts/tools/map_assets_for_model.json +9 -0
  40. package/prompts/tools/orbit_video.json +13 -0
  41. package/prompts/tools/overlay_video.json +10 -0
  42. package/prompts/tools/refine_result.json +11 -0
  43. package/prompts/tools/replace_video_segment.json +14 -0
  44. package/prompts/tools/resolve_personas.json +9 -0
  45. package/prompts/tools/restore_photo.json +12 -0
  46. package/prompts/tools/set_content_filter.json +9 -0
  47. package/prompts/tools/sound_to_video.json +9 -0
  48. package/prompts/tools/stitch_video.json +9 -0
  49. package/prompts/tools/validate_asset_references.json +10 -0
  50. package/prompts/tools/video_to_video.json +13 -0
  51. package/schemas/agent/intent-input.schema.json +128 -0
  52. package/schemas/agent/turn-analysis.schema.json +75 -0
  53. package/schemas/artifacts/artifact-graph.schema.json +42 -0
  54. package/schemas/artifacts/artifact-node.schema.json +137 -0
  55. package/schemas/billing/spend-gate.schema.json +151 -0
  56. package/schemas/billing/workflow-authorization.schema.json +83 -0
  57. package/schemas/errors/error.schema.json +21 -0
  58. package/schemas/errors/repair-control.schema.json +40 -0
  59. package/schemas/events/artifact-reference.schema.json +22 -0
  60. package/schemas/events/progress-event.schema.json +28 -0
  61. package/schemas/events/run-event.schema.json +122 -0
  62. package/schemas/events/workflow-event.schema.json +22 -0
  63. package/schemas/prompt-contract.schema.json +42 -0
  64. package/schemas/storyboards/storyboard-planning-contract.schema.json +108 -0
  65. package/schemas/tools/add_subtitles.schema.json +77 -0
  66. package/schemas/tools/animate_photo.schema.json +104 -0
  67. package/schemas/tools/apply_style.schema.json +37 -0
  68. package/schemas/tools/change_angle.schema.json +30 -0
  69. package/schemas/tools/compose_instrumental.schema.json +24 -0
  70. package/schemas/tools/compose_lyrics.schema.json +28 -0
  71. package/schemas/tools/compose_script.schema.json +68 -0
  72. package/schemas/tools/compose_workflow.schema.json +67 -0
  73. package/schemas/tools/compose_workflow_template.schema.json +156 -0
  74. package/schemas/tools/dance_montage.schema.json +47 -0
  75. package/schemas/tools/edit_image.schema.json +76 -0
  76. package/schemas/tools/enhance_prompt.schema.json +76 -0
  77. package/schemas/tools/extend_video.schema.json +43 -0
  78. package/schemas/tools/generate_image.schema.json +109 -0
  79. package/schemas/tools/generate_music.schema.json +62 -0
  80. package/schemas/tools/generate_video.schema.json +98 -0
  81. package/schemas/tools/manage_memory.schema.json +28 -0
  82. package/schemas/tools/orbit_video.schema.json +70 -0
  83. package/schemas/tools/overlay_video.schema.json +126 -0
  84. package/schemas/tools/refine_result.schema.json +43 -0
  85. package/schemas/tools/replace_video_segment.schema.json +61 -0
  86. package/schemas/tools/resolve_personas.schema.json +15 -0
  87. package/schemas/tools/restore_photo.schema.json +47 -0
  88. package/schemas/tools/set_content_filter.schema.json +14 -0
  89. package/schemas/tools/sound_to_video.schema.json +71 -0
  90. package/schemas/tools/stitch_video.schema.json +52 -0
  91. package/schemas/tools/tool-metadata.schema.json +78 -0
  92. package/schemas/tools/video_to_video.schema.json +78 -0
  93. package/schemas/workflows/durable-workflow-run.schema.json +165 -0
  94. package/schemas/workflows/durable-workflow-step.schema.json +141 -0
  95. package/version.json +4 -0
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-05-20.1/billing/workflow-authorization.schema.json",
4
+ "title": "Workflow authorization ticket",
5
+ "schemaVersion": "2026-05-20.1",
6
+ "description": "Umbrella authorization ticket recorded once at workflow run start. The executor consults it before dispatching each stage and pauses for re-authorization if cumulative settled + reserved + next-estimate would exceed authorizedCapacityUnits. Per-job settlement continues through the existing sogni-socket 'project + N identical jobs' path; the workflow layer is an authorization umbrella, not a new transaction ledger.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "$defs": {
10
+ "StageSettlementStatus": {
11
+ "type": "string",
12
+ "enum": ["pending", "in_flight", "settled", "failed", "cancelled"]
13
+ },
14
+ "StageSettlement": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "description": "Per-stage ledger row. estimatedUnits comes from the WorkflowCostPreview; settledUnits is filled in as the sogni-socket worker(s) for this stage finish.",
18
+ "properties": {
19
+ "stageId": { "type": "string" },
20
+ "projectId": {
21
+ "type": "string",
22
+ "description": "sogni-socket project id. Null until dispatched."
23
+ },
24
+ "jobIds": {
25
+ "type": "array",
26
+ "description": "sogni-socket job ids. Empty until dispatched. May have multiple entries for fan-out stages.",
27
+ "items": { "type": "string" }
28
+ },
29
+ "estimatedUnits": { "type": "number", "minimum": 0 },
30
+ "settledUnits": {
31
+ "type": "number",
32
+ "minimum": 0,
33
+ "description": "Cumulative settled units for this stage. Null until at least one worker completes."
34
+ },
35
+ "status": { "$ref": "#/$defs/StageSettlementStatus" }
36
+ },
37
+ "required": ["stageId", "estimatedUnits", "status"]
38
+ }
39
+ },
40
+ "properties": {
41
+ "workflowRunId": { "type": "string" },
42
+ "authorizedCapacityUnits": {
43
+ "type": "number",
44
+ "minimum": 0,
45
+ "description": "Umbrella cap. Per-job settlements stay within this; if next dispatch would exceed by more than the documented drift tolerance the run pauses for re-authorization."
46
+ },
47
+ "tokenType": {
48
+ "type": "string",
49
+ "enum": ["spark", "sogni"]
50
+ },
51
+ "authorizedAt": { "type": "string", "format": "date-time" },
52
+ "expiresAt": {
53
+ "type": "string",
54
+ "format": "date-time",
55
+ "description": "Past expiry, the run pauses with cost_approval_required for re-authorization. Template declares an expected duration; expiry is duration + retry grace."
56
+ },
57
+ "cumulativeSettledUnits": {
58
+ "type": "number",
59
+ "minimum": 0,
60
+ "description": "Sum of stageSettlements[].settledUnits to date."
61
+ },
62
+ "cumulativeReservedUnits": {
63
+ "type": "number",
64
+ "minimum": 0,
65
+ "description": "Estimated units for in-flight jobs not yet settled."
66
+ },
67
+ "stageSettlements": {
68
+ "type": "array",
69
+ "description": "Per-stage ledger. May be empty pre-dispatch; populated as the executor dispatches each stage.",
70
+ "items": { "$ref": "#/$defs/StageSettlement" }
71
+ }
72
+ },
73
+ "required": [
74
+ "workflowRunId",
75
+ "authorizedCapacityUnits",
76
+ "tokenType",
77
+ "authorizedAt",
78
+ "expiresAt",
79
+ "cumulativeSettledUnits",
80
+ "cumulativeReservedUnits",
81
+ "stageSettlements"
82
+ ]
83
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/errors/error.schema.json",
4
+ "title": "Creative agent error",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "code": { "type": "string" },
10
+ "message": { "type": "string" },
11
+ "classification": {
12
+ "type": "string",
13
+ "enum": ["validation", "auth", "billing", "rate_limit", "transient", "provider", "policy", "cancelled", "unknown"]
14
+ },
15
+ "retryable": { "type": "boolean" },
16
+ "toolName": { "type": "string" },
17
+ "stepId": { "type": "string" },
18
+ "details": { "type": "object", "additionalProperties": true }
19
+ },
20
+ "required": ["code", "message", "classification", "retryable"]
21
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/errors/repair-control.schema.json",
4
+ "title": "Creative agent repair control payload",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "error": { "type": "string" },
10
+ "message": { "type": "string" },
11
+ "controlAction": {
12
+ "type": "string",
13
+ "enum": ["execute_tool", "wait_for_user", "finish_response", "none"]
14
+ },
15
+ "retryPolicy": {
16
+ "type": "string",
17
+ "enum": [
18
+ "auto_tool_call",
19
+ "auto",
20
+ "auto_repair",
21
+ "llm_repair",
22
+ "manual_ui_only",
23
+ "manual_user_confirmation",
24
+ "none",
25
+ "no_retry",
26
+ "terminal"
27
+ ]
28
+ },
29
+ "requiredTool": {
30
+ "type": "string",
31
+ "pattern": "^[a-z][a-z0-9_]{1,40}$"
32
+ },
33
+ "suggestedArgs": {
34
+ "type": "object",
35
+ "additionalProperties": true
36
+ },
37
+ "nextAction": { "type": "string" }
38
+ },
39
+ "required": ["controlAction"]
40
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/events/artifact-reference.schema.json",
4
+ "title": "Creative agent artifact reference",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "kind": { "type": "string", "enum": ["image", "video", "audio", "archive", "json", "text", "other"] },
11
+ "url": { "type": "string" },
12
+ "mimeType": { "type": "string" },
13
+ "width": { "type": "number" },
14
+ "height": { "type": "number" },
15
+ "durationSeconds": { "type": "number" },
16
+ "sizeBytes": { "type": "number" },
17
+ "toolName": { "type": "string" },
18
+ "stepId": { "type": "string" },
19
+ "metadata": { "type": "object", "additionalProperties": true }
20
+ },
21
+ "required": ["id", "kind", "url"]
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/events/progress-event.schema.json",
4
+ "title": "Creative agent progress event",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "workflowId": { "type": "string" },
11
+ "stepId": { "type": "string" },
12
+ "sequence": { "type": "integer", "minimum": 0 },
13
+ "timestamp": { "type": "string", "format": "date-time" },
14
+ "type": {
15
+ "type": "string",
16
+ "enum": ["started", "progress", "completed", "error", "artifact", "tool_call", "llm_request", "cancelled", "custom"]
17
+ },
18
+ "toolName": { "type": "string" },
19
+ "progress": { "type": "number", "minimum": 0, "maximum": 1 },
20
+ "message": { "type": "string" },
21
+ "artifacts": {
22
+ "type": "array",
23
+ "items": { "type": "object", "additionalProperties": true }
24
+ },
25
+ "data": { "type": "object", "additionalProperties": true }
26
+ },
27
+ "required": ["id", "workflowId", "sequence", "timestamp", "type"]
28
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-05-20.1/events/run-event.schema.json",
4
+ "title": "Unified run event",
5
+ "schemaVersion": "2026-05-20.1",
6
+ "description": "Single event vocabulary across chat runs and workflow runs. Both persist into the shared `runs` substrate (plan §13.5) and differ only by the runKind discriminator. SSE replay key is (runId, sequence). idempotencyKey covers reentrant transitions such as cost confirmation. Per-event-type payload shapes are deliberately not enforced at this layer — payload shapes are documented per type and tightened in a Phase 1 follow-up to avoid an enormous union in this round.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "$defs": {
10
+ "RunEventType": {
11
+ "type": "string",
12
+ "description": "All event types — superset of every type emitted by any current consumer (sogni-creative-agent-v2, sogni-chat, sogni-api) plus the schema-mandated set; mirrors RUN_EVENT_TYPES in sogni-intelligence-client src/events/runEvent.ts. Clusters: lifecycle (run_created, run_queued, run_started, run_resumed, run_completed, run_partial_failure, run_failed, run_cancelled), LLM (llm_round_started, llm_token, llm_round_completed, assistant_message_delta, assistant_message_completed), tools (tool_call_proposed, tool_call_dispatched, tool_call_progress, tool_call_resolved), artifacts (artifact_created, artifact_updated, artifact_referenced), media context (media_context_updated, media_turn_intent_classified, asset_manifest_updated), waiting (run_waiting_for_user), spend/billing (billing_preview_updated, spend_gate_opened, spend_preview_emitted, spend_confirmed, spend_cancelled, spend_insufficient, run_awaiting_cost_confirmation, run_cost_confirmation_resolved), workflow-stage (stage_started, stage_completed, stage_failed, stage_waiting_for_user), audit (audit_evaluated, repair_requested).",
13
+ "enum": [
14
+ "run_created",
15
+ "run_queued",
16
+ "run_started",
17
+ "run_resumed",
18
+ "run_completed",
19
+ "run_partial_failure",
20
+ "run_failed",
21
+ "run_cancelled",
22
+ "llm_round_started",
23
+ "llm_token",
24
+ "llm_round_completed",
25
+ "assistant_message_delta",
26
+ "assistant_message_completed",
27
+ "tool_call_proposed",
28
+ "tool_call_dispatched",
29
+ "tool_call_progress",
30
+ "tool_call_resolved",
31
+ "artifact_created",
32
+ "artifact_updated",
33
+ "artifact_referenced",
34
+ "media_context_updated",
35
+ "media_turn_intent_classified",
36
+ "asset_manifest_updated",
37
+ "run_waiting_for_user",
38
+ "billing_preview_updated",
39
+ "spend_gate_opened",
40
+ "spend_preview_emitted",
41
+ "spend_confirmed",
42
+ "spend_cancelled",
43
+ "spend_insufficient",
44
+ "run_awaiting_cost_confirmation",
45
+ "run_cost_confirmation_resolved",
46
+ "stage_started",
47
+ "stage_completed",
48
+ "stage_failed",
49
+ "stage_waiting_for_user",
50
+ "audit_evaluated",
51
+ "repair_requested"
52
+ ]
53
+ },
54
+ "RunStatus": {
55
+ "type": "string",
56
+ "description": "Unified status enum across chat and workflow runs.",
57
+ "enum": [
58
+ "queued",
59
+ "running",
60
+ "completed",
61
+ "partial_failure",
62
+ "waiting_for_user",
63
+ "failed",
64
+ "cancelled"
65
+ ]
66
+ },
67
+ "WaitingReason": {
68
+ "type": "string",
69
+ "description": "Why a run paused. Carried inside the payload of a run_waiting_for_user event (and stage_waiting_for_user where applicable).",
70
+ "enum": [
71
+ "ask_clarifying_question",
72
+ "select_media_required",
73
+ "cost_approval_required",
74
+ "safety_review_required",
75
+ "workflow_user_input_required",
76
+ "insufficient_credit",
77
+ "other"
78
+ ]
79
+ }
80
+ },
81
+ "properties": {
82
+ "runId": { "type": "string" },
83
+ "runKind": {
84
+ "type": "string",
85
+ "enum": ["chat", "workflow", "tool_batch"],
86
+ "description": "Substrate discriminator (plan §13.5). chat and workflow runs share persistence, lease, heartbeat, event log, waiting semantics, cancellation, cost confirmation, and resume. tool_batch is used by sogni-creative-agent-v2 for fan-out tool-call runs that share the same event substrate without being a full chat or workflow run."
87
+ },
88
+ "sequence": {
89
+ "type": "integer",
90
+ "minimum": 0,
91
+ "description": "Strictly increasing per runId. SSE replay key is (runId, sequence)."
92
+ },
93
+ "type": { "$ref": "#/$defs/RunEventType" },
94
+ "status": { "$ref": "#/$defs/RunStatus" },
95
+ "payload": {
96
+ "type": "object",
97
+ "additionalProperties": true,
98
+ "description": "Per-type payload. Documented shapes: run_waiting_for_user -> { reason: WaitingReason, ... }; tool_call_proposed/_dispatched/_progress/_resolved -> { toolCallId, toolName, ... }; artifact_* -> { artifactId, ... }; spend_* -> { gateId, scope, ... }; audit_evaluated -> { toolCallId, passed, ... }; repair_requested -> { toolCallId, reason, retryCount }; stage_* -> { stageId, ... }. Schema-level enforcement of these shapes is intentionally deferred to Phase 1 to avoid an unwieldy union here."
99
+ },
100
+ "createdAt": { "type": "string", "format": "date-time" },
101
+ "resumable": {
102
+ "type": "boolean",
103
+ "description": "True when the run is in a state the client can resume from (typically paired with run_waiting_for_user)."
104
+ },
105
+ "terminal": {
106
+ "type": "boolean",
107
+ "description": "True for the final event of a run (run_completed / run_failed / run_cancelled / run_partial_failure)."
108
+ },
109
+ "idempotencyKey": {
110
+ "type": "string",
111
+ "description": "Stable key for reentrant transitions (e.g. POST /confirm-cost). Re-submitting the same key MUST be a no-op."
112
+ }
113
+ },
114
+ "required": [
115
+ "runId",
116
+ "runKind",
117
+ "sequence",
118
+ "type",
119
+ "payload",
120
+ "createdAt"
121
+ ]
122
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/events/workflow-event.schema.json",
4
+ "title": "Creative agent workflow event",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "workflowId": { "type": "string" },
11
+ "sequence": { "type": "integer", "minimum": 0 },
12
+ "timestamp": { "type": "string", "format": "date-time" },
13
+ "type": {
14
+ "type": "string",
15
+ "enum": ["workflow_started", "workflow_progress", "workflow_completed", "workflow_failed", "workflow_cancelled", "workflow_waiting_for_user", "step_started", "step_completed", "step_failed", "step_waiting_for_user", "artifact_created", "custom"]
16
+ },
17
+ "status": { "type": "string", "enum": ["queued", "running", "completed", "partial_failure", "waiting_for_user", "failed", "cancelled"] },
18
+ "message": { "type": "string" },
19
+ "data": { "type": "object", "additionalProperties": true }
20
+ },
21
+ "required": ["id", "workflowId", "sequence", "timestamp", "type"]
22
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://sogni.ai/schemas/prompt-contract.schema.json",
4
+ "title": "PromptContract",
5
+ "description": "A PromptContract owns a tool's LLM-visible description and per-parameter docstrings. One contract per tool. Files in prompts/tools/*.json validate against this shape.",
6
+ "type": "object",
7
+ "required": ["contractId", "version", "toolName", "baseDescription", "parameterDocs"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "contractId": {
11
+ "type": "string",
12
+ "description": "Stable identifier for telemetry and registry lookup. Convention: <toolName>_v<n>."
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "description": "Semver string. Bumped when the contract's data shape changes."
17
+ },
18
+ "toolName": {
19
+ "type": "string",
20
+ "description": "Tool the contract describes. Must match a registered tool name from enums/tool-names.json."
21
+ },
22
+ "baseDescription": {
23
+ "type": "string",
24
+ "description": "Default description shown to the LLM when this tool is visible."
25
+ },
26
+ "parameterDocs": {
27
+ "type": "object",
28
+ "description": "Per-parameter docstrings keyed by parameter name.",
29
+ "additionalProperties": { "type": "string" }
30
+ },
31
+ "voiceExamples": {
32
+ "type": "array",
33
+ "items": { "type": "string" },
34
+ "description": "Tool-specific voice or style examples (e.g. screenplay format for video)."
35
+ },
36
+ "conditionalNotes": {
37
+ "type": "object",
38
+ "description": "Conditional description fragments keyed by signal name. Appended to the baked description when the corresponding signal is present in the turn policy.",
39
+ "additionalProperties": { "type": "string" }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "title": "storyboard planning contract",
3
+ "schemaVersion": "2026-05-12.1",
4
+ "description": "Typed planner payload for storyboard layout and text-rendering decisions. Renderable visible text is intentionally separate from non-renderable production metadata labels.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "source", "layout", "scenes", "endCard", "metadataLabels"],
8
+ "properties": {
9
+ "schemaVersion": {
10
+ "type": "string",
11
+ "const": "storyboard-planning-contract/v1"
12
+ },
13
+ "source": {
14
+ "type": "string",
15
+ "enum": ["llm_schema", "assistant_metadata", "user_schema", "fallback_text"]
16
+ },
17
+ "layout": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": ["source", "storyboardCanvasAspectRatio", "storyboardCellAspectRatio", "targetVideoAspectRatio", "boardDimensions"],
21
+ "properties": {
22
+ "source": {
23
+ "type": "string",
24
+ "enum": ["llm_schema", "assistant_metadata", "user_schema", "fallback_text"]
25
+ },
26
+ "storyboardCanvasAspectRatio": {
27
+ "type": "string",
28
+ "description": "Aspect ratio for the composite storyboard sheet/page, such as 16:9 or 9:16."
29
+ },
30
+ "storyboardCellAspectRatio": {
31
+ "type": "string",
32
+ "description": "Aspect ratio for each cinematic video-frame artwork area inside the storyboard."
33
+ },
34
+ "targetVideoAspectRatio": {
35
+ "type": "string",
36
+ "description": "Final video aspect ratio, such as 9:16 for vertical social video."
37
+ },
38
+ "boardDimensions": {
39
+ "type": "string",
40
+ "description": "Optional exact storyboard board dimensions, such as 2560x1440 or 1440x2560."
41
+ }
42
+ }
43
+ },
44
+ "scenes": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["id", "index", "visibleText", "metadataLabels", "referenceUsage"],
50
+ "properties": {
51
+ "id": {
52
+ "type": "string"
53
+ },
54
+ "index": {
55
+ "type": "integer",
56
+ "minimum": 1,
57
+ "maximum": 24
58
+ },
59
+ "visibleText": {
60
+ "type": "array",
61
+ "items": {
62
+ "type": "string"
63
+ },
64
+ "description": "Only text that should actually appear inside the final video frame, such as brand copy, CTA text, signage, captions, or diegetic text."
65
+ },
66
+ "metadataLabels": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string"
70
+ },
71
+ "description": "Production labels, timing notes, scene numbers, overlay markers, placeholders, and other notes that may guide the storyboard but must not be rendered inside a video scene or Seedance output."
72
+ },
73
+ "referenceUsage": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "string"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ },
82
+ "endCard": {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": ["visibleText", "metadataLabels"],
86
+ "properties": {
87
+ "visibleText": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "metadataLabels": {
94
+ "type": "array",
95
+ "items": {
96
+ "type": "string"
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "metadataLabels": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "string"
105
+ }
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.sogni.ai/creative-agent/2026-04-27.1/tools/add_subtitles.schema.json",
4
+ "title": "add_subtitles arguments",
5
+ "schemaVersion": "2026-04-27.1",
6
+ "description": "Burn subtitles into a video from caller-supplied cues or an SRT/VTT string. Use when the user asks to add captions, subtitles, on-screen dialogue, or burned-in lyrics to a video. Either pass `cues` as an array of {startSeconds, endSeconds, text}, or pass a full `srt` string. Pace cues like real subtitles: split the script into multiple short cues (typically 1.5–4 seconds each, ~1–8 words per cue, roughly 15–20 characters per second of cue duration). Never burn a single cue that spans the entire clip — even a static image should get progressively revealed lines, not one paragraph held on screen the whole time. Auto-transcription (auto_transcribe=true) is not yet enabled and will return USER_INPUT_INCOMPLETE — when the user has not supplied lines, ask them for the cue text and timing instead of calling with auto_transcribe. If the user explicitly asks you to write, invent, improvise, or make up captions/subtitles, create a few short, generic cue lines yourself and call this tool with cues; do not ask a follow-up for exact wording in that case.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "sourceVideoIndex": {
11
+ "type": "number",
12
+ "description": "Which video to subtitle. Default: -1 (most recent generated or uploaded video). Non-negative values are 0-based indices into prior generated video results. Negative values reference uploaded videos."
13
+ },
14
+ "cues": {
15
+ "type": "array",
16
+ "description": "Ordered subtitle cues. Each cue has startSeconds, endSeconds, and the line of text to display. Provide either `cues` or `srt`, not both. Aim for multiple short cues (1.5–4s each, ~1–8 words) rather than one long cue spanning the full clip.",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "startSeconds": {
21
+ "type": "number",
22
+ "minimum": 0
23
+ },
24
+ "endSeconds": {
25
+ "type": "number",
26
+ "minimum": 0
27
+ },
28
+ "text": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "required": [
33
+ "startSeconds",
34
+ "endSeconds",
35
+ "text"
36
+ ]
37
+ }
38
+ },
39
+ "srt": {
40
+ "type": "string",
41
+ "description": "Full SRT (or VTT) document as a string, used in place of `cues`. Useful when the user pastes a subtitle file directly. Provide either `cues` or `srt`, not both."
42
+ },
43
+ "auto_transcribe": {
44
+ "type": "boolean",
45
+ "description": "Reserved for future speech-to-text support. Currently returns USER_INPUT_INCOMPLETE so the LLM can ask the user to supply cues. Do not set this — gather cue text from the user instead."
46
+ },
47
+ "style": {
48
+ "type": "object",
49
+ "description": "Optional styling overrides for the burned subtitles.",
50
+ "properties": {
51
+ "fontSizePct": {
52
+ "type": "number",
53
+ "minimum": 1,
54
+ "maximum": 30,
55
+ "description": "Font size as a percentage of the video height. Default 6."
56
+ },
57
+ "color": {
58
+ "type": "string",
59
+ "description": "Subtitle fill color. Default \"#FFFFFF\"."
60
+ },
61
+ "outlineColor": {
62
+ "type": "string",
63
+ "description": "Subtitle outline color. Default \"#000000\"."
64
+ },
65
+ "position": {
66
+ "type": "string",
67
+ "enum": [
68
+ "bottom",
69
+ "top",
70
+ "center"
71
+ ],
72
+ "description": "Vertical placement of the subtitle line. Default \"bottom\"."
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }