@multiplayer-app/sandbox 0.0.32 → 0.0.33-beta.1

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 (188) hide show
  1. package/dist/agents/content-generator.agent.d.ts +8 -0
  2. package/dist/agents/content-generator.agent.d.ts.map +1 -1
  3. package/dist/agents/content-generator.agent.js +53 -6
  4. package/dist/agents/content-generator.agent.js.map +1 -1
  5. package/dist/agents/notebook.agent.d.ts.map +1 -1
  6. package/dist/agents/notebook.agent.js +2 -1
  7. package/dist/agents/notebook.agent.js.map +1 -1
  8. package/dist/agents/shared/build-plan.tools.d.ts.map +1 -1
  9. package/dist/agents/shared/build-plan.tools.js +4 -4
  10. package/dist/agents/shared/build-plan.tools.js.map +1 -1
  11. package/dist/agents/shared/content-generator-system-prompt.d.ts +3 -2
  12. package/dist/agents/shared/content-generator-system-prompt.d.ts.map +1 -1
  13. package/dist/agents/shared/content-generator-system-prompt.js +41 -24
  14. package/dist/agents/shared/content-generator-system-prompt.js.map +1 -1
  15. package/dist/agents/shared/design-skills.d.ts +48 -0
  16. package/dist/agents/shared/design-skills.d.ts.map +1 -0
  17. package/dist/agents/shared/design-skills.js +230 -0
  18. package/dist/agents/shared/design-skills.js.map +1 -0
  19. package/dist/agents/shared/generate-session-images.tool.d.ts +15 -0
  20. package/dist/agents/shared/generate-session-images.tool.d.ts.map +1 -0
  21. package/dist/agents/shared/generate-session-images.tool.js +98 -0
  22. package/dist/agents/shared/generate-session-images.tool.js.map +1 -0
  23. package/dist/agents/shared/publish-session-artifacts.tool.d.ts +5 -0
  24. package/dist/agents/shared/publish-session-artifacts.tool.d.ts.map +1 -1
  25. package/dist/agents/shared/publish-session-artifacts.tool.js +154 -15
  26. package/dist/agents/shared/publish-session-artifacts.tool.js.map +1 -1
  27. package/dist/agents/shared/session-quality-report.tool.js +1 -1
  28. package/dist/agents/shared/session-quality-report.tool.js.map +1 -1
  29. package/dist/agents/shared/update-session-artifacts.tool.d.ts +5 -0
  30. package/dist/agents/shared/update-session-artifacts.tool.d.ts.map +1 -1
  31. package/dist/agents/shared/update-session-artifacts.tool.js +136 -26
  32. package/dist/agents/shared/update-session-artifacts.tool.js.map +1 -1
  33. package/dist/agents/shared/validate-artifact-content.tools.d.ts +4 -0
  34. package/dist/agents/shared/validate-artifact-content.tools.d.ts.map +1 -1
  35. package/dist/agents/shared/validate-artifact-content.tools.js +24 -1
  36. package/dist/agents/shared/validate-artifact-content.tools.js.map +1 -1
  37. package/dist/agents/skills/designer.skill.d.ts.map +1 -1
  38. package/dist/agents/skills/designer.skill.js +75 -113
  39. package/dist/agents/skills/designer.skill.js.map +1 -1
  40. package/dist/agents/skills/skill-injection.d.ts.map +1 -1
  41. package/dist/agents/skills/skill-injection.js +9 -3
  42. package/dist/agents/skills/skill-injection.js.map +1 -1
  43. package/dist/context.d.ts +4 -0
  44. package/dist/context.d.ts.map +1 -1
  45. package/dist/context.js.map +1 -1
  46. package/dist/create-builder-api.d.ts +6 -0
  47. package/dist/create-builder-api.d.ts.map +1 -1
  48. package/dist/create-builder-api.js +2 -0
  49. package/dist/create-builder-api.js.map +1 -1
  50. package/dist/index.d.ts +4 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +6 -1
  53. package/dist/index.js.map +1 -1
  54. package/dist/lib/session-artifacts/hashline-diff-guide.d.ts +1 -1
  55. package/dist/lib/session-artifacts/hashline-diff-guide.d.ts.map +1 -1
  56. package/dist/lib/session-artifacts/hashline-diff-guide.js +9 -5
  57. package/dist/lib/session-artifacts/hashline-diff-guide.js.map +1 -1
  58. package/dist/lib/session-artifacts/parse-hashline-diff.d.ts +13 -0
  59. package/dist/lib/session-artifacts/parse-hashline-diff.d.ts.map +1 -1
  60. package/dist/lib/session-artifacts/parse-hashline-diff.js +72 -0
  61. package/dist/lib/session-artifacts/parse-hashline-diff.js.map +1 -1
  62. package/dist/lib/session-pages/artifact-quality-audit.d.ts.map +1 -1
  63. package/dist/lib/session-pages/artifact-quality-audit.js +19 -14
  64. package/dist/lib/session-pages/artifact-quality-audit.js.map +1 -1
  65. package/dist/lib/session-pages/html-artifact-template.d.ts +16 -0
  66. package/dist/lib/session-pages/html-artifact-template.d.ts.map +1 -1
  67. package/dist/lib/session-pages/html-artifact-template.js +166 -10
  68. package/dist/lib/session-pages/html-artifact-template.js.map +1 -1
  69. package/dist/lib/session-pages/index.d.ts +4 -0
  70. package/dist/lib/session-pages/index.d.ts.map +1 -1
  71. package/dist/lib/session-pages/index.js +11 -1
  72. package/dist/lib/session-pages/index.js.map +1 -1
  73. package/dist/lib/session-pages/write-binary-session-artifact.d.ts +12 -0
  74. package/dist/lib/session-pages/write-binary-session-artifact.d.ts.map +1 -0
  75. package/dist/lib/session-pages/write-binary-session-artifact.js +23 -0
  76. package/dist/lib/session-pages/write-binary-session-artifact.js.map +1 -0
  77. package/dist/lib/session-pages/write-session-artifacts.d.ts +1 -0
  78. package/dist/lib/session-pages/write-session-artifacts.d.ts.map +1 -1
  79. package/dist/lib/session-pages/write-session-artifacts.js +4 -1
  80. package/dist/lib/session-pages/write-session-artifacts.js.map +1 -1
  81. package/dist/lib/session-plans/build-plan.d.ts +13 -3
  82. package/dist/lib/session-plans/build-plan.d.ts.map +1 -1
  83. package/dist/lib/session-plans/build-plan.js +37 -6
  84. package/dist/lib/session-plans/build-plan.js.map +1 -1
  85. package/dist/realtime/session-artifact-yjs-store.d.ts +18 -0
  86. package/dist/realtime/session-artifact-yjs-store.d.ts.map +1 -1
  87. package/dist/realtime/session-artifact-yjs-store.js +62 -0
  88. package/dist/realtime/session-artifact-yjs-store.js.map +1 -1
  89. package/dist/server.d.ts.map +1 -1
  90. package/dist/server.js +2 -0
  91. package/dist/server.js.map +1 -1
  92. package/package.json +9 -9
  93. package/dist/agents/blocknote.agent.d.ts +0 -6
  94. package/dist/agents/blocknote.agent.d.ts.map +0 -1
  95. package/dist/agents/blocknote.agent.js +0 -18
  96. package/dist/agents/blocknote.agent.js.map +0 -1
  97. package/dist/agents/filingramp-fetch.agent.d.ts +0 -4
  98. package/dist/agents/filingramp-fetch.agent.d.ts.map +0 -1
  99. package/dist/agents/filingramp-fetch.agent.js +0 -195
  100. package/dist/agents/filingramp-fetch.agent.js.map +0 -1
  101. package/dist/agents/knowledge/filingramp-endpoints.d.ts +0 -23
  102. package/dist/agents/knowledge/filingramp-endpoints.d.ts.map +0 -1
  103. package/dist/agents/knowledge/filingramp-endpoints.js +0 -116
  104. package/dist/agents/knowledge/filingramp-endpoints.js.map +0 -1
  105. package/dist/agents/shared/blocknote-system-prompt.d.ts +0 -2
  106. package/dist/agents/shared/blocknote-system-prompt.d.ts.map +0 -1
  107. package/dist/agents/shared/blocknote-system-prompt.js +0 -40
  108. package/dist/agents/shared/blocknote-system-prompt.js.map +0 -1
  109. package/dist/agents/shared/get-latest-session-artifact.tool.d.ts +0 -7
  110. package/dist/agents/shared/get-latest-session-artifact.tool.d.ts.map +0 -1
  111. package/dist/agents/shared/get-latest-session-artifact.tool.js +0 -43
  112. package/dist/agents/shared/get-latest-session-artifact.tool.js.map +0 -1
  113. package/dist/agents/shared/get-session-artifact-content.tool.d.ts +0 -7
  114. package/dist/agents/shared/get-session-artifact-content.tool.d.ts.map +0 -1
  115. package/dist/agents/shared/get-session-artifact-content.tool.js +0 -44
  116. package/dist/agents/shared/get-session-artifact-content.tool.js.map +0 -1
  117. package/dist/agents/shared/list-session-artifact-paths.tool.d.ts +0 -5
  118. package/dist/agents/shared/list-session-artifact-paths.tool.d.ts.map +0 -1
  119. package/dist/agents/shared/list-session-artifact-paths.tool.js +0 -37
  120. package/dist/agents/shared/list-session-artifact-paths.tool.js.map +0 -1
  121. package/dist/lib/ai/agent-ai-service.d.ts +0 -3
  122. package/dist/lib/ai/agent-ai-service.d.ts.map +0 -1
  123. package/dist/lib/ai/agent-ai-service.js +0 -15
  124. package/dist/lib/ai/agent-ai-service.js.map +0 -1
  125. package/dist/lib/ai/ai-error-details.d.ts +0 -13
  126. package/dist/lib/ai/ai-error-details.d.ts.map +0 -1
  127. package/dist/lib/ai/ai-error-details.js +0 -84
  128. package/dist/lib/ai/ai-error-details.js.map +0 -1
  129. package/dist/lib/ai/generate-ai-text.d.ts +0 -12
  130. package/dist/lib/ai/generate-ai-text.d.ts.map +0 -1
  131. package/dist/lib/ai/generate-ai-text.js +0 -105
  132. package/dist/lib/ai/generate-ai-text.js.map +0 -1
  133. package/dist/lib/ai/run-explicit-agent.d.ts +0 -15
  134. package/dist/lib/ai/run-explicit-agent.d.ts.map +0 -1
  135. package/dist/lib/ai/run-explicit-agent.js +0 -30
  136. package/dist/lib/ai/run-explicit-agent.js.map +0 -1
  137. package/dist/lib/notebooks/notebook-sql-client.d.ts +0 -5
  138. package/dist/lib/notebooks/notebook-sql-client.d.ts.map +0 -1
  139. package/dist/lib/notebooks/notebook-sql-client.js +0 -37
  140. package/dist/lib/notebooks/notebook-sql-client.js.map +0 -1
  141. package/dist/lib/notebooks/notebook-sql-schema.d.ts +0 -16
  142. package/dist/lib/notebooks/notebook-sql-schema.d.ts.map +0 -1
  143. package/dist/lib/notebooks/notebook-sql-schema.js +0 -117
  144. package/dist/lib/notebooks/notebook-sql-schema.js.map +0 -1
  145. package/dist/lib/notebooks/notebook-sql.d.ts +0 -9
  146. package/dist/lib/notebooks/notebook-sql.d.ts.map +0 -1
  147. package/dist/lib/notebooks/notebook-sql.js +0 -36
  148. package/dist/lib/notebooks/notebook-sql.js.map +0 -1
  149. package/dist/lib/session-artifacts/apply-hashline-edits.d.ts +0 -3
  150. package/dist/lib/session-artifacts/apply-hashline-edits.d.ts.map +0 -1
  151. package/dist/lib/session-artifacts/apply-hashline-edits.js +0 -25
  152. package/dist/lib/session-artifacts/apply-hashline-edits.js.map +0 -1
  153. package/dist/lib/session-artifacts/artifact-text-edit.d.ts +0 -8
  154. package/dist/lib/session-artifacts/artifact-text-edit.d.ts.map +0 -1
  155. package/dist/lib/session-artifacts/artifact-text-edit.js +0 -23
  156. package/dist/lib/session-artifacts/artifact-text-edit.js.map +0 -1
  157. package/dist/lib/session-artifacts/hashline-tag.d.ts +0 -33
  158. package/dist/lib/session-artifacts/hashline-tag.d.ts.map +0 -1
  159. package/dist/lib/session-artifacts/hashline-tag.js +0 -80
  160. package/dist/lib/session-artifacts/hashline-tag.js.map +0 -1
  161. package/dist/lib/session-pages/inject-preview-error-reporter.d.ts +0 -3
  162. package/dist/lib/session-pages/inject-preview-error-reporter.d.ts.map +0 -1
  163. package/dist/lib/session-pages/inject-preview-error-reporter.js +0 -30
  164. package/dist/lib/session-pages/inject-preview-error-reporter.js.map +0 -1
  165. package/dist/lib/session-pages/read-session-artifact.d.ts +0 -7
  166. package/dist/lib/session-pages/read-session-artifact.d.ts.map +0 -1
  167. package/dist/lib/session-pages/read-session-artifact.js +0 -60
  168. package/dist/lib/session-pages/read-session-artifact.js.map +0 -1
  169. package/dist/lib/session-pages/session-pico-css.d.ts +0 -5
  170. package/dist/lib/session-pages/session-pico-css.d.ts.map +0 -1
  171. package/dist/lib/session-pages/session-pico-css.js +0 -11
  172. package/dist/lib/session-pages/session-pico-css.js.map +0 -1
  173. package/dist/realtime/realtime-auth.d.ts +0 -12
  174. package/dist/realtime/realtime-auth.d.ts.map +0 -1
  175. package/dist/realtime/realtime-auth.js +0 -25
  176. package/dist/realtime/realtime-auth.js.map +0 -1
  177. package/dist/realtime/yjs-account-namespace.d.ts +0 -5
  178. package/dist/realtime/yjs-account-namespace.d.ts.map +0 -1
  179. package/dist/realtime/yjs-account-namespace.js +0 -21
  180. package/dist/realtime/yjs-account-namespace.js.map +0 -1
  181. package/dist/routes/notebooks/sql-execute.d.ts +0 -3
  182. package/dist/routes/notebooks/sql-execute.d.ts.map +0 -1
  183. package/dist/routes/notebooks/sql-execute.js +0 -45
  184. package/dist/routes/notebooks/sql-execute.js.map +0 -1
  185. package/dist/routes/sql.d.ts +0 -2
  186. package/dist/routes/sql.d.ts.map +0 -1
  187. package/dist/routes/sql.js +0 -50
  188. package/dist/routes/sql.js.map +0 -1
