@venizia/vulcan 0.4.0 → 0.4.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/base/claude/remote-hosts.json +1 -1
- package/base/claude/settings.json +75 -3
- package/base/hooks/guard-git.ts +55 -0
- package/base/hooks/guard-manifest.ts +1 -1
- package/base/hooks/guard-outside.ts +66 -0
- package/base/hooks/guard-package.ts +3 -2
- package/base/hooks/guard-remote-hosts.ts +3 -2
- package/base/hooks/guard-writes.ts +1 -1
- package/base/hooks/post-tool.ts +36 -0
- package/base/hooks/prompt-submit.ts +52 -0
- package/base/hooks/stop.ts +38 -0
- package/base/hooks/subagent-start.ts +18 -0
- package/base/references/delegation-brief.md +63 -0
- package/base/references/design-pass.md +39 -0
- package/base/references/evidence.md +36 -0
- package/base/references/phase-boundaries.md +20 -0
- package/base/references/testing.md +89 -0
- package/base/rules.md +11 -2
- package/base/skills/build-a-feature/SKILL.md +49 -23
- package/base/skills/docs-update/SKILL.md +12 -1
- package/base/skills/docs-writing/SKILL.md +2 -2
- package/base/skills/docs-writing/references/agent-documents.md +53 -0
- package/base/skills/fix-a-bug/SKILL.md +84 -0
- package/base/skills/fix-a-bug/evals/evals.json +17 -0
- package/base/skills/knowledge-sync/SKILL.md +4 -1
- package/base/skills/knowledge-sync/knowledge-sync.workflow.js +10 -10
- package/base/skills/plan-a-change/SKILL.md +95 -0
- package/base/skills/plan-a-change/evals/evals.json +23 -0
- package/base/skills/plan-a-change/references/spec-card.md +39 -0
- package/base/skills/report-back/SKILL.md +112 -0
- package/base/skills/report-back/evals/evals.json +23 -0
- package/base/skills/research/SKILL.md +64 -0
- package/base/skills/research/evals/evals.json +17 -0
- package/base/skills/retro/SKILL.md +69 -0
- package/base/skills/retro/evals/evals.json +17 -0
- package/base/skills/review-a-change/SKILL.md +90 -0
- package/base/skills/review-a-change/evals/evals.json +17 -0
- package/base/skills/ship/SKILL.md +82 -0
- package/base/skills/ship/evals/evals.json +23 -0
- package/base/skills/visualize-work/SKILL.md +87 -0
- package/base/skills/visualize-work/evals/evals.json +17 -0
- package/base/skills/visualize-work/references/spec.md +65 -0
- package/package.json +3 -3
- package/src/agents/common/schema.ts +2 -2
- package/src/agents/detect.ts +5 -5
- package/src/agents/exclude.ts +3 -3
- package/src/agents/local.ts +1 -1
- package/src/agents/prompt.ts +2 -2
- package/src/agents/render.ts +2 -2
- package/src/agents/resolve.ts +6 -6
- package/src/agents/table.ts +1 -1
- package/src/commands/agents.command.ts +4 -4
- package/src/commands/clean.command.ts +72 -0
- package/src/commands/help.command.ts +11 -0
- package/src/commands/index.ts +6 -0
- package/src/commands/init.command.ts +4 -1
- package/src/commands/profile.command.ts +255 -0
- package/src/commands/sync.command.ts +6 -4
- package/src/commands/upgrade.command.ts +1 -1
- package/src/commands/visualize.command.ts +107 -0
- package/src/common/constants.ts +23 -0
- package/src/config/common/constants.ts +2 -0
- package/src/config/loader.ts +4 -4
- package/src/config/packages.ts +1 -1
- package/src/config/schema.ts +16 -5
- package/src/create/add-app.ts +15 -15
- package/src/create/add-lib.ts +7 -7
- package/src/create/bunfig.ts +1 -1
- package/src/create/dockerignore.ts +4 -4
- package/src/create/init-monorepo.ts +3 -1
- package/src/create/lib-preset.ts +1 -1
- package/src/create/names.ts +7 -6
- package/src/create/next.ts +4 -4
- package/src/create/preset-menu.ts +4 -4
- package/src/create/preset.ts +3 -3
- package/src/create/scratch.ts +27 -6
- package/src/create/workspace.ts +11 -11
- package/src/doctor/checks.ts +231 -45
- package/src/doctor/common/constants.ts +4 -0
- package/src/doctor/makefile.ts +3 -3
- package/src/doctor/runner.ts +16 -1
- package/src/doctor/skills.ts +8 -8
- package/src/doctor/tags.ts +5 -5
- package/src/hooks/common/constants.ts +29 -0
- package/src/hooks/common/types.ts +20 -0
- package/src/hooks/decision.ts +15 -0
- package/src/hooks/guard-git.ts +288 -0
- package/src/hooks/guard-manifest.ts +1 -1
- package/src/hooks/guard-outside.ts +399 -0
- package/src/hooks/guard-package.ts +4 -4
- package/src/hooks/guard-writes.ts +5 -5
- package/src/hooks/index.ts +6 -0
- package/src/hooks/owner-reply.ts +148 -0
- package/src/hooks/post-tool.ts +137 -0
- package/src/hooks/remote-hosts.ts +25 -23
- package/src/hooks/session-digest.ts +24 -4
- package/src/hooks/shell.ts +325 -0
- package/src/hooks/subagent-card.ts +32 -0
- package/src/init/scaffold.ts +6 -6
- package/src/local/clean.ts +88 -0
- package/src/local/constants.ts +50 -0
- package/src/local/format.ts +25 -0
- package/src/local/index.ts +4 -0
- package/src/local/scan.ts +368 -0
- package/src/manifest/render.ts +1 -1
- package/src/owner/card.ts +85 -0
- package/src/owner/constants.ts +105 -0
- package/src/owner/index.ts +8 -0
- package/src/owner/profile.ts +123 -0
- package/src/owner/schema.ts +147 -0
- package/src/owner/shape.ts +380 -0
- package/src/owner/survey.ts +289 -0
- package/src/owner/view.ts +76 -0
- package/src/owner/violations.ts +202 -0
- package/src/router.ts +18 -1
- package/src/rules/base.ts +1 -1
- package/src/rules/parser.ts +5 -5
- package/src/signals/claims.ts +71 -0
- package/src/signals/classify.ts +132 -0
- package/src/signals/constants.ts +88 -0
- package/src/signals/index.ts +5 -0
- package/src/signals/loop.ts +46 -0
- package/src/signals/state.ts +276 -0
- package/src/sync/agent-files.ts +4 -4
- package/src/sync/agent-removal.ts +6 -6
- package/src/sync/atlas-block.ts +1 -1
- package/src/sync/base-rules.ts +1 -1
- package/src/sync/exclude.ts +9 -9
- package/src/sync/local-choice.ts +35 -5
- package/src/sync/planner.ts +16 -16
- package/src/sync/prune.ts +3 -3
- package/src/sync/settings.ts +15 -15
- package/src/ui/prompt.ts +3 -3
- package/src/visualize/assets.ts +80 -0
- package/src/visualize/constants.ts +126 -0
- package/src/visualize/index.ts +6 -0
- package/src/visualize/layout.ts +107 -0
- package/src/visualize/page.ts +211 -0
- package/src/visualize/render.ts +161 -0
- package/src/visualize/schema.ts +178 -0
- package/src/visualize/validate.ts +127 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { TVisualizeSpec } from './schema.ts';
|
|
2
|
+
|
|
3
|
+
/** Escapes text for HTML and for an attribute value: everything the spec says is data, never markup. */
|
|
4
|
+
export const escapeText = (opts: { value: string }): string =>
|
|
5
|
+
opts.value
|
|
6
|
+
.replaceAll('&', '&')
|
|
7
|
+
.replaceAll('<', '<')
|
|
8
|
+
.replaceAll('>', '>')
|
|
9
|
+
.replaceAll('"', '"')
|
|
10
|
+
.replaceAll("'", ''');
|
|
11
|
+
|
|
12
|
+
const CELL_WIDTH = 300;
|
|
13
|
+
const CELL_HEIGHT = 120;
|
|
14
|
+
const BOX_WIDTH = 160;
|
|
15
|
+
const BOX_HEIGHT = 64;
|
|
16
|
+
const MARGIN = 28;
|
|
17
|
+
|
|
18
|
+
interface IPoint {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const centreOf = (opts: { row: number; col: number }): IPoint => ({
|
|
24
|
+
x: MARGIN + opts.col * CELL_WIDTH + CELL_WIDTH / 2,
|
|
25
|
+
y: MARGIN + opts.row * CELL_HEIGHT + CELL_HEIGHT / 2,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const escaped = (value: string): string => escapeText({ value });
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The route of an edge between two box centres: straight when they share a row or a column, else an
|
|
32
|
+
* elbow - along the source's row, then along the target's column. The label sits on the longest run.
|
|
33
|
+
*/
|
|
34
|
+
const routeOf = (opts: { from: IPoint; to: IPoint }): { path: string; label: IPoint } => {
|
|
35
|
+
const { from, to } = opts;
|
|
36
|
+
|
|
37
|
+
if (from.y === to.y) {
|
|
38
|
+
const sign = to.x > from.x ? 1 : -1;
|
|
39
|
+
const start = { x: from.x + (sign * BOX_WIDTH) / 2, y: from.y };
|
|
40
|
+
const end = { x: to.x - (sign * BOX_WIDTH) / 2, y: to.y };
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
path: `M${start.x} ${start.y}L${end.x} ${end.y}`,
|
|
44
|
+
label: { x: (start.x + end.x) / 2, y: start.y - 6 },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (from.x === to.x) {
|
|
49
|
+
const sign = to.y > from.y ? 1 : -1;
|
|
50
|
+
const start = { x: from.x, y: from.y + (sign * BOX_HEIGHT) / 2 };
|
|
51
|
+
const end = { x: to.x, y: to.y - (sign * BOX_HEIGHT) / 2 };
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
path: `M${start.x} ${start.y}L${end.x} ${end.y}`,
|
|
55
|
+
label: { x: start.x + 6, y: (start.y + end.y) / 2 },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const horizontal = to.x > from.x ? 1 : -1;
|
|
60
|
+
const vertical = to.y > from.y ? 1 : -1;
|
|
61
|
+
const start = { x: from.x + (horizontal * BOX_WIDTH) / 2, y: from.y };
|
|
62
|
+
const corner = { x: to.x, y: from.y };
|
|
63
|
+
const end = { x: to.x, y: to.y - (vertical * BOX_HEIGHT) / 2 };
|
|
64
|
+
const horizontalRun = Math.abs(corner.x - start.x);
|
|
65
|
+
const verticalRun = Math.abs(end.y - corner.y);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
path: `M${start.x} ${start.y}L${corner.x} ${corner.y}L${end.x} ${end.y}`,
|
|
69
|
+
label:
|
|
70
|
+
horizontalRun >= verticalRun
|
|
71
|
+
? { x: (start.x + corner.x) / 2, y: start.y - 6 }
|
|
72
|
+
: { x: corner.x + 6, y: (corner.y + end.y) / 2 },
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** The figure: boxes on a grid, arrows between them. Every part carries a `data-` id the page script highlights. */
|
|
77
|
+
export const renderFigure = (opts: { flow: NonNullable<TVisualizeSpec['flow']> }): string => {
|
|
78
|
+
const { flow } = opts;
|
|
79
|
+
const byId = new Map(flow.nodes.map((node) => [node.id, node]));
|
|
80
|
+
const width = MARGIN * 2 + (Math.max(...flow.nodes.map((node) => node.col)) + 1) * CELL_WIDTH;
|
|
81
|
+
const height = MARGIN * 2 + (Math.max(...flow.nodes.map((node) => node.row)) + 1) * CELL_HEIGHT;
|
|
82
|
+
const edges = flow.edges
|
|
83
|
+
.map((edge) => {
|
|
84
|
+
const from = byId.get(edge.from);
|
|
85
|
+
const to = byId.get(edge.to);
|
|
86
|
+
|
|
87
|
+
if (from === undefined || to === undefined) {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const route = routeOf({ from: centreOf(from), to: centreOf(to) });
|
|
92
|
+
const name = `${edge.from}>${edge.to}`;
|
|
93
|
+
|
|
94
|
+
return `<g class="edge ${escaped(edge.variant ?? 'main')}" data-edge="${escaped(name)}"><title>${escaped(edge.label)}</title><path d="${route.path}" marker-end="url(#${edge.variant === 'error' ? 'e' : 'a'})"/><text x="${route.label.x}" y="${route.label.y}" text-anchor="middle">${escaped(edge.label)}</text></g>`;
|
|
95
|
+
})
|
|
96
|
+
.join('');
|
|
97
|
+
const nodes = flow.nodes
|
|
98
|
+
.map((node) => {
|
|
99
|
+
const centre = centreOf(node);
|
|
100
|
+
const lines = node.sublabel === undefined ? 1 : 2;
|
|
101
|
+
|
|
102
|
+
return `<g class="node ${escaped(node.kind ?? 'step')}" tabindex="0" role="img" aria-label="${escaped(node.label)}${node.sublabel === undefined ? '' : `, ${escaped(node.sublabel)}`}" data-node="${escaped(node.id)}" data-detail="${escaped(node.detail ?? node.sublabel ?? node.label)}"><title>${escaped(node.label)}</title><rect x="${centre.x - BOX_WIDTH / 2}" y="${centre.y - BOX_HEIGHT / 2}" width="${BOX_WIDTH}" height="${BOX_HEIGHT}" rx="10"/><text x="${centre.x}" y="${centre.y + (lines === 1 ? 5 : -4)}" text-anchor="middle" class="t">${escaped(node.label)}</text>${node.sublabel === undefined ? '' : `<text x="${centre.x}" y="${centre.y + 16}" text-anchor="middle" class="s">${escaped(node.sublabel)}</text>`}</g>`;
|
|
103
|
+
})
|
|
104
|
+
.join('');
|
|
105
|
+
|
|
106
|
+
return `<svg width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="group" aria-label="flow"><defs><marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0 0L10 5L0 10z" fill="currentColor"/></marker><marker id="e" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="bad" d="M0 0L10 5L0 10z"/></marker></defs>${edges}${nodes}</svg>`;
|
|
107
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { PAGE_CSS, PAGE_JS } from './assets.ts';
|
|
3
|
+
import { DEFAULT_CHROME } from './constants.ts';
|
|
4
|
+
import type { TChrome } from './constants.ts';
|
|
5
|
+
import { escapeText, renderFigure } from './layout.ts';
|
|
6
|
+
import type { TVisualizeSpec } from './schema.ts';
|
|
7
|
+
|
|
8
|
+
const escaped = (value: string): string => escapeText({ value });
|
|
9
|
+
|
|
10
|
+
/** A page word by its key; a key the page does not know shows as itself. */
|
|
11
|
+
const wordOf = (opts: { words: Record<string, string>; key: string }): string =>
|
|
12
|
+
opts.words[opts.key] ?? opts.key;
|
|
13
|
+
|
|
14
|
+
const definedOnly = (opts: {
|
|
15
|
+
value: Record<string, string | undefined> | undefined;
|
|
16
|
+
}): Record<string, string> =>
|
|
17
|
+
Object.fromEntries(
|
|
18
|
+
Object.entries(opts.value ?? {}).filter(
|
|
19
|
+
(entry): entry is [string, string] => entry[1] !== undefined,
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
/** The strings of the page: English, with whatever the spec replaces. */
|
|
24
|
+
export const chromeOf = (opts: { spec: TVisualizeSpec }): TChrome => {
|
|
25
|
+
const given = opts.spec.chrome ?? {};
|
|
26
|
+
const merged: Record<string, unknown> = { ...DEFAULT_CHROME };
|
|
27
|
+
|
|
28
|
+
for (const [key, value] of Object.entries(given)) {
|
|
29
|
+
if (typeof value === 'string') {
|
|
30
|
+
merged[key] = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
...DEFAULT_CHROME,
|
|
36
|
+
...Object.fromEntries(Object.entries(merged).filter(([, value]) => typeof value === 'string')),
|
|
37
|
+
statusStates: { ...DEFAULT_CHROME.statusStates, ...definedOnly({ value: given.statusStates }) },
|
|
38
|
+
evidenceLabels: {
|
|
39
|
+
...DEFAULT_CHROME.evidenceLabels,
|
|
40
|
+
...definedOnly({ value: given.evidenceLabels }),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** JSON for a `<script type="application/json">`: nothing in it can close the tag or start a comment. */
|
|
46
|
+
const jsonForScript = (opts: { value: unknown }): string =>
|
|
47
|
+
JSON.stringify(opts.value)
|
|
48
|
+
.replaceAll('<', '\\u003c')
|
|
49
|
+
.replaceAll('>', '\\u003e')
|
|
50
|
+
.replaceAll('&', '\\u0026')
|
|
51
|
+
.replaceAll('
', '\\u2028')
|
|
52
|
+
.replaceAll('
', '\\u2029');
|
|
53
|
+
|
|
54
|
+
const sha256 = (opts: { text: string }): string =>
|
|
55
|
+
`'sha256-${createHash('sha256').update(opts.text).digest('base64')}'`;
|
|
56
|
+
|
|
57
|
+
const table = (opts: { head: string[]; rows: string[][] }): string =>
|
|
58
|
+
`<div class="tw"><table><thead><tr>${opts.head.map((cell) => `<th>${escaped(cell)}</th>`).join('')}</tr></thead><tbody>${opts.rows
|
|
59
|
+
.map((row) => `<tr>${row.join('')}</tr>`)
|
|
60
|
+
.join('')}</tbody></table></div>`;
|
|
61
|
+
|
|
62
|
+
const cell = (opts: { value: string; tag?: boolean }): string =>
|
|
63
|
+
`<td${opts.tag === true ? ' class="tag"' : ''}>${escaped(opts.value)}</td>`;
|
|
64
|
+
|
|
65
|
+
const sectionOf = (opts: { title: string; body: string }): string =>
|
|
66
|
+
`<section><h2>${escaped(opts.title)}</h2>${opts.body}</section>`;
|
|
67
|
+
|
|
68
|
+
const figureSection = (opts: { spec: TVisualizeSpec; chrome: TChrome }): string => {
|
|
69
|
+
const { flow } = opts.spec;
|
|
70
|
+
|
|
71
|
+
if (flow === undefined) {
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const { chrome } = opts;
|
|
76
|
+
const kinds = [...new Set(flow.nodes.map((node) => node.kind ?? 'step'))];
|
|
77
|
+
const variants = [...new Set(flow.edges.map((edge) => edge.variant ?? 'main'))];
|
|
78
|
+
const steps = flow.steps;
|
|
79
|
+
const controls = [
|
|
80
|
+
flow.edges.length > 0
|
|
81
|
+
? `<button id="play" type="button" aria-pressed="false" data-play="${escaped(chrome.play)}" data-pause="${escaped(chrome.pause)}">${escaped(chrome.play)}</button>`
|
|
82
|
+
: '',
|
|
83
|
+
steps.length > 0
|
|
84
|
+
? `<button id="prev" type="button">${escaped(chrome.previous)}</button><button id="next" type="button">${escaped(chrome.following)}</button><button id="all" type="button">${escaped(chrome.allSteps)}</button>`
|
|
85
|
+
: '',
|
|
86
|
+
].join('');
|
|
87
|
+
|
|
88
|
+
return sectionOf({
|
|
89
|
+
title: chrome.flow,
|
|
90
|
+
body: `<div class="bar">${controls}</div><div class="fig">${renderFigure({ flow })}</div><p id="detail" aria-live="polite">${escaped(chrome.detailHint)}</p>${
|
|
91
|
+
steps.length > 0 ? `<p id="stepnote" aria-live="polite"></p>` : ''
|
|
92
|
+
}<p class="legend"><span>${escaped(chrome.legend)}:</span>${kinds.map((kind) => `<span>${escaped(kind)}</span>`).join('')}${variants.map((variant) => `<span>${escaped(variant)}</span>`).join('')}</p>${
|
|
93
|
+
steps.length > 0
|
|
94
|
+
? `<ol class="steps">${steps.map((step) => `<li><b>${escaped(step.title)}</b> - ${escaped(step.note)}</li>`).join('')}</ol><script type="application/json" id="steps">${jsonForScript({ value: steps })}</script>`
|
|
95
|
+
: ''
|
|
96
|
+
}`,
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const beforeAfterSection = (opts: { spec: TVisualizeSpec; chrome: TChrome }): string => {
|
|
101
|
+
const { beforeAfter } = opts.spec;
|
|
102
|
+
|
|
103
|
+
if (beforeAfter === undefined) {
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const { chrome } = opts;
|
|
108
|
+
const side = (given: {
|
|
109
|
+
title: string;
|
|
110
|
+
items: { text: string; change?: string }[];
|
|
111
|
+
kind: 'added' | 'removed';
|
|
112
|
+
}): string => {
|
|
113
|
+
const { title, items, kind } = given;
|
|
114
|
+
|
|
115
|
+
return `<section><h3>${escaped(title)}</h3><ul>${items
|
|
116
|
+
.map((item) =>
|
|
117
|
+
item.change === kind
|
|
118
|
+
? `<li class="${kind}">${escaped(item.text)} <small>(${escaped(kind === 'added' ? chrome.added : chrome.removed)})</small></li>`
|
|
119
|
+
: `<li>${escaped(item.text)}</li>`,
|
|
120
|
+
)
|
|
121
|
+
.join('')}</ul></section>`;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return sectionOf({
|
|
125
|
+
title: `${chrome.before} / ${chrome.after}`,
|
|
126
|
+
body: `<div class="ba">${side({ ...beforeAfter.before, kind: 'removed' })}${side({ ...beforeAfter.after, kind: 'added' })}</div>`,
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** The whole page: one file, no network, a content-security policy that allows only the page's own style and script by hash. */
|
|
131
|
+
export const renderPage = (opts: { spec: TVisualizeSpec }): string => {
|
|
132
|
+
const { spec } = opts;
|
|
133
|
+
const chrome = chromeOf({ spec });
|
|
134
|
+
const { state } = spec.status;
|
|
135
|
+
const chip = `<span class="chip ${escaped(state)}"><i></i>${escaped(spec.status.label ?? wordOf({ words: chrome.statusStates, key: state }))}</span>`;
|
|
136
|
+
const meta = [
|
|
137
|
+
spec.asOf === undefined ? '' : `<span>${escaped(chrome.asOf)}: ${escaped(spec.asOf)}</span>`,
|
|
138
|
+
spec.scope === undefined ? '' : `<span>${escaped(chrome.scope)}: ${escaped(spec.scope)}</span>`,
|
|
139
|
+
].join('');
|
|
140
|
+
const strip =
|
|
141
|
+
spec.strip === undefined
|
|
142
|
+
? ''
|
|
143
|
+
: `<div class="strip"><div><b>${escaped(chrome.healthy)}</b>${escaped(spec.strip.healthy)}</div><div><b>${escaped(chrome.blockedBy)}</b>${escaped(spec.strip.blockedBy)}</div><div><b>${escaped(chrome.changed)}</b>${escaped(spec.strip.changed)}</div><div><b>${escaped(chrome.next)}</b>${escaped(spec.strip.next)}</div></div>`;
|
|
144
|
+
const decisions =
|
|
145
|
+
spec.decisions === undefined
|
|
146
|
+
? ''
|
|
147
|
+
: sectionOf({
|
|
148
|
+
title: chrome.decisions,
|
|
149
|
+
body: `<ol class="d">${spec.decisions
|
|
150
|
+
.map(
|
|
151
|
+
(item) =>
|
|
152
|
+
`<li>${escaped(item.question)}<br><b>${escaped(chrome.recommended)}:</b> ${escaped(item.recommended)}<br><small>${escaped(chrome.changesClaim)}: ${escaped(item.changes)}</small></li>`,
|
|
153
|
+
)
|
|
154
|
+
.join('')}</ol>`,
|
|
155
|
+
});
|
|
156
|
+
const evidence =
|
|
157
|
+
spec.evidence === undefined
|
|
158
|
+
? ''
|
|
159
|
+
: sectionOf({
|
|
160
|
+
title: chrome.evidence,
|
|
161
|
+
body: table({
|
|
162
|
+
head: [chrome.claim, chrome.probe, chrome.result, chrome.label],
|
|
163
|
+
rows: spec.evidence.map((row) => [
|
|
164
|
+
cell({ value: row.claim }),
|
|
165
|
+
cell({ value: row.probe }),
|
|
166
|
+
cell({ value: row.result }),
|
|
167
|
+
cell({
|
|
168
|
+
value: wordOf({ words: chrome.evidenceLabels, key: row.label }),
|
|
169
|
+
tag: true,
|
|
170
|
+
}),
|
|
171
|
+
]),
|
|
172
|
+
}),
|
|
173
|
+
});
|
|
174
|
+
const risks =
|
|
175
|
+
spec.risks === undefined
|
|
176
|
+
? ''
|
|
177
|
+
: sectionOf({
|
|
178
|
+
title: chrome.risks,
|
|
179
|
+
body: table({
|
|
180
|
+
head: [chrome.risk, chrome.impact, chrome.fallback],
|
|
181
|
+
rows: spec.risks.map((row) => [
|
|
182
|
+
cell({ value: row.risk }),
|
|
183
|
+
cell({ value: row.impact }),
|
|
184
|
+
cell({ value: row.fallback }),
|
|
185
|
+
]),
|
|
186
|
+
}),
|
|
187
|
+
});
|
|
188
|
+
const log =
|
|
189
|
+
spec.log === undefined
|
|
190
|
+
? ''
|
|
191
|
+
: sectionOf({
|
|
192
|
+
title: chrome.log,
|
|
193
|
+
body: table({
|
|
194
|
+
head: ['', ''],
|
|
195
|
+
rows: spec.log.map((row) => [
|
|
196
|
+
cell({ value: row.date, tag: true }),
|
|
197
|
+
cell({ value: row.text }),
|
|
198
|
+
]),
|
|
199
|
+
}),
|
|
200
|
+
});
|
|
201
|
+
const links =
|
|
202
|
+
spec.links === undefined
|
|
203
|
+
? ''
|
|
204
|
+
: sectionOf({
|
|
205
|
+
title: chrome.links,
|
|
206
|
+
body: `<ul>${spec.links.map((link) => `<li><a href="${escaped(link.href)}" rel="noopener noreferrer">${escaped(link.label)}</a></li>`).join('')}</ul>`,
|
|
207
|
+
});
|
|
208
|
+
const policy = `default-src 'none'; style-src ${sha256({ text: PAGE_CSS })}; script-src ${sha256({ text: PAGE_JS })}; base-uri 'none'; form-action 'none'`;
|
|
209
|
+
|
|
210
|
+
return `<!doctype html><html lang="${escaped(spec.language)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="${escaped(policy)}"><meta name="generator" content="vulcan visualize"><title>${escaped(spec.title)}</title><style>${PAGE_CSS}</style></head><body><main><header><div><h1>${escaped(spec.title)}</h1><p class="meta">${meta}</p></div>${chip}<button id="theme" type="button">${escaped(chrome.theme)}</button></header><p class="verdict">${escaped(spec.verdict)}</p>${spec.caption === undefined ? '' : `<p class="cap">${escaped(spec.caption)}</p>`}${figureSection({ spec, chrome })}${strip}${beforeAfterSection({ spec, chrome })}${decisions}${evidence}${risks}${log}${links}</main><script>${PAGE_JS}</script></body></html>`;
|
|
211
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { lstatSync, mkdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { basename, join } from 'node:path';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { ProjectLayout } from '../common/index.ts';
|
|
6
|
+
import { localRootOf } from '../local/index.ts';
|
|
7
|
+
import { VisualizeLimits } from './constants.ts';
|
|
8
|
+
import { renderPage } from './page.ts';
|
|
9
|
+
import { VISUALIZE_SCHEMA } from './schema.ts';
|
|
10
|
+
import { checkSpec } from './validate.ts';
|
|
11
|
+
|
|
12
|
+
export interface IRendered {
|
|
13
|
+
html: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
/** What was checked and passed, for the report: nothing is silent. */
|
|
16
|
+
checks: string[];
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type TRenderResult = { ok: true; page: IRendered } | { ok: false; problems: string[] };
|
|
21
|
+
|
|
22
|
+
/** The checks the renderer runs on its own; a browser check is the caller's. */
|
|
23
|
+
const CHECKS = [
|
|
24
|
+
'spec shape and limits',
|
|
25
|
+
'ids unique, every edge and step points at a box, one box per cell',
|
|
26
|
+
'every text escaped, links https only',
|
|
27
|
+
"no network, no font, no image, a policy that allows only the page's own style and script",
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/** Spec text to a page: parse, validate, cross-check, render, size gate. Nothing is written here. */
|
|
31
|
+
export const renderSpecText = (opts: { text: string }): TRenderResult => {
|
|
32
|
+
let payload: unknown;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
payload = JSON.parse(opts.text);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
problems: [
|
|
40
|
+
`the spec is not valid JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const parsed = VISUALIZE_SCHEMA.safeParse(payload);
|
|
46
|
+
|
|
47
|
+
if (!parsed.success) {
|
|
48
|
+
return {
|
|
49
|
+
ok: false,
|
|
50
|
+
problems: parsed.error.issues.map(
|
|
51
|
+
(issue) => `${issue.path.join('.') || 'spec'}: ${issue.message}`,
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const problems = checkSpec({ spec: parsed.data });
|
|
57
|
+
|
|
58
|
+
if (problems.length > 0) {
|
|
59
|
+
return { ok: false, problems };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const html = renderPage({ spec: parsed.data });
|
|
63
|
+
const bytes = Buffer.byteLength(html, 'utf8');
|
|
64
|
+
|
|
65
|
+
if (bytes > VisualizeLimits.FAIL_BYTES) {
|
|
66
|
+
return {
|
|
67
|
+
ok: false,
|
|
68
|
+
problems: [
|
|
69
|
+
`the page is ${Math.round(bytes / 1024)} KB; the limit is ${VisualizeLimits.FAIL_BYTES / 1024} KB - a handoff that does not fit is two pages, not one dense page`,
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
ok: true,
|
|
76
|
+
page: {
|
|
77
|
+
html,
|
|
78
|
+
bytes,
|
|
79
|
+
checks: [
|
|
80
|
+
...CHECKS,
|
|
81
|
+
`size ${(bytes / 1024).toFixed(1)} KB, within ${VisualizeLimits.FAIL_BYTES / 1024} KB`,
|
|
82
|
+
],
|
|
83
|
+
warnings:
|
|
84
|
+
bytes > VisualizeLimits.WARN_BYTES
|
|
85
|
+
? [
|
|
86
|
+
`the page is ${Math.round(bytes / 1024)} KB, past the ${VisualizeLimits.WARN_BYTES / 1024} KB a page should stay under: consider two pages`,
|
|
87
|
+
]
|
|
88
|
+
: [],
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** The spec's JSON Schema, for an agent that wants to check a spec before it runs the renderer. */
|
|
94
|
+
export const specSchemaText = (): string =>
|
|
95
|
+
`${JSON.stringify(z.toJSONSchema(VISUALIZE_SCHEMA, { io: 'input' }), null, 2)}\n`;
|
|
96
|
+
|
|
97
|
+
/** A page name as a file name: lowercase letters, digits and dashes. */
|
|
98
|
+
export const pageNameOf = (opts: { name: string }): string | undefined => {
|
|
99
|
+
const base = basename(opts.name).replace(/\.[^.]*$/, '');
|
|
100
|
+
const cleaned = base
|
|
101
|
+
.toLowerCase()
|
|
102
|
+
.replace(/[^a-z0-9-]+/g, '-')
|
|
103
|
+
.slice(0, 64)
|
|
104
|
+
.replace(/^-+|-+$/g, '');
|
|
105
|
+
|
|
106
|
+
return cleaned === '' ? undefined : cleaned;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Writes the page to `.agents/local/prototypes/<name>.html` of the project: beside its place and moved in
|
|
111
|
+
* last, so a failed render never replaces the last good page. Only a trusted `.agents/local/` is used.
|
|
112
|
+
*/
|
|
113
|
+
export const writePage = (opts: {
|
|
114
|
+
root: string;
|
|
115
|
+
name: string;
|
|
116
|
+
html: string;
|
|
117
|
+
}): { ok: true; path: string } | { ok: false; error: string } => {
|
|
118
|
+
const local = localRootOf({ root: opts.root });
|
|
119
|
+
|
|
120
|
+
if (local === undefined) {
|
|
121
|
+
return {
|
|
122
|
+
ok: false,
|
|
123
|
+
error: `no .agents/local/ in ${opts.root} (or it is a symlink, or resolves outside the project) - run vulcan sync first`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const directory = join(local, VisualizeLimits.OUTPUT_DIRECTORY);
|
|
128
|
+
|
|
129
|
+
const refusal = (error: string) => ({ ok: false as const, error });
|
|
130
|
+
const place = `${ProjectLayout.LOCAL_DIRECTORY}/${VisualizeLimits.OUTPUT_DIRECTORY}`;
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
const kind = lstatSync(directory, { throwIfNoEntry: false });
|
|
134
|
+
|
|
135
|
+
if (kind?.isSymbolicLink()) {
|
|
136
|
+
return refusal(`${place} is a symlink - refusing to write through it`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (kind === undefined) {
|
|
140
|
+
mkdirSync(directory, { recursive: true });
|
|
141
|
+
} else if (!kind.isDirectory()) {
|
|
142
|
+
return refusal(`${place} is not a folder`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const path = join(directory, `${opts.name}.html`);
|
|
146
|
+
const partial = `${path}.${randomBytes(6).toString('hex')}.partial`;
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
writeFileSync(partial, opts.html, { flag: 'wx' });
|
|
150
|
+
renameSync(partial, path);
|
|
151
|
+
} finally {
|
|
152
|
+
rmSync(partial, { force: true });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return { ok: true, path };
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return refusal(
|
|
158
|
+
`could not write the page: ${error instanceof Error ? error.message : String(error)}`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_CHROME,
|
|
4
|
+
EdgeVariants,
|
|
5
|
+
EvidenceLabels,
|
|
6
|
+
NodeKinds,
|
|
7
|
+
StatusStates,
|
|
8
|
+
VisualizeLimits,
|
|
9
|
+
} from './constants.ts';
|
|
10
|
+
|
|
11
|
+
/** One line of plain text: no markup is interpreted anywhere, it is all escaped. */
|
|
12
|
+
const text = (max: number) =>
|
|
13
|
+
z
|
|
14
|
+
.string()
|
|
15
|
+
.max(max)
|
|
16
|
+
.regex(/^(?=.*\S)[^\p{Cc}\u202A-\u202E\u2066-\u2069]+$/u, 'one line of text, not blank');
|
|
17
|
+
/** A closed set as a pattern, so the printed JSON Schema says the same as the renderer. */
|
|
18
|
+
const choice = (opts: { set: Set<string> }) =>
|
|
19
|
+
z
|
|
20
|
+
.string()
|
|
21
|
+
.regex(new RegExp(`^(${[...opts.set].join('|')})$`), `one of: ${[...opts.set].join(', ')}`);
|
|
22
|
+
const ID = z
|
|
23
|
+
.string()
|
|
24
|
+
.regex(/^[a-z][a-z0-9-]{0,31}$/, 'lowercase letters, digits and -, at most 32');
|
|
25
|
+
const GRID = z
|
|
26
|
+
.number()
|
|
27
|
+
.int()
|
|
28
|
+
.min(0)
|
|
29
|
+
.max(VisualizeLimits.MAX_GRID - 1);
|
|
30
|
+
/** A link is https and nothing else: no script, no data, no relative path to guess at. */
|
|
31
|
+
const HTTPS = z
|
|
32
|
+
.string()
|
|
33
|
+
.max(500)
|
|
34
|
+
.regex(/^https:\/\/[^\s"'<>\p{Cc}]+$/u, 'an https URL');
|
|
35
|
+
const rows = <T extends z.ZodType>(item: T) =>
|
|
36
|
+
z.array(item).min(1).max(VisualizeLimits.MAX_ROWS_PER_TABLE);
|
|
37
|
+
|
|
38
|
+
const NODE = z.strictObject({
|
|
39
|
+
id: ID,
|
|
40
|
+
label: text(VisualizeLimits.MAX_LABEL),
|
|
41
|
+
sublabel: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
42
|
+
detail: text(VisualizeLimits.MAX_DETAIL).optional(),
|
|
43
|
+
row: GRID,
|
|
44
|
+
col: GRID,
|
|
45
|
+
kind: choice({ set: NodeKinds.SCHEME_SET }).optional(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const EDGE = z.strictObject({
|
|
49
|
+
from: ID,
|
|
50
|
+
to: ID,
|
|
51
|
+
/** Every arrow says what it does: a verb. */
|
|
52
|
+
label: text(VisualizeLimits.MAX_EDGE_LABEL),
|
|
53
|
+
variant: choice({ set: EdgeVariants.SCHEME_SET }).optional(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const STEP = z.strictObject({
|
|
57
|
+
title: text(VisualizeLimits.MAX_LABEL),
|
|
58
|
+
note: text(VisualizeLimits.MAX_SENTENCE),
|
|
59
|
+
nodes: z.array(ID).max(VisualizeLimits.MAX_NODES).default([]),
|
|
60
|
+
/** An edge is named `from>to`. */
|
|
61
|
+
edges: z
|
|
62
|
+
.array(z.string().regex(/^[a-z][a-z0-9-]*>[a-z][a-z0-9-]*$/))
|
|
63
|
+
.max(VisualizeLimits.MAX_EDGES)
|
|
64
|
+
.default([]),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const SIDE = (changed: 'added' | 'removed') =>
|
|
68
|
+
z.strictObject({
|
|
69
|
+
title: text(VisualizeLimits.MAX_LABEL),
|
|
70
|
+
items: rows(
|
|
71
|
+
z.strictObject({
|
|
72
|
+
text: text(VisualizeLimits.MAX_SENTENCE),
|
|
73
|
+
change: choice({ set: new Set(['same', changed]) }).optional(),
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/** The words of the page, English by default; any of them may be replaced (the owner's language). */
|
|
79
|
+
const CHROME = z
|
|
80
|
+
.strictObject({
|
|
81
|
+
...Object.fromEntries(
|
|
82
|
+
Object.entries(DEFAULT_CHROME)
|
|
83
|
+
.filter(([, value]) => typeof value === 'string')
|
|
84
|
+
.map(([key]) => [key, text(VisualizeLimits.MAX_LABEL).optional()]),
|
|
85
|
+
),
|
|
86
|
+
statusStates: z
|
|
87
|
+
.strictObject({
|
|
88
|
+
ok: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
89
|
+
warn: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
90
|
+
blocked: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
91
|
+
info: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
92
|
+
})
|
|
93
|
+
.optional(),
|
|
94
|
+
evidenceLabels: z
|
|
95
|
+
.strictObject({
|
|
96
|
+
verified: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
97
|
+
inferred: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
98
|
+
guess: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
99
|
+
})
|
|
100
|
+
.optional(),
|
|
101
|
+
})
|
|
102
|
+
.optional();
|
|
103
|
+
|
|
104
|
+
/** The spec of one page, strict: an unknown key is a typo, and a typo is an error. */
|
|
105
|
+
export const VISUALIZE_SCHEMA = z.strictObject({
|
|
106
|
+
schemaVersion: z.literal(VisualizeLimits.SCHEMA_VERSION),
|
|
107
|
+
/** The takeaway, not a topic. */
|
|
108
|
+
title: text(VisualizeLimits.MAX_TITLE),
|
|
109
|
+
language: z
|
|
110
|
+
.string()
|
|
111
|
+
.regex(/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/)
|
|
112
|
+
.default('en'),
|
|
113
|
+
status: z.strictObject({
|
|
114
|
+
state: choice({ set: StatusStates.SCHEME_SET }),
|
|
115
|
+
label: text(VisualizeLimits.MAX_LABEL).optional(),
|
|
116
|
+
}),
|
|
117
|
+
asOf: z
|
|
118
|
+
.string()
|
|
119
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
120
|
+
.optional(),
|
|
121
|
+
scope: text(VisualizeLimits.MAX_SENTENCE).optional(),
|
|
122
|
+
/** The verdict: one sentence the reader can stop at. */
|
|
123
|
+
verdict: text(VisualizeLimits.MAX_SENTENCE),
|
|
124
|
+
caption: text(VisualizeLimits.MAX_SENTENCE).optional(),
|
|
125
|
+
strip: z
|
|
126
|
+
.strictObject({
|
|
127
|
+
healthy: text(VisualizeLimits.MAX_SENTENCE),
|
|
128
|
+
blockedBy: text(VisualizeLimits.MAX_SENTENCE),
|
|
129
|
+
changed: text(VisualizeLimits.MAX_SENTENCE),
|
|
130
|
+
next: text(VisualizeLimits.MAX_SENTENCE),
|
|
131
|
+
})
|
|
132
|
+
.optional(),
|
|
133
|
+
flow: z
|
|
134
|
+
.strictObject({
|
|
135
|
+
nodes: z.array(NODE).min(1).max(VisualizeLimits.MAX_NODES),
|
|
136
|
+
edges: z.array(EDGE).max(VisualizeLimits.MAX_EDGES).default([]),
|
|
137
|
+
steps: z.array(STEP).max(VisualizeLimits.MAX_STEPS).default([]),
|
|
138
|
+
})
|
|
139
|
+
.optional(),
|
|
140
|
+
beforeAfter: z.strictObject({ before: SIDE('removed'), after: SIDE('added') }).optional(),
|
|
141
|
+
decisions: z
|
|
142
|
+
.array(
|
|
143
|
+
z.strictObject({
|
|
144
|
+
question: text(VisualizeLimits.MAX_SENTENCE),
|
|
145
|
+
recommended: text(VisualizeLimits.MAX_SENTENCE),
|
|
146
|
+
changes: text(VisualizeLimits.MAX_SENTENCE),
|
|
147
|
+
}),
|
|
148
|
+
)
|
|
149
|
+
.min(1)
|
|
150
|
+
.max(5)
|
|
151
|
+
.optional(),
|
|
152
|
+
evidence: rows(
|
|
153
|
+
z.strictObject({
|
|
154
|
+
claim: text(VisualizeLimits.MAX_SENTENCE),
|
|
155
|
+
probe: text(VisualizeLimits.MAX_SENTENCE),
|
|
156
|
+
result: text(VisualizeLimits.MAX_SENTENCE),
|
|
157
|
+
label: choice({ set: EvidenceLabels.SCHEME_SET }),
|
|
158
|
+
}),
|
|
159
|
+
).optional(),
|
|
160
|
+
risks: rows(
|
|
161
|
+
z.strictObject({
|
|
162
|
+
risk: text(VisualizeLimits.MAX_SENTENCE),
|
|
163
|
+
impact: text(VisualizeLimits.MAX_SENTENCE),
|
|
164
|
+
fallback: text(VisualizeLimits.MAX_SENTENCE),
|
|
165
|
+
}),
|
|
166
|
+
).optional(),
|
|
167
|
+
/** Newest first. */
|
|
168
|
+
log: rows(
|
|
169
|
+
z.strictObject({
|
|
170
|
+
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
171
|
+
text: text(VisualizeLimits.MAX_SENTENCE),
|
|
172
|
+
}),
|
|
173
|
+
).optional(),
|
|
174
|
+
links: rows(z.strictObject({ label: text(VisualizeLimits.MAX_LABEL), href: HTTPS })).optional(),
|
|
175
|
+
chrome: CHROME,
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
export type TVisualizeSpec = z.output<typeof VISUALIZE_SCHEMA>;
|