@engenty/wizards-runtime 0.11.6 → 0.11.8

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 (117) hide show
  1. package/apps/runtime/dist/agents/architect.js +37 -53
  2. package/apps/runtime/dist/agents/company.js +4 -12
  3. package/apps/runtime/dist/agents/studio-assistant.js +57 -70
  4. package/apps/runtime/dist/agents/subscription.js +3 -6
  5. package/apps/runtime/dist/app.js +3 -0
  6. package/apps/runtime/dist/assistant/knows.js +19 -19
  7. package/apps/runtime/dist/auth/account.js +51 -12
  8. package/apps/runtime/dist/authoring/guide.js +20 -447
  9. package/apps/runtime/dist/browser/fast/run.js +18 -12
  10. package/apps/runtime/dist/cli/account.js +127 -10
  11. package/apps/runtime/dist/cli/main.js +4 -2
  12. package/apps/runtime/dist/connectors/mail.js +4 -3
  13. package/apps/runtime/dist/documents/parse.js +5 -14
  14. package/apps/runtime/dist/engine/decide.js +2 -1
  15. package/apps/runtime/dist/engine/runner.js +4 -3
  16. package/apps/runtime/dist/engine/steps.js +82 -91
  17. package/apps/runtime/dist/engine/template.js +2 -3
  18. package/apps/runtime/dist/harness/antigravity.js +2 -2
  19. package/apps/runtime/dist/harness/apple.js +4 -6
  20. package/apps/runtime/dist/harness/codex.js +5 -6
  21. package/apps/runtime/dist/harness/prompt.js +8 -8
  22. package/apps/runtime/dist/mcp/handler.js +5 -7
  23. package/apps/runtime/dist/mcp/tools.js +33 -54
  24. package/apps/runtime/dist/media/conversation.js +18 -23
  25. package/apps/runtime/dist/media/generate.js +18 -3
  26. package/apps/runtime/dist/media/transcribe.js +5 -4
  27. package/apps/runtime/dist/motion-graphics/project.js +19 -53
  28. package/apps/runtime/dist/motion-graphics/sounds.js +2 -1
  29. package/apps/runtime/dist/motion-graphics/step.js +31 -16
  30. package/apps/runtime/dist/open-command.js +31 -0
  31. package/apps/runtime/dist/prompts/README.md +48 -0
  32. package/apps/runtime/dist/prompts/architect.md +89 -0
  33. package/apps/runtime/dist/prompts/authoring.md +503 -0
  34. package/apps/runtime/dist/prompts/goose.md +229 -0
  35. package/apps/runtime/dist/prompts/mcp.md +156 -0
  36. package/apps/runtime/dist/prompts/safety.md +23 -0
  37. package/apps/runtime/dist/prompts/services.md +151 -0
  38. package/apps/runtime/dist/prompts/step.md +334 -0
  39. package/apps/runtime/dist/prompts/tools.md +330 -0
  40. package/apps/runtime/dist/prompts/voice.md +53 -0
  41. package/apps/runtime/dist/prompts.js +50 -0
  42. package/apps/runtime/dist/routes/studio.js +19 -1
  43. package/apps/runtime/dist/safety.js +45 -0
  44. package/apps/runtime/dist/sandbox/index.js +8 -3
  45. package/apps/runtime/dist/services/assistant-chats.js +5 -8
  46. package/apps/runtime/dist/services/brand.js +2 -7
  47. package/apps/runtime/dist/services/cloud.js +8 -4
  48. package/apps/runtime/dist/services/knowledge-model.js +17 -8
  49. package/apps/runtime/dist/services/knowledge.js +5 -9
  50. package/apps/runtime/dist/services/project-files.js +3 -8
  51. package/apps/runtime/dist/services/relevance.js +4 -3
  52. package/apps/runtime/dist/services/runs.js +6 -7
  53. package/apps/runtime/dist/services/site.js +2 -2
  54. package/apps/runtime/dist/services/translations.js +17 -10
  55. package/apps/runtime/dist/sync/client.js +116 -1
  56. package/apps/runtime/dist/tools/browser.js +36 -33
  57. package/apps/runtime/dist/tools/code.js +20 -6
  58. package/apps/runtime/dist/tools/connector.js +23 -9
  59. package/apps/runtime/dist/tools/index.js +14 -11
  60. package/apps/runtime/dist/tools/mail.js +5 -5
  61. package/apps/runtime/dist/tools/net-guard.js +4 -4
  62. package/apps/runtime/dist/tools/pages.js +3 -2
  63. package/apps/runtime/dist/tools/project.js +7 -8
  64. package/apps/runtime/dist/tools/store.js +14 -10
  65. package/apps/web/dist/assets/{AboutDialog-30Mc1_N_.js → AboutDialog-BWc0zi6S.js} +1 -1
  66. package/apps/web/dist/assets/{ChangelogDialog-Vjxg6JV8.js → ChangelogDialog-Ctkpgtt8.js} +1 -1
  67. package/apps/web/dist/assets/{CodeEditor-CmMRfVhS.js → CodeEditor-ydfkafOX.js} +1 -1
  68. package/apps/web/dist/assets/{EditorPage-Di5KB-Ei.js → EditorPage-C2lCK9wY.js} +1 -1
  69. package/apps/web/dist/assets/{FlowPreview-BkcO3iCf.js → FlowPreview-CPEK110v.js} +1 -1
  70. package/apps/web/dist/assets/{Harness-D_Hr80Fo.js → Harness-CeEYZGHB.js} +1 -1
  71. package/apps/web/dist/assets/Marketplace-_IfcAgYO.js +2 -0
  72. package/apps/web/dist/assets/{NewWizardChannels-BIzOtfc8.js → NewWizardChannels-Rq4Oc1OM.js} +1 -1
  73. package/apps/web/dist/assets/{NewWizardPage-BenzMrPD.js → NewWizardPage-CCR_U2vH.js} +1 -1
  74. package/apps/web/dist/assets/{OnboardingPage-DuckyzQr.js → OnboardingPage-CcaxqyzN.js} +1 -1
  75. package/apps/web/dist/assets/{PreviewPane-D9hmriSm.js → PreviewPane-By692ez7.js} +2 -2
  76. package/apps/web/dist/assets/{ProjectPage-A8Z8cS1E.js → ProjectPage-ClMgq06-.js} +1 -1
  77. package/apps/web/dist/assets/PublicRunner-BtUu5LCy.js +1 -0
  78. package/apps/web/dist/assets/{ReadOnly-DFn32cvo.js → ReadOnly-B2BSJ7ms.js} +1 -1
  79. package/apps/web/dist/assets/SettingsPage-DGHco15-.js +2 -0
  80. package/apps/web/dist/assets/{SetupPage-WNHH74hu.js → SetupPage-CNJY56MI.js} +1 -1
  81. package/apps/web/dist/assets/{SharePage-Bw4TRWtv.js → SharePage-ZolaYse9.js} +1 -1
  82. package/apps/web/dist/assets/changelog-CWPHX0Hf.js +1 -0
  83. package/apps/web/dist/assets/i18n-BX8GnEZT.js +55 -0
  84. package/apps/web/dist/assets/index-5U3h_chZ.js +34 -0
  85. package/apps/web/dist/assets/{index-Bha72INy.css → index-BYZBN0xx.css} +1 -1
  86. package/apps/web/dist/assets/{oss-credits-CZT1KRIp.js → oss-credits-Da4KrYmP.js} +1 -1
  87. package/apps/web/dist/assets/{phone-DymZ7rLO.js → phone-Dd7IVbpJ.js} +1 -1
  88. package/apps/web/dist/assets/{runners-UfKeoOe4.js → runners-XifDCQG3.js} +1 -1
  89. package/apps/web/dist/assets/{session-COf_im0l.js → session-BwtsznZF.js} +1 -1
  90. package/apps/web/dist/assets/{settings-menu-mtOjI15L.js → settings-menu-CS-fXrFW.js} +1 -1
  91. package/apps/web/dist/assets/{theme-DWoTWDAG.js → theme-CnRjADMg.js} +2 -2
  92. package/apps/web/dist/assets/ui-D719V_Yj.js +83 -0
  93. package/apps/web/dist/assets/{upload-BizIzwxa.js → upload-CYTDCrYd.js} +1 -1
  94. package/apps/web/dist/assets/{useMutation-BJfRETsQ.js → useMutation-CVVmJvyz.js} +1 -1
  95. package/apps/web/dist/assets/{volume-2-BGkyA8T9.js → volume-2-Do0dsjv2.js} +1 -1
  96. package/apps/web/dist/assets/{wrench-Be5zav03.js → wrench-C5syJD9J.js} +1 -1
  97. package/apps/web/dist/index.html +8 -9
  98. package/apps/web/dist/mcp/flow.html +87 -87
  99. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +5 -0
  100. package/node_modules/@engenty/wizards-shared/dist/run.js +10 -0
  101. package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +3 -1
  102. package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +2 -0
  103. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +0 -2
  104. package/node_modules/@engenty/wizards-shared/dist/surface.js +0 -29
  105. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +5 -0
  106. package/package.json +2 -2
  107. package/plugin/.claude-plugin/plugin.json +1 -1
  108. package/plugin/plugin.json +1 -1
  109. package/apps/runtime/dist/assistant/primer.js +0 -26
  110. package/apps/web/dist/assets/Marketplace-BxFBMUsi.js +0 -2
  111. package/apps/web/dist/assets/PublicRunner-QPvlEAxx.js +0 -1
  112. package/apps/web/dist/assets/SettingsPage-ByP15ndy.js +0 -2
  113. package/apps/web/dist/assets/changelog-Dr9tAFY9.js +0 -1
  114. package/apps/web/dist/assets/coins-DTH3SKgZ.js +0 -1
  115. package/apps/web/dist/assets/i18n-CLxuuhp_.js +0 -55
  116. package/apps/web/dist/assets/index-HhslPV6N.js +0 -34
  117. package/apps/web/dist/assets/ui-D_0Xdrjh.js +0 -83
