@vibes.diy/api-svc 14.3.32 → 14.3.36
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/intern/draft-lane-config.d.ts +3 -0
- package/intern/draft-lane-config.js +3 -0
- package/intern/draft-lane-config.js.map +1 -1
- package/intern/draft-lane-persist.d.ts +1 -0
- package/intern/draft-lane-persist.js +1 -1
- package/intern/draft-lane-persist.js.map +1 -1
- package/intern/draft-lane-store.d.ts +1 -0
- package/intern/draft-lane-store.js.map +1 -1
- package/intern/draft-lane.d.ts +4 -1
- package/intern/draft-lane.js +33 -4
- package/intern/draft-lane.js.map +1 -1
- package/intern/draft-ready-frame.d.ts +1 -0
- package/intern/draft-ready-frame.js +2 -0
- package/intern/draft-ready-frame.js.map +1 -1
- package/intern/draft-variation-ast.d.ts +26 -0
- package/intern/draft-variation-ast.js +389 -0
- package/intern/draft-variation-ast.js.map +1 -0
- package/intern/draft-variation.d.ts +46 -0
- package/intern/draft-variation.js +249 -0
- package/intern/draft-variation.js.map +1 -0
- package/intern/mint-job-store.d.ts +3 -0
- package/intern/mint-job-store.js +3 -0
- package/intern/mint-job-store.js.map +1 -1
- package/intern/section-fan-out.js +1 -0
- package/intern/section-fan-out.js.map +1 -1
- package/package.json +12 -12
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { exception2Result, Result } from "@adviser/cement";
|
|
2
|
+
import { Parser } from "acorn";
|
|
3
|
+
import acornJsx from "acorn-jsx";
|
|
4
|
+
export const HOLE_OPEN = "/*__HOLE ";
|
|
5
|
+
export const HOLE_CLOSE = " __*/";
|
|
6
|
+
export function holeMarker(name) {
|
|
7
|
+
return `${HOLE_OPEN}${name}${HOLE_CLOSE}`;
|
|
8
|
+
}
|
|
9
|
+
const JsxParser = Parser.extend(acornJsx());
|
|
10
|
+
const MIN_BODY = 60;
|
|
11
|
+
const MAX_BODY = 2500;
|
|
12
|
+
function isNode(value) {
|
|
13
|
+
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
14
|
+
}
|
|
15
|
+
function nodesOf(value) {
|
|
16
|
+
return Array.isArray(value) ? value.filter(isNode) : [];
|
|
17
|
+
}
|
|
18
|
+
function nameOf(node) {
|
|
19
|
+
return isNode(node) && typeof node.name === "string" ? node.name : undefined;
|
|
20
|
+
}
|
|
21
|
+
function parse(source) {
|
|
22
|
+
const parsed = exception2Result(() => JsxParser.parse(source, { ecmaVersion: "latest", sourceType: "module" }));
|
|
23
|
+
if (parsed.isErr())
|
|
24
|
+
return Result.Err(parsed.Err());
|
|
25
|
+
const program = parsed.Ok();
|
|
26
|
+
if (isNode(program) === false)
|
|
27
|
+
return Result.Err("unreadable module");
|
|
28
|
+
return Result.Ok(program);
|
|
29
|
+
}
|
|
30
|
+
function childrenOf(node) {
|
|
31
|
+
const out = [];
|
|
32
|
+
for (const [key, value] of Object.entries(node)) {
|
|
33
|
+
if (key === "type" || key === "start" || key === "end" || key === "loc" || key === "range")
|
|
34
|
+
continue;
|
|
35
|
+
if (Array.isArray(value))
|
|
36
|
+
for (const child of nodesOf(value))
|
|
37
|
+
out.push({ key, child });
|
|
38
|
+
else if (isNode(value))
|
|
39
|
+
out.push({ key, child: value });
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
function leafCandidate(args) {
|
|
44
|
+
const { source, name, fn } = args;
|
|
45
|
+
const body = fn.body;
|
|
46
|
+
if (name === undefined || isNode(body) === false || body.type !== "BlockStatement")
|
|
47
|
+
return undefined;
|
|
48
|
+
const len = body.end - body.start;
|
|
49
|
+
if (len < MIN_BODY || len > MAX_BODY)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (/^[A-Z]/.test(name) || name === "App")
|
|
52
|
+
return undefined;
|
|
53
|
+
const params = nodesOf(fn.params)
|
|
54
|
+
.map((p) => source.slice(p.start, p.end))
|
|
55
|
+
.join(", ");
|
|
56
|
+
return { name, params, start: body.start + 1, end: body.end - 1, open: body.start, len };
|
|
57
|
+
}
|
|
58
|
+
function leafCandidates(source, program) {
|
|
59
|
+
const out = [];
|
|
60
|
+
function visit(node) {
|
|
61
|
+
if (node.type === "FunctionDeclaration") {
|
|
62
|
+
const c = leafCandidate({ source, name: nameOf(node.id), fn: node });
|
|
63
|
+
if (c !== undefined)
|
|
64
|
+
out.push(c);
|
|
65
|
+
}
|
|
66
|
+
const init = node.init;
|
|
67
|
+
if (node.type === "VariableDeclarator" &&
|
|
68
|
+
isNode(init) &&
|
|
69
|
+
(init.type === "ArrowFunctionExpression" || init.type === "FunctionExpression") &&
|
|
70
|
+
isNode(node.id) &&
|
|
71
|
+
node.id.type === "Identifier") {
|
|
72
|
+
const c = leafCandidate({ source, name: nameOf(node.id), fn: init });
|
|
73
|
+
if (c !== undefined)
|
|
74
|
+
out.push(c);
|
|
75
|
+
}
|
|
76
|
+
for (const { child } of childrenOf(node))
|
|
77
|
+
visit(child);
|
|
78
|
+
}
|
|
79
|
+
visit(program);
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function lineIndentAt(source, pos) {
|
|
83
|
+
const lineStart = source.lastIndexOf("\n", pos - 1) + 1;
|
|
84
|
+
const match = /^[ \t]*/.exec(source.slice(lineStart, pos));
|
|
85
|
+
return match === null ? "" : match[0];
|
|
86
|
+
}
|
|
87
|
+
export function hollowLeafFunctions(o) {
|
|
88
|
+
const { source, max } = o;
|
|
89
|
+
const rProgram = parse(source);
|
|
90
|
+
if (rProgram.isErr())
|
|
91
|
+
return Result.Err(rProgram.Err());
|
|
92
|
+
const candidates = leafCandidates(source, rProgram.Ok()).sort((a, b) => b.len - a.len || a.start - b.start);
|
|
93
|
+
const picked = [];
|
|
94
|
+
for (const c of candidates) {
|
|
95
|
+
if (picked.length >= max)
|
|
96
|
+
break;
|
|
97
|
+
const clashes = picked.some((p) => p.name === c.name || (c.open < p.end + 1 && p.open < c.end + 1));
|
|
98
|
+
if (clashes === false)
|
|
99
|
+
picked.push(c);
|
|
100
|
+
}
|
|
101
|
+
if (picked.length === 0)
|
|
102
|
+
return Result.Err("no hollowable function: no non-capitalized function with a 60..2500 char body");
|
|
103
|
+
picked.sort((a, b) => a.start - b.start);
|
|
104
|
+
let template = "";
|
|
105
|
+
let cursor = 0;
|
|
106
|
+
const holes = [];
|
|
107
|
+
for (const c of picked) {
|
|
108
|
+
const lineIndent = lineIndentAt(source, c.open);
|
|
109
|
+
const indent = `${lineIndent} `;
|
|
110
|
+
template += `${source.slice(cursor, c.start)}\n${indent}${holeMarker(c.name)}\n${lineIndent}`;
|
|
111
|
+
cursor = c.end;
|
|
112
|
+
holes.push({ name: c.name, params: c.params, body: source.slice(c.start, c.end), indent });
|
|
113
|
+
}
|
|
114
|
+
template += source.slice(cursor);
|
|
115
|
+
return Result.Ok({ template, holes });
|
|
116
|
+
}
|
|
117
|
+
export function fillHole(o) {
|
|
118
|
+
const { template, name, body } = o;
|
|
119
|
+
const marker = holeMarker(name);
|
|
120
|
+
const at = template.indexOf(marker);
|
|
121
|
+
if (at < 0)
|
|
122
|
+
return Result.Err(`no hole marker for ${name}`);
|
|
123
|
+
const before = template.slice(0, at);
|
|
124
|
+
const after = template.slice(at + marker.length);
|
|
125
|
+
const lead = /\s*$/.exec(before);
|
|
126
|
+
const trail = /^\s*/.exec(after);
|
|
127
|
+
const from = lead === null ? at : at - lead[0].length;
|
|
128
|
+
const to = trail === null ? at + marker.length : at + marker.length + trail[0].length;
|
|
129
|
+
if (template[from - 1] !== "{" || template[to] !== "}")
|
|
130
|
+
return Result.Err(`hole marker for ${name} is not a function's whole body`);
|
|
131
|
+
const interior = body.startsWith("\n") ? body : `\n${body.replace(/\s+$/, "")}\n${lineIndentAt(template, to)}`;
|
|
132
|
+
return Result.Ok(`${template.slice(0, from)}${interior}${template.slice(to)}`);
|
|
133
|
+
}
|
|
134
|
+
const GLOBALS = new Set([
|
|
135
|
+
"React",
|
|
136
|
+
"Date",
|
|
137
|
+
"Math",
|
|
138
|
+
"JSON",
|
|
139
|
+
"Object",
|
|
140
|
+
"Array",
|
|
141
|
+
"String",
|
|
142
|
+
"Number",
|
|
143
|
+
"Boolean",
|
|
144
|
+
"Promise",
|
|
145
|
+
"Set",
|
|
146
|
+
"Map",
|
|
147
|
+
"console",
|
|
148
|
+
"window",
|
|
149
|
+
"document",
|
|
150
|
+
"localStorage",
|
|
151
|
+
"navigator",
|
|
152
|
+
"setTimeout",
|
|
153
|
+
"clearTimeout",
|
|
154
|
+
"setInterval",
|
|
155
|
+
"clearInterval",
|
|
156
|
+
"requestAnimationFrame",
|
|
157
|
+
"cancelAnimationFrame",
|
|
158
|
+
"fetch",
|
|
159
|
+
"URL",
|
|
160
|
+
"Intl",
|
|
161
|
+
"parseInt",
|
|
162
|
+
"parseFloat",
|
|
163
|
+
"isNaN",
|
|
164
|
+
"Error",
|
|
165
|
+
"undefined",
|
|
166
|
+
"NaN",
|
|
167
|
+
"Infinity",
|
|
168
|
+
"crypto",
|
|
169
|
+
"Symbol",
|
|
170
|
+
"Reflect",
|
|
171
|
+
"alert",
|
|
172
|
+
"confirm",
|
|
173
|
+
"prompt",
|
|
174
|
+
"encodeURIComponent",
|
|
175
|
+
"decodeURIComponent",
|
|
176
|
+
"structuredClone",
|
|
177
|
+
"Blob",
|
|
178
|
+
"File",
|
|
179
|
+
"FileReader",
|
|
180
|
+
"Image",
|
|
181
|
+
"Audio",
|
|
182
|
+
"AbortController",
|
|
183
|
+
"Event",
|
|
184
|
+
"CustomEvent",
|
|
185
|
+
"globalThis",
|
|
186
|
+
"arguments",
|
|
187
|
+
"RegExp",
|
|
188
|
+
"Function",
|
|
189
|
+
]);
|
|
190
|
+
function bindPattern(pattern, scope) {
|
|
191
|
+
if (isNode(pattern) === false)
|
|
192
|
+
return;
|
|
193
|
+
switch (pattern.type) {
|
|
194
|
+
case "Identifier": {
|
|
195
|
+
const name = nameOf(pattern);
|
|
196
|
+
if (name !== undefined)
|
|
197
|
+
scope.add(name);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
case "ObjectPattern":
|
|
201
|
+
for (const p of nodesOf(pattern.properties))
|
|
202
|
+
bindPattern(p.type === "RestElement" ? p.argument : p.value, scope);
|
|
203
|
+
return;
|
|
204
|
+
case "ArrayPattern":
|
|
205
|
+
for (const e of nodesOf(pattern.elements))
|
|
206
|
+
bindPattern(e, scope);
|
|
207
|
+
return;
|
|
208
|
+
case "AssignmentPattern":
|
|
209
|
+
bindPattern(pattern.left, scope);
|
|
210
|
+
return;
|
|
211
|
+
case "RestElement":
|
|
212
|
+
bindPattern(pattern.argument, scope);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function hoist(statements, scope) {
|
|
217
|
+
for (const st of statements) {
|
|
218
|
+
switch (st.type) {
|
|
219
|
+
case "FunctionDeclaration":
|
|
220
|
+
case "ClassDeclaration": {
|
|
221
|
+
const name = nameOf(st.id);
|
|
222
|
+
if (name !== undefined)
|
|
223
|
+
scope.add(name);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
case "VariableDeclaration":
|
|
227
|
+
for (const d of nodesOf(st.declarations))
|
|
228
|
+
bindPattern(d.id, scope);
|
|
229
|
+
break;
|
|
230
|
+
case "ImportDeclaration":
|
|
231
|
+
for (const sp of nodesOf(st.specifiers)) {
|
|
232
|
+
const name = nameOf(sp.local);
|
|
233
|
+
if (name !== undefined)
|
|
234
|
+
scope.add(name);
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
237
|
+
case "ExportNamedDeclaration":
|
|
238
|
+
if (isNode(st.declaration))
|
|
239
|
+
hoist([st.declaration], scope);
|
|
240
|
+
break;
|
|
241
|
+
case "ExportDefaultDeclaration": {
|
|
242
|
+
const name = isNode(st.declaration) ? nameOf(st.declaration.id) : undefined;
|
|
243
|
+
if (name !== undefined)
|
|
244
|
+
scope.add(name);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function scopeOf(node) {
|
|
251
|
+
switch (node.type) {
|
|
252
|
+
case "Program":
|
|
253
|
+
case "BlockStatement":
|
|
254
|
+
case "StaticBlock": {
|
|
255
|
+
const scope = new Set();
|
|
256
|
+
hoist(nodesOf(node.body), scope);
|
|
257
|
+
return scope;
|
|
258
|
+
}
|
|
259
|
+
case "SwitchStatement": {
|
|
260
|
+
const scope = new Set();
|
|
261
|
+
for (const c of nodesOf(node.cases))
|
|
262
|
+
hoist(nodesOf(c.consequent), scope);
|
|
263
|
+
return scope;
|
|
264
|
+
}
|
|
265
|
+
case "FunctionDeclaration":
|
|
266
|
+
case "FunctionExpression":
|
|
267
|
+
case "ArrowFunctionExpression": {
|
|
268
|
+
const scope = new Set();
|
|
269
|
+
for (const p of nodesOf(node.params))
|
|
270
|
+
bindPattern(p, scope);
|
|
271
|
+
const name = nameOf(node.id);
|
|
272
|
+
if (name !== undefined)
|
|
273
|
+
scope.add(name);
|
|
274
|
+
if (isNode(node.body) && node.body.type === "BlockStatement")
|
|
275
|
+
hoist(nodesOf(node.body.body), scope);
|
|
276
|
+
return scope;
|
|
277
|
+
}
|
|
278
|
+
case "ClassExpression": {
|
|
279
|
+
const scope = new Set();
|
|
280
|
+
const name = nameOf(node.id);
|
|
281
|
+
if (name !== undefined)
|
|
282
|
+
scope.add(name);
|
|
283
|
+
return scope;
|
|
284
|
+
}
|
|
285
|
+
case "ForStatement":
|
|
286
|
+
case "ForOfStatement":
|
|
287
|
+
case "ForInStatement": {
|
|
288
|
+
const scope = new Set();
|
|
289
|
+
const init = node.type === "ForStatement" ? node.init : node.left;
|
|
290
|
+
if (isNode(init) && init.type === "VariableDeclaration")
|
|
291
|
+
for (const d of nodesOf(init.declarations))
|
|
292
|
+
bindPattern(d.id, scope);
|
|
293
|
+
return scope;
|
|
294
|
+
}
|
|
295
|
+
case "CatchClause": {
|
|
296
|
+
const scope = new Set();
|
|
297
|
+
bindPattern(node.param, scope);
|
|
298
|
+
return scope;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return undefined;
|
|
302
|
+
}
|
|
303
|
+
function isNotARead(parent, key) {
|
|
304
|
+
const computed = parent.computed === true;
|
|
305
|
+
switch (parent.type) {
|
|
306
|
+
case "VariableDeclarator":
|
|
307
|
+
return key === "id";
|
|
308
|
+
case "FunctionDeclaration":
|
|
309
|
+
case "FunctionExpression":
|
|
310
|
+
case "ArrowFunctionExpression":
|
|
311
|
+
return key === "params" || key === "id";
|
|
312
|
+
case "ClassDeclaration":
|
|
313
|
+
case "ClassExpression":
|
|
314
|
+
return key === "id";
|
|
315
|
+
case "MemberExpression":
|
|
316
|
+
return key === "property" && computed === false;
|
|
317
|
+
case "Property":
|
|
318
|
+
return key === "key" && computed === false && parent.shorthand !== true;
|
|
319
|
+
case "PropertyDefinition":
|
|
320
|
+
case "MethodDefinition":
|
|
321
|
+
return key === "key" && computed === false;
|
|
322
|
+
case "AssignmentPattern":
|
|
323
|
+
return key === "left";
|
|
324
|
+
case "CatchClause":
|
|
325
|
+
return key === "param";
|
|
326
|
+
case "ObjectPattern":
|
|
327
|
+
case "ArrayPattern":
|
|
328
|
+
case "RestElement":
|
|
329
|
+
case "ImportSpecifier":
|
|
330
|
+
case "ImportDefaultSpecifier":
|
|
331
|
+
case "ImportNamespaceSpecifier":
|
|
332
|
+
case "ExportSpecifier":
|
|
333
|
+
case "LabeledStatement":
|
|
334
|
+
case "BreakStatement":
|
|
335
|
+
case "ContinueStatement":
|
|
336
|
+
case "MetaProperty":
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
function bound(scopes, name) {
|
|
342
|
+
return scopes.some((s) => s.has(name));
|
|
343
|
+
}
|
|
344
|
+
function containsReturn(node) {
|
|
345
|
+
if (node.type === "ReturnStatement")
|
|
346
|
+
return true;
|
|
347
|
+
return childrenOf(node).some(({ child }) => containsReturn(child));
|
|
348
|
+
}
|
|
349
|
+
export function freeIdentifiers(source) {
|
|
350
|
+
const rProgram = parse(source);
|
|
351
|
+
if (rProgram.isErr())
|
|
352
|
+
return Result.Err(rProgram.Err());
|
|
353
|
+
const program = rProgram.Ok();
|
|
354
|
+
const found = [];
|
|
355
|
+
function visit(args) {
|
|
356
|
+
const { node, at } = args;
|
|
357
|
+
const own = scopeOf(node);
|
|
358
|
+
const scopes = own === undefined ? args.scopes : [...args.scopes, own];
|
|
359
|
+
if (node.type === "Identifier") {
|
|
360
|
+
const name = nameOf(node);
|
|
361
|
+
if (name === undefined)
|
|
362
|
+
return;
|
|
363
|
+
const notARead = at !== undefined && isNotARead(at.parent, at.key);
|
|
364
|
+
if (notARead === false && GLOBALS.has(name) === false && bound(scopes, name) === false)
|
|
365
|
+
found.push(name);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
if (node.type === "JSXIdentifier" && at !== undefined && at.parent.type === "JSXOpeningElement" && at.key === "name") {
|
|
369
|
+
const name = nameOf(node);
|
|
370
|
+
if (name !== undefined && /^[A-Z]/.test(name) && bound(scopes, name) === false)
|
|
371
|
+
found.push(`<${name}>`);
|
|
372
|
+
}
|
|
373
|
+
for (const { key, child } of childrenOf(node))
|
|
374
|
+
visit({ node: child, scopes, at: { parent: node, key } });
|
|
375
|
+
}
|
|
376
|
+
visit({ node: program, scopes: [] });
|
|
377
|
+
for (const st of nodesOf(program.body)) {
|
|
378
|
+
const decl = st.type === "ExportDefaultDeclaration" || st.type === "ExportNamedDeclaration" ? st.declaration : st;
|
|
379
|
+
if (isNode(decl) === false || decl.type !== "FunctionDeclaration")
|
|
380
|
+
continue;
|
|
381
|
+
const name = nameOf(decl.id);
|
|
382
|
+
if (name === undefined || /^[A-Z]/.test(name) === false)
|
|
383
|
+
continue;
|
|
384
|
+
if (isNode(decl.body) && containsReturn(decl.body) === false)
|
|
385
|
+
found.push(`${name} has no return`);
|
|
386
|
+
}
|
|
387
|
+
return Result.Ok([...new Set(found)]);
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=draft-variation-ast.js.map
|
|
@@ -0,0 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,SAAS;QAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK;YAAE,SAAS;QAClE,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,gBAAgB,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AutofixAndCheck } from "./draft-lane-autofix.js";
|
|
2
|
+
import type { DraftModelCall, DraftModelUsage } from "./draft-lane-classify.js";
|
|
3
|
+
import { type HollowedFunction } from "./draft-variation-ast.js";
|
|
4
|
+
export declare const VARIATION_MAX_HOLES = 4;
|
|
5
|
+
export declare const VARIATION_FILL_ATTEMPTS = 3;
|
|
6
|
+
export declare const VARIATION_MAX_TOKENS = 600;
|
|
7
|
+
export declare const VARIATION_DOC_HEAD = "# vibes.diy quick reference: small Fireproof apps\n\nRules every example follows:\n- Components come from `@vibes.diy/look` (Card, Badge, Button, Input); classes are semantic tokens (`bg-background`, `text-muted-foreground`), never hex colors.\n- Records are documents with a `type`; reads are `useLiveQuery`, writes are `database.put({ type, ..., createdAt: Date.now() })`.\n- Copy is specific and friendly; a helper does one thing and returns a value.\n\n## Example\n\n```jsx\n";
|
|
8
|
+
export interface VariationEvent {
|
|
9
|
+
readonly step: "hollowed" | "shaped" | "filled" | "settled";
|
|
10
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
11
|
+
}
|
|
12
|
+
export interface VaryDraftOptions {
|
|
13
|
+
readonly vfs: ReadonlyMap<string, string>;
|
|
14
|
+
readonly sentence: string;
|
|
15
|
+
readonly callModel: DraftModelCall;
|
|
16
|
+
readonly autofixAndCheck: AutofixAndCheck;
|
|
17
|
+
readonly deadlineMs: number;
|
|
18
|
+
readonly model?: string;
|
|
19
|
+
readonly log?: (event: VariationEvent) => void;
|
|
20
|
+
readonly random?: () => number;
|
|
21
|
+
}
|
|
22
|
+
export interface VaryDraftResult {
|
|
23
|
+
readonly vfs: ReadonlyMap<string, string>;
|
|
24
|
+
readonly notes: readonly string[];
|
|
25
|
+
readonly varied: boolean;
|
|
26
|
+
readonly holes: readonly string[];
|
|
27
|
+
readonly restored: readonly string[];
|
|
28
|
+
readonly usage: readonly DraftModelUsage[];
|
|
29
|
+
}
|
|
30
|
+
interface Outline {
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly tagline: string;
|
|
33
|
+
readonly purposes: ReadonlyMap<string, string>;
|
|
34
|
+
}
|
|
35
|
+
export declare function fallbackPurpose(hole: Pick<HollowedFunction, "name" | "params">): string;
|
|
36
|
+
export declare function stripFence(text: string): string;
|
|
37
|
+
export declare function parseShapeReply(text: string, holes: readonly HollowedFunction[]): Outline;
|
|
38
|
+
export declare function composeFillPrompt(o: {
|
|
39
|
+
readonly template: string;
|
|
40
|
+
readonly hole: HollowedFunction;
|
|
41
|
+
readonly holes: readonly HollowedFunction[];
|
|
42
|
+
readonly purposes: ReadonlyMap<string, string>;
|
|
43
|
+
readonly nonce: string;
|
|
44
|
+
}): string;
|
|
45
|
+
export declare function varyDraft(opts: VaryDraftOptions): Promise<VaryDraftResult>;
|
|
46
|
+
export {};
|