@slatesvideo/shared 0.7.0 → 0.7.2

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.
@@ -61,7 +61,8 @@ export declare function toolDefinition(op: SurfaceOp): ToolDefinition;
61
61
  * Render a tool surface.
62
62
  *
63
63
  * `desktop` sends `core` plus whatever groups have been loaded this run; `mcp`
64
- * renders all definitions; the MCP server filters its connection listing from that set.
64
+ * renders all definitions, and the MCP server lists all of them unless started with
65
+ * `--tools=compact`.
65
66
  */
66
67
  export declare function toolDefinitions(ops: readonly SurfaceOp[], opts: {
67
68
  surface: 'desktop' | 'mcp';
@@ -11,9 +11,12 @@
11
11
  //
12
12
  // 2. TIERS. 90 ops is 112 KB of descriptions and JSON schemas on EVERY
13
13
  // desktop Studio Agent turn. `core` is what a session needs to work;
14
- // `extended` is selected through `slates_load_tools`. Both surfaces replace
15
- // the optional selection on a named/group load. MCP keeps every direct
16
- // operation callable for compatibility and notifies when its listing changes.
14
+ // `extended` is selected through `slates_load_tools`. Tiers are a DESKTOP
15
+ // mechanism: we build every turn there, so a load reaches the model. The
16
+ // MCP server lists every op and leaves hiding definitions to the host
17
+ // (tiering there left Claude and Codex users unable to generate in 0.6.0;
18
+ // see the TOOLS comment in packages/mcp/src/server.ts). `--tools=compact`
19
+ // is the opt-in exception.
17
20
  //
18
21
  // 3. ONE SCHEMA RENDERER. The desktop rendered `$refStrategy: 'none'` and
19
22
  // the MCP server rendered `target: 'openApi3'`, so "the two surfaces
@@ -142,6 +145,9 @@ export const OPERATION_GROUPS = {
142
145
  'slates_relocate_project',
143
146
  'slates_undo_relocate_project',
144
147
  'slates_reveal_file',
148
+ 'slates_reorder_folders',
149
+ 'slates_reorder_pins',
150
+ 'slates_link_asset_source',
145
151
  ],
146
152
  // The cut and the export. A generation session never touches these.
147
153
  script: ['slates_get_script_document', 'slates_update_script_document', 'slates_get_script_sections', 'slates_update_script_section', 'slates_get_script_suggestions', 'slates_update_script_suggestions', 'slates_get_script_uses', 'slates_preview_script_variation', 'slates_create_script_variation', 'slates_get_shot_inputs', 'slates_reuse_shot_take'],
@@ -179,6 +185,9 @@ export const OPERATION_GROUPS = {
179
185
  'slates_duplicate_shot',
180
186
  'slates_split_shot',
181
187
  'slates_merge_shots',
188
+ 'slates_get_usage',
189
+ 'slates_get_app_settings',
190
+ 'slates_set_app_settings',
182
191
  ],
183
192
  // A third transport nobody without Blender installed can reach.
184
193
  blender: [
@@ -238,7 +247,8 @@ export function toolDefinition(op) {
238
247
  * Render a tool surface.
239
248
  *
240
249
  * `desktop` sends `core` plus whatever groups have been loaded this run; `mcp`
241
- * renders all definitions; the MCP server filters its connection listing from that set.
250
+ * renders all definitions, and the MCP server lists all of them unless started with
251
+ * `--tools=compact`.
242
252
  */
243
253
  export function toolDefinitions(ops, opts) {
244
254
  const loaded = new Set(opts.groups ?? []);
@@ -76,13 +76,34 @@ export function buildSkillIndex() {
76
76
  return entries;
77
77
  }
78
78
  // ── Preamble ───────────────────────────────────────────────────────
79
- const PREAMBLE = fork(`You are the Slates Studio Agent — a production assistant living inside Slates, the AI video creation studio. You plan and execute video/image production runs by chaining the Slates tools: script → characters → images → videos → quality-check → regenerate, ending with assets in the user's project (and on the timeline when asked).`, `You are connected to Slates, the AI video creation studio, through its MCP tool surface. These tools plan and execute real video/image production runs that spend the user's Slates credits: script → characters → images → videos → quality-check → regenerate, ending with assets in the user's project. Follow the working method and hard rules below on every Slates task — this is the same doctrine the in-app Studio Agent runs on.`);
79
+ // FORKED, and the MCP side is a SUMMARY THAT MUST FIT IN THE CUT. Claude Code
80
+ // keeps only the first 2,048 characters of a server's instructions (docs,
81
+ // 2026-09-30), and 0.6.0's cut fell mid-sentence in step 4, so every hard rule
82
+ // after it never reached the model. What an agent needs to act safely — how to
83
+ // find a tool when the host shows names only, the spend gate, real numbers, the
84
+ // current project — sits here; the sections below expand it for clients that
85
+ // read everything. mcp-instructions-smoke asserts these lines land inside the
86
+ // cut with the UPDATE AVAILABLE notice in front of them.
87
+ const PREAMBLE = fork(`You are the Slates Studio Agent — a production assistant living inside Slates, the AI video creation studio. You plan and execute video/image production runs by chaining the Slates tools: script → characters → images → videos → quality-check → regenerate, ending with assets in the user's project (and on the timeline when asked).`, `You are connected to Slates, the AI video creation studio. These tools run real image, video and audio generations that spend the user's Slates credits, ending with assets in the user's project.
88
+
89
+ ## Essentials (the sections below expand on these)
90
+
91
+ - FINDING TOOLS: every Slates capability is its own slates_* tool. If your client shows tool names only, search your tools for the task (for example "slates generate video") and load that tool before calling it. If a tool is missing from your list entirely, slates_load_tools finds and loads it.
92
+ - SPENDING: before ANY generation, price every step with slates_estimate_generation_cost, show the user the itemized total in ONE message, and wait for their OK. Pass confirm: true only to relay an explicit user OK for that exact spend.
93
+ - REAL NUMBERS ONLY: every cost, balance or count you state is copied from a tool result in this session. Never describe how a generation looks unless you fetched it this session.
94
+ - PROJECT: call slates_get_workspace_state once, work in the user's current project, and never create a project unless asked.
95
+ - CRAFT: before prompting a model, read its guide with slates_get_prompting_guide (pass the model id). For how or where in the app, use topic "app-manual".
96
+ - Speak in the app's words and name assets by code and label (IMG-A12), never by tool name or UUID.`);
80
97
  // ── The working method ─────────────────────────────────────────────
81
98
  export const WORKING_METHOD = [
82
- both(`For HOW/WHERE questions, load slates_get_prompting_guide with topic "app-manual" and relevant query keywords. Teach the documented buttons and tabs, preserving model-specific conditions; do not invent UI paths or mutate the project when the user only asks for instructions. Slates is a sandbox of optional tools, not a required pipeline.`),
99
+ both(`For HOW/WHERE questions, load slates_get_prompting_guide with topic "app-manual" and relevant query keywords. Teach the documented buttons and tabs, preserving model-specific conditions; do not invent UI paths or mutate the project when the user only asks for instructions. When the control is on screen, offer to point at it (slates_highlight_control); show a picture of a screen (slates_get_manual_picture) only when the user cannot find something or asks what it looks like. Slates is a sandbox of optional tools, not a required pipeline.`),
83
100
  both(`1. UNDERSTAND the outcome the user wants. If intent is clear, act with sane defaults — don't interrogate. If genuinely ambiguous, batch every question into ONE message.`),
84
101
  both(`2. ORIENT: call slates_get_workspace_state once at the start of a workflow. Work in the user's CURRENT project — this chat lives inside it. NEVER create a new project unless explicitly asked; if there's no current project, ask which to use.`),
85
- both(`3. LOAD KNOWLEDGE ON DEMAND: slates_get_prompting_guide returns a short card by default; query a section or technique when needed. Use slates_load_tools with query to find a capability, then names to load its exact schema. A load replaces the previous optional selection. Before quoting a model, load its tool schema or routing guide. Use workspace generationDefaults when the user has no preference. Read the model card delivered by the estimate; fetch a section or full guide for an unfamiliar mode or missing detail. Reuse guidance already in context; retrieve it again when omitted or stale.`),
102
+ // FORKED: the desktop sends core tools plus what `slates_load_tools` loaded,
103
+ // so its agent must load before calling. The MCP server lists every tool and
104
+ // the host decides what to show (Essentials, FINDING TOOLS), so telling an MCP
105
+ // client to load first costs it a turn for a tool it already has.
106
+ fork(`3. LOAD KNOWLEDGE ON DEMAND: slates_get_prompting_guide returns a short card by default; query a section or technique when needed. Use slates_load_tools with query to find a capability, then names to load its exact schema. A load replaces the previous optional selection. Before quoting a model, load its tool schema or routing guide. Use workspace generationDefaults when the user has no preference. Read the model card delivered by the estimate; fetch a section or full guide for an unfamiliar mode or missing detail. Reuse guidance already in context; retrieve it again when omitted or stale.`, `3. LOAD KNOWLEDGE ON DEMAND: slates_get_prompting_guide returns a short card by default; query a section or technique when needed. Before quoting a model, read its tool schema or routing guide. Use workspace generationDefaults when the user has no preference. Read the model card delivered by the estimate; fetch a section or full guide for an unfamiliar mode or missing detail. Reuse guidance already in context; retrieve it again when omitted or stale.`),
86
107
  // FORKED: `present_plan` is a loop-level DESKTOP tool, deliberately not in
87
108
  // ALL_OPERATIONS, so MCP never sees it and has no plan gate at all. Its
88
109
  // substitute is the per-op `requires_confirm` threshold plus the host
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slatesvideo/shared",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Shared operations layer for the Slates MCP server and CLI: auth, cloud/desktop clients, and the single tool surface both consume. Most users want @slatesvideo/mcp-server or @slatesvideo/cli instead.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  "dist",
41
41
  "!dist/**/*.map",
42
42
  "skills",
43
- "exports/slates-prompt-builder/generated",
43
+ "exports/slates-prompt-builder/generated",
44
44
  "exports/slates-chatgpt-images/generated",
45
45
  "README.md"
46
46
  ],
@@ -48,7 +48,7 @@
48
48
  "sync-partials": "node scripts/sync-partials.mjs",
49
49
  "build-prompt-builder": "node scripts/build-prompt-builder.mjs",
50
50
  "check-prompt-builder": "node scripts/build-prompt-builder.mjs --check",
51
- "build-chatgpt-skill": "node scripts/build-chatgpt-skill.mjs",
51
+ "build-chatgpt-skill": "node scripts/build-chatgpt-skill.mjs",
52
52
  "build": "node scripts/build-chatgpt-skill.mjs --check && node scripts/sync-partials.mjs --check && node scripts/build-prompt-builder.mjs --check && node scripts/embed-skills.mjs && tsc && node scripts/render-capability-partials.mjs --check && node scripts/update-check-check.mjs",
53
53
  "typecheck": "node scripts/sync-partials.mjs --check && node scripts/build-prompt-builder.mjs --check && node scripts/embed-skills.mjs && tsc --noEmit",
54
54
  "prepublishOnly": "npm run build && node ../../scripts/cinematic-catalogue-check.mjs && node ../../scripts/prompt-control-check.mjs",