@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.
- package/dist/agents/content-generator.agent.d.ts +8 -0
- package/dist/agents/content-generator.agent.d.ts.map +1 -1
- package/dist/agents/content-generator.agent.js +53 -6
- package/dist/agents/content-generator.agent.js.map +1 -1
- package/dist/agents/notebook.agent.d.ts.map +1 -1
- package/dist/agents/notebook.agent.js +2 -1
- package/dist/agents/notebook.agent.js.map +1 -1
- package/dist/agents/shared/build-plan.tools.d.ts.map +1 -1
- package/dist/agents/shared/build-plan.tools.js +4 -4
- package/dist/agents/shared/build-plan.tools.js.map +1 -1
- package/dist/agents/shared/content-generator-system-prompt.d.ts +3 -2
- package/dist/agents/shared/content-generator-system-prompt.d.ts.map +1 -1
- package/dist/agents/shared/content-generator-system-prompt.js +41 -24
- package/dist/agents/shared/content-generator-system-prompt.js.map +1 -1
- package/dist/agents/shared/design-skills.d.ts +48 -0
- package/dist/agents/shared/design-skills.d.ts.map +1 -0
- package/dist/agents/shared/design-skills.js +230 -0
- package/dist/agents/shared/design-skills.js.map +1 -0
- package/dist/agents/shared/generate-session-images.tool.d.ts +15 -0
- package/dist/agents/shared/generate-session-images.tool.d.ts.map +1 -0
- package/dist/agents/shared/generate-session-images.tool.js +98 -0
- package/dist/agents/shared/generate-session-images.tool.js.map +1 -0
- package/dist/agents/shared/publish-session-artifacts.tool.d.ts +5 -0
- package/dist/agents/shared/publish-session-artifacts.tool.d.ts.map +1 -1
- package/dist/agents/shared/publish-session-artifacts.tool.js +154 -15
- package/dist/agents/shared/publish-session-artifacts.tool.js.map +1 -1
- package/dist/agents/shared/session-quality-report.tool.js +1 -1
- package/dist/agents/shared/session-quality-report.tool.js.map +1 -1
- package/dist/agents/shared/update-session-artifacts.tool.d.ts +5 -0
- package/dist/agents/shared/update-session-artifacts.tool.d.ts.map +1 -1
- package/dist/agents/shared/update-session-artifacts.tool.js +136 -26
- package/dist/agents/shared/update-session-artifacts.tool.js.map +1 -1
- package/dist/agents/shared/validate-artifact-content.tools.d.ts +4 -0
- package/dist/agents/shared/validate-artifact-content.tools.d.ts.map +1 -1
- package/dist/agents/shared/validate-artifact-content.tools.js +24 -1
- package/dist/agents/shared/validate-artifact-content.tools.js.map +1 -1
- package/dist/agents/skills/designer.skill.d.ts.map +1 -1
- package/dist/agents/skills/designer.skill.js +75 -113
- package/dist/agents/skills/designer.skill.js.map +1 -1
- package/dist/agents/skills/skill-injection.d.ts.map +1 -1
- package/dist/agents/skills/skill-injection.js +9 -3
- package/dist/agents/skills/skill-injection.js.map +1 -1
- package/dist/context.d.ts +4 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/create-builder-api.d.ts +6 -0
- package/dist/create-builder-api.d.ts.map +1 -1
- package/dist/create-builder-api.js +2 -0
- package/dist/create-builder-api.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/session-artifacts/hashline-diff-guide.d.ts +1 -1
- package/dist/lib/session-artifacts/hashline-diff-guide.d.ts.map +1 -1
- package/dist/lib/session-artifacts/hashline-diff-guide.js +9 -5
- package/dist/lib/session-artifacts/hashline-diff-guide.js.map +1 -1
- package/dist/lib/session-artifacts/parse-hashline-diff.d.ts +13 -0
- package/dist/lib/session-artifacts/parse-hashline-diff.d.ts.map +1 -1
- package/dist/lib/session-artifacts/parse-hashline-diff.js +72 -0
- package/dist/lib/session-artifacts/parse-hashline-diff.js.map +1 -1
- package/dist/lib/session-pages/artifact-quality-audit.d.ts.map +1 -1
- package/dist/lib/session-pages/artifact-quality-audit.js +19 -14
- package/dist/lib/session-pages/artifact-quality-audit.js.map +1 -1
- package/dist/lib/session-pages/html-artifact-template.d.ts +16 -0
- package/dist/lib/session-pages/html-artifact-template.d.ts.map +1 -1
- package/dist/lib/session-pages/html-artifact-template.js +166 -10
- package/dist/lib/session-pages/html-artifact-template.js.map +1 -1
- package/dist/lib/session-pages/index.d.ts +4 -0
- package/dist/lib/session-pages/index.d.ts.map +1 -1
- package/dist/lib/session-pages/index.js +11 -1
- package/dist/lib/session-pages/index.js.map +1 -1
- package/dist/lib/session-pages/write-binary-session-artifact.d.ts +12 -0
- package/dist/lib/session-pages/write-binary-session-artifact.d.ts.map +1 -0
- package/dist/lib/session-pages/write-binary-session-artifact.js +23 -0
- package/dist/lib/session-pages/write-binary-session-artifact.js.map +1 -0
- package/dist/lib/session-pages/write-session-artifacts.d.ts +1 -0
- package/dist/lib/session-pages/write-session-artifacts.d.ts.map +1 -1
- package/dist/lib/session-pages/write-session-artifacts.js +4 -1
- package/dist/lib/session-pages/write-session-artifacts.js.map +1 -1
- package/dist/lib/session-plans/build-plan.d.ts +13 -3
- package/dist/lib/session-plans/build-plan.d.ts.map +1 -1
- package/dist/lib/session-plans/build-plan.js +37 -6
- package/dist/lib/session-plans/build-plan.js.map +1 -1
- package/dist/realtime/session-artifact-yjs-store.d.ts +18 -0
- package/dist/realtime/session-artifact-yjs-store.d.ts.map +1 -1
- package/dist/realtime/session-artifact-yjs-store.js +62 -0
- package/dist/realtime/session-artifact-yjs-store.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/package.json +9 -9
- package/dist/agents/blocknote.agent.d.ts +0 -6
- package/dist/agents/blocknote.agent.d.ts.map +0 -1
- package/dist/agents/blocknote.agent.js +0 -18
- package/dist/agents/blocknote.agent.js.map +0 -1
- package/dist/agents/filingramp-fetch.agent.d.ts +0 -4
- package/dist/agents/filingramp-fetch.agent.d.ts.map +0 -1
- package/dist/agents/filingramp-fetch.agent.js +0 -195
- package/dist/agents/filingramp-fetch.agent.js.map +0 -1
- package/dist/agents/knowledge/filingramp-endpoints.d.ts +0 -23
- package/dist/agents/knowledge/filingramp-endpoints.d.ts.map +0 -1
- package/dist/agents/knowledge/filingramp-endpoints.js +0 -116
- package/dist/agents/knowledge/filingramp-endpoints.js.map +0 -1
- package/dist/agents/shared/blocknote-system-prompt.d.ts +0 -2
- package/dist/agents/shared/blocknote-system-prompt.d.ts.map +0 -1
- package/dist/agents/shared/blocknote-system-prompt.js +0 -40
- package/dist/agents/shared/blocknote-system-prompt.js.map +0 -1
- package/dist/agents/shared/get-latest-session-artifact.tool.d.ts +0 -7
- package/dist/agents/shared/get-latest-session-artifact.tool.d.ts.map +0 -1
- package/dist/agents/shared/get-latest-session-artifact.tool.js +0 -43
- package/dist/agents/shared/get-latest-session-artifact.tool.js.map +0 -1
- package/dist/agents/shared/get-session-artifact-content.tool.d.ts +0 -7
- package/dist/agents/shared/get-session-artifact-content.tool.d.ts.map +0 -1
- package/dist/agents/shared/get-session-artifact-content.tool.js +0 -44
- package/dist/agents/shared/get-session-artifact-content.tool.js.map +0 -1
- package/dist/agents/shared/list-session-artifact-paths.tool.d.ts +0 -5
- package/dist/agents/shared/list-session-artifact-paths.tool.d.ts.map +0 -1
- package/dist/agents/shared/list-session-artifact-paths.tool.js +0 -37
- package/dist/agents/shared/list-session-artifact-paths.tool.js.map +0 -1
- package/dist/lib/ai/agent-ai-service.d.ts +0 -3
- package/dist/lib/ai/agent-ai-service.d.ts.map +0 -1
- package/dist/lib/ai/agent-ai-service.js +0 -15
- package/dist/lib/ai/agent-ai-service.js.map +0 -1
- package/dist/lib/ai/ai-error-details.d.ts +0 -13
- package/dist/lib/ai/ai-error-details.d.ts.map +0 -1
- package/dist/lib/ai/ai-error-details.js +0 -84
- package/dist/lib/ai/ai-error-details.js.map +0 -1
- package/dist/lib/ai/generate-ai-text.d.ts +0 -12
- package/dist/lib/ai/generate-ai-text.d.ts.map +0 -1
- package/dist/lib/ai/generate-ai-text.js +0 -105
- package/dist/lib/ai/generate-ai-text.js.map +0 -1
- package/dist/lib/ai/run-explicit-agent.d.ts +0 -15
- package/dist/lib/ai/run-explicit-agent.d.ts.map +0 -1
- package/dist/lib/ai/run-explicit-agent.js +0 -30
- package/dist/lib/ai/run-explicit-agent.js.map +0 -1
- package/dist/lib/notebooks/notebook-sql-client.d.ts +0 -5
- package/dist/lib/notebooks/notebook-sql-client.d.ts.map +0 -1
- package/dist/lib/notebooks/notebook-sql-client.js +0 -37
- package/dist/lib/notebooks/notebook-sql-client.js.map +0 -1
- package/dist/lib/notebooks/notebook-sql-schema.d.ts +0 -16
- package/dist/lib/notebooks/notebook-sql-schema.d.ts.map +0 -1
- package/dist/lib/notebooks/notebook-sql-schema.js +0 -117
- package/dist/lib/notebooks/notebook-sql-schema.js.map +0 -1
- package/dist/lib/notebooks/notebook-sql.d.ts +0 -9
- package/dist/lib/notebooks/notebook-sql.d.ts.map +0 -1
- package/dist/lib/notebooks/notebook-sql.js +0 -36
- package/dist/lib/notebooks/notebook-sql.js.map +0 -1
- package/dist/lib/session-artifacts/apply-hashline-edits.d.ts +0 -3
- package/dist/lib/session-artifacts/apply-hashline-edits.d.ts.map +0 -1
- package/dist/lib/session-artifacts/apply-hashline-edits.js +0 -25
- package/dist/lib/session-artifacts/apply-hashline-edits.js.map +0 -1
- package/dist/lib/session-artifacts/artifact-text-edit.d.ts +0 -8
- package/dist/lib/session-artifacts/artifact-text-edit.d.ts.map +0 -1
- package/dist/lib/session-artifacts/artifact-text-edit.js +0 -23
- package/dist/lib/session-artifacts/artifact-text-edit.js.map +0 -1
- package/dist/lib/session-artifacts/hashline-tag.d.ts +0 -33
- package/dist/lib/session-artifacts/hashline-tag.d.ts.map +0 -1
- package/dist/lib/session-artifacts/hashline-tag.js +0 -80
- package/dist/lib/session-artifacts/hashline-tag.js.map +0 -1
- package/dist/lib/session-pages/inject-preview-error-reporter.d.ts +0 -3
- package/dist/lib/session-pages/inject-preview-error-reporter.d.ts.map +0 -1
- package/dist/lib/session-pages/inject-preview-error-reporter.js +0 -30
- package/dist/lib/session-pages/inject-preview-error-reporter.js.map +0 -1
- package/dist/lib/session-pages/read-session-artifact.d.ts +0 -7
- package/dist/lib/session-pages/read-session-artifact.d.ts.map +0 -1
- package/dist/lib/session-pages/read-session-artifact.js +0 -60
- package/dist/lib/session-pages/read-session-artifact.js.map +0 -1
- package/dist/lib/session-pages/session-pico-css.d.ts +0 -5
- package/dist/lib/session-pages/session-pico-css.d.ts.map +0 -1
- package/dist/lib/session-pages/session-pico-css.js +0 -11
- package/dist/lib/session-pages/session-pico-css.js.map +0 -1
- package/dist/realtime/realtime-auth.d.ts +0 -12
- package/dist/realtime/realtime-auth.d.ts.map +0 -1
- package/dist/realtime/realtime-auth.js +0 -25
- package/dist/realtime/realtime-auth.js.map +0 -1
- package/dist/realtime/yjs-account-namespace.d.ts +0 -5
- package/dist/realtime/yjs-account-namespace.d.ts.map +0 -1
- package/dist/realtime/yjs-account-namespace.js +0 -21
- package/dist/realtime/yjs-account-namespace.js.map +0 -1
- package/dist/routes/notebooks/sql-execute.d.ts +0 -3
- package/dist/routes/notebooks/sql-execute.d.ts.map +0 -1
- package/dist/routes/notebooks/sql-execute.js +0 -45
- package/dist/routes/notebooks/sql-execute.js.map +0 -1
- package/dist/routes/sql.d.ts +0 -2
- package/dist/routes/sql.d.ts.map +0 -1
- package/dist/routes/sql.js +0 -50
- package/dist/routes/sql.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateSessionArtifactsSubagentTool = exports.applySessionArtifactDiffTool = exports.getSessionArtifactLatestContentTool = exports.updateSessionArtifactInputSchema = exports.getSessionArtifactLatestContentInputSchema = exports.applySessionArtifactDiffInputSchema = void 0;
|
|
4
|
+
exports.shouldStopUpdateSubagent = shouldStopUpdateSubagent;
|
|
4
5
|
exports.getUpdateSessionArtifactsSubagent = getUpdateSessionArtifactsSubagent;
|
|
5
6
|
const ai_agent_types_1 = require("@multiplayer-app/ai-agent-types");
|
|
6
7
|
const zod_1 = require("zod");
|
|
@@ -9,9 +10,12 @@ const agent_context_1 = require("./agent-context");
|
|
|
9
10
|
const artifact_events_1 = require("../../lib/socket/artifact-events");
|
|
10
11
|
const hashline_diff_guide_1 = require("../../lib/session-artifacts/hashline-diff-guide");
|
|
11
12
|
const hashline_tags_1 = require("../../lib/session-artifacts/hashline-tags");
|
|
13
|
+
const parse_hashline_diff_1 = require("../../lib/session-artifacts/parse-hashline-diff");
|
|
12
14
|
const session_pages_1 = require("../../lib/session-pages");
|
|
13
15
|
const session_artifact_yjs_store_1 = require("../../realtime/session-artifact-yjs-store");
|
|
14
16
|
const logger_1 = require("../../logger");
|
|
17
|
+
const build_plan_1 = require("../../lib/session-plans/build-plan");
|
|
18
|
+
const skills_1 = require("../skills");
|
|
15
19
|
exports.applySessionArtifactDiffInputSchema = zod_1.z.object({
|
|
16
20
|
path: zod_1.z
|
|
17
21
|
.string()
|
|
@@ -20,20 +24,47 @@ exports.applySessionArtifactDiffInputSchema = zod_1.z.object({
|
|
|
20
24
|
diff: zod_1.z
|
|
21
25
|
.string()
|
|
22
26
|
.min(1)
|
|
23
|
-
.describe('
|
|
27
|
+
.describe('Either (1) hashline SEARCH/REPLACE blocks with tags from getSessionArtifactLatestContent, or (2) the COMPLETE new file contents with no <<<SEARCH markers for a wholesale rewrite (preferred for structural/consistency fixes).'),
|
|
24
28
|
});
|
|
25
29
|
exports.getSessionArtifactLatestContentInputSchema = zod_1.z.object({
|
|
26
30
|
path: zod_1.z.string().min(1).describe('Relative path of an existing session artifact'),
|
|
27
31
|
});
|
|
28
32
|
exports.updateSessionArtifactInputSchema = zod_1.z.object({
|
|
29
|
-
parentContext: zod_1.z
|
|
30
|
-
|
|
33
|
+
parentContext: zod_1.z
|
|
34
|
+
.string()
|
|
35
|
+
.min(1)
|
|
36
|
+
.describe('Context the editor cannot see: design brief tokens, exact findings to fix (consistency only), acceptance criteria. Keep short.'),
|
|
37
|
+
task: zod_1.z
|
|
38
|
+
.string()
|
|
39
|
+
.min(1)
|
|
40
|
+
.describe('Single edit instruction including the exact existing path. For HTML section/structural work say WHOLESALE rewrite of the complete page. One delegation per plan task — do not stack multiple updateSessionArtifact calls for the same task.'),
|
|
41
|
+
skills: zod_1.z
|
|
42
|
+
.array(zod_1.z.string())
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Relevant built-in and account skill guides are selected automatically. Pass [] for doc edits and read/Q&A tasks to skip dynamic skill guidance; otherwise omit this field.'),
|
|
31
45
|
});
|
|
32
|
-
|
|
46
|
+
/** Missing-path attempts per subagent — the editor cannot create files, so
|
|
47
|
+
* retrying against a nonexistent path is always futile. */
|
|
48
|
+
const missingPathAttempts = new Map();
|
|
49
|
+
const MISSING_PATH_ATTEMPTS_LIMIT = 500;
|
|
50
|
+
async function assertExistingArtifactPath(sessionId, artifactPath, context) {
|
|
51
|
+
var _a, _b, _c;
|
|
33
52
|
const normalizedPath = (0, session_pages_1.normalizeArtifactPath)(artifactPath);
|
|
34
53
|
const [artifact] = await (0, session_pages_1.readSessionArtifacts)(sessionId, [normalizedPath]);
|
|
35
54
|
if (!(artifact === null || artifact === void 0 ? void 0 : artifact.found)) {
|
|
36
|
-
|
|
55
|
+
const files = await (0, session_pages_1.listSessionArtifacts)(sessionId);
|
|
56
|
+
const key = `${String((_b = (_a = context === null || context === void 0 ? void 0 : context.data) === null || _a === void 0 ? void 0 : _a.subagentChatId) !== null && _b !== void 0 ? _b : sessionId)}:${normalizedPath}`;
|
|
57
|
+
const attempts = ((_c = missingPathAttempts.get(key)) !== null && _c !== void 0 ? _c : 0) + 1;
|
|
58
|
+
if (missingPathAttempts.size > MISSING_PATH_ATTEMPTS_LIMIT) {
|
|
59
|
+
const oldest = missingPathAttempts.keys().next().value;
|
|
60
|
+
if (oldest !== undefined)
|
|
61
|
+
missingPathAttempts.delete(oldest);
|
|
62
|
+
}
|
|
63
|
+
missingPathAttempts.set(key, attempts);
|
|
64
|
+
const escalation = attempts > 1
|
|
65
|
+
? ' STOP — you were already told this file does not exist and you CANNOT create files. End your turn NOW with a short reply telling the parent to create it via publishSessionArtifacts.'
|
|
66
|
+
: ' You cannot create files — do not retry any tool against this path; reply to the parent that it must be created via publishSessionArtifacts.';
|
|
67
|
+
throw new Error(`Session artifact not found: ${normalizedPath}. Existing files: ${files.map((file) => file.path).join(', ') || '(none)'}.${escalation}`);
|
|
37
68
|
}
|
|
38
69
|
return normalizedPath;
|
|
39
70
|
}
|
|
@@ -58,7 +89,7 @@ exports.getSessionArtifactLatestContentTool = {
|
|
|
58
89
|
throw new Error('Session ID is required');
|
|
59
90
|
}
|
|
60
91
|
try {
|
|
61
|
-
const path = await assertExistingArtifactPath(sessionId, input.path);
|
|
92
|
+
const path = await assertExistingArtifactPath(sessionId, input.path, context);
|
|
62
93
|
const content = await (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)().getLatestText(sessionId, path);
|
|
63
94
|
return {
|
|
64
95
|
path,
|
|
@@ -84,13 +115,43 @@ exports.applySessionArtifactDiffTool = {
|
|
|
84
115
|
path: zod_1.z.string(),
|
|
85
116
|
}),
|
|
86
117
|
execute: async (input, context) => {
|
|
118
|
+
var _a;
|
|
87
119
|
const sessionId = (0, agent_context_1.getRootChatId)(context);
|
|
88
120
|
if (!sessionId) {
|
|
89
121
|
throw new Error('Session ID is required');
|
|
90
122
|
}
|
|
91
123
|
try {
|
|
92
|
-
const path = await assertExistingArtifactPath(sessionId, input.path);
|
|
93
|
-
const
|
|
124
|
+
const path = await assertExistingArtifactPath(sessionId, input.path, context);
|
|
125
|
+
const isHtml = path.toLowerCase().endsWith('.html');
|
|
126
|
+
const classification = (0, parse_hashline_diff_1.classifyArtifactDiff)(input.diff, { isHtml });
|
|
127
|
+
if (classification.kind === 'invalid') {
|
|
128
|
+
throw new Error(classification.reason);
|
|
129
|
+
}
|
|
130
|
+
const current = await (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)().getLatestText(sessionId, path);
|
|
131
|
+
const updated = classification.kind === 'replace'
|
|
132
|
+
? isHtml
|
|
133
|
+
? (0, session_pages_1.prepareHtmlArtifactContent)(classification.content, {})
|
|
134
|
+
: classification.content
|
|
135
|
+
: isHtml
|
|
136
|
+
? (0, session_pages_1.prepareHtmlArtifactContent)((0, hashline_tags_1.joinContentLines)((0, parse_hashline_diff_1.applyPatchToLines)((0, hashline_tags_1.splitContentLines)(current), input.diff)), { fragment: false })
|
|
137
|
+
: (0, hashline_tags_1.joinContentLines)((0, parse_hashline_diff_1.applyPatchToLines)((0, hashline_tags_1.splitContentLines)(current), input.diff));
|
|
138
|
+
// Soft quality gate: reject edits that introduce NEW audit errors
|
|
139
|
+
// (legacy pages may carry old findings — those never block edits).
|
|
140
|
+
if (isHtml) {
|
|
141
|
+
const beforeErrorRules = new Set((0, session_pages_1.auditHtmlArtifact)(current).findings
|
|
142
|
+
.filter((finding) => finding.severity === 'error')
|
|
143
|
+
.map((finding) => finding.rule));
|
|
144
|
+
const introduced = (0, session_pages_1.auditHtmlArtifact)(updated).findings.filter((finding) => finding.severity === 'error' && !beforeErrorRules.has(finding.rule));
|
|
145
|
+
if (introduced.length > 0) {
|
|
146
|
+
throw new Error(`Edit rejected — it introduces quality errors: ${introduced
|
|
147
|
+
.map((finding) => `[${finding.rule}] ${finding.message}`)
|
|
148
|
+
.join(' ')}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Always write the gated `updated` content. Never re-parse the raw
|
|
152
|
+
// diff via applyPatchText — that path threw on malformed SEARCH
|
|
153
|
+
// markers after partial retries and left duplicated sections.
|
|
154
|
+
const result = await (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)().replaceFromContent(sessionId, path, updated);
|
|
94
155
|
const publishedAt = new Date().toISOString();
|
|
95
156
|
const previewUrl = `${(0, context_1.getBuilderApiContext)().config.apiPrefix}/sessions/${sessionId}/${result.path}`;
|
|
96
157
|
const socketPayload = {
|
|
@@ -101,10 +162,28 @@ exports.applySessionArtifactDiffTool = {
|
|
|
101
162
|
};
|
|
102
163
|
const notifyUserIds = await (0, session_pages_1.resolveArtifactNotifyUserIds)(sessionId, context);
|
|
103
164
|
(0, artifact_events_1.emitArtifactUpdateToUsers)(notifyUserIds, socketPayload);
|
|
165
|
+
try {
|
|
166
|
+
const store = (0, session_artifact_yjs_store_1.getSessionArtifactYjsStore)();
|
|
167
|
+
const plan = (0, build_plan_1.parseBuildPlan)(await store.getLatestText(sessionId, build_plan_1.BUILD_PLAN_PATH).catch(() => ''));
|
|
168
|
+
if ((_a = plan === null || plan === void 0 ? void 0 : plan.openAdvisories) === null || _a === void 0 ? void 0 : _a.some((entry) => entry.path === result.path)) {
|
|
169
|
+
(0, build_plan_1.clearOpenAdvisories)(plan, [result.path], publishedAt);
|
|
170
|
+
await store.upsertFromContent(sessionId, build_plan_1.BUILD_PLAN_PATH, (0, build_plan_1.serializeBuildPlan)(plan));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
(0, logger_1.getBuilderApiLogger)().warn(`[update] failed to clear openAdvisories: ${String(err)}`);
|
|
175
|
+
}
|
|
104
176
|
return { path: result.path };
|
|
105
177
|
}
|
|
106
178
|
catch (err) {
|
|
107
179
|
(0, logger_1.getBuilderApiLogger)().error({ err });
|
|
180
|
+
// Stale tags are the common failure loop: models resend the same diff
|
|
181
|
+
// instead of re-reading. Point them at a fresh read (do NOT embed the
|
|
182
|
+
// entire file — that encouraged broken wholesale pastes mid-hashline).
|
|
183
|
+
if (err instanceof Error && /hash mismatch|out of range/i.test(err.message)) {
|
|
184
|
+
const path = (0, session_pages_1.normalizeArtifactPath)(input.path);
|
|
185
|
+
throw new Error(`${err.message}\nDo NOT resend the same diff — its tags are stale. Call getSessionArtifactLatestContent("${path}") again, then either rebuild SEARCH/REPLACE from the new tags OR send the COMPLETE page as diff with no <<<SEARCH markers (preferred for structural fixes).`);
|
|
186
|
+
}
|
|
108
187
|
throw err;
|
|
109
188
|
}
|
|
110
189
|
},
|
|
@@ -115,37 +194,44 @@ exports.updateSessionArtifactsSubagentTool = {
|
|
|
115
194
|
userConfigurable: true,
|
|
116
195
|
data: {
|
|
117
196
|
title: 'updateSessionArtifact',
|
|
118
|
-
description: '
|
|
197
|
+
description: 'ONE edit (or read) of an existing artifact for the current plan task. Prefer wholesale HTML rewrites. Do not call repeatedly for the same task or for mid-build quality warnings.',
|
|
119
198
|
inputSchema: exports.updateSessionArtifactInputSchema,
|
|
120
199
|
subAgent: {
|
|
121
200
|
name: 'artifact-editor',
|
|
122
|
-
description: 'Reads existing session
|
|
201
|
+
description: 'Reads an existing session artifact and applies one edit (wholesale preferred for HTML). Stops after one successful apply or one failed repair.',
|
|
123
202
|
systemPrompt: `You work with a single existing file under the active session. The parent passes parentContext and task (include the artifact path in task).
|
|
124
203
|
|
|
125
204
|
Decide mode from the task:
|
|
126
|
-
- **Read / Q&A** — explain
|
|
127
|
-
- **Edit** — change the file
|
|
205
|
+
- **Read / Q&A** — explain or quote briefly. No applySessionArtifactDiff.
|
|
206
|
+
- **Edit** — change the file once, then stop.
|
|
128
207
|
|
|
129
|
-
|
|
208
|
+
**Speed contract (mandatory)**
|
|
209
|
+
1. Call getSessionArtifactLatestContent once.
|
|
210
|
+
2. For HTML edits that add sections, fix structure, or touch more than a tiny localized tweak: WHOLESALE rewrite — pass the COMPLETE corrected page as \`diff\` with NO <<<SEARCH markers. Preserve existing good sections; add/change only what the task asks.
|
|
211
|
+
3. Hashline SEARCH/REPLACE only for a tiny single-block tweak (one color, one label). If unsure, wholesale.
|
|
212
|
+
4. Call applySessionArtifactDiff once. On success, reply with ONLY the updated path — do not re-read, re-apply, or "improve further".
|
|
213
|
+
5. If apply is rejected (stale tags / malformed hashline / new audit errors): re-read once, WHOLESALE-rewrite the complete page once (no <<<SEARCH), then stop even if still failing. Never loop. Never retry broken hashline.
|
|
214
|
+
6. Do not chase contrast/heuristic polish, emoji, or fonts unless the task explicitly lists blocking error rule names — the server strips emoji and injects fonts.
|
|
130
215
|
|
|
131
216
|
**Read / Q&A workflow**
|
|
132
|
-
1.
|
|
133
|
-
2.
|
|
134
|
-
3. Reply to the parent with the answer, summary, or relevant code chunks only.
|
|
217
|
+
1. Cite short excerpts or bullet summaries only. Never dump the full file.
|
|
218
|
+
2. Reply to the parent with the answer only.
|
|
135
219
|
|
|
136
|
-
**Edit
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
4. Validate before applying:
|
|
141
|
-
- For .html paths, call validateHtml with the expected updated content.
|
|
142
|
-
- For .md paths, call validateMarkdown with the expected updated content and path.
|
|
143
|
-
5. Call applySessionArtifactDiff with path and diff.
|
|
144
|
-
6. Reply to the parent with ONLY the updated path from applySessionArtifactDiff (no file body).
|
|
220
|
+
**Edit quality (single write)**
|
|
221
|
+
- Keep the established design system (fonts, accent hex, chrome, pack, signature). Raise quality in that one write — distinctive fonts (never Inter), topic-fit accent, atmosphere matching the signature (glass sticky nav only when the brief calls for soft glass), Lucide SVG icons, real copy. Never collapse the page into a generic centered blur-orb template.
|
|
222
|
+
- Keep the page's existing base-framework tag. On Tailwind pages style via utilities; every text color readable on its background.
|
|
223
|
+
- An "Account skill guides" / "Session design system" message may follow — apply it in the same write.
|
|
145
224
|
|
|
146
225
|
${hashline_diff_guide_1.HASHLINE_DIFF_GUIDE}
|
|
226
|
+
|
|
227
|
+
# Generation skill guides
|
|
228
|
+
When editing .html, keep changes aligned with these guides (designer + a11y + copywriting always apply):
|
|
229
|
+
|
|
230
|
+
${skills_1.STATIC_SKILL_GUIDES}
|
|
147
231
|
`,
|
|
148
|
-
stopWhen:
|
|
232
|
+
stopWhen: shouldStopUpdateSubagent,
|
|
233
|
+
maxOutputTokens: 16000,
|
|
234
|
+
prepareStep: (0, skills_1.createSkillInjectingPrepareStep)(),
|
|
149
235
|
tools: [
|
|
150
236
|
exports.getSessionArtifactLatestContentTool,
|
|
151
237
|
exports.applySessionArtifactDiffTool,
|
|
@@ -153,6 +239,30 @@ ${hashline_diff_guide_1.HASHLINE_DIFF_GUIDE}
|
|
|
153
239
|
},
|
|
154
240
|
},
|
|
155
241
|
};
|
|
242
|
+
const TERMINAL_UPDATE_FAILURES = [
|
|
243
|
+
'Edit rejected',
|
|
244
|
+
'Quality audit failed',
|
|
245
|
+
'hash mismatch',
|
|
246
|
+
'out of range',
|
|
247
|
+
'Malformed hashline',
|
|
248
|
+
'Artifact not found',
|
|
249
|
+
'does not exist yet',
|
|
250
|
+
'Invalid diff',
|
|
251
|
+
'Session ID is required',
|
|
252
|
+
'File already exists',
|
|
253
|
+
'File not found',
|
|
254
|
+
'Type validation failed',
|
|
255
|
+
];
|
|
256
|
+
/** Read + apply (+ one repair) only. Absolute cap stops providers that ignore the budget. */
|
|
257
|
+
function shouldStopUpdateSubagent({ steps }) {
|
|
258
|
+
if (steps.length >= 4)
|
|
259
|
+
return true;
|
|
260
|
+
const rejectedWrites = steps.filter((step) => {
|
|
261
|
+
const serialized = JSON.stringify(step !== null && step !== void 0 ? step : {});
|
|
262
|
+
return TERMINAL_UPDATE_FAILURES.some((marker) => serialized.includes(marker));
|
|
263
|
+
}).length;
|
|
264
|
+
return rejectedWrites >= 2;
|
|
265
|
+
}
|
|
156
266
|
function getUpdateSessionArtifactsSubagent() {
|
|
157
267
|
return exports.updateSessionArtifactsSubagentTool;
|
|
158
268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-session-artifacts.tool.js","sourceRoot":"","sources":["../../../src/agents/shared/update-session-artifacts.tool.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update-session-artifacts.tool.js","sourceRoot":"","sources":["../../../src/agents/shared/update-session-artifacts.tool.ts"],"names":[],"mappings":";;;AA2UA,4DAOC;AAED,8EAEC;AArVD,oEAA+D;AAC/D,6BAAuB;AACvB,2CAAoD;AACpD,mDAA+C;AAC/C,sEAGyC;AACzC,yFAAqF;AACrF,6EAIkD;AAClD,yFAAyG;AACzG,2DAOgC;AAChC,0FAAsF;AACtF,yCAAkD;AAClD,mEAK2C;AAC3C,sCAAgF;AAEnE,QAAA,mCAAmC,GAAG,O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EAAwB;IACtE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,CAAA;QAC7C,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/E,CAAC,CAAC,CAAC,MAAM,CAAA;IACT,OAAO,cAAc,IAAI,CAAC,CAAA;AAC5B,CAAC;AAED,SAAgB,iCAAiC;IAC/C,OAAO,0CAAkC,CAAA;AAC3C,CAAC"}
|
|
@@ -9,4 +9,8 @@ export declare const validateMarkdownInputSchema: z.ZodObject<{
|
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export declare const validateHtmlTool: AgentTool;
|
|
11
11
|
export declare const validateMarkdownTool: AgentTool;
|
|
12
|
+
export declare const auditHtmlQualityInputSchema: z.ZodObject<{
|
|
13
|
+
html: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const auditHtmlQualityTool: AgentTool;
|
|
12
16
|
//# sourceMappingURL=validate-artifact-content.tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-artifact-content.tools.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/validate-artifact-content.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"validate-artifact-content.tools.d.ts","sourceRoot":"","sources":["../../../src/agents/shared/validate-artifact-content.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,uBAAuB;;iBAElC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;iBAMtC,CAAA;AAwGF,eAAO,MAAM,gBAAgB,EAAE,SAe9B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,SAgBlC,CAAA;AAED,eAAO,MAAM,2BAA2B;;iBAEtC,CAAA;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAqBlC,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateMarkdownTool = exports.validateHtmlTool = exports.validateMarkdownInputSchema = exports.validateHtmlInputSchema = void 0;
|
|
3
|
+
exports.auditHtmlQualityTool = exports.auditHtmlQualityInputSchema = exports.validateMarkdownTool = exports.validateHtmlTool = exports.validateMarkdownInputSchema = exports.validateHtmlInputSchema = void 0;
|
|
4
4
|
const ai_agent_types_1 = require("@multiplayer-app/ai-agent-types");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
+
const session_pages_1 = require("../../lib/session-pages");
|
|
6
7
|
exports.validateHtmlInputSchema = zod_1.z.object({
|
|
7
8
|
html: zod_1.z.string().min(1).describe('HTML to validate'),
|
|
8
9
|
});
|
|
@@ -128,4 +129,26 @@ exports.validateMarkdownTool = {
|
|
|
128
129
|
execute: (input) => basicMarkdownValidation(input.markdown, input.path),
|
|
129
130
|
},
|
|
130
131
|
};
|
|
132
|
+
exports.auditHtmlQualityInputSchema = zod_1.z.object({
|
|
133
|
+
html: zod_1.z.string().min(1).describe('Full HTML page or fragment to audit'),
|
|
134
|
+
});
|
|
135
|
+
exports.auditHtmlQualityTool = {
|
|
136
|
+
type: ai_agent_types_1.AgentToolType.LOCAL_FUNCTION,
|
|
137
|
+
userConfigurable: true,
|
|
138
|
+
data: {
|
|
139
|
+
title: 'auditHtmlQuality',
|
|
140
|
+
needsApproval: false,
|
|
141
|
+
description: 'Audit generated HTML against page-quality rules (external images, placeholder copy, scheme-breaking colors, missing motion guards, unlabeled inputs). Run before publishing and fix findings.',
|
|
142
|
+
inputSchema: exports.auditHtmlQualityInputSchema,
|
|
143
|
+
outputSchema: zod_1.z.object({
|
|
144
|
+
clean: zod_1.z.boolean(),
|
|
145
|
+
findings: zod_1.z.array(zod_1.z.object({
|
|
146
|
+
rule: zod_1.z.string(),
|
|
147
|
+
severity: zod_1.z.enum(['error', 'warning']),
|
|
148
|
+
message: zod_1.z.string(),
|
|
149
|
+
})),
|
|
150
|
+
}),
|
|
151
|
+
execute: (input) => (0, session_pages_1.auditHtmlArtifact)(input.html),
|
|
152
|
+
},
|
|
153
|
+
};
|
|
131
154
|
//# sourceMappingURL=validate-artifact-content.tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-artifact-content.tools.js","sourceRoot":"","sources":["../../../src/agents/shared/validate-artifact-content.tools.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,6BAAuB;
|
|
1
|
+
{"version":3,"file":"validate-artifact-content.tools.js","sourceRoot":"","sources":["../../../src/agents/shared/validate-artifact-content.tools.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,6BAAuB;AACvB,2DAA2D;AAE9C,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;CACrD,CAAC,CAAA;AAEW,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACnE,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE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,EAAE,8BAAa,CAAC,cAAc;IAClC,gBAAgB,EAAE,IAAI;IACtB,IAAI,EAAE;QACJ,KAAK,EAAE,kBAAkB;QACzB,aAAa,EAAE,KAAK;QACpB,WAAW,EACT,+LAA+L;QACjM,WAAW,EAAE,mCAA2B;QACxC,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE;YAClB,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,MAAM,CAAC;gBACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;gBAChB,QAAQ,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;aACpB,CAAC,CACH;SACF,CAAC;QACF,OAAO,EAAE,CAAC,KAAkD,EAAE,EAAE,CAAC,IAAA,iCAAiB,EAAC,KAAK,CAAC,IAAI,CAAC;KAC/F;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"designer.skill.d.ts","sourceRoot":"","sources":["../../../src/agents/skills/designer.skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"designer.skill.d.ts","sourceRoot":"","sources":["../../../src/agents/skills/designer.skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,aAAa,EAAE,eAiG3B,CAAA"}
|
|
@@ -3,137 +3,99 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.designerSkill = void 0;
|
|
4
4
|
exports.designerSkill = {
|
|
5
5
|
name: 'designer',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Advanced visual design: diverse layout packs, signature systems, typography, atmosphere, polish — never a single SaaS template',
|
|
7
7
|
whenToUse: 'Every UI/HTML page. Always include for any .html artifact.',
|
|
8
8
|
instructions: `## designer
|
|
9
9
|
|
|
10
|
-
Goal: every
|
|
10
|
+
Goal: every session should feel like a distinct 2025–2026 product — rich, modern, and different from the last one. Tailwind Play CDN is on (preflight): utility-class every visible element. Use a small <style> only for fonts, keyframes, and atmosphere (mesh/grain/noise).
|
|
11
|
+
|
|
12
|
+
### Diversity mandate (non-negotiable)
|
|
13
|
+
Do NOT invent from a mental default of "sticky glass nav + centered headline + blur orb + 3 feature cards". That skeleton is BANNED as a default.
|
|
14
|
+
1. Read the brief's **layout pack** + **signature** first.
|
|
15
|
+
2. Compose the first viewport to match THAT pack — invent structure; do not paste a generic template.
|
|
16
|
+
3. Across sessions, vary composition deliberately. Same accent with the same centered blob hero = fail.
|
|
17
|
+
4. Within a session, keep ONE design system (tokens, chrome, type) — diversity is across products, consistency is within a product.
|
|
11
18
|
|
|
12
19
|
### Design brief is law
|
|
13
|
-
Use the brief's accent as LITERAL hex utilities (bg-[#0EA5E9] hover:bg-[#0284C7]) — same hex everywhere. One neutral scale (slate OR zinc OR stone). Never indigo/violet defaults unless the brief names them. Never Inter. Never bg-[var(--x)] class names (undefined vars fail the gate).
|
|
20
|
+
Use the brief's accent as LITERAL hex utilities (bg-[#0EA5E9] hover:bg-[#0284C7]) — same hex everywhere. One neutral scale (slate OR zinc OR stone OR neutral). Never indigo/violet defaults unless the brief names them. Never Inter. Never bg-[var(--x)] class names (undefined vars fail the gate).
|
|
21
|
+
Honor: **radius** (sharp | soft | pill), **density** (airy | comfortable | dense), **signature**, **atmosphere**, **anti-cliché**.
|
|
14
22
|
|
|
15
23
|
### Accent contrast (buttons & labels)
|
|
16
24
|
Bright accents (#1DB954, lime, cyan-400, etc.) fail WCAG with white text and as body/eyebrow text on white. Prefer one of:
|
|
17
25
|
- CTA: dark text on bright fill — e.g. \`bg-[#1DB954] text-slate-950\` (not text-white)
|
|
18
|
-
- Or darken the fill for white text — e.g. \`bg-[#15803d] text-white\`
|
|
19
|
-
- Accent-as-text
|
|
26
|
+
- Or darken the fill for white text — e.g. \`bg-[#15803d] text-white\`
|
|
27
|
+
- Accent-as-text: darker shade of the brief accent, not the bright fill hex on white
|
|
20
28
|
Never waste turns "fixing contrast" by nudging slate body text — fix the accent/button pairing once.
|
|
21
29
|
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
30
|
+
### Layout packs — build the composition the pack implies
|
|
31
|
+
Pick (or follow) exactly one. Section rhythm and chrome must match the pack, not a generic launch page.
|
|
32
|
+
|
|
33
|
+
- **launch** — Marketing narrative. Full-bleed hero edge-to-edge; brand-first; then 2–3 sections with alternating alignment (NOT everything centered); social proof; pricing or final CTA. Still invent a distinctive hero (split, offset type, framed UI mock) — not the default centered blob.
|
|
34
|
+
- **split-hero** — First viewport is 50/50 (or 40/60) text + framed product UI / abstract SVG. Nav can be minimal. No centered single-column hero.
|
|
35
|
+
- **product** — App/dashboard density: glass or solid chrome header; KPI/toolbar row; card grid or sidebar+main; tables in cards. First viewport is the workspace, not a marketing hero.
|
|
36
|
+
- **workspace** — Persistent sidebar + main canvas from the first paint. Dense controls, quiet chrome. Marketing sections are out of place.
|
|
37
|
+
- **editorial** / **magazine** — Strong type hierarchy, asymmetric columns, pull quotes, accent border-l callouts, generous measure (max-w-2xl for body). Hero may be typographic only — huge display, little ornament.
|
|
38
|
+
- **bento** — Uneven modular grid (varied col/row spans). Modules have different jobs/sizes — never three equal cards in a row as the hero.
|
|
39
|
+
- **dark-terminal** — Near-black ground, mono or semi-mono accents, tight tracking, hard borders, minimal blur/glass. Green/amber/cyan terminal accents when topic-fit.
|
|
40
|
+
- **brutalist** — Hard edges (radius sharp), high contrast, visible structure, little or no blur/glass/orb. Typography does the work.
|
|
41
|
+
- **story** — Full-bleed stacked chapters, scroll narrative, minimal persistent nav. Each section is one beat; motion is scroll-tied (respect prefers-reduced-motion).
|
|
42
|
+
|
|
43
|
+
### Signature system (required in brief — execute literally)
|
|
44
|
+
Name and ship ONE of each:
|
|
45
|
+
- **Signature layout**: asymmetric | split | stacked | bento | magazine | terminal-rail | sidebar-first
|
|
46
|
+
- **Signature surface**: paper grain | hard grid | ink wash | soft glass | flat ink | mesh drift | noise film — pick ONE primary; do not stack all
|
|
47
|
+
- **Signature motion** (2–3 max total on the page): hero entrance | card lift | scroll reveal | type stagger | mesh drift — behind prefers-reduced-motion; never decorative noise
|
|
48
|
+
|
|
49
|
+
### Radius & density
|
|
50
|
+
- **sharp**: rounded-none / rounded-sm; hard separators
|
|
51
|
+
- **soft**: rounded-xl / rounded-2xl (default only when brief says soft)
|
|
52
|
+
- **pill**: rounded-full on controls and chips; keep cards softer or sharper per brief
|
|
53
|
+
- **airy**: py-24+, sparse; **comfortable**: py-16/20; **dense**: py-8–12, tighter gaps, compact type
|
|
27
54
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
55
|
+
### Brand-first first viewport
|
|
56
|
+
ONE composition: brand/product name as a hero-level signal (unless pack is product/workspace — then brand lives in chrome), one headline, one supporting sentence, one CTA pair (marketing packs), one dominant visual plane matching the signature surface.
|
|
57
|
+
- Launch/story/split-hero: full-bleed section background; max-w column INSIDE the section. Never put the hero inside a rounded card.
|
|
58
|
+
- Brand must still read if the nav disappeared (marketing packs).
|
|
59
|
+
- At most one quiet eyebrow — no floating stickers, KPI strips, or promo chips on hero media.
|
|
60
|
+
- Product/workspace packs: first viewport IS the app chrome + primary content — skip marketing hero rules.
|
|
61
|
+
|
|
62
|
+
### Atmosphere (required — flat white/black slabs fail)
|
|
63
|
+
Depth without clutter. Follow the brief's signature surface. Examples (pick what the brief named):
|
|
64
|
+
- Soft accent-tint wash on the hero
|
|
65
|
+
- Mesh blob (blur-3xl, low opacity) — ONLY when signature allows soft glass/mesh; banned for brutalist/terminal
|
|
66
|
+
- Subtle grain / noise film at 3–5% opacity
|
|
67
|
+
- Hard grid overlay (brutalist / terminal)
|
|
68
|
+
- Glass chrome when signature is soft glass — not mandatory for every pack
|
|
69
|
+
Never neon saturated walls. Atmosphere supports content.
|
|
35
70
|
|
|
36
71
|
### Typography
|
|
37
|
-
Load the brief's Google Fonts <link> + wire font-family on body in <style>.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<a href="pricing.html" class="transition-colors hover:text-[#0EA5E9]">Pricing</a>
|
|
53
|
-
</nav>
|
|
54
|
-
<div class="flex items-center gap-3">
|
|
55
|
-
<button type="button" class="md:hidden inline-flex h-10 w-10 items-center justify-center rounded-lg text-slate-700" aria-label="Open menu"><!-- menu svg --></button>
|
|
56
|
-
<a href="#cta" class="hidden sm:inline-flex items-center rounded-lg bg-[#0EA5E9] px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-[#0284C7] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0EA5E9] focus-visible:ring-offset-2">Start free</a>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</header>
|
|
60
|
-
\`\`\`
|
|
61
|
-
Include a mobile drawer/menu script for the md:hidden button — a sticky nav that does nothing on mobile looks unfinished.
|
|
62
|
-
|
|
63
|
-
Launch hero:
|
|
64
|
-
\`\`\`html
|
|
65
|
-
<section class="relative overflow-hidden">
|
|
66
|
-
<div class="pointer-events-none absolute -top-24 left-1/2 h-72 w-72 -translate-x-1/2 rounded-full bg-[#0EA5E9]/25 blur-3xl"></div>
|
|
67
|
-
<div class="relative mx-auto max-w-6xl px-4 py-24 text-center sm:px-6 sm:py-32">
|
|
68
|
-
<p class="text-sm font-semibold tracking-wide text-[#0EA5E9]">For ops teams who live in data</p>
|
|
69
|
-
<h1 class="mt-4 text-5xl font-extrabold tracking-tight text-slate-900 sm:text-6xl lg:text-7xl">Ship clarity,<br><span class="text-[#0EA5E9]">not dashboards</span></h1>
|
|
70
|
-
<p class="mx-auto mt-6 max-w-2xl text-lg text-slate-600">One sentence of concrete value for a named audience — not "welcome to our platform".</p>
|
|
71
|
-
<div class="mt-10 flex flex-wrap items-center justify-center gap-4">
|
|
72
|
-
<a href="#cta" class="inline-flex items-center rounded-lg bg-[#0EA5E9] px-6 py-3 text-sm font-semibold text-white shadow-lg shadow-[#0EA5E9]/25 transition hover:bg-[#0284C7]">Start free trial</a>
|
|
73
|
-
<a href="features.html" class="inline-flex items-center rounded-lg border border-slate-200 bg-white px-6 py-3 text-sm font-semibold text-slate-800 transition hover:border-slate-300 hover:bg-slate-50">See how it works</a>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</section>
|
|
77
|
-
\`\`\`
|
|
78
|
-
|
|
79
|
-
Feature row (alternate direction with lg:flex-row-reverse on odd sections):
|
|
80
|
-
\`\`\`html
|
|
81
|
-
<section class="border-t border-slate-100 py-20 sm:py-28">
|
|
82
|
-
<div class="mx-auto grid max-w-6xl items-center gap-12 px-4 sm:px-6 lg:grid-cols-2">
|
|
83
|
-
<div>
|
|
84
|
-
<h2 class="text-3xl font-bold tracking-tight text-slate-900 sm:text-4xl">Outcome-led headline</h2>
|
|
85
|
-
<p class="mt-4 text-lg text-slate-600">Benefit first, mechanism second. Two sentences max.</p>
|
|
86
|
-
<ul class="mt-8 space-y-3 text-slate-700">
|
|
87
|
-
<li class="flex gap-3"><span class="mt-0.5 text-[#0EA5E9]"><!-- check svg --></span>Concrete capability</li>
|
|
88
|
-
</ul>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="relative aspect-[4/3] overflow-hidden rounded-2xl border border-slate-200 bg-gradient-to-br from-[#0EA5E9]/10 to-slate-50 shadow-sm">
|
|
91
|
-
<!-- abstract SVG illustration or UI mock framed here — never a hotlinked photo -->
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</section>
|
|
95
|
-
\`\`\`
|
|
96
|
-
|
|
97
|
-
KPI (product pack only — never in launch hero):
|
|
98
|
-
\`\`\`html
|
|
99
|
-
<div class="rounded-2xl border border-slate-200/80 bg-white p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-lg">
|
|
100
|
-
<div class="flex items-center justify-between">
|
|
101
|
-
<span class="text-sm font-medium text-slate-500">Weekly active</span>
|
|
102
|
-
<span class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-[#0EA5E9]/10 text-[#0EA5E9]"><!-- svg --></span>
|
|
103
|
-
</div>
|
|
104
|
-
<p class="mt-3 text-3xl font-bold tracking-tight tabular-nums text-slate-900">12,480</p>
|
|
105
|
-
<p class="mt-1 text-sm font-medium text-emerald-600">↑ 12.4% vs last week</p>
|
|
106
|
-
</div>
|
|
107
|
-
\`\`\`
|
|
108
|
-
|
|
109
|
-
Pricing highlight:
|
|
110
|
-
\`\`\`html
|
|
111
|
-
<div class="relative rounded-2xl border-2 border-[#0EA5E9] bg-white p-8 shadow-xl shadow-[#0EA5E9]/10">
|
|
112
|
-
<span class="absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-[#0EA5E9] px-3 py-1 text-xs font-semibold text-white">Most popular</span>
|
|
113
|
-
<h3 class="text-lg font-semibold text-slate-900">Growth</h3>
|
|
114
|
-
<p class="mt-3"><span class="text-4xl font-extrabold tracking-tight tabular-nums">$149</span><span class="text-slate-500">/mo</span></p>
|
|
115
|
-
<a href="#cta" class="mt-8 block rounded-lg bg-[#0EA5E9] py-2.5 text-center text-sm font-semibold text-white transition hover:bg-[#0284C7]">Start free trial</a>
|
|
116
|
-
</div>
|
|
117
|
-
\`\`\`
|
|
118
|
-
|
|
119
|
-
### Layout packs
|
|
120
|
-
- **launch**: hero → 2–3 alternating features → social proof (logos or quote) → pricing or final CTA band. Section rhythm py-20 sm:py-28. Alternate alignment; not everything centered.
|
|
121
|
-
- **product**: dense glass header; KPI row; card grid or sidebar+main; tables in cards with toolbar; space-y-6.
|
|
122
|
-
- **editorial**: max-w-2xl measure, strong type, sticky TOC (lg+), accent border-l-4 callouts.
|
|
72
|
+
Load the brief's Google Fonts <link> + wire font-family on body in <style>. Max two families. Pair by intent (examples — invent others when brief names them):
|
|
73
|
+
- Product: Manrope + Plus Jakarta Sans · Instrument Sans + Source Sans 3
|
|
74
|
+
- Tech: Sora + Space Grotesk · IBM Plex Sans + IBM Plex Mono
|
|
75
|
+
- Editorial: Fraunces + Newsreader · Libre Baskerville + Source Serif 4
|
|
76
|
+
- Friendly: Outfit + DM Sans · Nunito + Figtree
|
|
77
|
+
- Terminal: JetBrains Mono + IBM Plex Sans · Geist Mono + Satoshi-like via Space Grotesk
|
|
78
|
+
Never Inter. Scale: marketing heroes text-5xl→lg:text-7xl font-extrabold tracking-tight; editorial may go larger with serif; product/workspace use tighter display (text-2xl/3xl). Body text-base/lg; secondary text-slate-500 (or zinc/stone). tabular-nums on metrics.
|
|
79
|
+
|
|
80
|
+
### Structural recipes (describe — do NOT copy as fixed HTML)
|
|
81
|
+
Invent markup from the pack. These are jobs, not templates:
|
|
82
|
+
- **Nav**: sticky or static; glass OR solid OR invisible until scroll — match signature. Mobile drawer required when links collapse. Primary actions ≥44px.
|
|
83
|
+
- **Hero**: match pack (split / typographic / workspace shell / bento opener / story chapter 1). Dominant visual = abstract SVG, UI mock, grid, or type — never hotlinked photos.
|
|
84
|
+
- **Features**: alternate alignment, bento modules, or editorial callouts — not three identical icon cards unless the brief asks.
|
|
85
|
+
- **KPI / pricing**: product pack or pricing section only — never soup the marketing first viewport with KPIs.
|
|
86
|
+
- **Footer**: real product name + working relative links.
|
|
123
87
|
|
|
124
88
|
### Icons
|
|
125
|
-
Inline Lucide/Heroicons SVG only (stroke="currentColor" stroke-width="2" class="h-5 w-5"). Never emoji. Feature icons
|
|
89
|
+
Inline Lucide/Heroicons SVG only (stroke="currentColor" stroke-width="2" class="h-5 w-5"). Never emoji. Feature icons in rounded badges only when radius/signature allow.
|
|
126
90
|
|
|
127
|
-
### Interactions & polish (
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
- One <h1>; every section has a clear job; no dead href="#"; no lorem; no "Welcome to"
|
|
134
|
-
- Mentally check 360px and 1280px — grids collapse, type stays readable
|
|
91
|
+
### Interactions & polish (same write — do not iterate)
|
|
92
|
+
- Hover + focus-visible:ring-2 ring-offset-2 on controls; nav links transition-colors
|
|
93
|
+
- 2–3 purposeful motions max, matching signature motion
|
|
94
|
+
- body { background } matches scheme; gutters never flash wrong on dark pages
|
|
95
|
+
- One <h1>; every section one job; no dead href="#"; no lorem; no "Welcome to"
|
|
96
|
+
- Mentally check 360px and 1280px
|
|
135
97
|
|
|
136
98
|
### Automatic fails
|
|
137
|
-
Indigo/violet-on-white gradient cliché · Inter · emoji icons · hero-in-a-card · first-viewport KPI soup · flat unstyled sections · external raster images · template adjectives (revolutionary/seamless/cutting-edge/unleash/empower)`,
|
|
99
|
+
Indigo/violet-on-white gradient cliché · Inter · emoji icons · hero-in-a-card · first-viewport KPI soup on marketing packs · flat unstyled sections · external raster images · template adjectives (revolutionary/seamless/cutting-edge/unleash/empower) · default centered blur-orb hero when the brief asked for another pack/signature · three equal feature cards as the whole personality of the page`,
|
|
138
100
|
};
|
|
139
101
|
//# sourceMappingURL=designer.skill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"designer.skill.js","sourceRoot":"","sources":["../../../src/agents/skills/designer.skill.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAoB;IAC5C,IAAI,EAAE,UAAU;IAChB,WAAW,
|
|
1
|
+
{"version":3,"file":"designer.skill.js","sourceRoot":"","sources":["../../../src/agents/skills/designer.skill.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAoB;IAC5C,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,gIAAgI;IAClI,SAAS,EAAE,4DAA4D;IACvE,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2YA2F2X;CAC1Y,CAAA"}
|