@cleocode/adapters 2026.10.27 → 2026.11.1-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/.source-stamp.json +4 -0
- package/dist/index.js +1596 -1188
- package/dist/index.js.map +3 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -487,7 +487,9 @@ var init_acceptance_gate_schema = __esm({
|
|
|
487
487
|
/** When true, failure is recorded as a warning rather than a block. */
|
|
488
488
|
advisory: z.boolean().optional(),
|
|
489
489
|
/** Per-gate timeout override in milliseconds. */
|
|
490
|
-
timeoutMs: z.number().int().positive().optional()
|
|
490
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
491
|
+
/** Declared evidence repository the gate runs in (T14078). */
|
|
492
|
+
repo: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/).optional()
|
|
491
493
|
});
|
|
492
494
|
fileAssertionSchema = z.discriminatedUnion("type", [
|
|
493
495
|
z.object({ type: z.literal("exists") }),
|
|
@@ -11245,6 +11247,12 @@ var init_operations_registry = __esm({
|
|
|
11245
11247
|
type: "number",
|
|
11246
11248
|
required: false,
|
|
11247
11249
|
description: "Age threshold in days for the stale-drafts check (default 30)"
|
|
11250
|
+
},
|
|
11251
|
+
{
|
|
11252
|
+
name: "only",
|
|
11253
|
+
type: "string",
|
|
11254
|
+
required: false,
|
|
11255
|
+
description: "Comma-separated repair classes to scope the plan (and apply) to, e.g. publication-ledger-drift (T14174)"
|
|
11248
11256
|
}
|
|
11249
11257
|
]
|
|
11250
11258
|
},
|
|
@@ -11291,6 +11299,25 @@ var init_operations_registry = __esm({
|
|
|
11291
11299
|
requiredParams: [],
|
|
11292
11300
|
params: []
|
|
11293
11301
|
},
|
|
11302
|
+
// ── docs.rot (T14111 — Epic T14106) ──────────────────────────────────────
|
|
11303
|
+
{
|
|
11304
|
+
gateway: "query",
|
|
11305
|
+
domain: "docs",
|
|
11306
|
+
operation: "rot",
|
|
11307
|
+
description: "docs.rot (query) \u2014 docs-rot report from git alone: docs whose covers: code changed after them (stale), duplicate docs, and orphaned docs (dead covers globs, unreferenced docs/ files). changed:<base>..<head> also lists the docs that merged change left stale. Read-only.",
|
|
11308
|
+
tier: 1,
|
|
11309
|
+
idempotent: true,
|
|
11310
|
+
sessionRequired: false,
|
|
11311
|
+
requiredParams: [],
|
|
11312
|
+
params: [
|
|
11313
|
+
{
|
|
11314
|
+
name: "changed",
|
|
11315
|
+
type: "string",
|
|
11316
|
+
required: false,
|
|
11317
|
+
description: "Git range <base>..<head> of a merged change to flag docs for"
|
|
11318
|
+
}
|
|
11319
|
+
]
|
|
11320
|
+
},
|
|
11294
11321
|
{
|
|
11295
11322
|
gateway: "mutate",
|
|
11296
11323
|
domain: "docs",
|
|
@@ -11318,6 +11345,12 @@ var init_operations_registry = __esm({
|
|
|
11318
11345
|
type: "number",
|
|
11319
11346
|
required: false,
|
|
11320
11347
|
description: "Age threshold in days for the stale-drafts check (default 30)"
|
|
11348
|
+
},
|
|
11349
|
+
{
|
|
11350
|
+
name: "only",
|
|
11351
|
+
type: "string",
|
|
11352
|
+
required: false,
|
|
11353
|
+
description: "Comma-separated repair classes to scope the plan (and apply) to, e.g. publication-ledger-drift (T14174)"
|
|
11321
11354
|
}
|
|
11322
11355
|
]
|
|
11323
11356
|
},
|
|
@@ -11333,6 +11366,91 @@ var init_operations_registry = __esm({
|
|
|
11333
11366
|
requiredParams: [],
|
|
11334
11367
|
params: []
|
|
11335
11368
|
},
|
|
11369
|
+
// ── docs.modernize (T14113 — Epic T14106) ─────────────────────────────────
|
|
11370
|
+
{
|
|
11371
|
+
gateway: "mutate",
|
|
11372
|
+
domain: "docs",
|
|
11373
|
+
operation: "modernize",
|
|
11374
|
+
description: "docs.modernize (mutate) \u2014 turn a messy docs folder into clean, linked CleoDocs. Dry run by default: proposes per file a kind, a stable slug (no task, session or date tokens) and keep/rename/merge-into/delete with reasons and any System One judgment. --apply stores, merges, supersedes, moves files and writes wikilink edges with a receipt; --rollback <runId> reverses a run.",
|
|
11375
|
+
tier: 1,
|
|
11376
|
+
idempotent: false,
|
|
11377
|
+
sessionRequired: false,
|
|
11378
|
+
requiredParams: [],
|
|
11379
|
+
params: [
|
|
11380
|
+
{
|
|
11381
|
+
name: "path",
|
|
11382
|
+
type: "string",
|
|
11383
|
+
required: false,
|
|
11384
|
+
description: "Folder to modernize (required unless --rollback)"
|
|
11385
|
+
},
|
|
11386
|
+
{
|
|
11387
|
+
name: "apply",
|
|
11388
|
+
type: "boolean",
|
|
11389
|
+
required: false,
|
|
11390
|
+
description: "Execute the plan (default: dry run, nothing written)"
|
|
11391
|
+
},
|
|
11392
|
+
{
|
|
11393
|
+
name: "planFile",
|
|
11394
|
+
type: "string",
|
|
11395
|
+
required: false,
|
|
11396
|
+
description: "Apply this saved plan JSON verbatim"
|
|
11397
|
+
},
|
|
11398
|
+
{
|
|
11399
|
+
name: "out",
|
|
11400
|
+
type: "string",
|
|
11401
|
+
required: false,
|
|
11402
|
+
description: "Save the plan JSON to this path"
|
|
11403
|
+
},
|
|
11404
|
+
{
|
|
11405
|
+
name: "rollback",
|
|
11406
|
+
type: "string",
|
|
11407
|
+
required: false,
|
|
11408
|
+
description: "Roll back the apply run with this id"
|
|
11409
|
+
},
|
|
11410
|
+
{
|
|
11411
|
+
name: "exclude",
|
|
11412
|
+
type: "string",
|
|
11413
|
+
required: false,
|
|
11414
|
+
description: "Extra folder names to skip, comma-separated"
|
|
11415
|
+
},
|
|
11416
|
+
{
|
|
11417
|
+
name: "overrides",
|
|
11418
|
+
type: "string",
|
|
11419
|
+
required: false,
|
|
11420
|
+
description: "Reviewer decisions JSON keyed by path (DocsModernizeOverrides)"
|
|
11421
|
+
},
|
|
11422
|
+
{
|
|
11423
|
+
name: "kind",
|
|
11424
|
+
type: "string",
|
|
11425
|
+
required: false,
|
|
11426
|
+
description: "Use this kind for every file instead of classifying"
|
|
11427
|
+
},
|
|
11428
|
+
{
|
|
11429
|
+
name: "storeOnly",
|
|
11430
|
+
type: "boolean",
|
|
11431
|
+
required: false,
|
|
11432
|
+
description: "Ingest every file into the store and leave the folder untouched"
|
|
11433
|
+
},
|
|
11434
|
+
{
|
|
11435
|
+
name: "allowDirty",
|
|
11436
|
+
type: "boolean",
|
|
11437
|
+
required: false,
|
|
11438
|
+
description: "Apply even when the root is not a clean git checkout"
|
|
11439
|
+
},
|
|
11440
|
+
{
|
|
11441
|
+
name: "wikilinks",
|
|
11442
|
+
type: "boolean",
|
|
11443
|
+
required: false,
|
|
11444
|
+
description: "Rewrite relative links to planned docs as [[slug]] wikilinks (default: keep markdown links, re-pointed at the new paths)"
|
|
11445
|
+
},
|
|
11446
|
+
{
|
|
11447
|
+
name: "store",
|
|
11448
|
+
type: "boolean",
|
|
11449
|
+
required: false,
|
|
11450
|
+
description: "Modernize the docs already in the store instead of a folder"
|
|
11451
|
+
}
|
|
11452
|
+
]
|
|
11453
|
+
},
|
|
11336
11454
|
// ── docs.generate (T798) ─────────────────────────────────────────────────
|
|
11337
11455
|
{
|
|
11338
11456
|
gateway: "query",
|
|
@@ -12204,6 +12322,99 @@ var init_operations_registry = __esm({
|
|
|
12204
12322
|
}
|
|
12205
12323
|
]
|
|
12206
12324
|
},
|
|
12325
|
+
// release mutate: cut (T14102 — one-command release from the newest green
|
|
12326
|
+
// default-branch commit; replaces plan → open → bump-PR → hand tag).
|
|
12327
|
+
{
|
|
12328
|
+
gateway: "mutate",
|
|
12329
|
+
domain: "release",
|
|
12330
|
+
operation: "cut",
|
|
12331
|
+
description: "release.cut (mutate) \u2014 tag the newest default-branch commit with green CI as v<version> once confirmed with --yes (D11211/D11212); release.yml writes the CHANGELOG from changesets and publishes. Without --yes it reports the commit, notes, packages and task status and prints the confirm command (T14102).",
|
|
12332
|
+
tier: 1,
|
|
12333
|
+
idempotent: false,
|
|
12334
|
+
sessionRequired: false,
|
|
12335
|
+
requiredParams: ["version"],
|
|
12336
|
+
params: [
|
|
12337
|
+
{
|
|
12338
|
+
name: "version",
|
|
12339
|
+
type: "string",
|
|
12340
|
+
required: true,
|
|
12341
|
+
description: "Release version (accepts v2026.10.28 or 2026.10.28)",
|
|
12342
|
+
cli: { positional: true }
|
|
12343
|
+
},
|
|
12344
|
+
{
|
|
12345
|
+
name: "sha",
|
|
12346
|
+
type: "string",
|
|
12347
|
+
required: false,
|
|
12348
|
+
description: "Pin the commit instead of the newest green one; it must itself be green"
|
|
12349
|
+
},
|
|
12350
|
+
{
|
|
12351
|
+
name: "lead",
|
|
12352
|
+
type: "string",
|
|
12353
|
+
required: false,
|
|
12354
|
+
description: "Markdown file that leads the notes (Update now + Highlights)"
|
|
12355
|
+
},
|
|
12356
|
+
{
|
|
12357
|
+
name: "dryRun",
|
|
12358
|
+
type: "boolean",
|
|
12359
|
+
required: false,
|
|
12360
|
+
description: "Report the commit, notes, packages and tasks without creating the tag"
|
|
12361
|
+
},
|
|
12362
|
+
{
|
|
12363
|
+
name: "yes",
|
|
12364
|
+
type: "boolean",
|
|
12365
|
+
required: false,
|
|
12366
|
+
description: "Create the tag (D11212): the version typed on the controlling terminal (/dev/tty), or a standing release authorization (T14141), allows it. Without it the cut only reports and prints the confirm command"
|
|
12367
|
+
}
|
|
12368
|
+
]
|
|
12369
|
+
},
|
|
12370
|
+
// release mutate: write-changelog (T14102 — CHANGELOG section from the
|
|
12371
|
+
// changesets since the previous tag; run by release.yml on the tagged checkout).
|
|
12372
|
+
{
|
|
12373
|
+
gateway: "mutate",
|
|
12374
|
+
domain: "release",
|
|
12375
|
+
operation: "write-changelog",
|
|
12376
|
+
description: "release.write-changelog (mutate) \u2014 write the ## [VERSION] CHANGELOG.md section from the changesets added since the previous release tag, led by the tag annotation; leaves an existing section untouched (T14102).",
|
|
12377
|
+
tier: 1,
|
|
12378
|
+
idempotent: true,
|
|
12379
|
+
sessionRequired: false,
|
|
12380
|
+
requiredParams: ["version"],
|
|
12381
|
+
params: [
|
|
12382
|
+
{
|
|
12383
|
+
name: "version",
|
|
12384
|
+
type: "string",
|
|
12385
|
+
required: true,
|
|
12386
|
+
description: "Release version (accepts v2026.10.28 or 2026.10.28)",
|
|
12387
|
+
cli: { positional: true }
|
|
12388
|
+
},
|
|
12389
|
+
{
|
|
12390
|
+
name: "ref",
|
|
12391
|
+
type: "string",
|
|
12392
|
+
required: false,
|
|
12393
|
+
description: "Commit the release was cut from (default: tag v<version>, else HEAD)"
|
|
12394
|
+
}
|
|
12395
|
+
]
|
|
12396
|
+
},
|
|
12397
|
+
// release query: verify-tag (T14102 — release.yml refuses to publish a tag
|
|
12398
|
+
// that is not a green first-parent commit of the default branch).
|
|
12399
|
+
{
|
|
12400
|
+
gateway: "query",
|
|
12401
|
+
domain: "release",
|
|
12402
|
+
operation: "verify-tag",
|
|
12403
|
+
description: "release.verify-tag (query) \u2014 refuse a release tag whose commit is not a first-parent commit of origin/main with every required check (release.prRequiredWorkflows, app-pinned) green on its push run. Run by release.yml before publishing (T14102).",
|
|
12404
|
+
tier: 1,
|
|
12405
|
+
idempotent: true,
|
|
12406
|
+
sessionRequired: false,
|
|
12407
|
+
requiredParams: ["version"],
|
|
12408
|
+
params: [
|
|
12409
|
+
{
|
|
12410
|
+
name: "version",
|
|
12411
|
+
type: "string",
|
|
12412
|
+
required: true,
|
|
12413
|
+
description: "Release version whose tag is checked (accepts v2026.10.28 or 2026.10.28)",
|
|
12414
|
+
cli: { positional: true }
|
|
12415
|
+
}
|
|
12416
|
+
]
|
|
12417
|
+
},
|
|
12207
12418
|
// release query: validate-changelog (T9937 / Saga T9862 — canonical CHANGELOG
|
|
12208
12419
|
// header validator that replaces the brittle inline grep step in
|
|
12209
12420
|
// .github/workflows/release.yml). Read-only — exposed only under the query
|
|
@@ -13597,8 +13808,121 @@ var init_operations_registry = __esm({
|
|
|
13597
13808
|
}
|
|
13598
13809
|
});
|
|
13599
13810
|
|
|
13600
|
-
// packages/contracts/src/docs/
|
|
13811
|
+
// packages/contracts/src/docs/modernize.ts
|
|
13601
13812
|
import { z as z7 } from "zod";
|
|
13813
|
+
var DOCS_MODERNIZE_DISPOSITIONS, DOCS_MODERNIZE_OPS, judgmentSchema, relPath, docsModernizePlanSchema, docsModernizeOverridesSchema, receiptOpSchema, docsModernizeJournalLineSchema, docsModernizeReceiptSchema;
|
|
13814
|
+
var init_modernize = __esm({
|
|
13815
|
+
"packages/contracts/src/docs/modernize.ts"() {
|
|
13816
|
+
"use strict";
|
|
13817
|
+
DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
13818
|
+
DOCS_MODERNIZE_OPS = [
|
|
13819
|
+
"ingest",
|
|
13820
|
+
"merge",
|
|
13821
|
+
"fold",
|
|
13822
|
+
"supersede",
|
|
13823
|
+
"write-file",
|
|
13824
|
+
"remove-file",
|
|
13825
|
+
"link",
|
|
13826
|
+
"rekind",
|
|
13827
|
+
"reslug",
|
|
13828
|
+
"link-task"
|
|
13829
|
+
];
|
|
13830
|
+
judgmentSchema = z7.object({
|
|
13831
|
+
question: z7.enum(["classify", "merge"]),
|
|
13832
|
+
site: z7.string(),
|
|
13833
|
+
mode: z7.enum(["off", "shadow", "on"]),
|
|
13834
|
+
ruleAnswer: z7.string(),
|
|
13835
|
+
decidedAnswer: z7.string().nullable(),
|
|
13836
|
+
decidedConfidence: z7.number().nullable(),
|
|
13837
|
+
source: z7.enum(["provider", "cache", "fallback"]),
|
|
13838
|
+
acted: z7.string()
|
|
13839
|
+
});
|
|
13840
|
+
relPath = z7.string().min(1).max(1024);
|
|
13841
|
+
docsModernizePlanSchema = z7.object({
|
|
13842
|
+
root: z7.string().min(1),
|
|
13843
|
+
generatedAt: z7.string(),
|
|
13844
|
+
mode: z7.enum(["tree", "store-only"]),
|
|
13845
|
+
counts: z7.record(z7.enum(DOCS_MODERNIZE_DISPOSITIONS), z7.number()),
|
|
13846
|
+
rows: z7.array(
|
|
13847
|
+
z7.object({
|
|
13848
|
+
path: relPath,
|
|
13849
|
+
sha256: z7.string().regex(/^[0-9a-f]{64}$/),
|
|
13850
|
+
kind: z7.string().min(1),
|
|
13851
|
+
slug: z7.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
13852
|
+
title: z7.string(),
|
|
13853
|
+
disposition: z7.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13854
|
+
target: z7.string().min(1).max(1024).nullable(),
|
|
13855
|
+
reasons: z7.array(z7.string()),
|
|
13856
|
+
judgments: z7.array(judgmentSchema),
|
|
13857
|
+
ownerTasks: z7.array(z7.string().regex(/^[TD]\d+$/)),
|
|
13858
|
+
category: z7.string(),
|
|
13859
|
+
refs: z7.array(z7.string()),
|
|
13860
|
+
overridden: z7.boolean(),
|
|
13861
|
+
covers: z7.array(z7.string()),
|
|
13862
|
+
baselineRemove: z7.boolean()
|
|
13863
|
+
})
|
|
13864
|
+
),
|
|
13865
|
+
linkFixes: z7.array(
|
|
13866
|
+
z7.object({
|
|
13867
|
+
kind: z7.literal("link-fix"),
|
|
13868
|
+
path: relPath,
|
|
13869
|
+
href: z7.string().min(1).max(2048),
|
|
13870
|
+
newHref: z7.string().min(1).max(2048)
|
|
13871
|
+
})
|
|
13872
|
+
).optional()
|
|
13873
|
+
});
|
|
13874
|
+
docsModernizeOverridesSchema = z7.record(
|
|
13875
|
+
relPath,
|
|
13876
|
+
z7.object({
|
|
13877
|
+
disposition: z7.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
13878
|
+
target: z7.string().min(1).max(1024).optional(),
|
|
13879
|
+
reason: z7.string().min(1),
|
|
13880
|
+
kind: z7.string().min(1).optional(),
|
|
13881
|
+
slug: z7.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
13882
|
+
covers: z7.array(z7.string()).optional()
|
|
13883
|
+
})
|
|
13884
|
+
);
|
|
13885
|
+
receiptOpSchema = z7.object({
|
|
13886
|
+
op: z7.enum(DOCS_MODERNIZE_OPS),
|
|
13887
|
+
state: z7.enum(["pending", "done", "reversed"]),
|
|
13888
|
+
slug: z7.string().nullable(),
|
|
13889
|
+
path: relPath.nullable(),
|
|
13890
|
+
target: z7.string().nullable(),
|
|
13891
|
+
attachmentId: z7.string().nullable(),
|
|
13892
|
+
ownerId: z7.string().nullable(),
|
|
13893
|
+
beforeSha256: z7.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13894
|
+
afterSha256: z7.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
13895
|
+
prior: z7.object({
|
|
13896
|
+
lifecycleStatus: z7.string().nullable().optional(),
|
|
13897
|
+
supersededBy: z7.string().nullable().optional(),
|
|
13898
|
+
supersedes: z7.string().nullable().optional(),
|
|
13899
|
+
previousAttachmentId: z7.string().nullable().optional(),
|
|
13900
|
+
newAttachmentId: z7.string().nullable().optional(),
|
|
13901
|
+
linkTargets: z7.array(z7.string()).optional(),
|
|
13902
|
+
kind: z7.string().nullable().optional()
|
|
13903
|
+
}).optional()
|
|
13904
|
+
});
|
|
13905
|
+
docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
13906
|
+
i: z7.number().int().min(0)
|
|
13907
|
+
});
|
|
13908
|
+
docsModernizeReceiptSchema = z7.object({
|
|
13909
|
+
runId: z7.string().regex(/^dm-[\w-]+$/),
|
|
13910
|
+
root: z7.string().min(1),
|
|
13911
|
+
appliedAt: z7.string(),
|
|
13912
|
+
planSha256: z7.string(),
|
|
13913
|
+
edgeCount: z7.number(),
|
|
13914
|
+
rolledBackAt: z7.string().nullable(),
|
|
13915
|
+
blobs: z7.array(z7.object({ path: relPath, sha256: z7.string() })),
|
|
13916
|
+
moves: z7.array(z7.object({ from: relPath, to: relPath })),
|
|
13917
|
+
deleted: z7.array(relPath),
|
|
13918
|
+
ops: z7.array(receiptOpSchema),
|
|
13919
|
+
durationMs: z7.number().optional()
|
|
13920
|
+
});
|
|
13921
|
+
}
|
|
13922
|
+
});
|
|
13923
|
+
|
|
13924
|
+
// packages/contracts/src/docs/provenance.ts
|
|
13925
|
+
import { z as z8 } from "zod";
|
|
13602
13926
|
var PROVENANCE_NODE_KINDS, PROVENANCE_EDGE_RELATIONS, DOC_LIFECYCLE_STATUSES, provenanceNodeKindSchema, provenanceEdgeRelationSchema, docLifecycleStatusSchema, provenanceNodeBaseFields, provenanceDocNodeSchema, provenanceTaskNodeSchema, provenanceDecisionNodeSchema, provenanceSessionNodeSchema, provenanceMemoryNodeSchema, provenanceNodeSchema, provenanceEdgeSchema, docProvenanceResponseSchema;
|
|
13603
13927
|
var init_provenance = __esm({
|
|
13604
13928
|
"packages/contracts/src/docs/provenance.ts"() {
|
|
@@ -13625,102 +13949,102 @@ var init_provenance = __esm({
|
|
|
13625
13949
|
"archived",
|
|
13626
13950
|
"draft"
|
|
13627
13951
|
];
|
|
13628
|
-
provenanceNodeKindSchema =
|
|
13629
|
-
provenanceEdgeRelationSchema =
|
|
13630
|
-
docLifecycleStatusSchema =
|
|
13952
|
+
provenanceNodeKindSchema = z8.enum(PROVENANCE_NODE_KINDS);
|
|
13953
|
+
provenanceEdgeRelationSchema = z8.enum(PROVENANCE_EDGE_RELATIONS);
|
|
13954
|
+
docLifecycleStatusSchema = z8.enum(DOC_LIFECYCLE_STATUSES);
|
|
13631
13955
|
provenanceNodeBaseFields = {
|
|
13632
|
-
id:
|
|
13633
|
-
title:
|
|
13634
|
-
metadata:
|
|
13956
|
+
id: z8.string().min(1),
|
|
13957
|
+
title: z8.string().min(1),
|
|
13958
|
+
metadata: z8.record(z8.string(), z8.unknown()).optional()
|
|
13635
13959
|
};
|
|
13636
|
-
provenanceDocNodeSchema =
|
|
13960
|
+
provenanceDocNodeSchema = z8.object({
|
|
13637
13961
|
...provenanceNodeBaseFields,
|
|
13638
|
-
kind:
|
|
13639
|
-
slug:
|
|
13640
|
-
docKind:
|
|
13962
|
+
kind: z8.literal("doc"),
|
|
13963
|
+
slug: z8.string().min(1),
|
|
13964
|
+
docKind: z8.string().min(1),
|
|
13641
13965
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
13642
|
-
publishedAt:
|
|
13643
|
-
supersededAt:
|
|
13644
|
-
summary:
|
|
13966
|
+
publishedAt: z8.string().min(1),
|
|
13967
|
+
supersededAt: z8.string().min(1).optional(),
|
|
13968
|
+
summary: z8.string().optional()
|
|
13645
13969
|
});
|
|
13646
|
-
provenanceTaskNodeSchema =
|
|
13970
|
+
provenanceTaskNodeSchema = z8.object({
|
|
13647
13971
|
...provenanceNodeBaseFields,
|
|
13648
|
-
kind:
|
|
13649
|
-
taskType:
|
|
13650
|
-
status:
|
|
13972
|
+
kind: z8.literal("task"),
|
|
13973
|
+
taskType: z8.enum(["saga", "epic", "task", "subtask"]),
|
|
13974
|
+
status: z8.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
13651
13975
|
});
|
|
13652
|
-
provenanceDecisionNodeSchema =
|
|
13976
|
+
provenanceDecisionNodeSchema = z8.object({
|
|
13653
13977
|
...provenanceNodeBaseFields,
|
|
13654
|
-
kind:
|
|
13655
|
-
outcome:
|
|
13656
|
-
decidedAt:
|
|
13978
|
+
kind: z8.literal("decision"),
|
|
13979
|
+
outcome: z8.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
13980
|
+
decidedAt: z8.string().min(1)
|
|
13657
13981
|
});
|
|
13658
|
-
provenanceSessionNodeSchema =
|
|
13982
|
+
provenanceSessionNodeSchema = z8.object({
|
|
13659
13983
|
...provenanceNodeBaseFields,
|
|
13660
|
-
kind:
|
|
13661
|
-
startedAt:
|
|
13662
|
-
endedAt:
|
|
13984
|
+
kind: z8.literal("session"),
|
|
13985
|
+
startedAt: z8.string().min(1),
|
|
13986
|
+
endedAt: z8.string().min(1).optional()
|
|
13663
13987
|
});
|
|
13664
|
-
provenanceMemoryNodeSchema =
|
|
13988
|
+
provenanceMemoryNodeSchema = z8.object({
|
|
13665
13989
|
...provenanceNodeBaseFields,
|
|
13666
|
-
kind:
|
|
13667
|
-
memoryType:
|
|
13668
|
-
recordedAt:
|
|
13990
|
+
kind: z8.literal("memory"),
|
|
13991
|
+
memoryType: z8.enum(["observation", "pattern", "decision", "diary"]),
|
|
13992
|
+
recordedAt: z8.string().min(1)
|
|
13669
13993
|
});
|
|
13670
|
-
provenanceNodeSchema =
|
|
13994
|
+
provenanceNodeSchema = z8.discriminatedUnion("kind", [
|
|
13671
13995
|
provenanceDocNodeSchema,
|
|
13672
13996
|
provenanceTaskNodeSchema,
|
|
13673
13997
|
provenanceDecisionNodeSchema,
|
|
13674
13998
|
provenanceSessionNodeSchema,
|
|
13675
13999
|
provenanceMemoryNodeSchema
|
|
13676
14000
|
]);
|
|
13677
|
-
provenanceEdgeSchema =
|
|
14001
|
+
provenanceEdgeSchema = z8.object({
|
|
13678
14002
|
relation: provenanceEdgeRelationSchema,
|
|
13679
|
-
from:
|
|
14003
|
+
from: z8.string().min(1),
|
|
13680
14004
|
fromKind: provenanceNodeKindSchema,
|
|
13681
|
-
to:
|
|
14005
|
+
to: z8.string().min(1),
|
|
13682
14006
|
toKind: provenanceNodeKindSchema,
|
|
13683
|
-
addedAt:
|
|
13684
|
-
summary:
|
|
14007
|
+
addedAt: z8.string().min(1),
|
|
14008
|
+
summary: z8.string().optional()
|
|
13685
14009
|
});
|
|
13686
|
-
docProvenanceResponseSchema =
|
|
13687
|
-
nodes:
|
|
13688
|
-
edges:
|
|
13689
|
-
totalNodes:
|
|
13690
|
-
totalEdges:
|
|
14010
|
+
docProvenanceResponseSchema = z8.object({
|
|
14011
|
+
nodes: z8.array(provenanceNodeSchema).readonly(),
|
|
14012
|
+
edges: z8.array(provenanceEdgeSchema).readonly(),
|
|
14013
|
+
totalNodes: z8.number().int().nonnegative(),
|
|
14014
|
+
totalEdges: z8.number().int().nonnegative()
|
|
13691
14015
|
});
|
|
13692
14016
|
}
|
|
13693
14017
|
});
|
|
13694
14018
|
|
|
13695
14019
|
// packages/contracts/src/docs/read.ts
|
|
13696
|
-
import { z as
|
|
14020
|
+
import { z as z9 } from "zod";
|
|
13697
14021
|
var docFrontmatterSchema, docBodySchema, docReadResponseSchema;
|
|
13698
14022
|
var init_read = __esm({
|
|
13699
14023
|
"packages/contracts/src/docs/read.ts"() {
|
|
13700
14024
|
"use strict";
|
|
13701
|
-
docFrontmatterSchema =
|
|
13702
|
-
slug:
|
|
13703
|
-
kind:
|
|
13704
|
-
title:
|
|
13705
|
-
summary:
|
|
13706
|
-
lifecycleStatus:
|
|
13707
|
-
docVersion:
|
|
13708
|
-
ownerVersion:
|
|
13709
|
-
supersedes:
|
|
13710
|
-
supersededBy:
|
|
13711
|
-
topics:
|
|
13712
|
-
relatedTasks:
|
|
13713
|
-
sha256:
|
|
13714
|
-
createdAt:
|
|
13715
|
-
});
|
|
13716
|
-
docBodySchema =
|
|
13717
|
-
encoding:
|
|
13718
|
-
text:
|
|
13719
|
-
base64:
|
|
13720
|
-
sizeBytes:
|
|
13721
|
-
mimeType:
|
|
13722
|
-
});
|
|
13723
|
-
docReadResponseSchema =
|
|
14025
|
+
docFrontmatterSchema = z9.object({
|
|
14026
|
+
slug: z9.string(),
|
|
14027
|
+
kind: z9.string().nullable(),
|
|
14028
|
+
title: z9.string().nullable(),
|
|
14029
|
+
summary: z9.string().nullable(),
|
|
14030
|
+
lifecycleStatus: z9.string(),
|
|
14031
|
+
docVersion: z9.number().int(),
|
|
14032
|
+
ownerVersion: z9.string().nullable(),
|
|
14033
|
+
supersedes: z9.string().nullable(),
|
|
14034
|
+
supersededBy: z9.string().nullable(),
|
|
14035
|
+
topics: z9.array(z9.string()).readonly(),
|
|
14036
|
+
relatedTasks: z9.array(z9.string()).readonly(),
|
|
14037
|
+
sha256: z9.string(),
|
|
14038
|
+
createdAt: z9.string()
|
|
14039
|
+
});
|
|
14040
|
+
docBodySchema = z9.object({
|
|
14041
|
+
encoding: z9.enum(["utf-8", "base64"]),
|
|
14042
|
+
text: z9.string().optional(),
|
|
14043
|
+
base64: z9.string().optional(),
|
|
14044
|
+
sizeBytes: z9.number().int().nonnegative(),
|
|
14045
|
+
mimeType: z9.string().nullable()
|
|
14046
|
+
});
|
|
14047
|
+
docReadResponseSchema = z9.object({
|
|
13724
14048
|
frontmatter: docFrontmatterSchema,
|
|
13725
14049
|
body: docBodySchema
|
|
13726
14050
|
});
|
|
@@ -13768,7 +14092,8 @@ var init_docs_taxonomy = __esm({
|
|
|
13768
14092
|
defaultOwnerKind: "session",
|
|
13769
14093
|
publishDir: "docs/handoff",
|
|
13770
14094
|
requiresEntityId: false,
|
|
13771
|
-
requiredSections: ["Context", "State", "Next-Steps"]
|
|
14095
|
+
requiredSections: ["Context", "State", "Next-Steps"],
|
|
14096
|
+
storeOnly: true
|
|
13772
14097
|
},
|
|
13773
14098
|
{
|
|
13774
14099
|
kind: "note",
|
|
@@ -13826,6 +14151,42 @@ var init_docs_taxonomy = __esm({
|
|
|
13826
14151
|
requiresEntityId: true,
|
|
13827
14152
|
entityIdPattern: /^t\d+(-.+)?$/,
|
|
13828
14153
|
requiredSections: ["Root-Cause", "Action", "Schedule", "Detection"]
|
|
14154
|
+
},
|
|
14155
|
+
{
|
|
14156
|
+
kind: "guide",
|
|
14157
|
+
label: "Guide",
|
|
14158
|
+
description: "How-to guide: the steps to get a task done (T14107)",
|
|
14159
|
+
defaultOwnerKind: "project",
|
|
14160
|
+
publishDir: "docs/guide",
|
|
14161
|
+
requiresEntityId: false,
|
|
14162
|
+
requiredSections: []
|
|
14163
|
+
},
|
|
14164
|
+
{
|
|
14165
|
+
kind: "concept",
|
|
14166
|
+
label: "Concept",
|
|
14167
|
+
description: "Explanation of how and why the product works (T14107)",
|
|
14168
|
+
defaultOwnerKind: "project",
|
|
14169
|
+
publishDir: "docs/concept",
|
|
14170
|
+
requiresEntityId: false,
|
|
14171
|
+
requiredSections: []
|
|
14172
|
+
},
|
|
14173
|
+
{
|
|
14174
|
+
kind: "reference",
|
|
14175
|
+
label: "Reference",
|
|
14176
|
+
description: "Reference: APIs, CLI, registries and formats (T14107)",
|
|
14177
|
+
defaultOwnerKind: "project",
|
|
14178
|
+
publishDir: "docs/reference",
|
|
14179
|
+
requiresEntityId: false,
|
|
14180
|
+
requiredSections: []
|
|
14181
|
+
},
|
|
14182
|
+
{
|
|
14183
|
+
kind: "migration",
|
|
14184
|
+
label: "Migration",
|
|
14185
|
+
description: "Upgrade or data-migration guide (T14107)",
|
|
14186
|
+
defaultOwnerKind: "project",
|
|
14187
|
+
publishDir: "docs/migration",
|
|
14188
|
+
requiresEntityId: false,
|
|
14189
|
+
requiredSections: []
|
|
13829
14190
|
}
|
|
13830
14191
|
];
|
|
13831
14192
|
BUILTIN_DOC_KIND_VALUES = Object.freeze(
|
|
@@ -13887,8 +14248,8 @@ var init_errors = __esm({
|
|
|
13887
14248
|
});
|
|
13888
14249
|
|
|
13889
14250
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
13890
|
-
import { z as
|
|
13891
|
-
var EVIDENCE_ATOM_KINDS, PARSER_PREFIXES, KIND_BOUNDARY_REGEX, commitAtomSchema, filesAtomSchema, testRunAtomSchema, qaRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, ciAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
|
|
14251
|
+
import { z as z10 } from "zod";
|
|
14252
|
+
var EVIDENCE_ATOM_KINDS, PARSER_PREFIXES, KIND_BOUNDARY_REGEX, DEPLOY_PROVIDER_REGEX, DEPLOY_ID_REGEX, commitAtomSchema, filesAtomSchema, testRunAtomSchema, qaRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, ciAtomSchema, ciRunAtomSchema, deployAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, PROFILE_GATE_EVIDENCE, ATOM_EXAMPLES;
|
|
13892
14253
|
var init_evidence_atom_schema = __esm({
|
|
13893
14254
|
"packages/contracts/src/evidence-atom-schema.ts"() {
|
|
13894
14255
|
"use strict";
|
|
@@ -13903,91 +14264,106 @@ var init_evidence_atom_schema = __esm({
|
|
|
13903
14264
|
"decision",
|
|
13904
14265
|
"pr",
|
|
13905
14266
|
"ci",
|
|
14267
|
+
"ci-run",
|
|
14268
|
+
"deploy",
|
|
13906
14269
|
"loc-drop",
|
|
13907
14270
|
"callsite-coverage",
|
|
13908
14271
|
"satisfies"
|
|
13909
14272
|
];
|
|
13910
14273
|
PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
13911
14274
|
KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
14275
|
+
DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
14276
|
+
DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
14277
|
+
commitAtomSchema = z10.object({
|
|
14278
|
+
kind: z10.literal("commit"),
|
|
14279
|
+
sha: z10.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
14280
|
+
});
|
|
14281
|
+
filesAtomSchema = z10.object({
|
|
14282
|
+
kind: z10.literal("files"),
|
|
14283
|
+
paths: z10.array(z10.string().min(1)).min(1, "files atom requires at least one path")
|
|
14284
|
+
});
|
|
14285
|
+
testRunAtomSchema = z10.object({
|
|
14286
|
+
kind: z10.literal("test-run"),
|
|
14287
|
+
path: z10.string().min(1, "test-run atom requires a non-empty path")
|
|
14288
|
+
});
|
|
14289
|
+
qaRunAtomSchema = z10.object({
|
|
14290
|
+
kind: z10.literal("qa-run"),
|
|
14291
|
+
path: z10.string().min(1, "qa-run atom requires a non-empty path")
|
|
14292
|
+
});
|
|
14293
|
+
toolAtomSchema = z10.object({
|
|
14294
|
+
kind: z10.literal("tool"),
|
|
14295
|
+
tool: z10.string().min(1, "tool atom requires a non-empty tool name")
|
|
14296
|
+
});
|
|
14297
|
+
urlAtomSchema = z10.object({
|
|
14298
|
+
kind: z10.literal("url"),
|
|
14299
|
+
url: z10.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
14300
|
+
});
|
|
14301
|
+
noteAtomSchema = z10.object({
|
|
14302
|
+
kind: z10.literal("note"),
|
|
14303
|
+
note: z10.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
14304
|
+
});
|
|
14305
|
+
decisionAtomSchema = z10.object({
|
|
14306
|
+
kind: z10.literal("decision"),
|
|
14307
|
+
decisionId: z10.string().min(1, "decision atom requires a non-empty decision ID")
|
|
14308
|
+
});
|
|
14309
|
+
prAtomSchema = z10.object({
|
|
14310
|
+
kind: z10.literal("pr"),
|
|
14311
|
+
prNumber: z10.number().int().positive("pr atom requires a positive integer PR number"),
|
|
14312
|
+
componentPrNumber: z10.number().int().positive().optional(),
|
|
13948
14313
|
/**
|
|
13949
14314
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
13950
14315
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
13951
14316
|
* `origin`, since PR numbers are only unique per repository.
|
|
13952
14317
|
*/
|
|
13953
|
-
repo:
|
|
14318
|
+
repo: z10.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
13954
14319
|
});
|
|
13955
|
-
ciAtomSchema =
|
|
13956
|
-
kind:
|
|
13957
|
-
prNumber:
|
|
13958
|
-
componentPrNumber:
|
|
14320
|
+
ciAtomSchema = z10.object({
|
|
14321
|
+
kind: z10.literal("ci"),
|
|
14322
|
+
prNumber: z10.number().int().positive("ci atom requires a positive integer PR number"),
|
|
14323
|
+
componentPrNumber: z10.number().int().positive().optional(),
|
|
13959
14324
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
13960
|
-
repo:
|
|
14325
|
+
repo: z10.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14326
|
+
});
|
|
14327
|
+
ciRunAtomSchema = z10.object({
|
|
14328
|
+
kind: z10.literal("ci-run"),
|
|
14329
|
+
runId: z10.number().int().positive("ci-run atom requires a positive integer run id")
|
|
13961
14330
|
});
|
|
13962
|
-
|
|
13963
|
-
kind:
|
|
13964
|
-
|
|
13965
|
-
|
|
14331
|
+
deployAtomSchema = z10.object({
|
|
14332
|
+
kind: z10.literal("deploy"),
|
|
14333
|
+
provider: z10.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
14334
|
+
deploymentId: z10.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
14335
|
+
sha: z10.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
14336
|
+
probeUrl: z10.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
13966
14337
|
});
|
|
13967
|
-
|
|
13968
|
-
kind:
|
|
13969
|
-
|
|
13970
|
-
|
|
14338
|
+
locDropAtomSchema = z10.object({
|
|
14339
|
+
kind: z10.literal("loc-drop"),
|
|
14340
|
+
fromLines: z10.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
14341
|
+
toLines: z10.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
14342
|
+
});
|
|
14343
|
+
callsiteCoverageAtomSchema = z10.object({
|
|
14344
|
+
kind: z10.literal("callsite-coverage"),
|
|
14345
|
+
symbolName: z10.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
14346
|
+
relativeSourcePath: z10.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
13971
14347
|
});
|
|
13972
14348
|
AC_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
13973
14349
|
AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
13974
14350
|
SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
13975
14351
|
SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
13976
|
-
satisfiesAtomSchema =
|
|
13977
|
-
kind:
|
|
14352
|
+
satisfiesAtomSchema = z10.object({
|
|
14353
|
+
kind: z10.literal("satisfies"),
|
|
13978
14354
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
13979
|
-
targetTaskId:
|
|
14355
|
+
targetTaskId: z10.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
13980
14356
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
13981
|
-
targetAcId:
|
|
14357
|
+
targetAcId: z10.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
13982
14358
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
13983
|
-
targetAcAlias:
|
|
14359
|
+
targetAcAlias: z10.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
13984
14360
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
13985
|
-
versionPin:
|
|
14361
|
+
versionPin: z10.string().regex(
|
|
13986
14362
|
SATISFIES_VERSION_PIN_REGEX,
|
|
13987
14363
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
13988
14364
|
).optional()
|
|
13989
14365
|
});
|
|
13990
|
-
EvidenceAtomSchema =
|
|
14366
|
+
EvidenceAtomSchema = z10.discriminatedUnion("kind", [
|
|
13991
14367
|
commitAtomSchema,
|
|
13992
14368
|
filesAtomSchema,
|
|
13993
14369
|
testRunAtomSchema,
|
|
@@ -13998,6 +14374,8 @@ var init_evidence_atom_schema = __esm({
|
|
|
13998
14374
|
decisionAtomSchema,
|
|
13999
14375
|
prAtomSchema,
|
|
14000
14376
|
ciAtomSchema,
|
|
14377
|
+
ciRunAtomSchema,
|
|
14378
|
+
deployAtomSchema,
|
|
14001
14379
|
locDropAtomSchema,
|
|
14002
14380
|
callsiteCoverageAtomSchema,
|
|
14003
14381
|
satisfiesAtomSchema
|
|
@@ -14022,6 +14400,12 @@ var init_evidence_atom_schema = __esm({
|
|
|
14022
14400
|
cleanupDone: { oneOf: [["note"]] },
|
|
14023
14401
|
nexusImpact: { oneOf: [["tool"], ["note"]] }
|
|
14024
14402
|
});
|
|
14403
|
+
PROFILE_GATE_EVIDENCE = Object.freeze({
|
|
14404
|
+
ops: { implemented: [["files", "note"]] },
|
|
14405
|
+
decision: {},
|
|
14406
|
+
census: { implemented: [["files", "note"]] },
|
|
14407
|
+
audit: { implemented: [["files", "note"]] }
|
|
14408
|
+
});
|
|
14025
14409
|
ATOM_EXAMPLES = Object.freeze({
|
|
14026
14410
|
commit: "commit:<sha>",
|
|
14027
14411
|
files: "files:path/a.ts,path/b.ts",
|
|
@@ -14033,6 +14417,8 @@ var init_evidence_atom_schema = __esm({
|
|
|
14033
14417
|
decision: "decision:D-arch-001",
|
|
14034
14418
|
pr: "pr:357",
|
|
14035
14419
|
ci: "ci:357",
|
|
14420
|
+
"ci-run": "ci-run:<runId>",
|
|
14421
|
+
deploy: "deploy:<provider>/<deploymentId>@<sha>|https://<host>/health",
|
|
14036
14422
|
"loc-drop": "loc-drop:<fromLines>:<toLines>",
|
|
14037
14423
|
"callsite-coverage": "callsite-coverage:<symbolName>:<relativeSourcePath>",
|
|
14038
14424
|
satisfies: "satisfies:T1234#AC2"
|
|
@@ -14041,58 +14427,58 @@ var init_evidence_atom_schema = __esm({
|
|
|
14041
14427
|
});
|
|
14042
14428
|
|
|
14043
14429
|
// packages/contracts/src/evidence-record-schema.ts
|
|
14044
|
-
import { z as
|
|
14430
|
+
import { z as z11 } from "zod";
|
|
14045
14431
|
var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
|
|
14046
14432
|
var init_evidence_record_schema = __esm({
|
|
14047
14433
|
"packages/contracts/src/evidence-record-schema.ts"() {
|
|
14048
14434
|
"use strict";
|
|
14049
|
-
evidenceBaseSchema =
|
|
14435
|
+
evidenceBaseSchema = z11.object({
|
|
14050
14436
|
/** Identity string of the agent that produced this record. */
|
|
14051
|
-
agentIdentity:
|
|
14437
|
+
agentIdentity: z11.string().min(1),
|
|
14052
14438
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
14053
|
-
attachmentSha256:
|
|
14439
|
+
attachmentSha256: z11.string().length(64),
|
|
14054
14440
|
/** ISO 8601 timestamp at which the action ran. */
|
|
14055
|
-
ranAt:
|
|
14441
|
+
ranAt: z11.string().datetime(),
|
|
14056
14442
|
/** Wall-clock duration of the action in milliseconds. */
|
|
14057
|
-
durationMs:
|
|
14443
|
+
durationMs: z11.number().nonnegative()
|
|
14058
14444
|
});
|
|
14059
14445
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
14060
|
-
kind:
|
|
14061
|
-
phase:
|
|
14062
|
-
filesChanged:
|
|
14063
|
-
linesAdded:
|
|
14064
|
-
linesRemoved:
|
|
14446
|
+
kind: z11.literal("impl-diff"),
|
|
14447
|
+
phase: z11.literal("implement"),
|
|
14448
|
+
filesChanged: z11.array(z11.string().min(1)).min(1),
|
|
14449
|
+
linesAdded: z11.number().int().nonnegative(),
|
|
14450
|
+
linesRemoved: z11.number().int().nonnegative()
|
|
14065
14451
|
});
|
|
14066
14452
|
validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
14067
|
-
kind:
|
|
14068
|
-
phase:
|
|
14069
|
-
reqIdsChecked:
|
|
14070
|
-
passed:
|
|
14071
|
-
details:
|
|
14453
|
+
kind: z11.literal("validate-spec-check"),
|
|
14454
|
+
phase: z11.literal("validate"),
|
|
14455
|
+
reqIdsChecked: z11.array(z11.string().min(1)).min(1),
|
|
14456
|
+
passed: z11.boolean(),
|
|
14457
|
+
details: z11.string().min(1)
|
|
14072
14458
|
});
|
|
14073
14459
|
testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14074
|
-
kind:
|
|
14075
|
-
phase:
|
|
14076
|
-
command:
|
|
14077
|
-
exitCode:
|
|
14078
|
-
testsPassed:
|
|
14079
|
-
testsFailed:
|
|
14460
|
+
kind: z11.literal("test-output"),
|
|
14461
|
+
phase: z11.literal("test"),
|
|
14462
|
+
command: z11.string().min(1),
|
|
14463
|
+
exitCode: z11.number().int(),
|
|
14464
|
+
testsPassed: z11.number().int().nonnegative(),
|
|
14465
|
+
testsFailed: z11.number().int().nonnegative()
|
|
14080
14466
|
});
|
|
14081
14467
|
lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
14082
|
-
kind:
|
|
14083
|
-
phase:
|
|
14084
|
-
tool:
|
|
14085
|
-
passed:
|
|
14086
|
-
warnings:
|
|
14087
|
-
errors:
|
|
14468
|
+
kind: z11.literal("lint-report"),
|
|
14469
|
+
phase: z11.enum(["implement", "test"]),
|
|
14470
|
+
tool: z11.string().min(1),
|
|
14471
|
+
passed: z11.boolean(),
|
|
14472
|
+
warnings: z11.number().int().nonnegative(),
|
|
14473
|
+
errors: z11.number().int().nonnegative()
|
|
14088
14474
|
});
|
|
14089
14475
|
commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14090
|
-
kind:
|
|
14091
|
-
phase:
|
|
14092
|
-
cmd:
|
|
14093
|
-
exitCode:
|
|
14476
|
+
kind: z11.literal("command-output"),
|
|
14477
|
+
phase: z11.enum(["implement", "validate", "test"]),
|
|
14478
|
+
cmd: z11.string().min(1),
|
|
14479
|
+
exitCode: z11.number().int()
|
|
14094
14480
|
});
|
|
14095
|
-
evidenceRecordSchema =
|
|
14481
|
+
evidenceRecordSchema = z11.discriminatedUnion("kind", [
|
|
14096
14482
|
implDiffRecordSchema,
|
|
14097
14483
|
validateSpecCheckRecordSchema,
|
|
14098
14484
|
testOutputRecordSchema,
|
|
@@ -14971,6 +15357,21 @@ var init_sync_write_invariants = __esm({
|
|
|
14971
15357
|
sites: [],
|
|
14972
15358
|
reason: "two devices adopting one legacy doc must mint one uid: the shell takes the legacy birth and sentinel facts, so (uid, birth_fp) converge and receive places the peer copy as a duplicate; a lost local write is refused loudly at the writer"
|
|
14973
15359
|
},
|
|
15360
|
+
// T14118 — a slug is an alias, not an identity: renaming one moves the
|
|
15361
|
+
// live slug on the registry row and the conduit identity row together and
|
|
15362
|
+
// records the old slug in the append-only alias table.
|
|
15363
|
+
{
|
|
15364
|
+
id: "docs.slug.rename-keeps-alias",
|
|
15365
|
+
class: "identity-layer",
|
|
15366
|
+
tables: [
|
|
15367
|
+
"docs_attachments",
|
|
15368
|
+
"conduit_attachments",
|
|
15369
|
+
"docs_wikilinks",
|
|
15370
|
+
"conduit_doc_slug_aliases"
|
|
15371
|
+
],
|
|
15372
|
+
sites: [],
|
|
15373
|
+
reason: "a rename moves the live slug on docs_attachments and conduit_attachments in one transaction and records the old slug as an alias of the immutable doc uid, so every replica resolves the old and the new slug to one doc"
|
|
15374
|
+
},
|
|
14974
15375
|
// T13359 (D11165) — decisions-vs-ADRs link table; the natural composite key
|
|
14975
15376
|
// makes identical links merge to one row, and the revoke is a one-way latch.
|
|
14976
15377
|
// T13597: enforced at merge, not just by the local accessor — 'revoked' is an
|
|
@@ -15085,111 +15486,111 @@ var init_lafs = __esm({
|
|
|
15085
15486
|
});
|
|
15086
15487
|
|
|
15087
15488
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
15088
|
-
import { z as
|
|
15489
|
+
import { z as z12 } from "zod";
|
|
15089
15490
|
var LeaseScopeSchema, LeaseLaneSchema, LeaseAcquireRequestSchema, LeaseReleaseRequestSchema, LeaseRenewRequestSchema, RateCheckRequestSchema, ToolGrantRequestSchema, QueuePriorityClassSchema, QueueAdmitRequestSchema, WorkerHeartbeatRequestSchema, ResourceAdmitRequestSchema, ResourceReleaseRequestSchema, LeaseIpcRequestSchema, LeaseGrantedResponseSchema, LeaseQueuedResponseSchema, LeaseDeniedResponseSchema, RateResultResponseSchema, ToolGrantedResponseSchema, LeaseRevokedResponseSchema, ChildKilledUnresponsiveResponseSchema, QueueAdmitDispositionSchema, QueueAdmitResultResponseSchema, HeartbeatAckResponseSchema, ResourceAdmitDispositionSchema, ResourceAdmitResultResponseSchema, ResourceReleaseResultResponseSchema, LeaseErrorResponseSchema, LeaseIpcResponseSchema, LeaseIpcRequestEnvelopeSchema, LeaseIpcResponseEnvelopeSchema, LeaseIpcEnvelopeSchema, LEASE_IPC_REQUEST_KINDS, LEASE_IPC_RESPONSE_KINDS, LEASE_IPC_MESSAGE_KINDS;
|
|
15090
15491
|
var init_messages2 = __esm({
|
|
15091
15492
|
"packages/contracts/src/lease-ipc/messages.ts"() {
|
|
15092
15493
|
"use strict";
|
|
15093
|
-
LeaseScopeSchema =
|
|
15094
|
-
LeaseLaneSchema =
|
|
15095
|
-
LeaseAcquireRequestSchema =
|
|
15494
|
+
LeaseScopeSchema = z12.enum(["project", "global"]);
|
|
15495
|
+
LeaseLaneSchema = z12.enum(["tasks", "brain", "bulk"]);
|
|
15496
|
+
LeaseAcquireRequestSchema = z12.object({
|
|
15096
15497
|
/** Tag discriminating this request variant. */
|
|
15097
|
-
kind:
|
|
15498
|
+
kind: z12.literal("lease_acquire"),
|
|
15098
15499
|
/** The cleo.db scope being arbitrated. */
|
|
15099
15500
|
scope: LeaseScopeSchema,
|
|
15100
15501
|
/** The write lane within the scope. */
|
|
15101
15502
|
lane: LeaseLaneSchema,
|
|
15102
15503
|
/** Process+lane holder identity. */
|
|
15103
|
-
holder_id:
|
|
15504
|
+
holder_id: z12.string().min(1),
|
|
15104
15505
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
15105
|
-
priority:
|
|
15506
|
+
priority: z12.number().int().min(0).max(255),
|
|
15106
15507
|
/** Lease time-to-live in milliseconds. */
|
|
15107
|
-
ttl_ms:
|
|
15508
|
+
ttl_ms: z12.number().int().nonnegative(),
|
|
15108
15509
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
15109
|
-
reentrant:
|
|
15510
|
+
reentrant: z12.boolean()
|
|
15110
15511
|
}).strict();
|
|
15111
|
-
LeaseReleaseRequestSchema =
|
|
15512
|
+
LeaseReleaseRequestSchema = z12.object({
|
|
15112
15513
|
/** Tag discriminating this request variant. */
|
|
15113
|
-
kind:
|
|
15514
|
+
kind: z12.literal("lease_release"),
|
|
15114
15515
|
/** The cleo.db scope being arbitrated. */
|
|
15115
15516
|
scope: LeaseScopeSchema,
|
|
15116
15517
|
/** The write lane within the scope. */
|
|
15117
15518
|
lane: LeaseLaneSchema,
|
|
15118
15519
|
/** Process+lane holder identity. */
|
|
15119
|
-
holder_id:
|
|
15520
|
+
holder_id: z12.string().min(1),
|
|
15120
15521
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
15121
|
-
epoch:
|
|
15522
|
+
epoch: z12.number().int().nonnegative()
|
|
15122
15523
|
}).strict();
|
|
15123
|
-
LeaseRenewRequestSchema =
|
|
15524
|
+
LeaseRenewRequestSchema = z12.object({
|
|
15124
15525
|
/** Tag discriminating this request variant. */
|
|
15125
|
-
kind:
|
|
15526
|
+
kind: z12.literal("lease_renew"),
|
|
15126
15527
|
/** The cleo.db scope being arbitrated. */
|
|
15127
15528
|
scope: LeaseScopeSchema,
|
|
15128
15529
|
/** The write lane within the scope. */
|
|
15129
15530
|
lane: LeaseLaneSchema,
|
|
15130
15531
|
/** Process+lane holder identity. */
|
|
15131
|
-
holder_id:
|
|
15532
|
+
holder_id: z12.string().min(1),
|
|
15132
15533
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
15133
|
-
epoch:
|
|
15534
|
+
epoch: z12.number().int().nonnegative()
|
|
15134
15535
|
}).strict();
|
|
15135
|
-
RateCheckRequestSchema =
|
|
15536
|
+
RateCheckRequestSchema = z12.object({
|
|
15136
15537
|
/** Tag discriminating this request variant. */
|
|
15137
|
-
kind:
|
|
15538
|
+
kind: z12.literal("rate_check"),
|
|
15138
15539
|
/** The cleo.db scope being checked. */
|
|
15139
15540
|
scope: LeaseScopeSchema,
|
|
15140
15541
|
/** The write lane within the scope. */
|
|
15141
15542
|
lane: LeaseLaneSchema,
|
|
15142
15543
|
/** Estimated bytes the caller intends to write. */
|
|
15143
|
-
est_bytes:
|
|
15544
|
+
est_bytes: z12.number().int().nonnegative()
|
|
15144
15545
|
}).strict();
|
|
15145
|
-
ToolGrantRequestSchema =
|
|
15546
|
+
ToolGrantRequestSchema = z12.object({
|
|
15146
15547
|
/** Tag discriminating this request variant. */
|
|
15147
|
-
kind:
|
|
15548
|
+
kind: z12.literal("tool_grant"),
|
|
15148
15549
|
/** The tool name being requested. */
|
|
15149
|
-
tool:
|
|
15550
|
+
tool: z12.string().min(1),
|
|
15150
15551
|
/** The requesting holder identity. */
|
|
15151
|
-
holder_id:
|
|
15552
|
+
holder_id: z12.string().min(1)
|
|
15152
15553
|
}).strict();
|
|
15153
|
-
QueuePriorityClassSchema =
|
|
15154
|
-
QueueAdmitRequestSchema =
|
|
15554
|
+
QueuePriorityClassSchema = z12.enum(["lead", "worker", "background"]);
|
|
15555
|
+
QueueAdmitRequestSchema = z12.object({
|
|
15155
15556
|
/** Tag discriminating this request variant. */
|
|
15156
|
-
kind:
|
|
15557
|
+
kind: z12.literal("queue_admit"),
|
|
15157
15558
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
15158
|
-
provider:
|
|
15559
|
+
provider: z12.string().min(1),
|
|
15159
15560
|
/** The caller's priority class (lead > worker > background). */
|
|
15160
15561
|
priority_class: QueuePriorityClassSchema,
|
|
15161
15562
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
15162
|
-
est_tokens:
|
|
15563
|
+
est_tokens: z12.number().int().nonnegative(),
|
|
15163
15564
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
15164
|
-
child_id:
|
|
15565
|
+
child_id: z12.string().min(1)
|
|
15165
15566
|
}).strict();
|
|
15166
|
-
WorkerHeartbeatRequestSchema =
|
|
15567
|
+
WorkerHeartbeatRequestSchema = z12.object({
|
|
15167
15568
|
/** Tag discriminating this request variant. */
|
|
15168
|
-
kind:
|
|
15569
|
+
kind: z12.literal("worker_heartbeat"),
|
|
15169
15570
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
15170
|
-
child_id:
|
|
15571
|
+
child_id: z12.string().min(1),
|
|
15171
15572
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
15172
|
-
in_flight_llm:
|
|
15573
|
+
in_flight_llm: z12.boolean()
|
|
15173
15574
|
}).strict();
|
|
15174
|
-
ResourceAdmitRequestSchema =
|
|
15575
|
+
ResourceAdmitRequestSchema = z12.object({
|
|
15175
15576
|
/** Tag discriminating this request variant. */
|
|
15176
|
-
kind:
|
|
15577
|
+
kind: z12.literal("resource_admit"),
|
|
15177
15578
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
15178
|
-
class:
|
|
15579
|
+
class: z12.string().min(1),
|
|
15179
15580
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
15180
|
-
holder_id:
|
|
15581
|
+
holder_id: z12.string().min(1),
|
|
15181
15582
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
15182
|
-
budget:
|
|
15583
|
+
budget: z12.number().int().nonnegative()
|
|
15183
15584
|
}).strict();
|
|
15184
|
-
ResourceReleaseRequestSchema =
|
|
15585
|
+
ResourceReleaseRequestSchema = z12.object({
|
|
15185
15586
|
/** Tag discriminating this request variant. */
|
|
15186
|
-
kind:
|
|
15587
|
+
kind: z12.literal("resource_release"),
|
|
15187
15588
|
/** The resource class the slot belongs to. */
|
|
15188
|
-
class:
|
|
15589
|
+
class: z12.string().min(1),
|
|
15189
15590
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
15190
|
-
holder_id:
|
|
15591
|
+
holder_id: z12.string().min(1)
|
|
15191
15592
|
}).strict();
|
|
15192
|
-
LeaseIpcRequestSchema =
|
|
15593
|
+
LeaseIpcRequestSchema = z12.discriminatedUnion("kind", [
|
|
15193
15594
|
LeaseAcquireRequestSchema,
|
|
15194
15595
|
LeaseReleaseRequestSchema,
|
|
15195
15596
|
LeaseRenewRequestSchema,
|
|
@@ -15200,133 +15601,133 @@ var init_messages2 = __esm({
|
|
|
15200
15601
|
ResourceAdmitRequestSchema,
|
|
15201
15602
|
ResourceReleaseRequestSchema
|
|
15202
15603
|
]);
|
|
15203
|
-
LeaseGrantedResponseSchema =
|
|
15604
|
+
LeaseGrantedResponseSchema = z12.object({
|
|
15204
15605
|
/** Tag discriminating this response variant. */
|
|
15205
|
-
kind:
|
|
15606
|
+
kind: z12.literal("lease_granted"),
|
|
15206
15607
|
/** The granted cleo.db scope. */
|
|
15207
15608
|
scope: LeaseScopeSchema,
|
|
15208
15609
|
/** The granted write lane. */
|
|
15209
15610
|
lane: LeaseLaneSchema,
|
|
15210
15611
|
/** The holder the lease was granted to. */
|
|
15211
|
-
holder_id:
|
|
15612
|
+
holder_id: z12.string().min(1),
|
|
15212
15613
|
/** The monotonic epoch fence assigned to this grant. */
|
|
15213
|
-
epoch:
|
|
15614
|
+
epoch: z12.number().int().nonnegative(),
|
|
15214
15615
|
/** The lease TTL in milliseconds. */
|
|
15215
|
-
ttl_ms:
|
|
15616
|
+
ttl_ms: z12.number().int().nonnegative(),
|
|
15216
15617
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
15217
|
-
expires_at_ms:
|
|
15618
|
+
expires_at_ms: z12.number().int().nonnegative()
|
|
15218
15619
|
}).strict();
|
|
15219
|
-
LeaseQueuedResponseSchema =
|
|
15620
|
+
LeaseQueuedResponseSchema = z12.object({
|
|
15220
15621
|
/** Tag discriminating this response variant. */
|
|
15221
|
-
kind:
|
|
15622
|
+
kind: z12.literal("lease_queued"),
|
|
15222
15623
|
/** The queued cleo.db scope. */
|
|
15223
15624
|
scope: LeaseScopeSchema,
|
|
15224
15625
|
/** The queued write lane. */
|
|
15225
15626
|
lane: LeaseLaneSchema,
|
|
15226
15627
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
15227
|
-
ticket:
|
|
15628
|
+
ticket: z12.number().int().nonnegative(),
|
|
15228
15629
|
/** Number of waiters ahead of this one. */
|
|
15229
|
-
ahead:
|
|
15630
|
+
ahead: z12.number().int().nonnegative()
|
|
15230
15631
|
}).strict();
|
|
15231
|
-
LeaseDeniedResponseSchema =
|
|
15632
|
+
LeaseDeniedResponseSchema = z12.object({
|
|
15232
15633
|
/** Tag discriminating this response variant. */
|
|
15233
|
-
kind:
|
|
15634
|
+
kind: z12.literal("lease_denied"),
|
|
15234
15635
|
/** The denied cleo.db scope. */
|
|
15235
15636
|
scope: LeaseScopeSchema,
|
|
15236
15637
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
15237
|
-
code:
|
|
15638
|
+
code: z12.string().min(1),
|
|
15238
15639
|
/** Human-readable denial message. */
|
|
15239
|
-
message:
|
|
15640
|
+
message: z12.string()
|
|
15240
15641
|
}).strict();
|
|
15241
|
-
RateResultResponseSchema =
|
|
15642
|
+
RateResultResponseSchema = z12.object({
|
|
15242
15643
|
/** Tag discriminating this response variant. */
|
|
15243
|
-
kind:
|
|
15644
|
+
kind: z12.literal("rate_result"),
|
|
15244
15645
|
/** The checked cleo.db scope. */
|
|
15245
15646
|
scope: LeaseScopeSchema,
|
|
15246
15647
|
/** Whether the write is within budget. */
|
|
15247
|
-
ok:
|
|
15648
|
+
ok: z12.boolean(),
|
|
15248
15649
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
15249
|
-
retry_after_ms:
|
|
15650
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
15250
15651
|
/** Remaining token budget for the scope. */
|
|
15251
|
-
tokens_remaining:
|
|
15652
|
+
tokens_remaining: z12.number().int().nonnegative()
|
|
15252
15653
|
}).strict();
|
|
15253
|
-
ToolGrantedResponseSchema =
|
|
15654
|
+
ToolGrantedResponseSchema = z12.object({
|
|
15254
15655
|
/** Tag discriminating this response variant. */
|
|
15255
|
-
kind:
|
|
15656
|
+
kind: z12.literal("tool_granted"),
|
|
15256
15657
|
/** The granted tool name. */
|
|
15257
|
-
tool:
|
|
15658
|
+
tool: z12.string().min(1),
|
|
15258
15659
|
/** The holder the tool grant was issued to. */
|
|
15259
|
-
holder_id:
|
|
15660
|
+
holder_id: z12.string().min(1)
|
|
15260
15661
|
}).strict();
|
|
15261
|
-
LeaseRevokedResponseSchema =
|
|
15662
|
+
LeaseRevokedResponseSchema = z12.object({
|
|
15262
15663
|
/** Tag discriminating this response variant. */
|
|
15263
|
-
kind:
|
|
15664
|
+
kind: z12.literal("lease_revoked"),
|
|
15264
15665
|
/** The revoked cleo.db scope. */
|
|
15265
15666
|
scope: LeaseScopeSchema,
|
|
15266
15667
|
/** The revoked write lane. */
|
|
15267
15668
|
lane: LeaseLaneSchema,
|
|
15268
15669
|
/** The holder whose lease was revoked. */
|
|
15269
|
-
holder_id:
|
|
15670
|
+
holder_id: z12.string().min(1),
|
|
15270
15671
|
/** Human-readable reason for the revocation. */
|
|
15271
|
-
reason:
|
|
15672
|
+
reason: z12.string()
|
|
15272
15673
|
}).strict();
|
|
15273
|
-
ChildKilledUnresponsiveResponseSchema =
|
|
15674
|
+
ChildKilledUnresponsiveResponseSchema = z12.object({
|
|
15274
15675
|
/** Tag discriminating this response variant. */
|
|
15275
|
-
kind:
|
|
15676
|
+
kind: z12.literal("child_killed_unresponsive"),
|
|
15276
15677
|
/** Logical id of the killed child. */
|
|
15277
|
-
child_id:
|
|
15678
|
+
child_id: z12.string().min(1),
|
|
15278
15679
|
/** The holder identity the killed child held the lease as. */
|
|
15279
|
-
holder_id:
|
|
15680
|
+
holder_id: z12.string().min(1),
|
|
15280
15681
|
/** The cleo.db scope the killed child held the lease in. */
|
|
15281
15682
|
scope: LeaseScopeSchema,
|
|
15282
15683
|
/** Human-readable reason for the kill. */
|
|
15283
|
-
reason:
|
|
15684
|
+
reason: z12.string()
|
|
15284
15685
|
}).strict();
|
|
15285
|
-
QueueAdmitDispositionSchema =
|
|
15286
|
-
QueueAdmitResultResponseSchema =
|
|
15686
|
+
QueueAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
|
|
15687
|
+
QueueAdmitResultResponseSchema = z12.object({
|
|
15287
15688
|
/** Tag discriminating this response variant. */
|
|
15288
|
-
kind:
|
|
15689
|
+
kind: z12.literal("queue_admit_result"),
|
|
15289
15690
|
/** Whether the LLM call was admitted or deferred. */
|
|
15290
15691
|
disposition: QueueAdmitDispositionSchema,
|
|
15291
15692
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15292
|
-
retry_after_ms:
|
|
15693
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
15293
15694
|
/** Remaining provider token budget after this decision. */
|
|
15294
|
-
tokens_remaining:
|
|
15695
|
+
tokens_remaining: z12.number().int().nonnegative(),
|
|
15295
15696
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
15296
|
-
queue_position:
|
|
15697
|
+
queue_position: z12.number().int().nonnegative()
|
|
15297
15698
|
}).strict();
|
|
15298
|
-
HeartbeatAckResponseSchema =
|
|
15699
|
+
HeartbeatAckResponseSchema = z12.object({
|
|
15299
15700
|
/** Tag discriminating this response variant. */
|
|
15300
|
-
kind:
|
|
15701
|
+
kind: z12.literal("heartbeat_ack")
|
|
15301
15702
|
}).strict();
|
|
15302
|
-
ResourceAdmitDispositionSchema =
|
|
15303
|
-
ResourceAdmitResultResponseSchema =
|
|
15703
|
+
ResourceAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
|
|
15704
|
+
ResourceAdmitResultResponseSchema = z12.object({
|
|
15304
15705
|
/** Tag discriminating this response variant. */
|
|
15305
|
-
kind:
|
|
15706
|
+
kind: z12.literal("resource_admit_result"),
|
|
15306
15707
|
/** Whether the heavy op was admitted or deferred. */
|
|
15307
15708
|
disposition: ResourceAdmitDispositionSchema,
|
|
15308
15709
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15309
|
-
retry_after_ms:
|
|
15710
|
+
retry_after_ms: z12.number().int().nonnegative(),
|
|
15310
15711
|
/** Remaining slots for the class after this decision. */
|
|
15311
|
-
slots_remaining:
|
|
15712
|
+
slots_remaining: z12.number().int().nonnegative()
|
|
15312
15713
|
}).strict();
|
|
15313
|
-
ResourceReleaseResultResponseSchema =
|
|
15714
|
+
ResourceReleaseResultResponseSchema = z12.object({
|
|
15314
15715
|
/** Tag discriminating this response variant. */
|
|
15315
|
-
kind:
|
|
15716
|
+
kind: z12.literal("resource_release_result"),
|
|
15316
15717
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
15317
|
-
released:
|
|
15718
|
+
released: z12.boolean(),
|
|
15318
15719
|
/** Remaining in-flight holders for the class after the release. */
|
|
15319
|
-
slots_remaining:
|
|
15720
|
+
slots_remaining: z12.number().int().nonnegative()
|
|
15320
15721
|
}).strict();
|
|
15321
|
-
LeaseErrorResponseSchema =
|
|
15722
|
+
LeaseErrorResponseSchema = z12.object({
|
|
15322
15723
|
/** Tag discriminating this response variant. */
|
|
15323
|
-
kind:
|
|
15724
|
+
kind: z12.literal("error"),
|
|
15324
15725
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
15325
|
-
code:
|
|
15726
|
+
code: z12.string().min(1),
|
|
15326
15727
|
/** Human-readable error message. */
|
|
15327
|
-
message:
|
|
15728
|
+
message: z12.string()
|
|
15328
15729
|
}).strict();
|
|
15329
|
-
LeaseIpcResponseSchema =
|
|
15730
|
+
LeaseIpcResponseSchema = z12.discriminatedUnion("kind", [
|
|
15330
15731
|
LeaseGrantedResponseSchema,
|
|
15331
15732
|
LeaseQueuedResponseSchema,
|
|
15332
15733
|
LeaseDeniedResponseSchema,
|
|
@@ -15340,27 +15741,27 @@ var init_messages2 = __esm({
|
|
|
15340
15741
|
ResourceReleaseResultResponseSchema,
|
|
15341
15742
|
LeaseErrorResponseSchema
|
|
15342
15743
|
]);
|
|
15343
|
-
LeaseIpcRequestEnvelopeSchema =
|
|
15744
|
+
LeaseIpcRequestEnvelopeSchema = z12.object({
|
|
15344
15745
|
/** Parallel protocol version. */
|
|
15345
|
-
protocol_version:
|
|
15746
|
+
protocol_version: z12.string(),
|
|
15346
15747
|
/** Correlation id echoed back on the matching response. */
|
|
15347
|
-
id:
|
|
15748
|
+
id: z12.string().min(1),
|
|
15348
15749
|
/** Direction discriminator. */
|
|
15349
|
-
direction:
|
|
15750
|
+
direction: z12.literal("request"),
|
|
15350
15751
|
/** The request body. */
|
|
15351
15752
|
request: LeaseIpcRequestSchema
|
|
15352
15753
|
}).strict();
|
|
15353
|
-
LeaseIpcResponseEnvelopeSchema =
|
|
15754
|
+
LeaseIpcResponseEnvelopeSchema = z12.object({
|
|
15354
15755
|
/** Parallel protocol version. */
|
|
15355
|
-
protocol_version:
|
|
15756
|
+
protocol_version: z12.string(),
|
|
15356
15757
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
15357
|
-
id:
|
|
15758
|
+
id: z12.string().min(1),
|
|
15358
15759
|
/** Direction discriminator. */
|
|
15359
|
-
direction:
|
|
15760
|
+
direction: z12.literal("response"),
|
|
15360
15761
|
/** The response body. */
|
|
15361
15762
|
response: LeaseIpcResponseSchema
|
|
15362
15763
|
}).strict();
|
|
15363
|
-
LeaseIpcEnvelopeSchema =
|
|
15764
|
+
LeaseIpcEnvelopeSchema = z12.discriminatedUnion("direction", [
|
|
15364
15765
|
LeaseIpcRequestEnvelopeSchema,
|
|
15365
15766
|
LeaseIpcResponseEnvelopeSchema
|
|
15366
15767
|
]);
|
|
@@ -15413,7 +15814,7 @@ var init_lease_ipc = __esm({
|
|
|
15413
15814
|
});
|
|
15414
15815
|
|
|
15415
15816
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
15416
|
-
import { z as
|
|
15817
|
+
import { z as z13 } from "zod";
|
|
15417
15818
|
var CATALOG_MODEL_STATUSES, CATALOG_AUTH_TYPES, isoDate, semver, catalogModalitiesSchema, catalogCostSchema, catalogLimitSchema, catalogModelProviderSchema, catalogModelEntrySchema, catalogProviderSchema, curatedCatalogSchema, modelsCatalogRowInsertSchema, modelsCatalogRowSelectSchema;
|
|
15418
15819
|
var init_catalog_schema = __esm({
|
|
15419
15820
|
"packages/contracts/src/llm/catalog-schema.ts"() {
|
|
@@ -15426,78 +15827,78 @@ var init_catalog_schema = __esm({
|
|
|
15426
15827
|
"retired"
|
|
15427
15828
|
];
|
|
15428
15829
|
CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
15429
|
-
isoDate =
|
|
15430
|
-
semver =
|
|
15431
|
-
catalogModalitiesSchema =
|
|
15432
|
-
input:
|
|
15433
|
-
output:
|
|
15830
|
+
isoDate = z13.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
15831
|
+
semver = z13.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
15832
|
+
catalogModalitiesSchema = z13.object({
|
|
15833
|
+
input: z13.array(z13.string()),
|
|
15834
|
+
output: z13.array(z13.string())
|
|
15434
15835
|
}).strict();
|
|
15435
|
-
catalogCostSchema =
|
|
15436
|
-
input:
|
|
15437
|
-
output:
|
|
15438
|
-
cache_read:
|
|
15439
|
-
cache_write:
|
|
15440
|
-
context_over_200k:
|
|
15836
|
+
catalogCostSchema = z13.object({
|
|
15837
|
+
input: z13.number().optional(),
|
|
15838
|
+
output: z13.number().optional(),
|
|
15839
|
+
cache_read: z13.number().optional(),
|
|
15840
|
+
cache_write: z13.number().optional(),
|
|
15841
|
+
context_over_200k: z13.number().optional()
|
|
15441
15842
|
}).strict();
|
|
15442
|
-
catalogLimitSchema =
|
|
15443
|
-
context:
|
|
15444
|
-
output:
|
|
15843
|
+
catalogLimitSchema = z13.object({
|
|
15844
|
+
context: z13.number(),
|
|
15845
|
+
output: z13.number()
|
|
15445
15846
|
}).strict();
|
|
15446
|
-
catalogModelProviderSchema =
|
|
15447
|
-
npm:
|
|
15448
|
-
api:
|
|
15847
|
+
catalogModelProviderSchema = z13.object({
|
|
15848
|
+
npm: z13.string(),
|
|
15849
|
+
api: z13.string()
|
|
15449
15850
|
}).strict();
|
|
15450
|
-
catalogModelEntrySchema =
|
|
15451
|
-
id:
|
|
15452
|
-
name:
|
|
15453
|
-
family:
|
|
15454
|
-
attachment:
|
|
15455
|
-
reasoning:
|
|
15456
|
-
temperature:
|
|
15457
|
-
interleaved:
|
|
15458
|
-
tool_call:
|
|
15851
|
+
catalogModelEntrySchema = z13.object({
|
|
15852
|
+
id: z13.string(),
|
|
15853
|
+
name: z13.string(),
|
|
15854
|
+
family: z13.string(),
|
|
15855
|
+
attachment: z13.boolean(),
|
|
15856
|
+
reasoning: z13.boolean(),
|
|
15857
|
+
temperature: z13.boolean(),
|
|
15858
|
+
interleaved: z13.boolean(),
|
|
15859
|
+
tool_call: z13.boolean(),
|
|
15459
15860
|
modalities: catalogModalitiesSchema,
|
|
15460
15861
|
cost: catalogCostSchema,
|
|
15461
15862
|
limit: catalogLimitSchema,
|
|
15462
|
-
status:
|
|
15863
|
+
status: z13.enum(CATALOG_MODEL_STATUSES),
|
|
15463
15864
|
release_date: isoDate,
|
|
15464
15865
|
provider: catalogModelProviderSchema
|
|
15465
15866
|
}).strict();
|
|
15466
|
-
catalogProviderSchema =
|
|
15467
|
-
id:
|
|
15468
|
-
endpoint:
|
|
15469
|
-
authTypes:
|
|
15470
|
-
npm:
|
|
15867
|
+
catalogProviderSchema = z13.object({
|
|
15868
|
+
id: z13.string(),
|
|
15869
|
+
endpoint: z13.string(),
|
|
15870
|
+
authTypes: z13.array(z13.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
15871
|
+
npm: z13.string().optional()
|
|
15471
15872
|
}).strict();
|
|
15472
|
-
curatedCatalogSchema =
|
|
15473
|
-
$schema:
|
|
15873
|
+
curatedCatalogSchema = z13.object({
|
|
15874
|
+
$schema: z13.string().optional(),
|
|
15474
15875
|
version: semver,
|
|
15475
15876
|
lastUpdated: isoDate,
|
|
15476
|
-
providers:
|
|
15477
|
-
models:
|
|
15877
|
+
providers: z13.record(z13.string(), catalogProviderSchema),
|
|
15878
|
+
models: z13.record(z13.string(), z13.record(z13.string(), catalogModelEntrySchema))
|
|
15478
15879
|
}).strict();
|
|
15479
|
-
modelsCatalogRowInsertSchema =
|
|
15480
|
-
id:
|
|
15481
|
-
providerId:
|
|
15482
|
-
name:
|
|
15483
|
-
family:
|
|
15484
|
-
attachment:
|
|
15485
|
-
reasoning:
|
|
15486
|
-
temperature:
|
|
15487
|
-
interleaved:
|
|
15488
|
-
toolCall:
|
|
15489
|
-
modalities:
|
|
15490
|
-
cost:
|
|
15491
|
-
contextLimit:
|
|
15492
|
-
outputLimit:
|
|
15493
|
-
status:
|
|
15880
|
+
modelsCatalogRowInsertSchema = z13.object({
|
|
15881
|
+
id: z13.string(),
|
|
15882
|
+
providerId: z13.string(),
|
|
15883
|
+
name: z13.string(),
|
|
15884
|
+
family: z13.string(),
|
|
15885
|
+
attachment: z13.boolean(),
|
|
15886
|
+
reasoning: z13.boolean(),
|
|
15887
|
+
temperature: z13.boolean(),
|
|
15888
|
+
interleaved: z13.boolean(),
|
|
15889
|
+
toolCall: z13.boolean(),
|
|
15890
|
+
modalities: z13.string(),
|
|
15891
|
+
cost: z13.string(),
|
|
15892
|
+
contextLimit: z13.number().nullable().optional(),
|
|
15893
|
+
outputLimit: z13.number().nullable().optional(),
|
|
15894
|
+
status: z13.enum(CATALOG_MODEL_STATUSES),
|
|
15494
15895
|
releaseDate: isoDate,
|
|
15495
|
-
modelsDevId:
|
|
15496
|
-
source:
|
|
15497
|
-
seededAt:
|
|
15896
|
+
modelsDevId: z13.string(),
|
|
15897
|
+
source: z13.string(),
|
|
15898
|
+
seededAt: z13.string().optional()
|
|
15498
15899
|
}).strict();
|
|
15499
15900
|
modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
15500
|
-
seededAt:
|
|
15901
|
+
seededAt: z13.string()
|
|
15501
15902
|
});
|
|
15502
15903
|
}
|
|
15503
15904
|
});
|
|
@@ -15612,7 +16013,7 @@ var init_status_registry = __esm({
|
|
|
15612
16013
|
});
|
|
15613
16014
|
|
|
15614
16015
|
// packages/contracts/src/workgraph.ts
|
|
15615
|
-
import { z as
|
|
16016
|
+
import { z as z14 } from "zod";
|
|
15616
16017
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX, taskTypeSchema, taskPrioritySchema, taskStatusSchema, verificationGateSchema, workGraphRelationKindSchema, workGraphTraversalDirectionSchema, workGraphEdgeDirectionSchema, paginationParamsSchema, workGraphNodeSchema, workGraphEdgeSchema, workGraphHierarchyEdgeSchema, workGraphPageInfoSchema, workGraphRollupCountsSchema, workGraphSubtreePercentagesSchema, workGraphProjectionMismatchSchema, workGraphReadyFrontierTaskSchema, workGraphRelationEdgeSchema, workGraphDependencyEdgeSchema, workGraphOmissionReasonSchema, workGraphContextBudgetSchema, workGraphOmissionSchema, workGraphDirectEdgeSchema, workGraphContextPackParamsSchema, workGraphSliceParamsSchema, workGraphSliceSchema, workGraphReadinessParamsSchema, workGraphReadinessResultSchema, workGraphContextPackSchema, workGraphScaffoldValidateParamsSchema, workGraphScaffoldValidationIssueSchema, workGraphScaffoldValidateResultSchema, workGraphScaffoldApplyParamsSchema, workGraphScaffoldApplyResultSchema, workGraphPlanningDocParamsSchema, workGraphPlanningDocSchema, tasksTraverseParamsSchema, tasksTraverseResultSchema, tasksTreeParamsSchema, tasksTreeResultSchema, tasksRollupParamsSchema, tasksRollupResultSchema, tasksFrontierParamsSchema, tasksFrontierResultSchema, tasksWorkGraphAuditParamsSchema, tasksWorkGraphAuditResultSchema;
|
|
15617
16018
|
var init_workgraph = __esm({
|
|
15618
16019
|
"packages/contracts/src/workgraph.ts"() {
|
|
@@ -15620,10 +16021,10 @@ var init_workgraph = __esm({
|
|
|
15620
16021
|
init_enums();
|
|
15621
16022
|
init_status_registry();
|
|
15622
16023
|
E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
15623
|
-
taskTypeSchema =
|
|
15624
|
-
taskPrioritySchema =
|
|
15625
|
-
taskStatusSchema =
|
|
15626
|
-
verificationGateSchema =
|
|
16024
|
+
taskTypeSchema = z14.enum(["saga", "epic", "task", "subtask"]);
|
|
16025
|
+
taskPrioritySchema = z14.enum(["critical", "high", "medium", "low"]);
|
|
16026
|
+
taskStatusSchema = z14.enum(TASK_STATUSES);
|
|
16027
|
+
verificationGateSchema = z14.enum([
|
|
15627
16028
|
"implemented",
|
|
15628
16029
|
"testsPassed",
|
|
15629
16030
|
"qaPassed",
|
|
@@ -15632,7 +16033,7 @@ var init_workgraph = __esm({
|
|
|
15632
16033
|
"documented",
|
|
15633
16034
|
"nexusImpact"
|
|
15634
16035
|
]);
|
|
15635
|
-
workGraphRelationKindSchema =
|
|
16036
|
+
workGraphRelationKindSchema = z14.enum([
|
|
15636
16037
|
"contains",
|
|
15637
16038
|
"depends_on",
|
|
15638
16039
|
"blocks",
|
|
@@ -15640,317 +16041,317 @@ var init_workgraph = __esm({
|
|
|
15640
16041
|
"groups",
|
|
15641
16042
|
"satisfies"
|
|
15642
16043
|
]);
|
|
15643
|
-
workGraphTraversalDirectionSchema =
|
|
16044
|
+
workGraphTraversalDirectionSchema = z14.enum([
|
|
15644
16045
|
"ancestors",
|
|
15645
16046
|
"descendants",
|
|
15646
16047
|
"upstream",
|
|
15647
16048
|
"downstream"
|
|
15648
16049
|
]);
|
|
15649
|
-
workGraphEdgeDirectionSchema =
|
|
15650
|
-
paginationParamsSchema =
|
|
15651
|
-
cursor:
|
|
15652
|
-
limit:
|
|
16050
|
+
workGraphEdgeDirectionSchema = z14.enum(["out", "in", "both"]);
|
|
16051
|
+
paginationParamsSchema = z14.object({
|
|
16052
|
+
cursor: z14.string().min(1).optional(),
|
|
16053
|
+
limit: z14.number().int().positive().max(500).optional()
|
|
15653
16054
|
});
|
|
15654
|
-
workGraphNodeSchema =
|
|
15655
|
-
id:
|
|
16055
|
+
workGraphNodeSchema = z14.object({
|
|
16056
|
+
id: z14.string().min(1),
|
|
15656
16057
|
type: taskTypeSchema,
|
|
15657
|
-
title:
|
|
16058
|
+
title: z14.string(),
|
|
15658
16059
|
status: taskStatusSchema,
|
|
15659
16060
|
priority: taskPrioritySchema,
|
|
15660
|
-
parentId:
|
|
16061
|
+
parentId: z14.string().min(1).optional()
|
|
15661
16062
|
});
|
|
15662
|
-
workGraphEdgeSchema =
|
|
15663
|
-
fromId:
|
|
15664
|
-
toId:
|
|
16063
|
+
workGraphEdgeSchema = z14.object({
|
|
16064
|
+
fromId: z14.string().min(1),
|
|
16065
|
+
toId: z14.string().min(1),
|
|
15665
16066
|
kind: workGraphRelationKindSchema
|
|
15666
16067
|
});
|
|
15667
|
-
workGraphHierarchyEdgeSchema =
|
|
15668
|
-
fromId:
|
|
15669
|
-
toId:
|
|
15670
|
-
kind:
|
|
16068
|
+
workGraphHierarchyEdgeSchema = z14.object({
|
|
16069
|
+
fromId: z14.string().min(1),
|
|
16070
|
+
toId: z14.string().min(1),
|
|
16071
|
+
kind: z14.literal("contains")
|
|
15671
16072
|
}).strict();
|
|
15672
|
-
workGraphPageInfoSchema =
|
|
15673
|
-
nextCursor:
|
|
15674
|
-
hasMore:
|
|
15675
|
-
});
|
|
15676
|
-
workGraphRollupCountsSchema =
|
|
15677
|
-
total:
|
|
15678
|
-
byStatus:
|
|
15679
|
-
byType:
|
|
15680
|
-
});
|
|
15681
|
-
workGraphSubtreePercentagesSchema =
|
|
15682
|
-
done:
|
|
15683
|
-
active:
|
|
15684
|
-
blocked:
|
|
15685
|
-
pending:
|
|
15686
|
-
cancelled:
|
|
15687
|
-
});
|
|
15688
|
-
workGraphProjectionMismatchSchema =
|
|
15689
|
-
field:
|
|
15690
|
-
expected:
|
|
15691
|
-
actual:
|
|
16073
|
+
workGraphPageInfoSchema = z14.object({
|
|
16074
|
+
nextCursor: z14.string().min(1).optional(),
|
|
16075
|
+
hasMore: z14.boolean()
|
|
16076
|
+
});
|
|
16077
|
+
workGraphRollupCountsSchema = z14.object({
|
|
16078
|
+
total: z14.number().int().nonnegative(),
|
|
16079
|
+
byStatus: z14.partialRecord(taskStatusSchema, z14.number().int().nonnegative()),
|
|
16080
|
+
byType: z14.partialRecord(taskTypeSchema, z14.number().int().nonnegative())
|
|
16081
|
+
});
|
|
16082
|
+
workGraphSubtreePercentagesSchema = z14.object({
|
|
16083
|
+
done: z14.number().nonnegative(),
|
|
16084
|
+
active: z14.number().nonnegative(),
|
|
16085
|
+
blocked: z14.number().nonnegative(),
|
|
16086
|
+
pending: z14.number().nonnegative(),
|
|
16087
|
+
cancelled: z14.number().nonnegative()
|
|
16088
|
+
});
|
|
16089
|
+
workGraphProjectionMismatchSchema = z14.object({
|
|
16090
|
+
field: z14.string().min(1),
|
|
16091
|
+
expected: z14.number().int().nonnegative(),
|
|
16092
|
+
actual: z14.number().int().nonnegative()
|
|
15692
16093
|
});
|
|
15693
16094
|
workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
15694
|
-
role:
|
|
15695
|
-
dependencyBlockers:
|
|
15696
|
-
gateBlockers:
|
|
16095
|
+
role: z14.string().min(1).optional(),
|
|
16096
|
+
dependencyBlockers: z14.array(z14.object({ taskId: z14.string().min(1), status: taskStatusSchema })),
|
|
16097
|
+
gateBlockers: z14.array(z14.object({ gate: verificationGateSchema }))
|
|
15697
16098
|
});
|
|
15698
16099
|
workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
15699
|
-
source:
|
|
15700
|
-
relationType:
|
|
15701
|
-
reason:
|
|
16100
|
+
source: z14.literal("relation"),
|
|
16101
|
+
relationType: z14.enum(TASK_RELATION_TYPES),
|
|
16102
|
+
reason: z14.string().min(1).optional()
|
|
15702
16103
|
});
|
|
15703
16104
|
workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
15704
|
-
source:
|
|
15705
|
-
kind:
|
|
16105
|
+
source: z14.literal("dependency"),
|
|
16106
|
+
kind: z14.literal("depends_on")
|
|
15706
16107
|
});
|
|
15707
|
-
workGraphOmissionReasonSchema =
|
|
16108
|
+
workGraphOmissionReasonSchema = z14.enum([
|
|
15708
16109
|
"budget_exceeded",
|
|
15709
16110
|
"not_requested",
|
|
15710
16111
|
"not_available",
|
|
15711
16112
|
"redacted",
|
|
15712
16113
|
"truncated"
|
|
15713
16114
|
]);
|
|
15714
|
-
workGraphContextBudgetSchema =
|
|
15715
|
-
tokenBudget:
|
|
15716
|
-
estimatedTokens:
|
|
15717
|
-
remainingTokens:
|
|
15718
|
-
truncated:
|
|
15719
|
-
});
|
|
15720
|
-
workGraphOmissionSchema =
|
|
15721
|
-
path:
|
|
16115
|
+
workGraphContextBudgetSchema = z14.object({
|
|
16116
|
+
tokenBudget: z14.number().int().nonnegative(),
|
|
16117
|
+
estimatedTokens: z14.number().int().nonnegative(),
|
|
16118
|
+
remainingTokens: z14.number().int().nonnegative(),
|
|
16119
|
+
truncated: z14.boolean()
|
|
16120
|
+
});
|
|
16121
|
+
workGraphOmissionSchema = z14.object({
|
|
16122
|
+
path: z14.string().min(1),
|
|
15722
16123
|
reason: workGraphOmissionReasonSchema,
|
|
15723
|
-
message:
|
|
15724
|
-
estimatedTokens:
|
|
16124
|
+
message: z14.string().min(1),
|
|
16125
|
+
estimatedTokens: z14.number().int().nonnegative().optional()
|
|
15725
16126
|
});
|
|
15726
|
-
workGraphDirectEdgeSchema =
|
|
16127
|
+
workGraphDirectEdgeSchema = z14.discriminatedUnion("source", [
|
|
15727
16128
|
workGraphRelationEdgeSchema,
|
|
15728
16129
|
workGraphDependencyEdgeSchema
|
|
15729
16130
|
]);
|
|
15730
16131
|
workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
15731
|
-
rootId:
|
|
15732
|
-
tokenBudget:
|
|
15733
|
-
includeRelations:
|
|
15734
|
-
includeReadiness:
|
|
15735
|
-
includeRollup:
|
|
16132
|
+
rootId: z14.string().min(1),
|
|
16133
|
+
tokenBudget: z14.number().int().positive().optional(),
|
|
16134
|
+
includeRelations: z14.boolean().optional(),
|
|
16135
|
+
includeReadiness: z14.boolean().optional(),
|
|
16136
|
+
includeRollup: z14.boolean().optional()
|
|
15736
16137
|
});
|
|
15737
16138
|
workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
15738
|
-
rootId:
|
|
16139
|
+
rootId: z14.string().min(1),
|
|
15739
16140
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
15740
|
-
maxDepth:
|
|
15741
|
-
includeRelations:
|
|
16141
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
16142
|
+
includeRelations: z14.boolean().optional()
|
|
15742
16143
|
});
|
|
15743
|
-
workGraphSliceSchema =
|
|
15744
|
-
rootId:
|
|
16144
|
+
workGraphSliceSchema = z14.object({
|
|
16145
|
+
rootId: z14.string().min(1),
|
|
15745
16146
|
direction: workGraphTraversalDirectionSchema,
|
|
15746
|
-
nodes:
|
|
15747
|
-
edges:
|
|
16147
|
+
nodes: z14.array(workGraphNodeSchema),
|
|
16148
|
+
edges: z14.array(workGraphEdgeSchema),
|
|
15748
16149
|
pageInfo: workGraphPageInfoSchema,
|
|
15749
|
-
omissions:
|
|
15750
|
-
});
|
|
15751
|
-
workGraphReadinessParamsSchema =
|
|
15752
|
-
rootId:
|
|
15753
|
-
role:
|
|
15754
|
-
includeGateBlockers:
|
|
15755
|
-
});
|
|
15756
|
-
workGraphReadinessResultSchema =
|
|
15757
|
-
rootId:
|
|
15758
|
-
role:
|
|
15759
|
-
ready:
|
|
15760
|
-
warnings:
|
|
15761
|
-
groups:
|
|
15762
|
-
ready:
|
|
15763
|
-
blocked:
|
|
15764
|
-
blockedBy:
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
kind:
|
|
15768
|
-
blockerId:
|
|
15769
|
-
blocks:
|
|
16150
|
+
omissions: z14.array(workGraphOmissionSchema).optional()
|
|
16151
|
+
});
|
|
16152
|
+
workGraphReadinessParamsSchema = z14.object({
|
|
16153
|
+
rootId: z14.string().min(1),
|
|
16154
|
+
role: z14.string().min(1).optional(),
|
|
16155
|
+
includeGateBlockers: z14.boolean().optional()
|
|
16156
|
+
});
|
|
16157
|
+
workGraphReadinessResultSchema = z14.object({
|
|
16158
|
+
rootId: z14.string().min(1),
|
|
16159
|
+
role: z14.string().min(1).optional(),
|
|
16160
|
+
ready: z14.boolean(),
|
|
16161
|
+
warnings: z14.array(z14.string()),
|
|
16162
|
+
groups: z14.object({
|
|
16163
|
+
ready: z14.array(workGraphReadyFrontierTaskSchema),
|
|
16164
|
+
blocked: z14.array(workGraphReadyFrontierTaskSchema),
|
|
16165
|
+
blockedBy: z14.array(
|
|
16166
|
+
z14.discriminatedUnion("kind", [
|
|
16167
|
+
z14.object({
|
|
16168
|
+
kind: z14.literal("dependency"),
|
|
16169
|
+
blockerId: z14.string().min(1),
|
|
16170
|
+
blocks: z14.array(z14.string().min(1))
|
|
15770
16171
|
}),
|
|
15771
|
-
|
|
15772
|
-
kind:
|
|
16172
|
+
z14.object({
|
|
16173
|
+
kind: z14.literal("gate"),
|
|
15773
16174
|
gate: verificationGateSchema,
|
|
15774
|
-
blocks:
|
|
16175
|
+
blocks: z14.array(z14.string().min(1))
|
|
15775
16176
|
})
|
|
15776
16177
|
])
|
|
15777
16178
|
)
|
|
15778
16179
|
})
|
|
15779
16180
|
});
|
|
15780
|
-
workGraphContextPackSchema =
|
|
15781
|
-
rootId:
|
|
15782
|
-
generatedAt:
|
|
16181
|
+
workGraphContextPackSchema = z14.object({
|
|
16182
|
+
rootId: z14.string().min(1),
|
|
16183
|
+
generatedAt: z14.string().min(1),
|
|
15783
16184
|
budget: workGraphContextBudgetSchema,
|
|
15784
16185
|
slice: workGraphSliceSchema,
|
|
15785
|
-
relationEdges:
|
|
15786
|
-
rootId:
|
|
16186
|
+
relationEdges: z14.object({
|
|
16187
|
+
rootId: z14.string().min(1),
|
|
15787
16188
|
direction: workGraphEdgeDirectionSchema,
|
|
15788
|
-
edges:
|
|
16189
|
+
edges: z14.array(workGraphDirectEdgeSchema)
|
|
15789
16190
|
}).optional(),
|
|
15790
16191
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
15791
|
-
rollup:
|
|
15792
|
-
omissions:
|
|
15793
|
-
});
|
|
15794
|
-
workGraphScaffoldValidateParamsSchema =
|
|
15795
|
-
rootId:
|
|
15796
|
-
nodes:
|
|
15797
|
-
|
|
15798
|
-
id:
|
|
16192
|
+
rollup: z14.lazy(() => tasksRollupResultSchema).optional(),
|
|
16193
|
+
omissions: z14.array(workGraphOmissionSchema)
|
|
16194
|
+
});
|
|
16195
|
+
workGraphScaffoldValidateParamsSchema = z14.object({
|
|
16196
|
+
rootId: z14.string().min(1),
|
|
16197
|
+
nodes: z14.array(
|
|
16198
|
+
z14.object({
|
|
16199
|
+
id: z14.string().min(1),
|
|
15799
16200
|
type: taskTypeSchema,
|
|
15800
|
-
parentId:
|
|
16201
|
+
parentId: z14.string().min(1).nullable().optional()
|
|
15801
16202
|
})
|
|
15802
16203
|
),
|
|
15803
|
-
edges:
|
|
15804
|
-
dryRun:
|
|
15805
|
-
});
|
|
15806
|
-
workGraphScaffoldValidationIssueSchema =
|
|
15807
|
-
code:
|
|
15808
|
-
message:
|
|
15809
|
-
taskId:
|
|
15810
|
-
severity:
|
|
15811
|
-
});
|
|
15812
|
-
workGraphScaffoldValidateResultSchema =
|
|
15813
|
-
rootId:
|
|
15814
|
-
valid:
|
|
15815
|
-
dryRun:
|
|
15816
|
-
issues:
|
|
15817
|
-
hierarchy:
|
|
15818
|
-
valid:
|
|
15819
|
-
violations:
|
|
15820
|
-
|
|
15821
|
-
code:
|
|
15822
|
-
taskId:
|
|
16204
|
+
edges: z14.array(workGraphDirectEdgeSchema).optional(),
|
|
16205
|
+
dryRun: z14.boolean().optional()
|
|
16206
|
+
});
|
|
16207
|
+
workGraphScaffoldValidationIssueSchema = z14.object({
|
|
16208
|
+
code: z14.string().min(1),
|
|
16209
|
+
message: z14.string().min(1),
|
|
16210
|
+
taskId: z14.string().min(1).optional(),
|
|
16211
|
+
severity: z14.enum(["error", "warning"])
|
|
16212
|
+
});
|
|
16213
|
+
workGraphScaffoldValidateResultSchema = z14.object({
|
|
16214
|
+
rootId: z14.string().min(1),
|
|
16215
|
+
valid: z14.boolean(),
|
|
16216
|
+
dryRun: z14.boolean(),
|
|
16217
|
+
issues: z14.array(workGraphScaffoldValidationIssueSchema),
|
|
16218
|
+
hierarchy: z14.object({
|
|
16219
|
+
valid: z14.boolean(),
|
|
16220
|
+
violations: z14.array(
|
|
16221
|
+
z14.object({
|
|
16222
|
+
code: z14.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16223
|
+
taskId: z14.string().min(1),
|
|
15823
16224
|
taskType: taskTypeSchema,
|
|
15824
|
-
parentId:
|
|
16225
|
+
parentId: z14.string().min(1).nullable(),
|
|
15825
16226
|
parentType: taskTypeSchema.optional(),
|
|
15826
|
-
message:
|
|
16227
|
+
message: z14.string().min(1)
|
|
15827
16228
|
})
|
|
15828
16229
|
)
|
|
15829
16230
|
})
|
|
15830
16231
|
});
|
|
15831
16232
|
workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
15832
|
-
apply:
|
|
16233
|
+
apply: z14.boolean().optional()
|
|
15833
16234
|
});
|
|
15834
16235
|
workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
15835
|
-
applied:
|
|
15836
|
-
nodesChanged:
|
|
15837
|
-
edgesChanged:
|
|
15838
|
-
});
|
|
15839
|
-
workGraphPlanningDocParamsSchema =
|
|
15840
|
-
rootId:
|
|
15841
|
-
audience:
|
|
15842
|
-
tokenBudget:
|
|
15843
|
-
includeRelations:
|
|
15844
|
-
includeReadiness:
|
|
15845
|
-
includeRollup:
|
|
15846
|
-
});
|
|
15847
|
-
workGraphPlanningDocSchema =
|
|
15848
|
-
rootId:
|
|
15849
|
-
generatedAt:
|
|
15850
|
-
audience:
|
|
15851
|
-
title:
|
|
15852
|
-
content:
|
|
15853
|
-
sections:
|
|
15854
|
-
estimatedTokens:
|
|
15855
|
-
budget:
|
|
15856
|
-
tokenBudget:
|
|
15857
|
-
truncated:
|
|
16236
|
+
applied: z14.boolean(),
|
|
16237
|
+
nodesChanged: z14.number().int().nonnegative(),
|
|
16238
|
+
edgesChanged: z14.number().int().nonnegative()
|
|
16239
|
+
});
|
|
16240
|
+
workGraphPlanningDocParamsSchema = z14.object({
|
|
16241
|
+
rootId: z14.string().min(1),
|
|
16242
|
+
audience: z14.enum(["agent", "maintainer"]),
|
|
16243
|
+
tokenBudget: z14.number().int().positive().optional(),
|
|
16244
|
+
includeRelations: z14.boolean().optional(),
|
|
16245
|
+
includeReadiness: z14.boolean().optional(),
|
|
16246
|
+
includeRollup: z14.boolean().optional()
|
|
16247
|
+
});
|
|
16248
|
+
workGraphPlanningDocSchema = z14.object({
|
|
16249
|
+
rootId: z14.string().min(1),
|
|
16250
|
+
generatedAt: z14.string().min(1),
|
|
16251
|
+
audience: z14.enum(["agent", "maintainer"]),
|
|
16252
|
+
title: z14.string().min(1),
|
|
16253
|
+
content: z14.string(),
|
|
16254
|
+
sections: z14.array(z14.string().min(1)),
|
|
16255
|
+
estimatedTokens: z14.number().int().nonnegative(),
|
|
16256
|
+
budget: z14.object({
|
|
16257
|
+
tokenBudget: z14.number().int().positive(),
|
|
16258
|
+
truncated: z14.boolean()
|
|
15858
16259
|
}).optional()
|
|
15859
16260
|
});
|
|
15860
16261
|
tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
15861
|
-
rootId:
|
|
16262
|
+
rootId: z14.string().min(1),
|
|
15862
16263
|
direction: workGraphTraversalDirectionSchema,
|
|
15863
|
-
maxDepth:
|
|
15864
|
-
includeRelations:
|
|
16264
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
16265
|
+
includeRelations: z14.boolean().optional()
|
|
15865
16266
|
});
|
|
15866
|
-
tasksTraverseResultSchema =
|
|
15867
|
-
rootId:
|
|
16267
|
+
tasksTraverseResultSchema = z14.object({
|
|
16268
|
+
rootId: z14.string().min(1),
|
|
15868
16269
|
direction: workGraphTraversalDirectionSchema,
|
|
15869
|
-
nodes:
|
|
15870
|
-
edges:
|
|
16270
|
+
nodes: z14.array(workGraphNodeSchema),
|
|
16271
|
+
edges: z14.array(workGraphEdgeSchema),
|
|
15871
16272
|
pageInfo: workGraphPageInfoSchema
|
|
15872
16273
|
});
|
|
15873
16274
|
tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
15874
|
-
rootId:
|
|
15875
|
-
maxDepth:
|
|
16275
|
+
rootId: z14.string().min(1),
|
|
16276
|
+
maxDepth: z14.number().int().nonnegative().optional()
|
|
15876
16277
|
});
|
|
15877
|
-
tasksTreeResultSchema =
|
|
15878
|
-
rootId:
|
|
15879
|
-
nodes:
|
|
15880
|
-
edges:
|
|
16278
|
+
tasksTreeResultSchema = z14.object({
|
|
16279
|
+
rootId: z14.string().min(1),
|
|
16280
|
+
nodes: z14.array(workGraphNodeSchema.extend({ depth: z14.number().int().positive() })),
|
|
16281
|
+
edges: z14.array(workGraphHierarchyEdgeSchema),
|
|
15881
16282
|
pageInfo: workGraphPageInfoSchema
|
|
15882
16283
|
});
|
|
15883
|
-
tasksRollupParamsSchema =
|
|
15884
|
-
rootId:
|
|
16284
|
+
tasksRollupParamsSchema = z14.object({
|
|
16285
|
+
rootId: z14.string().min(1),
|
|
15885
16286
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
15886
16287
|
});
|
|
15887
|
-
tasksRollupResultSchema =
|
|
15888
|
-
rootId:
|
|
16288
|
+
tasksRollupResultSchema = z14.object({
|
|
16289
|
+
rootId: z14.string().min(1),
|
|
15889
16290
|
direct: workGraphRollupCountsSchema,
|
|
15890
16291
|
subtree: workGraphRollupCountsSchema,
|
|
15891
|
-
percentDenominator:
|
|
15892
|
-
basis:
|
|
15893
|
-
total:
|
|
15894
|
-
description:
|
|
16292
|
+
percentDenominator: z14.object({
|
|
16293
|
+
basis: z14.literal("subtree-total"),
|
|
16294
|
+
total: z14.number().int().nonnegative(),
|
|
16295
|
+
description: z14.string().min(1)
|
|
15895
16296
|
}),
|
|
15896
16297
|
percentages: workGraphSubtreePercentagesSchema,
|
|
15897
|
-
staleProjection:
|
|
15898
|
-
projectionMismatches:
|
|
15899
|
-
});
|
|
15900
|
-
tasksFrontierParamsSchema =
|
|
15901
|
-
rootId:
|
|
15902
|
-
role:
|
|
15903
|
-
});
|
|
15904
|
-
tasksFrontierResultSchema =
|
|
15905
|
-
rootId:
|
|
15906
|
-
role:
|
|
15907
|
-
groups:
|
|
15908
|
-
ready:
|
|
15909
|
-
blocked:
|
|
15910
|
-
blockedBy:
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
kind:
|
|
15914
|
-
blockerId:
|
|
15915
|
-
blocks:
|
|
16298
|
+
staleProjection: z14.boolean(),
|
|
16299
|
+
projectionMismatches: z14.array(workGraphProjectionMismatchSchema)
|
|
16300
|
+
});
|
|
16301
|
+
tasksFrontierParamsSchema = z14.object({
|
|
16302
|
+
rootId: z14.string().min(1),
|
|
16303
|
+
role: z14.string().min(1).optional()
|
|
16304
|
+
});
|
|
16305
|
+
tasksFrontierResultSchema = z14.object({
|
|
16306
|
+
rootId: z14.string().min(1),
|
|
16307
|
+
role: z14.string().min(1).optional(),
|
|
16308
|
+
groups: z14.object({
|
|
16309
|
+
ready: z14.array(workGraphReadyFrontierTaskSchema),
|
|
16310
|
+
blocked: z14.array(workGraphReadyFrontierTaskSchema),
|
|
16311
|
+
blockedBy: z14.array(
|
|
16312
|
+
z14.discriminatedUnion("kind", [
|
|
16313
|
+
z14.object({
|
|
16314
|
+
kind: z14.literal("dependency"),
|
|
16315
|
+
blockerId: z14.string().min(1),
|
|
16316
|
+
blocks: z14.array(z14.string().min(1))
|
|
15916
16317
|
}),
|
|
15917
|
-
|
|
15918
|
-
kind:
|
|
16318
|
+
z14.object({
|
|
16319
|
+
kind: z14.literal("gate"),
|
|
15919
16320
|
gate: verificationGateSchema,
|
|
15920
|
-
blocks:
|
|
16321
|
+
blocks: z14.array(z14.string().min(1))
|
|
15921
16322
|
})
|
|
15922
16323
|
])
|
|
15923
16324
|
)
|
|
15924
16325
|
})
|
|
15925
16326
|
});
|
|
15926
16327
|
tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
15927
|
-
rootId:
|
|
15928
|
-
maxDepth:
|
|
15929
|
-
includeRelations:
|
|
15930
|
-
});
|
|
15931
|
-
tasksWorkGraphAuditResultSchema =
|
|
15932
|
-
rootId:
|
|
15933
|
-
hierarchy:
|
|
15934
|
-
valid:
|
|
15935
|
-
violations:
|
|
15936
|
-
|
|
15937
|
-
code:
|
|
15938
|
-
taskId:
|
|
16328
|
+
rootId: z14.string().min(1),
|
|
16329
|
+
maxDepth: z14.number().int().nonnegative().optional(),
|
|
16330
|
+
includeRelations: z14.boolean().optional()
|
|
16331
|
+
});
|
|
16332
|
+
tasksWorkGraphAuditResultSchema = z14.object({
|
|
16333
|
+
rootId: z14.string().min(1),
|
|
16334
|
+
hierarchy: z14.object({
|
|
16335
|
+
valid: z14.boolean(),
|
|
16336
|
+
violations: z14.array(
|
|
16337
|
+
z14.object({
|
|
16338
|
+
code: z14.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16339
|
+
taskId: z14.string().min(1),
|
|
15939
16340
|
taskType: taskTypeSchema,
|
|
15940
|
-
parentId:
|
|
16341
|
+
parentId: z14.string().min(1).nullable(),
|
|
15941
16342
|
parentType: taskTypeSchema.optional(),
|
|
15942
|
-
message:
|
|
16343
|
+
message: z14.string().min(1)
|
|
15943
16344
|
})
|
|
15944
16345
|
)
|
|
15945
16346
|
}),
|
|
15946
16347
|
traversal: tasksTraverseResultSchema,
|
|
15947
16348
|
frontier: tasksFrontierResultSchema,
|
|
15948
16349
|
rollup: tasksRollupResultSchema,
|
|
15949
|
-
relationEdges:
|
|
15950
|
-
rootId:
|
|
16350
|
+
relationEdges: z14.object({
|
|
16351
|
+
rootId: z14.string().min(1),
|
|
15951
16352
|
direction: workGraphEdgeDirectionSchema,
|
|
15952
|
-
edges:
|
|
15953
|
-
|
|
16353
|
+
edges: z14.array(
|
|
16354
|
+
z14.discriminatedUnion("source", [
|
|
15954
16355
|
workGraphRelationEdgeSchema,
|
|
15955
16356
|
workGraphDependencyEdgeSchema
|
|
15956
16357
|
])
|
|
@@ -15970,49 +16371,49 @@ var init_operation_envelope_validation = __esm({
|
|
|
15970
16371
|
});
|
|
15971
16372
|
|
|
15972
16373
|
// packages/contracts/src/operations/docs.ts
|
|
15973
|
-
import { z as
|
|
16374
|
+
import { z as z15 } from "zod";
|
|
15974
16375
|
var DOCS_PROJECTION_PROPOSAL_SCHEMA, DOCS_PROJECTION_RECEIPT_SCHEMA;
|
|
15975
16376
|
var init_docs = __esm({
|
|
15976
16377
|
"packages/contracts/src/operations/docs.ts"() {
|
|
15977
16378
|
"use strict";
|
|
15978
16379
|
init_docs_taxonomy();
|
|
15979
16380
|
init_docs_lifecycle();
|
|
15980
|
-
DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
15981
|
-
version:
|
|
15982
|
-
operation:
|
|
15983
|
-
identity:
|
|
15984
|
-
projectId:
|
|
15985
|
-
projectRoot:
|
|
15986
|
-
actor:
|
|
15987
|
-
operation:
|
|
15988
|
-
idempotencyKey:
|
|
16381
|
+
DOCS_PROJECTION_PROPOSAL_SCHEMA = z15.object({
|
|
16382
|
+
version: z15.literal(1),
|
|
16383
|
+
operation: z15.literal("docs.projection"),
|
|
16384
|
+
identity: z15.object({
|
|
16385
|
+
projectId: z15.string().min(1),
|
|
16386
|
+
projectRoot: z15.string().min(1),
|
|
16387
|
+
actor: z15.string().min(1),
|
|
16388
|
+
operation: z15.literal("docs.projection"),
|
|
16389
|
+
idempotencyKey: z15.string().min(1)
|
|
15989
16390
|
}).strict(),
|
|
15990
|
-
source:
|
|
15991
|
-
attachmentId:
|
|
15992
|
-
sha256:
|
|
15993
|
-
ownerId:
|
|
15994
|
-
ownerType:
|
|
15995
|
-
label:
|
|
16391
|
+
source: z15.object({
|
|
16392
|
+
attachmentId: z15.string().min(1),
|
|
16393
|
+
sha256: z15.string().regex(/^[a-f0-9]{64}$/),
|
|
16394
|
+
ownerId: z15.string().min(1),
|
|
16395
|
+
ownerType: z15.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
16396
|
+
label: z15.string().min(1)
|
|
15996
16397
|
}).strict(),
|
|
15997
|
-
observation:
|
|
15998
|
-
kind:
|
|
15999
|
-
attachmentId:
|
|
16000
|
-
ownerId:
|
|
16001
|
-
addedAt:
|
|
16002
|
-
slug:
|
|
16003
|
-
type:
|
|
16398
|
+
observation: z15.object({
|
|
16399
|
+
kind: z15.literal("doc-attachment"),
|
|
16400
|
+
attachmentId: z15.string().min(1),
|
|
16401
|
+
ownerId: z15.string().min(1),
|
|
16402
|
+
addedAt: z15.string().min(1),
|
|
16403
|
+
slug: z15.string().optional(),
|
|
16404
|
+
type: z15.string().optional()
|
|
16004
16405
|
}).strict()
|
|
16005
16406
|
}).strict();
|
|
16006
|
-
DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
16007
|
-
version:
|
|
16008
|
-
sourceHash:
|
|
16009
|
-
graph:
|
|
16407
|
+
DOCS_PROJECTION_RECEIPT_SCHEMA = z15.object({
|
|
16408
|
+
version: z15.literal(1),
|
|
16409
|
+
sourceHash: z15.string().regex(/^[a-f0-9]{64}$/),
|
|
16410
|
+
graph: z15.enum(["completed", "disabled"]),
|
|
16010
16411
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
16011
|
-
observationId:
|
|
16412
|
+
observationId: z15.string().min(1).optional(),
|
|
16012
16413
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
16013
|
-
documents:
|
|
16014
|
-
verifiedAt:
|
|
16015
|
-
actor:
|
|
16414
|
+
documents: z15.literal(true).optional(),
|
|
16415
|
+
verifiedAt: z15.string().min(1),
|
|
16416
|
+
actor: z15.string().min(1)
|
|
16016
16417
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
16017
16418
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
16018
16419
|
});
|
|
@@ -16020,22 +16421,22 @@ var init_docs = __esm({
|
|
|
16020
16421
|
});
|
|
16021
16422
|
|
|
16022
16423
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
16023
|
-
import { z as
|
|
16424
|
+
import { z as z16 } from "zod";
|
|
16024
16425
|
var taskTreeEntrySchema, taskTreeSchema, evidenceSchema, passthroughSchema, LEGACY_PASSTHROUGH_SCHEMA_NAMES, ENSURES_SCHEMA_REGISTRY;
|
|
16025
16426
|
var init_ensures_schema_registry = __esm({
|
|
16026
16427
|
"packages/contracts/src/operations/ensures-schema-registry.ts"() {
|
|
16027
16428
|
"use strict";
|
|
16028
|
-
taskTreeEntrySchema =
|
|
16029
|
-
title:
|
|
16030
|
-
acceptance:
|
|
16429
|
+
taskTreeEntrySchema = z16.object({
|
|
16430
|
+
title: z16.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
|
|
16431
|
+
acceptance: z16.array(z16.unknown(), { message: "must have a non-empty acceptance array" }).min(1, { message: "must have a non-empty acceptance array" }).refine((arr) => arr.some((s) => typeof s === "string" && s.trim().length > 0), {
|
|
16031
16432
|
message: "acceptance array contains no non-empty strings"
|
|
16032
16433
|
}),
|
|
16033
|
-
id:
|
|
16034
|
-
parentId:
|
|
16035
|
-
depends:
|
|
16434
|
+
id: z16.string().optional(),
|
|
16435
|
+
parentId: z16.string().optional(),
|
|
16436
|
+
depends: z16.array(z16.string()).optional()
|
|
16036
16437
|
});
|
|
16037
|
-
taskTreeSchema =
|
|
16038
|
-
evidenceSchema =
|
|
16438
|
+
taskTreeSchema = z16.array(taskTreeEntrySchema, { message: "task_tree must be a non-empty array" }).min(1, { message: "task_tree is an empty array \u2014 decomposition produced no tasks" });
|
|
16439
|
+
evidenceSchema = z16.unknown().superRefine((value, ctx) => {
|
|
16039
16440
|
if (value === null || value === void 0) {
|
|
16040
16441
|
ctx.addIssue({
|
|
16041
16442
|
code: "custom",
|
|
@@ -16069,7 +16470,7 @@ var init_ensures_schema_registry = __esm({
|
|
|
16069
16470
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
16070
16471
|
});
|
|
16071
16472
|
});
|
|
16072
|
-
passthroughSchema =
|
|
16473
|
+
passthroughSchema = z16.unknown();
|
|
16073
16474
|
LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
16074
16475
|
// release.cantbook
|
|
16075
16476
|
"version_bump_report",
|
|
@@ -16354,41 +16755,41 @@ var init_process_probe = __esm({
|
|
|
16354
16755
|
});
|
|
16355
16756
|
|
|
16356
16757
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
16357
|
-
import { z as
|
|
16758
|
+
import { z as z17 } from "zod";
|
|
16358
16759
|
var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
16359
16760
|
var init_evidence_atoms = __esm({
|
|
16360
16761
|
"packages/contracts/src/release/evidence-atoms.ts"() {
|
|
16361
16762
|
"use strict";
|
|
16362
|
-
parsedPrEvidenceAtomSchema =
|
|
16363
|
-
kind:
|
|
16364
|
-
prNumber:
|
|
16365
|
-
});
|
|
16366
|
-
prEvidenceStateModifierSchema =
|
|
16367
|
-
kind:
|
|
16368
|
-
value:
|
|
16369
|
-
});
|
|
16370
|
-
ghPrViewSchema =
|
|
16371
|
-
state:
|
|
16372
|
-
mergedAt:
|
|
16373
|
-
headRefOid:
|
|
16374
|
-
mergeCommit:
|
|
16375
|
-
title:
|
|
16376
|
-
body:
|
|
16377
|
-
headRefName:
|
|
16378
|
-
files:
|
|
16379
|
-
changedFiles:
|
|
16380
|
-
mergeable:
|
|
16381
|
-
statusCheckRollup:
|
|
16382
|
-
|
|
16383
|
-
__typename:
|
|
16384
|
-
name:
|
|
16385
|
-
workflowName:
|
|
16386
|
-
conclusion:
|
|
16387
|
-
status:
|
|
16763
|
+
parsedPrEvidenceAtomSchema = z17.object({
|
|
16764
|
+
kind: z17.literal("pr"),
|
|
16765
|
+
prNumber: z17.number().int().positive()
|
|
16766
|
+
});
|
|
16767
|
+
prEvidenceStateModifierSchema = z17.object({
|
|
16768
|
+
kind: z17.literal("state"),
|
|
16769
|
+
value: z17.literal("MERGED")
|
|
16770
|
+
});
|
|
16771
|
+
ghPrViewSchema = z17.object({
|
|
16772
|
+
state: z17.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
16773
|
+
mergedAt: z17.string().nullable(),
|
|
16774
|
+
headRefOid: z17.string().optional(),
|
|
16775
|
+
mergeCommit: z17.object({ oid: z17.string() }).nullable().optional(),
|
|
16776
|
+
title: z17.string().optional(),
|
|
16777
|
+
body: z17.string().optional(),
|
|
16778
|
+
headRefName: z17.string().optional(),
|
|
16779
|
+
files: z17.array(z17.object({ path: z17.string() })).optional(),
|
|
16780
|
+
changedFiles: z17.number().int().nonnegative().optional(),
|
|
16781
|
+
mergeable: z17.string().optional(),
|
|
16782
|
+
statusCheckRollup: z17.array(
|
|
16783
|
+
z17.object({
|
|
16784
|
+
__typename: z17.string().optional(),
|
|
16785
|
+
name: z17.string().optional(),
|
|
16786
|
+
workflowName: z17.string().optional(),
|
|
16787
|
+
conclusion: z17.string().nullable().optional(),
|
|
16788
|
+
status: z17.string().optional(),
|
|
16388
16789
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16389
|
-
startedAt:
|
|
16790
|
+
startedAt: z17.string().nullable().optional(),
|
|
16390
16791
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16391
|
-
completedAt:
|
|
16792
|
+
completedAt: z17.string().nullable().optional()
|
|
16392
16793
|
}).passthrough()
|
|
16393
16794
|
).optional().default([])
|
|
16394
16795
|
}).passthrough();
|
|
@@ -16397,7 +16798,7 @@ var init_evidence_atoms = __esm({
|
|
|
16397
16798
|
});
|
|
16398
16799
|
|
|
16399
16800
|
// packages/contracts/src/release/plan.ts
|
|
16400
|
-
import { z as
|
|
16801
|
+
import { z as z18 } from "zod";
|
|
16401
16802
|
var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
|
|
16402
16803
|
var init_plan = __esm({
|
|
16403
16804
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -16445,20 +16846,20 @@ var init_plan = __esm({
|
|
|
16445
16846
|
"language-default",
|
|
16446
16847
|
"legacy-alias"
|
|
16447
16848
|
];
|
|
16448
|
-
ReleaseChannelSchema =
|
|
16449
|
-
ReleaseSchemeSchema =
|
|
16450
|
-
ReleaseKindSchema =
|
|
16451
|
-
ReleaseStatusSchema =
|
|
16452
|
-
GateStatusSchema =
|
|
16453
|
-
GateNameSchema =
|
|
16454
|
-
PlatformTupleSchema =
|
|
16455
|
-
PublisherSchema =
|
|
16456
|
-
TaskKindSchema =
|
|
16457
|
-
ImpactSchema =
|
|
16458
|
-
ResolvedSourceSchema =
|
|
16459
|
-
Iso8601 =
|
|
16460
|
-
NonEmptyString =
|
|
16461
|
-
ReleasePlanTaskSchema =
|
|
16849
|
+
ReleaseChannelSchema = z18.enum(RELEASE_CHANNEL);
|
|
16850
|
+
ReleaseSchemeSchema = z18.enum(RELEASE_SCHEME);
|
|
16851
|
+
ReleaseKindSchema = z18.enum(RELEASE_KIND);
|
|
16852
|
+
ReleaseStatusSchema = z18.enum(RELEASE_STATUS);
|
|
16853
|
+
GateStatusSchema = z18.enum(GATE_STATUS);
|
|
16854
|
+
GateNameSchema = z18.enum(GATE_NAME);
|
|
16855
|
+
PlatformTupleSchema = z18.enum(PLATFORM_TUPLE);
|
|
16856
|
+
PublisherSchema = z18.enum(PUBLISHER);
|
|
16857
|
+
TaskKindSchema = z18.enum(TASK_KIND);
|
|
16858
|
+
ImpactSchema = z18.enum(IMPACT);
|
|
16859
|
+
ResolvedSourceSchema = z18.enum(RESOLVED_SOURCE);
|
|
16860
|
+
Iso8601 = z18.iso.datetime({ offset: true });
|
|
16861
|
+
NonEmptyString = z18.string().min(1);
|
|
16862
|
+
ReleasePlanTaskSchema = z18.object({
|
|
16462
16863
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
16463
16864
|
id: NonEmptyString,
|
|
16464
16865
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -16466,20 +16867,20 @@ var init_plan = __esm({
|
|
|
16466
16867
|
/** SemVer impact classification. */
|
|
16467
16868
|
impact: ImpactSchema,
|
|
16468
16869
|
/** Human-readable changelog line for this task. */
|
|
16469
|
-
userFacingSummary:
|
|
16870
|
+
userFacingSummary: z18.string(),
|
|
16470
16871
|
/**
|
|
16471
16872
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
16472
16873
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
16473
16874
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
16474
16875
|
* enforces non-empty via R-301.
|
|
16475
16876
|
*/
|
|
16476
|
-
evidenceAtoms:
|
|
16877
|
+
evidenceAtoms: z18.array(NonEmptyString),
|
|
16477
16878
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
16478
|
-
ivtrPhaseAtPlan:
|
|
16879
|
+
ivtrPhaseAtPlan: z18.string().optional(),
|
|
16479
16880
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
16480
16881
|
epicAncestor: NonEmptyString
|
|
16481
16882
|
});
|
|
16482
|
-
ReleaseGateSchema =
|
|
16883
|
+
ReleaseGateSchema = z18.object({
|
|
16483
16884
|
/** Canonical gate name. */
|
|
16484
16885
|
name: GateNameSchema,
|
|
16485
16886
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -16489,11 +16890,11 @@ var init_plan = __esm({
|
|
|
16489
16890
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
16490
16891
|
lastVerifiedAt: Iso8601,
|
|
16491
16892
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
16492
|
-
resolvedCommand:
|
|
16893
|
+
resolvedCommand: z18.string().optional(),
|
|
16493
16894
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
16494
16895
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
16495
16896
|
});
|
|
16496
|
-
ReleasePlatformMatrixEntrySchema =
|
|
16897
|
+
ReleasePlatformMatrixEntrySchema = z18.object({
|
|
16497
16898
|
/** Target platform tuple. */
|
|
16498
16899
|
platform: PlatformTupleSchema,
|
|
16499
16900
|
/** Distribution backend. */
|
|
@@ -16501,47 +16902,47 @@ var init_plan = __esm({
|
|
|
16501
16902
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
16502
16903
|
package: NonEmptyString,
|
|
16503
16904
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
16504
|
-
smoke:
|
|
16905
|
+
smoke: z18.boolean().default(true).optional()
|
|
16505
16906
|
});
|
|
16506
|
-
ReleasePreflightSummarySchema =
|
|
16907
|
+
ReleasePreflightSummarySchema = z18.object({
|
|
16507
16908
|
/** True if esbuild externals are out of sync with package.json. */
|
|
16508
|
-
esbuildExternalsDrift:
|
|
16909
|
+
esbuildExternalsDrift: z18.boolean(),
|
|
16509
16910
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
16510
|
-
lockfileDrift:
|
|
16911
|
+
lockfileDrift: z18.boolean(),
|
|
16511
16912
|
/** True if all epic children are in terminal lifecycle states. */
|
|
16512
|
-
epicCompletenessClean:
|
|
16913
|
+
epicCompletenessClean: z18.boolean(),
|
|
16513
16914
|
/** True if no task appears in multiple in-flight release plans. */
|
|
16514
|
-
doubleListingClean:
|
|
16915
|
+
doubleListingClean: z18.boolean(),
|
|
16515
16916
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
16516
|
-
preflightWarnings:
|
|
16917
|
+
preflightWarnings: z18.array(z18.string()).default([]).optional()
|
|
16517
16918
|
});
|
|
16518
|
-
ReleasePlanChangelogSchema =
|
|
16919
|
+
ReleasePlanChangelogSchema = z18.object({
|
|
16519
16920
|
/** `kind=feat` tasks. */
|
|
16520
|
-
features:
|
|
16921
|
+
features: z18.array(NonEmptyString).default([]),
|
|
16521
16922
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
16522
|
-
fixes:
|
|
16923
|
+
fixes: z18.array(NonEmptyString).default([]),
|
|
16523
16924
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
16524
|
-
chores:
|
|
16925
|
+
chores: z18.array(NonEmptyString).default([]),
|
|
16525
16926
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
16526
|
-
breaking:
|
|
16927
|
+
breaking: z18.array(NonEmptyString).default([])
|
|
16527
16928
|
});
|
|
16528
|
-
ReleasePlanMetaSchema =
|
|
16929
|
+
ReleasePlanMetaSchema = z18.object({
|
|
16529
16930
|
/** True if this is the project's first ever release. */
|
|
16530
|
-
firstEverRelease:
|
|
16931
|
+
firstEverRelease: z18.boolean().optional(),
|
|
16531
16932
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
16532
|
-
unresolvedTools:
|
|
16933
|
+
unresolvedTools: z18.array(z18.string()).optional(),
|
|
16533
16934
|
/** Project archetype detected at plan time. */
|
|
16534
|
-
archetype:
|
|
16535
|
-
}).catchall(
|
|
16536
|
-
ReleasePlanSchema =
|
|
16935
|
+
archetype: z18.string().optional()
|
|
16936
|
+
}).catchall(z18.unknown());
|
|
16937
|
+
ReleasePlanSchema = z18.object({
|
|
16537
16938
|
/** Schema URL for this plan version. */
|
|
16538
|
-
$schema:
|
|
16939
|
+
$schema: z18.string().optional(),
|
|
16539
16940
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
16540
16941
|
version: NonEmptyString,
|
|
16541
16942
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
16542
16943
|
resolvedVersion: NonEmptyString,
|
|
16543
16944
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
16544
|
-
suffixApplied:
|
|
16945
|
+
suffixApplied: z18.boolean(),
|
|
16545
16946
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
16546
16947
|
scheme: ReleaseSchemeSchema,
|
|
16547
16948
|
/** npm dist-tag channel for this release. */
|
|
@@ -16555,7 +16956,7 @@ var init_plan = __esm({
|
|
|
16555
16956
|
/** Release-kind classification. */
|
|
16556
16957
|
releaseKind: ReleaseKindSchema,
|
|
16557
16958
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
16558
|
-
hooksV1Promotion:
|
|
16959
|
+
hooksV1Promotion: z18.boolean().optional(),
|
|
16559
16960
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
16560
16961
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
16561
16962
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -16566,27 +16967,27 @@ var init_plan = __esm({
|
|
|
16566
16967
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
16567
16968
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
16568
16969
|
*/
|
|
16569
|
-
previousVersion:
|
|
16970
|
+
previousVersion: z18.string().nullable(),
|
|
16570
16971
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
16571
|
-
previousTag:
|
|
16972
|
+
previousTag: z18.string().nullable(),
|
|
16572
16973
|
/** ISO-8601 timestamp the previous release was published. */
|
|
16573
16974
|
previousShippedAt: Iso8601.nullable(),
|
|
16574
16975
|
/** Tasks rolled into this release. */
|
|
16575
|
-
tasks:
|
|
16976
|
+
tasks: z18.array(ReleasePlanTaskSchema),
|
|
16576
16977
|
/** Bucketed changelog. */
|
|
16577
16978
|
changelog: ReleasePlanChangelogSchema,
|
|
16578
16979
|
/** Per-gate verification status. */
|
|
16579
|
-
gates:
|
|
16980
|
+
gates: z18.array(ReleaseGateSchema),
|
|
16580
16981
|
/** Platform / publisher matrix. */
|
|
16581
|
-
platformMatrix:
|
|
16982
|
+
platformMatrix: z18.array(ReleasePlatformMatrixEntrySchema),
|
|
16582
16983
|
/** Preflight summary from `cleo release plan`. */
|
|
16583
16984
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
16584
16985
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
16585
|
-
workflowRunUrl:
|
|
16986
|
+
workflowRunUrl: z18.string().nullable(),
|
|
16586
16987
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
16587
|
-
prUrl:
|
|
16988
|
+
prUrl: z18.string().nullable(),
|
|
16588
16989
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
16589
|
-
mergeCommitSha:
|
|
16990
|
+
mergeCommitSha: z18.string().nullable(),
|
|
16590
16991
|
/** Current FSM state per R-302. */
|
|
16591
16992
|
status: ReleaseStatusSchema,
|
|
16592
16993
|
/** Informational / forward-compat metadata. */
|
|
@@ -16670,61 +17071,67 @@ var init_session2 = __esm({
|
|
|
16670
17071
|
});
|
|
16671
17072
|
|
|
16672
17073
|
// packages/contracts/src/session-journal.ts
|
|
16673
|
-
import { z as
|
|
17074
|
+
import { z as z19 } from "zod";
|
|
16674
17075
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
16675
17076
|
var init_session_journal = __esm({
|
|
16676
17077
|
"packages/contracts/src/session-journal.ts"() {
|
|
16677
17078
|
"use strict";
|
|
16678
17079
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
16679
|
-
sessionJournalDoctorSummarySchema =
|
|
17080
|
+
sessionJournalDoctorSummarySchema = z19.object({
|
|
16680
17081
|
/** `true` when zero noise patterns were detected. */
|
|
16681
|
-
isClean:
|
|
17082
|
+
isClean: z19.boolean(),
|
|
16682
17083
|
/** Total number of noise findings across all patterns. */
|
|
16683
|
-
findingsCount:
|
|
17084
|
+
findingsCount: z19.number().int().nonnegative(),
|
|
16684
17085
|
/** Pattern names that were detected (empty when isClean). */
|
|
16685
|
-
patterns:
|
|
17086
|
+
patterns: z19.array(z19.string()),
|
|
16686
17087
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
16687
|
-
totalScanned:
|
|
17088
|
+
totalScanned: z19.number().int().nonnegative()
|
|
16688
17089
|
});
|
|
16689
|
-
sessionJournalDebriefSummarySchema =
|
|
17090
|
+
sessionJournalDebriefSummarySchema = z19.object({
|
|
16690
17091
|
/** First 200 characters of the session end note (if provided). */
|
|
16691
|
-
noteExcerpt:
|
|
17092
|
+
noteExcerpt: z19.string().max(200).optional(),
|
|
16692
17093
|
/** Number of tasks completed during the session. */
|
|
16693
|
-
tasksCompletedCount:
|
|
17094
|
+
tasksCompletedCount: z19.number().int().nonnegative(),
|
|
16694
17095
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
16695
|
-
tasksFocused:
|
|
17096
|
+
tasksFocused: z19.array(z19.string()).max(5).optional()
|
|
16696
17097
|
});
|
|
16697
|
-
sessionJournalEntrySchema =
|
|
17098
|
+
sessionJournalEntrySchema = z19.object({
|
|
16698
17099
|
// Identity
|
|
16699
17100
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
16700
|
-
schemaVersion:
|
|
17101
|
+
schemaVersion: z19.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
16701
17102
|
/** ISO 8601 timestamp when the entry was written. */
|
|
16702
|
-
timestamp:
|
|
17103
|
+
timestamp: z19.string(),
|
|
16703
17104
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
16704
|
-
sessionId:
|
|
17105
|
+
sessionId: z19.string(),
|
|
16705
17106
|
/** Event type that triggered this journal entry. */
|
|
16706
|
-
eventType:
|
|
17107
|
+
eventType: z19.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
16707
17108
|
// Session metadata (set on session_start / session_end)
|
|
16708
17109
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
16709
|
-
agentIdentifier:
|
|
17110
|
+
agentIdentifier: z19.string().optional(),
|
|
16710
17111
|
/** Provider adapter ID active for this session. */
|
|
16711
|
-
providerId:
|
|
17112
|
+
providerId: z19.string().optional(),
|
|
16712
17113
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
16713
|
-
scope:
|
|
17114
|
+
scope: z19.string().optional(),
|
|
16714
17115
|
// Session-end fields
|
|
16715
17116
|
/** Duration of the session in seconds (session_end only). */
|
|
16716
|
-
duration:
|
|
17117
|
+
duration: z19.number().int().nonnegative().optional(),
|
|
16717
17118
|
/** Task IDs (not titles) completed during the session. */
|
|
16718
|
-
tasksCompleted:
|
|
17119
|
+
tasksCompleted: z19.array(z19.string()).optional(),
|
|
16719
17120
|
// Doctor summary (T1262 absorbed)
|
|
16720
|
-
/**
|
|
17121
|
+
/**
|
|
17122
|
+
* Compact result of `scanBrainNoise` run at session-end.
|
|
17123
|
+
*
|
|
17124
|
+
* @deprecated T14120: no longer written. Session end stopped running the
|
|
17125
|
+
* brain scan (it held `cleo session end` for ~120 s on a large store); kept
|
|
17126
|
+
* so older journal entries still parse. Use `cleo memory doctor`.
|
|
17127
|
+
*/
|
|
16721
17128
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
16722
17129
|
// Debrief summary
|
|
16723
17130
|
/** Compact excerpt from session debrief data. */
|
|
16724
17131
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
16725
17132
|
// Optional hash chain
|
|
16726
17133
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
16727
|
-
prevEntryHash:
|
|
17134
|
+
prevEntryHash: z19.string().optional()
|
|
16728
17135
|
});
|
|
16729
17136
|
}
|
|
16730
17137
|
});
|
|
@@ -16737,52 +17144,52 @@ var init_task = __esm({
|
|
|
16737
17144
|
});
|
|
16738
17145
|
|
|
16739
17146
|
// packages/contracts/src/task-evidence.ts
|
|
16740
|
-
import { z as
|
|
17147
|
+
import { z as z20 } from "zod";
|
|
16741
17148
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
16742
17149
|
var init_task_evidence = __esm({
|
|
16743
17150
|
"packages/contracts/src/task-evidence.ts"() {
|
|
16744
17151
|
"use strict";
|
|
16745
|
-
fileEvidenceSchema =
|
|
16746
|
-
kind:
|
|
16747
|
-
sha256:
|
|
16748
|
-
timestamp:
|
|
16749
|
-
path:
|
|
16750
|
-
mime:
|
|
16751
|
-
description:
|
|
16752
|
-
});
|
|
16753
|
-
logEvidenceSchema =
|
|
16754
|
-
kind:
|
|
16755
|
-
sha256:
|
|
16756
|
-
timestamp:
|
|
16757
|
-
source:
|
|
16758
|
-
description:
|
|
16759
|
-
});
|
|
16760
|
-
screenshotEvidenceSchema =
|
|
16761
|
-
kind:
|
|
16762
|
-
sha256:
|
|
16763
|
-
timestamp:
|
|
16764
|
-
mime:
|
|
16765
|
-
description:
|
|
16766
|
-
});
|
|
16767
|
-
testOutputEvidenceSchema =
|
|
16768
|
-
kind:
|
|
16769
|
-
sha256:
|
|
16770
|
-
timestamp:
|
|
16771
|
-
passed:
|
|
16772
|
-
failed:
|
|
16773
|
-
skipped:
|
|
16774
|
-
exitCode:
|
|
16775
|
-
description:
|
|
16776
|
-
});
|
|
16777
|
-
commandOutputEvidenceSchema =
|
|
16778
|
-
kind:
|
|
16779
|
-
sha256:
|
|
16780
|
-
timestamp:
|
|
16781
|
-
cmd:
|
|
16782
|
-
exitCode:
|
|
16783
|
-
description:
|
|
16784
|
-
});
|
|
16785
|
-
taskEvidenceSchema =
|
|
17152
|
+
fileEvidenceSchema = z20.object({
|
|
17153
|
+
kind: z20.literal("file"),
|
|
17154
|
+
sha256: z20.string().length(64),
|
|
17155
|
+
timestamp: z20.string().datetime(),
|
|
17156
|
+
path: z20.string().min(1),
|
|
17157
|
+
mime: z20.string().optional(),
|
|
17158
|
+
description: z20.string().optional()
|
|
17159
|
+
});
|
|
17160
|
+
logEvidenceSchema = z20.object({
|
|
17161
|
+
kind: z20.literal("log"),
|
|
17162
|
+
sha256: z20.string().length(64),
|
|
17163
|
+
timestamp: z20.string().datetime(),
|
|
17164
|
+
source: z20.string().min(1),
|
|
17165
|
+
description: z20.string().optional()
|
|
17166
|
+
});
|
|
17167
|
+
screenshotEvidenceSchema = z20.object({
|
|
17168
|
+
kind: z20.literal("screenshot"),
|
|
17169
|
+
sha256: z20.string().length(64),
|
|
17170
|
+
timestamp: z20.string().datetime(),
|
|
17171
|
+
mime: z20.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
17172
|
+
description: z20.string().optional()
|
|
17173
|
+
});
|
|
17174
|
+
testOutputEvidenceSchema = z20.object({
|
|
17175
|
+
kind: z20.literal("test-output"),
|
|
17176
|
+
sha256: z20.string().length(64),
|
|
17177
|
+
timestamp: z20.string().datetime(),
|
|
17178
|
+
passed: z20.number().int().nonnegative(),
|
|
17179
|
+
failed: z20.number().int().nonnegative(),
|
|
17180
|
+
skipped: z20.number().int().nonnegative(),
|
|
17181
|
+
exitCode: z20.number().int(),
|
|
17182
|
+
description: z20.string().optional()
|
|
17183
|
+
});
|
|
17184
|
+
commandOutputEvidenceSchema = z20.object({
|
|
17185
|
+
kind: z20.literal("command-output"),
|
|
17186
|
+
sha256: z20.string().length(64),
|
|
17187
|
+
timestamp: z20.string().datetime(),
|
|
17188
|
+
cmd: z20.string().min(1),
|
|
17189
|
+
exitCode: z20.number().int(),
|
|
17190
|
+
description: z20.string().optional()
|
|
17191
|
+
});
|
|
17192
|
+
taskEvidenceSchema = z20.discriminatedUnion("kind", [
|
|
16786
17193
|
fileEvidenceSchema,
|
|
16787
17194
|
logEvidenceSchema,
|
|
16788
17195
|
screenshotEvidenceSchema,
|
|
@@ -16793,12 +17200,12 @@ var init_task_evidence = __esm({
|
|
|
16793
17200
|
});
|
|
16794
17201
|
|
|
16795
17202
|
// packages/contracts/src/tasks/archive.ts
|
|
16796
|
-
import { z as
|
|
17203
|
+
import { z as z21 } from "zod";
|
|
16797
17204
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
16798
17205
|
var init_archive = __esm({
|
|
16799
17206
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
16800
17207
|
"use strict";
|
|
16801
|
-
ArchiveReason =
|
|
17208
|
+
ArchiveReason = z21.enum([
|
|
16802
17209
|
"verified",
|
|
16803
17210
|
"reconciled",
|
|
16804
17211
|
"superseded",
|
|
@@ -16811,47 +17218,47 @@ var init_archive = __esm({
|
|
|
16811
17218
|
});
|
|
16812
17219
|
|
|
16813
17220
|
// packages/contracts/src/tasks.ts
|
|
16814
|
-
import { z as
|
|
17221
|
+
import { z as z22 } from "zod";
|
|
16815
17222
|
var taskMutationWarningSeveritySchema, taskMutationWarningSchema, taskMutationDryRunSummarySchema, taskMutationTaskRecordSchema, taskMutationEnvelopeSchema, completionTaskStatusSchema, completionCriterionKindSchema, completionCriterionStatusSchema, completionBlockerReasonSchema, completionStaleReasonSchema, completionProjectionRepairErrorCodeSchema, completionCriterionWaiverSchema, completionCriterionReplacementSchema, completionCriterionEvaluationSchema, unsatisfiedCompletionCriterionSchema, completionTotalsSchema, completionContextPackSchema, completionEvaluationSchema, completionExplanationSchema, completionListParamsSchema, completionListResultSchema, completionEvaluateParamsSchema, completionProjectionRepairErrorSchema, completionProjectionRepairParamsSchema, completionProjectionRepairResultSchema;
|
|
16816
17223
|
var init_tasks2 = __esm({
|
|
16817
17224
|
"packages/contracts/src/tasks.ts"() {
|
|
16818
17225
|
"use strict";
|
|
16819
17226
|
init_status_registry();
|
|
16820
|
-
taskMutationWarningSeveritySchema =
|
|
16821
|
-
taskMutationWarningSchema =
|
|
16822
|
-
code:
|
|
16823
|
-
message:
|
|
17227
|
+
taskMutationWarningSeveritySchema = z22.enum(["info", "warning"]);
|
|
17228
|
+
taskMutationWarningSchema = z22.object({
|
|
17229
|
+
code: z22.string().min(1),
|
|
17230
|
+
message: z22.string().min(1),
|
|
16824
17231
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
16825
|
-
taskId:
|
|
16826
|
-
field:
|
|
16827
|
-
index:
|
|
16828
|
-
});
|
|
16829
|
-
taskMutationDryRunSummarySchema =
|
|
16830
|
-
dryRun:
|
|
16831
|
-
wouldCreate:
|
|
16832
|
-
wouldUpdate:
|
|
16833
|
-
wouldDelete:
|
|
16834
|
-
wouldAffect:
|
|
16835
|
-
validatedCount:
|
|
16836
|
-
insertedCount:
|
|
16837
|
-
updatedCount:
|
|
16838
|
-
deletedCount:
|
|
16839
|
-
warnings:
|
|
16840
|
-
});
|
|
16841
|
-
taskMutationTaskRecordSchema =
|
|
16842
|
-
taskMutationEnvelopeSchema =
|
|
16843
|
-
dryRun:
|
|
16844
|
-
created:
|
|
16845
|
-
updated:
|
|
16846
|
-
deleted:
|
|
16847
|
-
affectedCount:
|
|
16848
|
-
mutationWarnings:
|
|
17232
|
+
taskId: z22.string().min(1).optional(),
|
|
17233
|
+
field: z22.string().min(1).optional(),
|
|
17234
|
+
index: z22.number().int().nonnegative().optional()
|
|
17235
|
+
});
|
|
17236
|
+
taskMutationDryRunSummarySchema = z22.object({
|
|
17237
|
+
dryRun: z22.literal(true),
|
|
17238
|
+
wouldCreate: z22.number().int().nonnegative(),
|
|
17239
|
+
wouldUpdate: z22.number().int().nonnegative(),
|
|
17240
|
+
wouldDelete: z22.number().int().nonnegative(),
|
|
17241
|
+
wouldAffect: z22.number().int().nonnegative(),
|
|
17242
|
+
validatedCount: z22.number().int().nonnegative(),
|
|
17243
|
+
insertedCount: z22.literal(0),
|
|
17244
|
+
updatedCount: z22.literal(0),
|
|
17245
|
+
deletedCount: z22.literal(0),
|
|
17246
|
+
warnings: z22.array(taskMutationWarningSchema)
|
|
17247
|
+
});
|
|
17248
|
+
taskMutationTaskRecordSchema = z22.object({ id: z22.string().min(1) }).passthrough();
|
|
17249
|
+
taskMutationEnvelopeSchema = z22.object({
|
|
17250
|
+
dryRun: z22.boolean().optional(),
|
|
17251
|
+
created: z22.array(taskMutationTaskRecordSchema),
|
|
17252
|
+
updated: z22.array(taskMutationTaskRecordSchema),
|
|
17253
|
+
deleted: z22.array(taskMutationTaskRecordSchema),
|
|
17254
|
+
affectedCount: z22.number().int().nonnegative(),
|
|
17255
|
+
mutationWarnings: z22.array(taskMutationWarningSchema),
|
|
16849
17256
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
16850
17257
|
});
|
|
16851
|
-
completionTaskStatusSchema =
|
|
16852
|
-
completionCriterionKindSchema =
|
|
16853
|
-
completionCriterionStatusSchema =
|
|
16854
|
-
completionBlockerReasonSchema =
|
|
17258
|
+
completionTaskStatusSchema = z22.enum(TASK_STATUSES);
|
|
17259
|
+
completionCriterionKindSchema = z22.enum(["text", "evidence_bound", "child_task"]);
|
|
17260
|
+
completionCriterionStatusSchema = z22.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
17261
|
+
completionBlockerReasonSchema = z22.enum([
|
|
16855
17262
|
"missing_evidence_binding",
|
|
16856
17263
|
"child_not_done",
|
|
16857
17264
|
"child_cancelled_requires_waiver",
|
|
@@ -16859,68 +17266,68 @@ var init_tasks2 = __esm({
|
|
|
16859
17266
|
"child_missing",
|
|
16860
17267
|
"done_parent_stale"
|
|
16861
17268
|
]);
|
|
16862
|
-
completionStaleReasonSchema =
|
|
16863
|
-
completionProjectionRepairErrorCodeSchema =
|
|
17269
|
+
completionStaleReasonSchema = z22.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
17270
|
+
completionProjectionRepairErrorCodeSchema = z22.enum([
|
|
16864
17271
|
"projection_not_stale",
|
|
16865
17272
|
"criteria_missing",
|
|
16866
17273
|
"binding_target_missing",
|
|
16867
17274
|
"repair_conflict"
|
|
16868
17275
|
]);
|
|
16869
|
-
completionCriterionWaiverSchema =
|
|
16870
|
-
criterionAcId:
|
|
16871
|
-
childTaskId:
|
|
16872
|
-
reason:
|
|
16873
|
-
actor:
|
|
16874
|
-
waivedAt:
|
|
16875
|
-
});
|
|
16876
|
-
completionCriterionReplacementSchema =
|
|
16877
|
-
criterionAcId:
|
|
16878
|
-
originalChildTaskId:
|
|
16879
|
-
replacementChildTaskId:
|
|
16880
|
-
reason:
|
|
16881
|
-
actor:
|
|
16882
|
-
replacedAt:
|
|
16883
|
-
});
|
|
16884
|
-
completionCriterionEvaluationSchema =
|
|
16885
|
-
acId:
|
|
16886
|
-
alias:
|
|
16887
|
-
text:
|
|
17276
|
+
completionCriterionWaiverSchema = z22.object({
|
|
17277
|
+
criterionAcId: z22.string().min(1),
|
|
17278
|
+
childTaskId: z22.string().min(1),
|
|
17279
|
+
reason: z22.string().min(1),
|
|
17280
|
+
actor: z22.string().min(1),
|
|
17281
|
+
waivedAt: z22.string().min(1)
|
|
17282
|
+
});
|
|
17283
|
+
completionCriterionReplacementSchema = z22.object({
|
|
17284
|
+
criterionAcId: z22.string().min(1),
|
|
17285
|
+
originalChildTaskId: z22.string().min(1),
|
|
17286
|
+
replacementChildTaskId: z22.string().min(1),
|
|
17287
|
+
reason: z22.string().min(1),
|
|
17288
|
+
actor: z22.string().min(1),
|
|
17289
|
+
replacedAt: z22.string().min(1)
|
|
17290
|
+
});
|
|
17291
|
+
completionCriterionEvaluationSchema = z22.object({
|
|
17292
|
+
acId: z22.string().min(1),
|
|
17293
|
+
alias: z22.string().min(1),
|
|
17294
|
+
text: z22.string(),
|
|
16888
17295
|
kind: completionCriterionKindSchema,
|
|
16889
17296
|
status: completionCriterionStatusSchema,
|
|
16890
17297
|
reason: completionBlockerReasonSchema.optional(),
|
|
16891
|
-
targetTaskId:
|
|
17298
|
+
targetTaskId: z22.string().min(1).optional(),
|
|
16892
17299
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
16893
17300
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
16894
17301
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
16895
17302
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
16896
|
-
evidenceBindings:
|
|
17303
|
+
evidenceBindings: z22.number().int().nonnegative()
|
|
16897
17304
|
});
|
|
16898
17305
|
unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
16899
|
-
status:
|
|
17306
|
+
status: z22.literal("unsatisfied"),
|
|
16900
17307
|
reason: completionBlockerReasonSchema
|
|
16901
17308
|
});
|
|
16902
|
-
completionTotalsSchema =
|
|
16903
|
-
criteria:
|
|
16904
|
-
satisfied:
|
|
16905
|
-
unsatisfied:
|
|
16906
|
-
waived:
|
|
16907
|
-
replaced:
|
|
16908
|
-
});
|
|
16909
|
-
completionContextPackSchema =
|
|
16910
|
-
taskId:
|
|
16911
|
-
generatedAt:
|
|
16912
|
-
source:
|
|
16913
|
-
window:
|
|
16914
|
-
limit:
|
|
16915
|
-
since:
|
|
16916
|
-
relationDepth:
|
|
16917
|
-
relatedTaskIds:
|
|
17309
|
+
completionTotalsSchema = z22.object({
|
|
17310
|
+
criteria: z22.number().int().nonnegative(),
|
|
17311
|
+
satisfied: z22.number().int().nonnegative(),
|
|
17312
|
+
unsatisfied: z22.number().int().nonnegative(),
|
|
17313
|
+
waived: z22.number().int().nonnegative(),
|
|
17314
|
+
replaced: z22.number().int().nonnegative()
|
|
17315
|
+
});
|
|
17316
|
+
completionContextPackSchema = z22.object({
|
|
17317
|
+
taskId: z22.string().min(1),
|
|
17318
|
+
generatedAt: z22.string().min(1),
|
|
17319
|
+
source: z22.literal("audit_log"),
|
|
17320
|
+
window: z22.object({
|
|
17321
|
+
limit: z22.number().int().positive(),
|
|
17322
|
+
since: z22.string().min(1).optional(),
|
|
17323
|
+
relationDepth: z22.number().int().nonnegative(),
|
|
17324
|
+
relatedTaskIds: z22.array(z22.string().min(1))
|
|
16918
17325
|
}),
|
|
16919
|
-
events:
|
|
16920
|
-
|
|
16921
|
-
id:
|
|
16922
|
-
timestamp:
|
|
16923
|
-
action:
|
|
17326
|
+
events: z22.array(
|
|
17327
|
+
z22.object({
|
|
17328
|
+
id: z22.string().min(1),
|
|
17329
|
+
timestamp: z22.string().min(1),
|
|
17330
|
+
action: z22.enum([
|
|
16924
17331
|
"task_completed",
|
|
16925
17332
|
"task_reopened",
|
|
16926
17333
|
"task_cancelled",
|
|
@@ -16928,77 +17335,77 @@ var init_tasks2 = __esm({
|
|
|
16928
17335
|
"task_reparented",
|
|
16929
17336
|
"ac_projection_rebuilt"
|
|
16930
17337
|
]),
|
|
16931
|
-
taskId:
|
|
16932
|
-
relation:
|
|
16933
|
-
actor:
|
|
16934
|
-
details:
|
|
16935
|
-
before:
|
|
16936
|
-
after:
|
|
17338
|
+
taskId: z22.string().min(1),
|
|
17339
|
+
relation: z22.enum(["self", "parent", "child", "sibling", "related"]),
|
|
17340
|
+
actor: z22.string().min(1),
|
|
17341
|
+
details: z22.record(z22.string(), z22.unknown()).optional(),
|
|
17342
|
+
before: z22.record(z22.string(), z22.unknown()).optional(),
|
|
17343
|
+
after: z22.record(z22.string(), z22.unknown()).optional()
|
|
16937
17344
|
})
|
|
16938
17345
|
),
|
|
16939
|
-
summary:
|
|
16940
|
-
totalEvents:
|
|
16941
|
-
byAction:
|
|
16942
|
-
byRelation:
|
|
16943
|
-
latestEventAt:
|
|
17346
|
+
summary: z22.object({
|
|
17347
|
+
totalEvents: z22.number().int().nonnegative(),
|
|
17348
|
+
byAction: z22.record(z22.string(), z22.number().int().nonnegative()),
|
|
17349
|
+
byRelation: z22.record(z22.string(), z22.number().int().nonnegative()),
|
|
17350
|
+
latestEventAt: z22.string().nullable()
|
|
16944
17351
|
})
|
|
16945
17352
|
});
|
|
16946
|
-
completionEvaluationSchema =
|
|
16947
|
-
taskId:
|
|
17353
|
+
completionEvaluationSchema = z22.object({
|
|
17354
|
+
taskId: z22.string().min(1),
|
|
16948
17355
|
taskStatus: completionTaskStatusSchema,
|
|
16949
|
-
ready:
|
|
16950
|
-
stale:
|
|
16951
|
-
staleReasons:
|
|
17356
|
+
ready: z22.boolean(),
|
|
17357
|
+
stale: z22.boolean(),
|
|
17358
|
+
staleReasons: z22.array(completionStaleReasonSchema),
|
|
16952
17359
|
contextPack: completionContextPackSchema.optional(),
|
|
16953
|
-
satisfied:
|
|
16954
|
-
unsatisfied:
|
|
16955
|
-
waived:
|
|
16956
|
-
replaced:
|
|
17360
|
+
satisfied: z22.array(completionCriterionEvaluationSchema),
|
|
17361
|
+
unsatisfied: z22.array(unsatisfiedCompletionCriterionSchema),
|
|
17362
|
+
waived: z22.array(completionCriterionEvaluationSchema),
|
|
17363
|
+
replaced: z22.array(completionCriterionEvaluationSchema),
|
|
16957
17364
|
totals: completionTotalsSchema
|
|
16958
17365
|
});
|
|
16959
|
-
completionExplanationSchema =
|
|
16960
|
-
taskId:
|
|
16961
|
-
ready:
|
|
16962
|
-
stale:
|
|
16963
|
-
summary:
|
|
17366
|
+
completionExplanationSchema = z22.object({
|
|
17367
|
+
taskId: z22.string().min(1),
|
|
17368
|
+
ready: z22.boolean(),
|
|
17369
|
+
stale: z22.boolean(),
|
|
17370
|
+
summary: z22.string(),
|
|
16964
17371
|
contextPack: completionContextPackSchema.optional(),
|
|
16965
|
-
blockers:
|
|
17372
|
+
blockers: z22.array(completionCriterionEvaluationSchema)
|
|
16966
17373
|
});
|
|
16967
|
-
completionListParamsSchema =
|
|
16968
|
-
taskId:
|
|
17374
|
+
completionListParamsSchema = z22.object({
|
|
17375
|
+
taskId: z22.string().min(1),
|
|
16969
17376
|
status: completionCriterionStatusSchema.optional(),
|
|
16970
17377
|
kind: completionCriterionKindSchema.optional()
|
|
16971
17378
|
});
|
|
16972
|
-
completionListResultSchema =
|
|
16973
|
-
taskId:
|
|
16974
|
-
criteria:
|
|
17379
|
+
completionListResultSchema = z22.object({
|
|
17380
|
+
taskId: z22.string().min(1),
|
|
17381
|
+
criteria: z22.array(completionCriterionEvaluationSchema),
|
|
16975
17382
|
totals: completionTotalsSchema
|
|
16976
17383
|
});
|
|
16977
|
-
completionEvaluateParamsSchema =
|
|
16978
|
-
taskId:
|
|
16979
|
-
includeContext:
|
|
16980
|
-
limit:
|
|
16981
|
-
since:
|
|
16982
|
-
relationDepth:
|
|
17384
|
+
completionEvaluateParamsSchema = z22.object({
|
|
17385
|
+
taskId: z22.string().min(1),
|
|
17386
|
+
includeContext: z22.boolean().optional(),
|
|
17387
|
+
limit: z22.number().int().positive().optional(),
|
|
17388
|
+
since: z22.string().min(1).optional(),
|
|
17389
|
+
relationDepth: z22.number().int().nonnegative().optional()
|
|
16983
17390
|
});
|
|
16984
|
-
completionProjectionRepairErrorSchema =
|
|
17391
|
+
completionProjectionRepairErrorSchema = z22.object({
|
|
16985
17392
|
code: completionProjectionRepairErrorCodeSchema,
|
|
16986
|
-
message:
|
|
16987
|
-
taskId:
|
|
16988
|
-
acId:
|
|
16989
|
-
evidenceAtomId:
|
|
17393
|
+
message: z22.string().min(1),
|
|
17394
|
+
taskId: z22.string().min(1),
|
|
17395
|
+
acId: z22.string().min(1).optional(),
|
|
17396
|
+
evidenceAtomId: z22.string().min(1).optional()
|
|
16990
17397
|
});
|
|
16991
|
-
completionProjectionRepairParamsSchema =
|
|
16992
|
-
taskId:
|
|
16993
|
-
dryRun:
|
|
17398
|
+
completionProjectionRepairParamsSchema = z22.object({
|
|
17399
|
+
taskId: z22.string().min(1),
|
|
17400
|
+
dryRun: z22.boolean().optional()
|
|
16994
17401
|
});
|
|
16995
|
-
completionProjectionRepairResultSchema =
|
|
16996
|
-
taskId:
|
|
16997
|
-
repaired:
|
|
16998
|
-
dryRun:
|
|
16999
|
-
staleBefore:
|
|
17000
|
-
staleAfter:
|
|
17001
|
-
errors:
|
|
17402
|
+
completionProjectionRepairResultSchema = z22.object({
|
|
17403
|
+
taskId: z22.string().min(1),
|
|
17404
|
+
repaired: z22.boolean(),
|
|
17405
|
+
dryRun: z22.boolean(),
|
|
17406
|
+
staleBefore: z22.boolean(),
|
|
17407
|
+
staleAfter: z22.boolean(),
|
|
17408
|
+
errors: z22.array(completionProjectionRepairErrorSchema)
|
|
17002
17409
|
});
|
|
17003
17410
|
}
|
|
17004
17411
|
});
|
|
@@ -17509,7 +17916,7 @@ var init_taxonomy = __esm({
|
|
|
17509
17916
|
});
|
|
17510
17917
|
|
|
17511
17918
|
// packages/contracts/src/templates/manifest.ts
|
|
17512
|
-
import { z as
|
|
17919
|
+
import { z as z23 } from "zod";
|
|
17513
17920
|
var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
|
|
17514
17921
|
var init_manifest2 = __esm({
|
|
17515
17922
|
"packages/contracts/src/templates/manifest.ts"() {
|
|
@@ -17530,85 +17937,85 @@ var init_manifest2 = __esm({
|
|
|
17530
17937
|
"tool-resolver",
|
|
17531
17938
|
"literal"
|
|
17532
17939
|
];
|
|
17533
|
-
PlaceholderSpecSchema =
|
|
17940
|
+
PlaceholderSpecSchema = z23.object({
|
|
17534
17941
|
/**
|
|
17535
17942
|
* Placeholder identifier as it appears in the template body
|
|
17536
17943
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
17537
17944
|
*/
|
|
17538
|
-
name:
|
|
17945
|
+
name: z23.string().min(1, "placeholder name must be non-empty"),
|
|
17539
17946
|
/** Resolver source the installer consults for this placeholder. */
|
|
17540
|
-
source:
|
|
17947
|
+
source: z23.enum(PLACEHOLDER_SOURCES),
|
|
17541
17948
|
/**
|
|
17542
17949
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
17543
17950
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
17544
17951
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
17545
17952
|
*/
|
|
17546
|
-
sourcePath:
|
|
17953
|
+
sourcePath: z23.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
17547
17954
|
/**
|
|
17548
17955
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
17549
17956
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
17550
17957
|
*/
|
|
17551
|
-
defaultValue:
|
|
17958
|
+
defaultValue: z23.union([z23.string(), z23.number(), z23.boolean(), z23.null()]).optional()
|
|
17552
17959
|
});
|
|
17553
|
-
TemplateManifestEntrySchema =
|
|
17960
|
+
TemplateManifestEntrySchema = z23.object({
|
|
17554
17961
|
/** Stable identifier for this template entry. */
|
|
17555
|
-
id:
|
|
17962
|
+
id: z23.string().min(1, "id must be non-empty"),
|
|
17556
17963
|
/** Category of file this template represents. */
|
|
17557
|
-
kind:
|
|
17964
|
+
kind: z23.enum(TEMPLATE_KINDS),
|
|
17558
17965
|
/** Repo-relative path of the template source file. */
|
|
17559
|
-
sourcePath:
|
|
17966
|
+
sourcePath: z23.string().min(1, "sourcePath must be non-empty"),
|
|
17560
17967
|
/** Project-relative path where the rendered template installs. */
|
|
17561
|
-
installPath:
|
|
17968
|
+
installPath: z23.string().min(1, "installPath must be non-empty"),
|
|
17562
17969
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
17563
|
-
substitution:
|
|
17970
|
+
substitution: z23.enum(TEMPLATE_SUBSTITUTIONS),
|
|
17564
17971
|
/** Declared placeholders this template requires. May be empty. */
|
|
17565
|
-
placeholders:
|
|
17972
|
+
placeholders: z23.array(PlaceholderSpecSchema),
|
|
17566
17973
|
/** Reconciliation policy on upgrade. */
|
|
17567
|
-
updateStrategy:
|
|
17974
|
+
updateStrategy: z23.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
17568
17975
|
});
|
|
17569
17976
|
}
|
|
17570
17977
|
});
|
|
17571
17978
|
|
|
17572
17979
|
// packages/contracts/src/validator/index.ts
|
|
17573
|
-
import { z as
|
|
17980
|
+
import { z as z24 } from "zod";
|
|
17574
17981
|
var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
|
|
17575
17982
|
var init_validator = __esm({
|
|
17576
17983
|
"packages/contracts/src/validator/index.ts"() {
|
|
17577
17984
|
"use strict";
|
|
17578
17985
|
VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
17579
|
-
validatorFindingSchema =
|
|
17580
|
-
acId:
|
|
17581
|
-
status:
|
|
17582
|
-
reasoning:
|
|
17583
|
-
evidenceRefs:
|
|
17584
|
-
checkedAt:
|
|
17585
|
-
});
|
|
17586
|
-
validatorAttestationSchema =
|
|
17587
|
-
verdict:
|
|
17588
|
-
taskId:
|
|
17589
|
-
validatorId:
|
|
17590
|
-
findings:
|
|
17986
|
+
validatorFindingSchema = z24.object({
|
|
17987
|
+
acId: z24.string().min(1, "acId must be non-empty"),
|
|
17988
|
+
status: z24.enum(["pass", "fail", "inconclusive"]),
|
|
17989
|
+
reasoning: z24.string().min(1, "reasoning must be non-empty"),
|
|
17990
|
+
evidenceRefs: z24.array(z24.string()).optional(),
|
|
17991
|
+
checkedAt: z24.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
17992
|
+
});
|
|
17993
|
+
validatorAttestationSchema = z24.object({
|
|
17994
|
+
verdict: z24.literal("attest"),
|
|
17995
|
+
taskId: z24.string().min(1),
|
|
17996
|
+
validatorId: z24.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17997
|
+
findings: z24.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
17591
17998
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
17592
17999
|
'attestation requires every finding to have status="pass"'
|
|
17593
18000
|
),
|
|
17594
|
-
summary:
|
|
17595
|
-
attestedAt:
|
|
17596
|
-
schemaVersion:
|
|
17597
|
-
});
|
|
17598
|
-
validatorRejectionSchema =
|
|
17599
|
-
verdict:
|
|
17600
|
-
taskId:
|
|
17601
|
-
validatorId:
|
|
17602
|
-
findings:
|
|
18001
|
+
summary: z24.string().optional(),
|
|
18002
|
+
attestedAt: z24.string().min(1),
|
|
18003
|
+
schemaVersion: z24.literal("1")
|
|
18004
|
+
});
|
|
18005
|
+
validatorRejectionSchema = z24.object({
|
|
18006
|
+
verdict: z24.literal("reject"),
|
|
18007
|
+
taskId: z24.string().min(1),
|
|
18008
|
+
validatorId: z24.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
18009
|
+
findings: z24.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
17603
18010
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
17604
18011
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
17605
18012
|
),
|
|
17606
|
-
summary:
|
|
17607
|
-
remediationHints:
|
|
17608
|
-
rejectedAt:
|
|
17609
|
-
schemaVersion:
|
|
18013
|
+
summary: z24.string().min(1, "rejection summary must be non-empty"),
|
|
18014
|
+
remediationHints: z24.array(z24.string()).optional(),
|
|
18015
|
+
rejectedAt: z24.string().min(1),
|
|
18016
|
+
schemaVersion: z24.literal("1")
|
|
17610
18017
|
});
|
|
17611
|
-
validatorVerdictSchema =
|
|
18018
|
+
validatorVerdictSchema = z24.discriminatedUnion("verdict", [
|
|
17612
18019
|
validatorAttestationSchema,
|
|
17613
18020
|
validatorRejectionSchema
|
|
17614
18021
|
]);
|
|
@@ -18379,7 +18786,7 @@ var init_collection_keys = __esm({
|
|
|
18379
18786
|
});
|
|
18380
18787
|
|
|
18381
18788
|
// packages/contracts/src/decide.ts
|
|
18382
|
-
import { z as
|
|
18789
|
+
import { z as z25 } from "zod";
|
|
18383
18790
|
var DECISION_QUESTION_TYPES, DECISION_OUTCOME_SOURCES, DECISION_REQUEST_LIMITS, DECISION_PROVIDER_KINDS, decisionQuestionTypeSchema, decisionOutcomeSourceSchema, decisionInstructionsSchema, unitIntervalSchema, decisionStateSchema, noulDecisionQuestionSchema, choiceDecisionQuestionSchema, scoreDecisionQuestionSchema, decisionQuestionSchema, decisionRequestSchema, noulDecisionAnswerSchema, choiceDecisionAnswerSchema, scoreDecisionAnswerSchema, decisionAnswerSchema, decisionOutcomeSchema, decisionProviderKindSchema, decisionProviderConfigSchema;
|
|
18384
18791
|
var init_decide = __esm({
|
|
18385
18792
|
"packages/contracts/src/decide.ts"() {
|
|
@@ -18405,11 +18812,11 @@ var init_decide = __esm({
|
|
|
18405
18812
|
maxScoreLevels: 10
|
|
18406
18813
|
};
|
|
18407
18814
|
DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
18408
|
-
decisionQuestionTypeSchema =
|
|
18409
|
-
decisionOutcomeSourceSchema =
|
|
18410
|
-
decisionInstructionsSchema =
|
|
18411
|
-
unitIntervalSchema =
|
|
18412
|
-
decisionStateSchema =
|
|
18815
|
+
decisionQuestionTypeSchema = z25.enum(DECISION_QUESTION_TYPES);
|
|
18816
|
+
decisionOutcomeSourceSchema = z25.enum(DECISION_OUTCOME_SOURCES);
|
|
18817
|
+
decisionInstructionsSchema = z25.union([z25.string(), z25.record(z25.string(), z25.json())]);
|
|
18818
|
+
unitIntervalSchema = z25.number().min(0).max(1);
|
|
18819
|
+
decisionStateSchema = z25.union([z25.string(), z25.array(z25.json()), z25.record(z25.string(), z25.json())]).superRefine((state, context) => {
|
|
18413
18820
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
18414
18821
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
18415
18822
|
context.addIssue({
|
|
@@ -18418,34 +18825,34 @@ var init_decide = __esm({
|
|
|
18418
18825
|
});
|
|
18419
18826
|
}
|
|
18420
18827
|
});
|
|
18421
|
-
noulDecisionQuestionSchema =
|
|
18422
|
-
type:
|
|
18828
|
+
noulDecisionQuestionSchema = z25.object({
|
|
18829
|
+
type: z25.literal("noul"),
|
|
18423
18830
|
instructions: decisionInstructionsSchema.optional(),
|
|
18424
|
-
criteria:
|
|
18831
|
+
criteria: z25.string().min(1)
|
|
18425
18832
|
});
|
|
18426
|
-
choiceDecisionQuestionSchema =
|
|
18427
|
-
type:
|
|
18833
|
+
choiceDecisionQuestionSchema = z25.object({
|
|
18834
|
+
type: z25.literal("choice"),
|
|
18428
18835
|
instructions: decisionInstructionsSchema.optional(),
|
|
18429
|
-
criteria:
|
|
18836
|
+
criteria: z25.record(z25.string().min(1), z25.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
18430
18837
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
18431
18838
|
})
|
|
18432
18839
|
});
|
|
18433
|
-
scoreDecisionQuestionSchema =
|
|
18434
|
-
type:
|
|
18840
|
+
scoreDecisionQuestionSchema = z25.object({
|
|
18841
|
+
type: z25.literal("score"),
|
|
18435
18842
|
instructions: decisionInstructionsSchema.optional(),
|
|
18436
|
-
criteria:
|
|
18843
|
+
criteria: z25.array(z25.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
18437
18844
|
});
|
|
18438
|
-
decisionQuestionSchema =
|
|
18845
|
+
decisionQuestionSchema = z25.discriminatedUnion("type", [
|
|
18439
18846
|
noulDecisionQuestionSchema,
|
|
18440
18847
|
choiceDecisionQuestionSchema,
|
|
18441
18848
|
scoreDecisionQuestionSchema
|
|
18442
18849
|
]);
|
|
18443
|
-
decisionRequestSchema =
|
|
18444
|
-
model:
|
|
18445
|
-
lang:
|
|
18446
|
-
cache:
|
|
18850
|
+
decisionRequestSchema = z25.object({
|
|
18851
|
+
model: z25.string().min(1).optional(),
|
|
18852
|
+
lang: z25.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
18853
|
+
cache: z25.boolean().optional(),
|
|
18447
18854
|
state: decisionStateSchema,
|
|
18448
|
-
questions:
|
|
18855
|
+
questions: z25.record(z25.string().min(1), decisionQuestionSchema).refine(
|
|
18449
18856
|
(questions) => {
|
|
18450
18857
|
const count = Object.keys(questions).length;
|
|
18451
18858
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -18455,43 +18862,43 @@ var init_decide = __esm({
|
|
|
18455
18862
|
}
|
|
18456
18863
|
)
|
|
18457
18864
|
});
|
|
18458
|
-
noulDecisionAnswerSchema =
|
|
18459
|
-
type:
|
|
18460
|
-
value:
|
|
18865
|
+
noulDecisionAnswerSchema = z25.object({
|
|
18866
|
+
type: z25.literal("noul"),
|
|
18867
|
+
value: z25.boolean(),
|
|
18461
18868
|
probability: unitIntervalSchema,
|
|
18462
18869
|
confidence: unitIntervalSchema
|
|
18463
18870
|
});
|
|
18464
|
-
choiceDecisionAnswerSchema =
|
|
18465
|
-
type:
|
|
18466
|
-
value:
|
|
18467
|
-
probabilities:
|
|
18871
|
+
choiceDecisionAnswerSchema = z25.object({
|
|
18872
|
+
type: z25.literal("choice"),
|
|
18873
|
+
value: z25.string().min(1),
|
|
18874
|
+
probabilities: z25.record(z25.string().min(1), unitIntervalSchema),
|
|
18468
18875
|
confidence: unitIntervalSchema
|
|
18469
18876
|
});
|
|
18470
|
-
scoreDecisionAnswerSchema =
|
|
18471
|
-
type:
|
|
18472
|
-
value:
|
|
18473
|
-
probabilities:
|
|
18877
|
+
scoreDecisionAnswerSchema = z25.object({
|
|
18878
|
+
type: z25.literal("score"),
|
|
18879
|
+
value: z25.number().int().nonnegative(),
|
|
18880
|
+
probabilities: z25.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
18474
18881
|
confidence: unitIntervalSchema
|
|
18475
18882
|
});
|
|
18476
|
-
decisionAnswerSchema =
|
|
18883
|
+
decisionAnswerSchema = z25.discriminatedUnion("type", [
|
|
18477
18884
|
noulDecisionAnswerSchema,
|
|
18478
18885
|
choiceDecisionAnswerSchema,
|
|
18479
18886
|
scoreDecisionAnswerSchema
|
|
18480
18887
|
]);
|
|
18481
|
-
decisionOutcomeSchema =
|
|
18482
|
-
answers:
|
|
18888
|
+
decisionOutcomeSchema = z25.object({
|
|
18889
|
+
answers: z25.record(z25.string().min(1), decisionAnswerSchema),
|
|
18483
18890
|
source: decisionOutcomeSourceSchema,
|
|
18484
|
-
requestId:
|
|
18485
|
-
latencyMs:
|
|
18486
|
-
costUsd:
|
|
18487
|
-
costMicros:
|
|
18488
|
-
balanceMicros:
|
|
18489
|
-
checkpoint:
|
|
18490
|
-
inputTokens:
|
|
18491
|
-
});
|
|
18492
|
-
decisionProviderKindSchema =
|
|
18493
|
-
decisionProviderConfigSchema =
|
|
18494
|
-
baseUrl:
|
|
18891
|
+
requestId: z25.string().min(1).optional(),
|
|
18892
|
+
latencyMs: z25.number().nonnegative(),
|
|
18893
|
+
costUsd: z25.number().nonnegative().optional(),
|
|
18894
|
+
costMicros: z25.number().int().nonnegative().optional(),
|
|
18895
|
+
balanceMicros: z25.number().int().optional(),
|
|
18896
|
+
checkpoint: z25.string().min(1).optional(),
|
|
18897
|
+
inputTokens: z25.number().int().nonnegative().optional()
|
|
18898
|
+
});
|
|
18899
|
+
decisionProviderKindSchema = z25.enum(DECISION_PROVIDER_KINDS);
|
|
18900
|
+
decisionProviderConfigSchema = z25.object({
|
|
18901
|
+
baseUrl: z25.url(),
|
|
18495
18902
|
provider: decisionProviderKindSchema.optional()
|
|
18496
18903
|
});
|
|
18497
18904
|
}
|
|
@@ -18505,33 +18912,33 @@ var init_decide_sites = __esm({
|
|
|
18505
18912
|
});
|
|
18506
18913
|
|
|
18507
18914
|
// packages/contracts/src/nexus-account.ts
|
|
18508
|
-
import { z as
|
|
18915
|
+
import { z as z26 } from "zod";
|
|
18509
18916
|
var nexusAccountUserSchema, nexusAccountOrganizationSchema, nexusAccountMeSchema;
|
|
18510
18917
|
var init_nexus_account = __esm({
|
|
18511
18918
|
"packages/contracts/src/nexus-account.ts"() {
|
|
18512
18919
|
"use strict";
|
|
18513
|
-
nexusAccountUserSchema =
|
|
18514
|
-
id:
|
|
18515
|
-
email:
|
|
18516
|
-
name:
|
|
18517
|
-
});
|
|
18518
|
-
nexusAccountOrganizationSchema =
|
|
18519
|
-
id:
|
|
18520
|
-
name:
|
|
18521
|
-
slug:
|
|
18522
|
-
role:
|
|
18920
|
+
nexusAccountUserSchema = z26.object({
|
|
18921
|
+
id: z26.string(),
|
|
18922
|
+
email: z26.string(),
|
|
18923
|
+
name: z26.string().nullable().optional()
|
|
18924
|
+
});
|
|
18925
|
+
nexusAccountOrganizationSchema = z26.object({
|
|
18926
|
+
id: z26.string(),
|
|
18927
|
+
name: z26.string(),
|
|
18928
|
+
slug: z26.string().nullable().optional(),
|
|
18929
|
+
role: z26.string().optional(),
|
|
18523
18930
|
/** `true` for the personal organization created at sign-up. */
|
|
18524
|
-
personal:
|
|
18931
|
+
personal: z26.boolean().optional()
|
|
18525
18932
|
});
|
|
18526
|
-
nexusAccountMeSchema =
|
|
18933
|
+
nexusAccountMeSchema = z26.object({
|
|
18527
18934
|
user: nexusAccountUserSchema,
|
|
18528
|
-
organizations:
|
|
18935
|
+
organizations: z26.array(nexusAccountOrganizationSchema).default([])
|
|
18529
18936
|
});
|
|
18530
18937
|
}
|
|
18531
18938
|
});
|
|
18532
18939
|
|
|
18533
18940
|
// packages/contracts/src/nexus-cloud.ts
|
|
18534
|
-
import { z as
|
|
18941
|
+
import { z as z27 } from "zod";
|
|
18535
18942
|
var NEXUS_DEVICE_STATES, NEXUS_CLOUD_PROFILES, NEXUS_DEVICE_STATE_UNKNOWN, isoTime, profile, deviceState, nexusCloudCredentialSchema, nexusCloudDeviceSchema, nexusCloudOrganizationSchema, nexusCloudUserSchema, nexusCloudWhoamiSchema, nexusCloudDevicePageSchema, nexusCloudPresenceSchema, nexusCloudReplicaSchema, nexusCloudDeviceCountsSchema, projectFields, nexusCloudProjectListItemSchema, nexusCloudProjectPageSchema, nexusCloudProjectDetailSchema, nexusCloudReplicaPageSchema, NEXUS_STATUS_CHECK_IDS, NEXUS_STATUS_VERDICTS, CLOUD_STATUS_VERDICTS, knownCheckId, nexusCloudStatusCheckSchema, nexusCloudStatusSchema, LOGIN, SESSION_EXPIRED_LOGIN, SERVER_REFUSED, NEXUS_FORBIDDEN_ERRORS;
|
|
18536
18943
|
var init_nexus_cloud = __esm({
|
|
18537
18944
|
"packages/contracts/src/nexus-cloud.ts"() {
|
|
@@ -18539,74 +18946,74 @@ var init_nexus_cloud = __esm({
|
|
|
18539
18946
|
NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
18540
18947
|
NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
18541
18948
|
NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
18542
|
-
isoTime =
|
|
18543
|
-
profile =
|
|
18544
|
-
deviceState =
|
|
18545
|
-
nexusCloudCredentialSchema =
|
|
18546
|
-
kind:
|
|
18547
|
-
credentialId:
|
|
18949
|
+
isoTime = z27.iso.datetime({ offset: true });
|
|
18950
|
+
profile = z27.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
18951
|
+
deviceState = z27.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
18952
|
+
nexusCloudCredentialSchema = z27.object({
|
|
18953
|
+
kind: z27.enum(["device", "session"]),
|
|
18954
|
+
credentialId: z27.string().nullable().optional(),
|
|
18548
18955
|
profile: profile.optional(),
|
|
18549
|
-
scopes:
|
|
18956
|
+
scopes: z27.array(z27.string()).default([]),
|
|
18550
18957
|
createdAt: isoTime.nullable().optional(),
|
|
18551
18958
|
lastUsedAt: isoTime.nullable().optional(),
|
|
18552
18959
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
18553
18960
|
idleExpiresAt: isoTime.nullable().optional()
|
|
18554
18961
|
});
|
|
18555
|
-
nexusCloudDeviceSchema =
|
|
18556
|
-
deviceId:
|
|
18557
|
-
name:
|
|
18558
|
-
platform:
|
|
18559
|
-
arch:
|
|
18560
|
-
cliVersion:
|
|
18962
|
+
nexusCloudDeviceSchema = z27.object({
|
|
18963
|
+
deviceId: z27.string(),
|
|
18964
|
+
name: z27.string(),
|
|
18965
|
+
platform: z27.string().optional(),
|
|
18966
|
+
arch: z27.string().nullable().optional(),
|
|
18967
|
+
cliVersion: z27.string().nullable().optional(),
|
|
18561
18968
|
createdAt: isoTime.optional(),
|
|
18562
18969
|
lastSeenAt: isoTime.nullable().optional(),
|
|
18563
18970
|
state: deviceState,
|
|
18564
18971
|
signedOutAt: isoTime.nullable().optional(),
|
|
18565
18972
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
18566
|
-
certificate:
|
|
18973
|
+
certificate: z27.string().nullable().optional(),
|
|
18567
18974
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
18568
18975
|
profile: profile.optional(),
|
|
18569
18976
|
/** True for the device whose credential made this request. */
|
|
18570
|
-
current:
|
|
18571
|
-
projects:
|
|
18572
|
-
replicas:
|
|
18977
|
+
current: z27.boolean().default(false),
|
|
18978
|
+
projects: z27.number().int().nonnegative().optional(),
|
|
18979
|
+
replicas: z27.number().int().nonnegative().optional(),
|
|
18573
18980
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18574
18981
|
lastPresenceAt: isoTime.nullable().optional()
|
|
18575
18982
|
});
|
|
18576
|
-
nexusCloudOrganizationSchema =
|
|
18577
|
-
id:
|
|
18578
|
-
name:
|
|
18579
|
-
slug:
|
|
18580
|
-
role:
|
|
18581
|
-
personal:
|
|
18983
|
+
nexusCloudOrganizationSchema = z27.object({
|
|
18984
|
+
id: z27.string(),
|
|
18985
|
+
name: z27.string(),
|
|
18986
|
+
slug: z27.string().nullable().optional(),
|
|
18987
|
+
role: z27.string().optional(),
|
|
18988
|
+
personal: z27.boolean().optional()
|
|
18582
18989
|
});
|
|
18583
|
-
nexusCloudUserSchema =
|
|
18584
|
-
id:
|
|
18585
|
-
email:
|
|
18586
|
-
name:
|
|
18990
|
+
nexusCloudUserSchema = z27.object({
|
|
18991
|
+
id: z27.string(),
|
|
18992
|
+
email: z27.string(),
|
|
18993
|
+
name: z27.string().nullable().optional()
|
|
18587
18994
|
});
|
|
18588
|
-
nexusCloudWhoamiSchema =
|
|
18995
|
+
nexusCloudWhoamiSchema = z27.object({
|
|
18589
18996
|
serverTime: isoTime.optional(),
|
|
18590
18997
|
user: nexusCloudUserSchema,
|
|
18591
|
-
organizations:
|
|
18998
|
+
organizations: z27.array(nexusCloudOrganizationSchema).default([]),
|
|
18592
18999
|
credential: nexusCloudCredentialSchema,
|
|
18593
19000
|
/** The calling device; null for a session caller. */
|
|
18594
19001
|
device: nexusCloudDeviceSchema.nullable()
|
|
18595
19002
|
});
|
|
18596
|
-
nexusCloudDevicePageSchema =
|
|
18597
|
-
devices:
|
|
18598
|
-
nextCursor:
|
|
18599
|
-
truncated:
|
|
19003
|
+
nexusCloudDevicePageSchema = z27.object({
|
|
19004
|
+
devices: z27.array(nexusCloudDeviceSchema),
|
|
19005
|
+
nextCursor: z27.string().max(512).nullable().default(null),
|
|
19006
|
+
truncated: z27.boolean().default(false)
|
|
18600
19007
|
});
|
|
18601
|
-
nexusCloudPresenceSchema =
|
|
19008
|
+
nexusCloudPresenceSchema = z27.looseObject({
|
|
18602
19009
|
observedAt: isoTime.optional(),
|
|
18603
|
-
sync:
|
|
19010
|
+
sync: z27.object({ enabled: z27.boolean() }).optional()
|
|
18604
19011
|
});
|
|
18605
|
-
nexusCloudReplicaSchema =
|
|
18606
|
-
projectId:
|
|
18607
|
-
replicaId:
|
|
18608
|
-
deviceId:
|
|
18609
|
-
deviceName:
|
|
19012
|
+
nexusCloudReplicaSchema = z27.object({
|
|
19013
|
+
projectId: z27.string(),
|
|
19014
|
+
replicaId: z27.string(),
|
|
19015
|
+
deviceId: z27.string(),
|
|
19016
|
+
deviceName: z27.string(),
|
|
18610
19017
|
deviceState: deviceState.optional(),
|
|
18611
19018
|
attachedAt: isoTime.optional(),
|
|
18612
19019
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -18615,72 +19022,72 @@ var init_nexus_cloud = __esm({
|
|
|
18615
19022
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
18616
19023
|
retiredAt: isoTime.nullable().optional(),
|
|
18617
19024
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
18618
|
-
successor:
|
|
19025
|
+
successor: z27.string().nullable().optional()
|
|
18619
19026
|
});
|
|
18620
|
-
nexusCloudDeviceCountsSchema =
|
|
18621
|
-
active:
|
|
18622
|
-
total:
|
|
19027
|
+
nexusCloudDeviceCountsSchema = z27.object({
|
|
19028
|
+
active: z27.number().int().nonnegative(),
|
|
19029
|
+
total: z27.number().int().nonnegative()
|
|
18623
19030
|
});
|
|
18624
19031
|
projectFields = {
|
|
18625
|
-
projectId:
|
|
18626
|
-
label:
|
|
18627
|
-
organizationId:
|
|
18628
|
-
organizationName:
|
|
18629
|
-
remoteUrl:
|
|
19032
|
+
projectId: z27.string(),
|
|
19033
|
+
label: z27.string().nullable(),
|
|
19034
|
+
organizationId: z27.string(),
|
|
19035
|
+
organizationName: z27.string().optional(),
|
|
19036
|
+
remoteUrl: z27.string().nullable().optional(),
|
|
18630
19037
|
createdAt: isoTime.optional()
|
|
18631
19038
|
};
|
|
18632
|
-
nexusCloudProjectListItemSchema =
|
|
19039
|
+
nexusCloudProjectListItemSchema = z27.object({
|
|
18633
19040
|
...projectFields,
|
|
18634
|
-
role:
|
|
19041
|
+
role: z27.string(),
|
|
18635
19042
|
/**
|
|
18636
19043
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
18637
19044
|
* only a holder of the account key can open it (T13102).
|
|
18638
19045
|
*/
|
|
18639
|
-
encryptedName:
|
|
18640
|
-
streamId:
|
|
18641
|
-
headSeq:
|
|
19046
|
+
encryptedName: z27.string().nullable().optional(),
|
|
19047
|
+
streamId: z27.string().optional(),
|
|
19048
|
+
headSeq: z27.number().int().nonnegative().nullable().optional(),
|
|
18642
19049
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
18643
|
-
headCheckpointId:
|
|
18644
|
-
openConflicts:
|
|
18645
|
-
replicas:
|
|
19050
|
+
headCheckpointId: z27.string().nullable().optional(),
|
|
19051
|
+
openConflicts: z27.number().int().nonnegative().optional(),
|
|
19052
|
+
replicas: z27.array(nexusCloudReplicaSchema).default([]),
|
|
18646
19053
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18647
|
-
replicaCount:
|
|
19054
|
+
replicaCount: z27.number().int().nonnegative().optional(),
|
|
18648
19055
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18649
19056
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
18650
19057
|
/** This project's replica list was cut at 50 (T12858). */
|
|
18651
|
-
replicasTruncated:
|
|
19058
|
+
replicasTruncated: z27.boolean().default(false)
|
|
18652
19059
|
});
|
|
18653
|
-
nexusCloudProjectPageSchema =
|
|
18654
|
-
projects:
|
|
18655
|
-
nextCursor:
|
|
19060
|
+
nexusCloudProjectPageSchema = z27.object({
|
|
19061
|
+
projects: z27.array(nexusCloudProjectListItemSchema),
|
|
19062
|
+
nextCursor: z27.string().max(512).nullable().default(null),
|
|
18656
19063
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
18657
|
-
truncated:
|
|
19064
|
+
truncated: z27.boolean().default(false),
|
|
18658
19065
|
/** The project list itself was cut at 1000 (T12858). */
|
|
18659
|
-
projectsTruncated:
|
|
19066
|
+
projectsTruncated: z27.boolean().default(false)
|
|
18660
19067
|
});
|
|
18661
|
-
nexusCloudProjectDetailSchema =
|
|
18662
|
-
project:
|
|
18663
|
-
role:
|
|
18664
|
-
canTrash:
|
|
18665
|
-
openConflicts:
|
|
19068
|
+
nexusCloudProjectDetailSchema = z27.object({
|
|
19069
|
+
project: z27.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
19070
|
+
role: z27.string(),
|
|
19071
|
+
canTrash: z27.boolean().optional(),
|
|
19072
|
+
openConflicts: z27.number().int().nonnegative(),
|
|
18666
19073
|
/** At most 50, oldest attachment first. */
|
|
18667
|
-
replicas:
|
|
19074
|
+
replicas: z27.array(nexusCloudReplicaSchema),
|
|
18668
19075
|
devices: nexusCloudDeviceCountsSchema,
|
|
18669
|
-
replicaCount:
|
|
19076
|
+
replicaCount: z27.number().int().nonnegative().optional(),
|
|
18670
19077
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18671
19078
|
/** `replicas` was cut at 50. */
|
|
18672
|
-
truncated:
|
|
18673
|
-
stream:
|
|
18674
|
-
streamId:
|
|
18675
|
-
headSeq:
|
|
18676
|
-
headCheckpointId:
|
|
19079
|
+
truncated: z27.boolean().default(false),
|
|
19080
|
+
stream: z27.object({
|
|
19081
|
+
streamId: z27.string(),
|
|
19082
|
+
headSeq: z27.number().int().nonnegative(),
|
|
19083
|
+
headCheckpointId: z27.string().nullable()
|
|
18677
19084
|
}).nullable()
|
|
18678
19085
|
});
|
|
18679
|
-
nexusCloudReplicaPageSchema =
|
|
18680
|
-
replicas:
|
|
19086
|
+
nexusCloudReplicaPageSchema = z27.object({
|
|
19087
|
+
replicas: z27.array(nexusCloudReplicaSchema),
|
|
18681
19088
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18682
|
-
nextCursor:
|
|
18683
|
-
truncated:
|
|
19089
|
+
nextCursor: z27.string().max(512).nullable().default(null),
|
|
19090
|
+
truncated: z27.boolean().default(false)
|
|
18684
19091
|
});
|
|
18685
19092
|
NEXUS_STATUS_CHECK_IDS = [
|
|
18686
19093
|
"credential.valid",
|
|
@@ -18696,56 +19103,56 @@ var init_nexus_cloud = __esm({
|
|
|
18696
19103
|
];
|
|
18697
19104
|
NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
18698
19105
|
CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
18699
|
-
knownCheckId =
|
|
18700
|
-
nexusCloudStatusCheckSchema =
|
|
18701
|
-
id:
|
|
18702
|
-
ok:
|
|
18703
|
-
required:
|
|
18704
|
-
detail:
|
|
18705
|
-
});
|
|
18706
|
-
nexusCloudStatusSchema =
|
|
19106
|
+
knownCheckId = z27.enum(NEXUS_STATUS_CHECK_IDS);
|
|
19107
|
+
nexusCloudStatusCheckSchema = z27.object({
|
|
19108
|
+
id: z27.enum(NEXUS_STATUS_CHECK_IDS),
|
|
19109
|
+
ok: z27.boolean(),
|
|
19110
|
+
required: z27.boolean(),
|
|
19111
|
+
detail: z27.string()
|
|
19112
|
+
});
|
|
19113
|
+
nexusCloudStatusSchema = z27.object({
|
|
18707
19114
|
serverTime: isoTime.optional(),
|
|
18708
|
-
apiVersion:
|
|
19115
|
+
apiVersion: z27.string().optional(),
|
|
18709
19116
|
/**
|
|
18710
19117
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
18711
19118
|
* than the list, which therefore support none of them.
|
|
18712
19119
|
*/
|
|
18713
|
-
features:
|
|
19120
|
+
features: z27.array(z27.string()).optional(),
|
|
18714
19121
|
user: nexusCloudUserSchema,
|
|
18715
19122
|
credential: nexusCloudCredentialSchema,
|
|
18716
19123
|
device: nexusCloudDeviceSchema.nullable(),
|
|
18717
|
-
project:
|
|
18718
|
-
projectId:
|
|
18719
|
-
registered:
|
|
18720
|
-
organizationId:
|
|
18721
|
-
organizationName:
|
|
18722
|
-
role:
|
|
19124
|
+
project: z27.object({
|
|
19125
|
+
projectId: z27.string(),
|
|
19126
|
+
registered: z27.boolean(),
|
|
19127
|
+
organizationId: z27.string().nullable(),
|
|
19128
|
+
organizationName: z27.string().nullable(),
|
|
19129
|
+
role: z27.string().nullable()
|
|
18723
19130
|
}).nullable(),
|
|
18724
|
-
replica:
|
|
18725
|
-
replicaId:
|
|
18726
|
-
attached:
|
|
18727
|
-
attachedElsewhere:
|
|
19131
|
+
replica: z27.object({
|
|
19132
|
+
replicaId: z27.string(),
|
|
19133
|
+
attached: z27.boolean(),
|
|
19134
|
+
attachedElsewhere: z27.boolean(),
|
|
18728
19135
|
attachedAt: isoTime.nullable(),
|
|
18729
19136
|
lastSyncAt: isoTime.nullable(),
|
|
18730
19137
|
presenceAt: isoTime.nullable(),
|
|
18731
|
-
lastReplicaSeq:
|
|
19138
|
+
lastReplicaSeq: z27.number().int().nonnegative().nullable().optional()
|
|
18732
19139
|
}).nullable(),
|
|
18733
|
-
stream:
|
|
18734
|
-
streamId:
|
|
18735
|
-
headSeq:
|
|
18736
|
-
headCheckpointId:
|
|
18737
|
-
openConflicts:
|
|
19140
|
+
stream: z27.object({
|
|
19141
|
+
streamId: z27.string(),
|
|
19142
|
+
headSeq: z27.number().int().nonnegative(),
|
|
19143
|
+
headCheckpointId: z27.string().nullable(),
|
|
19144
|
+
openConflicts: z27.number().int().nonnegative(),
|
|
18738
19145
|
devices: nexusCloudDeviceCountsSchema
|
|
18739
19146
|
}).nullable(),
|
|
18740
19147
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
18741
|
-
checks:
|
|
19148
|
+
checks: z27.array(nexusCloudStatusCheckSchema.extend({ id: z27.string() })).transform(
|
|
18742
19149
|
(list) => list.flatMap((c) => {
|
|
18743
19150
|
const id = knownCheckId.safeParse(c.id);
|
|
18744
19151
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
18745
19152
|
})
|
|
18746
19153
|
),
|
|
18747
19154
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
18748
|
-
verdict:
|
|
19155
|
+
verdict: z27.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
18749
19156
|
});
|
|
18750
19157
|
LOGIN = "run `cleo login nexus`";
|
|
18751
19158
|
SESSION_EXPIRED_LOGIN = {
|
|
@@ -18799,54 +19206,54 @@ var init_nexus_first_run = __esm({
|
|
|
18799
19206
|
});
|
|
18800
19207
|
|
|
18801
19208
|
// packages/contracts/src/nexus-vault.ts
|
|
18802
|
-
import { z as
|
|
19209
|
+
import { z as z28 } from "zod";
|
|
18803
19210
|
var isoTime2, uuid, nexusUserKeysSchema, nexusProjectKeysSchema, nexusLeaseSchema, nexusLeaseAcquireSchema, nexusStreamHeadSchema, nexusActivityEventSchema, nexusActivityPageSchema;
|
|
18804
19211
|
var init_nexus_vault = __esm({
|
|
18805
19212
|
"packages/contracts/src/nexus-vault.ts"() {
|
|
18806
19213
|
"use strict";
|
|
18807
|
-
isoTime2 =
|
|
18808
|
-
uuid =
|
|
18809
|
-
nexusUserKeysSchema =
|
|
18810
|
-
keyVersion:
|
|
18811
|
-
masterKeyVerifier:
|
|
18812
|
-
});
|
|
18813
|
-
nexusProjectKeysSchema =
|
|
18814
|
-
keys:
|
|
18815
|
-
|
|
19214
|
+
isoTime2 = z28.iso.datetime({ offset: true });
|
|
19215
|
+
uuid = z28.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
|
|
19216
|
+
nexusUserKeysSchema = z28.looseObject({
|
|
19217
|
+
keyVersion: z28.number().int().positive(),
|
|
19218
|
+
masterKeyVerifier: z28.string()
|
|
19219
|
+
});
|
|
19220
|
+
nexusProjectKeysSchema = z28.looseObject({
|
|
19221
|
+
keys: z28.array(
|
|
19222
|
+
z28.looseObject({ wrappedProjectKey: z28.string(), keyVersion: z28.number().int().positive() })
|
|
18816
19223
|
)
|
|
18817
19224
|
});
|
|
18818
|
-
nexusLeaseSchema =
|
|
18819
|
-
streamId:
|
|
18820
|
-
role:
|
|
19225
|
+
nexusLeaseSchema = z28.looseObject({
|
|
19226
|
+
streamId: z28.string(),
|
|
19227
|
+
role: z28.string(),
|
|
18821
19228
|
replicaId: uuid,
|
|
18822
19229
|
expiresAt: isoTime2,
|
|
18823
19230
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
18824
19231
|
});
|
|
18825
|
-
nexusLeaseAcquireSchema =
|
|
18826
|
-
nexusStreamHeadSchema =
|
|
18827
|
-
streamId:
|
|
18828
|
-
kind:
|
|
18829
|
-
headSeq:
|
|
18830
|
-
headCheckpointId:
|
|
19232
|
+
nexusLeaseAcquireSchema = z28.looseObject({ lease: nexusLeaseSchema });
|
|
19233
|
+
nexusStreamHeadSchema = z28.looseObject({
|
|
19234
|
+
streamId: z28.string(),
|
|
19235
|
+
kind: z28.string().optional(),
|
|
19236
|
+
headSeq: z28.number().int().nonnegative(),
|
|
19237
|
+
headCheckpointId: z28.string().nullable(),
|
|
18831
19238
|
/**
|
|
18832
19239
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
18833
19240
|
* Absent from an older server.
|
|
18834
19241
|
*/
|
|
18835
|
-
maxSchemaVersion:
|
|
19242
|
+
maxSchemaVersion: z28.number().int().nonnegative().optional()
|
|
18836
19243
|
});
|
|
18837
|
-
nexusActivityEventSchema =
|
|
18838
|
-
id:
|
|
19244
|
+
nexusActivityEventSchema = z28.looseObject({
|
|
19245
|
+
id: z28.union([z28.string(), z28.number()]),
|
|
18839
19246
|
at: isoTime2,
|
|
18840
|
-
actorUserId:
|
|
18841
|
-
actorDeviceId:
|
|
18842
|
-
requestId:
|
|
18843
|
-
action:
|
|
18844
|
-
target:
|
|
18845
|
-
detail:
|
|
19247
|
+
actorUserId: z28.string().nullable().optional(),
|
|
19248
|
+
actorDeviceId: z28.string().nullable().optional(),
|
|
19249
|
+
requestId: z28.string().nullable().optional(),
|
|
19250
|
+
action: z28.string(),
|
|
19251
|
+
target: z28.string().nullable().optional(),
|
|
19252
|
+
detail: z28.unknown().optional()
|
|
18846
19253
|
});
|
|
18847
|
-
nexusActivityPageSchema =
|
|
18848
|
-
events:
|
|
18849
|
-
nextBefore:
|
|
19254
|
+
nexusActivityPageSchema = z28.looseObject({
|
|
19255
|
+
events: z28.array(nexusActivityEventSchema),
|
|
19256
|
+
nextBefore: z28.union([z28.string(), z28.number()]).nullable().optional()
|
|
18850
19257
|
});
|
|
18851
19258
|
}
|
|
18852
19259
|
});
|
|
@@ -18882,6 +19289,7 @@ var init_src = __esm({
|
|
|
18882
19289
|
init_db_inventory2();
|
|
18883
19290
|
init_identity();
|
|
18884
19291
|
init_operations_registry();
|
|
19292
|
+
init_modernize();
|
|
18885
19293
|
init_provenance();
|
|
18886
19294
|
init_read();
|
|
18887
19295
|
init_docs_taxonomy();
|
|
@@ -32968,7 +33376,7 @@ function resolveRef(ref, ctx) {
|
|
|
32968
33376
|
function convertBaseSchema(schema, ctx) {
|
|
32969
33377
|
if (schema.not !== void 0) {
|
|
32970
33378
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
32971
|
-
return
|
|
33379
|
+
return z29.never();
|
|
32972
33380
|
}
|
|
32973
33381
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
32974
33382
|
}
|
|
@@ -32990,7 +33398,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
32990
33398
|
return ctx.refs.get(refPath);
|
|
32991
33399
|
}
|
|
32992
33400
|
if (ctx.processing.has(refPath)) {
|
|
32993
|
-
return
|
|
33401
|
+
return z29.lazy(() => {
|
|
32994
33402
|
if (!ctx.refs.has(refPath)) {
|
|
32995
33403
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
32996
33404
|
}
|
|
@@ -33007,25 +33415,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33007
33415
|
if (schema.enum !== void 0) {
|
|
33008
33416
|
const enumValues = schema.enum;
|
|
33009
33417
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
33010
|
-
return
|
|
33418
|
+
return z29.null();
|
|
33011
33419
|
}
|
|
33012
33420
|
if (enumValues.length === 0) {
|
|
33013
|
-
return
|
|
33421
|
+
return z29.never();
|
|
33014
33422
|
}
|
|
33015
33423
|
if (enumValues.length === 1) {
|
|
33016
|
-
return
|
|
33424
|
+
return z29.literal(enumValues[0]);
|
|
33017
33425
|
}
|
|
33018
33426
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
33019
|
-
return
|
|
33427
|
+
return z29.enum(enumValues);
|
|
33020
33428
|
}
|
|
33021
|
-
const literalSchemas = enumValues.map((v) =>
|
|
33429
|
+
const literalSchemas = enumValues.map((v) => z29.literal(v));
|
|
33022
33430
|
if (literalSchemas.length < 2) {
|
|
33023
33431
|
return literalSchemas[0];
|
|
33024
33432
|
}
|
|
33025
|
-
return
|
|
33433
|
+
return z29.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
33026
33434
|
}
|
|
33027
33435
|
if (schema.const !== void 0) {
|
|
33028
|
-
return
|
|
33436
|
+
return z29.literal(schema.const);
|
|
33029
33437
|
}
|
|
33030
33438
|
const type = schema.type;
|
|
33031
33439
|
if (Array.isArray(type)) {
|
|
@@ -33034,68 +33442,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33034
33442
|
return convertBaseSchema(typeSchema, ctx);
|
|
33035
33443
|
});
|
|
33036
33444
|
if (typeSchemas.length === 0) {
|
|
33037
|
-
return
|
|
33445
|
+
return z29.never();
|
|
33038
33446
|
}
|
|
33039
33447
|
if (typeSchemas.length === 1) {
|
|
33040
33448
|
return typeSchemas[0];
|
|
33041
33449
|
}
|
|
33042
|
-
return
|
|
33450
|
+
return z29.union(typeSchemas);
|
|
33043
33451
|
}
|
|
33044
33452
|
if (!type) {
|
|
33045
|
-
return
|
|
33453
|
+
return z29.any();
|
|
33046
33454
|
}
|
|
33047
33455
|
let zodSchema2;
|
|
33048
33456
|
switch (type) {
|
|
33049
33457
|
case "string": {
|
|
33050
|
-
let stringSchema =
|
|
33458
|
+
let stringSchema = z29.string();
|
|
33051
33459
|
if (schema.format) {
|
|
33052
33460
|
const format = schema.format;
|
|
33053
33461
|
if (format === "email") {
|
|
33054
|
-
stringSchema = stringSchema.check(
|
|
33462
|
+
stringSchema = stringSchema.check(z29.email());
|
|
33055
33463
|
} else if (format === "uri" || format === "uri-reference") {
|
|
33056
|
-
stringSchema = stringSchema.check(
|
|
33464
|
+
stringSchema = stringSchema.check(z29.url());
|
|
33057
33465
|
} else if (format === "uuid" || format === "guid") {
|
|
33058
|
-
stringSchema = stringSchema.check(
|
|
33466
|
+
stringSchema = stringSchema.check(z29.uuid());
|
|
33059
33467
|
} else if (format === "date-time") {
|
|
33060
|
-
stringSchema = stringSchema.check(
|
|
33468
|
+
stringSchema = stringSchema.check(z29.iso.datetime());
|
|
33061
33469
|
} else if (format === "date") {
|
|
33062
|
-
stringSchema = stringSchema.check(
|
|
33470
|
+
stringSchema = stringSchema.check(z29.iso.date());
|
|
33063
33471
|
} else if (format === "time") {
|
|
33064
|
-
stringSchema = stringSchema.check(
|
|
33472
|
+
stringSchema = stringSchema.check(z29.iso.time());
|
|
33065
33473
|
} else if (format === "duration") {
|
|
33066
|
-
stringSchema = stringSchema.check(
|
|
33474
|
+
stringSchema = stringSchema.check(z29.iso.duration());
|
|
33067
33475
|
} else if (format === "ipv4") {
|
|
33068
|
-
stringSchema = stringSchema.check(
|
|
33476
|
+
stringSchema = stringSchema.check(z29.ipv4());
|
|
33069
33477
|
} else if (format === "ipv6") {
|
|
33070
|
-
stringSchema = stringSchema.check(
|
|
33478
|
+
stringSchema = stringSchema.check(z29.ipv6());
|
|
33071
33479
|
} else if (format === "mac") {
|
|
33072
|
-
stringSchema = stringSchema.check(
|
|
33480
|
+
stringSchema = stringSchema.check(z29.mac());
|
|
33073
33481
|
} else if (format === "cidr") {
|
|
33074
|
-
stringSchema = stringSchema.check(
|
|
33482
|
+
stringSchema = stringSchema.check(z29.cidrv4());
|
|
33075
33483
|
} else if (format === "cidr-v6") {
|
|
33076
|
-
stringSchema = stringSchema.check(
|
|
33484
|
+
stringSchema = stringSchema.check(z29.cidrv6());
|
|
33077
33485
|
} else if (format === "base64") {
|
|
33078
|
-
stringSchema = stringSchema.check(
|
|
33486
|
+
stringSchema = stringSchema.check(z29.base64());
|
|
33079
33487
|
} else if (format === "base64url") {
|
|
33080
|
-
stringSchema = stringSchema.check(
|
|
33488
|
+
stringSchema = stringSchema.check(z29.base64url());
|
|
33081
33489
|
} else if (format === "e164") {
|
|
33082
|
-
stringSchema = stringSchema.check(
|
|
33490
|
+
stringSchema = stringSchema.check(z29.e164());
|
|
33083
33491
|
} else if (format === "jwt") {
|
|
33084
|
-
stringSchema = stringSchema.check(
|
|
33492
|
+
stringSchema = stringSchema.check(z29.jwt());
|
|
33085
33493
|
} else if (format === "emoji") {
|
|
33086
|
-
stringSchema = stringSchema.check(
|
|
33494
|
+
stringSchema = stringSchema.check(z29.emoji());
|
|
33087
33495
|
} else if (format === "nanoid") {
|
|
33088
|
-
stringSchema = stringSchema.check(
|
|
33496
|
+
stringSchema = stringSchema.check(z29.nanoid());
|
|
33089
33497
|
} else if (format === "cuid") {
|
|
33090
|
-
stringSchema = stringSchema.check(
|
|
33498
|
+
stringSchema = stringSchema.check(z29.cuid());
|
|
33091
33499
|
} else if (format === "cuid2") {
|
|
33092
|
-
stringSchema = stringSchema.check(
|
|
33500
|
+
stringSchema = stringSchema.check(z29.cuid2());
|
|
33093
33501
|
} else if (format === "ulid") {
|
|
33094
|
-
stringSchema = stringSchema.check(
|
|
33502
|
+
stringSchema = stringSchema.check(z29.ulid());
|
|
33095
33503
|
} else if (format === "xid") {
|
|
33096
|
-
stringSchema = stringSchema.check(
|
|
33504
|
+
stringSchema = stringSchema.check(z29.xid());
|
|
33097
33505
|
} else if (format === "ksuid") {
|
|
33098
|
-
stringSchema = stringSchema.check(
|
|
33506
|
+
stringSchema = stringSchema.check(z29.ksuid());
|
|
33099
33507
|
}
|
|
33100
33508
|
}
|
|
33101
33509
|
if (typeof schema.minLength === "number") {
|
|
@@ -33112,7 +33520,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33112
33520
|
}
|
|
33113
33521
|
case "number":
|
|
33114
33522
|
case "integer": {
|
|
33115
|
-
let numberSchema = type === "integer" ?
|
|
33523
|
+
let numberSchema = type === "integer" ? z29.number().int() : z29.number();
|
|
33116
33524
|
if (typeof schema.minimum === "number") {
|
|
33117
33525
|
numberSchema = numberSchema.min(schema.minimum);
|
|
33118
33526
|
}
|
|
@@ -33136,11 +33544,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33136
33544
|
break;
|
|
33137
33545
|
}
|
|
33138
33546
|
case "boolean": {
|
|
33139
|
-
zodSchema2 =
|
|
33547
|
+
zodSchema2 = z29.boolean();
|
|
33140
33548
|
break;
|
|
33141
33549
|
}
|
|
33142
33550
|
case "null": {
|
|
33143
|
-
zodSchema2 =
|
|
33551
|
+
zodSchema2 = z29.null();
|
|
33144
33552
|
break;
|
|
33145
33553
|
}
|
|
33146
33554
|
case "object": {
|
|
@@ -33153,14 +33561,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33153
33561
|
}
|
|
33154
33562
|
if (schema.propertyNames) {
|
|
33155
33563
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
33156
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
33564
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z29.any();
|
|
33157
33565
|
if (Object.keys(shape).length === 0) {
|
|
33158
|
-
zodSchema2 =
|
|
33566
|
+
zodSchema2 = z29.record(keySchema, valueSchema);
|
|
33159
33567
|
break;
|
|
33160
33568
|
}
|
|
33161
|
-
const objectSchema2 =
|
|
33162
|
-
const recordSchema =
|
|
33163
|
-
zodSchema2 =
|
|
33569
|
+
const objectSchema2 = z29.object(shape).passthrough();
|
|
33570
|
+
const recordSchema = z29.looseRecord(keySchema, valueSchema);
|
|
33571
|
+
zodSchema2 = z29.intersection(objectSchema2, recordSchema);
|
|
33164
33572
|
break;
|
|
33165
33573
|
}
|
|
33166
33574
|
if (schema.patternProperties) {
|
|
@@ -33169,28 +33577,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33169
33577
|
const looseRecords = [];
|
|
33170
33578
|
for (const pattern of patternKeys) {
|
|
33171
33579
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
33172
|
-
const keySchema =
|
|
33173
|
-
looseRecords.push(
|
|
33580
|
+
const keySchema = z29.string().regex(new RegExp(pattern));
|
|
33581
|
+
looseRecords.push(z29.looseRecord(keySchema, patternValue));
|
|
33174
33582
|
}
|
|
33175
33583
|
const schemasToIntersect = [];
|
|
33176
33584
|
if (Object.keys(shape).length > 0) {
|
|
33177
|
-
schemasToIntersect.push(
|
|
33585
|
+
schemasToIntersect.push(z29.object(shape).passthrough());
|
|
33178
33586
|
}
|
|
33179
33587
|
schemasToIntersect.push(...looseRecords);
|
|
33180
33588
|
if (schemasToIntersect.length === 0) {
|
|
33181
|
-
zodSchema2 =
|
|
33589
|
+
zodSchema2 = z29.object({}).passthrough();
|
|
33182
33590
|
} else if (schemasToIntersect.length === 1) {
|
|
33183
33591
|
zodSchema2 = schemasToIntersect[0];
|
|
33184
33592
|
} else {
|
|
33185
|
-
let result =
|
|
33593
|
+
let result = z29.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
33186
33594
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
33187
|
-
result =
|
|
33595
|
+
result = z29.intersection(result, schemasToIntersect[i]);
|
|
33188
33596
|
}
|
|
33189
33597
|
zodSchema2 = result;
|
|
33190
33598
|
}
|
|
33191
33599
|
break;
|
|
33192
33600
|
}
|
|
33193
|
-
const objectSchema =
|
|
33601
|
+
const objectSchema = z29.object(shape);
|
|
33194
33602
|
if (schema.additionalProperties === false) {
|
|
33195
33603
|
zodSchema2 = objectSchema.strict();
|
|
33196
33604
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -33207,33 +33615,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33207
33615
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
33208
33616
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
33209
33617
|
if (rest) {
|
|
33210
|
-
zodSchema2 =
|
|
33618
|
+
zodSchema2 = z29.tuple(tupleItems).rest(rest);
|
|
33211
33619
|
} else {
|
|
33212
|
-
zodSchema2 =
|
|
33620
|
+
zodSchema2 = z29.tuple(tupleItems);
|
|
33213
33621
|
}
|
|
33214
33622
|
if (typeof schema.minItems === "number") {
|
|
33215
|
-
zodSchema2 = zodSchema2.check(
|
|
33623
|
+
zodSchema2 = zodSchema2.check(z29.minLength(schema.minItems));
|
|
33216
33624
|
}
|
|
33217
33625
|
if (typeof schema.maxItems === "number") {
|
|
33218
|
-
zodSchema2 = zodSchema2.check(
|
|
33626
|
+
zodSchema2 = zodSchema2.check(z29.maxLength(schema.maxItems));
|
|
33219
33627
|
}
|
|
33220
33628
|
} else if (Array.isArray(items)) {
|
|
33221
33629
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
33222
33630
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
33223
33631
|
if (rest) {
|
|
33224
|
-
zodSchema2 =
|
|
33632
|
+
zodSchema2 = z29.tuple(tupleItems).rest(rest);
|
|
33225
33633
|
} else {
|
|
33226
|
-
zodSchema2 =
|
|
33634
|
+
zodSchema2 = z29.tuple(tupleItems);
|
|
33227
33635
|
}
|
|
33228
33636
|
if (typeof schema.minItems === "number") {
|
|
33229
|
-
zodSchema2 = zodSchema2.check(
|
|
33637
|
+
zodSchema2 = zodSchema2.check(z29.minLength(schema.minItems));
|
|
33230
33638
|
}
|
|
33231
33639
|
if (typeof schema.maxItems === "number") {
|
|
33232
|
-
zodSchema2 = zodSchema2.check(
|
|
33640
|
+
zodSchema2 = zodSchema2.check(z29.maxLength(schema.maxItems));
|
|
33233
33641
|
}
|
|
33234
33642
|
} else if (items !== void 0) {
|
|
33235
33643
|
const element = convertSchema(items, ctx);
|
|
33236
|
-
let arraySchema =
|
|
33644
|
+
let arraySchema = z29.array(element);
|
|
33237
33645
|
if (typeof schema.minItems === "number") {
|
|
33238
33646
|
arraySchema = arraySchema.min(schema.minItems);
|
|
33239
33647
|
}
|
|
@@ -33242,7 +33650,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33242
33650
|
}
|
|
33243
33651
|
zodSchema2 = arraySchema;
|
|
33244
33652
|
} else {
|
|
33245
|
-
zodSchema2 =
|
|
33653
|
+
zodSchema2 = z29.array(z29.any());
|
|
33246
33654
|
}
|
|
33247
33655
|
break;
|
|
33248
33656
|
}
|
|
@@ -33259,37 +33667,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
33259
33667
|
}
|
|
33260
33668
|
function convertSchema(schema, ctx) {
|
|
33261
33669
|
if (typeof schema === "boolean") {
|
|
33262
|
-
return schema ?
|
|
33670
|
+
return schema ? z29.any() : z29.never();
|
|
33263
33671
|
}
|
|
33264
33672
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
33265
33673
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
33266
33674
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
33267
33675
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
33268
|
-
const anyOfUnion =
|
|
33269
|
-
baseSchema = hasExplicitType ?
|
|
33676
|
+
const anyOfUnion = z29.union(options);
|
|
33677
|
+
baseSchema = hasExplicitType ? z29.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
33270
33678
|
}
|
|
33271
33679
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
33272
33680
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
33273
|
-
const oneOfUnion =
|
|
33274
|
-
baseSchema = hasExplicitType ?
|
|
33681
|
+
const oneOfUnion = z29.xor(options);
|
|
33682
|
+
baseSchema = hasExplicitType ? z29.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
33275
33683
|
}
|
|
33276
33684
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
33277
33685
|
if (schema.allOf.length === 0) {
|
|
33278
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
33686
|
+
baseSchema = hasExplicitType ? baseSchema : z29.any();
|
|
33279
33687
|
} else {
|
|
33280
33688
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
33281
33689
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
33282
33690
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
33283
|
-
result =
|
|
33691
|
+
result = z29.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
33284
33692
|
}
|
|
33285
33693
|
baseSchema = result;
|
|
33286
33694
|
}
|
|
33287
33695
|
}
|
|
33288
33696
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
33289
|
-
baseSchema =
|
|
33697
|
+
baseSchema = z29.nullable(baseSchema);
|
|
33290
33698
|
}
|
|
33291
33699
|
if (schema.readOnly === true) {
|
|
33292
|
-
baseSchema =
|
|
33700
|
+
baseSchema = z29.readonly(baseSchema);
|
|
33293
33701
|
}
|
|
33294
33702
|
const extraMeta = {};
|
|
33295
33703
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -33316,7 +33724,7 @@ function convertSchema(schema, ctx) {
|
|
|
33316
33724
|
}
|
|
33317
33725
|
function fromJSONSchema(schema, params) {
|
|
33318
33726
|
if (typeof schema === "boolean") {
|
|
33319
|
-
return schema ?
|
|
33727
|
+
return schema ? z29.any() : z29.never();
|
|
33320
33728
|
}
|
|
33321
33729
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
33322
33730
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -33330,14 +33738,14 @@ function fromJSONSchema(schema, params) {
|
|
|
33330
33738
|
};
|
|
33331
33739
|
return convertSchema(schema, ctx);
|
|
33332
33740
|
}
|
|
33333
|
-
var
|
|
33741
|
+
var z29, RECOGNIZED_KEYS;
|
|
33334
33742
|
var init_from_json_schema = __esm({
|
|
33335
33743
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
33336
33744
|
init_registries();
|
|
33337
33745
|
init_checks2();
|
|
33338
33746
|
init_iso();
|
|
33339
33747
|
init_schemas2();
|
|
33340
|
-
|
|
33748
|
+
z29 = {
|
|
33341
33749
|
...schemas_exports2,
|
|
33342
33750
|
...checks_exports2,
|
|
33343
33751
|
iso: iso_exports
|
|
@@ -45313,16 +45721,16 @@ function excludeFile(projectDir, env = process.env) {
|
|
|
45313
45721
|
if (path === null || path === "") return null;
|
|
45314
45722
|
return isAbsolute(path) ? path : join3(projectDir, path);
|
|
45315
45723
|
}
|
|
45316
|
-
function excludeLine(projectDir,
|
|
45724
|
+
function excludeLine(projectDir, relPath2, env = process.env) {
|
|
45317
45725
|
const prefix = gitOutput(projectDir, ["rev-parse", "--show-prefix"], env) ?? "";
|
|
45318
|
-
return `/${prefix}${
|
|
45726
|
+
return `/${prefix}${relPath2}`;
|
|
45319
45727
|
}
|
|
45320
|
-
function excludeHookFileFromGit(projectDir,
|
|
45728
|
+
function excludeHookFileFromGit(projectDir, relPath2, marker16 = HOOK_FILE_EXCLUDE_MARKER, env = process.env) {
|
|
45321
45729
|
const exclude = excludeFile(projectDir, env);
|
|
45322
45730
|
if (exclude === null) return false;
|
|
45323
|
-
if (gitOutput(projectDir, ["check-ignore",
|
|
45324
|
-
if (gitOutput(projectDir, ["ls-files", "--error-unmatch",
|
|
45325
|
-
const line = excludeLine(projectDir,
|
|
45731
|
+
if (gitOutput(projectDir, ["check-ignore", relPath2], env) !== null) return false;
|
|
45732
|
+
if (gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath2], env) !== null) return false;
|
|
45733
|
+
const line = excludeLine(projectDir, relPath2, env);
|
|
45326
45734
|
const text = existsSync3(exclude) ? readFileSync3(exclude, "utf-8") : "";
|
|
45327
45735
|
if (text.split("\n").includes(line)) return false;
|
|
45328
45736
|
const block = `${marker16}
|
|
@@ -45333,11 +45741,11 @@ ${line}
|
|
|
45333
45741
|
${block}`);
|
|
45334
45742
|
return true;
|
|
45335
45743
|
}
|
|
45336
|
-
function unexcludeHookFileFromGit(projectDir,
|
|
45744
|
+
function unexcludeHookFileFromGit(projectDir, relPath2) {
|
|
45337
45745
|
const exclude = excludeFile(projectDir);
|
|
45338
45746
|
if (exclude === null || !existsSync3(exclude)) return false;
|
|
45339
45747
|
const lines = readFileSync3(exclude, "utf-8").split("\n");
|
|
45340
|
-
const at = lines.indexOf(excludeLine(projectDir,
|
|
45748
|
+
const at = lines.indexOf(excludeLine(projectDir, relPath2));
|
|
45341
45749
|
const above = lines[at - 1];
|
|
45342
45750
|
if (at < 1 || above !== LOCAL_SETTINGS_EXCLUDE_MARKER && above !== HOOK_FILE_EXCLUDE_MARKER) {
|
|
45343
45751
|
return false;
|
|
@@ -45346,10 +45754,10 @@ function unexcludeHookFileFromGit(projectDir, relPath) {
|
|
|
45346
45754
|
writeFileSync(exclude, lines.join("\n"));
|
|
45347
45755
|
return true;
|
|
45348
45756
|
}
|
|
45349
|
-
function hookFileVisibleToGit(projectDir,
|
|
45757
|
+
function hookFileVisibleToGit(projectDir, relPath2) {
|
|
45350
45758
|
if (gitOutput(projectDir, ["rev-parse", "--is-inside-work-tree"]) !== "true") return false;
|
|
45351
|
-
if (gitOutput(projectDir, ["check-ignore",
|
|
45352
|
-
return gitOutput(projectDir, ["ls-files", "--error-unmatch",
|
|
45759
|
+
if (gitOutput(projectDir, ["check-ignore", relPath2]) !== null) return false;
|
|
45760
|
+
return gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath2]) === null;
|
|
45353
45761
|
}
|
|
45354
45762
|
function excludeLocalSettingsFromGit(projectDir) {
|
|
45355
45763
|
return excludeHookFileFromGit(projectDir, CLAUDE_LOCAL_SETTINGS, LOCAL_SETTINGS_EXCLUDE_MARKER);
|
|
@@ -45440,20 +45848,20 @@ function restoreCommittedCodexHooks(projectDir) {
|
|
|
45440
45848
|
writeFileSync(file2, committed);
|
|
45441
45849
|
return true;
|
|
45442
45850
|
}
|
|
45443
|
-
function excludedByCleo(projectDir,
|
|
45851
|
+
function excludedByCleo(projectDir, relPath2) {
|
|
45444
45852
|
const exclude = excludeFile(projectDir);
|
|
45445
45853
|
if (exclude === null || !existsSync3(exclude)) return false;
|
|
45446
45854
|
const lines = readFileSync3(exclude, "utf-8").split("\n");
|
|
45447
|
-
const at = lines.indexOf(excludeLine(projectDir,
|
|
45855
|
+
const at = lines.indexOf(excludeLine(projectDir, relPath2));
|
|
45448
45856
|
const above = lines[at - 1];
|
|
45449
45857
|
return at >= 1 && (above === LOCAL_SETTINGS_EXCLUDE_MARKER || above === HOOK_FILE_EXCLUDE_MARKER);
|
|
45450
45858
|
}
|
|
45451
45859
|
function codexHookSnippet() {
|
|
45452
45860
|
return JSON.stringify(heavyCommandHookEntry("codex"));
|
|
45453
45861
|
}
|
|
45454
|
-
function trackedFileModified(projectDir,
|
|
45455
|
-
if (gitOutput(projectDir, ["ls-files", "--error-unmatch",
|
|
45456
|
-
return (gitOutput(projectDir, ["diff", "--name-only", "HEAD", "--",
|
|
45862
|
+
function trackedFileModified(projectDir, relPath2) {
|
|
45863
|
+
if (gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath2]) === null) return false;
|
|
45864
|
+
return (gitOutput(projectDir, ["diff", "--name-only", "HEAD", "--", relPath2]) ?? "") !== "";
|
|
45457
45865
|
}
|
|
45458
45866
|
async function syncCodexHeavyCommandHook(projectDir, mode) {
|
|
45459
45867
|
const file2 = join3(projectDir, CODEX_HOOKS_FILE);
|