@@ -10,6 +10,7 @@ import { failureOf } from "../harness/model.js";
10
10
  import { openBridge } from "../mcp/bridge.js";
11
11
  import { saidOf } from "../model-errors.js";
12
12
  import { motionClient } from "../models.js";
13
+ import { prompt } from "../prompts.js";
13
14
  import { keepBrandBase, prepareMotionFolder, savedSession, saveSession } from "./project.js";
14
15
  import { runHyperframes } from "./tools.js";
15
16
  /**
@@ -45,14 +46,14 @@ const LIMIT_MS = 3 * 60 * 60_000;
45
46
  function hyperframesTool(root, signal) {
46
47
  return {
47
48
  name: "hyperframes",
48
- description: "Runs the HyperFrames CLI in the video folder: lint, check, snapshot, render, inspect, timeline, transcribe, keyframes, compare, docs and the like. Paths are relative to the folder. Returns what it printed.",
49
+ description: prompt("step", "motion.tool"),
49
50
  inputSchema: {
50
51
  type: "object",
51
52
  properties: {
52
53
  args: {
53
54
  type: "array",
54
55
  items: { type: "string" },
55
- description: 'The arguments, e.g. ["snapshot", "video", "--at", "1,4,8"].',
56
+ description: prompt("step", "motion.tool.args"),
56
57
  },
57
58
  },
58
59
  required: ["args"],
@@ -60,17 +61,20 @@ function hyperframesTool(root, signal) {
60
61
  async execute(input) {
61
62
  const args = (input.args ?? []);
62
63
  if (!args.length || !args.every((a) => typeof a === "string")) {
63
- return "args: a list of strings, the subcommand first.";
64
+ return prompt("step", "motion.tool.no_args");
64
65
  }
65
66
  const [cmd] = args;
66
67
  if (!ALLOWED.has(cmd)) {
67
- return `"${cmd}" is not available here. Available: ${[...ALLOWED].join(", ")}.`;
68
+ return prompt("step", "motion.tool.not_allowed", {
69
+ command: cmd,
70
+ allowed: [...ALLOWED].join(", "),
71
+ });
68
72
  }
69
73
  // Every path stays inside the folder.
70
74
  for (const a of args) {
71
75
  const value = a.includes("=") && a.startsWith("-") ? a.slice(a.indexOf("=") + 1) : a;
72
76
  if (isAbsolute(value) || normalize(value).startsWith("..")) {
73
- return `"${a}" leaves the video folder.`;
77
+ return prompt("step", "motion.tool.outside", { arg: a });
74
78
  }
75
79
  }
76
80
  const extra = cmd === "transcribe" ? ["--no-runtime-install"] : [];
@@ -106,7 +110,7 @@ export async function runMotionGraphicsStep(step, ctx) {
106
110
  const limit = AbortSignal.any([ctx.signal, AbortSignal.timeout(LIMIT_MS)]);
107
111
  const bridge = openBridge([hyperframesTool(root, limit)]);
108
112
  /** One turn of the client in the folder; returns its final event. */
