rivet-design 0.13.5 → 0.14.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/agent-variants/SessionStore.d.ts +11 -1
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +8 -1
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/WorkerExecutorService.d.ts +140 -0
- package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -0
- package/dist/agent-variants/WorkerExecutorService.js +496 -0
- package/dist/agent-variants/WorkerExecutorService.js.map +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +11 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +28 -1
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +20 -0
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +4 -2
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/directionAuthoring.d.ts +36 -0
- package/dist/agent-variants/directionAuthoring.d.ts.map +1 -0
- package/dist/agent-variants/directionAuthoring.js +348 -0
- package/dist/agent-variants/directionAuthoring.js.map +1 -0
- package/dist/agent-variants/videoKeyframes.d.ts +19 -0
- package/dist/agent-variants/videoKeyframes.d.ts.map +1 -0
- package/dist/agent-variants/videoKeyframes.js +109 -0
- package/dist/agent-variants/videoKeyframes.js.map +1 -0
- package/dist/agent-variants/workItemBriefing.d.ts +3 -1
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
- package/dist/agent-variants/workItemBriefing.js +34 -2
- package/dist/agent-variants/workItemBriefing.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +44 -11
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +222 -4
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
- package/dist/cli/hostWorkNextAction.js +6 -1
- package/dist/cli/hostWorkNextAction.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +42 -0
- package/dist/hosts/workerDefaults.d.ts.map +1 -1
- package/dist/hosts/workerDefaults.js +40 -1
- package/dist/hosts/workerDefaults.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -10
- package/dist/index.js.map +1 -1
- package/dist/install/globalBootstrap.d.ts +47 -0
- package/dist/install/globalBootstrap.d.ts.map +1 -0
- package/dist/install/globalBootstrap.js +106 -0
- package/dist/install/globalBootstrap.js.map +1 -0
- package/dist/install/harnesses.d.ts +5 -4
- package/dist/install/harnesses.d.ts.map +1 -1
- package/dist/install/harnesses.js +8 -8
- package/dist/install/harnesses.js.map +1 -1
- package/dist/install/mcpRegistration.d.ts +17 -1
- package/dist/install/mcpRegistration.d.ts.map +1 -1
- package/dist/install/mcpRegistration.js +44 -14
- package/dist/install/mcpRegistration.js.map +1 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +25 -0
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +36 -1
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +331 -16
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +8 -0
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +29 -5
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/VariantsRuntime.d.ts.map +1 -1
- package/dist/services/VariantsRuntime.js +9 -0
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/types/change-request-types.d.ts +17 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +2 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +7 -5
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/{main-Ct4AXMqD.js → main-C-8Mff7k.js} +51 -51
- package/src/ui/dist/assets/main-CobdEReL.css +1 -0
- package/src/ui/dist/index.html +2 -2
- package/src/ui/dist/assets/main-Dyos9I29.css +0 -1
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authorDirections = exports.fallbackDirections = exports.fallbackRunLabel = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const logger_1 = require("../utils/logger");
|
|
6
|
+
const log = (0, logger_1.createLogger)('DirectionAuthoring');
|
|
7
|
+
/**
|
|
8
|
+
* Server-side direction authoring for fresh (zero-to-one) variant runs.
|
|
9
|
+
*
|
|
10
|
+
* Historically the coordinating host agent authored the direction briefs
|
|
11
|
+
* in-conversation before calling `variants start` — 60–160s of wall-clock
|
|
12
|
+
* spent before any worker could spawn, on prose the workers treat only as
|
|
13
|
+
* steering (they view the reference media natively). This module moves that
|
|
14
|
+
* authorship onto the server: one fast vision tool-use call produces the
|
|
15
|
+
* labels, bodies, and steering notes, and a deterministic archetype fallback
|
|
16
|
+
* guarantees the run starts even when the gateway is unreachable.
|
|
17
|
+
*
|
|
18
|
+
* Quality note: reference FIDELITY comes from the implementation worker's
|
|
19
|
+
* model tier (see `workerDefaults.RIVET_WORKER_REFERENCE_CREATE_DEFAULTS`),
|
|
20
|
+
* not from brief prose — the briefs only need distinct, plausible direction
|
|
21
|
+
* concepts, which a fast model produces reliably.
|
|
22
|
+
*/
|
|
23
|
+
const DIRECTION_AUTHOR_MODEL = 'claude-haiku-4-5-20251001';
|
|
24
|
+
const DIRECTION_AUTHOR_MAX_TOKENS = 1200;
|
|
25
|
+
const DIRECTION_AUTHOR_TIMEOUT_MS = 25_000;
|
|
26
|
+
const LABEL_MAX_LENGTH = 48;
|
|
27
|
+
const BODY_MAX_LENGTH = 200;
|
|
28
|
+
const NOTES_MAX_LENGTH = 1200;
|
|
29
|
+
const RUN_LABEL_MAX_LENGTH = 40;
|
|
30
|
+
/** Archetype directions used when the gateway cannot author. Ordered so the
|
|
31
|
+
* first N slots always cover the faithful → reinterpreted spectrum. */
|
|
32
|
+
const FALLBACK_ARCHETYPES = [
|
|
33
|
+
{ label: 'Faithful', body: 'Faithful recreation of the reference design language' },
|
|
34
|
+
{ label: 'Expressive', body: 'Amplify the boldest visual ideas in the request' },
|
|
35
|
+
{ label: 'Structural Remix', body: 'Same design system, different layout architecture' },
|
|
36
|
+
{ label: 'Editorial', body: 'Typography-led, editorial interpretation' },
|
|
37
|
+
{ label: 'Minimal', body: 'Pared-back, spacious, minimal interpretation' },
|
|
38
|
+
];
|
|
39
|
+
const FALLBACK_NOTES = 'Derive every design decision directly from the visual references and the ' +
|
|
40
|
+
'request: match palette, typography, spacing, shapes, and energy. Ship every ' +
|
|
41
|
+
'section and interaction the request names — never a stripped-down subset. ' +
|
|
42
|
+
'When the request names motion, design and IMPLEMENT a concrete motion spec ' +
|
|
43
|
+
'(trigger, timing, easing, choreography) grounded in what the references show.';
|
|
44
|
+
const clip = (value, max) => value.length <= max ? value : `${value.slice(0, max - 1).trimEnd()}…`;
|
|
45
|
+
/** Deterministic 1–3 word run label from the request text. */
|
|
46
|
+
const fallbackRunLabel = (prompt) => {
|
|
47
|
+
const words = prompt
|
|
48
|
+
.split(/\s+/)
|
|
49
|
+
.map((word) => word.replace(/[^\p{L}\p{N}-]/gu, ''))
|
|
50
|
+
.filter((word) => word.length > 2);
|
|
51
|
+
const label = words.slice(0, 3).join(' ');
|
|
52
|
+
return clip(label || 'Design directions', RUN_LABEL_MAX_LENGTH);
|
|
53
|
+
};
|
|
54
|
+
exports.fallbackRunLabel = fallbackRunLabel;
|
|
55
|
+
const fallbackDirections = (prompt, count) => ({
|
|
56
|
+
briefs: Array.from({ length: count }, (_, index) => {
|
|
57
|
+
const archetype = FALLBACK_ARCHETYPES[index % FALLBACK_ARCHETYPES.length];
|
|
58
|
+
const suffix = index >= FALLBACK_ARCHETYPES.length
|
|
59
|
+
? ` ${Math.floor(index / FALLBACK_ARCHETYPES.length) + 1}`
|
|
60
|
+
: '';
|
|
61
|
+
return {
|
|
62
|
+
label: `${archetype.label}${suffix}`,
|
|
63
|
+
body: archetype.body,
|
|
64
|
+
notes: FALLBACK_NOTES,
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
runLabel: (0, exports.fallbackRunLabel)(prompt),
|
|
68
|
+
});
|
|
69
|
+
exports.fallbackDirections = fallbackDirections;
|
|
70
|
+
const AUTHOR_DIRECTIONS_TOOL = {
|
|
71
|
+
name: 'author_directions',
|
|
72
|
+
description: 'Record the design directions for this variants run. Every direction ' +
|
|
73
|
+
'must name a materially different layout or interaction architecture — ' +
|
|
74
|
+
'never a recolor or a near-duplicate of another direction.',
|
|
75
|
+
strict: true,
|
|
76
|
+
input_schema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
additionalProperties: false,
|
|
79
|
+
required: ['runLabel', 'directions'],
|
|
80
|
+
properties: {
|
|
81
|
+
runLabel: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: '1–3 word summary of the whole batch',
|
|
84
|
+
},
|
|
85
|
+
directions: {
|
|
86
|
+
type: 'array',
|
|
87
|
+
items: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
additionalProperties: false,
|
|
90
|
+
required: ['label', 'body', 'notes'],
|
|
91
|
+
properties: {
|
|
92
|
+
label: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
description: 'Distinct 1–4 word direction title',
|
|
95
|
+
},
|
|
96
|
+
body: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
description: 'At most 12 words naming the layout/interaction direction',
|
|
99
|
+
},
|
|
100
|
+
notes: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
description: 'Steering notes for the implementer. START with "Sections: ' +
|
|
103
|
+
'<5-7 concrete sections this direction ships>." Then concrete ' +
|
|
104
|
+
'observations from the references (palette hexes, type, ' +
|
|
105
|
+
'spacing, shapes, energy). When the request involves motion ' +
|
|
106
|
+
'or interaction, the notes MUST include a concrete motion ' +
|
|
107
|
+
'spec — trigger (scroll, hover, click), timing, easing, ' +
|
|
108
|
+
'choreography — that the page implements visibly. For ' +
|
|
109
|
+
'navigation/header motion, scroll-linked state change ' +
|
|
110
|
+
'(condense, invert, hide-reveal) is the default expectation ' +
|
|
111
|
+
'unless the request names another trigger. The implementer ' +
|
|
112
|
+
'views the references natively — steer interpretation, do ' +
|
|
113
|
+
'not replace looking.',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const buildAuthorPrompt = (input) => {
|
|
122
|
+
const lines = [
|
|
123
|
+
`Design request:`,
|
|
124
|
+
input.prompt.trim(),
|
|
125
|
+
'',
|
|
126
|
+
`Author exactly ${input.count} genuinely distinct, comparison-ready design directions for this request.`,
|
|
127
|
+
];
|
|
128
|
+
if (input.images?.length) {
|
|
129
|
+
lines.push('', 'The attached images are the primary design signal (uploaded references, rendered page screenshots, or video keyframes in order). Ground every direction in what they actually show.');
|
|
130
|
+
}
|
|
131
|
+
if (input.referenceNotes?.length) {
|
|
132
|
+
lines.push('', 'Reference evidence:', ...input.referenceNotes.map((note) => `- ${note}`));
|
|
133
|
+
}
|
|
134
|
+
lines.push('', 'Each direction must preserve the full user deliverable (for a landing page: complete page scope, not just a hero). Call the author_directions tool once.');
|
|
135
|
+
return lines.join('\n');
|
|
136
|
+
};
|
|
137
|
+
const sanitizeDirections = (raw, input) => {
|
|
138
|
+
if (!Array.isArray(raw.directions))
|
|
139
|
+
return undefined;
|
|
140
|
+
const seenLabels = new Set();
|
|
141
|
+
const briefs = [];
|
|
142
|
+
for (const entry of raw.directions) {
|
|
143
|
+
if (!entry || typeof entry !== 'object')
|
|
144
|
+
continue;
|
|
145
|
+
const candidate = entry;
|
|
146
|
+
const label = typeof candidate.label === 'string' ? candidate.label.trim() : '';
|
|
147
|
+
const body = typeof candidate.body === 'string' ? candidate.body.trim() : '';
|
|
148
|
+
const notes = typeof candidate.notes === 'string' ? candidate.notes.trim() : '';
|
|
149
|
+
if (!label || !body)
|
|
150
|
+
continue;
|
|
151
|
+
const key = label.toLowerCase();
|
|
152
|
+
if (seenLabels.has(key))
|
|
153
|
+
continue;
|
|
154
|
+
seenLabels.add(key);
|
|
155
|
+
briefs.push({
|
|
156
|
+
label: clip(label, LABEL_MAX_LENGTH),
|
|
157
|
+
body: clip(body, BODY_MAX_LENGTH),
|
|
158
|
+
...(notes ? { notes: clip(notes, NOTES_MAX_LENGTH) } : {}),
|
|
159
|
+
});
|
|
160
|
+
if (briefs.length === input.count)
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
if (briefs.length === 0)
|
|
164
|
+
return undefined;
|
|
165
|
+
// Pad any shortfall deterministically so the run always gets `count`.
|
|
166
|
+
const fallback = (0, exports.fallbackDirections)(input.prompt, input.count);
|
|
167
|
+
for (const spare of fallback.briefs) {
|
|
168
|
+
if (briefs.length === input.count)
|
|
169
|
+
break;
|
|
170
|
+
if (seenLabels.has(spare.label.toLowerCase()))
|
|
171
|
+
continue;
|
|
172
|
+
briefs.push(spare);
|
|
173
|
+
}
|
|
174
|
+
const runLabel = typeof raw.runLabel === 'string' && raw.runLabel.trim()
|
|
175
|
+
? clip(raw.runLabel.trim(), RUN_LABEL_MAX_LENGTH)
|
|
176
|
+
: fallback.runLabel;
|
|
177
|
+
return { briefs: briefs.slice(0, input.count), runLabel };
|
|
178
|
+
};
|
|
179
|
+
// Sonnet over haiku: measured 2026-07-16, the haiku pool showed 4x latency
|
|
180
|
+
// variance under concurrent load (12s → 45s+ timeouts) while sonnet held
|
|
181
|
+
// steady; the call is ~250 output tokens so per-token speed barely matters.
|
|
182
|
+
const CLAUDE_AUTHOR_MODEL = 'claude-sonnet-5';
|
|
183
|
+
const CLAUDE_AUTHOR_TIMEOUT_MS = 25_000;
|
|
184
|
+
/** Extract the first balanced JSON object from free text. */
|
|
185
|
+
const extractJsonObject = (text) => {
|
|
186
|
+
const start = text.indexOf('{');
|
|
187
|
+
if (start === -1)
|
|
188
|
+
return undefined;
|
|
189
|
+
for (let end = text.length; end > start; end -= 1) {
|
|
190
|
+
const candidate = text.slice(start, end);
|
|
191
|
+
if (!candidate.trimEnd().endsWith('}'))
|
|
192
|
+
continue;
|
|
193
|
+
try {
|
|
194
|
+
return JSON.parse(candidate);
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// keep shrinking
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return undefined;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Author directions with the local `claude` runtime — the same binary (and
|
|
204
|
+
* the same user subscription) the worker executor runs, so this path works
|
|
205
|
+
* wherever the executor works, including machines whose gateway spend limit
|
|
206
|
+
* is exhausted. Reference imagery rides INLINE as image content blocks via
|
|
207
|
+
* `--input-format stream-json`, so the whole call is a single model turn —
|
|
208
|
+
* no temp files, no Read-tool round trip, no turn-count variance.
|
|
209
|
+
*/
|
|
210
|
+
const authorViaClaudeRuntime = async (input, options) => {
|
|
211
|
+
const command = options?.command ?? process.env.RIVET_EXECUTOR_COMMAND ?? 'claude';
|
|
212
|
+
const prompt = [
|
|
213
|
+
input.images?.length
|
|
214
|
+
? 'The attached images are the primary design signal (uploaded references, rendered page screenshots, or video keyframes in order).\n'
|
|
215
|
+
: '',
|
|
216
|
+
buildAuthorPrompt(input),
|
|
217
|
+
'',
|
|
218
|
+
'Respond with ONLY a compact single-line JSON object of the shape',
|
|
219
|
+
'{"runLabel": "1-3 word batch summary", "directions": [{"label": "1-4 word title", "body": "<=12 word direction", "notes": "<=350 chars. START with: Sections: <5-7 concrete sections this direction ships>. Then concrete steering (palette hexes, type, spacing, energy). When the request names motion or interaction, notes MUST carry a terse motion spec — trigger (scroll/hover/click), timing, easing — the page implements visibly; for nav/header motion default to scroll-linked state change (condense/invert/hide-reveal)."}]}',
|
|
220
|
+
`with exactly ${input.count} directions. Speed matters: no deliberation, no tool use, no prose, no markdown fences.`,
|
|
221
|
+
]
|
|
222
|
+
.filter(Boolean)
|
|
223
|
+
.join('\n');
|
|
224
|
+
const userMessage = JSON.stringify({
|
|
225
|
+
type: 'user',
|
|
226
|
+
message: {
|
|
227
|
+
role: 'user',
|
|
228
|
+
content: [
|
|
229
|
+
...(input.images ?? []).map((image) => ({
|
|
230
|
+
type: 'image',
|
|
231
|
+
source: {
|
|
232
|
+
type: 'base64',
|
|
233
|
+
media_type: image.mediaType,
|
|
234
|
+
data: image.data,
|
|
235
|
+
},
|
|
236
|
+
})),
|
|
237
|
+
{ type: 'text', text: prompt },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
const startedAt = Date.now();
|
|
242
|
+
const stdout = await new Promise((resolve, reject) => {
|
|
243
|
+
const child = (0, child_process_1.execFile)(command, [
|
|
244
|
+
'--print',
|
|
245
|
+
'--input-format',
|
|
246
|
+
'stream-json',
|
|
247
|
+
'--output-format',
|
|
248
|
+
'stream-json',
|
|
249
|
+
'--verbose',
|
|
250
|
+
'--model',
|
|
251
|
+
CLAUDE_AUTHOR_MODEL,
|
|
252
|
+
'--effort',
|
|
253
|
+
'low',
|
|
254
|
+
'--dangerously-skip-permissions',
|
|
255
|
+
'--exclude-dynamic-system-prompt-sections',
|
|
256
|
+
], {
|
|
257
|
+
timeout: options?.timeoutMs ?? CLAUDE_AUTHOR_TIMEOUT_MS,
|
|
258
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
259
|
+
}, (error, out, err) => error
|
|
260
|
+
? reject(new Error(`${error.message}${err ? ` — stderr: ${String(err).slice(-400)}` : ''}`))
|
|
261
|
+
: resolve(out));
|
|
262
|
+
child.stdin?.write(`${userMessage}\n`);
|
|
263
|
+
child.stdin?.end();
|
|
264
|
+
});
|
|
265
|
+
let resultText = '';
|
|
266
|
+
let childDurationMs;
|
|
267
|
+
for (const line of stdout.split('\n')) {
|
|
268
|
+
const trimmed = line.trim();
|
|
269
|
+
if (!trimmed.startsWith('{'))
|
|
270
|
+
continue;
|
|
271
|
+
try {
|
|
272
|
+
const event = JSON.parse(trimmed);
|
|
273
|
+
if (event.type === 'result') {
|
|
274
|
+
resultText = typeof event.result === 'string' ? event.result : '';
|
|
275
|
+
childDurationMs = event.duration_ms;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
catch {
|
|
279
|
+
// Non-JSON noise on stdout — skip.
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
log.info(`claude runtime authored directions in ${Date.now() - startedAt}ms (child duration_ms=${String(childDurationMs)})`);
|
|
283
|
+
const parsed = extractJsonObject(resultText || stdout);
|
|
284
|
+
if (parsed && typeof parsed === 'object') {
|
|
285
|
+
return parsed;
|
|
286
|
+
}
|
|
287
|
+
return undefined;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Author the direction briefs for a fresh run. Ladder: one fast gateway
|
|
291
|
+
* vision call → the local `claude` runtime (subscription-billed, available
|
|
292
|
+
* wherever the executor is) → deterministic archetypes. Never throws — any
|
|
293
|
+
* failure degrades a rung so intake keeps its latency contract.
|
|
294
|
+
*/
|
|
295
|
+
const authorDirections = async (gateway, input, options) => {
|
|
296
|
+
const startedAt = Date.now();
|
|
297
|
+
try {
|
|
298
|
+
const raw = await gateway.sendToolUse({
|
|
299
|
+
model: DIRECTION_AUTHOR_MODEL,
|
|
300
|
+
maxTokens: DIRECTION_AUTHOR_MAX_TOKENS,
|
|
301
|
+
temperature: 1,
|
|
302
|
+
system: 'You are the direction planner for Rivet, which builds N parallel ' +
|
|
303
|
+
'design variants of a web page. You author short, materially ' +
|
|
304
|
+
'different direction briefs; separate implementers build each one ' +
|
|
305
|
+
'with the same reference media you see.',
|
|
306
|
+
prompt: buildAuthorPrompt(input),
|
|
307
|
+
tool: AUTHOR_DIRECTIONS_TOOL,
|
|
308
|
+
...(input.images?.length ? { images: input.images } : {}),
|
|
309
|
+
timeoutMs: options?.timeoutMs ?? DIRECTION_AUTHOR_TIMEOUT_MS,
|
|
310
|
+
});
|
|
311
|
+
const sanitized = sanitizeDirections(raw, input);
|
|
312
|
+
if (sanitized) {
|
|
313
|
+
return {
|
|
314
|
+
...sanitized,
|
|
315
|
+
source: 'gateway',
|
|
316
|
+
durationMs: Date.now() - startedAt,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
log.warn('gateway direction author returned no usable directions');
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
log.warn('gateway direction authoring failed — trying claude runtime', error);
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
const raw = await authorViaClaudeRuntime(input, {
|
|
326
|
+
...(options?.claudeCommand ? { command: options.claudeCommand } : {}),
|
|
327
|
+
});
|
|
328
|
+
const sanitized = raw ? sanitizeDirections(raw, input) : undefined;
|
|
329
|
+
if (sanitized) {
|
|
330
|
+
return {
|
|
331
|
+
...sanitized,
|
|
332
|
+
source: 'claude_runtime',
|
|
333
|
+
durationMs: Date.now() - startedAt,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
log.warn('claude runtime direction author returned no usable directions');
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
log.warn('claude runtime direction authoring failed — using archetype fallback', error);
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
...(0, exports.fallbackDirections)(input.prompt, input.count),
|
|
343
|
+
source: 'fallback',
|
|
344
|
+
durationMs: Date.now() - startedAt,
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
exports.authorDirections = authorDirections;
|
|
348
|
+
//# sourceMappingURL=directionAuthoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directionAuthoring.js","sourceRoot":"","sources":["../../src/agent-variants/directionAuthoring.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,4CAA+C;AAO/C,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,oBAAoB,CAAC,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAC3D,MAAM,2BAA2B,GAAG,IAAI,CAAC;AACzC,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAE3C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAqBhC;wEACwE;AACxE,MAAM,mBAAmB,GAA2C;IAClE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,sDAAsD,EAAE;IACnF,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,iDAAiD,EAAE;IAChF,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,mDAAmD,EAAE;IACxF,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,0CAA0C,EAAE;IACxE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,8CAA8C,EAAE;CAC3E,CAAC;AAEF,MAAM,cAAc,GAClB,2EAA2E;IAC3E,8EAA8E;IAC9E,4EAA4E;IAC5E,6EAA6E;IAC7E,+EAA+E,CAAC;AAElF,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,GAAW,EAAU,EAAE,CAClD,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,C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|
8
|
+
/**
|
|
9
|
+
* Sample a local reference video into evenly spaced PNG keyframes so vision
|
|
10
|
+
* models (direction authoring) and implementation workers can observe the
|
|
11
|
+
* motion without any host-agent ffmpeg work. Requires `ffmpeg`/`ffprobe` on
|
|
12
|
+
* PATH; any failure is reported, never thrown — reference prep must degrade,
|
|
13
|
+
* not block intake.
|
|
14
|
+
*/
|
|
15
|
+
export declare const extractVideoKeyframes: (videoPath: string, options?: {
|
|
16
|
+
frameCount?: number;
|
|
17
|
+
outDir?: string;
|
|
18
|
+
}) => Promise<KeyframeResult>;
|
|
19
|
+
//# sourceMappingURL=videoKeyframes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoKeyframes.d.ts","sourceRoot":"","sources":["../../src/agent-variants/videoKeyframes.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GAClC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,UAAU;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KACjD,OAAO,CAAC,cAAc,CAoExB,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.extractVideoKeyframes = void 0;
|
|
37
|
+
const child_process_1 = require("child_process");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const os = __importStar(require("os"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const util_1 = require("util");
|
|
42
|
+
const logger_1 = require("../utils/logger");
|
|
43
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
44
|
+
const log = (0, logger_1.createLogger)('VideoKeyframes');
|
|
45
|
+
const FFMPEG_TIMEOUT_MS = 30_000;
|
|
46
|
+
const DEFAULT_FRAME_COUNT = 5;
|
|
47
|
+
/**
|
|
48
|
+
* Sample a local reference video into evenly spaced PNG keyframes so vision
|
|
49
|
+
* models (direction authoring) and implementation workers can observe the
|
|
50
|
+
* motion without any host-agent ffmpeg work. Requires `ffmpeg`/`ffprobe` on
|
|
51
|
+
* PATH; any failure is reported, never thrown — reference prep must degrade,
|
|
52
|
+
* not block intake.
|
|
53
|
+
*/
|
|
54
|
+
const extractVideoKeyframes = async (videoPath, options) => {
|
|
55
|
+
const frameCount = options?.frameCount ?? DEFAULT_FRAME_COUNT;
|
|
56
|
+
let duration;
|
|
57
|
+
try {
|
|
58
|
+
const probe = await execFileAsync('ffprobe', [
|
|
59
|
+
'-v',
|
|
60
|
+
'error',
|
|
61
|
+
'-show_entries',
|
|
62
|
+
'format=duration',
|
|
63
|
+
'-of',
|
|
64
|
+
'default=noprint_wrappers=1:nokey=1',
|
|
65
|
+
videoPath,
|
|
66
|
+
], { timeout: FFMPEG_TIMEOUT_MS });
|
|
67
|
+
duration = Number.parseFloat(probe.stdout.trim());
|
|
68
|
+
if (!Number.isFinite(duration) || duration <= 0) {
|
|
69
|
+
return { ok: false, reason: `ffprobe reported no duration for ${videoPath}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
74
|
+
return { ok: false, reason: `ffprobe unavailable or failed: ${message}` };
|
|
75
|
+
}
|
|
76
|
+
const outDir = options?.outDir ?? fs.mkdtempSync(path.join(os.tmpdir(), 'rivet-keyframes-'));
|
|
77
|
+
const stamps = Array.from({ length: frameCount }, (_, index) => (duration * (index + 0.5)) / frameCount);
|
|
78
|
+
const framePaths = [];
|
|
79
|
+
try {
|
|
80
|
+
await Promise.all(stamps.map(async (stamp, index) => {
|
|
81
|
+
const framePath = path.join(outDir, `frame-${index + 1}.png`);
|
|
82
|
+
await execFileAsync('ffmpeg', [
|
|
83
|
+
'-ss',
|
|
84
|
+
stamp.toFixed(2),
|
|
85
|
+
'-i',
|
|
86
|
+
videoPath,
|
|
87
|
+
'-frames:v',
|
|
88
|
+
'1',
|
|
89
|
+
'-q:v',
|
|
90
|
+
'3',
|
|
91
|
+
'-y',
|
|
92
|
+
framePath,
|
|
93
|
+
], { timeout: FFMPEG_TIMEOUT_MS });
|
|
94
|
+
framePaths[index] = framePath;
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
+
log.warn(`keyframe extraction failed for ${videoPath}`, error);
|
|
100
|
+
return { ok: false, reason: `ffmpeg failed: ${message}` };
|
|
101
|
+
}
|
|
102
|
+
const existing = framePaths.filter((framePath) => framePath && fs.existsSync(framePath));
|
|
103
|
+
if (existing.length === 0) {
|
|
104
|
+
return { ok: false, reason: 'ffmpeg produced no frames' };
|
|
105
|
+
}
|
|
106
|
+
return { ok: true, framePaths: existing };
|
|
107
|
+
};
|
|
108
|
+
exports.extractVideoKeyframes = extractVideoKeyframes;
|
|
109
|
+
//# sourceMappingURL=videoKeyframes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoKeyframes.js","sourceRoot":"","sources":["../../src/agent-variants/videoKeyframes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAyC;AACzC,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,+BAAiC;AACjC,4CAA+C;AAE/C,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAC1C,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,gBAAgB,CAAC,CAAC;AAE3C,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAM9B;;;;;;GAMG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,SAAiB,EACjB,OAAkD,EACzB,EAAE;IAC3B,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,mBAAmB,CAAC;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C"}
|
|
@@ -22,5 +22,7 @@ export declare const workItemBriefingPath: (sessionId: string, workId: string) =
|
|
|
22
22
|
export declare const workItemCompleteCommand: (workId: string) => string;
|
|
23
23
|
/** The ~40-token prompt the coordinator passes to each worker verbatim. */
|
|
24
24
|
export declare const workItemWorkerPrompt: (sessionId: string, item: HostVariantImplementationWorkItemSnapshot) => string;
|
|
25
|
-
export declare const renderWorkItemBriefing: (item: HostVariantImplementationWorkItemSnapshot
|
|
25
|
+
export declare const renderWorkItemBriefing: (item: HostVariantImplementationWorkItemSnapshot, options?: {
|
|
26
|
+
completion?: "self" | "executor";
|
|
27
|
+
}) => string;
|
|
26
28
|
//# sourceMappingURL=workItemBriefing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workItemBriefing.d.ts","sourceRoot":"","sources":["../../src/agent-variants/workItemBriefing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,aAAa,CAAC;AAK7E;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,QAAQ,MAAM,KACb,MACwE,CAAC;AAE5E,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,MACD,CAAC;AAEzD,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,MAAM,yCAAyC,KAC9C,MAG4E,CAAC;AAuBhF,eAAO,MAAM,sBAAsB,GACjC,MAAM,yCAAyC,
|
|
1
|
+
{"version":3,"file":"workItemBriefing.d.ts","sourceRoot":"","sources":["../../src/agent-variants/workItemBriefing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,aAAa,CAAC;AAK7E;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,QAAQ,MAAM,KACb,MACwE,CAAC;AAE5E,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,MACD,CAAC;AAEzD,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,MAAM,yCAAyC,KAC9C,MAG4E,CAAC;AAuBhF,eAAO,MAAM,sBAAsB,GACjC,MAAM,yCAAyC,EAC/C,UAAU;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,KAC7C,MAiIF,CAAC"}
|
|
@@ -79,7 +79,7 @@ const modeContract = (item) => {
|
|
|
79
79
|
? `Write a complete standalone page to ${item.workspace.rootPath}/${item.workspace.entryPath}.`
|
|
80
80
|
: `Build the direction by editing the app under ${item.workspace.projectPath}.`;
|
|
81
81
|
};
|
|
82
|
-
const renderWorkItemBriefing = (item) => {
|
|
82
|
+
const renderWorkItemBriefing = (item, options) => {
|
|
83
83
|
const lines = [
|
|
84
84
|
`# Rivet work item ${item.workId}`,
|
|
85
85
|
'',
|
|
@@ -96,12 +96,44 @@ const renderWorkItemBriefing = (item) => {
|
|
|
96
96
|
if (item.relevantFiles?.length) {
|
|
97
97
|
lines.push('', `## Relevant files`, ...item.relevantFiles.map((file) => `- ${file}`));
|
|
98
98
|
}
|
|
99
|
+
if (item.contextFiles?.length) {
|
|
100
|
+
lines.push('', `## Visual references — Read these files FIRST`, `They are the primary design signal (brand, palette, type, layout,`, `energy); match them over any prose interpretation in the brief.`, ...item.contextFiles.map((file) => `- ${file.path}${file.label ? ` — ${file.label}` : ''}`));
|
|
101
|
+
}
|
|
99
102
|
if (item.contextBundlePath) {
|
|
100
103
|
lines.push('', `## Design context`, `Read ${item.contextBundlePath} before implementing.`);
|
|
101
104
|
}
|
|
102
105
|
lines.push('', `## Boundaries`, `Edit only ${item.workspace.rootPath}${item.workspace.kind === 'git_worktree'
|
|
103
106
|
? ` (app at ${item.workspace.projectPath})`
|
|
104
|
-
: ''}. Do not touch other variants' workspaces. Do not run git commit or push
|
|
107
|
+
: ''}. Do not touch other variants' workspaces. Do not run git commit or push.`);
|
|
108
|
+
if (options?.completion === 'executor') {
|
|
109
|
+
// Executor-run workers never self-report: the executor observes process
|
|
110
|
+
// exit, validates the artifact, and completes the work item itself.
|
|
111
|
+
if (item.mode === 'create' && item.fidelity === 'high') {
|
|
112
|
+
// High fidelity: frontier authorship, no size cap — the user chose
|
|
113
|
+
// quality over latency. Structure discipline still applies.
|
|
114
|
+
lines.push('', `## Delivery contract`, `Write the COMPLETE page in ONE Write call, authored at full depth:`, `every section and interaction the request names, fully realized`, `design-system CSS, and — when the request names motion — a visibly`, `implemented motion spec. No filler sections or repeated style`, `variants nobody asked for.`);
|
|
115
|
+
}
|
|
116
|
+
else if (item.mode === 'create') {
|
|
117
|
+
// Latency contract: page-writing time is dominated by output volume.
|
|
118
|
+
// A complete-but-tight page ships every requested section without
|
|
119
|
+
// filler — the 1-star failures were MISSING sections/fonts/broken
|
|
120
|
+
// layout, never page brevity.
|
|
121
|
+
const entryFile = `${item.workspace.rootPath}/${item.workspace.kind === 'artifact_directory'
|
|
122
|
+
? item.workspace.entryPath
|
|
123
|
+
: 'index.html'}`;
|
|
124
|
+
lines.push('', `## Size & delivery contract`, `Plan briefly, then write the COMPLETE page in ONE Write call, aiming`, `for roughly 16–20KB of finished HTML. Ship every section and`, `interaction the request names, with fully realized CSS. Stay tight`, `the other way too: no filler sections, long copy blocks, or repeated`, `style variants nobody asked for. When the request names motion, the`, `page must visibly implement the direction's motion spec.`, '', `Then verify depth ONCE: run \`wc -c ${entryFile}\`. If it prints`, `under 15000, the page is underdeveloped — expand the weakest`, `sections with fully-realized styling and real content via targeted`, `Edit operations until a re-run prints over 16000. One expansion`, `round only; never rewrite the whole page.`);
|
|
125
|
+
}
|
|
126
|
+
lines.push('', `## Completion`);
|
|
127
|
+
if (item.mode === 'create') {
|
|
128
|
+
// Full-page authorship gets one bounded structural pass — overlapping
|
|
129
|
+
// absolutely-positioned text and missing sections have shipped broken
|
|
130
|
+
// pages that the objective QA gate cannot catch.
|
|
131
|
+
lines.push(`Before stopping, re-read your finished page ONCE, checking structure`, `only: no overlapping or stacked text (be careful with absolute`, `positioning), no unclosed tags, and every requested section present.`, `Fix findings with minimal targeted Edit operations — never re-emit`, `the page — then stop.`);
|
|
132
|
+
}
|
|
133
|
+
lines.push(`Rivet collects and validates the artifact automatically — do NOT spend`, `time on broader verification, screenshots, or repeated re-reads, and do`, `not run any completion command. When your edits are in place, simply`, `stop.`, '');
|
|
134
|
+
return lines.join('\n');
|
|
135
|
+
}
|
|
136
|
+
lines.push('', `## Completion — your FINAL step, the moment the workspace is done`, `Rivet validates the artifact server-side (QA gate) — do NOT spend time on`, `broad verification, screenshots, or re-reads. When your edits are in`, `place, run exactly:`, '', '```', (0, exports.workItemCompleteCommand)(item.workId), '```', '', `(Hosts with Rivet MCP tools may instead call the rivet_variants tool with ` +
|
|
105
137
|
`action "complete" and workId "${item.workId}".) Do not send file contents ` +
|
|
106
138
|
`through the completion; Rivet reads the workspace itself. Then stop.`, '');
|
|
107
139
|
return lines.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workItemBriefing.js","sourceRoot":"","sources":["../../src/agent-variants/workItemBriefing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAyB;AACzB,2CAA6B;AAE7B;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,oBAAoB,GAAG,CAClC,SAAiB,EACjB,MAAc,EACN,EAAE,CACV,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,sBAAsB,EAAE,SAAS,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC;AAJ/D,QAAA,oBAAoB,wBAI2C;AAErE,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAU,EAAE,CAChE,2BAA2B,MAAM,qBAAqB,CAAC;AAD5C,QAAA,uBAAuB,2BACqB;AAEzD,2EAA2E;AACpE,MAAM,oBAAoB,GAAG,CAClC,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,sBAAsB,0BAoIjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpServe.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcpServe.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAcnC;;;;;;;;;;;;GAYG;AAEH,KAAK,eAAe,GAAG;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,iFAAiF;AACjF,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,OASlD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,WAAW,KAAG,OAgB1D,CAAC;AAwBF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAU,UAAS,eAAoB;;;
|
|
1
|
+
{"version":3,"file":"mcpServe.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcpServe.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAcnC;;;;;;;;;;;;GAYG;AAEH,KAAK,eAAe,GAAG;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,iFAAiF;AACjF,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,OASlD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,WAAW,KAAG,OAgB1D,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