@bendyline/gezel 1.1.0 → 1.1.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/checks/index.js +8 -3
- package/dist/{index-C7jST61L.d.ts → index-BagGCdN3.d.ts} +1819 -1206
- package/dist/index.d.ts +60 -9
- package/dist/index.js +13219 -11822
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/index.js +780 -718
- package/dist/native/index.d.ts +1 -1
- package/dist/native/index.js +1 -1
- package/dist/paths.js +64 -2
- package/dist/{report-action-Dn_QrwwK.d.ts → report-action-BCqCZQiu.d.ts} +72 -0
- package/dist/schemas/index.d.ts +3 -3
- package/dist/schemas/index.js +6857 -6626
- package/package.json +2 -2
package/dist/markdown/index.js
CHANGED
|
@@ -2059,7 +2059,7 @@ function defaultStepIdForName(name) {
|
|
|
2059
2059
|
}
|
|
2060
2060
|
|
|
2061
2061
|
// src/schemas/gezel.ts
|
|
2062
|
-
import { z as
|
|
2062
|
+
import { z as z20 } from "zod";
|
|
2063
2063
|
|
|
2064
2064
|
// src/poppetje/schema.ts
|
|
2065
2065
|
import { z as z7 } from "zod";
|
|
@@ -2141,7 +2141,20 @@ var FIGURE_SCALES = {
|
|
|
2141
2141
|
var FIGURE_SCALE_KEYS = Object.keys(FIGURE_SCALES);
|
|
2142
2142
|
var HAT_OPTIONS = ["cap", "beanie", "kerchief", "straw", "newsboy", "hood"];
|
|
2143
2143
|
var DRESS_OPTIONS = ["scarf", "apron", "collar", "turtleneck"];
|
|
2144
|
-
var HAIR_SHAPES = [
|
|
2144
|
+
var HAIR_SHAPES = [
|
|
2145
|
+
"halo",
|
|
2146
|
+
"short",
|
|
2147
|
+
"bob",
|
|
2148
|
+
"medium",
|
|
2149
|
+
"long",
|
|
2150
|
+
"extra-long",
|
|
2151
|
+
"bun",
|
|
2152
|
+
"braids",
|
|
2153
|
+
"shaved",
|
|
2154
|
+
"bald"
|
|
2155
|
+
];
|
|
2156
|
+
var BANGS_OPTIONS = ["straight", "side-swept", "curtain", "short"];
|
|
2157
|
+
var HAIR_PART_OPTIONS = ["none", "center", "left", "right"];
|
|
2145
2158
|
var ACCESSORY_OPTIONS = [
|
|
2146
2159
|
"glasses",
|
|
2147
2160
|
"sunglasses",
|
|
@@ -2222,6 +2235,9 @@ var PoppetjeSchema = z7.preprocess(
|
|
|
2222
2235
|
skin2: z7.string(),
|
|
2223
2236
|
hair: z7.string(),
|
|
2224
2237
|
hairShape: z7.enum(HAIR_SHAPES),
|
|
2238
|
+
/** Optional styling choices; older files retain an open, unparted hairline. */
|
|
2239
|
+
bangs: z7.enum(BANGS_OPTIONS).nullable().optional().default(null),
|
|
2240
|
+
hairPart: z7.enum(HAIR_PART_OPTIONS).optional().default("none"),
|
|
2225
2241
|
/** Replaces hair when set; 'hood' renders at body level. */
|
|
2226
2242
|
hat: z7.enum(HAT_OPTIONS).nullable().optional().default(null),
|
|
2227
2243
|
/** Body overlay; null for an unadorned shirt. */
|
|
@@ -2398,73 +2414,119 @@ var GezelGrowthSummarySchema = z12.object({
|
|
|
2398
2414
|
});
|
|
2399
2415
|
|
|
2400
2416
|
// src/schemas/model-tuning.ts
|
|
2417
|
+
import { z as z14 } from "zod";
|
|
2418
|
+
|
|
2419
|
+
// src/schemas/llama-cpp-config.ts
|
|
2401
2420
|
import { z as z13 } from "zod";
|
|
2402
|
-
var
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2421
|
+
var LlamaCppLoadModeSchema = z13.enum([
|
|
2422
|
+
"auto",
|
|
2423
|
+
"none",
|
|
2424
|
+
"mmap",
|
|
2425
|
+
"mlock",
|
|
2426
|
+
"mmap+mlock",
|
|
2427
|
+
"dio"
|
|
2428
|
+
]);
|
|
2429
|
+
var LlamaCppLazyModeSchema = z13.enum(["on", "auto", "off"]);
|
|
2430
|
+
var LlamaCppV4ConfigSchema = z13.object({
|
|
2431
|
+
/**
|
|
2432
|
+
* Model file loading policy (`--load-mode`). Unset leaves the server on
|
|
2433
|
+
* Auto; the legacy `llamaCppMlock: true` setting maps to `mlock`.
|
|
2434
|
+
*/
|
|
2435
|
+
llamaCppLoadMode: LlamaCppLoadModeSchema.optional(),
|
|
2436
|
+
/** On-demand loading for large row-addressable tensors (`--lazy-mode`). */
|
|
2437
|
+
llamaCppLazyMode: LlamaCppLazyModeSchema.optional(),
|
|
2438
|
+
/** Preserve and replay private reasoning across assistant history. */
|
|
2439
|
+
llamaCppReasoningPreserve: z13.boolean().optional(),
|
|
2440
|
+
/**
|
|
2441
|
+
* Keep dense FFN weights from the first N blocks in RAM. Unset delegates
|
|
2442
|
+
* to the hardware planner; zero explicitly disables automatic planning.
|
|
2443
|
+
*/
|
|
2444
|
+
llamaCppNCpuFfn: z13.number().int().min(0).optional()
|
|
2445
|
+
});
|
|
2446
|
+
var LlamaCppV4ConfigResetSchema = z13.object({
|
|
2447
|
+
llamaCppMlock: z13.boolean().nullable().optional(),
|
|
2448
|
+
llamaCppLoadMode: LlamaCppLoadModeSchema.nullable().optional(),
|
|
2449
|
+
llamaCppLazyMode: LlamaCppLazyModeSchema.nullable().optional(),
|
|
2450
|
+
llamaCppReasoningPreserve: z13.boolean().nullable().optional(),
|
|
2451
|
+
llamaCppNCpuFfn: z13.number().int().min(0).nullable().optional()
|
|
2452
|
+
});
|
|
2453
|
+
|
|
2454
|
+
// src/schemas/model-tuning.ts
|
|
2455
|
+
var DrySamplerSchema = z14.object({
|
|
2456
|
+
multiplier: z14.number().min(0).max(5).describe("DRY penalty strength. 0 disables. 0.8 is a reasonable default."),
|
|
2457
|
+
base: z14.number().min(0).max(5).optional().describe("Base of the exponential penalty for repeated tokens. Default 1.75."),
|
|
2458
|
+
allowedLength: z14.number().int().min(0).max(64).optional().describe("Minimum n-gram length before DRY kicks in. Default 2.")
|
|
2406
2459
|
}).describe("DRY anti-repetition sampler (llama.cpp only).");
|
|
2407
|
-
var XtcSamplerSchema =
|
|
2408
|
-
probability:
|
|
2409
|
-
threshold:
|
|
2460
|
+
var XtcSamplerSchema = z14.object({
|
|
2461
|
+
probability: z14.number().min(0).max(1).describe("Probability of triggering XTC on any given step."),
|
|
2462
|
+
threshold: z14.number().min(0).max(1).describe("Minimum top-token probability for XTC to fire.")
|
|
2410
2463
|
}).describe("XTC sampler (llama.cpp only).");
|
|
2411
|
-
var SamplingBlockSchema =
|
|
2412
|
-
temperature:
|
|
2413
|
-
topP:
|
|
2414
|
-
topK:
|
|
2415
|
-
minP:
|
|
2416
|
-
maxTokens:
|
|
2417
|
-
seed:
|
|
2418
|
-
repetitionPenalty:
|
|
2419
|
-
repetitionContext:
|
|
2420
|
-
frequencyPenalty:
|
|
2421
|
-
presencePenalty:
|
|
2464
|
+
var SamplingBlockSchema = z14.object({
|
|
2465
|
+
temperature: z14.number().min(0).max(2).optional().describe("Sampling temperature. 0 = greedy. Most reasoning models want 0.6\u20131.0."),
|
|
2466
|
+
topP: z14.number().min(0).max(1).optional().describe("Nucleus sampling. 0.95 is the common default for Qwen, Gemma, Nemotron."),
|
|
2467
|
+
topK: z14.number().int().min(0).max(1e3).optional().describe("Top-k cutoff. 20 for Qwen think, 64 for Gemma, 1 for greedy-on-instruct."),
|
|
2468
|
+
minP: z14.number().min(0).max(1).optional().describe("Min-p cutoff (llama.cpp / MLX / Ollama). Qwen recommends 0."),
|
|
2469
|
+
maxTokens: z14.number().int().positive().optional().describe("Per-turn output token cap. Maps to num_predict / max_tokens / n_predict."),
|
|
2470
|
+
seed: z14.number().int().optional().describe("RNG seed. Unset / negative = random. Best-effort determinism on cloud."),
|
|
2471
|
+
repetitionPenalty: z14.number().min(0).max(3).optional().describe("Local engines (Ollama / llama.cpp / MLX): repeat_penalty. 1.0 = off, 1.1 = mild."),
|
|
2472
|
+
repetitionContext: z14.number().int().positive().optional().describe("Local engines: window size for repetition penalty (`repeat_last_n`)."),
|
|
2473
|
+
frequencyPenalty: z14.number().min(-2).max(2).optional().describe("Cloud (OpenAI) and Ollama / llama.cpp: penalize repeated tokens by frequency."),
|
|
2474
|
+
presencePenalty: z14.number().min(-2).max(2).optional().describe("Cloud (OpenAI) and Ollama / llama.cpp: penalize any reused token."),
|
|
2422
2475
|
dry: DrySamplerSchema.optional(),
|
|
2423
2476
|
xtc: XtcSamplerSchema.optional()
|
|
2424
2477
|
}).describe("Sampling parameters applied per-request.");
|
|
2425
|
-
var ReasoningBlockSchema =
|
|
2426
|
-
effort:
|
|
2478
|
+
var ReasoningBlockSchema = z14.object({
|
|
2479
|
+
effort: z14.enum(["low", "medium", "high"]).optional().describe(
|
|
2427
2480
|
"Cloud reasoning effort. Maps to OpenAI `reasoning.effort` and Anthropic `thinking.budget_tokens` tiers."
|
|
2428
2481
|
),
|
|
2429
|
-
thinkingBudget:
|
|
2482
|
+
thinkingBudget: z14.number().int().positive().optional().describe(
|
|
2430
2483
|
"Explicit thinking-token budget (Anthropic `thinking.budget_tokens`, Nemotron `reasoning_budget`). Wins over `effort` when both set."
|
|
2431
2484
|
),
|
|
2432
|
-
enableThinking:
|
|
2485
|
+
enableThinking: z14.boolean().optional().describe(
|
|
2433
2486
|
"Chat-template toggle for dual-mode models (Qwen3+, Nemotron Nano/Super). Implicit on cloud thinking models."
|
|
2434
2487
|
),
|
|
2435
|
-
templateKwargs:
|
|
2488
|
+
templateKwargs: z14.record(z14.string(), z14.union([z14.string(), z14.number(), z14.boolean()])).optional().describe(
|
|
2436
2489
|
"Chat-template variables that drive this model's reasoning depth, forwarded verbatim as `chat_template_kwargs` on local engines. The names are the model's own \u2014 GPT-OSS reads `reasoning_effort`, Muse Glimmer reads `reasoning_strength` (low|medium|high|xhigh) \u2014 so the manifest declares them rather than the runtime guessing. Lives under `reasoning` (not `engine`) because depth is a per-request choice a tuning profile overrides: `thinking-coding` can ask for xhigh while `instruct` asks for low. Cloud providers ignore it; use `reasoning.effort` there."
|
|
2437
2490
|
)
|
|
2438
2491
|
}).describe("Reasoning controls.");
|
|
2439
|
-
var StructuredOutputSchema =
|
|
2440
|
-
responseFormat:
|
|
2441
|
-
jsonSchema:
|
|
2442
|
-
grammar:
|
|
2492
|
+
var StructuredOutputSchema = z14.object({
|
|
2493
|
+
responseFormat: z14.enum(["text", "json_object"]).optional().describe("Output mode. `text` = freeform (default). `json_object` = enforce JSON."),
|
|
2494
|
+
jsonSchema: z14.unknown().optional().describe("Pin output to a JSON Schema (OpenAI strict mode, llama.cpp --json-schema)."),
|
|
2495
|
+
grammar: z14.string().optional().describe("llama.cpp GBNF grammar. Last-resort structured-output knob.")
|
|
2443
2496
|
}).describe("Structured-output controls.");
|
|
2444
|
-
var PromptTagsSchema =
|
|
2445
|
-
enableThinkingTag:
|
|
2446
|
-
disableThinkingTag:
|
|
2497
|
+
var PromptTagsSchema = z14.object({
|
|
2498
|
+
enableThinkingTag: z14.string().optional().describe("User-prompt tag that enables thinking for this turn (e.g. `/think`)."),
|
|
2499
|
+
disableThinkingTag: z14.string().optional().describe("User-prompt tag that disables thinking for this turn (e.g. `/no_think`).")
|
|
2447
2500
|
}).describe("Per-turn reasoning toggle tags.");
|
|
2448
|
-
var LlamaCppEngineConfigSchema =
|
|
2449
|
-
nGpuLayers:
|
|
2450
|
-
cpuMoe:
|
|
2451
|
-
nCpuMoe:
|
|
2452
|
-
|
|
2501
|
+
var LlamaCppEngineConfigSchema = z14.object({
|
|
2502
|
+
nGpuLayers: z14.number().int().min(-1).optional().describe("`--n-gpu-layers` override. -1 = all. Unset = b9843 `auto`/`--fit`."),
|
|
2503
|
+
cpuMoe: z14.boolean().optional().describe("`--cpu-moe`: keep ALL MoE experts in system RAM (attention/dense on GPU)."),
|
|
2504
|
+
nCpuMoe: z14.number().int().min(0).optional().describe("`--n-cpu-moe N`: keep the first N layers\u2019 MoE experts in RAM. Partial split."),
|
|
2505
|
+
nCpuFfn: z14.number().int().min(0).optional().describe(
|
|
2506
|
+
"`--n-cpu-ffn N`: keep the first N layers\u2019 dense FFN weights in RAM. 0 disables the hardware planner."
|
|
2507
|
+
),
|
|
2508
|
+
loadMode: LlamaCppLoadModeSchema.optional().describe(
|
|
2509
|
+
"llama.cpp v0.4.0 `--load-mode` override for this model."
|
|
2510
|
+
),
|
|
2511
|
+
lazyMode: LlamaCppLazyModeSchema.optional().describe(
|
|
2512
|
+
"llama.cpp v0.4.0 on-demand tensor loading mode."
|
|
2513
|
+
),
|
|
2514
|
+
cacheReuse: z14.number().int().min(0).optional().describe(
|
|
2453
2515
|
"`--cache-reuse N` prefix-KV reuse chunk. 0 = disable. Unset inherits the global default."
|
|
2454
2516
|
),
|
|
2455
|
-
swaFull:
|
|
2456
|
-
flashAttn:
|
|
2457
|
-
ubatchSize:
|
|
2458
|
-
contextSize:
|
|
2517
|
+
swaFull: z14.boolean().optional().describe("`--swa-full`: full-size SWA cache (Gemma family)."),
|
|
2518
|
+
flashAttn: z14.enum(["on", "off", "auto"]).optional().describe("`--flash-attn` mode override for this model."),
|
|
2519
|
+
ubatchSize: z14.number().int().positive().optional().describe("`--ubatch-size` (inner microbatch) override for this model."),
|
|
2520
|
+
contextSize: z14.number().int().positive().optional().describe(
|
|
2459
2521
|
"Per-turn context ceiling (tokens) this model launches with. Capped by GGUF train ctx."
|
|
2460
2522
|
),
|
|
2461
|
-
chatTemplate:
|
|
2523
|
+
chatTemplate: z14.string().min(1).optional().describe(
|
|
2462
2524
|
"`--chat-template` override for GGUFs whose embedded Jinja template is incompatible with llama.cpp tool parsing."
|
|
2463
2525
|
),
|
|
2464
|
-
threads:
|
|
2465
|
-
batchSize:
|
|
2466
|
-
spec:
|
|
2467
|
-
type:
|
|
2526
|
+
threads: z14.number().int().positive().optional().describe("`--threads` override."),
|
|
2527
|
+
batchSize: z14.number().int().positive().optional().describe("`--batch-size` override."),
|
|
2528
|
+
spec: z14.object({
|
|
2529
|
+
type: z14.enum([
|
|
2468
2530
|
"none",
|
|
2469
2531
|
"draft-mtp",
|
|
2470
2532
|
"draft-eagle3",
|
|
@@ -2476,24 +2538,24 @@ var LlamaCppEngineConfigSchema = z13.object({
|
|
|
2476
2538
|
"ngram-map-k4v",
|
|
2477
2539
|
"ngram-cache"
|
|
2478
2540
|
]).optional().describe("`--spec-type` speculative-decoding mode for this model."),
|
|
2479
|
-
mtp:
|
|
2541
|
+
mtp: z14.boolean().optional().describe(
|
|
2480
2542
|
"VERIFIED capability metadata: this model\u2019s target or companion GGUF carries MTP tensors. Does not enable `draft-mtp` by itself."
|
|
2481
2543
|
),
|
|
2482
|
-
draftModelId:
|
|
2483
|
-
nMax:
|
|
2544
|
+
draftModelId: z14.string().optional().describe("Catalog id / path of the draft model for `draft-simple`."),
|
|
2545
|
+
nMax: z14.number().int().positive().optional().describe("`--spec-draft-n-max`: tokens drafted per step.")
|
|
2484
2546
|
}).optional().describe("Speculative-decoding config for this model.")
|
|
2485
2547
|
}).describe("Per-model llama.cpp launch-flag defaults (engine-level, applied at model load).");
|
|
2486
|
-
var EngineConfigSchema =
|
|
2548
|
+
var EngineConfigSchema = z14.object({
|
|
2487
2549
|
llamaCpp: LlamaCppEngineConfigSchema.optional()
|
|
2488
2550
|
}).describe("Per-model engine launch-flag defaults, keyed by engine.");
|
|
2489
|
-
var ChatModelTuningBaseSchema =
|
|
2551
|
+
var ChatModelTuningBaseSchema = z14.object({
|
|
2490
2552
|
sampling: SamplingBlockSchema.optional(),
|
|
2491
2553
|
samplingWhenThinking: SamplingBlockSchema.optional().describe(
|
|
2492
2554
|
"Sparse override of `sampling` applied when the runtime determines reasoning is engaged. Used by Qwen3+ (different sampling for /think mode) and Nemotron Nano (different sampling for thinking vs instruct)."
|
|
2493
2555
|
),
|
|
2494
2556
|
reasoning: ReasoningBlockSchema.optional(),
|
|
2495
2557
|
output: StructuredOutputSchema.optional(),
|
|
2496
|
-
toolChoice:
|
|
2558
|
+
toolChoice: z14.enum(["auto", "required", "none"]).optional().describe(
|
|
2497
2559
|
"Tool selection mode (cloud + llama.cpp + MLX). `auto` lets the model decide; `required` forces a tool call this turn; `none` disables tools."
|
|
2498
2560
|
),
|
|
2499
2561
|
promptTags: PromptTagsSchema.optional()
|
|
@@ -2502,16 +2564,16 @@ var ChatModelTuningSchema = ChatModelTuningBaseSchema.extend({
|
|
|
2502
2564
|
engine: EngineConfigSchema.optional().describe(
|
|
2503
2565
|
"Per-model ENGINE launch-flag defaults (llama.cpp `--n-gpu-layers`, `--cpu-moe`, `--spec-type`, \u2026). Applied once at model load, not per request \u2014 so it lives on the top-level tuning object, not inside per-request `profiles`."
|
|
2504
2566
|
),
|
|
2505
|
-
profiles:
|
|
2567
|
+
profiles: z14.record(TuningProfileIdSchema, ChatModelTuningBaseSchema.partial()).optional().describe(
|
|
2506
2568
|
"Named tuning presets this model implements. Gezel frontmatter `tuningProfile` selects one; the resolver applies the profile as a layer between installDefault and catalog base. Missing requested profiles walk the canonical fallback chain."
|
|
2507
2569
|
)
|
|
2508
2570
|
}).describe("Per-model sampling, reasoning, and output defaults.");
|
|
2509
2571
|
|
|
2510
2572
|
// src/schemas/question.ts
|
|
2511
|
-
import { z as
|
|
2573
|
+
import { z as z16 } from "zod";
|
|
2512
2574
|
|
|
2513
2575
|
// src/schemas/npm-package.ts
|
|
2514
|
-
import { z as
|
|
2576
|
+
import { z as z15 } from "zod";
|
|
2515
2577
|
var NPM_NAME_SEGMENT = /^[a-z0-9](?:[a-z0-9._~-]*[a-z0-9])?$/;
|
|
2516
2578
|
var SEMVER_NUMBER = String.raw`(?:0|[1-9]\d*)`;
|
|
2517
2579
|
var SEMVER_PART = String.raw`(?:${SEMVER_NUMBER}|[xX*])`;
|
|
@@ -2543,28 +2605,28 @@ function isValidNpmRegistryVersion(value) {
|
|
|
2543
2605
|
return atoms.length > 0 && atoms.every((atom) => SEMVER_ATOM.test(atom));
|
|
2544
2606
|
});
|
|
2545
2607
|
}
|
|
2546
|
-
var NpmPackageNameSchema =
|
|
2608
|
+
var NpmPackageNameSchema = z15.string().refine(isValidNpmPackageName, {
|
|
2547
2609
|
message: "must be a lowercase npm registry package name (for example zod or @types/node)"
|
|
2548
2610
|
});
|
|
2549
|
-
var NpmRegistryVersionSchema =
|
|
2611
|
+
var NpmRegistryVersionSchema = z15.string().refine(isValidNpmRegistryVersion, {
|
|
2550
2612
|
message: "must be a registry dist-tag or semver range"
|
|
2551
2613
|
});
|
|
2552
|
-
var NpmRegistryPackageRequestSchema =
|
|
2614
|
+
var NpmRegistryPackageRequestSchema = z15.object({
|
|
2553
2615
|
package: NpmPackageNameSchema,
|
|
2554
2616
|
version: NpmRegistryVersionSchema.optional()
|
|
2555
2617
|
}).strict();
|
|
2556
2618
|
|
|
2557
2619
|
// src/schemas/question.ts
|
|
2558
|
-
var NpmInstallApprovalDecisionSchema =
|
|
2620
|
+
var NpmInstallApprovalDecisionSchema = z16.object({
|
|
2559
2621
|
package: NpmPackageNameSchema,
|
|
2560
2622
|
version: NpmRegistryVersionSchema,
|
|
2561
|
-
decision:
|
|
2623
|
+
decision: z16.enum(["install", "always", "decline"])
|
|
2562
2624
|
});
|
|
2563
|
-
var QuestionAnswerSchema =
|
|
2625
|
+
var QuestionAnswerSchema = z16.object({
|
|
2564
2626
|
/** Indices into `choices` the user picked. Empty when only write-in. */
|
|
2565
|
-
selectedChoices:
|
|
2627
|
+
selectedChoices: z16.array(z16.number().int().min(0)).optional(),
|
|
2566
2628
|
/** Free-text the user typed. Empty when they only clicked choices. */
|
|
2567
|
-
writeIn:
|
|
2629
|
+
writeIn: z16.string().optional(),
|
|
2568
2630
|
/**
|
|
2569
2631
|
* Set when the user explicitly dismissed BUT wants the gezel to
|
|
2570
2632
|
* proceed anyway with sensible defaults. Triggers a synthetic
|
|
@@ -2577,7 +2639,7 @@ var QuestionAnswerSchema = z15.object({
|
|
|
2577
2639
|
* mean it literally (declining an image generation, an npm install,
|
|
2578
2640
|
* a schedule) and on the permission broker's dismissal path.
|
|
2579
2641
|
*/
|
|
2580
|
-
declined:
|
|
2642
|
+
declined: z16.boolean().optional(),
|
|
2581
2643
|
/**
|
|
2582
2644
|
* Set when the user just wants the question to go away — no
|
|
2583
2645
|
* follow-up turn, no work done, nothing for the gezel to act on.
|
|
@@ -2586,112 +2648,112 @@ var QuestionAnswerSchema = z15.object({
|
|
|
2586
2648
|
* from `declined` so the model never sees a "user wants defaults"
|
|
2587
2649
|
* signal that the user didn't intend. UI label: "Skip".
|
|
2588
2650
|
*/
|
|
2589
|
-
silentSkip:
|
|
2651
|
+
silentSkip: z16.boolean().optional(),
|
|
2590
2652
|
/**
|
|
2591
2653
|
* Per-package decisions for `npm-install-approval` questions. When
|
|
2592
2654
|
* set, the answer handler installs / always-allows / declines each
|
|
2593
2655
|
* package and emits a single follow-up summary into the session.
|
|
2594
2656
|
*/
|
|
2595
|
-
npmInstallDecisions:
|
|
2596
|
-
at:
|
|
2657
|
+
npmInstallDecisions: z16.array(NpmInstallApprovalDecisionSchema).optional(),
|
|
2658
|
+
at: z16.string()
|
|
2597
2659
|
});
|
|
2598
|
-
var NpmInstallApprovalPackageSchema =
|
|
2660
|
+
var NpmInstallApprovalPackageSchema = z16.object({
|
|
2599
2661
|
package: NpmPackageNameSchema,
|
|
2600
2662
|
version: NpmRegistryVersionSchema
|
|
2601
2663
|
});
|
|
2602
|
-
var CommandApprovalScopeSchema =
|
|
2603
|
-
var CommandApprovalInputFileSchema =
|
|
2664
|
+
var CommandApprovalScopeSchema = z16.enum(["script", "npx"]);
|
|
2665
|
+
var CommandApprovalInputFileSchema = z16.object({
|
|
2604
2666
|
/** Workspace-relative, slash-normalized path shown in the approval prompt. */
|
|
2605
|
-
path:
|
|
2606
|
-
sha256:
|
|
2667
|
+
path: z16.string().min(1),
|
|
2668
|
+
sha256: z16.string().regex(/^[a-f0-9]{64}$/)
|
|
2607
2669
|
});
|
|
2608
|
-
var CommandApprovalIntentSchema =
|
|
2609
|
-
kind:
|
|
2670
|
+
var CommandApprovalIntentSchema = z16.object({
|
|
2671
|
+
kind: z16.literal("command-approval"),
|
|
2610
2672
|
scope: CommandApprovalScopeSchema,
|
|
2611
|
-
name:
|
|
2612
|
-
body:
|
|
2613
|
-
args:
|
|
2614
|
-
inputFiles:
|
|
2615
|
-
});
|
|
2616
|
-
var ToolPermissionIntentSchema =
|
|
2617
|
-
kind:
|
|
2618
|
-
toolName:
|
|
2619
|
-
toolInput:
|
|
2620
|
-
});
|
|
2621
|
-
var ClaudeUserQuestionOptionSchema =
|
|
2622
|
-
label:
|
|
2623
|
-
description:
|
|
2624
|
-
});
|
|
2625
|
-
var ClaudeUserQuestionIntentSchema =
|
|
2626
|
-
kind:
|
|
2673
|
+
name: z16.string().min(1),
|
|
2674
|
+
body: z16.string().optional(),
|
|
2675
|
+
args: z16.array(z16.string()).optional(),
|
|
2676
|
+
inputFiles: z16.array(CommandApprovalInputFileSchema).max(128).optional()
|
|
2677
|
+
});
|
|
2678
|
+
var ToolPermissionIntentSchema = z16.object({
|
|
2679
|
+
kind: z16.literal("tool-permission"),
|
|
2680
|
+
toolName: z16.string(),
|
|
2681
|
+
toolInput: z16.record(z16.string(), z16.unknown())
|
|
2682
|
+
});
|
|
2683
|
+
var ClaudeUserQuestionOptionSchema = z16.object({
|
|
2684
|
+
label: z16.string().min(1),
|
|
2685
|
+
description: z16.string().optional()
|
|
2686
|
+
});
|
|
2687
|
+
var ClaudeUserQuestionIntentSchema = z16.object({
|
|
2688
|
+
kind: z16.literal("claude-user-question"),
|
|
2627
2689
|
/** The CLI's short topic chip for the question (e.g. "Gate block"). */
|
|
2628
|
-
header:
|
|
2690
|
+
header: z16.string().optional(),
|
|
2629
2691
|
/** Options with descriptions; labels mirror the Question's `choices`. */
|
|
2630
|
-
options:
|
|
2692
|
+
options: z16.array(ClaudeUserQuestionOptionSchema),
|
|
2631
2693
|
/** 0-based position within the originating multi-question call. */
|
|
2632
|
-
questionIndex:
|
|
2694
|
+
questionIndex: z16.number().int().min(0),
|
|
2633
2695
|
/** Total questions in the originating call (cards appear sequentially). */
|
|
2634
|
-
questionCount:
|
|
2635
|
-
});
|
|
2636
|
-
var ToolsetInstallApprovalIntentSchema =
|
|
2637
|
-
kind:
|
|
2638
|
-
toolsetId:
|
|
2639
|
-
sourceId:
|
|
2640
|
-
version:
|
|
2641
|
-
targetProjectId:
|
|
2642
|
-
craftbookId:
|
|
2643
|
-
});
|
|
2644
|
-
var ImageGenerationApprovalIntentSchema =
|
|
2645
|
-
kind:
|
|
2646
|
-
provider:
|
|
2647
|
-
model:
|
|
2696
|
+
questionCount: z16.number().int().min(1)
|
|
2697
|
+
});
|
|
2698
|
+
var ToolsetInstallApprovalIntentSchema = z16.object({
|
|
2699
|
+
kind: z16.literal("toolset-install-approval"),
|
|
2700
|
+
toolsetId: z16.string(),
|
|
2701
|
+
sourceId: z16.string(),
|
|
2702
|
+
version: z16.string(),
|
|
2703
|
+
targetProjectId: z16.string(),
|
|
2704
|
+
craftbookId: z16.string()
|
|
2705
|
+
});
|
|
2706
|
+
var ImageGenerationApprovalIntentSchema = z16.object({
|
|
2707
|
+
kind: z16.literal("image-generation-approval"),
|
|
2708
|
+
provider: z16.string(),
|
|
2709
|
+
model: z16.string(),
|
|
2648
2710
|
/** Truncated prompt the model is about to send. Surfaced verbatim. */
|
|
2649
|
-
promptPreview:
|
|
2711
|
+
promptPreview: z16.string(),
|
|
2650
2712
|
/** Resolved generation size, e.g. '2K 16:9' or '1024x1024'. Optional. */
|
|
2651
|
-
estimatedSize:
|
|
2713
|
+
estimatedSize: z16.string().optional()
|
|
2652
2714
|
});
|
|
2653
|
-
var VideoGenerationApprovalIntentSchema =
|
|
2654
|
-
kind:
|
|
2655
|
-
provider:
|
|
2656
|
-
model:
|
|
2657
|
-
promptPreview:
|
|
2715
|
+
var VideoGenerationApprovalIntentSchema = z16.object({
|
|
2716
|
+
kind: z16.literal("video-generation-approval"),
|
|
2717
|
+
provider: z16.string(),
|
|
2718
|
+
model: z16.string(),
|
|
2719
|
+
promptPreview: z16.string(),
|
|
2658
2720
|
/** Resolved clip shape, e.g. '704×480 · 97f · 24fps'. Optional. */
|
|
2659
|
-
estimatedSize:
|
|
2721
|
+
estimatedSize: z16.string().optional()
|
|
2660
2722
|
});
|
|
2661
|
-
var ScheduleApprovalIntentSchema =
|
|
2662
|
-
kind:
|
|
2663
|
-
typeId:
|
|
2664
|
-
craftbookId:
|
|
2723
|
+
var ScheduleApprovalIntentSchema = z16.object({
|
|
2724
|
+
kind: z16.literal("schedule-approval"),
|
|
2725
|
+
typeId: z16.string(),
|
|
2726
|
+
craftbookId: z16.string(),
|
|
2665
2727
|
/**
|
|
2666
2728
|
* Recurrence flavor. Absent → 'scheduled' (every question written
|
|
2667
2729
|
* before this field existed is a cron schedule). 'night-shift' hosts
|
|
2668
2730
|
* run inside the Night Shift window instead of on a user-visible cron;
|
|
2669
2731
|
* the card copy switches accordingly.
|
|
2670
2732
|
*/
|
|
2671
|
-
runMode:
|
|
2733
|
+
runMode: z16.enum(["scheduled", "night-shift"]).optional(),
|
|
2672
2734
|
/**
|
|
2673
2735
|
* 5-field cron expression (UTC). Surfaced verbatim on the card for
|
|
2674
2736
|
* 'scheduled' hosts; for 'night-shift' hosts it is the internal
|
|
2675
2737
|
* heartbeat and the card shows the window instead.
|
|
2676
2738
|
*/
|
|
2677
|
-
cron:
|
|
2678
|
-
overlap:
|
|
2739
|
+
cron: z16.string(),
|
|
2740
|
+
overlap: z16.enum(["skip", "queue", "concurrent"]).optional()
|
|
2679
2741
|
});
|
|
2680
|
-
var NightShiftReviewIntentSchema =
|
|
2681
|
-
kind:
|
|
2742
|
+
var NightShiftReviewIntentSchema = z16.object({
|
|
2743
|
+
kind: z16.literal("night-shift-review"),
|
|
2682
2744
|
/** The window's day key (see `nightShiftWindowKey`). */
|
|
2683
|
-
windowKey:
|
|
2684
|
-
tasksCompleted:
|
|
2685
|
-
reports:
|
|
2686
|
-
|
|
2687
|
-
projectId:
|
|
2688
|
-
path:
|
|
2689
|
-
title:
|
|
2690
|
-
actionCount:
|
|
2745
|
+
windowKey: z16.string(),
|
|
2746
|
+
tasksCompleted: z16.number(),
|
|
2747
|
+
reports: z16.array(
|
|
2748
|
+
z16.object({
|
|
2749
|
+
projectId: z16.string(),
|
|
2750
|
+
path: z16.string(),
|
|
2751
|
+
title: z16.string().optional(),
|
|
2752
|
+
actionCount: z16.number()
|
|
2691
2753
|
})
|
|
2692
2754
|
)
|
|
2693
2755
|
});
|
|
2694
|
-
var TaskPausedReasonSchema =
|
|
2756
|
+
var TaskPausedReasonSchema = z16.enum([
|
|
2695
2757
|
"gate_exhausted",
|
|
2696
2758
|
"gate_plateau",
|
|
2697
2759
|
"gate_unsatisfiable",
|
|
@@ -2700,22 +2762,22 @@ var TaskPausedReasonSchema = z15.enum([
|
|
|
2700
2762
|
"step_stalled",
|
|
2701
2763
|
"budget_exhausted"
|
|
2702
2764
|
]);
|
|
2703
|
-
var TaskPausedIntentSchema =
|
|
2704
|
-
kind:
|
|
2765
|
+
var TaskPausedIntentSchema = z16.object({
|
|
2766
|
+
kind: z16.literal("task-paused"),
|
|
2705
2767
|
/** `projectId/num` of the paused task — the dedup key. */
|
|
2706
|
-
taskRef:
|
|
2707
|
-
stepId:
|
|
2768
|
+
taskRef: z16.string(),
|
|
2769
|
+
stepId: z16.string().optional(),
|
|
2708
2770
|
reason: TaskPausedReasonSchema
|
|
2709
2771
|
});
|
|
2710
|
-
var QuestionIntentSchema =
|
|
2711
|
-
|
|
2712
|
-
kind:
|
|
2772
|
+
var QuestionIntentSchema = z16.discriminatedUnion("kind", [
|
|
2773
|
+
z16.object({
|
|
2774
|
+
kind: z16.literal("npm-install-approval"),
|
|
2713
2775
|
/**
|
|
2714
2776
|
* Packages that need approval. Always at least one; multiple when
|
|
2715
2777
|
* the gezel batched an install call (encouraged) or when we merged
|
|
2716
2778
|
* a later request into the same pending question for dedup.
|
|
2717
2779
|
*/
|
|
2718
|
-
packages:
|
|
2780
|
+
packages: z16.array(NpmInstallApprovalPackageSchema).min(1)
|
|
2719
2781
|
}),
|
|
2720
2782
|
CommandApprovalIntentSchema,
|
|
2721
2783
|
ToolPermissionIntentSchema,
|
|
@@ -2727,61 +2789,61 @@ var QuestionIntentSchema = z15.discriminatedUnion("kind", [
|
|
|
2727
2789
|
NightShiftReviewIntentSchema,
|
|
2728
2790
|
TaskPausedIntentSchema
|
|
2729
2791
|
]);
|
|
2730
|
-
var QuestionSchema =
|
|
2731
|
-
id:
|
|
2732
|
-
projectId:
|
|
2733
|
-
gezelId:
|
|
2734
|
-
sessionId:
|
|
2792
|
+
var QuestionSchema = z16.object({
|
|
2793
|
+
id: z16.string(),
|
|
2794
|
+
projectId: z16.string(),
|
|
2795
|
+
gezelId: z16.string(),
|
|
2796
|
+
sessionId: z16.string(),
|
|
2735
2797
|
/** Body of the question — supports markdown. */
|
|
2736
|
-
prompt:
|
|
2798
|
+
prompt: z16.string().min(1),
|
|
2737
2799
|
/** Optional preset choices. Empty / omitted => write-in only. */
|
|
2738
|
-
choices:
|
|
2800
|
+
choices: z16.array(z16.string()).max(20).optional(),
|
|
2739
2801
|
/** Whether the user can also type a write-in alongside choices. Default true. */
|
|
2740
|
-
allowWriteIn:
|
|
2802
|
+
allowWriteIn: z16.boolean().optional(),
|
|
2741
2803
|
/** Whether multiple choices may be selected. Default false. */
|
|
2742
|
-
multiSelect:
|
|
2804
|
+
multiSelect: z16.boolean().optional(),
|
|
2743
2805
|
/**
|
|
2744
2806
|
* Approval-flow attachment: a task this question is *about*. Stored in
|
|
2745
2807
|
* `projectId/num` form so existing parsing helpers work. The UI shows
|
|
2746
2808
|
* the task title + status above the prompt and offers an "Open task"
|
|
2747
2809
|
* link.
|
|
2748
2810
|
*/
|
|
2749
|
-
taskRef:
|
|
2811
|
+
taskRef: z16.string().optional(),
|
|
2750
2812
|
/**
|
|
2751
2813
|
* Approval-flow attachment: a document this question is *about*.
|
|
2752
2814
|
* Project-relative path when `projectId` is set, otherwise into the
|
|
2753
2815
|
* global `~/.gezel/documents/` library. The UI renders a collapsed
|
|
2754
2816
|
* preview + "Open document" link.
|
|
2755
2817
|
*/
|
|
2756
|
-
documentPath:
|
|
2818
|
+
documentPath: z16.string().optional(),
|
|
2757
2819
|
/**
|
|
2758
2820
|
* Service-created specialized-question marker (see `QuestionIntent`
|
|
2759
2821
|
* for context). Absent for plain user-facing questions asked via
|
|
2760
2822
|
* the `ask_user_question` MCP tool.
|
|
2761
2823
|
*/
|
|
2762
2824
|
intent: QuestionIntentSchema.optional(),
|
|
2763
|
-
createdAt:
|
|
2825
|
+
createdAt: z16.string(),
|
|
2764
2826
|
/** Set once the user has answered (or declined). */
|
|
2765
2827
|
answer: QuestionAnswerSchema.optional()
|
|
2766
2828
|
});
|
|
2767
2829
|
|
|
2768
2830
|
// src/schemas/recognition.ts
|
|
2769
|
-
import { z as
|
|
2770
|
-
var ImageExifSchema =
|
|
2771
|
-
make:
|
|
2772
|
-
model:
|
|
2773
|
-
lensModel:
|
|
2774
|
-
dateTimeOriginal:
|
|
2775
|
-
orientation:
|
|
2776
|
-
software:
|
|
2777
|
-
imageDescription:
|
|
2778
|
-
});
|
|
2779
|
-
var ImageStaticMetaSchema =
|
|
2780
|
-
format:
|
|
2781
|
-
width:
|
|
2782
|
-
height:
|
|
2783
|
-
byteLength:
|
|
2784
|
-
sha256:
|
|
2831
|
+
import { z as z17 } from "zod";
|
|
2832
|
+
var ImageExifSchema = z17.object({
|
|
2833
|
+
make: z17.string().optional(),
|
|
2834
|
+
model: z17.string().optional(),
|
|
2835
|
+
lensModel: z17.string().optional(),
|
|
2836
|
+
dateTimeOriginal: z17.string().optional(),
|
|
2837
|
+
orientation: z17.number().int().min(1).max(8).optional(),
|
|
2838
|
+
software: z17.string().optional(),
|
|
2839
|
+
imageDescription: z17.string().optional()
|
|
2840
|
+
});
|
|
2841
|
+
var ImageStaticMetaSchema = z17.object({
|
|
2842
|
+
format: z17.enum(["png", "jpeg", "gif", "webp", "svg", "unknown"]),
|
|
2843
|
+
width: z17.number().int().positive().optional(),
|
|
2844
|
+
height: z17.number().int().positive().optional(),
|
|
2845
|
+
byteLength: z17.number().int().nonnegative(),
|
|
2846
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
2785
2847
|
/**
|
|
2786
2848
|
* PNG `tEXt`/`iTXt`/`zTXt` keyword→value pairs. Generation provenance lives
|
|
2787
2849
|
* here (A1111 writes `parameters`, ComfyUI writes `prompt`/`workflow`) and
|
|
@@ -2790,171 +2852,171 @@ var ImageStaticMetaSchema = z16.object({
|
|
|
2790
2852
|
* Attacker-controlled: anyone can author a PNG whose `Description` chunk
|
|
2791
2853
|
* reads "Ignore previous instructions". Renderers MUST fence and cap this.
|
|
2792
2854
|
*/
|
|
2793
|
-
pngText:
|
|
2855
|
+
pngText: z17.record(z17.string(), z17.string()).optional(),
|
|
2794
2856
|
exif: ImageExifSchema.optional(),
|
|
2795
2857
|
/** Withheld from every prompt. See the schema doc above. */
|
|
2796
|
-
gps:
|
|
2858
|
+
gps: z17.object({ lat: z17.number(), lon: z17.number() }).optional(),
|
|
2797
2859
|
/** True when the file carried location data we deliberately dropped. */
|
|
2798
|
-
gpsRedacted:
|
|
2860
|
+
gpsRedacted: z17.boolean().optional(),
|
|
2799
2861
|
/**
|
|
2800
2862
|
* Heuristic from dimensions, format, and metadata — drives `auto` mode
|
|
2801
2863
|
* selection without paying a classifier call.
|
|
2802
2864
|
*/
|
|
2803
|
-
likelyScreenshot:
|
|
2865
|
+
likelyScreenshot: z17.boolean().optional()
|
|
2804
2866
|
});
|
|
2805
|
-
var RecognitionModeSchema =
|
|
2806
|
-
var RecognitionModeRequestSchema =
|
|
2807
|
-
var ImageRecognitionSchema =
|
|
2808
|
-
schemaVersion:
|
|
2809
|
-
sha256:
|
|
2867
|
+
var RecognitionModeSchema = z17.enum(["describe", "ocr", "ui", "extract"]);
|
|
2868
|
+
var RecognitionModeRequestSchema = z17.enum(["auto", "describe", "ocr", "ui", "extract"]);
|
|
2869
|
+
var ImageRecognitionSchema = z17.object({
|
|
2870
|
+
schemaVersion: z17.literal(1),
|
|
2871
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
2810
2872
|
meta: ImageStaticMetaSchema,
|
|
2811
|
-
modes:
|
|
2812
|
-
description:
|
|
2813
|
-
ocrText:
|
|
2814
|
-
structured:
|
|
2815
|
-
templateId:
|
|
2816
|
-
data:
|
|
2873
|
+
modes: z17.array(RecognitionModeSchema).min(1),
|
|
2874
|
+
description: z17.string().optional(),
|
|
2875
|
+
ocrText: z17.string().optional(),
|
|
2876
|
+
structured: z17.object({
|
|
2877
|
+
templateId: z17.string().optional(),
|
|
2878
|
+
data: z17.unknown()
|
|
2817
2879
|
}).optional(),
|
|
2818
|
-
engine:
|
|
2819
|
-
modelId:
|
|
2820
|
-
status:
|
|
2821
|
-
failureReason:
|
|
2822
|
-
durationMs:
|
|
2823
|
-
at:
|
|
2824
|
-
});
|
|
2825
|
-
var MessageImageDigestSchema =
|
|
2880
|
+
engine: z17.enum(["llama-cpp", "mlx", "mock", "none"]),
|
|
2881
|
+
modelId: z17.string(),
|
|
2882
|
+
status: z17.enum(["ok", "partial", "failed", "static-only"]),
|
|
2883
|
+
failureReason: z17.string().optional(),
|
|
2884
|
+
durationMs: z17.number().int().nonnegative(),
|
|
2885
|
+
at: z17.string()
|
|
2886
|
+
});
|
|
2887
|
+
var MessageImageDigestSchema = z17.object({
|
|
2826
2888
|
/** The markdown ref exactly as it appears in the message body. */
|
|
2827
|
-
ref:
|
|
2828
|
-
sha256:
|
|
2889
|
+
ref: z17.string(),
|
|
2890
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
2829
2891
|
/** Pre-rendered, already capped and fenced-safe. */
|
|
2830
|
-
digest:
|
|
2831
|
-
modelId:
|
|
2832
|
-
modes:
|
|
2833
|
-
status:
|
|
2834
|
-
at:
|
|
2892
|
+
digest: z17.string(),
|
|
2893
|
+
modelId: z17.string(),
|
|
2894
|
+
modes: z17.array(RecognitionModeSchema),
|
|
2895
|
+
status: z17.enum(["ok", "partial", "failed", "static-only"]),
|
|
2896
|
+
at: z17.string()
|
|
2835
2897
|
});
|
|
2836
|
-
var RecognitionRequestSchema =
|
|
2898
|
+
var RecognitionRequestSchema = z17.object({
|
|
2837
2899
|
/** Project-relative artifact path, e.g. `attachments/<uuid>.png`. */
|
|
2838
|
-
artifactPath:
|
|
2839
|
-
data:
|
|
2840
|
-
mimeType:
|
|
2900
|
+
artifactPath: z17.string().min(1).optional(),
|
|
2901
|
+
data: z17.string().min(1).optional(),
|
|
2902
|
+
mimeType: z17.string().optional(),
|
|
2841
2903
|
mode: RecognitionModeRequestSchema.default("auto"),
|
|
2842
2904
|
/** JSON Schema for `extract` mode — fed to llama-server `response_format`. */
|
|
2843
|
-
schema:
|
|
2905
|
+
schema: z17.unknown().optional(),
|
|
2844
2906
|
/** Overrides the configured recognition model for this call. */
|
|
2845
|
-
model:
|
|
2846
|
-
});
|
|
2847
|
-
var RecognitionHealthSchema =
|
|
2848
|
-
state:
|
|
2849
|
-
modelId:
|
|
2850
|
-
detail:
|
|
2851
|
-
});
|
|
2852
|
-
var RecognitionPullEventSchema =
|
|
2853
|
-
|
|
2854
|
-
type:
|
|
2855
|
-
bytesWritten:
|
|
2856
|
-
totalBytes:
|
|
2907
|
+
model: z17.string().optional()
|
|
2908
|
+
});
|
|
2909
|
+
var RecognitionHealthSchema = z17.object({
|
|
2910
|
+
state: z17.enum(["ok", "no-model", "not-configured", "error"]),
|
|
2911
|
+
modelId: z17.string().optional(),
|
|
2912
|
+
detail: z17.string().optional()
|
|
2913
|
+
});
|
|
2914
|
+
var RecognitionPullEventSchema = z17.union([
|
|
2915
|
+
z17.object({
|
|
2916
|
+
type: z17.literal("progress"),
|
|
2917
|
+
bytesWritten: z17.number().int().nonnegative(),
|
|
2918
|
+
totalBytes: z17.number().int().nonnegative().optional()
|
|
2857
2919
|
}),
|
|
2858
|
-
|
|
2859
|
-
|
|
2920
|
+
z17.object({ type: z17.literal("error"), error: z17.string() }),
|
|
2921
|
+
z17.object({ type: z17.literal("done"), id: z17.string() })
|
|
2860
2922
|
]);
|
|
2861
|
-
var RecognitionCatalogEntrySchema =
|
|
2862
|
-
id:
|
|
2863
|
-
name:
|
|
2864
|
-
description:
|
|
2865
|
-
license:
|
|
2866
|
-
approxSizeBytes:
|
|
2867
|
-
recoScore:
|
|
2868
|
-
});
|
|
2869
|
-
var ListRecognitionCatalogResponseSchema =
|
|
2870
|
-
models:
|
|
2871
|
-
});
|
|
2872
|
-
var InstalledRecognitionModelSchema =
|
|
2873
|
-
id:
|
|
2874
|
-
name:
|
|
2875
|
-
approxSizeBytes:
|
|
2876
|
-
installedAt:
|
|
2877
|
-
weightsPath:
|
|
2878
|
-
mmprojPath:
|
|
2879
|
-
});
|
|
2880
|
-
var ListInstalledRecognitionModelsResponseSchema =
|
|
2881
|
-
models:
|
|
2923
|
+
var RecognitionCatalogEntrySchema = z17.object({
|
|
2924
|
+
id: z17.string(),
|
|
2925
|
+
name: z17.string(),
|
|
2926
|
+
description: z17.string(),
|
|
2927
|
+
license: z17.string(),
|
|
2928
|
+
approxSizeBytes: z17.number().int().nonnegative(),
|
|
2929
|
+
recoScore: z17.number()
|
|
2930
|
+
});
|
|
2931
|
+
var ListRecognitionCatalogResponseSchema = z17.object({
|
|
2932
|
+
models: z17.array(RecognitionCatalogEntrySchema)
|
|
2933
|
+
});
|
|
2934
|
+
var InstalledRecognitionModelSchema = z17.object({
|
|
2935
|
+
id: z17.string(),
|
|
2936
|
+
name: z17.string(),
|
|
2937
|
+
approxSizeBytes: z17.number().int().nonnegative(),
|
|
2938
|
+
installedAt: z17.string(),
|
|
2939
|
+
weightsPath: z17.string().optional(),
|
|
2940
|
+
mmprojPath: z17.string().optional()
|
|
2941
|
+
});
|
|
2942
|
+
var ListInstalledRecognitionModelsResponseSchema = z17.object({
|
|
2943
|
+
models: z17.array(InstalledRecognitionModelSchema)
|
|
2882
2944
|
});
|
|
2883
2945
|
|
|
2884
2946
|
// src/schemas/session-lineage.ts
|
|
2885
|
-
import { z as
|
|
2886
|
-
var SessionLinkSchema =
|
|
2887
|
-
sessionId:
|
|
2888
|
-
gezelId:
|
|
2947
|
+
import { z as z18 } from "zod";
|
|
2948
|
+
var SessionLinkSchema = z18.object({
|
|
2949
|
+
sessionId: z18.string(),
|
|
2950
|
+
gezelId: z18.string()
|
|
2889
2951
|
});
|
|
2890
2952
|
var SessionParentSchema = SessionLinkSchema.extend({
|
|
2891
|
-
kind:
|
|
2953
|
+
kind: z18.enum(["delegation", "consultation", "task-entry", "task-handoff"])
|
|
2892
2954
|
});
|
|
2893
2955
|
|
|
2894
2956
|
// src/schemas/session-telemetry.ts
|
|
2895
|
-
import { z as
|
|
2896
|
-
var SessionGpuTaskSchema =
|
|
2957
|
+
import { z as z19 } from "zod";
|
|
2958
|
+
var SessionGpuTaskSchema = z19.enum([
|
|
2897
2959
|
"image_generation",
|
|
2898
2960
|
"video_generation",
|
|
2899
2961
|
"image_recognition"
|
|
2900
2962
|
]);
|
|
2901
|
-
var SessionTurnPhaseSchema =
|
|
2902
|
-
var SessionTurnTelemetrySchema =
|
|
2963
|
+
var SessionTurnPhaseSchema = z19.enum(["preparing", "recall", "provider"]);
|
|
2964
|
+
var SessionTurnTelemetrySchema = z19.object({
|
|
2903
2965
|
/** Epoch ms when the in-flight turn started. */
|
|
2904
|
-
startedAt:
|
|
2966
|
+
startedAt: z19.number(),
|
|
2905
2967
|
phase: SessionTurnPhaseSchema,
|
|
2906
2968
|
/** Epoch ms when `phase` last changed. */
|
|
2907
|
-
phaseStartedAt:
|
|
2969
|
+
phaseStartedAt: z19.number(),
|
|
2908
2970
|
/** Provider requests issued by this user-visible turn, including retries. */
|
|
2909
|
-
providerRequestsStarted:
|
|
2910
|
-
streamedContentChars:
|
|
2911
|
-
toolCalls:
|
|
2912
|
-
fileMutations:
|
|
2971
|
+
providerRequestsStarted: z19.number().int().nonnegative(),
|
|
2972
|
+
streamedContentChars: z19.number().int().nonnegative(),
|
|
2973
|
+
toolCalls: z19.number().int().nonnegative(),
|
|
2974
|
+
fileMutations: z19.number().int().nonnegative()
|
|
2913
2975
|
});
|
|
2914
|
-
var SessionTelemetrySchema =
|
|
2915
|
-
sessionId:
|
|
2916
|
-
gezelId:
|
|
2917
|
-
projectId:
|
|
2976
|
+
var SessionTelemetrySchema = z19.object({
|
|
2977
|
+
sessionId: z19.string(),
|
|
2978
|
+
gezelId: z19.string(),
|
|
2979
|
+
projectId: z19.string(),
|
|
2918
2980
|
/** True while a send is currently running for this session. */
|
|
2919
|
-
inflight:
|
|
2920
|
-
turnsStarted:
|
|
2981
|
+
inflight: z19.boolean(),
|
|
2982
|
+
turnsStarted: z19.number().int().nonnegative(),
|
|
2921
2983
|
/** Provider requests issued across all turns in this daemon process. */
|
|
2922
|
-
providerRequestsStarted:
|
|
2923
|
-
deltaChunks:
|
|
2924
|
-
streamedContentChars:
|
|
2925
|
-
wirePulses:
|
|
2926
|
-
heartbeats:
|
|
2927
|
-
enginePhaseEvents:
|
|
2984
|
+
providerRequestsStarted: z19.number().int().nonnegative(),
|
|
2985
|
+
deltaChunks: z19.number().int().nonnegative(),
|
|
2986
|
+
streamedContentChars: z19.number().int().nonnegative(),
|
|
2987
|
+
wirePulses: z19.number().int().nonnegative(),
|
|
2988
|
+
heartbeats: z19.number().int().nonnegative(),
|
|
2989
|
+
enginePhaseEvents: z19.number().int().nonnegative(),
|
|
2928
2990
|
/**
|
|
2929
2991
|
* `engine_phase === 'generating'` transitions — roughly one per completion
|
|
2930
2992
|
* request the engine served (the slot-launch granularity stall logic and
|
|
2931
2993
|
* the eval chatter threshold were calibrated against).
|
|
2932
2994
|
*/
|
|
2933
|
-
generationSpurts:
|
|
2934
|
-
toolCalls:
|
|
2935
|
-
toolArgChars:
|
|
2936
|
-
fileMutations:
|
|
2937
|
-
gpuEvents:
|
|
2995
|
+
generationSpurts: z19.number().int().nonnegative(),
|
|
2996
|
+
toolCalls: z19.number().int().nonnegative(),
|
|
2997
|
+
toolArgChars: z19.number().int().nonnegative(),
|
|
2998
|
+
fileMutations: z19.number().int().nonnegative(),
|
|
2999
|
+
gpuEvents: z19.number().int().nonnegative(),
|
|
2938
3000
|
gpuTaskActive: SessionGpuTaskSchema.nullable(),
|
|
2939
3001
|
/** Epoch ms of the last streamed signal (delta / pulse / heartbeat / phase). */
|
|
2940
|
-
lastStreamActivityAt:
|
|
2941
|
-
lastToolActivityAt:
|
|
2942
|
-
lastMutationAt:
|
|
2943
|
-
lastGpuActivityAt:
|
|
3002
|
+
lastStreamActivityAt: z19.number().nullable(),
|
|
3003
|
+
lastToolActivityAt: z19.number().nullable(),
|
|
3004
|
+
lastMutationAt: z19.number().nullable(),
|
|
3005
|
+
lastGpuActivityAt: z19.number().nullable(),
|
|
2944
3006
|
/** Max of all activity timestamps — "when did ANY progress signal last fire". */
|
|
2945
|
-
lastProgressAt:
|
|
3007
|
+
lastProgressAt: z19.number().nullable(),
|
|
2946
3008
|
/** Counters scoped to the currently-running turn; null between turns. */
|
|
2947
3009
|
currentTurn: SessionTurnTelemetrySchema.nullable()
|
|
2948
3010
|
});
|
|
2949
|
-
var SessionTelemetryListResponseSchema =
|
|
3011
|
+
var SessionTelemetryListResponseSchema = z19.object({
|
|
2950
3012
|
/** Bumped when counter semantics change; consumers gate on it. */
|
|
2951
|
-
version:
|
|
2952
|
-
capturedAt:
|
|
2953
|
-
sessions:
|
|
3013
|
+
version: z19.literal(1),
|
|
3014
|
+
capturedAt: z19.number(),
|
|
3015
|
+
sessions: z19.array(SessionTelemetrySchema)
|
|
2954
3016
|
});
|
|
2955
3017
|
|
|
2956
3018
|
// src/schemas/gezel.ts
|
|
2957
|
-
var ProviderNameSchema =
|
|
3019
|
+
var ProviderNameSchema = z20.enum([
|
|
2958
3020
|
"copilot",
|
|
2959
3021
|
"openai",
|
|
2960
3022
|
"anthropic",
|
|
@@ -2963,11 +3025,11 @@ var ProviderNameSchema = z19.enum([
|
|
|
2963
3025
|
"ollama",
|
|
2964
3026
|
"llama-cpp",
|
|
2965
3027
|
"mlx",
|
|
2966
|
-
// DwarfStar/ds4 — antirez's DeepSeek
|
|
2967
|
-
// it serves an OpenAI-compatible HTTP API from a supervised
|
|
2968
|
-
// but it only loads
|
|
2969
|
-
//
|
|
2970
|
-
//
|
|
3028
|
+
// DwarfStar/ds4 — antirez's specialized DeepSeek/GLM MoE engine. Like
|
|
3029
|
+
// llama-cpp/mlx it serves an OpenAI-compatible HTTP API from a supervised
|
|
3030
|
+
// native binary, but it only loads GGUF layouts the engine explicitly
|
|
3031
|
+
// supports. GPU-only (Metal/CUDA/ROCm upstream); see the ds4 provider for
|
|
3032
|
+
// Gezel's platform availability gating.
|
|
2971
3033
|
"ds4",
|
|
2972
3034
|
// Inference hosted on another paired gezel daemon ("remote models"). A
|
|
2973
3035
|
// single enum arm fronts a family of paired servers; the specific server is
|
|
@@ -2976,27 +3038,27 @@ var ProviderNameSchema = z19.enum([
|
|
|
2976
3038
|
// forward-pass is remoted — so `remote` is NOT a local provider.
|
|
2977
3039
|
"remote"
|
|
2978
3040
|
]);
|
|
2979
|
-
var GezelGenderSchema =
|
|
2980
|
-
var FixedFunctionConfigSchema =
|
|
3041
|
+
var GezelGenderSchema = z20.enum(["male", "female", "non-binary"]);
|
|
3042
|
+
var FixedFunctionConfigSchema = z20.object({
|
|
2981
3043
|
/** MCP tool name to forward to (e.g. `'generate_image'`). */
|
|
2982
|
-
tool:
|
|
3044
|
+
tool: z20.string().min(1),
|
|
2983
3045
|
/** Argument key on the tool that receives the user's message text. */
|
|
2984
|
-
promptKey:
|
|
3046
|
+
promptKey: z20.string().min(1).default("prompt"),
|
|
2985
3047
|
/** Defaults merged into every call; user text on `promptKey` always wins. */
|
|
2986
|
-
defaults:
|
|
3048
|
+
defaults: z20.record(z20.string(), z20.unknown()).optional()
|
|
2987
3049
|
});
|
|
2988
|
-
var GezelTraitSchema =
|
|
2989
|
-
id:
|
|
3050
|
+
var GezelTraitSchema = z20.object({
|
|
3051
|
+
id: z20.string(),
|
|
2990
3052
|
/** One imperative second-person sentence, rendered as a prompt bullet. */
|
|
2991
|
-
text:
|
|
2992
|
-
adoptedAt:
|
|
2993
|
-
source:
|
|
3053
|
+
text: z20.string().min(1).max(200),
|
|
3054
|
+
adoptedAt: z20.string(),
|
|
3055
|
+
source: z20.enum(["levelup", "manual"]).optional()
|
|
2994
3056
|
});
|
|
2995
|
-
var GezelFrontmatterSchema =
|
|
3057
|
+
var GezelFrontmatterSchema = z20.object({
|
|
2996
3058
|
id: EntityIdSchema.optional(),
|
|
2997
|
-
name:
|
|
2998
|
-
description:
|
|
2999
|
-
role:
|
|
3059
|
+
name: z20.string(),
|
|
3060
|
+
description: z20.string().optional(),
|
|
3061
|
+
role: z20.string().optional(),
|
|
3000
3062
|
/**
|
|
3001
3063
|
* Kebab-case slug derived from `role` (or `gezel-N` when role is absent),
|
|
3002
3064
|
* globally unique across the install. Collisions get `-2`, `-3`, …
|
|
@@ -3004,7 +3066,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3004
3066
|
* identifier for @-mentions and as the sole rendered identifier when
|
|
3005
3067
|
* `config.roleBasedNameOnlyMode` is enabled.
|
|
3006
3068
|
*/
|
|
3007
|
-
roleBasedName:
|
|
3069
|
+
roleBasedName: z20.string().optional(),
|
|
3008
3070
|
/**
|
|
3009
3071
|
* One of `male` / `female` / `non-binary`. Assigned at creation time
|
|
3010
3072
|
* from the matching gendered first-name pool (with a small chance of
|
|
@@ -3013,9 +3075,9 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3013
3075
|
* own prompt. Absent on legacy gezels, where references omit pronouns.
|
|
3014
3076
|
*/
|
|
3015
3077
|
gender: GezelGenderSchema.optional(),
|
|
3016
|
-
model:
|
|
3078
|
+
model: z20.string().optional(),
|
|
3017
3079
|
provider: ProviderNameSchema.optional(),
|
|
3018
|
-
reasoningEffort:
|
|
3080
|
+
reasoningEffort: z20.string().optional(),
|
|
3019
3081
|
/**
|
|
3020
3082
|
* Per-gezel sampling / reasoning / structured-output / tool-call overrides.
|
|
3021
3083
|
* Sparse — only set fields override the catalog's recommended defaults.
|
|
@@ -3048,8 +3110,8 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3048
3110
|
* low-temperature `thinking-precise` without locking the user out.
|
|
3049
3111
|
*/
|
|
3050
3112
|
suggestedTuningProfile: TuningProfileIdSchema.optional(),
|
|
3051
|
-
tools:
|
|
3052
|
-
tags:
|
|
3113
|
+
tools: z20.array(z20.string()).optional(),
|
|
3114
|
+
tags: z20.array(z20.string()).optional(),
|
|
3053
3115
|
/**
|
|
3054
3116
|
* When set, switches this gezel into "fixed-function" mode: chat
|
|
3055
3117
|
* messages bypass the LLM and forward to the named MCP tool. See
|
|
@@ -3059,9 +3121,9 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3059
3121
|
*/
|
|
3060
3122
|
fixedFunction: FixedFunctionConfigSchema.optional(),
|
|
3061
3123
|
/** Ollama-only: override the context window (tokens) for this gezel. */
|
|
3062
|
-
numCtx:
|
|
3124
|
+
numCtx: z20.number().int().positive().optional(),
|
|
3063
3125
|
/** When false, suppresses auto-recall on session start for this gezel. */
|
|
3064
|
-
autoRecall:
|
|
3126
|
+
autoRecall: z20.boolean().optional(),
|
|
3065
3127
|
/**
|
|
3066
3128
|
* Per-gezel proactive indexed-context policy. Supersedes `autoRecall` when
|
|
3067
3129
|
* present; absent inherits the install default. The generic `search` tool is
|
|
@@ -3072,7 +3134,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3072
3134
|
* Chat bubble font id (one of `GEZEL_CHAT_FONTS[*].id`). When unset or
|
|
3073
3135
|
* unrecognized, chat bubbles inherit the app default (Hanken Grotesk).
|
|
3074
3136
|
*/
|
|
3075
|
-
font:
|
|
3137
|
+
font: z20.string().optional(),
|
|
3076
3138
|
/**
|
|
3077
3139
|
* Kokoro TTS voice id (one of `KOKORO_VOICES[*].id`, e.g. `af_heart`,
|
|
3078
3140
|
* `bm_george`). Drives spoken audio rendering — `synthesize_speech`
|
|
@@ -3081,7 +3143,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3081
3143
|
* dialog. Absent on legacy gezels — synthesize falls back to the
|
|
3082
3144
|
* default voice (`af_heart`) when missing.
|
|
3083
3145
|
*/
|
|
3084
|
-
voice:
|
|
3146
|
+
voice: z20.string().optional(),
|
|
3085
3147
|
/**
|
|
3086
3148
|
* Provenance: the id of the gilde catalog template this gezel was
|
|
3087
3149
|
* created from, if any. Written by exact-template or about-omitted
|
|
@@ -3089,7 +3151,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3089
3151
|
* Absent on bespoke-generated or hand-authored gezels. The UI uses
|
|
3090
3152
|
* this to offer "reset to original template" on the about editor.
|
|
3091
3153
|
*/
|
|
3092
|
-
templateId:
|
|
3154
|
+
templateId: z20.string().optional(),
|
|
3093
3155
|
/**
|
|
3094
3156
|
* Provenance: the semver of the template version installed at create
|
|
3095
3157
|
* time. Paired with `templateId`. Absent on gezels created before this
|
|
@@ -3097,7 +3159,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3097
3159
|
* source version" and offers a refresh to current latest without
|
|
3098
3160
|
* comparing.
|
|
3099
3161
|
*/
|
|
3100
|
-
templateVersion:
|
|
3162
|
+
templateVersion: z20.string().optional(),
|
|
3101
3163
|
/**
|
|
3102
3164
|
* Copilot-only: when true, deny the Copilot CLI's built-in tools
|
|
3103
3165
|
* (bash, web_fetch, view, str_replace_editor, read_file, write_file,
|
|
@@ -3106,7 +3168,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3106
3168
|
* itself defaults to the sandboxed MCP surface.
|
|
3107
3169
|
* Provider other than copilot: ignored.
|
|
3108
3170
|
*/
|
|
3109
|
-
sandboxCopilot:
|
|
3171
|
+
sandboxCopilot: z20.boolean().optional(),
|
|
3110
3172
|
/**
|
|
3111
3173
|
* `anthropic-cli`-only: per-gezel override for the Claude CLI permission
|
|
3112
3174
|
* mode. Forwarded as `--permission-mode <value>` to each `claude` invocation.
|
|
@@ -3132,7 +3194,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3132
3194
|
* abstract sigil instead of the parametric poppetje. Default (absent /
|
|
3133
3195
|
* false) renders the poppetje everywhere. Toggled from Gezel Detail.
|
|
3134
3196
|
*/
|
|
3135
|
-
iconOverride:
|
|
3197
|
+
iconOverride: z20.boolean().optional(),
|
|
3136
3198
|
/**
|
|
3137
3199
|
* Standing behavior traits, adopted through the growth system (or
|
|
3138
3200
|
* hand-authored). Rendered as their own `### Traits` block in the
|
|
@@ -3141,7 +3203,7 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3141
3203
|
* The frontmatter list is AUTHORITATIVE for what's active — growth.json
|
|
3142
3204
|
* keeps the evidence-bearing adoption log.
|
|
3143
3205
|
*/
|
|
3144
|
-
traits:
|
|
3206
|
+
traits: z20.array(GezelTraitSchema).max(8).optional(),
|
|
3145
3207
|
/**
|
|
3146
3208
|
* Overrides `config.recognition.mode` for this gezel. A gezel whose job is
|
|
3147
3209
|
* reading screenshots sets `always`; everyone else inherits.
|
|
@@ -3151,48 +3213,48 @@ var GezelFrontmatterSchema = z19.object({
|
|
|
3151
3213
|
* support burden. Native vision is a property of the model *install*, not of
|
|
3152
3214
|
* the gezel, so it has no frontmatter counterpart.
|
|
3153
3215
|
*/
|
|
3154
|
-
recognition:
|
|
3216
|
+
recognition: z20.enum(["auto", "always", "off"]).optional()
|
|
3155
3217
|
});
|
|
3156
|
-
var GezelSectionSchema =
|
|
3157
|
-
heading:
|
|
3158
|
-
template:
|
|
3159
|
-
params:
|
|
3160
|
-
body:
|
|
3218
|
+
var GezelSectionSchema = z20.object({
|
|
3219
|
+
heading: z20.string(),
|
|
3220
|
+
template: z20.string().optional(),
|
|
3221
|
+
params: z20.record(z20.string(), z20.string()).optional(),
|
|
3222
|
+
body: z20.string()
|
|
3161
3223
|
});
|
|
3162
|
-
var ParsedGezelSchema =
|
|
3224
|
+
var ParsedGezelSchema = z20.object({
|
|
3163
3225
|
frontmatter: GezelFrontmatterSchema,
|
|
3164
|
-
sections:
|
|
3165
|
-
source:
|
|
3226
|
+
sections: z20.array(GezelSectionSchema),
|
|
3227
|
+
source: z20.string()
|
|
3166
3228
|
});
|
|
3167
|
-
var GezelSummarySchema =
|
|
3229
|
+
var GezelSummarySchema = z20.object({
|
|
3168
3230
|
id: EntityIdSchema,
|
|
3169
|
-
name:
|
|
3170
|
-
description:
|
|
3171
|
-
role:
|
|
3231
|
+
name: z20.string(),
|
|
3232
|
+
description: z20.string().optional(),
|
|
3233
|
+
role: z20.string().optional(),
|
|
3172
3234
|
/** Mirrors `GezelFrontmatter.roleBasedName`. */
|
|
3173
|
-
roleBasedName:
|
|
3235
|
+
roleBasedName: z20.string().optional(),
|
|
3174
3236
|
/** Mirrors `GezelFrontmatter.gender`. */
|
|
3175
3237
|
gender: GezelGenderSchema.optional(),
|
|
3176
|
-
model:
|
|
3238
|
+
model: z20.string().optional(),
|
|
3177
3239
|
provider: ProviderNameSchema.optional(),
|
|
3178
|
-
reasoningEffort:
|
|
3240
|
+
reasoningEffort: z20.string().optional(),
|
|
3179
3241
|
/** Mirrors `GezelFrontmatter.tuningProfile`. */
|
|
3180
3242
|
tuningProfile: TuningProfileIdSchema.optional(),
|
|
3181
3243
|
/** Mirrors `GezelFrontmatter.suggestedTuningProfile`. */
|
|
3182
3244
|
suggestedTuningProfile: TuningProfileIdSchema.optional(),
|
|
3183
|
-
numCtx:
|
|
3184
|
-
autoRecall:
|
|
3245
|
+
numCtx: z20.number().int().positive().optional(),
|
|
3246
|
+
autoRecall: z20.boolean().optional(),
|
|
3185
3247
|
/** Mirrors `GezelFrontmatter.retrieval`. */
|
|
3186
3248
|
retrieval: RetrievalPolicySchema.optional(),
|
|
3187
|
-
font:
|
|
3249
|
+
font: z20.string().optional(),
|
|
3188
3250
|
/** Mirrors `GezelFrontmatter.voice` — Kokoro TTS voice id. */
|
|
3189
|
-
voice:
|
|
3251
|
+
voice: z20.string().optional(),
|
|
3190
3252
|
/** Mirrors `GezelFrontmatter.templateId` when the gezel came from a gilde template. */
|
|
3191
|
-
templateId:
|
|
3253
|
+
templateId: z20.string().optional(),
|
|
3192
3254
|
/** Mirrors `GezelFrontmatter.templateVersion`. */
|
|
3193
|
-
templateVersion:
|
|
3255
|
+
templateVersion: z20.string().optional(),
|
|
3194
3256
|
/** Mirrors `GezelFrontmatter.sandboxCopilot`. */
|
|
3195
|
-
sandboxCopilot:
|
|
3257
|
+
sandboxCopilot: z20.boolean().optional(),
|
|
3196
3258
|
/** Mirrors `GezelFrontmatter.claudePermissionMode`. */
|
|
3197
3259
|
claudePermissionMode: ClaudePermissionModeSchema.optional(),
|
|
3198
3260
|
/** Mirrors `GezelFrontmatter.codexPermissionMode`. */
|
|
@@ -3205,7 +3267,7 @@ var GezelSummarySchema = z19.object({
|
|
|
3205
3267
|
* affordance.
|
|
3206
3268
|
*/
|
|
3207
3269
|
fixedFunction: FixedFunctionConfigSchema.optional(),
|
|
3208
|
-
icon:
|
|
3270
|
+
icon: z20.string().optional(),
|
|
3209
3271
|
/**
|
|
3210
3272
|
* The resolved poppetje character data for this gezel. Inlined on
|
|
3211
3273
|
* every list/detail response so the UI can render the parametric SVG
|
|
@@ -3215,9 +3277,9 @@ var GezelSummarySchema = z19.object({
|
|
|
3215
3277
|
*/
|
|
3216
3278
|
poppetje: PoppetjeSchema.optional(),
|
|
3217
3279
|
/** Mirrors `GezelFrontmatter.iconOverride`. */
|
|
3218
|
-
iconOverride:
|
|
3280
|
+
iconOverride: z20.boolean().optional(),
|
|
3219
3281
|
/** Mirrors `GezelFrontmatter.recognition`. */
|
|
3220
|
-
recognition:
|
|
3282
|
+
recognition: z20.enum(["auto", "always", "off"]).optional(),
|
|
3221
3283
|
/**
|
|
3222
3284
|
* Where this gezel lives. `global` (the default when absent — back-compat
|
|
3223
3285
|
* with every gezel on disk before this field existed) is the install-wide
|
|
@@ -3227,15 +3289,15 @@ var GezelSummarySchema = z19.object({
|
|
|
3227
3289
|
* badges project-scoped gezels and the roster only surfaces them inside
|
|
3228
3290
|
* their own project.
|
|
3229
3291
|
*/
|
|
3230
|
-
scope:
|
|
3292
|
+
scope: z20.enum(["global", "project"]).optional(),
|
|
3231
3293
|
/**
|
|
3232
3294
|
* Filesystem ownership boundary, distinct from `scope` above. Shared gezel
|
|
3233
3295
|
* identity lives in the installer-managed machine root; chats, memories,
|
|
3234
3296
|
* growth, credentials, and installed toolsets remain in the user home.
|
|
3235
3297
|
*/
|
|
3236
|
-
storageScope:
|
|
3298
|
+
storageScope: z20.enum(["user", "machine-shared"]).optional(),
|
|
3237
3299
|
/** Mirrors `GezelFrontmatter.traits`. */
|
|
3238
|
-
traits:
|
|
3300
|
+
traits: z20.array(GezelTraitSchema).optional(),
|
|
3239
3301
|
/**
|
|
3240
3302
|
* Lightweight growth summary (level + pending level-up flag),
|
|
3241
3303
|
* hydrated from growth.json and inlined on list/detail responses —
|
|
@@ -3243,11 +3305,11 @@ var GezelSummarySchema = z19.object({
|
|
|
3243
3305
|
* without N+1 follow-up requests.
|
|
3244
3306
|
*/
|
|
3245
3307
|
growth: GezelGrowthSummarySchema.optional(),
|
|
3246
|
-
updatedAt:
|
|
3308
|
+
updatedAt: z20.string()
|
|
3247
3309
|
});
|
|
3248
3310
|
var GezelDetailSchema = GezelSummarySchema.extend({
|
|
3249
3311
|
parsed: ParsedGezelSchema,
|
|
3250
|
-
about:
|
|
3312
|
+
about: z20.string(),
|
|
3251
3313
|
/**
|
|
3252
3314
|
* Optional contents of the per-gezel `tools.md` file. When present
|
|
3253
3315
|
* (non-null), fully replaces the auto-injected `## Tools available
|
|
@@ -3257,78 +3319,78 @@ var GezelDetailSchema = GezelSummarySchema.extend({
|
|
|
3257
3319
|
* default) means no override file exists and the runtime renders
|
|
3258
3320
|
* the auto-block from the live MCP bridge.
|
|
3259
3321
|
*/
|
|
3260
|
-
toolsMd:
|
|
3322
|
+
toolsMd: z20.string().nullable().default(null)
|
|
3261
3323
|
});
|
|
3262
|
-
var ToolCallImageSchema =
|
|
3324
|
+
var ToolCallImageSchema = z20.object({
|
|
3263
3325
|
/** Path relative to the project's artifacts/ root (e.g. `sessions/2026-04-19_143015_snake-test/tool-3-img-0.png`). */
|
|
3264
|
-
path:
|
|
3326
|
+
path: z20.string(),
|
|
3265
3327
|
/** MIME type of the image, used by the UI to set the right `<img>` src URL. */
|
|
3266
|
-
mimeType:
|
|
3328
|
+
mimeType: z20.string()
|
|
3267
3329
|
});
|
|
3268
|
-
var ToolCallAudioSchema =
|
|
3330
|
+
var ToolCallAudioSchema = z20.object({
|
|
3269
3331
|
/** Path relative to the project's artifacts/ root. */
|
|
3270
|
-
path:
|
|
3332
|
+
path: z20.string(),
|
|
3271
3333
|
/** MIME type, e.g. `audio/wav`. */
|
|
3272
|
-
mimeType:
|
|
3334
|
+
mimeType: z20.string(),
|
|
3273
3335
|
/** Duration in seconds when known — used by the UI to show length without preloading the blob. */
|
|
3274
|
-
durationSeconds:
|
|
3336
|
+
durationSeconds: z20.number().optional(),
|
|
3275
3337
|
/** Voice id used to produce this audio (TTS only). */
|
|
3276
|
-
voice:
|
|
3338
|
+
voice: z20.string().optional()
|
|
3277
3339
|
});
|
|
3278
|
-
var ToolCallVideoSchema =
|
|
3340
|
+
var ToolCallVideoSchema = z20.object({
|
|
3279
3341
|
/** Path relative to the project's artifacts/ root (e.g. `generated/video-123.mp4`). */
|
|
3280
|
-
path:
|
|
3342
|
+
path: z20.string(),
|
|
3281
3343
|
/** MIME type, e.g. `video/mp4`. */
|
|
3282
|
-
mimeType:
|
|
3344
|
+
mimeType: z20.string(),
|
|
3283
3345
|
/** Optional poster-frame artifact path for the `<video poster>` attribute. */
|
|
3284
|
-
posterPath:
|
|
3346
|
+
posterPath: z20.string().optional()
|
|
3285
3347
|
});
|
|
3286
|
-
var ToolCardStepSchema =
|
|
3287
|
-
id:
|
|
3288
|
-
name:
|
|
3289
|
-
status:
|
|
3348
|
+
var ToolCardStepSchema = z20.object({
|
|
3349
|
+
id: z20.string(),
|
|
3350
|
+
name: z20.string(),
|
|
3351
|
+
status: z20.enum(["done", "active", "pending"])
|
|
3290
3352
|
});
|
|
3291
|
-
var CraftbookStartCardSchema =
|
|
3292
|
-
kind:
|
|
3293
|
-
craftbookId:
|
|
3294
|
-
craftbookName:
|
|
3353
|
+
var CraftbookStartCardSchema = z20.object({
|
|
3354
|
+
kind: z20.literal("craftbook-start"),
|
|
3355
|
+
craftbookId: z20.string(),
|
|
3356
|
+
craftbookName: z20.string(),
|
|
3295
3357
|
/** Task ref `projectId/num`. */
|
|
3296
|
-
taskRef:
|
|
3358
|
+
taskRef: z20.string(),
|
|
3297
3359
|
/** The TASK's project — may differ from the session's when invoked cross-project. */
|
|
3298
|
-
projectId:
|
|
3360
|
+
projectId: z20.string(),
|
|
3299
3361
|
/** Task status at event time. */
|
|
3300
|
-
status:
|
|
3301
|
-
activeStepId:
|
|
3302
|
-
steps:
|
|
3362
|
+
status: z20.string(),
|
|
3363
|
+
activeStepId: z20.string().optional(),
|
|
3364
|
+
steps: z20.array(ToolCardStepSchema),
|
|
3303
3365
|
/** True when the call idempotently returned an already-running task. */
|
|
3304
|
-
reused:
|
|
3366
|
+
reused: z20.boolean().optional(),
|
|
3305
3367
|
/**
|
|
3306
3368
|
* The craftbook declares it works better with the External services
|
|
3307
3369
|
* capability. The UI nudges (with the optional author rationale) only
|
|
3308
3370
|
* while the resolved security policy has it disabled.
|
|
3309
3371
|
*/
|
|
3310
|
-
recommendsExternalServices:
|
|
3311
|
-
});
|
|
3312
|
-
var TaskStepAdvanceCardSchema =
|
|
3313
|
-
kind:
|
|
3314
|
-
craftbookId:
|
|
3315
|
-
craftbookName:
|
|
3316
|
-
taskRef:
|
|
3317
|
-
projectId:
|
|
3318
|
-
status:
|
|
3319
|
-
completedStepId:
|
|
3320
|
-
completedStepName:
|
|
3372
|
+
recommendsExternalServices: z20.object({ reason: z20.string().optional() }).optional()
|
|
3373
|
+
});
|
|
3374
|
+
var TaskStepAdvanceCardSchema = z20.object({
|
|
3375
|
+
kind: z20.literal("task-step-advance"),
|
|
3376
|
+
craftbookId: z20.string(),
|
|
3377
|
+
craftbookName: z20.string(),
|
|
3378
|
+
taskRef: z20.string(),
|
|
3379
|
+
projectId: z20.string(),
|
|
3380
|
+
status: z20.string(),
|
|
3381
|
+
completedStepId: z20.string(),
|
|
3382
|
+
completedStepName: z20.string().optional(),
|
|
3321
3383
|
/** Absent when the advance took the task terminal (complete/canceled). */
|
|
3322
|
-
activeStepId:
|
|
3323
|
-
activeStepName:
|
|
3324
|
-
steps:
|
|
3384
|
+
activeStepId: z20.string().optional(),
|
|
3385
|
+
activeStepName: z20.string().optional(),
|
|
3386
|
+
steps: z20.array(ToolCardStepSchema)
|
|
3325
3387
|
});
|
|
3326
|
-
var ToolCallCardSchema =
|
|
3388
|
+
var ToolCallCardSchema = z20.discriminatedUnion("kind", [
|
|
3327
3389
|
CraftbookStartCardSchema,
|
|
3328
3390
|
TaskStepAdvanceCardSchema
|
|
3329
3391
|
]);
|
|
3330
|
-
var ChatMessageToolCallSchema =
|
|
3331
|
-
name:
|
|
3392
|
+
var ChatMessageToolCallSchema = z20.object({
|
|
3393
|
+
name: z20.string(),
|
|
3332
3394
|
/**
|
|
3333
3395
|
* ISO timestamp of the call's START. Optional: absent on every message
|
|
3334
3396
|
* persisted before this field existed, so readers must not assume it.
|
|
@@ -3336,16 +3398,16 @@ var ChatMessageToolCallSchema = z19.object({
|
|
|
3336
3398
|
* (run recordings, the eval movie pipeline) intra-turn ordering with
|
|
3337
3399
|
* absolute time — array order alone cannot place calls on a timeline.
|
|
3338
3400
|
*/
|
|
3339
|
-
at:
|
|
3340
|
-
durationMs:
|
|
3341
|
-
success:
|
|
3342
|
-
errorMessage:
|
|
3401
|
+
at: z20.string().optional(),
|
|
3402
|
+
durationMs: z20.number(),
|
|
3403
|
+
success: z20.boolean(),
|
|
3404
|
+
errorMessage: z20.string().optional(),
|
|
3343
3405
|
/** File path the tool touched, for the References pane. */
|
|
3344
|
-
path:
|
|
3406
|
+
path: z20.string().optional(),
|
|
3345
3407
|
/** Ordered file paths touched by a batched filesystem tool. */
|
|
3346
|
-
paths:
|
|
3408
|
+
paths: z20.array(z20.string()).optional(),
|
|
3347
3409
|
/** Compact, human-readable one-liner ("→ Freja: update the game loop · file: workspace/index.html"). */
|
|
3348
|
-
argsSummary:
|
|
3410
|
+
argsSummary: z20.string().optional(),
|
|
3349
3411
|
/**
|
|
3350
3412
|
* The tool call's FULL arguments, rendered as readable text (field by
|
|
3351
3413
|
* field, bulky values shown in full — not truncated like
|
|
@@ -3356,26 +3418,26 @@ var ChatMessageToolCallSchema = z19.object({
|
|
|
3356
3418
|
* arguments are not a secret vector in this codebase (secrets live in
|
|
3357
3419
|
* the toolset-config path), so this is not separately redacted.
|
|
3358
3420
|
*/
|
|
3359
|
-
argsFull:
|
|
3421
|
+
argsFull: z20.string().optional(),
|
|
3360
3422
|
/** Short full response, or a bounded beginning/end summary for a long response. */
|
|
3361
|
-
resultText:
|
|
3423
|
+
resultText: z20.string().optional(),
|
|
3362
3424
|
/** True when `resultText` is a bounded summary rather than the complete response. */
|
|
3363
|
-
resultTruncated:
|
|
3425
|
+
resultTruncated: z20.boolean().optional(),
|
|
3364
3426
|
/** Image artifacts the tool returned (e.g. browser_snapshot screenshots). */
|
|
3365
|
-
images:
|
|
3427
|
+
images: z20.array(ToolCallImageSchema).optional(),
|
|
3366
3428
|
/** Audio artifacts the tool returned (e.g. synthesize_speech WAV). */
|
|
3367
|
-
audios:
|
|
3429
|
+
audios: z20.array(ToolCallAudioSchema).optional(),
|
|
3368
3430
|
/** Video artifacts the tool returned (e.g. generate_video mp4). */
|
|
3369
|
-
videos:
|
|
3431
|
+
videos: z20.array(ToolCallVideoSchema).optional(),
|
|
3370
3432
|
/**
|
|
3371
3433
|
* Unified diff describing the change a surgical-edit tool made
|
|
3372
3434
|
* (`replace_in_file`, `apply_patch`, `insert_at_marker`). Used by the UI
|
|
3373
3435
|
* to render an inline diff under the tool-call row. Capped at ~100KB
|
|
3374
3436
|
* server-side; larger diffs are truncated with a marker line.
|
|
3375
3437
|
*/
|
|
3376
|
-
diff:
|
|
3377
|
-
addedLines:
|
|
3378
|
-
removedLines:
|
|
3438
|
+
diff: z20.string().optional(),
|
|
3439
|
+
addedLines: z20.number().int().nonnegative().optional(),
|
|
3440
|
+
removedLines: z20.number().int().nonnegative().optional(),
|
|
3379
3441
|
/** Rich inline card payload for tools with special renderings — see ToolCallCardSchema. */
|
|
3380
3442
|
card: ToolCallCardSchema.optional(),
|
|
3381
3443
|
/**
|
|
@@ -3398,42 +3460,42 @@ var ChatMessageToolCallSchema = z19.object({
|
|
|
3398
3460
|
* message written before this field existed — the expander then
|
|
3399
3461
|
* renders the plain trace it always did.
|
|
3400
3462
|
*/
|
|
3401
|
-
afterReasoningChars:
|
|
3463
|
+
afterReasoningChars: z20.number().int().min(0).optional()
|
|
3402
3464
|
});
|
|
3403
|
-
var ChatSessionSourceSchema =
|
|
3404
|
-
kind:
|
|
3465
|
+
var ChatSessionSourceSchema = z20.object({
|
|
3466
|
+
kind: z20.literal("external"),
|
|
3405
3467
|
/** Stable integration id, e.g. `pi`. */
|
|
3406
|
-
appId:
|
|
3468
|
+
appId: z20.string().min(1),
|
|
3407
3469
|
/** Human-facing application name, e.g. `Pi`. */
|
|
3408
|
-
appName:
|
|
3470
|
+
appName: z20.string().min(1),
|
|
3409
3471
|
/** The external application's stable conversation/session identifier. */
|
|
3410
|
-
externalConversationId:
|
|
3472
|
+
externalConversationId: z20.string().min(1),
|
|
3411
3473
|
/** External threads are ledger views; the owning app controls replies. */
|
|
3412
|
-
readOnly:
|
|
3474
|
+
readOnly: z20.literal(true),
|
|
3413
3475
|
/** Working-directory hint supplied by the external app, when available. */
|
|
3414
|
-
workingDirectory:
|
|
3476
|
+
workingDirectory: z20.string().optional(),
|
|
3415
3477
|
/** Project id/name hint supplied by the external app, when available. */
|
|
3416
|
-
projectHint:
|
|
3478
|
+
projectHint: z20.string().optional()
|
|
3417
3479
|
});
|
|
3418
|
-
var ReferencedFileKindSchema =
|
|
3419
|
-
var ReferencedFileSchema =
|
|
3480
|
+
var ReferencedFileKindSchema = z20.enum(["artifact", "workspace"]);
|
|
3481
|
+
var ReferencedFileSchema = z20.object({
|
|
3420
3482
|
kind: ReferencedFileKindSchema,
|
|
3421
|
-
path:
|
|
3422
|
-
});
|
|
3423
|
-
var ContextCompactionSchema =
|
|
3424
|
-
removedCount:
|
|
3425
|
-
contextWindow:
|
|
3426
|
-
estimatedTokensBefore:
|
|
3427
|
-
compactionCount:
|
|
3428
|
-
autoCompactRatio:
|
|
3429
|
-
});
|
|
3430
|
-
var ChatMessageSchema =
|
|
3431
|
-
role:
|
|
3432
|
-
content:
|
|
3433
|
-
at:
|
|
3434
|
-
from:
|
|
3435
|
-
gezelId:
|
|
3436
|
-
gezelName:
|
|
3483
|
+
path: z20.string()
|
|
3484
|
+
});
|
|
3485
|
+
var ContextCompactionSchema = z20.object({
|
|
3486
|
+
removedCount: z20.number().int().nonnegative(),
|
|
3487
|
+
contextWindow: z20.number().int().positive(),
|
|
3488
|
+
estimatedTokensBefore: z20.number().int().nonnegative(),
|
|
3489
|
+
compactionCount: z20.number().int().positive(),
|
|
3490
|
+
autoCompactRatio: z20.number().positive().max(1)
|
|
3491
|
+
});
|
|
3492
|
+
var ChatMessageSchema = z20.object({
|
|
3493
|
+
role: z20.enum(["user", "assistant"]),
|
|
3494
|
+
content: z20.string(),
|
|
3495
|
+
at: z20.string(),
|
|
3496
|
+
from: z20.object({
|
|
3497
|
+
gezelId: z20.string(),
|
|
3498
|
+
gezelName: z20.string(),
|
|
3437
3499
|
/**
|
|
3438
3500
|
* The SENDER's session id — the durable per-edge record of which
|
|
3439
3501
|
* thread this message came from. `session.parentSession` only says
|
|
@@ -3442,9 +3504,9 @@ var ChatMessageSchema = z19.object({
|
|
|
3442
3504
|
* edge, including later senders into an existing session. Optional:
|
|
3443
3505
|
* absent on messages persisted before the field existed.
|
|
3444
3506
|
*/
|
|
3445
|
-
sessionId:
|
|
3507
|
+
sessionId: z20.string().optional(),
|
|
3446
3508
|
/** How the sender reached this session; mirrors SessionParent.kind. */
|
|
3447
|
-
kind:
|
|
3509
|
+
kind: z20.enum(["delegation", "consultation", "task-entry", "task-handoff"]).optional()
|
|
3448
3510
|
}).optional(),
|
|
3449
3511
|
/**
|
|
3450
3512
|
* Real files the assistant reply named in its body text — artifacts
|
|
@@ -3454,7 +3516,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3454
3516
|
* match a real file. Back-stops Copilot's tool-call blindspot and any
|
|
3455
3517
|
* "AI wrote a file outside the MCP tools" path.
|
|
3456
3518
|
*/
|
|
3457
|
-
referencedFiles:
|
|
3519
|
+
referencedFiles: z20.array(ReferencedFileSchema).optional(),
|
|
3458
3520
|
/**
|
|
3459
3521
|
* The artifact-only projection of {@link referencedFiles}, still
|
|
3460
3522
|
* written so an older `@bendyline/gezel-cli` (or any out-of-tree
|
|
@@ -3464,7 +3526,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3464
3526
|
*
|
|
3465
3527
|
* @deprecated superseded by `referencedFiles`
|
|
3466
3528
|
*/
|
|
3467
|
-
referencedArtifacts:
|
|
3529
|
+
referencedArtifacts: z20.array(z20.string()).optional(),
|
|
3468
3530
|
/**
|
|
3469
3531
|
* Task refs (`<projectId>/<num>`) the assistant reply mentioned. Same
|
|
3470
3532
|
* shape as `referencedFiles` — populated on save, gated on the
|
|
@@ -3473,7 +3535,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3473
3535
|
* gezel-ux-roadmap/2" mention so the user can jump to it without
|
|
3474
3536
|
* scrolling the body for the ref.
|
|
3475
3537
|
*/
|
|
3476
|
-
referencedTasks:
|
|
3538
|
+
referencedTasks: z20.array(z20.string()).optional(),
|
|
3477
3539
|
/**
|
|
3478
3540
|
* Indexed-context sources consulted for THIS user turn (proactive
|
|
3479
3541
|
* retrieval). Citations only — source/path/line/score, never the retrieved
|
|
@@ -3481,15 +3543,15 @@ var ChatMessageSchema = z19.object({
|
|
|
3481
3543
|
* "consulted N sources" row so proactive RAG is visible diligence instead
|
|
3482
3544
|
* of invisible machinery.
|
|
3483
3545
|
*/
|
|
3484
|
-
retrieval:
|
|
3485
|
-
hits:
|
|
3486
|
-
|
|
3546
|
+
retrieval: z20.object({
|
|
3547
|
+
hits: z20.array(
|
|
3548
|
+
z20.object({
|
|
3487
3549
|
source: RetrievalSourceSchema,
|
|
3488
|
-
projectId:
|
|
3489
|
-
path:
|
|
3490
|
-
line:
|
|
3491
|
-
lineEnd:
|
|
3492
|
-
score:
|
|
3550
|
+
projectId: z20.string().optional(),
|
|
3551
|
+
path: z20.string().optional(),
|
|
3552
|
+
line: z20.number().int().positive().optional(),
|
|
3553
|
+
lineEnd: z20.number().int().positive().optional(),
|
|
3554
|
+
score: z20.number()
|
|
3493
3555
|
})
|
|
3494
3556
|
)
|
|
3495
3557
|
}).optional(),
|
|
@@ -3499,7 +3561,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3499
3561
|
* "thinking" expando above the reply body so the user can still see
|
|
3500
3562
|
* what ran even after the live stream has closed.
|
|
3501
3563
|
*/
|
|
3502
|
-
toolCalls:
|
|
3564
|
+
toolCalls: z20.array(ChatMessageToolCallSchema).optional(),
|
|
3503
3565
|
/**
|
|
3504
3566
|
* Phase announcements the model emitted via Copilot's `report_intent`
|
|
3505
3567
|
* tool during this turn. Each entry carries the intent label and an
|
|
@@ -3510,10 +3572,10 @@ var ChatMessageSchema = z19.object({
|
|
|
3510
3572
|
* replay and history export are unaffected. Copilot-only; other
|
|
3511
3573
|
* providers don't emit these.
|
|
3512
3574
|
*/
|
|
3513
|
-
intents:
|
|
3514
|
-
|
|
3515
|
-
label:
|
|
3516
|
-
afterChars:
|
|
3575
|
+
intents: z20.array(
|
|
3576
|
+
z20.object({
|
|
3577
|
+
label: z20.string(),
|
|
3578
|
+
afterChars: z20.number().int().min(0)
|
|
3517
3579
|
})
|
|
3518
3580
|
).optional(),
|
|
3519
3581
|
/**
|
|
@@ -3523,7 +3585,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3523
3585
|
* itself lives in the per-project questions file; this id is just
|
|
3524
3586
|
* the foreign key.
|
|
3525
3587
|
*/
|
|
3526
|
-
pendingQuestionId:
|
|
3588
|
+
pendingQuestionId: z20.string().optional(),
|
|
3527
3589
|
/**
|
|
3528
3590
|
* Marks the message as a system-generated synthesis rather than a real
|
|
3529
3591
|
* model turn.
|
|
@@ -3552,7 +3614,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3552
3614
|
* UI renders these as muted bubbles; the model sees them as normal
|
|
3553
3615
|
* assistant turns (the role label is what matters to the API).
|
|
3554
3616
|
*/
|
|
3555
|
-
synthetic:
|
|
3617
|
+
synthetic: z20.enum([
|
|
3556
3618
|
"compaction-summary",
|
|
3557
3619
|
"context-loop-halt",
|
|
3558
3620
|
"turn-aborted",
|
|
@@ -3577,7 +3639,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3577
3639
|
* from loaded transcripts and the live-timeline handler skips its bubble
|
|
3578
3640
|
* while still opening the assistant's streaming slot.
|
|
3579
3641
|
*/
|
|
3580
|
-
hidden:
|
|
3642
|
+
hidden: z20.boolean().optional(),
|
|
3581
3643
|
/**
|
|
3582
3644
|
* This user message was delivered from the session's mid-turn queue
|
|
3583
3645
|
* as a nudge — typed while the previous turn was still streaming and
|
|
@@ -3585,14 +3647,14 @@ var ChatMessageSchema = z19.object({
|
|
|
3585
3647
|
* Display-only marker: the model sees a normal user turn; the UI
|
|
3586
3648
|
* renders a small "nudged" chip on the bubble.
|
|
3587
3649
|
*/
|
|
3588
|
-
nudge:
|
|
3650
|
+
nudge: z20.boolean().optional(),
|
|
3589
3651
|
/**
|
|
3590
3652
|
* The prompt draft (`artifacts/prompts/<draftId>/`) this user message was
|
|
3591
3653
|
* sent from. Display-only: the model never sees it, and the draft may since
|
|
3592
3654
|
* have been swept, so the UI must treat a dangling id as "no prompt to
|
|
3593
3655
|
* open" rather than an error.
|
|
3594
3656
|
*/
|
|
3595
|
-
draftId:
|
|
3657
|
+
draftId: z20.string().optional(),
|
|
3596
3658
|
/**
|
|
3597
3659
|
* The machinery — not the human — authored this `role: 'user'` message.
|
|
3598
3660
|
* Task dispatch seeds, step handoffs, and project-page reaction seeds
|
|
@@ -3611,7 +3673,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3611
3673
|
* widen it without a second field. Messages written before this field
|
|
3612
3674
|
* existed are inferred at read time — see `Store.listTimeline`.
|
|
3613
3675
|
*/
|
|
3614
|
-
origin:
|
|
3676
|
+
origin: z20.enum(["system"]).optional(),
|
|
3615
3677
|
/**
|
|
3616
3678
|
* Persistent warnings attached to this assistant turn — fabricated
|
|
3617
3679
|
* tool-use detection, degraded provider state, etc. The streaming
|
|
@@ -3621,7 +3683,7 @@ var ChatMessageSchema = z19.object({
|
|
|
3621
3683
|
* reload. Populated by the chat manager just before `events.publish`
|
|
3622
3684
|
* fires the `complete` event.
|
|
3623
3685
|
*/
|
|
3624
|
-
warnings:
|
|
3686
|
+
warnings: z20.array(z20.string()).optional(),
|
|
3625
3687
|
/**
|
|
3626
3688
|
* Chain-of-thought captured during this turn. Local providers
|
|
3627
3689
|
* (ollama, llama-cpp, mlx, ds4) extract `<think>…</think>` /
|
|
@@ -3634,14 +3696,14 @@ var ChatMessageSchema = z19.object({
|
|
|
3634
3696
|
* Responses hides reasoning server-side and leaves this unset.
|
|
3635
3697
|
* Empty / whitespace-only captures are dropped.
|
|
3636
3698
|
*/
|
|
3637
|
-
reasoning:
|
|
3699
|
+
reasoning: z20.string().optional(),
|
|
3638
3700
|
/**
|
|
3639
3701
|
* Observed wall-clock span of the streamed private-reasoning trace,
|
|
3640
3702
|
* measured from the first `reasoning_delta` to the last. Optional
|
|
3641
3703
|
* because older messages and providers that only expose reasoning at
|
|
3642
3704
|
* commit time have no trustworthy phase timing.
|
|
3643
3705
|
*/
|
|
3644
|
-
reasoningDurationMs:
|
|
3706
|
+
reasoningDurationMs: z20.number().int().nonnegative().optional(),
|
|
3645
3707
|
/**
|
|
3646
3708
|
* Tool-call bodies the model emitted that the salvage layer
|
|
3647
3709
|
* couldn't parse — the literal text from `<|tool_call|>` markers
|
|
@@ -3656,10 +3718,10 @@ var ChatMessageSchema = z19.object({
|
|
|
3656
3718
|
* hundred chars per body in the populator so a long fabricated body
|
|
3657
3719
|
* doesn't blow up the session file.
|
|
3658
3720
|
*/
|
|
3659
|
-
attemptedToolCalls:
|
|
3660
|
-
|
|
3661
|
-
body:
|
|
3662
|
-
reason:
|
|
3721
|
+
attemptedToolCalls: z20.array(
|
|
3722
|
+
z20.object({
|
|
3723
|
+
body: z20.string(),
|
|
3724
|
+
reason: z20.string().optional()
|
|
3663
3725
|
})
|
|
3664
3726
|
).optional(),
|
|
3665
3727
|
/**
|
|
@@ -3675,28 +3737,28 @@ var ChatMessageSchema = z19.object({
|
|
|
3675
3737
|
* daemon restart, a provider reset, or a context-pressure rebuild — leaving
|
|
3676
3738
|
* the model replaying a bare ``.
|
|
3677
3739
|
*/
|
|
3678
|
-
recognizedImages:
|
|
3740
|
+
recognizedImages: z20.array(MessageImageDigestSchema).optional()
|
|
3679
3741
|
});
|
|
3680
|
-
var ChatTurnErrorDetailSchema =
|
|
3681
|
-
code:
|
|
3742
|
+
var ChatTurnErrorDetailSchema = z20.object({
|
|
3743
|
+
code: z20.string().max(64).optional(),
|
|
3682
3744
|
/** Component that failed — a provider name (`llama-cpp`) or a subsystem. */
|
|
3683
|
-
engine:
|
|
3745
|
+
engine: z20.string().max(64).optional(),
|
|
3684
3746
|
/** Correlation key, also written into the engine's own incident log. */
|
|
3685
|
-
incidentId:
|
|
3747
|
+
incidentId: z20.string().max(64).optional(),
|
|
3686
3748
|
/** Native crash class from the exit snapshot, e.g. `cuda-out-of-memory`. */
|
|
3687
|
-
panicKind:
|
|
3688
|
-
exitCode:
|
|
3689
|
-
signal:
|
|
3749
|
+
panicKind: z20.string().max(64).optional(),
|
|
3750
|
+
exitCode: z20.number().int().nullable().optional(),
|
|
3751
|
+
signal: z20.string().max(32).nullable().optional(),
|
|
3690
3752
|
/**
|
|
3691
3753
|
* Request-independent launch facts copied from the crash snapshot, which
|
|
3692
3754
|
* is contractually free of prompts, tool arguments, and secrets. Bounded
|
|
3693
3755
|
* by the extractor. A machine profile cannot reconstruct which model at
|
|
3694
3756
|
* which context size with which KV type crashed; this can.
|
|
3695
3757
|
*/
|
|
3696
|
-
diagnostics:
|
|
3758
|
+
diagnostics: z20.record(z20.string(), z20.union([z20.string(), z20.number(), z20.boolean()])).optional()
|
|
3697
3759
|
});
|
|
3698
|
-
var ChatEventSchema =
|
|
3699
|
-
|
|
3760
|
+
var ChatEventSchema = z20.discriminatedUnion("type", [
|
|
3761
|
+
z20.object({ type: z20.literal("delta"), content: z20.string() }),
|
|
3700
3762
|
/**
|
|
3701
3763
|
* Live private-reasoning tokens (ds4's think phase), streamed on their
|
|
3702
3764
|
* own channel so they never mix into the visible `delta` stream, the
|
|
@@ -3704,14 +3766,14 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3704
3766
|
* renders them as a distinct "thinking" block that collapses into the
|
|
3705
3767
|
* committed message's reasoning expander once `complete` lands.
|
|
3706
3768
|
*/
|
|
3707
|
-
|
|
3708
|
-
|
|
3769
|
+
z20.object({ type: z20.literal("reasoning_delta"), content: z20.string() }),
|
|
3770
|
+
z20.object({ type: z20.literal("complete"), message: ChatMessageSchema }),
|
|
3709
3771
|
/**
|
|
3710
3772
|
* The user submitted a message, but a cold provider session is still being
|
|
3711
3773
|
* created. Project timelines render this as a temporary pending row until
|
|
3712
3774
|
* the durable `user_message` or a terminal `error` arrives.
|
|
3713
3775
|
*/
|
|
3714
|
-
|
|
3776
|
+
z20.object({ type: z20.literal("user_message_pending"), preview: z20.string() }),
|
|
3715
3777
|
/**
|
|
3716
3778
|
* Emitted right after the user's message is appended to the session
|
|
3717
3779
|
* record. The legacy session-scoped UI inserted user messages locally
|
|
@@ -3719,29 +3781,29 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3719
3781
|
* envelope streams need it so the interleaved timeline can render the
|
|
3720
3782
|
* user's bubble immediately, before any assistant deltas.
|
|
3721
3783
|
*/
|
|
3722
|
-
|
|
3784
|
+
z20.object({ type: z20.literal("user_message"), message: ChatMessageSchema }),
|
|
3723
3785
|
/**
|
|
3724
3786
|
* Emitted when the assistant invokes an MCP tool (OpenAI + Mock paths
|
|
3725
3787
|
* only — Copilot runs tools inside its subprocess, invisible to us).
|
|
3726
3788
|
* The UI surfaces these as "thinking" breadcrumbs.
|
|
3727
3789
|
*/
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3730
|
-
name:
|
|
3790
|
+
z20.object({
|
|
3791
|
+
type: z20.literal("tool"),
|
|
3792
|
+
name: z20.string(),
|
|
3731
3793
|
/** ISO start-of-call timestamp; see ChatMessageToolCallSchema.at. */
|
|
3732
|
-
at:
|
|
3733
|
-
durationMs:
|
|
3734
|
-
success:
|
|
3735
|
-
errorMessage:
|
|
3794
|
+
at: z20.string().optional(),
|
|
3795
|
+
durationMs: z20.number(),
|
|
3796
|
+
success: z20.boolean(),
|
|
3797
|
+
errorMessage: z20.string().optional(),
|
|
3736
3798
|
/**
|
|
3737
3799
|
* File path the tool touched (if any). Set for tools that take a `path`
|
|
3738
3800
|
* argument: readFile, writeFile, read_artifact, write_artifact,
|
|
3739
3801
|
* read_document, write_document. Lets the UI build a References panel
|
|
3740
3802
|
* without guessing.
|
|
3741
3803
|
*/
|
|
3742
|
-
path:
|
|
3804
|
+
path: z20.string().optional(),
|
|
3743
3805
|
/** Ordered file paths touched by a batched filesystem tool. */
|
|
3744
|
-
paths:
|
|
3806
|
+
paths: z20.array(z20.string()).optional(),
|
|
3745
3807
|
/**
|
|
3746
3808
|
* Compact human-readable preview of the non-bulky arguments. Example:
|
|
3747
3809
|
* `gezel: "Maya", message: "what's the status of..."`. Values are
|
|
@@ -3749,46 +3811,46 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3749
3811
|
* UI to render a useful in-progress tool line instead of just the
|
|
3750
3812
|
* tool name.
|
|
3751
3813
|
*/
|
|
3752
|
-
argsSummary:
|
|
3814
|
+
argsSummary: z20.string().optional(),
|
|
3753
3815
|
/** Full, readable args for the expand + copy affordance. See the persisted `ChatMessageToolCall.argsFull`. */
|
|
3754
|
-
argsFull:
|
|
3816
|
+
argsFull: z20.string().optional(),
|
|
3755
3817
|
/** Short full response, or a bounded beginning/end summary. */
|
|
3756
|
-
resultText:
|
|
3818
|
+
resultText: z20.string().optional(),
|
|
3757
3819
|
/** True when `resultText` is a bounded summary rather than the complete response. */
|
|
3758
|
-
resultTruncated:
|
|
3820
|
+
resultTruncated: z20.boolean().optional(),
|
|
3759
3821
|
/**
|
|
3760
3822
|
* Image artifacts the tool returned (most commonly browser screenshots).
|
|
3761
3823
|
* Paths are relative to the project's artifacts/ root and resolved
|
|
3762
3824
|
* to URLs by the UI via the artifact-read endpoint.
|
|
3763
3825
|
*/
|
|
3764
|
-
images:
|
|
3826
|
+
images: z20.array(ToolCallImageSchema).optional(),
|
|
3765
3827
|
/**
|
|
3766
3828
|
* Audio artifacts the tool returned (synthesize_speech narrations,
|
|
3767
3829
|
* voice memos transcribed via transcribe_audio). Same artifact-path
|
|
3768
3830
|
* resolution as `images`.
|
|
3769
3831
|
*/
|
|
3770
|
-
audios:
|
|
3832
|
+
audios: z20.array(ToolCallAudioSchema).optional(),
|
|
3771
3833
|
/**
|
|
3772
3834
|
* Video artifacts the tool returned (`generate_video`). Same
|
|
3773
3835
|
* artifact-path resolution as `images`; rendered as a `<video>`
|
|
3774
3836
|
* player in the chat row.
|
|
3775
3837
|
*/
|
|
3776
|
-
videos:
|
|
3838
|
+
videos: z20.array(ToolCallVideoSchema).optional(),
|
|
3777
3839
|
/**
|
|
3778
3840
|
* Unified diff describing the change a surgical-edit tool made
|
|
3779
3841
|
* (`replace_in_file`, `apply_patch`, `insert_at_marker`). Streams to the
|
|
3780
3842
|
* UI mid-turn so the chat bubble can render an inline diff under
|
|
3781
3843
|
* the tool-call row even before the assistant message is finalized.
|
|
3782
3844
|
*/
|
|
3783
|
-
diff:
|
|
3784
|
-
addedLines:
|
|
3785
|
-
removedLines:
|
|
3845
|
+
diff: z20.string().optional(),
|
|
3846
|
+
addedLines: z20.number().int().nonnegative().optional(),
|
|
3847
|
+
removedLines: z20.number().int().nonnegative().optional(),
|
|
3786
3848
|
/** Rich inline card payload for tools with special renderings — see ToolCallCardSchema. */
|
|
3787
3849
|
card: ToolCallCardSchema.optional()
|
|
3788
3850
|
}),
|
|
3789
|
-
|
|
3790
|
-
type:
|
|
3791
|
-
error:
|
|
3851
|
+
z20.object({
|
|
3852
|
+
type: z20.literal("error"),
|
|
3853
|
+
error: z20.string(),
|
|
3792
3854
|
// Not `detail` — three sibling variants in this union already use that
|
|
3793
3855
|
// name for free-form progress prose, and one union with two meanings for
|
|
3794
3856
|
// one key is a trap.
|
|
@@ -3799,8 +3861,8 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3799
3861
|
* surface. This is terminal for the live UI, but is deliberately not an
|
|
3800
3862
|
* error: it must not poison the session or render failure recovery UI.
|
|
3801
3863
|
*/
|
|
3802
|
-
|
|
3803
|
-
|
|
3864
|
+
z20.object({ type: z20.literal("cancelled") }),
|
|
3865
|
+
z20.object({ type: z20.literal("done") }),
|
|
3804
3866
|
/**
|
|
3805
3867
|
* Emitted when a turn ends up waiting in the provider queue for more
|
|
3806
3868
|
* than a brief grace period (~200ms). `aheadOf` is an approximate
|
|
@@ -3810,7 +3872,7 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3810
3872
|
* emit this event — avoids flashing the indicator on the happy path
|
|
3811
3873
|
* where the queue is empty.
|
|
3812
3874
|
*/
|
|
3813
|
-
|
|
3875
|
+
z20.object({ type: z20.literal("queued"), aheadOf: z20.number().int().min(0) }),
|
|
3814
3876
|
/**
|
|
3815
3877
|
* Ollama-only: emitted for each bare framing chunk that arrives
|
|
3816
3878
|
* on the wire without visible content / tool_calls — the
|
|
@@ -3820,7 +3882,7 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3820
3882
|
* when the model isn't producing visible output. Reset on the
|
|
3821
3883
|
* next real `delta`, `tool`, or `complete`.
|
|
3822
3884
|
*/
|
|
3823
|
-
|
|
3885
|
+
z20.object({ type: z20.literal("wire_pulse") }),
|
|
3824
3886
|
/**
|
|
3825
3887
|
* Live tool-argument stream. Fired while the model is generating a
|
|
3826
3888
|
* structured tool call — most visibly a multi-minute `write_file`
|
|
@@ -3832,7 +3894,7 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3832
3894
|
* "working" block (same pattern as `reasoning_delta`) and drops the
|
|
3833
3895
|
* block when the corresponding `tool` event lands.
|
|
3834
3896
|
*/
|
|
3835
|
-
|
|
3897
|
+
z20.object({ type: z20.literal("tool_args_delta"), name: z20.string(), content: z20.string() }),
|
|
3836
3898
|
/**
|
|
3837
3899
|
* Emitted when a provider tells us it's still doing work — even though
|
|
3838
3900
|
* no visible text/tool event has arrived. Today this is wired from
|
|
@@ -3843,24 +3905,24 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3843
3905
|
* Optional `label` carries a short phase hint ('thinking', 'tool',
|
|
3844
3906
|
* etc.) that the streaming bubble can surface as a status line.
|
|
3845
3907
|
*/
|
|
3846
|
-
|
|
3908
|
+
z20.object({ type: z20.literal("heartbeat"), label: z20.string().optional() }),
|
|
3847
3909
|
/**
|
|
3848
3910
|
* Provider-side warning surfaced mid-turn (e.g. Copilot rate-limit,
|
|
3849
3911
|
* context pressure, degraded mode). The UI renders these inline on
|
|
3850
3912
|
* the streaming bubble so the user sees them immediately instead of
|
|
3851
3913
|
* only finding out when the turn completes or times out.
|
|
3852
3914
|
*/
|
|
3853
|
-
|
|
3854
|
-
type:
|
|
3855
|
-
message:
|
|
3915
|
+
z20.object({
|
|
3916
|
+
type: z20.literal("warning"),
|
|
3917
|
+
message: z20.string(),
|
|
3856
3918
|
/**
|
|
3857
3919
|
* Optional in-app destination for a warning's inline action. Kept
|
|
3858
3920
|
* deliberately narrow: warnings are still readable prose when an older
|
|
3859
3921
|
* client ignores this additive field.
|
|
3860
3922
|
*/
|
|
3861
|
-
action:
|
|
3862
|
-
kind:
|
|
3863
|
-
section:
|
|
3923
|
+
action: z20.object({
|
|
3924
|
+
kind: z20.literal("settings"),
|
|
3925
|
+
section: z20.enum(["llamaCpp", "mlx", "ds4"])
|
|
3864
3926
|
}).optional()
|
|
3865
3927
|
}),
|
|
3866
3928
|
/**
|
|
@@ -3871,18 +3933,18 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3871
3933
|
* offset on the final assistant message so completed bubbles render
|
|
3872
3934
|
* the same segmentation on reload.
|
|
3873
3935
|
*/
|
|
3874
|
-
|
|
3936
|
+
z20.object({ type: z20.literal("intent"), label: z20.string() }),
|
|
3875
3937
|
/**
|
|
3876
3938
|
* Emitted when a new message is enqueued on the per-session queue
|
|
3877
3939
|
* because the session already has a turn in flight. The timeline
|
|
3878
3940
|
* renders a "ghost bubble" under the session's streaming bubble
|
|
3879
3941
|
* showing the queued text preview. Cleared via `queue_removed`.
|
|
3880
3942
|
*/
|
|
3881
|
-
|
|
3882
|
-
type:
|
|
3883
|
-
queueId:
|
|
3884
|
-
preview:
|
|
3885
|
-
enqueuedAt:
|
|
3943
|
+
z20.object({
|
|
3944
|
+
type: z20.literal("queue_enqueued"),
|
|
3945
|
+
queueId: z20.string(),
|
|
3946
|
+
preview: z20.string(),
|
|
3947
|
+
enqueuedAt: z20.string(),
|
|
3886
3948
|
/**
|
|
3887
3949
|
* The entry was queued as a mid-turn nudge — the ghost bubble labels
|
|
3888
3950
|
* it "nudge" and contiguous nudges merge into one turn on drain.
|
|
@@ -3890,7 +3952,7 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3890
3952
|
* every coalesce/edit); the edit affordance fetches it lazily via
|
|
3891
3953
|
* `GET /api/sessions/:id/queue`.
|
|
3892
3954
|
*/
|
|
3893
|
-
nudge:
|
|
3955
|
+
nudge: z20.boolean().optional()
|
|
3894
3956
|
}),
|
|
3895
3957
|
/**
|
|
3896
3958
|
* Emitted when a queued entry leaves the queue — either because
|
|
@@ -3899,39 +3961,39 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3899
3961
|
* dropped without running (`reason: 'canceled'` via user action,
|
|
3900
3962
|
* `reason: 'rejected'` via session archive / delete / shutdown).
|
|
3901
3963
|
*/
|
|
3902
|
-
|
|
3903
|
-
type:
|
|
3904
|
-
queueId:
|
|
3905
|
-
reason:
|
|
3964
|
+
z20.object({
|
|
3965
|
+
type: z20.literal("queue_removed"),
|
|
3966
|
+
queueId: z20.string(),
|
|
3967
|
+
reason: z20.enum(["started", "canceled", "rejected"])
|
|
3906
3968
|
}),
|
|
3907
3969
|
/**
|
|
3908
3970
|
* Effective context policy for a local or remote-local session. Emitted on
|
|
3909
3971
|
* each turn so the live UI can show the model's token window immediately;
|
|
3910
3972
|
* the same values are persisted on the session for reloads.
|
|
3911
3973
|
*/
|
|
3912
|
-
|
|
3913
|
-
type:
|
|
3914
|
-
numCtx:
|
|
3915
|
-
model:
|
|
3916
|
-
autoCompactRatio:
|
|
3974
|
+
z20.object({
|
|
3975
|
+
type: z20.literal("context_window"),
|
|
3976
|
+
numCtx: z20.number().int().positive(),
|
|
3977
|
+
model: z20.string(),
|
|
3978
|
+
autoCompactRatio: z20.number().positive().max(1),
|
|
3917
3979
|
/**
|
|
3918
3980
|
* Estimated prompt size for the turn about to run, in the same
|
|
3919
3981
|
* chars/4 units the compaction check itself uses. Absent on older
|
|
3920
3982
|
* daemons, which published the window without the fill.
|
|
3921
3983
|
*/
|
|
3922
|
-
estimatedTokens:
|
|
3984
|
+
estimatedTokens: z20.number().int().nonnegative().optional()
|
|
3923
3985
|
}),
|
|
3924
3986
|
/**
|
|
3925
3987
|
* Local-provider context policy: emitted only when accumulated conversation
|
|
3926
3988
|
* could not be compacted automatically. Normal pressure is handled without
|
|
3927
3989
|
* a warning; this is the exceptional maintenance-failure path.
|
|
3928
3990
|
*/
|
|
3929
|
-
|
|
3930
|
-
type:
|
|
3931
|
-
estimatedTokens:
|
|
3932
|
-
numCtx:
|
|
3933
|
-
model:
|
|
3934
|
-
reason:
|
|
3991
|
+
z20.object({
|
|
3992
|
+
type: z20.literal("context_warning"),
|
|
3993
|
+
estimatedTokens: z20.number(),
|
|
3994
|
+
numCtx: z20.number(),
|
|
3995
|
+
model: z20.string(),
|
|
3996
|
+
reason: z20.literal("compaction_failed").optional()
|
|
3935
3997
|
}),
|
|
3936
3998
|
/**
|
|
3937
3999
|
* Local-provider context policy: emitted right after in-flight compaction collapses
|
|
@@ -3940,16 +4002,16 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3940
4002
|
* for a "compacted" variant and refreshes the visible timeline (older
|
|
3941
4003
|
* bubbles are now gone from disk).
|
|
3942
4004
|
*/
|
|
3943
|
-
|
|
3944
|
-
type:
|
|
3945
|
-
removedCount:
|
|
3946
|
-
model:
|
|
4005
|
+
z20.object({
|
|
4006
|
+
type: z20.literal("context_compacted"),
|
|
4007
|
+
removedCount: z20.number().int().nonnegative(),
|
|
4008
|
+
model: z20.string(),
|
|
3947
4009
|
/** Optional for wire compatibility with pre-context-visibility daemons. */
|
|
3948
|
-
numCtx:
|
|
3949
|
-
estimatedTokensBefore:
|
|
3950
|
-
autoCompactRatio:
|
|
3951
|
-
compactionCount:
|
|
3952
|
-
mode:
|
|
4010
|
+
numCtx: z20.number().int().positive().optional(),
|
|
4011
|
+
estimatedTokensBefore: z20.number().int().nonnegative().optional(),
|
|
4012
|
+
autoCompactRatio: z20.number().positive().max(1).optional(),
|
|
4013
|
+
compactionCount: z20.number().int().positive().optional(),
|
|
4014
|
+
mode: z20.enum(["between-turn", "mid-turn"]).optional()
|
|
3953
4015
|
}),
|
|
3954
4016
|
/**
|
|
3955
4017
|
* Emitted when the chat manager detects a self-chat / compaction loop —
|
|
@@ -3958,10 +4020,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3958
4020
|
* compaction cycle without making progress. The pipeline halts the turn
|
|
3959
4021
|
* so the user can intervene; the UI surfaces a "looks stuck" banner.
|
|
3960
4022
|
*/
|
|
3961
|
-
|
|
3962
|
-
type:
|
|
3963
|
-
compactionsThisSend:
|
|
3964
|
-
reason:
|
|
4023
|
+
z20.object({
|
|
4024
|
+
type: z20.literal("context_loop"),
|
|
4025
|
+
compactionsThisSend: z20.number().int().positive(),
|
|
4026
|
+
reason: z20.string()
|
|
3965
4027
|
}),
|
|
3966
4028
|
/**
|
|
3967
4029
|
* Emitted when the Keurmeester (frontier quality inspector) steps in
|
|
@@ -3969,23 +4031,23 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3969
4031
|
* UI renders a "stepped in" notice on the thread; the full case
|
|
3970
4032
|
* record lives under `~/.gezel/keurmeester/cases/` keyed by caseId.
|
|
3971
4033
|
*/
|
|
3972
|
-
|
|
3973
|
-
type:
|
|
3974
|
-
caseId:
|
|
3975
|
-
gezelId:
|
|
3976
|
-
gezelName:
|
|
3977
|
-
action:
|
|
3978
|
-
summary:
|
|
4034
|
+
z20.object({
|
|
4035
|
+
type: z20.literal("keurmeester_intervention"),
|
|
4036
|
+
caseId: z20.string(),
|
|
4037
|
+
gezelId: z20.string(),
|
|
4038
|
+
gezelName: z20.string(),
|
|
4039
|
+
action: z20.string(),
|
|
4040
|
+
summary: z20.string()
|
|
3979
4041
|
}),
|
|
3980
4042
|
/**
|
|
3981
4043
|
* Emitted once per session the first time auto-recall runs, so the UI
|
|
3982
4044
|
* can render a "pulled N memories from prior work" chip above the first
|
|
3983
4045
|
* assistant reply.
|
|
3984
4046
|
*/
|
|
3985
|
-
|
|
3986
|
-
type:
|
|
3987
|
-
hitCount:
|
|
3988
|
-
query:
|
|
4047
|
+
z20.object({
|
|
4048
|
+
type: z20.literal("recall_applied"),
|
|
4049
|
+
hitCount: z20.number(),
|
|
4050
|
+
query: z20.string()
|
|
3989
4051
|
}),
|
|
3990
4052
|
/**
|
|
3991
4053
|
* Emitted when a gezel posts a structured question via the
|
|
@@ -3993,14 +4055,14 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
3993
4055
|
* questions on this event so the in-chat card, Home pane, and Home
|
|
3994
4056
|
* tab badge all light up together.
|
|
3995
4057
|
*/
|
|
3996
|
-
|
|
4058
|
+
z20.object({ type: z20.literal("question_asked"), question: QuestionSchema }),
|
|
3997
4059
|
/**
|
|
3998
4060
|
* Emitted when the user submits (or declines) an answer. The UI
|
|
3999
4061
|
* uses the same fan-out as `question_asked` to refresh every
|
|
4000
4062
|
* surface; the chat bubble's pending card collapses to its
|
|
4001
4063
|
* answered state.
|
|
4002
4064
|
*/
|
|
4003
|
-
|
|
4065
|
+
z20.object({ type: z20.literal("question_answered"), question: QuestionSchema }),
|
|
4004
4066
|
/**
|
|
4005
4067
|
* A durable task audit event, fanned onto the project's live stream after
|
|
4006
4068
|
* it has been appended to History. This keeps lightweight clients (most
|
|
@@ -4008,13 +4070,13 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4008
4070
|
* second task lifecycle bus. `task.tick` heartbeats are intentionally not
|
|
4009
4071
|
* published; this channel is for user-meaningful changes.
|
|
4010
4072
|
*/
|
|
4011
|
-
|
|
4012
|
-
type:
|
|
4013
|
-
eventId:
|
|
4014
|
-
kind:
|
|
4015
|
-
summary:
|
|
4016
|
-
at:
|
|
4017
|
-
taskRef:
|
|
4073
|
+
z20.object({
|
|
4074
|
+
type: z20.literal("task_event"),
|
|
4075
|
+
eventId: z20.string(),
|
|
4076
|
+
kind: z20.string(),
|
|
4077
|
+
summary: z20.string(),
|
|
4078
|
+
at: z20.string(),
|
|
4079
|
+
taskRef: z20.string().optional(),
|
|
4018
4080
|
/**
|
|
4019
4081
|
* Gezel responsible for the event, when History recorded one. Kept
|
|
4020
4082
|
* separate from the human-readable summary so fixed-presentation
|
|
@@ -4022,18 +4084,18 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4022
4084
|
* their own naming mode instead of leaking the friendly name embedded
|
|
4023
4085
|
* in the audit prose.
|
|
4024
4086
|
*/
|
|
4025
|
-
gezelId:
|
|
4087
|
+
gezelId: z20.string().optional()
|
|
4026
4088
|
}),
|
|
4027
4089
|
/**
|
|
4028
4090
|
* Emitted when a gezel crosses a growth level threshold and a pending
|
|
4029
4091
|
* level-up is created. The UI refreshes growth badges/dots and raises
|
|
4030
4092
|
* a single calm OS notification when the window is hidden.
|
|
4031
4093
|
*/
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
gezelId:
|
|
4035
|
-
gezelName:
|
|
4036
|
-
toLevel:
|
|
4094
|
+
z20.object({
|
|
4095
|
+
type: z20.literal("growth_level_up"),
|
|
4096
|
+
gezelId: z20.string(),
|
|
4097
|
+
gezelName: z20.string(),
|
|
4098
|
+
toLevel: z20.number().int()
|
|
4037
4099
|
}),
|
|
4038
4100
|
/**
|
|
4039
4101
|
* llama-cpp-only: lifecycle phase of the supervised on-device engine
|
|
@@ -4056,19 +4118,19 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4056
4118
|
* the phase label so users who want to know what's happening can
|
|
4057
4119
|
* see, without cluttering the happy-path status line.
|
|
4058
4120
|
*/
|
|
4059
|
-
|
|
4060
|
-
type:
|
|
4061
|
-
provider:
|
|
4062
|
-
phase:
|
|
4121
|
+
z20.object({
|
|
4122
|
+
type: z20.literal("engine_phase"),
|
|
4123
|
+
provider: z20.enum(["llama-cpp", "mlx", "ds4"]),
|
|
4124
|
+
phase: z20.enum(["starting", "loading_model", "prefill", "generating", "ready"]),
|
|
4063
4125
|
/**
|
|
4064
4126
|
* Human-readable subject for an ephemeral background completion. Unlike
|
|
4065
4127
|
* `detail` (engine diagnostics), this names the user's work — for example
|
|
4066
4128
|
* "Indexing src/app.ts". Ordinary chat turns leave it absent.
|
|
4067
4129
|
*/
|
|
4068
|
-
activity:
|
|
4069
|
-
detail:
|
|
4070
|
-
progress:
|
|
4071
|
-
ttftMs:
|
|
4130
|
+
activity: z20.string().optional(),
|
|
4131
|
+
detail: z20.string().optional(),
|
|
4132
|
+
progress: z20.number().min(0).max(1).optional(),
|
|
4133
|
+
ttftMs: z20.number().int().nonnegative().optional(),
|
|
4072
4134
|
/**
|
|
4073
4135
|
* Exact cumulative completion tokens decoded so far this turn, as the
|
|
4074
4136
|
* engine counts them (llama-server `timings.predicted_n`, MLX's
|
|
@@ -4077,14 +4139,14 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4077
4139
|
* to an explicitly-approximate character estimate when it is absent,
|
|
4078
4140
|
* so this field is what lets a readout drop its "≈".
|
|
4079
4141
|
*/
|
|
4080
|
-
outputTokens:
|
|
4142
|
+
outputTokens: z20.number().int().nonnegative().optional(),
|
|
4081
4143
|
/**
|
|
4082
4144
|
* Exact decode rate right now, engine-measured over the generation
|
|
4083
4145
|
* phase alone (llama-server `timings.predicted_per_second`, MLX's
|
|
4084
4146
|
* `generation_tps`). Same contract as `outputTokens`: absent means the
|
|
4085
4147
|
* UI must derive and mark its own estimate.
|
|
4086
4148
|
*/
|
|
4087
|
-
tokensPerSec:
|
|
4149
|
+
tokensPerSec: z20.number().nonnegative().optional()
|
|
4088
4150
|
}),
|
|
4089
4151
|
/**
|
|
4090
4152
|
* Per-turn telemetry for locally-hosted providers (llama-cpp, Ollama,
|
|
@@ -4099,21 +4161,21 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4099
4161
|
* local speed metric isn't meaningful when the latency is
|
|
4100
4162
|
* dominated by network round-trips.
|
|
4101
4163
|
*/
|
|
4102
|
-
|
|
4103
|
-
type:
|
|
4104
|
-
provider:
|
|
4164
|
+
z20.object({
|
|
4165
|
+
type: z20.literal("turn_stats"),
|
|
4166
|
+
provider: z20.enum(["llama-cpp", "ollama", "mlx", "ds4"]),
|
|
4105
4167
|
/**
|
|
4106
4168
|
* Model that generated the turn, as the session recorded it. Lets the
|
|
4107
4169
|
* UI bucket speed by model instead of averaging a 27B and a 4B into
|
|
4108
4170
|
* one meaningless number. Optional because older daemons (and remote
|
|
4109
4171
|
* peers on an older wire) don't send it.
|
|
4110
4172
|
*/
|
|
4111
|
-
model:
|
|
4112
|
-
promptTokens:
|
|
4113
|
-
completionTokens:
|
|
4114
|
-
durationMs:
|
|
4173
|
+
model: z20.string().optional(),
|
|
4174
|
+
promptTokens: z20.number().int().nonnegative(),
|
|
4175
|
+
completionTokens: z20.number().int().nonnegative(),
|
|
4176
|
+
durationMs: z20.number().int().nonnegative(),
|
|
4115
4177
|
/** Generation speed in tokens/sec — completionTokens / generationSeconds. */
|
|
4116
|
-
tokensPerSec:
|
|
4178
|
+
tokensPerSec: z20.number().nonnegative().optional()
|
|
4117
4179
|
}),
|
|
4118
4180
|
/**
|
|
4119
4181
|
* Static engine-level metrics that don't change during a session —
|
|
@@ -4125,11 +4187,11 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4125
4187
|
* `engine_phase` (every session waiting on the same supervisor
|
|
4126
4188
|
* startup gets a copy).
|
|
4127
4189
|
*/
|
|
4128
|
-
|
|
4129
|
-
type:
|
|
4130
|
-
provider:
|
|
4190
|
+
z20.object({
|
|
4191
|
+
type: z20.literal("engine_stats"),
|
|
4192
|
+
provider: z20.enum(["llama-cpp", "mlx", "ds4"]),
|
|
4131
4193
|
/** Total bytes allocated across all GGUF buffers + KV cache. */
|
|
4132
|
-
ramAllocBytes:
|
|
4194
|
+
ramAllocBytes: z20.number().nonnegative()
|
|
4133
4195
|
}),
|
|
4134
4196
|
/**
|
|
4135
4197
|
* VRAM tenancy change — a non-LLM workload has taken (or released)
|
|
@@ -4159,9 +4221,9 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4159
4221
|
* `step`/`totalSteps` drive a real progress bar; `secondsPerStep`
|
|
4160
4222
|
* lets the UI show an ETA.
|
|
4161
4223
|
*/
|
|
4162
|
-
|
|
4163
|
-
type:
|
|
4164
|
-
state:
|
|
4224
|
+
z20.object({
|
|
4225
|
+
type: z20.literal("gpu_swap"),
|
|
4226
|
+
state: z20.enum(["started", "progress", "ended"]),
|
|
4165
4227
|
/**
|
|
4166
4228
|
* Shared with session telemetry so a new workload can't light up the
|
|
4167
4229
|
* bubble while staying invisible to stall detection.
|
|
@@ -4174,12 +4236,12 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4174
4236
|
* seconds", which reads as a bug.
|
|
4175
4237
|
*/
|
|
4176
4238
|
task: SessionGpuTaskSchema,
|
|
4177
|
-
detail:
|
|
4178
|
-
prompt:
|
|
4179
|
-
progress:
|
|
4180
|
-
step:
|
|
4181
|
-
totalSteps:
|
|
4182
|
-
secondsPerStep:
|
|
4239
|
+
detail: z20.string().optional(),
|
|
4240
|
+
prompt: z20.string().optional(),
|
|
4241
|
+
progress: z20.number().min(0).max(1).optional(),
|
|
4242
|
+
step: z20.number().int().nonnegative().optional(),
|
|
4243
|
+
totalSteps: z20.number().int().positive().optional(),
|
|
4244
|
+
secondsPerStep: z20.number().nonnegative().optional()
|
|
4183
4245
|
}),
|
|
4184
4246
|
/**
|
|
4185
4247
|
* The turn is parked inside a synchronous `ask_gezel` /
|
|
@@ -4202,10 +4264,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4202
4264
|
* side, same as the `ask_gezel` tool result), so the UI can render
|
|
4203
4265
|
* it verbatim.
|
|
4204
4266
|
*/
|
|
4205
|
-
|
|
4206
|
-
type:
|
|
4207
|
-
state:
|
|
4208
|
-
targetGezelName:
|
|
4267
|
+
z20.object({
|
|
4268
|
+
type: z20.literal("awaiting_gezel"),
|
|
4269
|
+
state: z20.enum(["started", "ended"]),
|
|
4270
|
+
targetGezelName: z20.string()
|
|
4209
4271
|
}),
|
|
4210
4272
|
/**
|
|
4211
4273
|
* A new project was created (via the New Project dialog, the
|
|
@@ -4216,10 +4278,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4216
4278
|
* for the next manual refresh / tab-focus poll. Not a renderable
|
|
4217
4279
|
* timeline event (like `growth_level_up`); the chat surfaces ignore it.
|
|
4218
4280
|
*/
|
|
4219
|
-
|
|
4220
|
-
type:
|
|
4221
|
-
projectId:
|
|
4222
|
-
name:
|
|
4281
|
+
z20.object({
|
|
4282
|
+
type: z20.literal("project_created"),
|
|
4283
|
+
projectId: z20.string(),
|
|
4284
|
+
name: z20.string()
|
|
4223
4285
|
}),
|
|
4224
4286
|
/**
|
|
4225
4287
|
* A project was deleted (via the Project Actions menu, or an equivalent
|
|
@@ -4229,10 +4291,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4229
4291
|
* waiting for the next manual refresh / tab-focus poll. Not a renderable
|
|
4230
4292
|
* timeline event; the chat surfaces ignore it.
|
|
4231
4293
|
*/
|
|
4232
|
-
|
|
4233
|
-
type:
|
|
4234
|
-
projectId:
|
|
4235
|
-
name:
|
|
4294
|
+
z20.object({
|
|
4295
|
+
type: z20.literal("project_deleted"),
|
|
4296
|
+
projectId: z20.string(),
|
|
4297
|
+
name: z20.string()
|
|
4236
4298
|
}),
|
|
4237
4299
|
/**
|
|
4238
4300
|
* A new shared gezel joined the global roster. Emitted on the global
|
|
@@ -4241,10 +4303,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4241
4303
|
* gezels deliberately do not emit this event because they do not belong in
|
|
4242
4304
|
* the global Gezellen list.
|
|
4243
4305
|
*/
|
|
4244
|
-
|
|
4245
|
-
type:
|
|
4246
|
-
gezelId:
|
|
4247
|
-
name:
|
|
4306
|
+
z20.object({
|
|
4307
|
+
type: z20.literal("gezel_created"),
|
|
4308
|
+
gezelId: z20.string(),
|
|
4309
|
+
name: z20.string()
|
|
4248
4310
|
}),
|
|
4249
4311
|
/**
|
|
4250
4312
|
* A prompt draft was created, edited, re-filed, sent, or removed. Emitted
|
|
@@ -4256,15 +4318,15 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4256
4318
|
* `gezelId` is the draft's, not the envelope's: a draft that will start a
|
|
4257
4319
|
* new thread has no session for the envelope to be scoped by.
|
|
4258
4320
|
*/
|
|
4259
|
-
|
|
4260
|
-
type:
|
|
4261
|
-
projectId:
|
|
4262
|
-
gezelId:
|
|
4263
|
-
draftId:
|
|
4264
|
-
sessionId:
|
|
4265
|
-
status:
|
|
4266
|
-
deleted:
|
|
4267
|
-
updatedAt:
|
|
4321
|
+
z20.object({
|
|
4322
|
+
type: z20.literal("prompt_draft_changed"),
|
|
4323
|
+
projectId: z20.string(),
|
|
4324
|
+
gezelId: z20.string(),
|
|
4325
|
+
draftId: z20.string(),
|
|
4326
|
+
sessionId: z20.string().nullable(),
|
|
4327
|
+
status: z20.enum(["draft", "sent"]),
|
|
4328
|
+
deleted: z20.boolean().optional(),
|
|
4329
|
+
updatedAt: z20.string()
|
|
4268
4330
|
}),
|
|
4269
4331
|
/**
|
|
4270
4332
|
* Global (project-less) signal that Night Shift mode flipped ON/OFF.
|
|
@@ -4272,10 +4334,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4272
4334
|
* menu pill reflects the live state. `source` is the active driver
|
|
4273
4335
|
* (scheduled window vs. a manual shift), null when inactive.
|
|
4274
4336
|
*/
|
|
4275
|
-
|
|
4276
|
-
type:
|
|
4277
|
-
active:
|
|
4278
|
-
source:
|
|
4337
|
+
z20.object({
|
|
4338
|
+
type: z20.literal("night_shift"),
|
|
4339
|
+
active: z20.boolean(),
|
|
4340
|
+
source: z20.enum(["scheduled", "manual"]).nullable()
|
|
4279
4341
|
}),
|
|
4280
4342
|
/**
|
|
4281
4343
|
* Global signal from the meester status generator. `started` fires
|
|
@@ -4284,10 +4346,10 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4284
4346
|
* produced nothing usable — the Home greeting refetches on the
|
|
4285
4347
|
* terminal states instead of polling.
|
|
4286
4348
|
*/
|
|
4287
|
-
|
|
4288
|
-
type:
|
|
4289
|
-
state:
|
|
4290
|
-
generatedAt:
|
|
4349
|
+
z20.object({
|
|
4350
|
+
type: z20.literal("meester_status"),
|
|
4351
|
+
state: z20.enum(["started", "ended", "failed"]),
|
|
4352
|
+
generatedAt: z20.string().optional()
|
|
4291
4353
|
}),
|
|
4292
4354
|
/**
|
|
4293
4355
|
* Global signal from the ambient dashboard generator. `ended` means a
|
|
@@ -4296,11 +4358,11 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4296
4358
|
* the wallpaper when the user opted in, and the Settings card
|
|
4297
4359
|
* refreshes its preview.
|
|
4298
4360
|
*/
|
|
4299
|
-
|
|
4300
|
-
type:
|
|
4301
|
-
state:
|
|
4302
|
-
generatedAt:
|
|
4303
|
-
filename:
|
|
4361
|
+
z20.object({
|
|
4362
|
+
type: z20.literal("ambient_dashboard"),
|
|
4363
|
+
state: z20.enum(["started", "ended", "failed"]),
|
|
4364
|
+
generatedAt: z20.string().optional(),
|
|
4365
|
+
filename: z20.string().optional()
|
|
4304
4366
|
}),
|
|
4305
4367
|
/**
|
|
4306
4368
|
* Global (history-free) heartbeat from the boekwachter indexing loops —
|
|
@@ -4308,23 +4370,23 @@ var ChatEventSchema = z19.discriminatedUnion("type", [
|
|
|
4308
4370
|
* indicator pill; complements (doesn't replace) the polled per-project
|
|
4309
4371
|
* index status. `pending` = files still awaiting AI enrichment when known.
|
|
4310
4372
|
*/
|
|
4311
|
-
|
|
4312
|
-
type:
|
|
4313
|
-
phase:
|
|
4314
|
-
state:
|
|
4315
|
-
projectId:
|
|
4316
|
-
detail:
|
|
4317
|
-
pending:
|
|
4373
|
+
z20.object({
|
|
4374
|
+
type: z20.literal("index_progress"),
|
|
4375
|
+
phase: z20.enum(["scan", "shadow", "enrich", "review", "digest"]),
|
|
4376
|
+
state: z20.enum(["started", "progress", "ended"]),
|
|
4377
|
+
projectId: z20.string().optional(),
|
|
4378
|
+
detail: z20.string().optional(),
|
|
4379
|
+
pending: z20.number().int().nonnegative().optional(),
|
|
4318
4380
|
/** The concrete autonomous gezel doing this work, when the project has one. */
|
|
4319
|
-
gezelId:
|
|
4381
|
+
gezelId: z20.string().optional(),
|
|
4320
4382
|
/** Snapshot of their display name so transient progress remains human-readable. */
|
|
4321
|
-
gezelName:
|
|
4383
|
+
gezelName: z20.string().optional()
|
|
4322
4384
|
})
|
|
4323
4385
|
]);
|
|
4324
|
-
var ChatEventEnvelopeSchema =
|
|
4325
|
-
sessionId:
|
|
4326
|
-
gezelId:
|
|
4327
|
-
projectId:
|
|
4386
|
+
var ChatEventEnvelopeSchema = z20.object({
|
|
4387
|
+
sessionId: z20.string(),
|
|
4388
|
+
gezelId: z20.string(),
|
|
4389
|
+
projectId: z20.string(),
|
|
4328
4390
|
/** Present when this live session was opened by another session. */
|
|
4329
4391
|
parentSession: SessionParentSchema.optional(),
|
|
4330
4392
|
/** Immediate task-step session that handed work to this live session. */
|
|
@@ -4461,8 +4523,8 @@ function promoteBareChannelNames(text) {
|
|
|
4461
4523
|
}
|
|
4462
4524
|
|
|
4463
4525
|
// src/schemas/report-action.ts
|
|
4464
|
-
import { z as
|
|
4465
|
-
var ReportActionKindSchema =
|
|
4526
|
+
import { z as z21 } from "zod";
|
|
4527
|
+
var ReportActionKindSchema = z21.enum(["fire-craftbook", "create-task", "apply-edits"]);
|
|
4466
4528
|
var commonFields = {
|
|
4467
4529
|
/**
|
|
4468
4530
|
* Author-supplied stable slug — keeps lifecycle state attached across
|
|
@@ -4470,121 +4532,121 @@ var commonFields = {
|
|
|
4470
4532
|
* content hash (`a-<hash>`), which is stable only while the block's
|
|
4471
4533
|
* body is byte-identical.
|
|
4472
4534
|
*/
|
|
4473
|
-
id:
|
|
4535
|
+
id: z21.string().regex(/^[a-z0-9][a-z0-9_-]*$/i).optional(),
|
|
4474
4536
|
/** Short human label for the card ("Fix the unchecked null in parser.ts"). */
|
|
4475
|
-
title:
|
|
4537
|
+
title: z21.string().min(1),
|
|
4476
4538
|
/** One-or-two-sentence rationale shown under the title. */
|
|
4477
|
-
reason:
|
|
4539
|
+
reason: z21.string().optional(),
|
|
4478
4540
|
/**
|
|
4479
4541
|
* Target project. Defaults to the report's own project. Cross-project
|
|
4480
4542
|
* targets are a primary case — the bundled oversight report lives in
|
|
4481
4543
|
* `default` but recommends work in specific projects.
|
|
4482
4544
|
*/
|
|
4483
|
-
projectId:
|
|
4545
|
+
projectId: z21.string().optional()
|
|
4484
4546
|
};
|
|
4485
|
-
var FireCraftbookActionSchema =
|
|
4486
|
-
kind:
|
|
4547
|
+
var FireCraftbookActionSchema = z21.object({
|
|
4548
|
+
kind: z21.literal("fire-craftbook"),
|
|
4487
4549
|
...commonFields,
|
|
4488
|
-
craftbookId:
|
|
4550
|
+
craftbookId: z21.string().min(1),
|
|
4489
4551
|
/** Invocation params for the craftbook's paramSchema (stringified values). */
|
|
4490
|
-
params:
|
|
4552
|
+
params: z21.record(z21.string(), z21.string()).optional()
|
|
4491
4553
|
});
|
|
4492
|
-
var CreateTaskActionSchema =
|
|
4493
|
-
kind:
|
|
4554
|
+
var CreateTaskActionSchema = z21.object({
|
|
4555
|
+
kind: z21.literal("create-task"),
|
|
4494
4556
|
...commonFields,
|
|
4495
4557
|
/** Full work instruction for the bespoke task's single step. */
|
|
4496
|
-
prompt:
|
|
4558
|
+
prompt: z21.string().min(1),
|
|
4497
4559
|
/** Role to recruit for the work (ensure_gezel jobTitle). Default: software developer. */
|
|
4498
|
-
role:
|
|
4560
|
+
role: z21.string().optional()
|
|
4499
4561
|
});
|
|
4500
|
-
var ApplyEditsActionSchema =
|
|
4501
|
-
kind:
|
|
4562
|
+
var ApplyEditsActionSchema = z21.object({
|
|
4563
|
+
kind: z21.literal("apply-edits"),
|
|
4502
4564
|
...commonFields,
|
|
4503
|
-
edits:
|
|
4504
|
-
|
|
4565
|
+
edits: z21.array(
|
|
4566
|
+
z21.object({
|
|
4505
4567
|
/** Workspace-relative target file in the TARGET project. */
|
|
4506
|
-
path:
|
|
4568
|
+
path: z21.string().min(1),
|
|
4507
4569
|
/** Artifacts-relative sidecar `.diff` path in the REPORT's project. */
|
|
4508
|
-
diffArtifact:
|
|
4570
|
+
diffArtifact: z21.string().min(1)
|
|
4509
4571
|
})
|
|
4510
4572
|
).min(1)
|
|
4511
4573
|
});
|
|
4512
|
-
var ReportActionSchema =
|
|
4574
|
+
var ReportActionSchema = z21.discriminatedUnion("kind", [
|
|
4513
4575
|
FireCraftbookActionSchema,
|
|
4514
4576
|
CreateTaskActionSchema,
|
|
4515
4577
|
ApplyEditsActionSchema
|
|
4516
4578
|
]);
|
|
4517
|
-
var ReportActionStateSchema =
|
|
4579
|
+
var ReportActionStateSchema = z21.enum([
|
|
4518
4580
|
"suggested",
|
|
4519
4581
|
"fired",
|
|
4520
4582
|
"applied",
|
|
4521
4583
|
"failed",
|
|
4522
4584
|
"dismissed"
|
|
4523
4585
|
]);
|
|
4524
|
-
var ReportActionRecordSchema =
|
|
4525
|
-
actionId:
|
|
4586
|
+
var ReportActionRecordSchema = z21.object({
|
|
4587
|
+
actionId: z21.string(),
|
|
4526
4588
|
/** Artifacts-relative path of the report the action came from. */
|
|
4527
|
-
reportPath:
|
|
4589
|
+
reportPath: z21.string(),
|
|
4528
4590
|
kind: ReportActionKindSchema,
|
|
4529
|
-
contentHash:
|
|
4530
|
-
firstSeenAt:
|
|
4591
|
+
contentHash: z21.string(),
|
|
4592
|
+
firstSeenAt: z21.string(),
|
|
4531
4593
|
state: ReportActionStateSchema,
|
|
4532
4594
|
/** Task materialized by fire-craftbook / create-task. */
|
|
4533
|
-
taskRef:
|
|
4534
|
-
firedAt:
|
|
4595
|
+
taskRef: z21.string().optional(),
|
|
4596
|
+
firedAt: z21.string().optional(),
|
|
4535
4597
|
/** Stamped when the fired task settles. */
|
|
4536
|
-
settledAt:
|
|
4537
|
-
outcome:
|
|
4598
|
+
settledAt: z21.string().optional(),
|
|
4599
|
+
outcome: z21.enum(["complete", "canceled"]).optional(),
|
|
4538
4600
|
/** apply-edits per-file results. */
|
|
4539
|
-
results:
|
|
4540
|
-
|
|
4541
|
-
path:
|
|
4542
|
-
ok:
|
|
4543
|
-
error:
|
|
4601
|
+
results: z21.array(
|
|
4602
|
+
z21.object({
|
|
4603
|
+
path: z21.string(),
|
|
4604
|
+
ok: z21.boolean(),
|
|
4605
|
+
error: z21.string().optional()
|
|
4544
4606
|
})
|
|
4545
4607
|
).optional()
|
|
4546
4608
|
});
|
|
4547
|
-
var ReportActionParseIssueSchema =
|
|
4609
|
+
var ReportActionParseIssueSchema = z21.object({
|
|
4548
4610
|
/** Zero-based index among the report's gezel-action fences. */
|
|
4549
|
-
index:
|
|
4550
|
-
message:
|
|
4611
|
+
index: z21.number().int(),
|
|
4612
|
+
message: z21.string(),
|
|
4551
4613
|
/** Raw fence body, for the "unreadable action block" card. */
|
|
4552
|
-
raw:
|
|
4614
|
+
raw: z21.string()
|
|
4553
4615
|
});
|
|
4554
|
-
var ReportActionViewSchema =
|
|
4616
|
+
var ReportActionViewSchema = z21.object({
|
|
4555
4617
|
action: ReportActionSchema,
|
|
4556
|
-
id:
|
|
4557
|
-
contentHash:
|
|
4618
|
+
id: z21.string(),
|
|
4619
|
+
contentHash: z21.string(),
|
|
4558
4620
|
state: ReportActionStateSchema,
|
|
4559
|
-
taskRef:
|
|
4560
|
-
firedAt:
|
|
4561
|
-
settledAt:
|
|
4562
|
-
outcome:
|
|
4563
|
-
results:
|
|
4621
|
+
taskRef: z21.string().optional(),
|
|
4622
|
+
firedAt: z21.string().optional(),
|
|
4623
|
+
settledAt: z21.string().optional(),
|
|
4624
|
+
outcome: z21.enum(["complete", "canceled"]).optional(),
|
|
4625
|
+
results: z21.array(z21.object({ path: z21.string(), ok: z21.boolean(), error: z21.string().optional() })).optional(),
|
|
4564
4626
|
/** The stored record predates a changed block body (report regenerated). */
|
|
4565
|
-
contentChanged:
|
|
4627
|
+
contentChanged: z21.boolean().optional()
|
|
4566
4628
|
});
|
|
4567
|
-
var ReportActionsResponseSchema =
|
|
4568
|
-
actions:
|
|
4569
|
-
issues:
|
|
4629
|
+
var ReportActionsResponseSchema = z21.object({
|
|
4630
|
+
actions: z21.array(ReportActionViewSchema),
|
|
4631
|
+
issues: z21.array(ReportActionParseIssueSchema),
|
|
4570
4632
|
/** Records whose action vanished from the regenerated report. */
|
|
4571
|
-
stale:
|
|
4633
|
+
stale: z21.array(ReportActionRecordSchema)
|
|
4572
4634
|
});
|
|
4573
|
-
var FireReportActionRequestSchema =
|
|
4635
|
+
var FireReportActionRequestSchema = z21.object({
|
|
4574
4636
|
/** Artifacts-relative report path. */
|
|
4575
|
-
path:
|
|
4576
|
-
actionId:
|
|
4637
|
+
path: z21.string().min(1),
|
|
4638
|
+
actionId: z21.string().min(1),
|
|
4577
4639
|
/** apply-edits: none. fire-craftbook: overrides the block's params. */
|
|
4578
|
-
params:
|
|
4640
|
+
params: z21.record(z21.string(), z21.string()).optional()
|
|
4579
4641
|
});
|
|
4580
|
-
var FireReportActionResponseSchema =
|
|
4642
|
+
var FireReportActionResponseSchema = z21.object({
|
|
4581
4643
|
record: ReportActionRecordSchema,
|
|
4582
4644
|
/** Set for fire-craftbook / create-task. */
|
|
4583
|
-
taskRef:
|
|
4645
|
+
taskRef: z21.string().optional()
|
|
4584
4646
|
});
|
|
4585
|
-
var DismissReportActionRequestSchema =
|
|
4586
|
-
path:
|
|
4587
|
-
actionId:
|
|
4647
|
+
var DismissReportActionRequestSchema = z21.object({
|
|
4648
|
+
path: z21.string().min(1),
|
|
4649
|
+
actionId: z21.string().min(1)
|
|
4588
4650
|
});
|
|
4589
4651
|
|
|
4590
4652
|
// src/markdown/report-actions.ts
|