@@ -1,4 +1,12 @@
1
1
  import type { AgentConfig } from '@multiplayer-app/ai-agent-types';
2
2
  import type { BuilderApiAgentDeps } from '../builder-api-config';
3
+ /**
4
+ * Parent stop budget. Models otherwise round-robin updateSessionArtifact on
5
+ * every published file ("polish index, then contact, then index…") until the
6
+ * old 16-step cap. Count tool names conservatively from serialized steps.
7
+ */
8
+ export declare function shouldStopContentGenerator({ steps }: {
9
+ steps: unknown[];
10
+ }): boolean;
3
11
  export declare function createContentGeneratorAgent(deps: BuilderApiAgentDeps): AgentConfig;
4
12
  //# sourceMappingURL=content-generator.agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-generator.agent.d.ts","sourceRoot":"","sources":["../../src/agents/content-generator.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CAgClF"}
1
+ {"version":3,"file":"content-generator.agent.d.ts","sourceRoot":"","sources":["../../src/agents/content-generator.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAUhE;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,OAAO,CAUnF;AAOD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CAqDlF"}
@@ -1,32 +1,76 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldStopContentGenerator = shouldStopContentGenerator;
3
4
  exports.createContentGeneratorAgent = createContentGeneratorAgent;
4
5
  const ai_agent_types_1 = require("@multiplayer-app/ai-agent-types");
5
6
  const publish_session_artifacts_tool_1 = require("./shared/publish-session-artifacts.tool");
7
+ const app_vm_tools_1 = require("./shared/app-vm.tools");
6
8
  const content_generator_system_prompt_1 = require("./shared/content-generator-system-prompt");
7
9
  const update_session_artifacts_tool_1 = require("./shared/update-session-artifacts.tool");
10
+ const session_quality_report_tool_1 = require("./shared/session-quality-report.tool");
8
11
  const session_pages_1 = require("../lib/session-pages");
9
12
  const agent_context_1 = require("./shared/agent-context");
13
+ const skills_1 = require("./skills");
14
+ /**
15
+ * Parent stop budget. Models otherwise round-robin updateSessionArtifact on
16
+ * every published file ("polish index, then contact, then index…") until the
17
+ * old 16-step cap. Count tool names conservatively from serialized steps.
18
+ */
19
+ function shouldStopContentGenerator({ steps }) {
20
+ if (steps.length >= 6)
21
+ return true;
22
+ const blob = JSON.stringify(steps !== null && steps !== void 0 ? steps : []);
23
+ const updateCalls = countToolMentions(blob, 'updateSessionArtifact');
24
+ const publishCalls = countToolMentions(blob, 'publishSessionArtifacts');
25
+ // After a landing is on disk, at most one follow-up edit pass — not one per file.
26
+ if (updateCalls >= 2)
27
+ return true;
28
+ // Two publish delegations is already past the intended "one ship + one repair" path.
29
+ if (publishCalls >= 2 && updateCalls >= 1)
30
+ return true;
31
+ return false;
32
+ }
33
+ function countToolMentions(blob, toolName) {
34
+ var _a, _b;
35
+ const re = new RegExp(`"(?:name|title)"\\s*:\\s*"${toolName}"`, 'g');
36
+ return (_b = (_a = blob.match(re)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
37
+ }
10
38
  function createContentGeneratorAgent(deps) {
11
39
  return {
12
40
  name: 'content-generator',
13
41
  description: 'Generates and updates session artifacts: HTML pages, optional split CSS/JS, JSON data, and Markdown docs',
14
42
  defaultModel: deps.defaultModel,
15
43
  systemPrompt: content_generator_system_prompt_1.CONTENT_GENERATOR_SYSTEM_PROMPT,
16
- stopWhen: () => false,
44
+ stopWhen: shouldStopContentGenerator,
17
45
  prepareStep: async (options, context) => {
18
- if (options.stepCount > 0) {
19
- return undefined;
20
- }
46
+ var _a;
21
47
  const sessionId = (0, agent_context_1.getRootChatId)(context);
22
48
  if (!sessionId) {
23
49
  return undefined;
24
50
  }
25
- const artifacts = await (0, session_pages_1.listSessionArtifacts)(sessionId);
51
+ const stepCount = (_a = options.stepCount) !== null && _a !== void 0 ? _a : 0;
52
+ const [artifacts, customSkills] = await Promise.all([
53
+ (0, session_pages_1.listSessionArtifacts)(sessionId),
54
+ stepCount === 0 ? (0, skills_1.loadAccountSkills)(context) : Promise.resolve([]),
55
+ ]);
56
+ const customSkillCatalog = customSkills.length
57
+ ? `\nAccount skills (add to the catalog; same-name entries replace built-ins):\n${customSkills
58
+ .map((skill) => `- ${skill.name} — ${skill.description}. Use for: ${skill.whenToUse}`)
59
+ .join('\n')}`
60
+ : '';
61
+ const artifactList = artifacts.length
62
+ ? artifacts.map((artifact) => artifact.path).join(', ')
63
+ : '(none yet)';
64
+ const stopPolish = artifacts.length > 0 && stepCount >= 1
65
+ ? `\nSTOP RULE: HTML already exists (${artifactList}). If the last publish/update returned previewUrl or an updated path, FINISH with a short summary NOW. Do NOT round-robin updateSessionArtifact across every file. Do NOT invent nindex.html / contact.html / data/*.json unless the user asked. At most ONE updateSessionArtifact for a named blocking error — then stop.`
66
+ : '';
26
67
  return {
27
68
  messages: [
28
69
  ...options.messages,
29
- { role: 'system', content: `List of available artifacts: ${artifacts.map((artifact) => artifact.path).join(', ')}` },
70
+ {
71
+ role: 'system',
72
+ content: `Existing session artifacts RIGHT NOW: ${artifactList}. These paths MUST go through updateSessionArtifact — publishing them again always fails. Any path NOT in this list does not exist yet — create it with publishSessionArtifacts, never updateSessionArtifact. No build plan — ship with publish/update directly.${customSkillCatalog}${stopPolish}`,
73
+ },
30
74
  ],
31
75
  };
32
76
  },
@@ -35,6 +79,9 @@ function createContentGeneratorAgent(deps) {
35
79
  { type: ai_agent_types_1.AgentToolType.REQUEST_CLARIFICATION, userConfigurable: true },
36
80
  publish_session_artifacts_tool_1.publishSessionArtifactsSubagentTool,
37
81
  update_session_artifacts_tool_1.updateSessionArtifactsSubagentTool,
82
+ app_vm_tools_1.writeAppFilesTool,
83
+ app_vm_tools_1.runAppCommandTool,
84
+ session_quality_report_tool_1.getSessionQualityReportTool,
38
85
  ],
39
86
  };
40
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"content-generator.agent.js","sourceRoot":"","sources":["../../src/agents/content-generator.agent.ts"],"names":[],"mappings":";;AASA,kEAgCC;AAxCD,oEAA+D;AAE/D,4FAA6F;AAC7F,8FAA0F;AAC1F,0FAA2F;AAC3F,wDAA2D;AAC3D,0DAAsD;AAEtD,SAAgB,2BAA2B,CAAC,IAAyB;IACnE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,0GAA0G;QAC5G,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,iEAA+B;QAC7C,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;QACrB,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;YACtC,IAAI,OAAO,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,SAAS,CAAA;YAClB,CAAC;YACD,MAAM,SAAS,GAAG,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAA;YACxC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO,SAAS,CAAA;YAClB,CAAC;YAED,MAAM,SAAS,GAAG,MAAM,IAAA,oCAAoB,EAAC,SAAS,CAAC,CAAA;YACvD,OAAO;gBACL,QAAQ,EAAE;oBACR,GAAG,OAAO,CAAC,QAAQ;oBACnB,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,gCAAgC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;iBACrH;aACF,CAAA;QACH,CAAC;QACD,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,8BAAa,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE;YAC1D,EAAE,IAAI,EAAE,8BAAa,CAAC,qBAAqB,EAAE,gBAAgB,EAAE,IAAI,EAAE;YACrE,oEAAmC;YACnC,kEAAkC;SACnC;KACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"content-generator.agent.js","sourceRoot":"","sources":["../../src/agents/content-generator.agent.ts"],"names":[],"mappings":";;AAiBA,gEAUC;AAOD,kEAqDC;AAtFD,oEAA+D;AAE/D,4FAA6F;AAC7F,wDAA4E;AAC5E,8FAA0F;AAC1F,0FAA2F;AAC3F,sFAAkF;AAClF,wDAA2D;AAC3D,0DAAsD;AACtD,qCAA4C;AAE5C;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,EAAE,KAAK,EAAwB;IACxE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAA;IACxC,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAA;IACpE,MAAM,YAAY,GAAG,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAA;IACvE,kFAAkF;IAClF,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACjC,qFAAqF;IACrF,IAAI,YAAY,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACtD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,QAAgB;;IACvD,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,6BAA6B,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAA;IACpE,OAAO,MAAA,M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AAI,CAAC,IAAI,CAAC;gBACvD,CAAC,CAAC,YAAY,CAAA;YAEhB,MAAM,UAAU,GACd,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,IAAI,CAAC;gBACpC,CAAC,CAAC,qCAAqC,YAAY,4TAA4T;gBAC/W,CAAC,CAAC,EAAE,CAAA;YAER,OAAO;gBACL,QAAQ,EAAE;oBACR,GAAG,OAAO,CAAC,QAAQ;oBACnB;wBACE,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,yCAAyC,YAAY,mQAAmQ,kBAAkB,GAAG,UAAU,EAAE;qBACnW;iBACF;aACF,CAAA;QACH,CAAC;QACD,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,8BAAa,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE;YAC1D,EAAE,IAAI,EAAE,8BAAa,CAAC,qBAAqB,EAAE,gBAAgB,EAAE,IAAI,EAAE;YACrE,oEAAmC;YACnC,kEAAkC;YAClC,gCAAiB;YACjB,gCAAiB;YACjB,yDAA2B;SAC5B;KACF,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notebook.agent.d.ts","sourceRoot":"","sources":["../../src/agents/notebook.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CA2C1E"}
1
+ {"version":3,"file":"notebook.agent.d.ts","sourceRoot":"","sources":["../../src/agents/notebook.agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CA4C1E"}
@@ -13,7 +13,8 @@ function createNotebookAgent(deps) {
13
13
  description: 'Reads, searches, and edits the collaborative notebook the user has open, including runnable SQL, code, and chart blocks',
14
14
  defaultModel: deps.defaultModel,
15
15
  systemPrompt: notebook_agent_system_prompt_1.NOTEBOOK_AGENT_SYSTEM_PROMPT,
16
- stopWhen: () => false,
16
+ // Safety net against runaway tool-retry loops.
17
+ stopWhen: ({ steps }) => steps.length >= 64,
17
18
  prepareStep: async (options, context) => {
18
19
  if (options.stepCount > 0) {
19
20
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"notebook.agent.js","sourceRoot":"","sources":["../../src/agents/notebook.agent.ts"],"names":[],"mappings":";;AASA,kDA2CC;AAnDD,oEAA+D;AAE/D,sCAA+C;AAC/C,8EAAuF;AACvF,uFAAmF;AACnF,wFAAoF;AACpF,4DAA8E;AAE9E,SAAgB,mBAAmB,CAAC,IAAyB;IAC3D,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,yHAAyH;QAC3H,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,2DAA4B;QAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;QACrB,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;YACtC,IAAI,OAAO,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,SAAS,CAAA;YAClB,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAA,sCAAqB,EAAC,OAAO,CAAC,CAAA;gBACnD,MAAM,QAAQ,GAAG,MAAM,IAAA,uDAA0B,GAAE,CAAC,mBAAmB,CACrE,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,UAAU,CAClB,CAAA;gBACD,MAAM,OAAO,GAAG,IAAA,kCAAY,EAAC,IAAA,wCAAkB,EAAC,QAAQ,CAAC,CAAC,CAAA;gBAC1D,OAAO;oBACL,QAAQ,EAAE;wBACR,GAA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;AAmGnF,eAAO,MAAM,mBAAmB,EAAE,SA6BjC,CAAA;AASD,eAAO,MAAM,mBAAmB,EAAE,SA8DjC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,SAkB9B,CAAA"}
1
+ {"version":3,"file":"build-plan.tools.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/build-plan.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAoGnF,eAAO,MAAM,mBAAmB,EAAE,SA6BjC,CAAA;AASD,eAAO,MAAM,mBAAmB,EAAE,SA8DjC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,SAkB9B,CAAA"}
@@ -25,7 +25,7 @@ async function readPlan(sessionId) {
25
25
  }
26
26
  }
27
27
  async function writePlan(sessionId, plan) {
28
- await (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)().initializeFromContent(sessionId, build_plan_1.BUILD_PLAN_PATH, (0, build_plan_1.serializeBuildPlan)(plan));
28
+ await (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)().upsertFromContent(sessionId, build_plan_1.BUILD_PLAN_PATH, (0, build_plan_1.serializeBuildPlan)(plan));
29
29
  }
30
30
  const openAdvisorySchema = zod_1.z.object({
31
31
  path: zod_1.z.string(),
@@ -54,9 +54,9 @@ const createPlanInputSchema = zod_1.z.object({
54
54
  title: zod_1.z.string().min(1).max(200).describe('Short name of what is being built'),
55
55
  designBrief: zod_1.z
56
56
  .string()
57
- .min(80)
58
- .max(900)
59
- .describe('Session-wide design contract BEFORE building. MUST include: (1) accent hex + darker hover hex (topic-fit, never default indigo), (2) neutral scale slate/zinc/stone, (3) Google Font pairing by name (Manrope/Sora/Fraunces/Outfit — never Inter), (4) tone, (5) layout pack product|launch|editorial, (6) light/dark strategy, (7) atmosphere (e.g. soft accent wash + blur orb / glass nav), (8) anti-cliché note (what this must NOT look like).'),
57
+ .min(120)
58
+ .max(1400)
59
+ .describe(`Session-wide design contract BEFORE building. MUST include: (1) accent hex + darker hover hex (topic-fit, never default indigo), (2) neutral scale slate/zinc/stone/neutral, (3) Google Font pairing by name (never Inter), (4) tone, (5) layout pack ${build_plan_1.LAYOUT_PACKS.join('|')}, (6) signature layout+surface+motion (e.g. "signature: split + hard grid + scroll reveal"), (7) radius sharp|soft|pill and/or density airy|comfortable|dense, (8) light/dark strategy, (9) atmosphere matching the signature (not always blur-orb+glass), (10) anti-cliché note (explicitly ban the default centered blur-orb SaaS hero unless the pack requires it). Pick a pack that fits the product — vary across sessions.`),
60
60
  tasks: zod_1.z
61
61
  .array(zod_1.z.object({
62
62
  title: zod_1.z.string().min(1).max(120).describe('One concrete deliverable, e.g. "Landing page hero + nav"'),
@@ -1 +1 @@
1
- {"version":3,"file":"build-plan.tools.js","sourceRoot":"","sources":["../../../src/agents/shared/build-plan.tools.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,6BAAuB;AACvB,mDAA+C;AAC/C,yCAAkD;AAClD,0FAAsF;AACtF,mEAa2C;AAC3C,2DAIgC;AAEhC,SAAS,gBAAgB,CAAC,OAA2B;IACnD,MAAM,SAAS,GAAG,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAA;IACxC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IAC3C,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,SAAiB;IACvC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,IAAA,uDAA0B,GAAE,CAAC,aAAa,CAAC,SAAS,EAAE,4BAAe,CAAC,CAAA;QAC5F,OAAO,IAAA,2BAAc,EAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,SAAiB,EAAE,IAAe;IACzD,MAAM,IAAA,uDAA0B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AAa,CAAC,cAAc;IAClC,gBAAgB,EAAE,IAAI;IACtB,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,4GAA4G;QAC9G,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;SACnC,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAe,EAAE,OAA2B,EAAE,EAAE;YAC9D,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;YAC3C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAA;YACtC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAClD,CAAC;KACF;CACF,CAAA"}
@@ -1,3 +1,4 @@
1
- /** Shared system prompt for content-generator / html-generator agents. */
2
- export declare const CONTENT_GENERATOR_SYSTEM_PROMPT = "You generate and update session artifacts for both UI and docs. Use publishSessionArtifacts for NEW files and updateSessionArtifact for EXISTING files.\n\nWorkflow:\n1. Decide output mode:\n - UI/HTML (default): publish body/main fragments per .html page (page logic in <script>, small overrides in <style>). The server wraps fragments in a Pico CSS template \u2014 do not generate <!DOCTYPE>/<html>/<head> boilerplate unless the user explicitly wants a full custom document.\n - Split assets (only when the user explicitly asks): separate styles.css, script.js, and/or extra .css/.js, linked from HTML via relative URLs (./styles.css, ./script.js).\n - Docs: .md files such as README.md, docs/architecture.md\n - Optional data: JSON under data/ (e.g. data/metrics.json), loaded from inline <script> when needed.\n2. Keep paths relative (no leading slash). Do not add styles.css or script.js unless the user requested split files or you are extending an existing split layout.\n3. Existing session artifacts are listed in a system message.\n4. New paths: publishSessionArtifacts with task, artifacts[], and parentContext. parentContext MUST include: (a) outputs from any knowledge tools you called this session (e.g. getWeather), (b) relevant prior conversation excerpts, (c) concrete data values the subagent cannot fetch itself. The subagent has NO access to your chat history or tool results \u2014 if data is not in parentContext, it will be missing from the page.\n5. Existing paths: updateSessionArtifact with parentContext and task (include the path). One path per call. Same parentContext rules as step 4.\n6. Mixed create + update: publish new paths only, then update each existing path separately.\n7. previewPath: primary .md for doc-only publishes; main entry .html (usually index.html) for UI.\n8. After publish, give previewUrl; after edit, the updated path; after read/Q&A, relay excerpts/summary only.\n\nHTML / UI (Pico CSS):\n- New .html files: send fragments only (semantic body content); server adds Pico template shell.\n- Prefer semantic Pico elements: header, nav, section, article, aside, footer, table, figure, button, input, select, textarea, details, dialog. Use Pico patterns for grids/cards (e.g. class=\"grid\") instead of large custom layout CSS.\n- Keep custom <style> minimal (only what Pico cannot express). \n- Put behavior in <script>.\n\nRules:\n- Prefer concise, production-grade output.\n- Do not overwrite existing paths via publishSessionArtifacts.\n- You do not have validateHtml or validateMarkdown; delegated subagents run validation.\n- When editing, keep the same layout model as the session (inline vs split files).";
1
+ /** Shared system prompt for content-generator / html-generator agents.
2
+ * No build-plan tools publish/update directly for speed. */
3
+ export declare const CONTENT_GENERATOR_SYSTEM_PROMPT: string;
3
4
  //# sourceMappingURL=content-generator-system-prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-generator-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/content-generator-system-prompt.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,mnFA0BuC,CAAA"}
1
+ {"version":3,"file":"content-generator-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/content-generator-system-prompt.ts"],"names":[],"mappings":"AAEA;8DAC8D;AAC9D,eAAO,MAAM,+BAA+B,QAyCiC,CAAA"}
@@ -1,32 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CONTENT_GENERATOR_SYSTEM_PROMPT = void 0;
4
- /** Shared system prompt for content-generator / html-generator agents. */
4
+ const skills_1 = require("../skills");
5
+ /** Shared system prompt for content-generator / html-generator agents.
6
+ * No build-plan tools — publish/update directly for speed. */
5
7
  exports.CONTENT_GENERATOR_SYSTEM_PROMPT = `You generate and update session artifacts for both UI and docs. Use publishSessionArtifacts for NEW files and updateSessionArtifact for EXISTING files.
6
8
 
7
- Workflow:
8
- 1. Decide output mode:
9
- - UI/HTML (default): publish body/main fragments per .html page (page logic in <script>, small overrides in <style>). The server wraps fragments in a Pico CSS template — do not generate <!DOCTYPE>/<html>/<head> boilerplate unless the user explicitly wants a full custom document.
10
- - Split assets (only when the user explicitly asks): separate styles.css, script.js, and/or extra .css/.js, linked from HTML via relative URLs (./styles.css, ./script.js).
11
- - Docs: .md files such as README.md, docs/architecture.md
12
- - Optional data: JSON under data/ (e.g. data/metrics.json), loaded from inline <script> when needed.
13
- 2. Keep paths relative (no leading slash). Do not add styles.css or script.js unless the user requested split files or you are extending an existing split layout.
14
- 3. Existing session artifacts are listed in a system message.
15
- 4. New paths: publishSessionArtifacts with task, artifacts[], and parentContext. parentContext MUST include: (a) outputs from any knowledge tools you called this session (e.g. getWeather), (b) relevant prior conversation excerpts, (c) concrete data values the subagent cannot fetch itself. The subagent has NO access to your chat history or tool results — if data is not in parentContext, it will be missing from the page.
16
- 5. Existing paths: updateSessionArtifact with parentContext and task (include the path). One path per call. Same parentContext rules as step 4.
17
- 6. Mixed create + update: publish new paths only, then update each existing path separately.
18
- 7. previewPath: primary .md for doc-only publishes; main entry .html (usually index.html) for UI.
19
- 8. After publish, give previewUrl; after edit, the updated path; after read/Q&A, relay excerpts/summary only.
20
-
21
- HTML / UI (Pico CSS):
22
- - New .html files: send fragments only (semantic body content); server adds Pico template shell.
23
- - Prefer semantic Pico elements: header, nav, section, article, aside, footer, table, figure, button, input, select, textarea, details, dialog. Use Pico patterns for grids/cards (e.g. class="grid") instead of large custom layout CSS.
24
- - Keep custom <style> minimal (only what Pico cannot express).
25
- - Put behavior in <script>.
9
+ # Workflow — NO build plan (do not invent plan/task tooling)
10
+
11
+ There is no createBuildPlan / updateBuildTask / getBuildPlan. Do not narrate fake plans or task ids. Ship artifacts directly.
12
+
13
+ 1. CLARIFY only when genuinely needed (audience, single vs multi-page, data source). Ask 1–3 questions in ONE round via request_clarification. Skip when the user says "don't ask" or the request is clear.
14
+
15
+ 2. DESIGN CONTRACT (keep in your head, put verbatim into every parentContext):
16
+ Exact accent hex + darker hover hex (topic-fit — EV→teal/lime, finance→emerald/navy, tax/filing→green/navy, health→coral; never default indigo), neutral scale (slate/zinc/stone/neutral), Google Font pairing by name (never Inter), tone, layout pack (product | launch | editorial | magazine | split-hero | dark-terminal | bento | brutalist | workspace | story), signature (layout + surface + motion), radius (sharp|soft|pill) and/or density (airy|comfortable|dense), light/dark strategy, atmosphere matching the signature, anti-cliché note that bans the default centered blur-orb SaaS hero unless the pack truly needs a marketing hero. Vary pack+signature across sessions. Include this full brief in parentContext on every publish/update.
17
+
18
+ 3. BUILD (SPEED FIRST) anti-loop contract:
19
+ - Landing / magazine / single page: ONE publishSessionArtifacts with ONLY index.html (complete fragment). No contact.html, about.html, nindex.html, or data/*.json unless the user explicitly asked.
20
+ - Success = previewUrl returned. Then FINISH. Do not open a polish tour.
21
+ - Subagent may repair ONCE inside publish. If that still fails, you may call publishSessionArtifacts ONE more time with the named audit fixes then stop or report the remaining rule names. Never empty files:[].
22
+ - updateSessionArtifact: at most ONE call per user message, and only for a path that already exists AND a blocking error rule name (or an explicit user edit). Never update every file in sequence. Never call update just to "add fonts" / "improve design" / "replace emoji" after a successful publish — the server repairs fonts and strips emoji.
23
+ - Do NOT call getSessionQualityReport unless the user asks to polish/audit, or zero HTML files exist after publish.
24
+
25
+ 4. FINISH: short summary with previewUrl. No plan status narration. No extra tool calls after success.
26
+
27
+ Follow-ups in an existing session: one updateSessionArtifact (or one publish for a new path). Then stop.
28
+
29
+ Artifact mechanics:
30
+ 1. UI/HTML (default): publish body/main fragments per .html page (page logic in <script>, styling via Tailwind utilities). Server wraps fragments in a Tailwind shell — no doctype/html/head unless the user wants a full custom document. Prefer the design-brief Google Fonts (<link> + font-family); the server injects a non-Inter fallback if missing.
31
+ 2. Split assets only when the user asks (./styles.css, ./script.js).
32
+ 3. Docs: .md; optional data under data/*.json.
33
+ 4. Paths relative (no leading slash). Existing artifacts are listed in a system message — never re-publish them.
34
+ 5. parentContext MUST include the design brief plus any knowledge-tool outputs / data the subagent cannot see. Put visual requirements in artifacts[].requirements too.
35
+ 6. HTML structural edits: WHOLESALE complete-page rewrite (no hashline ping-pong). Tiny label tweaks may use hashline.
36
+ 7. Never tell the user a file exists without a previewUrl / updated path from the tool.
37
+
38
+ Skills — server selects guides automatically:
39
+ ${(0, skills_1.getSkillCatalog)()}
40
+
41
+ Omit the skills field for HTML. Pass skills: [] only for doc/data-only work.
42
+
43
+ App workspace (real apps): writeAppFiles + runAppCommand when the user wants a multi-file app with deps/build. Single pages stay on session artifacts.
26
44
 
27
45
  Rules:
28
- - Prefer concise, production-grade output.
29
- - Do not overwrite existing paths via publishSessionArtifacts.
30
- - You do not have validateHtml or validateMarkdown; delegated subagents run validation.
31
- - When editing, keep the same layout model as the session (inline vs split files).`;
46
+ - Production-grade UI; no flat AI-indigo templates; never Inter; Lucide SVG icons not emoji; no lorem / template adjectives (revolutionary/seamless/…).
47
+ - Prefer href="index.html" or #section-id over href="#".
48
+ - Speed over ceremony: one successful publish beats multi-step polish loops.`;
32
49
  //# sourceMappingURL=content-generator-system-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-generator-system-prompt.js","sourceRoot":"","sources":["../../../src/agents/shared/content-generator-system-prompt.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC7D,QAAA,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;mFA0BoC,CAAA"}
1
+ {"version":3,"file":"content-generator-system-prompt.js","sourceRoot":"","sources":["../../../src/agents/shared/content-generator-system-prompt.ts"],"names":[],"mappings":";;;AAAA,sCAA2C;AAE3C;8DAC8D;AACjD,QAAA,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC7C,IAAA,wBAAe,GAAE;;;;;;;;;6EAS0D,CAAA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Injectable design skills for UI-generating subagents.
3
+ *
4
+ * The orchestrator picks skill names per task; the subagent's prepareStep
5
+ * resolves them to content and injects a system message before the first step.
6
+ * `visual-foundation` is the baseline and is always injected for UI work.
7
+ */
8
+ export declare const VISUAL_FOUNDATION_SKILL = "visual-foundation";
9
+ export interface DesignSkill {
10
+ /** One-line summary shown in the orchestrator's skill catalog. */
11
+ description: string;
12
+ content: string;
13
+ }
14
+ export declare const DESIGN_SKILLS: Record<string, DesignSkill>;
15
+ export declare const DESIGN_SKILL_NAMES: [string, ...string[]];
16
+ /** One line per skill, for the orchestrator system prompt. */
17
+ export declare function designSkillsCatalog(): string;
18
+ /**
19
+ * Resolve skill names to injectable content. Unknown names are ignored.
20
+ * Pass alwaysIncludeFoundation for UI-producing agents.
21
+ */
22
+ export declare function resolveDesignSkills(names: string[], options?: {
23
+ alwaysIncludeFoundation?: boolean;
24
+ }): string;
25
+ /**
26
+ * Extract a `skills: string[]` field from a subagent's first user message,
27
+ * which the framework serializes as JSON.stringify(tool input).
28
+ */
29
+ export declare function parseSkillsFromMessages(messages: Array<{
30
+ role: string;
31
+ content: unknown;
32
+ }>): string[];
33
+ /**
34
+ * Infer page-specific design guides from the delegated task payload. This is a
35
+ * safety net for smaller orchestrator models: UI quality must not depend on the
36
+ * parent remembering an optional `skills` field.
37
+ */
38
+ export declare function inferDesignSkillsFromMessages(messages: Array<{
39
+ role: string;
40
+ content: unknown;
41
+ }>): string[];
42
+ export declare function resolveRequestedAndInferredDesignSkills(messages: Array<{
43
+ role: string;
44
+ content: unknown;
45
+ }>, options?: {
46
+ alwaysIncludeFoundation?: boolean;
47
+ }): string;
48
+ //# sourceMappingURL=design-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-skills.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/design-skills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,uBAAuB,sBAAsB,CAAA;AAwG1D,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CA6BrD,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAiC,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;AAErF,8DAA8D;AAC9D,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE;IAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAO,GAClD,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,GAClD,MAAM,EAAE,CAsBV;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,GAClD,MAAM,EAAE,CA8BV;AAED,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,EACnD,OAAO,GAAE;IAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAO,GAClD,MAAM,CAMR"}
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ /**
3
+ * Injectable design skills for UI-generating subagents.
4
+ *
5
+ * The orchestrator picks skill names per task; the subagent's prepareStep
6
+ * resolves them to content and injects a system message before the first step.
7
+ * `visual-foundation` is the baseline and is always injected for UI work.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DESIGN_SKILL_NAMES = exports.DESIGN_SKILLS = exports.VISUAL_FOUNDATION_SKILL = void 0;
11
+ exports.designSkillsCatalog = designSkillsCatalog;
12
+ exports.resolveDesignSkills = resolveDesignSkills;
13
+ exports.parseSkillsFromMessages = parseSkillsFromMessages;
14
+ exports.inferDesignSkillsFromMessages = inferDesignSkillsFromMessages;
15
+ exports.resolveRequestedAndInferredDesignSkills = resolveRequestedAndInferredDesignSkills;
16
+ exports.VISUAL_FOUNDATION_SKILL = 'visual-foundation';
17
+ const visualFoundation = `## Design skill: visual foundation (always applies to UI pages)
18
+ Pico CSS is only the base layer. Every page MUST open with a page-scoped <style> block that gives it an intentional design; a default-styled document is not acceptable output.
19
+
20
+ Accent color — pick ONE that fits the content and set it via Pico variables at the top of <style>:
21
+ :root {
22
+ --pico-primary: <accent>;
23
+ --pico-primary-background: <accent>;
24
+ --pico-primary-hover-background: <~10% darker>;
25
+ --pico-primary-underline: <accent>;
26
+ }
27
+ Use color-mix(in srgb, <accent> 10%, transparent) for tinted section/badge backgrounds so light and dark mode both work. For all other colors use Pico variables (var(--pico-muted-color), var(--pico-muted-border-color), var(--pico-card-background-color)) — never hard-coded grays.
28
+
29
+ Hierarchy: one clear h1 (clamp(2rem, 4vw, 2.75rem), tight letter-spacing), a muted one-line subtitle under it, then sections separated by generous whitespace (3-4rem). Never a wall of same-sized text.
30
+
31
+ Layout: CSS grid for cards, features, and stats — grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem.
32
+
33
+ Composition: do not place the entire experience in one narrow text column. Use contrasting section rhythms, asymmetric compositions where appropriate, layered surfaces, and deliberate negative space. For full-width bands inside the server container use a full-bleed utility; keep inner content aligned to a shared max-width.
34
+
35
+ Cards: <article> with ~1.25-1.5rem padding; hover lift (translateY(-2px) + stronger shadow, 150ms transition) only when clickable.
36
+
37
+ Icons: small inline SVGs (24px viewBox, stroke="currentColor", stroke-width 1.5-2, fill="none") — not emoji.
38
+
39
+ Restraint: one accent + neutrals only, at most two extra font weights, one border-radius value, spacing from a 0.5/1/1.5/2/3rem scale. No gradients-on-everything, no more than one decorative flourish per page.
40
+
41
+ Responsive: grids collapse via auto-fit; no fixed pixel widths on containers; verify mentally at 375px.`;
42
+ const landingPage = `## Design skill: landing page
43
+ Structure top to bottom: hero → social proof strip → 3 feature cards or alternating feature rows → deep-dive section → pricing (if relevant) → final CTA band → footer.
44
+
45
+ Hero: full-width section, 5-6rem vertical padding. Headline clamp(2.5rem, 6vw, 4rem), font-weight 800, letter-spacing -0.03em, max-width 16ch when centered. One-sentence subhead in var(--pico-muted-color), max-width 55ch. Two CTAs side by side: primary button + secondary outline. Optionally a generated hero image below or beside (split hero: grid 1.1fr 1fr, text left, image right with border-radius and subtle shadow).
46
+
47
+ Social proof: a muted "Trusted by" line with 4-6 grayscale text logos or stat pair, 0.85rem, uppercase, letter-spacing 0.05em.
48
+
49
+ Feature sections: alternate text/image sides in split rows (grid, gap 3rem, align-items center). Each feature: small tinted icon chip (2.5rem square, border-radius, accent at 10% via color-mix), h3, 2-line description.
50
+
51
+ Pricing: 2-3 cards in a grid; highlight the recommended tier with an accent border, a small "Popular" pill, and slightly larger scale. Price big (2.5rem bold), features as a checkmark list (inline SVG checks in accent color).
52
+
53
+ Final CTA band: tinted background (accent 8% via color-mix), centered h2 + one primary button, 4rem padding.
54
+
55
+ Images: generate ONE hero image (and at most one supporting illustration) with generateSessionImages; describe a consistent art style in the prompt (e.g. "clean minimal 3D render, soft studio lighting, single <accent-name> accent color on light neutral background"). Never generate images for icons or logos.`;
56
+ const dashboard = `## Design skill: dashboard
57
+ Shell: sticky top bar (product name left, actions/avatar right, border-bottom var(--pico-muted-border-color), backdrop-filter blur) over a content area with max-width 1200px. Add a slim sidebar only if there are 5+ nav destinations.
58
+
59
+ Top of content: page title (1.5rem, 700) + date/filter controls right-aligned in one row (flex, space-between).
60
+
61
+ Stat tiles first: 3-4 in a grid row. Tile = article with label (0.8rem, uppercase, letter-spacing 0.05em, var(--pico-muted-color)) above value (2rem, 700, tabular-nums) plus a small delta pill (green/red tinted background via color-mix, ▲/▼ arrow, 0.8rem).
62
+
63
+ Charts: render with inline <svg> (line/area/bar drawn from the data — no chart library). Area fills use the accent at 15% opacity, 2px accent stroke, subtle horizontal gridlines (var(--pico-muted-border-color)), axis labels 0.75rem muted. Chart lives in a card with a title row (h3 + time-range select).
64
+
65
+ Tables: compact (0.9rem), th uppercase 0.75rem muted, numeric columns right-aligned with font-variant-numeric: tabular-nums, status as small pill badges, row hover background color-mix(in srgb, var(--pico-primary) 4%, transparent).
66
+
67
+ Density: dashboards are the one page type where whitespace shrinks — 1rem gaps, 1rem card padding. Everything aligns to the same grid; no orphan widgets. Do not generate images for dashboards.`;
68
+ const dataTable = `## Design skill: data table
69
+ Wrap in a card: article with zero padding, table inside, header row with title + search input + primary action button (padding 1rem 1.25rem, border-bottom).
70
+
71
+ Table: font-size 0.9rem; th 0.75rem uppercase letter-spacing 0.05em var(--pico-muted-color); text columns left-aligned, numeric right-aligned with tabular-nums; dates muted. Sticky header (position: sticky, top: 0, background var(--pico-card-background-color)) when the table scrolls.
72
+
73
+ Rows: 1px separators only (no zebra unless 20+ dense rows), hover tint color-mix(in srgb, var(--pico-primary) 4%, transparent). First column can pair an avatar-initial circle (2rem, accent 15% background, 600 weight initials) with a name + muted sub-line.
74
+
75
+ Status: pill badges — 0.75rem, 600, padding 0.15rem 0.6rem, border-radius 999px, tinted background + matching darker text (green=active, amber=pending, red=failed, gray=archived), all via color-mix so dark mode works.
76
+
77
+ Footer row: "Showing X–Y of Z" muted left, page buttons right (small outline buttons, current page solid accent).
78
+
79
+ Empty state: centered in the card — muted inline SVG icon (48px), one bold line, one muted line, primary action button. Never render an empty <table>.`;
80
+ const formApp = `## Design skill: forms
81
+ Container: single column card, max-width 480px (560px for complex forms), centered; h2 + one muted context line above the fields.
82
+
83
+ Fields: label every input (0.85rem, 500). Group related fields with a 0.75rem-uppercase muted group heading and 2rem top margin. Pair short fields (city/zip) in a 2-column grid; never 3+ columns.
84
+
85
+ Primary action: full-width solid accent button at the bottom; secondary action as a text link beside/below it — never two solid buttons. Destructive actions are red outline.
86
+
87
+ Validation: on error add aria-invalid="true" and a 0.8rem red helper line under the field; on success keep quiet (no green everywhere). Disable the submit button while submitting with a busy label.
88
+
89
+ Multi-step: slim progress indicator on top (steps as dots/short labels, done in accent, current bold, future muted); Back as text button left, Next as solid accent right.
90
+
91
+ Finish with a success state: replace the form with a centered check icon in a tinted circle (accent 12%), bold confirmation line, muted detail line, one follow-up action.`;
92
+ const docsPage = `## Design skill: docs / long-form
93
+ Reading column: max-width 70ch, line-height 1.7; page h1 then a muted lede paragraph. If 5+ sections, add a right-side "On this page" TOC (sticky, 0.85rem, muted links, accent on active) using a two-column grid 1fr 220px that collapses on mobile.
94
+
95
+ Headings: h2 with 3rem top margin and optional subtle border-top separator; h3 at 2rem top margin. Every heading gets an id for anchor links.
96
+
97
+ Code: inline code in tinted background chips; blocks in <pre> with 1rem padding, border-radius, overflow-x auto, and a small muted language label. Keep Pico's code styling, don't re-theme it.
98
+
99
+ Callouts: blockquote variants with a 3px left accent border and tinted background — info (accent), warning (amber), danger (red) via color-mix; bold first word ("Note:", "Warning:").
100
+
101
+ Tables for API/params: parameter names in code style, types muted, required as a small pill. Navigation footer: prev/next as two outline cards (muted "Previous"/"Next" label above the page title) in a 2-column grid.`;
102
+ const portfolioGallery = `## Design skill: portfolio / gallery
103
+ Intro: short hero — name/title (clamp(2rem, 5vw, 3rem), 800), one-line positioning statement, muted; social/contact as small outline icon buttons.
104
+
105
+ Grid: cards in repeat(auto-fill, minmax(280px, 1fr)), gap 1.5rem. Card = image on top (aspect-ratio 16/10, object-fit cover, border-radius on top corners only), then 1.25rem padded body: title (1.1rem, 600), one-line muted description, tag pills row (0.75rem, tinted).
106
+
107
+ Hover: image scales 1.03 inside overflow-hidden container + card lifts; 200ms ease transitions.
108
+
109
+ Category filter: pill buttons row above the grid — active pill solid accent, inactive outline muted.
110
+
111
+ Images: generate one image per showcased item with generateSessionImages, all sharing ONE art-style phrase in their prompts (e.g. "soft-gradient abstract 3D shapes, matte texture, muted <accent> palette") so the grid reads as a curated set; vary only the subject per item. Square or landscape, never portrait mixed with landscape in one grid.`;
112
+ exports.DESIGN_SKILLS = {
113
+ [exports.VISUAL_FOUNDATION_SKILL]: {
114
+ description: 'Baseline visual system: accent via Pico variables, hierarchy, spacing, cards, restraint. Always applied to UI.',
115
+ content: visualFoundation,
116
+ },
117
+ 'landing-page': {
118
+ description: 'Marketing/landing pages: hero, social proof, feature rows, pricing, CTA band, hero imagery.',
119
+ content: landingPage,
120
+ },
121
+ dashboard: {
122
+ description: 'App dashboards: shell, stat tiles, inline SVG charts, dense tables, filters.',
123
+ content: dashboard,
124
+ },
125
+ 'data-table': {
126
+ description: 'Record lists and admin tables: alignment, status pills, pagination, empty states.',
127
+ content: dataTable,
128
+ },
129
+ 'form-app': {
130
+ description: 'Forms and wizards: field layout, grouping, validation, multi-step, success states.',
131
+ content: formApp,
132
+ },
133
+ 'docs-page': {
134
+ description: 'Docs and long-form reading: measure, TOC, code blocks, callouts, prev/next.',
135
+ content: docsPage,
136
+ },
137
+ 'portfolio-gallery': {
138
+ description: 'Portfolios and image grids: card grid, hover, filters, cohesive generated imagery.',
139
+ content: portfolioGallery,
140
+ },
141
+ };
142
+ exports.DESIGN_SKILL_NAMES = Object.keys(exports.DESIGN_SKILLS);
143
+ /** One line per skill, for the orchestrator system prompt. */
144
+ function designSkillsCatalog() {
145
+ return Object.entries(exports.DESIGN_SKILLS)
146
+ .map(([name, skill]) => `- ${name}: ${skill.description}`)
147
+ .join('\n');
148
+ }
149
+ /**
150
+ * Resolve skill names to injectable content. Unknown names are ignored.
151
+ * Pass alwaysIncludeFoundation for UI-producing agents.
152
+ */
153
+ function resolveDesignSkills(names, options = {}) {
154
+ const selected = new Set(options.alwaysIncludeFoundation ? [exports.VISUAL_FOUNDATION_SKILL] : []);
155
+ for (const name of names) {
156
+ if (exports.DESIGN_SKILLS[name]) {
157
+ selected.add(name);
158
+ }
159
+ }
160
+ if (selected.size === 0) {
161
+ return '';
162
+ }
163
+ return [...selected].map((name) => exports.DESIGN_SKILLS[name].content).join('\n\n');
164
+ }
165
+ /**
166
+ * Extract a `skills: string[]` field from a subagent's first user message,
167
+ * which the framework serializes as JSON.stringify(tool input).
168
+ */
169
+ function parseSkillsFromMessages(messages) {
170
+ const firstUser = messages.find((message) => message.role === 'user');
171
+ if (!firstUser) {
172
+ return [];
173
+ }
174
+ const text = typeof firstUser.content === 'string'
175
+ ? firstUser.content
176
+ : Array.isArray(firstUser.content)
177
+ ? firstUser.content
178
+ .map((part) => (typeof part === 'object' && part && 'text' in part ? String(part.text) : ''))
179
+ .join('')
180
+ : '';
181
+ try {
182
+ const parsed = JSON.parse(text);
183
+ if (Array.isArray(parsed.skills)) {
184
+ return parsed.skills.filter((skill) => typeof skill === 'string');
185
+ }
186
+ }
187
+ catch (_a) {
188
+ // Task payload was not JSON — no skills requested.
189
+ }
190
+ return [];
191
+ }
192
+ /**
193
+ * Infer page-specific design guides from the delegated task payload. This is a
194
+ * safety net for smaller orchestrator models: UI quality must not depend on the
195
+ * parent remembering an optional `skills` field.
196
+ */
197
+ function inferDesignSkillsFromMessages(messages) {
198
+ const text = messages
199
+ .filter((message) => message.role === 'user')
200
+ .map((message) => typeof message.content === 'string'
201
+ ? message.content
202
+ : JSON.stringify(message.content))
203
+ .join('\n')
204
+ .toLowerCase();
205
+ const inferred = new Set();
206
+ const addWhen = (pattern, skill) => {
207
+ if (pattern.test(text))
208
+ inferred.add(skill);
209
+ };
210
+ addWhen(/landing|marketing|saas|startup|product page|pricing|hero|conversion|waitlist/, 'landing-page');
211
+ addWhen(/dashboard|analytics|metrics|kpi|admin|overview|chart|reporting/, 'dashboard');
212
+ addWhen(/table|records|customers|orders|inventory|directory|list view|management/, 'data-table');
213
+ addWhen(/form|sign[ -]?up|login|checkout|onboarding|wizard|survey|settings/, 'form-app');
214
+ addWhen(/documentation|docs|guide|reference|article|knowledge base/, 'docs-page');
215
+ addWhen(/portfolio|gallery|showcase|photography|projects|case studies|real estate|travel|restaurant|fashion/, 'portfolio-gallery');
216
+ // A generic public-facing page benefits more from a landing composition than
217
+ // from receiving only the baseline visual tokens.
218
+ if (inferred.size === 0 && /\.html|website|web page|site|homepage/.test(text)) {
219
+ inferred.add('landing-page');
220
+ }
221
+ return [...inferred];
222
+ }
223
+ function resolveRequestedAndInferredDesignSkills(messages, options = {}) {
224
+ const names = [
225
+ ...parseSkillsFromMessages(messages),
226
+ ...inferDesignSkillsFromMessages(messages),
227
+ ];
228
+ return resolveDesignSkills(names, options);
229
+ }
230
+ //# sourceMappingURL=design-skills.js.map