@kirkchinese/dsh-citeciter 0.9.0-beta.2 → 0.9.0-beta.4
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/README.md +17 -10
- package/README.zh.md +17 -10
- package/assets/citeciter-mascot.png +0 -0
- package/assets/locale/en.json +6 -0
- package/assets/locale/zh.json +6 -0
- package/lib/client.js +6111 -3495
- package/lib/index.js +1769 -314
- package/lib/{typert-common-g1lnIG8u.js → typert-common-BtQUArWP.js} +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/actions.d.ts +15 -0
- package/lib/types/blackboard-tool.d.ts +6 -0
- package/lib/types/board-animation.d.ts +278 -0
- package/lib/types/board-capture-protocol.d.ts +61 -1
- package/lib/types/board-capture.d.ts +2 -0
- package/lib/types/board.d.ts +62 -3
- package/lib/types/client/action-controller.d.ts +14 -1
- package/lib/types/client/action-executor.d.ts +3 -1
- package/lib/types/client/board-citation.d.ts +2 -0
- package/lib/types/client/board-timeline.d.ts +33 -0
- package/lib/types/client/components/BoardCaptureSurface.d.ts +3 -1
- package/lib/types/client/components/BoardView.d.ts +5 -1
- package/lib/types/client/components/CiteCiterSettings.d.ts +13 -2
- package/lib/types/client/components/CitePanel.d.ts +14 -1
- package/lib/types/client/components/CiterTab.d.ts +15 -0
- package/lib/types/client/components/ContextRow.d.ts +7 -0
- package/lib/types/client/components/PermissionControl.d.ts +1 -1
- package/lib/types/client/components/SelectionToolbar.d.ts +2 -0
- package/lib/types/client/components/ToolMessage.d.ts +10 -5
- package/lib/types/client/components/TopicActions.d.ts +4 -1
- package/lib/types/client/components/TopicHeader.d.ts +4 -3
- package/lib/types/client/components/TopicModelControls.d.ts +1 -1
- package/lib/types/client/components/TopicUsage.d.ts +5 -0
- package/lib/types/client/components/UserMessageBody.d.ts +7 -2
- package/lib/types/client/conversation-dom.d.ts +2 -0
- package/lib/types/client/copy.d.ts +16 -4
- package/lib/types/client/draft-references.d.ts +3 -1
- package/lib/types/client/entries.d.ts +3 -0
- package/lib/types/client/i18n.d.ts +23 -0
- package/lib/types/client/locales/board.d.ts +51 -0
- package/lib/types/client/locales/common.d.ts +7 -0
- package/lib/types/client/locales/index.d.ts +564 -0
- package/lib/types/client/locales/panel.d.ts +215 -0
- package/lib/types/client/locales/settings.d.ts +179 -0
- package/lib/types/client/locales/transcript.d.ts +127 -0
- package/lib/types/client/main-quote.d.ts +16 -0
- package/lib/types/client/native-file-link.d.ts +10 -0
- package/lib/types/client/request-guard.d.ts +2 -1
- package/lib/types/client/rich-content.d.ts +7 -0
- package/lib/types/client/selection-references.d.ts +1 -1
- package/lib/types/client/tool-cards.d.ts +84 -0
- package/lib/types/client/tool-presentation.d.ts +1 -4
- package/lib/types/client/topic-presentation.d.ts +8 -3
- package/lib/types/client/types.d.ts +12 -0
- package/lib/types/client/view-actions.d.ts +1 -1
- package/lib/types/evidence-text.d.ts +8 -0
- package/lib/types/host-agent-modules.d.ts +4 -1
- package/lib/types/line-diff.d.ts +12 -0
- package/lib/types/message-projection.d.ts +25 -7
- package/lib/types/model-admission.d.ts +1 -1
- package/lib/types/observer.d.ts +0 -30
- package/lib/types/owned-session-cleanup.d.ts +7 -1
- package/lib/types/source-read-tool.d.ts +3 -3
- package/lib/types/source-session.d.ts +11 -2
- package/lib/types/source-transcript.d.ts +58 -0
- package/lib/types/tool-events.d.ts +2 -0
- package/lib/types/topic-context.d.ts +80 -0
- package/lib/types/topic-log.d.ts +5 -1
- package/lib/types/topic-prompts.d.ts +4 -0
- package/lib/types/topic-runtime.d.ts +5 -1
- package/lib/types/topic.d.ts +273 -15
- package/lib/types/typert-common.d.ts +148 -5
- package/lib/types/typert.host.d.ts +383 -14
- package/lib/types/workspace-changes.d.ts +90 -0
- package/lib/{update-B_0nN1_f.js → update-D-jnLTb5.js} +681 -5
- package/package.json +70 -65
- package/lib/types/client/board-capture-target.d.ts +0 -8
- package/lib/types/client/components/ChoicePopover.d.ts +0 -8
|
@@ -152,6 +152,641 @@ const nativeStateSchema = z.object({
|
|
|
152
152
|
attachments: z.array(nativeAttachmentSchema)
|
|
153
153
|
}).strict())
|
|
154
154
|
}).strict();
|
|
155
|
+
const ANIMATION_MAX_DURATION_MS = 3e4;
|
|
156
|
+
/** Offset in canvas percent used by directional appear and disappear. */
|
|
157
|
+
const SLIDE_DISTANCE = 6;
|
|
158
|
+
const easingSchema = z.enum([
|
|
159
|
+
"linear",
|
|
160
|
+
"ease-in",
|
|
161
|
+
"ease-out",
|
|
162
|
+
"ease-in-out"
|
|
163
|
+
]);
|
|
164
|
+
const directionSchema = z.enum([
|
|
165
|
+
"left",
|
|
166
|
+
"right",
|
|
167
|
+
"up",
|
|
168
|
+
"down"
|
|
169
|
+
]);
|
|
170
|
+
const timeSchema = z.number().int().min(0).max(ANIMATION_MAX_DURATION_MS);
|
|
171
|
+
const coordinateSchema = z.number().min(-50).max(150);
|
|
172
|
+
const expressionSchema = z.string().min(1).max(240);
|
|
173
|
+
/** One verb applied to one board element. */
|
|
174
|
+
const animationTrackSchema = z.object({
|
|
175
|
+
target: z.string().min(1).max(80),
|
|
176
|
+
verb: z.enum([
|
|
177
|
+
"appear",
|
|
178
|
+
"disappear",
|
|
179
|
+
"move",
|
|
180
|
+
"scale",
|
|
181
|
+
"rotate",
|
|
182
|
+
"highlight",
|
|
183
|
+
"reveal",
|
|
184
|
+
"follow",
|
|
185
|
+
"keyframes",
|
|
186
|
+
"parametric"
|
|
187
|
+
]),
|
|
188
|
+
startMs: timeSchema.optional(),
|
|
189
|
+
endMs: timeSchema.optional(),
|
|
190
|
+
easing: easingSchema.optional(),
|
|
191
|
+
to: z.object({
|
|
192
|
+
x: coordinateSchema,
|
|
193
|
+
y: coordinateSchema
|
|
194
|
+
}).strict().optional(),
|
|
195
|
+
scale: z.number().min(.05).max(10).optional(),
|
|
196
|
+
degrees: z.number().min(-3600).max(3600).optional(),
|
|
197
|
+
direction: directionSchema.optional(),
|
|
198
|
+
path: z.string().min(1).max(4e3).optional(),
|
|
199
|
+
orient: z.boolean().optional(),
|
|
200
|
+
frames: z.array(z.object({
|
|
201
|
+
atMs: timeSchema,
|
|
202
|
+
x: coordinateSchema.optional(),
|
|
203
|
+
y: coordinateSchema.optional(),
|
|
204
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
205
|
+
scale: z.number().min(.05).max(10).optional(),
|
|
206
|
+
rotate: z.number().min(-3600).max(3600).optional()
|
|
207
|
+
}).strict()).min(1).max(40).optional(),
|
|
208
|
+
x: expressionSchema.optional(),
|
|
209
|
+
y: expressionSchema.optional(),
|
|
210
|
+
t: z.tuple([z.number().min(-1e6).max(1e6), z.number().min(-1e6).max(1e6)]).optional()
|
|
211
|
+
}).strict();
|
|
212
|
+
/** One complete timeline as written by the model. */
|
|
213
|
+
const animationSpecSchema = z.object({
|
|
214
|
+
durationMs: z.number().int().min(200).max(ANIMATION_MAX_DURATION_MS),
|
|
215
|
+
loop: z.boolean().optional(),
|
|
216
|
+
beats: z.array(z.object({
|
|
217
|
+
atMs: timeSchema,
|
|
218
|
+
caption: z.string().min(1).max(160)
|
|
219
|
+
}).strict()).max(20).optional(),
|
|
220
|
+
tracks: z.array(animationTrackSchema).min(1).max(40)
|
|
221
|
+
}).strict();
|
|
222
|
+
/** The board's current timeline: the spec of the latest successful call, keyed by that call. */
|
|
223
|
+
const boardTimelineSchema = z.object({
|
|
224
|
+
id: z.string().min(1),
|
|
225
|
+
spec: animationSpecSchema
|
|
226
|
+
}).strict();
|
|
227
|
+
const FUNCTIONS = {
|
|
228
|
+
sin: Math.sin,
|
|
229
|
+
cos: Math.cos,
|
|
230
|
+
tan: Math.tan,
|
|
231
|
+
asin: Math.asin,
|
|
232
|
+
acos: Math.acos,
|
|
233
|
+
atan: Math.atan,
|
|
234
|
+
atan2: Math.atan2,
|
|
235
|
+
sqrt: Math.sqrt,
|
|
236
|
+
abs: Math.abs,
|
|
237
|
+
exp: Math.exp,
|
|
238
|
+
log: Math.log,
|
|
239
|
+
min: Math.min,
|
|
240
|
+
max: Math.max,
|
|
241
|
+
pow: Math.pow,
|
|
242
|
+
floor: Math.floor,
|
|
243
|
+
ceil: Math.ceil,
|
|
244
|
+
round: Math.round,
|
|
245
|
+
sign: Math.sign
|
|
246
|
+
};
|
|
247
|
+
const CONSTANTS = {
|
|
248
|
+
pi: Math.PI,
|
|
249
|
+
e: Math.E,
|
|
250
|
+
tau: Math.PI * 2
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Compile a restricted arithmetic expression of `t`: numbers, `+ - * / ^`, parentheses,
|
|
254
|
+
* the constants pi, e, tau and a fixed set of Math functions. Nothing else is accepted.
|
|
255
|
+
* @throws an Error naming the first unexpected token.
|
|
256
|
+
*/
|
|
257
|
+
function compileExpression(source) {
|
|
258
|
+
const tokens = source.match(/\d+(?:\.\d+)?(?:e[+-]?\d+)?|\.\d+|[a-z_][a-z0-9_]*|\*\*|[-+*/^(),]|\S/giu) ?? [];
|
|
259
|
+
let index = 0;
|
|
260
|
+
const peek = () => tokens[index];
|
|
261
|
+
const take = (expected) => {
|
|
262
|
+
const token = tokens[index];
|
|
263
|
+
if (token === void 0 || expected !== void 0 && token !== expected) throw new Error(`expression "${source}": expected ${expected ?? "a value"} at ${token ?? "end"}`);
|
|
264
|
+
index += 1;
|
|
265
|
+
return token;
|
|
266
|
+
};
|
|
267
|
+
const primary = () => {
|
|
268
|
+
const token = take();
|
|
269
|
+
if (/^(?:\d|\.\d)/u.test(token)) {
|
|
270
|
+
const value = Number(token);
|
|
271
|
+
return () => value;
|
|
272
|
+
}
|
|
273
|
+
if (token === "(") {
|
|
274
|
+
const inner = sum();
|
|
275
|
+
take(")");
|
|
276
|
+
return inner;
|
|
277
|
+
}
|
|
278
|
+
if (token === "-") {
|
|
279
|
+
const inner = power();
|
|
280
|
+
return (t) => -inner(t);
|
|
281
|
+
}
|
|
282
|
+
if (token === "+") return power();
|
|
283
|
+
const name = token.toLowerCase();
|
|
284
|
+
if (name === "t") return (t) => t;
|
|
285
|
+
if (Object.hasOwn(CONSTANTS, name)) {
|
|
286
|
+
const value = CONSTANTS[name];
|
|
287
|
+
return () => value;
|
|
288
|
+
}
|
|
289
|
+
if (Object.hasOwn(FUNCTIONS, name)) {
|
|
290
|
+
const fn = FUNCTIONS[name];
|
|
291
|
+
take("(");
|
|
292
|
+
const args = [sum()];
|
|
293
|
+
while (peek() === ",") {
|
|
294
|
+
take(",");
|
|
295
|
+
args.push(sum());
|
|
296
|
+
}
|
|
297
|
+
take(")");
|
|
298
|
+
return (t) => fn(...args.map((arg) => arg(t)));
|
|
299
|
+
}
|
|
300
|
+
throw new Error(`expression "${source}": unknown name or symbol "${token}"`);
|
|
301
|
+
};
|
|
302
|
+
const power = () => {
|
|
303
|
+
const base = primary();
|
|
304
|
+
if (peek() === "^" || peek() === "**") {
|
|
305
|
+
take();
|
|
306
|
+
const exponent = power();
|
|
307
|
+
return (t) => base(t) ** exponent(t);
|
|
308
|
+
}
|
|
309
|
+
return base;
|
|
310
|
+
};
|
|
311
|
+
const product = () => {
|
|
312
|
+
let left = power();
|
|
313
|
+
while (peek() === "*" || peek() === "/") {
|
|
314
|
+
const op = take();
|
|
315
|
+
const right = power();
|
|
316
|
+
const previous = left;
|
|
317
|
+
left = op === "*" ? (t) => previous(t) * right(t) : (t) => previous(t) / right(t);
|
|
318
|
+
}
|
|
319
|
+
return left;
|
|
320
|
+
};
|
|
321
|
+
const sum = () => {
|
|
322
|
+
let left = product();
|
|
323
|
+
while (peek() === "+" || peek() === "-") {
|
|
324
|
+
const op = take();
|
|
325
|
+
const right = product();
|
|
326
|
+
const previous = left;
|
|
327
|
+
left = op === "+" ? (t) => previous(t) + right(t) : (t) => previous(t) - right(t);
|
|
328
|
+
}
|
|
329
|
+
return left;
|
|
330
|
+
};
|
|
331
|
+
const expression = sum();
|
|
332
|
+
if (index !== tokens.length) throw new Error(`expression "${source}": unexpected "${tokens[index]}"`);
|
|
333
|
+
return expression;
|
|
334
|
+
}
|
|
335
|
+
const CURVE_STEPS = 24;
|
|
336
|
+
function arcPoints(from, rx, ry, rotation, large, sweep, to) {
|
|
337
|
+
if (rx === 0 || ry === 0) return [to];
|
|
338
|
+
const phi = rotation * Math.PI / 180;
|
|
339
|
+
const cos = Math.cos(phi);
|
|
340
|
+
const sin = Math.sin(phi);
|
|
341
|
+
const dx = (from.x - to.x) / 2;
|
|
342
|
+
const dy = (from.y - to.y) / 2;
|
|
343
|
+
const x1 = cos * dx + sin * dy;
|
|
344
|
+
const y1 = -sin * dx + cos * dy;
|
|
345
|
+
let a = Math.abs(rx);
|
|
346
|
+
let b = Math.abs(ry);
|
|
347
|
+
const lambda = x1 * x1 / (a * a) + y1 * y1 / (b * b);
|
|
348
|
+
if (lambda > 1) {
|
|
349
|
+
a *= Math.sqrt(lambda);
|
|
350
|
+
b *= Math.sqrt(lambda);
|
|
351
|
+
}
|
|
352
|
+
const numerator = a * a * b * b - a * a * y1 * y1 - b * b * x1 * x1;
|
|
353
|
+
const factor = (large === sweep ? -1 : 1) * Math.sqrt(Math.max(0, numerator / (a * a * y1 * y1 + b * b * x1 * x1)));
|
|
354
|
+
const cx1 = factor * (a * y1) / b;
|
|
355
|
+
const cy1 = factor * -(b * x1) / a;
|
|
356
|
+
const cx = cos * cx1 - sin * cy1 + (from.x + to.x) / 2;
|
|
357
|
+
const cy = sin * cx1 + cos * cy1 + (from.y + to.y) / 2;
|
|
358
|
+
const angle = (ux, uy, vx, vy) => Math.atan2(ux * vy - uy * vx, ux * vx + uy * vy);
|
|
359
|
+
const start = angle(1, 0, (x1 - cx1) / a, (y1 - cy1) / b);
|
|
360
|
+
let delta = angle((x1 - cx1) / a, (y1 - cy1) / b, (-x1 - cx1) / a, (-y1 - cy1) / b);
|
|
361
|
+
if (!sweep && delta > 0) delta -= Math.PI * 2;
|
|
362
|
+
if (sweep && delta < 0) delta += Math.PI * 2;
|
|
363
|
+
const points = [];
|
|
364
|
+
for (let step = 1; step <= CURVE_STEPS; step += 1) {
|
|
365
|
+
const theta = start + delta * step / CURVE_STEPS;
|
|
366
|
+
points.push({
|
|
367
|
+
x: cos * a * Math.cos(theta) - sin * b * Math.sin(theta) + cx,
|
|
368
|
+
y: sin * a * Math.cos(theta) + cos * b * Math.sin(theta) + cy
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return points;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Sample an SVG path (M L H V C S Q T A Z, absolute and relative) into a polyline.
|
|
375
|
+
* @throws an Error for unsupported commands or malformed numbers.
|
|
376
|
+
*/
|
|
377
|
+
function samplePath(d) {
|
|
378
|
+
const tokens = d.match(/[a-z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/giu) ?? [];
|
|
379
|
+
if (tokens.join("").length < d.replace(/[\s,]/gu, "").length) throw new Error("path contains unsupported characters");
|
|
380
|
+
const points = [];
|
|
381
|
+
let index = 0;
|
|
382
|
+
let command = "";
|
|
383
|
+
let current = {
|
|
384
|
+
x: 0,
|
|
385
|
+
y: 0
|
|
386
|
+
};
|
|
387
|
+
let start = {
|
|
388
|
+
x: 0,
|
|
389
|
+
y: 0
|
|
390
|
+
};
|
|
391
|
+
let control = null;
|
|
392
|
+
const number = () => {
|
|
393
|
+
const token = tokens[index];
|
|
394
|
+
if (token === void 0 || /^[a-z]$/iu.test(token)) throw new Error(`path command ${command} is missing a number`);
|
|
395
|
+
index += 1;
|
|
396
|
+
return Number(token);
|
|
397
|
+
};
|
|
398
|
+
const flag = () => number() !== 0;
|
|
399
|
+
while (index < tokens.length) {
|
|
400
|
+
if (/^[a-z]$/iu.test(tokens[index])) command = tokens[index++];
|
|
401
|
+
else if (command === "") throw new Error("path must start with a command");
|
|
402
|
+
const relative = command === command.toLowerCase();
|
|
403
|
+
const base = relative ? current : {
|
|
404
|
+
x: 0,
|
|
405
|
+
y: 0
|
|
406
|
+
};
|
|
407
|
+
const at = (x, y) => ({
|
|
408
|
+
x: base.x + x,
|
|
409
|
+
y: base.y + y
|
|
410
|
+
});
|
|
411
|
+
switch (command.toUpperCase()) {
|
|
412
|
+
case "M":
|
|
413
|
+
current = at(number(), number());
|
|
414
|
+
start = current;
|
|
415
|
+
points.push(current);
|
|
416
|
+
control = null;
|
|
417
|
+
command = relative ? "l" : "L";
|
|
418
|
+
break;
|
|
419
|
+
case "L":
|
|
420
|
+
current = at(number(), number());
|
|
421
|
+
points.push(current);
|
|
422
|
+
control = null;
|
|
423
|
+
break;
|
|
424
|
+
case "H":
|
|
425
|
+
current = {
|
|
426
|
+
x: (relative ? current.x : 0) + number(),
|
|
427
|
+
y: current.y
|
|
428
|
+
};
|
|
429
|
+
points.push(current);
|
|
430
|
+
control = null;
|
|
431
|
+
break;
|
|
432
|
+
case "V":
|
|
433
|
+
current = {
|
|
434
|
+
x: current.x,
|
|
435
|
+
y: (relative ? current.y : 0) + number()
|
|
436
|
+
};
|
|
437
|
+
points.push(current);
|
|
438
|
+
control = null;
|
|
439
|
+
break;
|
|
440
|
+
case "Z":
|
|
441
|
+
current = start;
|
|
442
|
+
points.push(current);
|
|
443
|
+
control = null;
|
|
444
|
+
break;
|
|
445
|
+
case "C":
|
|
446
|
+
case "S": {
|
|
447
|
+
const first = command.toUpperCase() === "C" ? at(number(), number()) : control === null ? current : {
|
|
448
|
+
x: 2 * current.x - control.x,
|
|
449
|
+
y: 2 * current.y - control.y
|
|
450
|
+
};
|
|
451
|
+
const second = at(number(), number());
|
|
452
|
+
const end = at(number(), number());
|
|
453
|
+
for (let step = 1; step <= CURVE_STEPS; step += 1) {
|
|
454
|
+
const s = step / CURVE_STEPS;
|
|
455
|
+
const r = 1 - s;
|
|
456
|
+
points.push({
|
|
457
|
+
x: r ** 3 * current.x + 3 * r * r * s * first.x + 3 * r * s * s * second.x + s ** 3 * end.x,
|
|
458
|
+
y: r ** 3 * current.y + 3 * r * r * s * first.y + 3 * r * s * s * second.y + s ** 3 * end.y
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
control = second;
|
|
462
|
+
current = end;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
case "Q":
|
|
466
|
+
case "T": {
|
|
467
|
+
const middle = command.toUpperCase() === "Q" ? at(number(), number()) : control === null ? current : {
|
|
468
|
+
x: 2 * current.x - control.x,
|
|
469
|
+
y: 2 * current.y - control.y
|
|
470
|
+
};
|
|
471
|
+
const end = at(number(), number());
|
|
472
|
+
for (let step = 1; step <= CURVE_STEPS; step += 1) {
|
|
473
|
+
const s = step / CURVE_STEPS;
|
|
474
|
+
const r = 1 - s;
|
|
475
|
+
points.push({
|
|
476
|
+
x: r * r * current.x + 2 * r * s * middle.x + s * s * end.x,
|
|
477
|
+
y: r * r * current.y + 2 * r * s * middle.y + s * s * end.y
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
control = middle;
|
|
481
|
+
current = end;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
case "A": {
|
|
485
|
+
const rx = number();
|
|
486
|
+
const ry = number();
|
|
487
|
+
const rotation = number();
|
|
488
|
+
const large = flag();
|
|
489
|
+
const sweep = flag();
|
|
490
|
+
const end = at(number(), number());
|
|
491
|
+
points.push(...arcPoints(current, rx, ry, rotation, large, sweep, end));
|
|
492
|
+
current = end;
|
|
493
|
+
control = null;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
default: throw new Error(`unsupported path command ${command}`);
|
|
497
|
+
}
|
|
498
|
+
if (command.toUpperCase() === "Z" && index < tokens.length && !/^[a-z]$/iu.test(tokens[index])) throw new Error("numbers after Z need a command");
|
|
499
|
+
}
|
|
500
|
+
if (points.length < 2) throw new Error("path needs at least two points");
|
|
501
|
+
if (points.some((point) => !Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new Error("path has non-finite coordinates");
|
|
502
|
+
const lengths = [0];
|
|
503
|
+
for (let i = 1; i < points.length; i += 1) lengths.push(lengths[i - 1] + Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y));
|
|
504
|
+
return {
|
|
505
|
+
points,
|
|
506
|
+
lengths,
|
|
507
|
+
total: lengths.at(-1)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
/** Position and tangent angle (degrees) at a fraction of a sampled path's length. */
|
|
511
|
+
function pointAlong(path, fraction) {
|
|
512
|
+
const target = Math.min(1, Math.max(0, fraction)) * path.total;
|
|
513
|
+
let i = 1;
|
|
514
|
+
while (i < path.points.length - 1 && path.lengths[i] < target) i += 1;
|
|
515
|
+
const a = path.points[i - 1];
|
|
516
|
+
const b = path.points[i];
|
|
517
|
+
const span = path.lengths[i] - path.lengths[i - 1];
|
|
518
|
+
const local = span === 0 ? 0 : (target - path.lengths[i - 1]) / span;
|
|
519
|
+
return {
|
|
520
|
+
x: a.x + (b.x - a.x) * local,
|
|
521
|
+
y: a.y + (b.y - a.y) * local,
|
|
522
|
+
angle: Math.atan2(b.y - a.y, b.x - a.x) * 180 / Math.PI
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
const BASE = {
|
|
526
|
+
dx: 0,
|
|
527
|
+
dy: 0,
|
|
528
|
+
scale: 1,
|
|
529
|
+
rotate: 0,
|
|
530
|
+
opacity: 1,
|
|
531
|
+
clip: 0,
|
|
532
|
+
glow: 0,
|
|
533
|
+
slideX: 0,
|
|
534
|
+
slideY: 0
|
|
535
|
+
};
|
|
536
|
+
function ease(kind, p) {
|
|
537
|
+
if (kind === "ease-in") return p ** 3;
|
|
538
|
+
if (kind === "ease-out") return 1 - (1 - p) ** 3;
|
|
539
|
+
if (kind === "ease-in-out") return p < .5 ? 4 * p ** 3 : 1 - (-2 * p + 2) ** 3 / 2;
|
|
540
|
+
return p;
|
|
541
|
+
}
|
|
542
|
+
const lerp = (a, b, p) => a + (b - a) * p;
|
|
543
|
+
function direction(value) {
|
|
544
|
+
if (value === "left") return {
|
|
545
|
+
x: -1,
|
|
546
|
+
y: 0
|
|
547
|
+
};
|
|
548
|
+
if (value === "right") return {
|
|
549
|
+
x: 1,
|
|
550
|
+
y: 0
|
|
551
|
+
};
|
|
552
|
+
if (value === "up") return {
|
|
553
|
+
x: 0,
|
|
554
|
+
y: -1
|
|
555
|
+
};
|
|
556
|
+
return {
|
|
557
|
+
x: 0,
|
|
558
|
+
y: 1
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
function valueAt(segments, from, base, t) {
|
|
562
|
+
let active;
|
|
563
|
+
for (const segment of segments) {
|
|
564
|
+
if (segment.start > t) break;
|
|
565
|
+
active = segment;
|
|
566
|
+
}
|
|
567
|
+
if (active === void 0) return segments[0]?.before ?? base;
|
|
568
|
+
return active.at(t, from.get(active) ?? base);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Validate and compile a timeline against the current board.
|
|
572
|
+
* @param spec - parsed timeline spec.
|
|
573
|
+
* @param targets - current board element envelopes.
|
|
574
|
+
* @returns the compiled timeline.
|
|
575
|
+
* @throws an Error describing the first invalid track.
|
|
576
|
+
*/
|
|
577
|
+
function compileTimeline(spec, targets) {
|
|
578
|
+
const byId = new Map(targets.map((target) => [target.id, target]));
|
|
579
|
+
const pending = /* @__PURE__ */ new Map();
|
|
580
|
+
const clipSides = /* @__PURE__ */ new Map();
|
|
581
|
+
spec.tracks.forEach((track, index) => {
|
|
582
|
+
const label = `track ${index + 1} (${track.verb} ${track.target})`;
|
|
583
|
+
const target = byId.get(track.target);
|
|
584
|
+
if (target === void 0) throw new Error(`${label}: no board element with id "${track.target}"`);
|
|
585
|
+
const cx = target.x + target.w / 2;
|
|
586
|
+
const cy = target.y + target.h / 2;
|
|
587
|
+
const start = track.startMs ?? 0;
|
|
588
|
+
const end = track.endMs ?? spec.durationMs;
|
|
589
|
+
if (track.verb !== "keyframes" && (end <= start || end > spec.durationMs)) throw new Error(`${label}: needs 0 <= startMs < endMs <= durationMs`);
|
|
590
|
+
const easing = track.easing ?? (track.verb === "follow" || track.verb === "parametric" ? "linear" : "ease-in-out");
|
|
591
|
+
const progress = (t) => ease(easing, Math.min(1, Math.max(0, (t - start) / (end - start))));
|
|
592
|
+
const props = pending.get(track.target) ?? /* @__PURE__ */ new Map();
|
|
593
|
+
pending.set(track.target, props);
|
|
594
|
+
const add = (prop, segment) => {
|
|
595
|
+
props.set(prop, [...props.get(prop) ?? [], segment]);
|
|
596
|
+
};
|
|
597
|
+
const require = (value, name) => {
|
|
598
|
+
if (value === void 0) throw new Error(`${label}: ${track.verb} requires ${name}`);
|
|
599
|
+
return value;
|
|
600
|
+
};
|
|
601
|
+
switch (track.verb) {
|
|
602
|
+
case "appear":
|
|
603
|
+
case "disappear": {
|
|
604
|
+
const showing = track.verb === "appear";
|
|
605
|
+
add("opacity", {
|
|
606
|
+
start,
|
|
607
|
+
end,
|
|
608
|
+
...showing ? { before: 0 } : {},
|
|
609
|
+
at: (t, from) => showing ? progress(t) : lerp(from, 0, progress(t))
|
|
610
|
+
});
|
|
611
|
+
if (track.direction !== void 0) {
|
|
612
|
+
const unit = direction(track.direction);
|
|
613
|
+
add("slideX", {
|
|
614
|
+
start,
|
|
615
|
+
end,
|
|
616
|
+
at: (t) => (showing ? -unit.x * (1 - progress(t)) : unit.x * progress(t)) * SLIDE_DISTANCE
|
|
617
|
+
});
|
|
618
|
+
add("slideY", {
|
|
619
|
+
start,
|
|
620
|
+
end,
|
|
621
|
+
at: (t) => (showing ? -unit.y * (1 - progress(t)) : unit.y * progress(t)) * SLIDE_DISTANCE
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
case "move": {
|
|
627
|
+
const to = require(track.to, "to");
|
|
628
|
+
add("dx", {
|
|
629
|
+
start,
|
|
630
|
+
end,
|
|
631
|
+
at: (t, from) => lerp(from, to.x - cx, progress(t))
|
|
632
|
+
});
|
|
633
|
+
add("dy", {
|
|
634
|
+
start,
|
|
635
|
+
end,
|
|
636
|
+
at: (t, from) => lerp(from, to.y - cy, progress(t))
|
|
637
|
+
});
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
case "scale": {
|
|
641
|
+
const factor = require(track.scale, "scale");
|
|
642
|
+
add("scale", {
|
|
643
|
+
start,
|
|
644
|
+
end,
|
|
645
|
+
at: (t, from) => lerp(from, factor, progress(t))
|
|
646
|
+
});
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
case "rotate": {
|
|
650
|
+
const degrees = require(track.degrees, "degrees");
|
|
651
|
+
add("rotate", {
|
|
652
|
+
start,
|
|
653
|
+
end,
|
|
654
|
+
at: (t, from) => from + degrees * progress(t)
|
|
655
|
+
});
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
case "highlight":
|
|
659
|
+
add("glow", {
|
|
660
|
+
start,
|
|
661
|
+
end,
|
|
662
|
+
at: (t) => t >= end ? 0 : Math.sin(Math.PI * Math.min(1, Math.max(0, (t - start) / (end - start))))
|
|
663
|
+
});
|
|
664
|
+
break;
|
|
665
|
+
case "reveal": {
|
|
666
|
+
const side = track.direction ?? "right";
|
|
667
|
+
clipSides.set(track.target, side === "right" ? "right" : side === "left" ? "left" : side === "up" ? "top" : "bottom");
|
|
668
|
+
add("clip", {
|
|
669
|
+
start,
|
|
670
|
+
end,
|
|
671
|
+
before: 100,
|
|
672
|
+
at: (t) => 100 * (1 - progress(t))
|
|
673
|
+
});
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
case "follow": {
|
|
677
|
+
let path;
|
|
678
|
+
try {
|
|
679
|
+
path = samplePath(require(track.path, "path"));
|
|
680
|
+
} catch (error) {
|
|
681
|
+
throw new Error(`${label}: ${error instanceof Error ? error.message : String(error)}`);
|
|
682
|
+
}
|
|
683
|
+
add("dx", {
|
|
684
|
+
start,
|
|
685
|
+
end,
|
|
686
|
+
at: (t) => pointAlong(path, progress(t)).x - cx
|
|
687
|
+
});
|
|
688
|
+
add("dy", {
|
|
689
|
+
start,
|
|
690
|
+
end,
|
|
691
|
+
at: (t) => pointAlong(path, progress(t)).y - cy
|
|
692
|
+
});
|
|
693
|
+
if (track.orient === true) add("rotate", {
|
|
694
|
+
start,
|
|
695
|
+
end,
|
|
696
|
+
at: (t) => pointAlong(path, progress(t)).angle
|
|
697
|
+
});
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
case "parametric": {
|
|
701
|
+
let x;
|
|
702
|
+
let y;
|
|
703
|
+
try {
|
|
704
|
+
x = compileExpression(require(track.x, "x"));
|
|
705
|
+
y = compileExpression(require(track.y, "y"));
|
|
706
|
+
} catch (error) {
|
|
707
|
+
throw new Error(`${label}: ${error instanceof Error ? error.message : String(error)}`);
|
|
708
|
+
}
|
|
709
|
+
const [t0, t1] = track.t ?? [0, 1];
|
|
710
|
+
const param = (t) => lerp(t0, t1, Math.min(1, Math.max(0, (t - start) / (end - start))));
|
|
711
|
+
for (let step = 0; step <= 16; step += 1) {
|
|
712
|
+
const value = lerp(t0, t1, step / 16);
|
|
713
|
+
if (!Number.isFinite(x(value)) || !Number.isFinite(y(value))) throw new Error(`${label}: x or y is not finite at t = ${value}`);
|
|
714
|
+
}
|
|
715
|
+
add("dx", {
|
|
716
|
+
start,
|
|
717
|
+
end,
|
|
718
|
+
at: (t) => x(param(t)) - cx
|
|
719
|
+
});
|
|
720
|
+
add("dy", {
|
|
721
|
+
start,
|
|
722
|
+
end,
|
|
723
|
+
at: (t) => y(param(t)) - cy
|
|
724
|
+
});
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case "keyframes": {
|
|
728
|
+
const frames = [...require(track.frames, "frames")].sort((a, b) => a.atMs - b.atMs);
|
|
729
|
+
if (frames.some((frame) => frame.atMs > spec.durationMs)) throw new Error(`${label}: frame atMs exceeds durationMs`);
|
|
730
|
+
const channels = [
|
|
731
|
+
["dx", (frame) => frame.x === void 0 ? void 0 : frame.x - cx],
|
|
732
|
+
["dy", (frame) => frame.y === void 0 ? void 0 : frame.y - cy],
|
|
733
|
+
["opacity", (frame) => frame.opacity],
|
|
734
|
+
["scale", (frame) => frame.scale],
|
|
735
|
+
["rotate", (frame) => frame.rotate]
|
|
736
|
+
];
|
|
737
|
+
for (const [prop, read] of channels) {
|
|
738
|
+
const stops = frames.flatMap((frame) => {
|
|
739
|
+
const value = read(frame);
|
|
740
|
+
return value === void 0 ? [] : [{
|
|
741
|
+
at: frame.atMs,
|
|
742
|
+
value
|
|
743
|
+
}];
|
|
744
|
+
});
|
|
745
|
+
if (stops.length === 0) continue;
|
|
746
|
+
const first = stops[0];
|
|
747
|
+
const last = stops.at(-1);
|
|
748
|
+
add(prop, {
|
|
749
|
+
start: first.at,
|
|
750
|
+
end: Math.max(first.at + 1, last.at),
|
|
751
|
+
at: (t) => {
|
|
752
|
+
if (t >= last.at) return last.value;
|
|
753
|
+
let i = 1;
|
|
754
|
+
while (i < stops.length - 1 && stops[i].at <= t) i += 1;
|
|
755
|
+
const a = stops[i - 1];
|
|
756
|
+
const b = stops[i];
|
|
757
|
+
return lerp(a.value, b.value, ease(easing, b.at === a.at ? 1 : Math.min(1, Math.max(0, (t - a.at) / (b.at - a.at)))));
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
default: return track.verb;
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
const elements = /* @__PURE__ */ new Map();
|
|
767
|
+
for (const [id, props] of pending) {
|
|
768
|
+
const segments = /* @__PURE__ */ new Map();
|
|
769
|
+
const from = /* @__PURE__ */ new Map();
|
|
770
|
+
for (const [prop, list] of props) {
|
|
771
|
+
const sorted = [...list].sort((a, b) => a.start - b.start);
|
|
772
|
+
sorted.forEach((segment, index) => {
|
|
773
|
+
from.set(segment, valueAt(sorted.slice(0, index), from, BASE[prop], segment.start));
|
|
774
|
+
});
|
|
775
|
+
segments.set(prop, sorted);
|
|
776
|
+
}
|
|
777
|
+
elements.set(id, {
|
|
778
|
+
segments,
|
|
779
|
+
from,
|
|
780
|
+
clipSide: clipSides.get(id) ?? "right"
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
return {
|
|
784
|
+
durationMs: spec.durationMs,
|
|
785
|
+
loop: spec.loop ?? false,
|
|
786
|
+
beats: [...spec.beats ?? []].sort((a, b) => a.atMs - b.atMs),
|
|
787
|
+
elements
|
|
788
|
+
};
|
|
789
|
+
}
|
|
155
790
|
/** Maximum combined UTF-8 element-content bytes retained on one board. */
|
|
156
791
|
const BOARD_MAX_CONTENT_BYTES = 5e5;
|
|
157
792
|
/** Element kinds the blackboard renders safely on the chalk canvas. */
|
|
@@ -398,7 +1033,9 @@ const boardSnapshotSchema = z.object({
|
|
|
398
1033
|
version: z.literal(4),
|
|
399
1034
|
revision: z.number().int().nonnegative(),
|
|
400
1035
|
elements: z.array(boardElementStateSchema).max(50),
|
|
401
|
-
invalid: z.number().int().nonnegative()
|
|
1036
|
+
invalid: z.number().int().nonnegative(),
|
|
1037
|
+
/** Latest animation timeline; absent in snapshots from earlier versions. */
|
|
1038
|
+
timeline: boardTimelineSchema.nullable().optional()
|
|
402
1039
|
}).strict();
|
|
403
1040
|
Object.freeze({
|
|
404
1041
|
version: 4,
|
|
@@ -412,7 +1049,9 @@ Object.freeze({
|
|
|
412
1049
|
const boardCaptureJobSchema = z.object({
|
|
413
1050
|
id: z.string().min(1),
|
|
414
1051
|
sessionId: z.string().min(1),
|
|
415
|
-
board: boardSnapshotSchema
|
|
1052
|
+
board: boardSnapshotSchema,
|
|
1053
|
+
/** Render the board's timeline frozen at this time instead of its resting state. */
|
|
1054
|
+
atMs: z.number().int().min(0).max(ANIMATION_MAX_DURATION_MS).optional()
|
|
416
1055
|
}).strict();
|
|
417
1056
|
//#endregion
|
|
418
1057
|
//#region lib/types/learning-example.js
|
|
@@ -605,6 +1244,14 @@ const DEFAULT_WHEEL_SLOTS = [
|
|
|
605
1244
|
null,
|
|
606
1245
|
null
|
|
607
1246
|
];
|
|
1247
|
+
englishLearningQuestion("Underlying logic"), englishLearningQuestion("Quantitative analysis (blackboard)"), englishLearningQuestion("Summary study cards", "Organize the content around this quote.");
|
|
1248
|
+
function englishLearningQuestion(stage, question = "") {
|
|
1249
|
+
return `[Learning stage: ${stage}]\n${{
|
|
1250
|
+
"Underlying logic": "Explain the underlying logic of the current topic: start with definitions and conditions, then explain the causal mechanism and why it works. Distinguish source evidence, general knowledge, and assumptions. Cover this stage only; do not advance automatically.",
|
|
1251
|
+
"Quantitative analysis (blackboard)": "Analyze the current topic quantitatively and use blackboard_apply to organize the blackboard: specify variables, units, assumptions, derivation steps, and one verifiable worked example. Mark example values as hypothetical; do not invent source data. If quantitative analysis is unsuitable or information is insufficient, explain why. Cover this stage only; do not advance automatically.",
|
|
1252
|
+
"Summary study cards": "First check and correct the conclusions and existing blackboard in this Topic: review definitions, conditions, derivations, numbers, and contradictions. Do not treat earlier model responses as evidence; consult available sources if needed. Correct mistakes and mark unverifiable claims as unverified or omit them; do not invent sources or locations. Then call learning_cards to create 1–6 study cards, each with a key conclusion, a concrete example, an optional self-test question, and a reference answer. Check that these fields agree, including corrections in examples and answers. Preserve real source locations for source-dependent facts and distinguish evidence from general knowledge. Briefly report corrections and remaining unverified claims; do not schedule reviews."
|
|
1253
|
+
}[stage]}${question.trim() === "" ? "" : `\n\nMy question: ${question.trim()}`}`;
|
|
1254
|
+
}
|
|
608
1255
|
//#endregion
|
|
609
1256
|
//#region lib/types/tool-outcome-contract.js
|
|
610
1257
|
/** Recognized question outcomes shared by Host and Client without importing either service face. */
|
|
@@ -712,7 +1359,13 @@ const citeCiterSettingsSchema = z.object({
|
|
|
712
1359
|
"workspace-write",
|
|
713
1360
|
"danger-full-access"
|
|
714
1361
|
]).optional(),
|
|
715
|
-
learningRoute: z.boolean().optional()
|
|
1362
|
+
learningRoute: z.boolean().optional(),
|
|
1363
|
+
autoReadSource: z.boolean().optional(),
|
|
1364
|
+
workspaceChanges: z.enum([
|
|
1365
|
+
"off",
|
|
1366
|
+
"summary",
|
|
1367
|
+
"diff"
|
|
1368
|
+
]).optional()
|
|
716
1369
|
}).strict();
|
|
717
1370
|
/** Settings used before an optional DSH settings provider becomes available. */
|
|
718
1371
|
const DEFAULT_CITECITER_SETTINGS = Object.freeze({
|
|
@@ -724,6 +1377,8 @@ const DEFAULT_CITECITER_SETTINGS = Object.freeze({
|
|
|
724
1377
|
activeRecall: false,
|
|
725
1378
|
defaultPermission: "read-only",
|
|
726
1379
|
learningRoute: false,
|
|
1380
|
+
autoReadSource: false,
|
|
1381
|
+
workspaceChanges: "summary",
|
|
727
1382
|
updateNotifications: true,
|
|
728
1383
|
selectionToolbar: true,
|
|
729
1384
|
actionDelivery: "send",
|
|
@@ -1000,6 +1655,7 @@ const topicMessageSchema = z.discriminatedUnion("role", [
|
|
|
1000
1655
|
...topicMessageIdentitySchema,
|
|
1001
1656
|
role: z.literal("assistant"),
|
|
1002
1657
|
renderKey: z.string().optional(),
|
|
1658
|
+
attachments: z.array(messageAttachmentSchema).optional(),
|
|
1003
1659
|
text: z.string(),
|
|
1004
1660
|
reasoning: z.string().nullable(),
|
|
1005
1661
|
streaming: z.boolean()
|
|
@@ -1008,6 +1664,12 @@ const topicMessageSchema = z.discriminatedUnion("role", [
|
|
|
1008
1664
|
...topicMessageIdentitySchema,
|
|
1009
1665
|
role: z.literal("context"),
|
|
1010
1666
|
label: z.string().min(1),
|
|
1667
|
+
/** DSH context role: material recalled from another session, or any other injected context. */
|
|
1668
|
+
contextRole: z.enum(["inject", "recall"]).optional(),
|
|
1669
|
+
/** Producer named by the durable source: a plugin package, a source kind, or Citer's own form. */
|
|
1670
|
+
producer: z.string().nullable().optional(),
|
|
1671
|
+
/** One-line account a `notice` records for its collapsed row. */
|
|
1672
|
+
summary: z.string().optional(),
|
|
1011
1673
|
text: z.string()
|
|
1012
1674
|
}).strict(),
|
|
1013
1675
|
z.object({
|
|
@@ -1018,6 +1680,10 @@ const topicMessageSchema = z.discriminatedUnion("role", [
|
|
|
1018
1680
|
name: z.string().min(1),
|
|
1019
1681
|
arguments: z.string(),
|
|
1020
1682
|
result: z.string().nullable(),
|
|
1683
|
+
/** Structured result metadata the tool recorded beside its model-facing text (read windows, search hits, exit codes). */
|
|
1684
|
+
meta: z.unknown().optional(),
|
|
1685
|
+
/** The run_code call that dispatched this one, when it was a programmatic child call. */
|
|
1686
|
+
parentCallId: z.string().optional(),
|
|
1021
1687
|
isError: z.boolean(),
|
|
1022
1688
|
errorCode: z.enum(QUESTION_TOOL_OUTCOME_CODES).optional(),
|
|
1023
1689
|
approvalOutcome: z.literal("rejected").optional(),
|
|
@@ -1027,6 +1693,7 @@ const topicMessageSchema = z.discriminatedUnion("role", [
|
|
|
1027
1693
|
z.object({
|
|
1028
1694
|
...topicMessageIdentitySchema,
|
|
1029
1695
|
role: z.literal("error"),
|
|
1696
|
+
turn: z.number().int().nonnegative().optional(),
|
|
1030
1697
|
text: z.string(),
|
|
1031
1698
|
bodyRetained: z.boolean(),
|
|
1032
1699
|
attempt: z.number().int().positive(),
|
|
@@ -1058,8 +1725,17 @@ const pendingQuestionSchema = z.object({
|
|
|
1058
1725
|
timed: z.boolean().optional(),
|
|
1059
1726
|
blocking: z.boolean().optional()
|
|
1060
1727
|
}).strict();
|
|
1728
|
+
/** Topic-owned usage totals; context occupancy refers to the latest reported request. */
|
|
1729
|
+
const topicUsageSchema = z.object({
|
|
1730
|
+
inputTokens: z.number().int().nonnegative(),
|
|
1731
|
+
outputTokens: z.number().int().nonnegative(),
|
|
1732
|
+
cachedInputTokens: z.number().int().nonnegative(),
|
|
1733
|
+
lastContextTokens: z.number().int().nonnegative().optional(),
|
|
1734
|
+
contextWindow: z.number().int().positive().optional()
|
|
1735
|
+
}).strict();
|
|
1061
1736
|
const topicSnapshotSchema = z.object({
|
|
1062
1737
|
captureId: z.string().optional(),
|
|
1738
|
+
usage: topicUsageSchema.optional(),
|
|
1063
1739
|
documentTitle: z.string().optional(),
|
|
1064
1740
|
topic: topicSummarySchema,
|
|
1065
1741
|
messages: z.array(topicMessageSchema),
|
|
@@ -1085,7 +1761,7 @@ const providerOptionSchema = z.object({
|
|
|
1085
1761
|
const draftQuestionSchema = z.string().trim().max(12e3);
|
|
1086
1762
|
const questionSchema = z.string().trim().min(1).max(12e3);
|
|
1087
1763
|
const topicSessionIdSchema = z.string().min(1);
|
|
1088
|
-
/**
|
|
1764
|
+
/** Tool-result claim of the whole card or a selected part of it; the Host verifies it against the committed `tool/result`. */
|
|
1089
1765
|
const toolEvidenceClaimSchema = z.object({
|
|
1090
1766
|
sourceSessionId: z.string().min(1),
|
|
1091
1767
|
callId: z.string().min(1),
|
|
@@ -1602,4 +2278,4 @@ function waitForCaller(operation, signal) {
|
|
|
1602
2278
|
});
|
|
1603
2279
|
}
|
|
1604
2280
|
//#endregion
|
|
1605
|
-
export { applyBoardOps as A, questionReplyText as C, learningCardsInputSchema as D, LEARNING_CARD_FIELD_DESCRIPTIONS as E,
|
|
2281
|
+
export { applyBoardOps as A, draftFileSchema as B, questionReplyText as C, learningCardsInputSchema as D, LEARNING_CARD_FIELD_DESCRIPTIONS as E, EMPTY_QUESTION_DRAFT_STATE as F, subtractSubmitted as H, questionDraftKeySchema as I, questionDraftRecordSchema as L, ANIMATION_MAX_DURATION_MS as M, animationSpecSchema as N, LEARNING_EXAMPLE_PARAMETER as O, compileTimeline as P, DRAFT_CHUNK_BYTES as R, topicSummarySchema as S, DEFAULT_WHEEL_SLOTS as T, draftStateSchema as V, readCiteCiterSettings as _, DEFAULT_CITECITER_SETTINGS as a, topicMetadataSchema as b, citationDraftSchema as c, citeCiterRequestSchema as d, citeCiterResponseSchema as f, parseTopicMetadataFile as g, documentSummarySchema as h, CITECITER_SETTINGS_NAMESPACE as i, boardBatchSchema as j, EMPTY_BOARD_STATE as k, citationRecordSchema as l, documentEvidenceClaimSchema as m, updateCheckErrorCodeSchema as n, TUTOR_SECTION_NAME as o, documentContentSchema as p, updateCheckResponseSchema as r, canonicalCitationIdentity as s, UpdateChecker as t, citationSelectionClaimSchema as u, toolEvidenceClaimSchema as v, readQuestionReply as w, topicSnapshotSchema as x, topicDisplayTitle as y, EMPTY_DRAFT_STATE as z };
|