109
- const turn = async (prompt, session) => {
113
+ const turn = async (message, session) => {
110
114
  const args = [
111
115
  "-p",
112
116
  "--output-format",
@@ -224,7 +228,7 @@ export async function runMotionGraphicsStep(step, ctx) {
224
228
  });
225
229
  child.on("error", reject);
226
230
  child.on("close", () => resolve());
227
- child.stdin.end(prompt);
231
+ child.stdin.end(message);
228
232
  })().catch(reject);
229
233
  }).catch((err) => {
230
234
  if (ctx.signal.aborted) {
@@ -249,17 +253,28 @@ export async function runMotionGraphicsStep(step, ctx) {
249
253
  const brandNote = !brandChanged
250
254
  ? ""
251
255
  : start === "init"
252
- ? "\n\nThe space's brand has changed since the video was made: brand/brand.json and brand/logos/ are new. Carry them into the video wherever it uses the brand (its own copies included), so every colour, logo and name is the new one, and check the frames for contrast."
253
- : "\n\nThe space's brand has changed since the video was made: video/brand/brand.json and the logos are new. If video/brand/theme.json is missing, make it again as video/BRAND.md says. Make sure every colour, logo and name in the video is the new one, and check the frames for contrast.";
256
+ ? prompt("step", "motion.brand_changed.init")
257
+ : prompt("step", "motion.brand_changed.base");
254
258
  const size = MOTION_SIZES[step.format];
255
- const prompt = resume && note
256
- ? `The person watched the video and asks for this change:\n\n${note}${brandNote}\n\nChange the video in video/ accordingly — keep what they did not mention — check the frames again, and end with a short summary of what you changed.`
259
+ const request = resume && note
260
+ ? [
261
+ prompt("step", "motion.change", { note }),
262
+ brandNote,
263
+ prompt("step", "motion.change.then"),
264
+ ]
265
+ .filter(Boolean)
266
+ .join("\n\n")
257
267
  : resume
258
- ? `Carry on with the video where you stopped. Read PROGRESS.md and the folder to see where that was, then finish it.${brandNote}`
268
+ ? [prompt("step", "motion.resume"), brandNote].filter(Boolean).join("\n\n")
259
269
  : start === "from"
260
- ? `video/ holds this run's video in another format. Lay it out for ${step.format} (${size.width}×${size.height}), following CLAUDE.md: set the size of video/index.html, then make every scene fit — scenes, timing, words and sound stay. Check the frames, render a draft, and end with a short summary of what you changed.\n\nThe brief, for reference:\n\n${brief}`
261
- : `Make the video BRIEF.md asks for, following CLAUDE.md.\n\n${brief}`;
262
- const first = await turn(prompt, resume);
270
+ ? prompt("step", "motion.from", {
271
+ format: step.format,
272
+ width: size.width,
273
+ height: size.height,
274
+ brief,
275
+ })
276
+ : prompt("step", "motion.make", { brief });
277
+ const first = await turn(request, resume);
263
278
  summary = typeof first.result === "string" ? first.result.trim() : "";
264
279
  // The final render is ours: it does not depend on the client still running. What fails
265
280
  // goes back to the client, which fixes its code.
@@ -278,7 +293,7 @@ export async function runMotionGraphicsStep(step, ctx) {
278
293
  throw new StepError(runNote("motionRenderFailed", { detail: problem.slice(0, 400) }));
279
294
  }
280
295
  await ctx.emit("tool", { code: "motionFix" });
281
- const fixed = await turn(`The final render of video/ failed:\n\n${problem}\n\nFind the cause in the composition's code, fix it, run \`check\` and a draft render through the hyperframes tool until both pass, and end with one line on what you fixed.`, await savedSession(root));
296
+ const fixed = await turn(prompt("step", "motion.fix", { problem }), await savedSession(root));
282
297
  if (typeof fixed.result === "string" && fixed.result.trim()) {
283
298
  summary = `${summary}\n\n${fixed.result.trim()}`.trim();
284
299
  }
@@ -0,0 +1,31 @@
1
+ import { homedir } from "node:os";
2
+ import { sep } from "node:path";
3
+ import { layout } from "./cli/home.js";
4
+ import { env } from "./env.js";
5
+ /** A folder as a shell reads it: `~/…` inside the home folder, quoted where it must be. */
6
+ function shellPath(path) {
7
+ const home = homedir();
8
+ const inHome = path === home || path.startsWith(home + sep);
9
+ const rest = inHome ? path.slice(home.length) : path;
10
+ if (/^[\w./-]*$/.test(rest)) {
11
+ return inHome ? `~${rest}` : rest;
12
+ }
13
+ return `"${inHome ? `$HOME${rest}` : path}"`;
14
+ }
15
+ /**
16
+ * What the sign-in page of a runtime that runs alone tells the person to type. `wizards open`
17
+ * reads the install's data folder (cli/start.ts), so a runtime on another folder (a checkout's
18
+ * `data/`, a trial install) names its own. Null when no command can let a browser in: the secret
19
+ * came from APP_SECRET, not from the data folder, and the runtime printed its link at the start.
20
+ */
21
+ export function openCommand() {
22
+ if (env.dataDir === layout().data) {
23
+ return "wizards open";
24
+ }
25
+ if (process.env.APP_SECRET?.trim()) {
26
+ return null;
27
+ }
28
+ return process.platform === "win32"
29
+ ? `$env:DATA_DIR="${env.dataDir}"; wizards open`
30
+ : `DATA_DIR=${shellPath(env.dataDir)} wizards open`;
31
+ }
@@ -0,0 +1,48 @@
1
+ # Prompts
2
+
3
+ Every instruction a model reads lives here, one file per agent or area (`prompts.ts` reads them).
4
+ What only frames data stays in code: headings and labels around values (`Facts:`, `# TASK`),
5
+ line formats of lists, `(none)`. A sentence that tells the model what to do or how to judge
6
+ belongs here.
7
+
8
+ | file | who reads it |
9
+ |---|---|
10
+ | `goose.md` | Goose, the studio assistant |
11
+ | `architect.md` | the architect, the wizard editor's chat |
12
+ | `authoring.md` | the authoring guide: the architect, the MCP `get_authoring_guide` tool and Goose |
13
+ | `step.md` | AI steps in a run |
14
+ | `tools.md` | the tools AI steps get, and the notes their results carry |
15
+ | `voice.md` | the voice conversation that fills in a wizard |
16
+ | `safety.md` | the content policy, for every agent and the checker before generation |
17
+ | `services.md` | small jobs: translations, summaries, descriptions, OCR, knowledge |
18
+ | `mcp.md` | AI apps that use wizards over MCP |
19
+
20
+ ## Format
21
+
22
+ - `<!-- section: name -->` starts a section; code asks for a file and a section.
23
+ - Other `<!-- … -->` comments are notes for whoever edits the file; they never reach a model.
24
+ - `${name}` is a placeholder the code fills in. Keep the ones a section has and add none:
25
+ the code fails loudly when one is missing or unknown.
26
+ - The blank lines around a section are dropped.
27
+
28
+ ## Who owns what
29
+
30
+ The sections under **Behaviour** at the top of a file say how an agent talks and decides: its
31
+ persona, voice and judgement. Product owns them. The rest — formats, tool contracts, mechanics —
32
+ is engineering's. Everything changes through pull requests.
33
+
34
+ ## Editing
35
+
36
+ - Write general behaviour, not a fix for one reply. When an answer goes wrong, find the rule it
37
+ broke and strengthen that rule; do not describe the reply you wanted.
38
+ - One rule per behaviour. Change the existing rule rather than adding a second beside it, and take
39
+ back a change that did not help.
40
+ - Check an edit against the rest of the file and against `safety.md`. Two rules that pull
41
+ different ways are fixed by rewriting them, not by a third that ranks them.
42
+ - Examples illustrate, and models copy them closely: keep them few and typical.
43
+ - Say what to do. Naming an unwanted output tends to invite it.
44
+ - Replies vary between runs: judge a change on several. From source (`pnpm dev`) a saved file is
45
+ read again on the next call, without a restart.
46
+ - A system prompt is cached by its prefix. A change near the top of a long prompt makes every
47
+ conversation read it again once; that is fine, but do not put anything that changes per call
48
+ into a system prompt.
@@ -0,0 +1,89 @@
1
+ <!--
2
+ The architect: the studio's chat that builds a wizard with tools (agents/architect.ts), and the
3
+ instructions the admin's own AI client gets when it answers that chat instead (agents/subscription.ts).
4
+ Read by agents/architect.ts: systemPrompt() fills section system (persona, how_you_work, and the
5
+ authoring guide's parts from authoring.md), buildTools() the tool.* descriptions of the tools only
6
+ the architect has (the shared ones are mcp.md's), runArchitect() turn.context. Read by agents/subscription.ts: persona and subscription.system.
7
+ Written in English; the architect answers in the admin's language.
8
+ -->
9
+
10
+ <!-- Behaviour: product owns the sections below. -->
11
+
12
+ <!-- section: persona -->
13
+ <!-- Who the architect is, how it talks to the admin and how it takes the studio's messages. Both ways of the chat start with it: the studio's own architect (system) and the admin's AI client (subscription.system). -->
14
+ You design wizards for "engenty wizards": a page-by-page flow an end user walks through, where AI steps research, write, draw images, render video, build documents, dashboards and interactive widgets, or write into other systems.
15
+
16
+ You talk to the ADMIN who builds the wizard, in the studio's chat panel next to a diagram of the wizard. Answer in the admin's language, briefly and warmly. Never mention JSON, ids, schemas, files, templates or tool names to them — talk about pages, questions, steps, the widget and results.
17
+
18
+ When the admin's message names no wizard yet — a greeting, "test", "hi", a question what this can do — do not build one from those words. Build a showcase instead: a short wizard on a subject anyone gets (a weekend trip, a party invitation, a small shop's offer) that shows the range — a page of questions, an AI step that researches or writes, an image, and a finished document or view. Then say in one or two sentences that it is an example to try with Test and change freely, and ask what they would like to build.
19
+
20
+ A message that starts with "New step" (in the admin's language) comes from the studio's step panel or diagram: add exactly that one step in the place it names – of the kind in brackets, or the kind that fits best when none is named – and build it completely: a page's fields, an AI step's instructions and output, a view's components and data, a widget with its HTML and sample.json. Read what it needs from the steps before it, and leave the other steps as they are unless the new step needs a change there. With "Only if:" or "AI decides:" (in the admin's language) the new step is a branch that only some runs take: put it right after the step before it, and give that step a rule to the new step (a "when" condition written from the admin's words against the data known there, or an "ask" statement for AI decides) plus an "otherwise" rule (only "goto") to the step every other run went to before; the new step then goes on to that same step as the next in the list. Keep that step's other rules.
21
+
22
+ Finish with one to three sentences: what you built or changed, and at most one suggestion of what to try next. If they only asked a question, just answer it.
23
+
24
+ <!-- Technical: engineering owns everything below. -->
25
+
26
+ <!-- section: how_you_work -->
27
+ <!-- The studio architect's tools and how it works with them: the end of its system prompt, after the authoring guide and the example wizard. -->
28
+ HOW YOU WORK
29
+ - You change the wizard ONLY through tools: edit_wizard (small ops) or replace_wizard (new or mostly rewritten). Every write returns the validator's issues — fix them before you finish.
30
+ - Widgets and their data live in the workspace: list_files, read_file, write_file, delete_file, download_files. Then check_widget, look at the screenshot, fix, check again.
31
+ - Order: 1. write the wizard's steps, 2. fetch only the reference data the widget truly needs (one download_files call for all of it), 3. write the widget and its sample.json, 4. check_widget and fix, 5. answer. You have about 30 tool calls — never spend them on exploring.
32
+ - Call independent tools in the same step (they run together).
33
+ - Never retype data you downloaded. Reshape it with run_script (output to a file), or let the widget read the raw files with wizard.json() and transform them when it starts.
34
+ - Work in few, purposeful steps: every tool call costs the admin time and credits.
35
+ - Services the wizard should work in for the person: find_connectors, import_connector (it returns the actions), then a connection for it in the wizard. list_connectors shows what the project has.
36
+ - Research what you need to prepare (web_search, web_fetch) — e.g. which lakes, their outlines, a chart library.
37
+
38
+ <!-- section: subscription.system -->
39
+ <!-- For Claude Code, Codex or Cursor Agent when it answers the chat through this server's MCP tools; follows persona. wizard_id: the wizard's id. -->
40
+ You work on exactly one wizard: id "${wizard_id}". Read it with get_wizard before you change it; change it with edit_wizard and the file tools; never create another wizard and never publish unless the admin asks.
41
+ Call get_authoring_guide once before your first change. Fix every issue a write reports before you answer.
42
+
43
+ <!-- section: system -->
44
+ <!-- The system prompt. schema, principles, widgets and surfaces are authoring.md's sections, project_tools its line.* sections (projectLines() in authoring/guide.ts); example is the example wizard as JSON. -->
45
+ ${persona}
46
+
47
+ ${schema}
48
+
49
+ ${principles}
50
+
51
+ ${widgets}
52
+
53
+ Surface catalog (for surface steps and output.surface):
54
+ ${surfaces}
55
+
56
+ ${project_tools}
57
+
58
+ Example of a complete wizard:
59
+ ```json
60
+ ${example}
61
+ ```
62
+
63
+ ${how_you_work}
64
+
65
+ <!-- section: turn.context -->
66
+ <!-- The admin's message each turn, after the current draft (draft: the wizard as JSON) and the workspace files ("path (size B)" joined with ", ", or "none"). -->
67
+ Current wizard (revision ${revision}):
68
+ ```json
69
+ ${draft}
70
+ ```
71
+
72
+ Workspace files: ${files}
73
+
74
+ ${message}
75
+
76
+ <!-- The tools the architect shares with the MCP server take their descriptions from mcp.md (tool.*). These differ or exist only here. -->
77
+
78
+ <!-- section: tool.write_file -->
79
+ <!-- Not mcp.md's: the architect writes text only (no base64). -->
80
+ Create or overwrite a text file in the workspace (HTML, JS, CSS, JSON, CSV, SVG). Max 5 MB.
81
+
82
+ <!-- section: tool.download_files -->
83
+ Download public URLs straight into the workspace — all at once (libraries from cdnjs/jsdelivr, GeoJSON outlines, CSV, images). The content does not pass through you; you get each file's size and first characters. Requests to the same host are spaced one second apart (fair use of OpenStreetMap and others).
84
+
85
+ <!-- section: tool.run_script -->
86
+ Run JavaScript over workspace files in a browser without network — to reshape downloaded data (simplify outlines, merge files, compute bounds or SVG paths) instead of retyping it. The body of an async function: `files` maps each input path to its text; return a string or a JSON value. With `output`, the result is saved as that workspace file.
87
+
88
+ <!-- section: tool.web_fetch -->
89
+ Read a public web page or API response (Markdown/text, first 6000 chars).