@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/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/provenance.ts
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 = z7.enum(PROVENANCE_NODE_KINDS);
13629
- provenanceEdgeRelationSchema = z7.enum(PROVENANCE_EDGE_RELATIONS);
13630
- docLifecycleStatusSchema = z7.enum(DOC_LIFECYCLE_STATUSES);
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: z7.string().min(1),
13633
- title: z7.string().min(1),
13634
- metadata: z7.record(z7.string(), z7.unknown()).optional()
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 = z7.object({
13960
+ provenanceDocNodeSchema = z8.object({
13637
13961
  ...provenanceNodeBaseFields,
13638
- kind: z7.literal("doc"),
13639
- slug: z7.string().min(1),
13640
- docKind: z7.string().min(1),
13962
+ kind: z8.literal("doc"),
13963
+ slug: z8.string().min(1),
13964
+ docKind: z8.string().min(1),
13641
13965
  lifecycleStatus: docLifecycleStatusSchema,
13642
- publishedAt: z7.string().min(1),
13643
- supersededAt: z7.string().min(1).optional(),
13644
- summary: z7.string().optional()
13966
+ publishedAt: z8.string().min(1),
13967
+ supersededAt: z8.string().min(1).optional(),
13968
+ summary: z8.string().optional()
13645
13969
  });
13646
- provenanceTaskNodeSchema = z7.object({
13970
+ provenanceTaskNodeSchema = z8.object({
13647
13971
  ...provenanceNodeBaseFields,
13648
- kind: z7.literal("task"),
13649
- taskType: z7.enum(["saga", "epic", "task", "subtask"]),
13650
- status: z7.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
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 = z7.object({
13976
+ provenanceDecisionNodeSchema = z8.object({
13653
13977
  ...provenanceNodeBaseFields,
13654
- kind: z7.literal("decision"),
13655
- outcome: z7.enum(["proposed", "accepted", "rejected", "superseded"]),
13656
- decidedAt: z7.string().min(1)
13978
+ kind: z8.literal("decision"),
13979
+ outcome: z8.enum(["proposed", "accepted", "rejected", "superseded"]),
13980
+ decidedAt: z8.string().min(1)
13657
13981
  });
13658
- provenanceSessionNodeSchema = z7.object({
13982
+ provenanceSessionNodeSchema = z8.object({
13659
13983
  ...provenanceNodeBaseFields,
13660
- kind: z7.literal("session"),
13661
- startedAt: z7.string().min(1),
13662
- endedAt: z7.string().min(1).optional()
13984
+ kind: z8.literal("session"),
13985
+ startedAt: z8.string().min(1),
13986
+ endedAt: z8.string().min(1).optional()
13663
13987
  });
13664
- provenanceMemoryNodeSchema = z7.object({
13988
+ provenanceMemoryNodeSchema = z8.object({
13665
13989
  ...provenanceNodeBaseFields,
13666
- kind: z7.literal("memory"),
13667
- memoryType: z7.enum(["observation", "pattern", "decision", "diary"]),
13668
- recordedAt: z7.string().min(1)
13990
+ kind: z8.literal("memory"),
13991
+ memoryType: z8.enum(["observation", "pattern", "decision", "diary"]),
13992
+ recordedAt: z8.string().min(1)
13669
13993
  });
13670
- provenanceNodeSchema = z7.discriminatedUnion("kind", [
13994
+ provenanceNodeSchema = z8.discriminatedUnion("kind", [
13671
13995
  provenanceDocNodeSchema,
13672
13996
  provenanceTaskNodeSchema,
13673
13997
  provenanceDecisionNodeSchema,
13674
13998
  provenanceSessionNodeSchema,
13675
13999
  provenanceMemoryNodeSchema
13676
14000
  ]);
13677
- provenanceEdgeSchema = z7.object({
14001
+ provenanceEdgeSchema = z8.object({
13678
14002
  relation: provenanceEdgeRelationSchema,
13679
- from: z7.string().min(1),
14003
+ from: z8.string().min(1),
13680
14004
  fromKind: provenanceNodeKindSchema,
13681
- to: z7.string().min(1),
14005
+ to: z8.string().min(1),
13682
14006
  toKind: provenanceNodeKindSchema,
13683
- addedAt: z7.string().min(1),
13684
- summary: z7.string().optional()
14007
+ addedAt: z8.string().min(1),
14008
+ summary: z8.string().optional()
13685
14009
  });
13686
- docProvenanceResponseSchema = z7.object({
13687
- nodes: z7.array(provenanceNodeSchema).readonly(),
13688
- edges: z7.array(provenanceEdgeSchema).readonly(),
13689
- totalNodes: z7.number().int().nonnegative(),
13690
- totalEdges: z7.number().int().nonnegative()
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 z8 } from "zod";
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 = z8.object({
13702
- slug: z8.string(),
13703
- kind: z8.string().nullable(),
13704
- title: z8.string().nullable(),
13705
- summary: z8.string().nullable(),
13706
- lifecycleStatus: z8.string(),
13707
- docVersion: z8.number().int(),
13708
- ownerVersion: z8.string().nullable(),
13709
- supersedes: z8.string().nullable(),
13710
- supersededBy: z8.string().nullable(),
13711
- topics: z8.array(z8.string()).readonly(),
13712
- relatedTasks: z8.array(z8.string()).readonly(),
13713
- sha256: z8.string(),
13714
- createdAt: z8.string()
13715
- });
13716
- docBodySchema = z8.object({
13717
- encoding: z8.enum(["utf-8", "base64"]),
13718
- text: z8.string().optional(),
13719
- base64: z8.string().optional(),
13720
- sizeBytes: z8.number().int().nonnegative(),
13721
- mimeType: z8.string().nullable()
13722
- });
13723
- docReadResponseSchema = z8.object({
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 z9 } from "zod";
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
- commitAtomSchema = z9.object({
13913
- kind: z9.literal("commit"),
13914
- sha: z9.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
13915
- });
13916
- filesAtomSchema = z9.object({
13917
- kind: z9.literal("files"),
13918
- paths: z9.array(z9.string().min(1)).min(1, "files atom requires at least one path")
13919
- });
13920
- testRunAtomSchema = z9.object({
13921
- kind: z9.literal("test-run"),
13922
- path: z9.string().min(1, "test-run atom requires a non-empty path")
13923
- });
13924
- qaRunAtomSchema = z9.object({
13925
- kind: z9.literal("qa-run"),
13926
- path: z9.string().min(1, "qa-run atom requires a non-empty path")
13927
- });
13928
- toolAtomSchema = z9.object({
13929
- kind: z9.literal("tool"),
13930
- tool: z9.string().min(1, "tool atom requires a non-empty tool name")
13931
- });
13932
- urlAtomSchema = z9.object({
13933
- kind: z9.literal("url"),
13934
- url: z9.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
13935
- });
13936
- noteAtomSchema = z9.object({
13937
- kind: z9.literal("note"),
13938
- note: z9.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
13939
- });
13940
- decisionAtomSchema = z9.object({
13941
- kind: z9.literal("decision"),
13942
- decisionId: z9.string().min(1, "decision atom requires a non-empty decision ID")
13943
- });
13944
- prAtomSchema = z9.object({
13945
- kind: z9.literal("pr"),
13946
- prNumber: z9.number().int().positive("pr atom requires a positive integer PR number"),
13947
- componentPrNumber: z9.number().int().positive().optional(),
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: z9.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14318
+ repo: z10.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13954
14319
  });
13955
- ciAtomSchema = z9.object({
13956
- kind: z9.literal("ci"),
13957
- prNumber: z9.number().int().positive("ci atom requires a positive integer PR number"),
13958
- componentPrNumber: z9.number().int().positive().optional(),
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: z9.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
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
- locDropAtomSchema = z9.object({
13963
- kind: z9.literal("loc-drop"),
13964
- fromLines: z9.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
13965
- toLines: z9.number().int().nonnegative("loc-drop toLines must be \u2265 0")
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
- callsiteCoverageAtomSchema = z9.object({
13968
- kind: z9.literal("callsite-coverage"),
13969
- symbolName: z9.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
13970
- relativeSourcePath: z9.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
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 = z9.object({
13977
- kind: z9.literal("satisfies"),
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: z9.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
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: z9.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
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: z9.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
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: z9.string().regex(
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 = z9.discriminatedUnion("kind", [
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 z10 } from "zod";
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 = z10.object({
14435
+ evidenceBaseSchema = z11.object({
14050
14436
  /** Identity string of the agent that produced this record. */
14051
- agentIdentity: z10.string().min(1),
14437
+ agentIdentity: z11.string().min(1),
14052
14438
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
14053
- attachmentSha256: z10.string().length(64),
14439
+ attachmentSha256: z11.string().length(64),
14054
14440
  /** ISO 8601 timestamp at which the action ran. */
14055
- ranAt: z10.string().datetime(),
14441
+ ranAt: z11.string().datetime(),
14056
14442
  /** Wall-clock duration of the action in milliseconds. */
14057
- durationMs: z10.number().nonnegative()
14443
+ durationMs: z11.number().nonnegative()
14058
14444
  });
14059
14445
  implDiffRecordSchema = evidenceBaseSchema.extend({
14060
- kind: z10.literal("impl-diff"),
14061
- phase: z10.literal("implement"),
14062
- filesChanged: z10.array(z10.string().min(1)).min(1),
14063
- linesAdded: z10.number().int().nonnegative(),
14064
- linesRemoved: z10.number().int().nonnegative()
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: z10.literal("validate-spec-check"),
14068
- phase: z10.literal("validate"),
14069
- reqIdsChecked: z10.array(z10.string().min(1)).min(1),
14070
- passed: z10.boolean(),
14071
- details: z10.string().min(1)
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: z10.literal("test-output"),
14075
- phase: z10.literal("test"),
14076
- command: z10.string().min(1),
14077
- exitCode: z10.number().int(),
14078
- testsPassed: z10.number().int().nonnegative(),
14079
- testsFailed: z10.number().int().nonnegative()
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: z10.literal("lint-report"),
14083
- phase: z10.enum(["implement", "test"]),
14084
- tool: z10.string().min(1),
14085
- passed: z10.boolean(),
14086
- warnings: z10.number().int().nonnegative(),
14087
- errors: z10.number().int().nonnegative()
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: z10.literal("command-output"),
14091
- phase: z10.enum(["implement", "validate", "test"]),
14092
- cmd: z10.string().min(1),
14093
- exitCode: z10.number().int()
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 = z10.discriminatedUnion("kind", [
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 z11 } from "zod";
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 = z11.enum(["project", "global"]);
15094
- LeaseLaneSchema = z11.enum(["tasks", "brain", "bulk"]);
15095
- LeaseAcquireRequestSchema = z11.object({
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: z11.literal("lease_acquire"),
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: z11.string().min(1),
15504
+ holder_id: z12.string().min(1),
15104
15505
  /** Advisory priority — lower acquires sooner. `0` = highest. */
15105
- priority: z11.number().int().min(0).max(255),
15506
+ priority: z12.number().int().min(0).max(255),
15106
15507
  /** Lease time-to-live in milliseconds. */
15107
- ttl_ms: z11.number().int().nonnegative(),
15508
+ ttl_ms: z12.number().int().nonnegative(),
15108
15509
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
15109
- reentrant: z11.boolean()
15510
+ reentrant: z12.boolean()
15110
15511
  }).strict();
15111
- LeaseReleaseRequestSchema = z11.object({
15512
+ LeaseReleaseRequestSchema = z12.object({
15112
15513
  /** Tag discriminating this request variant. */
15113
- kind: z11.literal("lease_release"),
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: z11.string().min(1),
15520
+ holder_id: z12.string().min(1),
15120
15521
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
15121
- epoch: z11.number().int().nonnegative()
15522
+ epoch: z12.number().int().nonnegative()
15122
15523
  }).strict();
15123
- LeaseRenewRequestSchema = z11.object({
15524
+ LeaseRenewRequestSchema = z12.object({
15124
15525
  /** Tag discriminating this request variant. */
15125
- kind: z11.literal("lease_renew"),
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: z11.string().min(1),
15532
+ holder_id: z12.string().min(1),
15132
15533
  /** The epoch fence the holder acquired (epoch-guarded renew). */
15133
- epoch: z11.number().int().nonnegative()
15534
+ epoch: z12.number().int().nonnegative()
15134
15535
  }).strict();
15135
- RateCheckRequestSchema = z11.object({
15536
+ RateCheckRequestSchema = z12.object({
15136
15537
  /** Tag discriminating this request variant. */
15137
- kind: z11.literal("rate_check"),
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: z11.number().int().nonnegative()
15544
+ est_bytes: z12.number().int().nonnegative()
15144
15545
  }).strict();
15145
- ToolGrantRequestSchema = z11.object({
15546
+ ToolGrantRequestSchema = z12.object({
15146
15547
  /** Tag discriminating this request variant. */
15147
- kind: z11.literal("tool_grant"),
15548
+ kind: z12.literal("tool_grant"),
15148
15549
  /** The tool name being requested. */
15149
- tool: z11.string().min(1),
15550
+ tool: z12.string().min(1),
15150
15551
  /** The requesting holder identity. */
15151
- holder_id: z11.string().min(1)
15552
+ holder_id: z12.string().min(1)
15152
15553
  }).strict();
15153
- QueuePriorityClassSchema = z11.enum(["lead", "worker", "background"]);
15154
- QueueAdmitRequestSchema = z11.object({
15554
+ QueuePriorityClassSchema = z12.enum(["lead", "worker", "background"]);
15555
+ QueueAdmitRequestSchema = z12.object({
15155
15556
  /** Tag discriminating this request variant. */
15156
- kind: z11.literal("queue_admit"),
15557
+ kind: z12.literal("queue_admit"),
15157
15558
  /** The LLM provider id the call targets (rate budget is per-provider). */
15158
- provider: z11.string().min(1),
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: z11.number().int().nonnegative(),
15563
+ est_tokens: z12.number().int().nonnegative(),
15163
15564
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
15164
- child_id: z11.string().min(1)
15565
+ child_id: z12.string().min(1)
15165
15566
  }).strict();
15166
- WorkerHeartbeatRequestSchema = z11.object({
15567
+ WorkerHeartbeatRequestSchema = z12.object({
15167
15568
  /** Tag discriminating this request variant. */
15168
- kind: z11.literal("worker_heartbeat"),
15569
+ kind: z12.literal("worker_heartbeat"),
15169
15570
  /** The logical id of the heartbeating child (matches the registry key). */
15170
- child_id: z11.string().min(1),
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: z11.boolean()
15573
+ in_flight_llm: z12.boolean()
15173
15574
  }).strict();
15174
- ResourceAdmitRequestSchema = z11.object({
15575
+ ResourceAdmitRequestSchema = z12.object({
15175
15576
  /** Tag discriminating this request variant. */
15176
- kind: z11.literal("resource_admit"),
15577
+ kind: z12.literal("resource_admit"),
15177
15578
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
15178
- class: z11.string().min(1),
15579
+ class: z12.string().min(1),
15179
15580
  /** The caller holding the slot — process/worktree-unique; the release key. */
15180
- holder_id: z11.string().min(1),
15581
+ holder_id: z12.string().min(1),
15181
15582
  /** The client-computed budget: the max concurrent holders for this class. */
15182
- budget: z11.number().int().nonnegative()
15583
+ budget: z12.number().int().nonnegative()
15183
15584
  }).strict();
15184
- ResourceReleaseRequestSchema = z11.object({
15585
+ ResourceReleaseRequestSchema = z12.object({
15185
15586
  /** Tag discriminating this request variant. */
15186
- kind: z11.literal("resource_release"),
15587
+ kind: z12.literal("resource_release"),
15187
15588
  /** The resource class the slot belongs to. */
15188
- class: z11.string().min(1),
15589
+ class: z12.string().min(1),
15189
15590
  /** The holder that was admitted (matches the admit `holder_id`). */
15190
- holder_id: z11.string().min(1)
15591
+ holder_id: z12.string().min(1)
15191
15592
  }).strict();
15192
- LeaseIpcRequestSchema = z11.discriminatedUnion("kind", [
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 = z11.object({
15604
+ LeaseGrantedResponseSchema = z12.object({
15204
15605
  /** Tag discriminating this response variant. */
15205
- kind: z11.literal("lease_granted"),
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: z11.string().min(1),
15612
+ holder_id: z12.string().min(1),
15212
15613
  /** The monotonic epoch fence assigned to this grant. */
15213
- epoch: z11.number().int().nonnegative(),
15614
+ epoch: z12.number().int().nonnegative(),
15214
15615
  /** The lease TTL in milliseconds. */
15215
- ttl_ms: z11.number().int().nonnegative(),
15616
+ ttl_ms: z12.number().int().nonnegative(),
15216
15617
  /** Absolute expiry timestamp (epoch ms) for this grant. */
15217
- expires_at_ms: z11.number().int().nonnegative()
15618
+ expires_at_ms: z12.number().int().nonnegative()
15218
15619
  }).strict();
15219
- LeaseQueuedResponseSchema = z11.object({
15620
+ LeaseQueuedResponseSchema = z12.object({
15220
15621
  /** Tag discriminating this response variant. */
15221
- kind: z11.literal("lease_queued"),
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: z11.number().int().nonnegative(),
15628
+ ticket: z12.number().int().nonnegative(),
15228
15629
  /** Number of waiters ahead of this one. */
15229
- ahead: z11.number().int().nonnegative()
15630
+ ahead: z12.number().int().nonnegative()
15230
15631
  }).strict();
15231
- LeaseDeniedResponseSchema = z11.object({
15632
+ LeaseDeniedResponseSchema = z12.object({
15232
15633
  /** Tag discriminating this response variant. */
15233
- kind: z11.literal("lease_denied"),
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: z11.string().min(1),
15638
+ code: z12.string().min(1),
15238
15639
  /** Human-readable denial message. */
15239
- message: z11.string()
15640
+ message: z12.string()
15240
15641
  }).strict();
15241
- RateResultResponseSchema = z11.object({
15642
+ RateResultResponseSchema = z12.object({
15242
15643
  /** Tag discriminating this response variant. */
15243
- kind: z11.literal("rate_result"),
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: z11.boolean(),
15648
+ ok: z12.boolean(),
15248
15649
  /** Suggested back-off in milliseconds when `ok` is false. */
15249
- retry_after_ms: z11.number().int().nonnegative(),
15650
+ retry_after_ms: z12.number().int().nonnegative(),
15250
15651
  /** Remaining token budget for the scope. */
15251
- tokens_remaining: z11.number().int().nonnegative()
15652
+ tokens_remaining: z12.number().int().nonnegative()
15252
15653
  }).strict();
15253
- ToolGrantedResponseSchema = z11.object({
15654
+ ToolGrantedResponseSchema = z12.object({
15254
15655
  /** Tag discriminating this response variant. */
15255
- kind: z11.literal("tool_granted"),
15656
+ kind: z12.literal("tool_granted"),
15256
15657
  /** The granted tool name. */
15257
- tool: z11.string().min(1),
15658
+ tool: z12.string().min(1),
15258
15659
  /** The holder the tool grant was issued to. */
15259
- holder_id: z11.string().min(1)
15660
+ holder_id: z12.string().min(1)
15260
15661
  }).strict();
15261
- LeaseRevokedResponseSchema = z11.object({
15662
+ LeaseRevokedResponseSchema = z12.object({
15262
15663
  /** Tag discriminating this response variant. */
15263
- kind: z11.literal("lease_revoked"),
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: z11.string().min(1),
15670
+ holder_id: z12.string().min(1),
15270
15671
  /** Human-readable reason for the revocation. */
15271
- reason: z11.string()
15672
+ reason: z12.string()
15272
15673
  }).strict();
15273
- ChildKilledUnresponsiveResponseSchema = z11.object({
15674
+ ChildKilledUnresponsiveResponseSchema = z12.object({
15274
15675
  /** Tag discriminating this response variant. */
15275
- kind: z11.literal("child_killed_unresponsive"),
15676
+ kind: z12.literal("child_killed_unresponsive"),
15276
15677
  /** Logical id of the killed child. */
15277
- child_id: z11.string().min(1),
15678
+ child_id: z12.string().min(1),
15278
15679
  /** The holder identity the killed child held the lease as. */
15279
- holder_id: z11.string().min(1),
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: z11.string()
15684
+ reason: z12.string()
15284
15685
  }).strict();
15285
- QueueAdmitDispositionSchema = z11.enum(["admitted", "deferred"]);
15286
- QueueAdmitResultResponseSchema = z11.object({
15686
+ QueueAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
15687
+ QueueAdmitResultResponseSchema = z12.object({
15287
15688
  /** Tag discriminating this response variant. */
15288
- kind: z11.literal("queue_admit_result"),
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: z11.number().int().nonnegative(),
15693
+ retry_after_ms: z12.number().int().nonnegative(),
15293
15694
  /** Remaining provider token budget after this decision. */
15294
- tokens_remaining: z11.number().int().nonnegative(),
15695
+ tokens_remaining: z12.number().int().nonnegative(),
15295
15696
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
15296
- queue_position: z11.number().int().nonnegative()
15697
+ queue_position: z12.number().int().nonnegative()
15297
15698
  }).strict();
15298
- HeartbeatAckResponseSchema = z11.object({
15699
+ HeartbeatAckResponseSchema = z12.object({
15299
15700
  /** Tag discriminating this response variant. */
15300
- kind: z11.literal("heartbeat_ack")
15701
+ kind: z12.literal("heartbeat_ack")
15301
15702
  }).strict();
15302
- ResourceAdmitDispositionSchema = z11.enum(["admitted", "deferred"]);
15303
- ResourceAdmitResultResponseSchema = z11.object({
15703
+ ResourceAdmitDispositionSchema = z12.enum(["admitted", "deferred"]);
15704
+ ResourceAdmitResultResponseSchema = z12.object({
15304
15705
  /** Tag discriminating this response variant. */
15305
- kind: z11.literal("resource_admit_result"),
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: z11.number().int().nonnegative(),
15710
+ retry_after_ms: z12.number().int().nonnegative(),
15310
15711
  /** Remaining slots for the class after this decision. */
15311
- slots_remaining: z11.number().int().nonnegative()
15712
+ slots_remaining: z12.number().int().nonnegative()
15312
15713
  }).strict();
15313
- ResourceReleaseResultResponseSchema = z11.object({
15714
+ ResourceReleaseResultResponseSchema = z12.object({
15314
15715
  /** Tag discriminating this response variant. */
15315
- kind: z11.literal("resource_release_result"),
15716
+ kind: z12.literal("resource_release_result"),
15316
15717
  /** Whether a held slot was actually released (false = no such holder). */
15317
- released: z11.boolean(),
15718
+ released: z12.boolean(),
15318
15719
  /** Remaining in-flight holders for the class after the release. */
15319
- slots_remaining: z11.number().int().nonnegative()
15720
+ slots_remaining: z12.number().int().nonnegative()
15320
15721
  }).strict();
15321
- LeaseErrorResponseSchema = z11.object({
15722
+ LeaseErrorResponseSchema = z12.object({
15322
15723
  /** Tag discriminating this response variant. */
15323
- kind: z11.literal("error"),
15724
+ kind: z12.literal("error"),
15324
15725
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
15325
- code: z11.string().min(1),
15726
+ code: z12.string().min(1),
15326
15727
  /** Human-readable error message. */
15327
- message: z11.string()
15728
+ message: z12.string()
15328
15729
  }).strict();
15329
- LeaseIpcResponseSchema = z11.discriminatedUnion("kind", [
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 = z11.object({
15744
+ LeaseIpcRequestEnvelopeSchema = z12.object({
15344
15745
  /** Parallel protocol version. */
15345
- protocol_version: z11.string(),
15746
+ protocol_version: z12.string(),
15346
15747
  /** Correlation id echoed back on the matching response. */
15347
- id: z11.string().min(1),
15748
+ id: z12.string().min(1),
15348
15749
  /** Direction discriminator. */
15349
- direction: z11.literal("request"),
15750
+ direction: z12.literal("request"),
15350
15751
  /** The request body. */
15351
15752
  request: LeaseIpcRequestSchema
15352
15753
  }).strict();
15353
- LeaseIpcResponseEnvelopeSchema = z11.object({
15754
+ LeaseIpcResponseEnvelopeSchema = z12.object({
15354
15755
  /** Parallel protocol version. */
15355
- protocol_version: z11.string(),
15756
+ protocol_version: z12.string(),
15356
15757
  /** Correlation id echoed from the originating request (or a fresh id for events). */
15357
- id: z11.string().min(1),
15758
+ id: z12.string().min(1),
15358
15759
  /** Direction discriminator. */
15359
- direction: z11.literal("response"),
15760
+ direction: z12.literal("response"),
15360
15761
  /** The response body. */
15361
15762
  response: LeaseIpcResponseSchema
15362
15763
  }).strict();
15363
- LeaseIpcEnvelopeSchema = z11.discriminatedUnion("direction", [
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 z12 } from "zod";
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 = z12.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15430
- semver = z12.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15431
- catalogModalitiesSchema = z12.object({
15432
- input: z12.array(z12.string()),
15433
- output: z12.array(z12.string())
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 = z12.object({
15436
- input: z12.number().optional(),
15437
- output: z12.number().optional(),
15438
- cache_read: z12.number().optional(),
15439
- cache_write: z12.number().optional(),
15440
- context_over_200k: z12.number().optional()
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 = z12.object({
15443
- context: z12.number(),
15444
- output: z12.number()
15843
+ catalogLimitSchema = z13.object({
15844
+ context: z13.number(),
15845
+ output: z13.number()
15445
15846
  }).strict();
15446
- catalogModelProviderSchema = z12.object({
15447
- npm: z12.string(),
15448
- api: z12.string()
15847
+ catalogModelProviderSchema = z13.object({
15848
+ npm: z13.string(),
15849
+ api: z13.string()
15449
15850
  }).strict();
15450
- catalogModelEntrySchema = z12.object({
15451
- id: z12.string(),
15452
- name: z12.string(),
15453
- family: z12.string(),
15454
- attachment: z12.boolean(),
15455
- reasoning: z12.boolean(),
15456
- temperature: z12.boolean(),
15457
- interleaved: z12.boolean(),
15458
- tool_call: z12.boolean(),
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: z12.enum(CATALOG_MODEL_STATUSES),
15863
+ status: z13.enum(CATALOG_MODEL_STATUSES),
15463
15864
  release_date: isoDate,
15464
15865
  provider: catalogModelProviderSchema
15465
15866
  }).strict();
15466
- catalogProviderSchema = z12.object({
15467
- id: z12.string(),
15468
- endpoint: z12.string(),
15469
- authTypes: z12.array(z12.enum(CATALOG_AUTH_TYPES)).min(1),
15470
- npm: z12.string().optional()
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 = z12.object({
15473
- $schema: z12.string().optional(),
15873
+ curatedCatalogSchema = z13.object({
15874
+ $schema: z13.string().optional(),
15474
15875
  version: semver,
15475
15876
  lastUpdated: isoDate,
15476
- providers: z12.record(z12.string(), catalogProviderSchema),
15477
- models: z12.record(z12.string(), z12.record(z12.string(), catalogModelEntrySchema))
15877
+ providers: z13.record(z13.string(), catalogProviderSchema),
15878
+ models: z13.record(z13.string(), z13.record(z13.string(), catalogModelEntrySchema))
15478
15879
  }).strict();
15479
- modelsCatalogRowInsertSchema = z12.object({
15480
- id: z12.string(),
15481
- providerId: z12.string(),
15482
- name: z12.string(),
15483
- family: z12.string(),
15484
- attachment: z12.boolean(),
15485
- reasoning: z12.boolean(),
15486
- temperature: z12.boolean(),
15487
- interleaved: z12.boolean(),
15488
- toolCall: z12.boolean(),
15489
- modalities: z12.string(),
15490
- cost: z12.string(),
15491
- contextLimit: z12.number().nullable().optional(),
15492
- outputLimit: z12.number().nullable().optional(),
15493
- status: z12.enum(CATALOG_MODEL_STATUSES),
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: z12.string(),
15496
- source: z12.string(),
15497
- seededAt: z12.string().optional()
15896
+ modelsDevId: z13.string(),
15897
+ source: z13.string(),
15898
+ seededAt: z13.string().optional()
15498
15899
  }).strict();
15499
15900
  modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
15500
- seededAt: z12.string()
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 z13 } from "zod";
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 = z13.enum(["saga", "epic", "task", "subtask"]);
15624
- taskPrioritySchema = z13.enum(["critical", "high", "medium", "low"]);
15625
- taskStatusSchema = z13.enum(TASK_STATUSES);
15626
- verificationGateSchema = z13.enum([
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 = z13.enum([
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 = z13.enum([
16044
+ workGraphTraversalDirectionSchema = z14.enum([
15644
16045
  "ancestors",
15645
16046
  "descendants",
15646
16047
  "upstream",
15647
16048
  "downstream"
15648
16049
  ]);
15649
- workGraphEdgeDirectionSchema = z13.enum(["out", "in", "both"]);
15650
- paginationParamsSchema = z13.object({
15651
- cursor: z13.string().min(1).optional(),
15652
- limit: z13.number().int().positive().max(500).optional()
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 = z13.object({
15655
- id: z13.string().min(1),
16055
+ workGraphNodeSchema = z14.object({
16056
+ id: z14.string().min(1),
15656
16057
  type: taskTypeSchema,
15657
- title: z13.string(),
16058
+ title: z14.string(),
15658
16059
  status: taskStatusSchema,
15659
16060
  priority: taskPrioritySchema,
15660
- parentId: z13.string().min(1).optional()
16061
+ parentId: z14.string().min(1).optional()
15661
16062
  });
15662
- workGraphEdgeSchema = z13.object({
15663
- fromId: z13.string().min(1),
15664
- toId: z13.string().min(1),
16063
+ workGraphEdgeSchema = z14.object({
16064
+ fromId: z14.string().min(1),
16065
+ toId: z14.string().min(1),
15665
16066
  kind: workGraphRelationKindSchema
15666
16067
  });
15667
- workGraphHierarchyEdgeSchema = z13.object({
15668
- fromId: z13.string().min(1),
15669
- toId: z13.string().min(1),
15670
- kind: z13.literal("contains")
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 = z13.object({
15673
- nextCursor: z13.string().min(1).optional(),
15674
- hasMore: z13.boolean()
15675
- });
15676
- workGraphRollupCountsSchema = z13.object({
15677
- total: z13.number().int().nonnegative(),
15678
- byStatus: z13.partialRecord(taskStatusSchema, z13.number().int().nonnegative()),
15679
- byType: z13.partialRecord(taskTypeSchema, z13.number().int().nonnegative())
15680
- });
15681
- workGraphSubtreePercentagesSchema = z13.object({
15682
- done: z13.number().nonnegative(),
15683
- active: z13.number().nonnegative(),
15684
- blocked: z13.number().nonnegative(),
15685
- pending: z13.number().nonnegative(),
15686
- cancelled: z13.number().nonnegative()
15687
- });
15688
- workGraphProjectionMismatchSchema = z13.object({
15689
- field: z13.string().min(1),
15690
- expected: z13.number().int().nonnegative(),
15691
- actual: z13.number().int().nonnegative()
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: z13.string().min(1).optional(),
15695
- dependencyBlockers: z13.array(z13.object({ taskId: z13.string().min(1), status: taskStatusSchema })),
15696
- gateBlockers: z13.array(z13.object({ gate: verificationGateSchema }))
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: z13.literal("relation"),
15700
- relationType: z13.enum(TASK_RELATION_TYPES),
15701
- reason: z13.string().min(1).optional()
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: z13.literal("dependency"),
15705
- kind: z13.literal("depends_on")
16105
+ source: z14.literal("dependency"),
16106
+ kind: z14.literal("depends_on")
15706
16107
  });
15707
- workGraphOmissionReasonSchema = z13.enum([
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 = z13.object({
15715
- tokenBudget: z13.number().int().nonnegative(),
15716
- estimatedTokens: z13.number().int().nonnegative(),
15717
- remainingTokens: z13.number().int().nonnegative(),
15718
- truncated: z13.boolean()
15719
- });
15720
- workGraphOmissionSchema = z13.object({
15721
- path: z13.string().min(1),
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: z13.string().min(1),
15724
- estimatedTokens: z13.number().int().nonnegative().optional()
16124
+ message: z14.string().min(1),
16125
+ estimatedTokens: z14.number().int().nonnegative().optional()
15725
16126
  });
15726
- workGraphDirectEdgeSchema = z13.discriminatedUnion("source", [
16127
+ workGraphDirectEdgeSchema = z14.discriminatedUnion("source", [
15727
16128
  workGraphRelationEdgeSchema,
15728
16129
  workGraphDependencyEdgeSchema
15729
16130
  ]);
15730
16131
  workGraphContextPackParamsSchema = paginationParamsSchema.extend({
15731
- rootId: z13.string().min(1),
15732
- tokenBudget: z13.number().int().positive().optional(),
15733
- includeRelations: z13.boolean().optional(),
15734
- includeReadiness: z13.boolean().optional(),
15735
- includeRollup: z13.boolean().optional()
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: z13.string().min(1),
16139
+ rootId: z14.string().min(1),
15739
16140
  direction: workGraphTraversalDirectionSchema.optional(),
15740
- maxDepth: z13.number().int().nonnegative().optional(),
15741
- includeRelations: z13.boolean().optional()
16141
+ maxDepth: z14.number().int().nonnegative().optional(),
16142
+ includeRelations: z14.boolean().optional()
15742
16143
  });
15743
- workGraphSliceSchema = z13.object({
15744
- rootId: z13.string().min(1),
16144
+ workGraphSliceSchema = z14.object({
16145
+ rootId: z14.string().min(1),
15745
16146
  direction: workGraphTraversalDirectionSchema,
15746
- nodes: z13.array(workGraphNodeSchema),
15747
- edges: z13.array(workGraphEdgeSchema),
16147
+ nodes: z14.array(workGraphNodeSchema),
16148
+ edges: z14.array(workGraphEdgeSchema),
15748
16149
  pageInfo: workGraphPageInfoSchema,
15749
- omissions: z13.array(workGraphOmissionSchema).optional()
15750
- });
15751
- workGraphReadinessParamsSchema = z13.object({
15752
- rootId: z13.string().min(1),
15753
- role: z13.string().min(1).optional(),
15754
- includeGateBlockers: z13.boolean().optional()
15755
- });
15756
- workGraphReadinessResultSchema = z13.object({
15757
- rootId: z13.string().min(1),
15758
- role: z13.string().min(1).optional(),
15759
- ready: z13.boolean(),
15760
- warnings: z13.array(z13.string()),
15761
- groups: z13.object({
15762
- ready: z13.array(workGraphReadyFrontierTaskSchema),
15763
- blocked: z13.array(workGraphReadyFrontierTaskSchema),
15764
- blockedBy: z13.array(
15765
- z13.discriminatedUnion("kind", [
15766
- z13.object({
15767
- kind: z13.literal("dependency"),
15768
- blockerId: z13.string().min(1),
15769
- blocks: z13.array(z13.string().min(1))
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
- z13.object({
15772
- kind: z13.literal("gate"),
16172
+ z14.object({
16173
+ kind: z14.literal("gate"),
15773
16174
  gate: verificationGateSchema,
15774
- blocks: z13.array(z13.string().min(1))
16175
+ blocks: z14.array(z14.string().min(1))
15775
16176
  })
15776
16177
  ])
15777
16178
  )
15778
16179
  })
15779
16180
  });
15780
- workGraphContextPackSchema = z13.object({
15781
- rootId: z13.string().min(1),
15782
- generatedAt: z13.string().min(1),
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: z13.object({
15786
- rootId: z13.string().min(1),
16186
+ relationEdges: z14.object({
16187
+ rootId: z14.string().min(1),
15787
16188
  direction: workGraphEdgeDirectionSchema,
15788
- edges: z13.array(workGraphDirectEdgeSchema)
16189
+ edges: z14.array(workGraphDirectEdgeSchema)
15789
16190
  }).optional(),
15790
16191
  readiness: workGraphReadinessResultSchema.optional(),
15791
- rollup: z13.lazy(() => tasksRollupResultSchema).optional(),
15792
- omissions: z13.array(workGraphOmissionSchema)
15793
- });
15794
- workGraphScaffoldValidateParamsSchema = z13.object({
15795
- rootId: z13.string().min(1),
15796
- nodes: z13.array(
15797
- z13.object({
15798
- id: z13.string().min(1),
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: z13.string().min(1).nullable().optional()
16201
+ parentId: z14.string().min(1).nullable().optional()
15801
16202
  })
15802
16203
  ),
15803
- edges: z13.array(workGraphDirectEdgeSchema).optional(),
15804
- dryRun: z13.boolean().optional()
15805
- });
15806
- workGraphScaffoldValidationIssueSchema = z13.object({
15807
- code: z13.string().min(1),
15808
- message: z13.string().min(1),
15809
- taskId: z13.string().min(1).optional(),
15810
- severity: z13.enum(["error", "warning"])
15811
- });
15812
- workGraphScaffoldValidateResultSchema = z13.object({
15813
- rootId: z13.string().min(1),
15814
- valid: z13.boolean(),
15815
- dryRun: z13.boolean(),
15816
- issues: z13.array(workGraphScaffoldValidationIssueSchema),
15817
- hierarchy: z13.object({
15818
- valid: z13.boolean(),
15819
- violations: z13.array(
15820
- z13.object({
15821
- code: z13.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15822
- taskId: z13.string().min(1),
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: z13.string().min(1).nullable(),
16225
+ parentId: z14.string().min(1).nullable(),
15825
16226
  parentType: taskTypeSchema.optional(),
15826
- message: z13.string().min(1)
16227
+ message: z14.string().min(1)
15827
16228
  })
15828
16229
  )
15829
16230
  })
15830
16231
  });
15831
16232
  workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
15832
- apply: z13.boolean().optional()
16233
+ apply: z14.boolean().optional()
15833
16234
  });
15834
16235
  workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
15835
- applied: z13.boolean(),
15836
- nodesChanged: z13.number().int().nonnegative(),
15837
- edgesChanged: z13.number().int().nonnegative()
15838
- });
15839
- workGraphPlanningDocParamsSchema = z13.object({
15840
- rootId: z13.string().min(1),
15841
- audience: z13.enum(["agent", "maintainer"]),
15842
- tokenBudget: z13.number().int().positive().optional(),
15843
- includeRelations: z13.boolean().optional(),
15844
- includeReadiness: z13.boolean().optional(),
15845
- includeRollup: z13.boolean().optional()
15846
- });
15847
- workGraphPlanningDocSchema = z13.object({
15848
- rootId: z13.string().min(1),
15849
- generatedAt: z13.string().min(1),
15850
- audience: z13.enum(["agent", "maintainer"]),
15851
- title: z13.string().min(1),
15852
- content: z13.string(),
15853
- sections: z13.array(z13.string().min(1)),
15854
- estimatedTokens: z13.number().int().nonnegative(),
15855
- budget: z13.object({
15856
- tokenBudget: z13.number().int().positive(),
15857
- truncated: z13.boolean()
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: z13.string().min(1),
16262
+ rootId: z14.string().min(1),
15862
16263
  direction: workGraphTraversalDirectionSchema,
15863
- maxDepth: z13.number().int().nonnegative().optional(),
15864
- includeRelations: z13.boolean().optional()
16264
+ maxDepth: z14.number().int().nonnegative().optional(),
16265
+ includeRelations: z14.boolean().optional()
15865
16266
  });
15866
- tasksTraverseResultSchema = z13.object({
15867
- rootId: z13.string().min(1),
16267
+ tasksTraverseResultSchema = z14.object({
16268
+ rootId: z14.string().min(1),
15868
16269
  direction: workGraphTraversalDirectionSchema,
15869
- nodes: z13.array(workGraphNodeSchema),
15870
- edges: z13.array(workGraphEdgeSchema),
16270
+ nodes: z14.array(workGraphNodeSchema),
16271
+ edges: z14.array(workGraphEdgeSchema),
15871
16272
  pageInfo: workGraphPageInfoSchema
15872
16273
  });
15873
16274
  tasksTreeParamsSchema = paginationParamsSchema.extend({
15874
- rootId: z13.string().min(1),
15875
- maxDepth: z13.number().int().nonnegative().optional()
16275
+ rootId: z14.string().min(1),
16276
+ maxDepth: z14.number().int().nonnegative().optional()
15876
16277
  });
15877
- tasksTreeResultSchema = z13.object({
15878
- rootId: z13.string().min(1),
15879
- nodes: z13.array(workGraphNodeSchema.extend({ depth: z13.number().int().positive() })),
15880
- edges: z13.array(workGraphHierarchyEdgeSchema),
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 = z13.object({
15884
- rootId: z13.string().min(1),
16284
+ tasksRollupParamsSchema = z14.object({
16285
+ rootId: z14.string().min(1),
15885
16286
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
15886
16287
  });
15887
- tasksRollupResultSchema = z13.object({
15888
- rootId: z13.string().min(1),
16288
+ tasksRollupResultSchema = z14.object({
16289
+ rootId: z14.string().min(1),
15889
16290
  direct: workGraphRollupCountsSchema,
15890
16291
  subtree: workGraphRollupCountsSchema,
15891
- percentDenominator: z13.object({
15892
- basis: z13.literal("subtree-total"),
15893
- total: z13.number().int().nonnegative(),
15894
- description: z13.string().min(1)
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: z13.boolean(),
15898
- projectionMismatches: z13.array(workGraphProjectionMismatchSchema)
15899
- });
15900
- tasksFrontierParamsSchema = z13.object({
15901
- rootId: z13.string().min(1),
15902
- role: z13.string().min(1).optional()
15903
- });
15904
- tasksFrontierResultSchema = z13.object({
15905
- rootId: z13.string().min(1),
15906
- role: z13.string().min(1).optional(),
15907
- groups: z13.object({
15908
- ready: z13.array(workGraphReadyFrontierTaskSchema),
15909
- blocked: z13.array(workGraphReadyFrontierTaskSchema),
15910
- blockedBy: z13.array(
15911
- z13.discriminatedUnion("kind", [
15912
- z13.object({
15913
- kind: z13.literal("dependency"),
15914
- blockerId: z13.string().min(1),
15915
- blocks: z13.array(z13.string().min(1))
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
- z13.object({
15918
- kind: z13.literal("gate"),
16318
+ z14.object({
16319
+ kind: z14.literal("gate"),
15919
16320
  gate: verificationGateSchema,
15920
- blocks: z13.array(z13.string().min(1))
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: z13.string().min(1),
15928
- maxDepth: z13.number().int().nonnegative().optional(),
15929
- includeRelations: z13.boolean().optional()
15930
- });
15931
- tasksWorkGraphAuditResultSchema = z13.object({
15932
- rootId: z13.string().min(1),
15933
- hierarchy: z13.object({
15934
- valid: z13.boolean(),
15935
- violations: z13.array(
15936
- z13.object({
15937
- code: z13.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15938
- taskId: z13.string().min(1),
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: z13.string().min(1).nullable(),
16341
+ parentId: z14.string().min(1).nullable(),
15941
16342
  parentType: taskTypeSchema.optional(),
15942
- message: z13.string().min(1)
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: z13.object({
15950
- rootId: z13.string().min(1),
16350
+ relationEdges: z14.object({
16351
+ rootId: z14.string().min(1),
15951
16352
  direction: workGraphEdgeDirectionSchema,
15952
- edges: z13.array(
15953
- z13.discriminatedUnion("source", [
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 z14 } from "zod";
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 = z14.object({
15981
- version: z14.literal(1),
15982
- operation: z14.literal("docs.projection"),
15983
- identity: z14.object({
15984
- projectId: z14.string().min(1),
15985
- projectRoot: z14.string().min(1),
15986
- actor: z14.string().min(1),
15987
- operation: z14.literal("docs.projection"),
15988
- idempotencyKey: z14.string().min(1)
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: z14.object({
15991
- attachmentId: z14.string().min(1),
15992
- sha256: z14.string().regex(/^[a-f0-9]{64}$/),
15993
- ownerId: z14.string().min(1),
15994
- ownerType: z14.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
15995
- label: z14.string().min(1)
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: z14.object({
15998
- kind: z14.literal("doc-attachment"),
15999
- attachmentId: z14.string().min(1),
16000
- ownerId: z14.string().min(1),
16001
- addedAt: z14.string().min(1),
16002
- slug: z14.string().optional(),
16003
- type: z14.string().optional()
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 = z14.object({
16007
- version: z14.literal(1),
16008
- sourceHash: z14.string().regex(/^[a-f0-9]{64}$/),
16009
- graph: z14.enum(["completed", "disabled"]),
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: z14.string().min(1).optional(),
16412
+ observationId: z15.string().min(1).optional(),
16012
16413
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
16013
- documents: z14.literal(true).optional(),
16014
- verifiedAt: z14.string().min(1),
16015
- actor: z14.string().min(1)
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 z15 } from "zod";
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 = z15.object({
16029
- title: z15.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
16030
- acceptance: z15.array(z15.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), {
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: z15.string().optional(),
16034
- parentId: z15.string().optional(),
16035
- depends: z15.array(z15.string()).optional()
16434
+ id: z16.string().optional(),
16435
+ parentId: z16.string().optional(),
16436
+ depends: z16.array(z16.string()).optional()
16036
16437
  });
16037
- taskTreeSchema = z15.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" });
16038
- evidenceSchema = z15.unknown().superRefine((value, ctx) => {
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 = z15.unknown();
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 z16 } from "zod";
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 = z16.object({
16363
- kind: z16.literal("pr"),
16364
- prNumber: z16.number().int().positive()
16365
- });
16366
- prEvidenceStateModifierSchema = z16.object({
16367
- kind: z16.literal("state"),
16368
- value: z16.literal("MERGED")
16369
- });
16370
- ghPrViewSchema = z16.object({
16371
- state: z16.enum(["OPEN", "CLOSED", "MERGED"]),
16372
- mergedAt: z16.string().nullable(),
16373
- headRefOid: z16.string().optional(),
16374
- mergeCommit: z16.object({ oid: z16.string() }).nullable().optional(),
16375
- title: z16.string().optional(),
16376
- body: z16.string().optional(),
16377
- headRefName: z16.string().optional(),
16378
- files: z16.array(z16.object({ path: z16.string() })).optional(),
16379
- changedFiles: z16.number().int().nonnegative().optional(),
16380
- mergeable: z16.string().optional(),
16381
- statusCheckRollup: z16.array(
16382
- z16.object({
16383
- __typename: z16.string().optional(),
16384
- name: z16.string().optional(),
16385
- workflowName: z16.string().optional(),
16386
- conclusion: z16.string().nullable().optional(),
16387
- status: z16.string().optional(),
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: z16.string().nullable().optional(),
16790
+ startedAt: z17.string().nullable().optional(),
16390
16791
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
16391
- completedAt: z16.string().nullable().optional()
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 z17 } from "zod";
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 = z17.enum(RELEASE_CHANNEL);
16449
- ReleaseSchemeSchema = z17.enum(RELEASE_SCHEME);
16450
- ReleaseKindSchema = z17.enum(RELEASE_KIND);
16451
- ReleaseStatusSchema = z17.enum(RELEASE_STATUS);
16452
- GateStatusSchema = z17.enum(GATE_STATUS);
16453
- GateNameSchema = z17.enum(GATE_NAME);
16454
- PlatformTupleSchema = z17.enum(PLATFORM_TUPLE);
16455
- PublisherSchema = z17.enum(PUBLISHER);
16456
- TaskKindSchema = z17.enum(TASK_KIND);
16457
- ImpactSchema = z17.enum(IMPACT);
16458
- ResolvedSourceSchema = z17.enum(RESOLVED_SOURCE);
16459
- Iso8601 = z17.iso.datetime({ offset: true });
16460
- NonEmptyString = z17.string().min(1);
16461
- ReleasePlanTaskSchema = z17.object({
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: z17.string(),
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: z17.array(NonEmptyString),
16877
+ evidenceAtoms: z18.array(NonEmptyString),
16477
16878
  /** IVTR phase at plan time — informational only per R-316. */
16478
- ivtrPhaseAtPlan: z17.string().optional(),
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 = z17.object({
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: z17.string().optional(),
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 = z17.object({
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: z17.boolean().default(true).optional()
16905
+ smoke: z18.boolean().default(true).optional()
16505
16906
  });
16506
- ReleasePreflightSummarySchema = z17.object({
16907
+ ReleasePreflightSummarySchema = z18.object({
16507
16908
  /** True if esbuild externals are out of sync with package.json. */
16508
- esbuildExternalsDrift: z17.boolean(),
16909
+ esbuildExternalsDrift: z18.boolean(),
16509
16910
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
16510
- lockfileDrift: z17.boolean(),
16911
+ lockfileDrift: z18.boolean(),
16511
16912
  /** True if all epic children are in terminal lifecycle states. */
16512
- epicCompletenessClean: z17.boolean(),
16913
+ epicCompletenessClean: z18.boolean(),
16513
16914
  /** True if no task appears in multiple in-flight release plans. */
16514
- doubleListingClean: z17.boolean(),
16915
+ doubleListingClean: z18.boolean(),
16515
16916
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
16516
- preflightWarnings: z17.array(z17.string()).default([]).optional()
16917
+ preflightWarnings: z18.array(z18.string()).default([]).optional()
16517
16918
  });
16518
- ReleasePlanChangelogSchema = z17.object({
16919
+ ReleasePlanChangelogSchema = z18.object({
16519
16920
  /** `kind=feat` tasks. */
16520
- features: z17.array(NonEmptyString).default([]),
16921
+ features: z18.array(NonEmptyString).default([]),
16521
16922
  /** `kind=fix` or `kind=hotfix` tasks. */
16522
- fixes: z17.array(NonEmptyString).default([]),
16923
+ fixes: z18.array(NonEmptyString).default([]),
16523
16924
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
16524
- chores: z17.array(NonEmptyString).default([]),
16925
+ chores: z18.array(NonEmptyString).default([]),
16525
16926
  /** `kind=breaking` or `kind=revert` tasks. */
16526
- breaking: z17.array(NonEmptyString).default([])
16927
+ breaking: z18.array(NonEmptyString).default([])
16527
16928
  });
16528
- ReleasePlanMetaSchema = z17.object({
16929
+ ReleasePlanMetaSchema = z18.object({
16529
16930
  /** True if this is the project's first ever release. */
16530
- firstEverRelease: z17.boolean().optional(),
16931
+ firstEverRelease: z18.boolean().optional(),
16531
16932
  /** Canonical tool names that could not be resolved at plan time. */
16532
- unresolvedTools: z17.array(z17.string()).optional(),
16933
+ unresolvedTools: z18.array(z18.string()).optional(),
16533
16934
  /** Project archetype detected at plan time. */
16534
- archetype: z17.string().optional()
16535
- }).catchall(z17.unknown());
16536
- ReleasePlanSchema = z17.object({
16935
+ archetype: z18.string().optional()
16936
+ }).catchall(z18.unknown());
16937
+ ReleasePlanSchema = z18.object({
16537
16938
  /** Schema URL for this plan version. */
16538
- $schema: z17.string().optional(),
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: z17.boolean(),
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: z17.boolean().optional(),
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: z17.string().nullable(),
16970
+ previousVersion: z18.string().nullable(),
16570
16971
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
16571
- previousTag: z17.string().nullable(),
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: z17.array(ReleasePlanTaskSchema),
16976
+ tasks: z18.array(ReleasePlanTaskSchema),
16576
16977
  /** Bucketed changelog. */
16577
16978
  changelog: ReleasePlanChangelogSchema,
16578
16979
  /** Per-gate verification status. */
16579
- gates: z17.array(ReleaseGateSchema),
16980
+ gates: z18.array(ReleaseGateSchema),
16580
16981
  /** Platform / publisher matrix. */
16581
- platformMatrix: z17.array(ReleasePlatformMatrixEntrySchema),
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: z17.string().nullable(),
16986
+ workflowRunUrl: z18.string().nullable(),
16586
16987
  /** URL of the bump PR (populated by `cleo release open`). */
16587
- prUrl: z17.string().nullable(),
16988
+ prUrl: z18.string().nullable(),
16588
16989
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
16589
- mergeCommitSha: z17.string().nullable(),
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 z18 } from "zod";
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 = z18.object({
17080
+ sessionJournalDoctorSummarySchema = z19.object({
16680
17081
  /** `true` when zero noise patterns were detected. */
16681
- isClean: z18.boolean(),
17082
+ isClean: z19.boolean(),
16682
17083
  /** Total number of noise findings across all patterns. */
16683
- findingsCount: z18.number().int().nonnegative(),
17084
+ findingsCount: z19.number().int().nonnegative(),
16684
17085
  /** Pattern names that were detected (empty when isClean). */
16685
- patterns: z18.array(z18.string()),
17086
+ patterns: z19.array(z19.string()),
16686
17087
  /** Total brain entries scanned. `0` = empty or unavailable. */
16687
- totalScanned: z18.number().int().nonnegative()
17088
+ totalScanned: z19.number().int().nonnegative()
16688
17089
  });
16689
- sessionJournalDebriefSummarySchema = z18.object({
17090
+ sessionJournalDebriefSummarySchema = z19.object({
16690
17091
  /** First 200 characters of the session end note (if provided). */
16691
- noteExcerpt: z18.string().max(200).optional(),
17092
+ noteExcerpt: z19.string().max(200).optional(),
16692
17093
  /** Number of tasks completed during the session. */
16693
- tasksCompletedCount: z18.number().int().nonnegative(),
17094
+ tasksCompletedCount: z19.number().int().nonnegative(),
16694
17095
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
16695
- tasksFocused: z18.array(z18.string()).max(5).optional()
17096
+ tasksFocused: z19.array(z19.string()).max(5).optional()
16696
17097
  });
16697
- sessionJournalEntrySchema = z18.object({
17098
+ sessionJournalEntrySchema = z19.object({
16698
17099
  // Identity
16699
17100
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
16700
- schemaVersion: z18.literal(SESSION_JOURNAL_SCHEMA_VERSION),
17101
+ schemaVersion: z19.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16701
17102
  /** ISO 8601 timestamp when the entry was written. */
16702
- timestamp: z18.string(),
17103
+ timestamp: z19.string(),
16703
17104
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
16704
- sessionId: z18.string(),
17105
+ sessionId: z19.string(),
16705
17106
  /** Event type that triggered this journal entry. */
16706
- eventType: z18.enum(["session_start", "session_end", "observation", "decision", "error"]),
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: z18.string().optional(),
17110
+ agentIdentifier: z19.string().optional(),
16710
17111
  /** Provider adapter ID active for this session. */
16711
- providerId: z18.string().optional(),
17112
+ providerId: z19.string().optional(),
16712
17113
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
16713
- scope: z18.string().optional(),
17114
+ scope: z19.string().optional(),
16714
17115
  // Session-end fields
16715
17116
  /** Duration of the session in seconds (session_end only). */
16716
- duration: z18.number().int().nonnegative().optional(),
17117
+ duration: z19.number().int().nonnegative().optional(),
16717
17118
  /** Task IDs (not titles) completed during the session. */
16718
- tasksCompleted: z18.array(z18.string()).optional(),
17119
+ tasksCompleted: z19.array(z19.string()).optional(),
16719
17120
  // Doctor summary (T1262 absorbed)
16720
- /** Compact result of `scanBrainNoise` run at session-end. */
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: z18.string().optional()
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 z19 } from "zod";
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 = z19.object({
16746
- kind: z19.literal("file"),
16747
- sha256: z19.string().length(64),
16748
- timestamp: z19.string().datetime(),
16749
- path: z19.string().min(1),
16750
- mime: z19.string().optional(),
16751
- description: z19.string().optional()
16752
- });
16753
- logEvidenceSchema = z19.object({
16754
- kind: z19.literal("log"),
16755
- sha256: z19.string().length(64),
16756
- timestamp: z19.string().datetime(),
16757
- source: z19.string().min(1),
16758
- description: z19.string().optional()
16759
- });
16760
- screenshotEvidenceSchema = z19.object({
16761
- kind: z19.literal("screenshot"),
16762
- sha256: z19.string().length(64),
16763
- timestamp: z19.string().datetime(),
16764
- mime: z19.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16765
- description: z19.string().optional()
16766
- });
16767
- testOutputEvidenceSchema = z19.object({
16768
- kind: z19.literal("test-output"),
16769
- sha256: z19.string().length(64),
16770
- timestamp: z19.string().datetime(),
16771
- passed: z19.number().int().nonnegative(),
16772
- failed: z19.number().int().nonnegative(),
16773
- skipped: z19.number().int().nonnegative(),
16774
- exitCode: z19.number().int(),
16775
- description: z19.string().optional()
16776
- });
16777
- commandOutputEvidenceSchema = z19.object({
16778
- kind: z19.literal("command-output"),
16779
- sha256: z19.string().length(64),
16780
- timestamp: z19.string().datetime(),
16781
- cmd: z19.string().min(1),
16782
- exitCode: z19.number().int(),
16783
- description: z19.string().optional()
16784
- });
16785
- taskEvidenceSchema = z19.discriminatedUnion("kind", [
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 z20 } from "zod";
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 = z20.enum([
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 z21 } from "zod";
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 = z21.enum(["info", "warning"]);
16821
- taskMutationWarningSchema = z21.object({
16822
- code: z21.string().min(1),
16823
- message: z21.string().min(1),
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: z21.string().min(1).optional(),
16826
- field: z21.string().min(1).optional(),
16827
- index: z21.number().int().nonnegative().optional()
16828
- });
16829
- taskMutationDryRunSummarySchema = z21.object({
16830
- dryRun: z21.literal(true),
16831
- wouldCreate: z21.number().int().nonnegative(),
16832
- wouldUpdate: z21.number().int().nonnegative(),
16833
- wouldDelete: z21.number().int().nonnegative(),
16834
- wouldAffect: z21.number().int().nonnegative(),
16835
- validatedCount: z21.number().int().nonnegative(),
16836
- insertedCount: z21.literal(0),
16837
- updatedCount: z21.literal(0),
16838
- deletedCount: z21.literal(0),
16839
- warnings: z21.array(taskMutationWarningSchema)
16840
- });
16841
- taskMutationTaskRecordSchema = z21.object({ id: z21.string().min(1) }).passthrough();
16842
- taskMutationEnvelopeSchema = z21.object({
16843
- dryRun: z21.boolean().optional(),
16844
- created: z21.array(taskMutationTaskRecordSchema),
16845
- updated: z21.array(taskMutationTaskRecordSchema),
16846
- deleted: z21.array(taskMutationTaskRecordSchema),
16847
- affectedCount: z21.number().int().nonnegative(),
16848
- mutationWarnings: z21.array(taskMutationWarningSchema),
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 = z21.enum(TASK_STATUSES);
16852
- completionCriterionKindSchema = z21.enum(["text", "evidence_bound", "child_task"]);
16853
- completionCriterionStatusSchema = z21.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16854
- completionBlockerReasonSchema = z21.enum([
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 = z21.enum(["done_parent_has_unsatisfied_criteria"]);
16863
- completionProjectionRepairErrorCodeSchema = z21.enum([
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 = z21.object({
16870
- criterionAcId: z21.string().min(1),
16871
- childTaskId: z21.string().min(1),
16872
- reason: z21.string().min(1),
16873
- actor: z21.string().min(1),
16874
- waivedAt: z21.string().min(1)
16875
- });
16876
- completionCriterionReplacementSchema = z21.object({
16877
- criterionAcId: z21.string().min(1),
16878
- originalChildTaskId: z21.string().min(1),
16879
- replacementChildTaskId: z21.string().min(1),
16880
- reason: z21.string().min(1),
16881
- actor: z21.string().min(1),
16882
- replacedAt: z21.string().min(1)
16883
- });
16884
- completionCriterionEvaluationSchema = z21.object({
16885
- acId: z21.string().min(1),
16886
- alias: z21.string().min(1),
16887
- text: z21.string(),
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: z21.string().min(1).optional(),
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: z21.number().int().nonnegative()
17303
+ evidenceBindings: z22.number().int().nonnegative()
16897
17304
  });
16898
17305
  unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
16899
- status: z21.literal("unsatisfied"),
17306
+ status: z22.literal("unsatisfied"),
16900
17307
  reason: completionBlockerReasonSchema
16901
17308
  });
16902
- completionTotalsSchema = z21.object({
16903
- criteria: z21.number().int().nonnegative(),
16904
- satisfied: z21.number().int().nonnegative(),
16905
- unsatisfied: z21.number().int().nonnegative(),
16906
- waived: z21.number().int().nonnegative(),
16907
- replaced: z21.number().int().nonnegative()
16908
- });
16909
- completionContextPackSchema = z21.object({
16910
- taskId: z21.string().min(1),
16911
- generatedAt: z21.string().min(1),
16912
- source: z21.literal("audit_log"),
16913
- window: z21.object({
16914
- limit: z21.number().int().positive(),
16915
- since: z21.string().min(1).optional(),
16916
- relationDepth: z21.number().int().nonnegative(),
16917
- relatedTaskIds: z21.array(z21.string().min(1))
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: z21.array(
16920
- z21.object({
16921
- id: z21.string().min(1),
16922
- timestamp: z21.string().min(1),
16923
- action: z21.enum([
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: z21.string().min(1),
16932
- relation: z21.enum(["self", "parent", "child", "sibling", "related"]),
16933
- actor: z21.string().min(1),
16934
- details: z21.record(z21.string(), z21.unknown()).optional(),
16935
- before: z21.record(z21.string(), z21.unknown()).optional(),
16936
- after: z21.record(z21.string(), z21.unknown()).optional()
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: z21.object({
16940
- totalEvents: z21.number().int().nonnegative(),
16941
- byAction: z21.record(z21.string(), z21.number().int().nonnegative()),
16942
- byRelation: z21.record(z21.string(), z21.number().int().nonnegative()),
16943
- latestEventAt: z21.string().nullable()
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 = z21.object({
16947
- taskId: z21.string().min(1),
17353
+ completionEvaluationSchema = z22.object({
17354
+ taskId: z22.string().min(1),
16948
17355
  taskStatus: completionTaskStatusSchema,
16949
- ready: z21.boolean(),
16950
- stale: z21.boolean(),
16951
- staleReasons: z21.array(completionStaleReasonSchema),
17356
+ ready: z22.boolean(),
17357
+ stale: z22.boolean(),
17358
+ staleReasons: z22.array(completionStaleReasonSchema),
16952
17359
  contextPack: completionContextPackSchema.optional(),
16953
- satisfied: z21.array(completionCriterionEvaluationSchema),
16954
- unsatisfied: z21.array(unsatisfiedCompletionCriterionSchema),
16955
- waived: z21.array(completionCriterionEvaluationSchema),
16956
- replaced: z21.array(completionCriterionEvaluationSchema),
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 = z21.object({
16960
- taskId: z21.string().min(1),
16961
- ready: z21.boolean(),
16962
- stale: z21.boolean(),
16963
- summary: z21.string(),
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: z21.array(completionCriterionEvaluationSchema)
17372
+ blockers: z22.array(completionCriterionEvaluationSchema)
16966
17373
  });
16967
- completionListParamsSchema = z21.object({
16968
- taskId: z21.string().min(1),
17374
+ completionListParamsSchema = z22.object({
17375
+ taskId: z22.string().min(1),
16969
17376
  status: completionCriterionStatusSchema.optional(),
16970
17377
  kind: completionCriterionKindSchema.optional()
16971
17378
  });
16972
- completionListResultSchema = z21.object({
16973
- taskId: z21.string().min(1),
16974
- criteria: z21.array(completionCriterionEvaluationSchema),
17379
+ completionListResultSchema = z22.object({
17380
+ taskId: z22.string().min(1),
17381
+ criteria: z22.array(completionCriterionEvaluationSchema),
16975
17382
  totals: completionTotalsSchema
16976
17383
  });
16977
- completionEvaluateParamsSchema = z21.object({
16978
- taskId: z21.string().min(1),
16979
- includeContext: z21.boolean().optional(),
16980
- limit: z21.number().int().positive().optional(),
16981
- since: z21.string().min(1).optional(),
16982
- relationDepth: z21.number().int().nonnegative().optional()
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 = z21.object({
17391
+ completionProjectionRepairErrorSchema = z22.object({
16985
17392
  code: completionProjectionRepairErrorCodeSchema,
16986
- message: z21.string().min(1),
16987
- taskId: z21.string().min(1),
16988
- acId: z21.string().min(1).optional(),
16989
- evidenceAtomId: z21.string().min(1).optional()
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 = z21.object({
16992
- taskId: z21.string().min(1),
16993
- dryRun: z21.boolean().optional()
17398
+ completionProjectionRepairParamsSchema = z22.object({
17399
+ taskId: z22.string().min(1),
17400
+ dryRun: z22.boolean().optional()
16994
17401
  });
16995
- completionProjectionRepairResultSchema = z21.object({
16996
- taskId: z21.string().min(1),
16997
- repaired: z21.boolean(),
16998
- dryRun: z21.boolean(),
16999
- staleBefore: z21.boolean(),
17000
- staleAfter: z21.boolean(),
17001
- errors: z21.array(completionProjectionRepairErrorSchema)
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 z22 } from "zod";
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 = z22.object({
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: z22.string().min(1, "placeholder name must be non-empty"),
17945
+ name: z23.string().min(1, "placeholder name must be non-empty"),
17539
17946
  /** Resolver source the installer consults for this placeholder. */
17540
- source: z22.enum(PLACEHOLDER_SOURCES),
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: z22.string().min(1, "placeholder sourcePath must be non-empty"),
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: z22.union([z22.string(), z22.number(), z22.boolean(), z22.null()]).optional()
17958
+ defaultValue: z23.union([z23.string(), z23.number(), z23.boolean(), z23.null()]).optional()
17552
17959
  });
17553
- TemplateManifestEntrySchema = z22.object({
17960
+ TemplateManifestEntrySchema = z23.object({
17554
17961
  /** Stable identifier for this template entry. */
17555
- id: z22.string().min(1, "id must be non-empty"),
17962
+ id: z23.string().min(1, "id must be non-empty"),
17556
17963
  /** Category of file this template represents. */
17557
- kind: z22.enum(TEMPLATE_KINDS),
17964
+ kind: z23.enum(TEMPLATE_KINDS),
17558
17965
  /** Repo-relative path of the template source file. */
17559
- sourcePath: z22.string().min(1, "sourcePath must be non-empty"),
17966
+ sourcePath: z23.string().min(1, "sourcePath must be non-empty"),
17560
17967
  /** Project-relative path where the rendered template installs. */
17561
- installPath: z22.string().min(1, "installPath must be non-empty"),
17968
+ installPath: z23.string().min(1, "installPath must be non-empty"),
17562
17969
  /** Substitution strategy the installer applies to `sourcePath`. */
17563
- substitution: z22.enum(TEMPLATE_SUBSTITUTIONS),
17970
+ substitution: z23.enum(TEMPLATE_SUBSTITUTIONS),
17564
17971
  /** Declared placeholders this template requires. May be empty. */
17565
- placeholders: z22.array(PlaceholderSpecSchema),
17972
+ placeholders: z23.array(PlaceholderSpecSchema),
17566
17973
  /** Reconciliation policy on upgrade. */
17567
- updateStrategy: z22.enum(TEMPLATE_UPDATE_STRATEGIES)
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 z23 } from "zod";
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 = z23.object({
17580
- acId: z23.string().min(1, "acId must be non-empty"),
17581
- status: z23.enum(["pass", "fail", "inconclusive"]),
17582
- reasoning: z23.string().min(1, "reasoning must be non-empty"),
17583
- evidenceRefs: z23.array(z23.string()).optional(),
17584
- checkedAt: z23.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17585
- });
17586
- validatorAttestationSchema = z23.object({
17587
- verdict: z23.literal("attest"),
17588
- taskId: z23.string().min(1),
17589
- validatorId: z23.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17590
- findings: z23.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
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: z23.string().optional(),
17595
- attestedAt: z23.string().min(1),
17596
- schemaVersion: z23.literal("1")
17597
- });
17598
- validatorRejectionSchema = z23.object({
17599
- verdict: z23.literal("reject"),
17600
- taskId: z23.string().min(1),
17601
- validatorId: z23.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17602
- findings: z23.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
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: z23.string().min(1, "rejection summary must be non-empty"),
17607
- remediationHints: z23.array(z23.string()).optional(),
17608
- rejectedAt: z23.string().min(1),
17609
- schemaVersion: z23.literal("1")
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 = z23.discriminatedUnion("verdict", [
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 z24 } from "zod";
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 = z24.enum(DECISION_QUESTION_TYPES);
18409
- decisionOutcomeSourceSchema = z24.enum(DECISION_OUTCOME_SOURCES);
18410
- decisionInstructionsSchema = z24.union([z24.string(), z24.record(z24.string(), z24.json())]);
18411
- unitIntervalSchema = z24.number().min(0).max(1);
18412
- decisionStateSchema = z24.union([z24.string(), z24.array(z24.json()), z24.record(z24.string(), z24.json())]).superRefine((state, context) => {
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 = z24.object({
18422
- type: z24.literal("noul"),
18828
+ noulDecisionQuestionSchema = z25.object({
18829
+ type: z25.literal("noul"),
18423
18830
  instructions: decisionInstructionsSchema.optional(),
18424
- criteria: z24.string().min(1)
18831
+ criteria: z25.string().min(1)
18425
18832
  });
18426
- choiceDecisionQuestionSchema = z24.object({
18427
- type: z24.literal("choice"),
18833
+ choiceDecisionQuestionSchema = z25.object({
18834
+ type: z25.literal("choice"),
18428
18835
  instructions: decisionInstructionsSchema.optional(),
18429
- criteria: z24.record(z24.string().min(1), z24.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
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 = z24.object({
18434
- type: z24.literal("score"),
18840
+ scoreDecisionQuestionSchema = z25.object({
18841
+ type: z25.literal("score"),
18435
18842
  instructions: decisionInstructionsSchema.optional(),
18436
- criteria: z24.array(z24.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18843
+ criteria: z25.array(z25.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18437
18844
  });
18438
- decisionQuestionSchema = z24.discriminatedUnion("type", [
18845
+ decisionQuestionSchema = z25.discriminatedUnion("type", [
18439
18846
  noulDecisionQuestionSchema,
18440
18847
  choiceDecisionQuestionSchema,
18441
18848
  scoreDecisionQuestionSchema
18442
18849
  ]);
18443
- decisionRequestSchema = z24.object({
18444
- model: z24.string().min(1).optional(),
18445
- lang: z24.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18446
- cache: z24.boolean().optional(),
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: z24.record(z24.string().min(1), decisionQuestionSchema).refine(
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 = z24.object({
18459
- type: z24.literal("noul"),
18460
- value: z24.boolean(),
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 = z24.object({
18465
- type: z24.literal("choice"),
18466
- value: z24.string().min(1),
18467
- probabilities: z24.record(z24.string().min(1), unitIntervalSchema),
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 = z24.object({
18471
- type: z24.literal("score"),
18472
- value: z24.number().int().nonnegative(),
18473
- probabilities: z24.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
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 = z24.discriminatedUnion("type", [
18883
+ decisionAnswerSchema = z25.discriminatedUnion("type", [
18477
18884
  noulDecisionAnswerSchema,
18478
18885
  choiceDecisionAnswerSchema,
18479
18886
  scoreDecisionAnswerSchema
18480
18887
  ]);
18481
- decisionOutcomeSchema = z24.object({
18482
- answers: z24.record(z24.string().min(1), decisionAnswerSchema),
18888
+ decisionOutcomeSchema = z25.object({
18889
+ answers: z25.record(z25.string().min(1), decisionAnswerSchema),
18483
18890
  source: decisionOutcomeSourceSchema,
18484
- requestId: z24.string().min(1).optional(),
18485
- latencyMs: z24.number().nonnegative(),
18486
- costUsd: z24.number().nonnegative().optional(),
18487
- costMicros: z24.number().int().nonnegative().optional(),
18488
- balanceMicros: z24.number().int().optional(),
18489
- checkpoint: z24.string().min(1).optional(),
18490
- inputTokens: z24.number().int().nonnegative().optional()
18491
- });
18492
- decisionProviderKindSchema = z24.enum(DECISION_PROVIDER_KINDS);
18493
- decisionProviderConfigSchema = z24.object({
18494
- baseUrl: z24.url(),
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 z25 } from "zod";
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 = z25.object({
18514
- id: z25.string(),
18515
- email: z25.string(),
18516
- name: z25.string().nullable().optional()
18517
- });
18518
- nexusAccountOrganizationSchema = z25.object({
18519
- id: z25.string(),
18520
- name: z25.string(),
18521
- slug: z25.string().nullable().optional(),
18522
- role: z25.string().optional(),
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: z25.boolean().optional()
18931
+ personal: z26.boolean().optional()
18525
18932
  });
18526
- nexusAccountMeSchema = z25.object({
18933
+ nexusAccountMeSchema = z26.object({
18527
18934
  user: nexusAccountUserSchema,
18528
- organizations: z25.array(nexusAccountOrganizationSchema).default([])
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 z26 } from "zod";
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 = z26.iso.datetime({ offset: true });
18543
- profile = z26.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18544
- deviceState = z26.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18545
- nexusCloudCredentialSchema = z26.object({
18546
- kind: z26.enum(["device", "session"]),
18547
- credentialId: z26.string().nullable().optional(),
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: z26.array(z26.string()).default([]),
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 = z26.object({
18556
- deviceId: z26.string(),
18557
- name: z26.string(),
18558
- platform: z26.string().optional(),
18559
- arch: z26.string().nullable().optional(),
18560
- cliVersion: z26.string().nullable().optional(),
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: z26.string().nullable().optional(),
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: z26.boolean().default(false),
18571
- projects: z26.number().int().nonnegative().optional(),
18572
- replicas: z26.number().int().nonnegative().optional(),
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 = z26.object({
18577
- id: z26.string(),
18578
- name: z26.string(),
18579
- slug: z26.string().nullable().optional(),
18580
- role: z26.string().optional(),
18581
- personal: z26.boolean().optional()
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 = z26.object({
18584
- id: z26.string(),
18585
- email: z26.string(),
18586
- name: z26.string().nullable().optional()
18990
+ nexusCloudUserSchema = z27.object({
18991
+ id: z27.string(),
18992
+ email: z27.string(),
18993
+ name: z27.string().nullable().optional()
18587
18994
  });
18588
- nexusCloudWhoamiSchema = z26.object({
18995
+ nexusCloudWhoamiSchema = z27.object({
18589
18996
  serverTime: isoTime.optional(),
18590
18997
  user: nexusCloudUserSchema,
18591
- organizations: z26.array(nexusCloudOrganizationSchema).default([]),
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 = z26.object({
18597
- devices: z26.array(nexusCloudDeviceSchema),
18598
- nextCursor: z26.string().max(512).nullable().default(null),
18599
- truncated: z26.boolean().default(false)
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 = z26.looseObject({
19008
+ nexusCloudPresenceSchema = z27.looseObject({
18602
19009
  observedAt: isoTime.optional(),
18603
- sync: z26.object({ enabled: z26.boolean() }).optional()
19010
+ sync: z27.object({ enabled: z27.boolean() }).optional()
18604
19011
  });
18605
- nexusCloudReplicaSchema = z26.object({
18606
- projectId: z26.string(),
18607
- replicaId: z26.string(),
18608
- deviceId: z26.string(),
18609
- deviceName: z26.string(),
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: z26.string().nullable().optional()
19025
+ successor: z27.string().nullable().optional()
18619
19026
  });
18620
- nexusCloudDeviceCountsSchema = z26.object({
18621
- active: z26.number().int().nonnegative(),
18622
- total: z26.number().int().nonnegative()
19027
+ nexusCloudDeviceCountsSchema = z27.object({
19028
+ active: z27.number().int().nonnegative(),
19029
+ total: z27.number().int().nonnegative()
18623
19030
  });
18624
19031
  projectFields = {
18625
- projectId: z26.string(),
18626
- label: z26.string().nullable(),
18627
- organizationId: z26.string(),
18628
- organizationName: z26.string().optional(),
18629
- remoteUrl: z26.string().nullable().optional(),
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 = z26.object({
19039
+ nexusCloudProjectListItemSchema = z27.object({
18633
19040
  ...projectFields,
18634
- role: z26.string(),
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: z26.string().nullable().optional(),
18640
- streamId: z26.string().optional(),
18641
- headSeq: z26.number().int().nonnegative().nullable().optional(),
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: z26.string().nullable().optional(),
18644
- openConflicts: z26.number().int().nonnegative().optional(),
18645
- replicas: z26.array(nexusCloudReplicaSchema).default([]),
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: z26.number().int().nonnegative().optional(),
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: z26.boolean().default(false)
19058
+ replicasTruncated: z27.boolean().default(false)
18652
19059
  });
18653
- nexusCloudProjectPageSchema = z26.object({
18654
- projects: z26.array(nexusCloudProjectListItemSchema),
18655
- nextCursor: z26.string().max(512).nullable().default(null),
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: z26.boolean().default(false),
19064
+ truncated: z27.boolean().default(false),
18658
19065
  /** The project list itself was cut at 1000 (T12858). */
18659
- projectsTruncated: z26.boolean().default(false)
19066
+ projectsTruncated: z27.boolean().default(false)
18660
19067
  });
18661
- nexusCloudProjectDetailSchema = z26.object({
18662
- project: z26.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18663
- role: z26.string(),
18664
- canTrash: z26.boolean().optional(),
18665
- openConflicts: z26.number().int().nonnegative(),
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: z26.array(nexusCloudReplicaSchema),
19074
+ replicas: z27.array(nexusCloudReplicaSchema),
18668
19075
  devices: nexusCloudDeviceCountsSchema,
18669
- replicaCount: z26.number().int().nonnegative().optional(),
19076
+ replicaCount: z27.number().int().nonnegative().optional(),
18670
19077
  lastSyncAt: isoTime.nullable().optional(),
18671
19078
  /** `replicas` was cut at 50. */
18672
- truncated: z26.boolean().default(false),
18673
- stream: z26.object({
18674
- streamId: z26.string(),
18675
- headSeq: z26.number().int().nonnegative(),
18676
- headCheckpointId: z26.string().nullable()
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 = z26.object({
18680
- replicas: z26.array(nexusCloudReplicaSchema),
19086
+ nexusCloudReplicaPageSchema = z27.object({
19087
+ replicas: z27.array(nexusCloudReplicaSchema),
18681
19088
  devices: nexusCloudDeviceCountsSchema.optional(),
18682
- nextCursor: z26.string().max(512).nullable().default(null),
18683
- truncated: z26.boolean().default(false)
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 = z26.enum(NEXUS_STATUS_CHECK_IDS);
18700
- nexusCloudStatusCheckSchema = z26.object({
18701
- id: z26.enum(NEXUS_STATUS_CHECK_IDS),
18702
- ok: z26.boolean(),
18703
- required: z26.boolean(),
18704
- detail: z26.string()
18705
- });
18706
- nexusCloudStatusSchema = z26.object({
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: z26.string().optional(),
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: z26.array(z26.string()).optional(),
19120
+ features: z27.array(z27.string()).optional(),
18714
19121
  user: nexusCloudUserSchema,
18715
19122
  credential: nexusCloudCredentialSchema,
18716
19123
  device: nexusCloudDeviceSchema.nullable(),
18717
- project: z26.object({
18718
- projectId: z26.string(),
18719
- registered: z26.boolean(),
18720
- organizationId: z26.string().nullable(),
18721
- organizationName: z26.string().nullable(),
18722
- role: z26.string().nullable()
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: z26.object({
18725
- replicaId: z26.string(),
18726
- attached: z26.boolean(),
18727
- attachedElsewhere: z26.boolean(),
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: z26.number().int().nonnegative().nullable().optional()
19138
+ lastReplicaSeq: z27.number().int().nonnegative().nullable().optional()
18732
19139
  }).nullable(),
18733
- stream: z26.object({
18734
- streamId: z26.string(),
18735
- headSeq: z26.number().int().nonnegative(),
18736
- headCheckpointId: z26.string().nullable(),
18737
- openConflicts: z26.number().int().nonnegative(),
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: z26.array(nexusCloudStatusCheckSchema.extend({ id: z26.string() })).transform(
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: z26.enum(NEXUS_STATUS_VERDICTS).catch("attention")
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 z27 } from "zod";
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 = z27.iso.datetime({ offset: true });
18808
- uuid = z27.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
18809
- nexusUserKeysSchema = z27.looseObject({
18810
- keyVersion: z27.number().int().positive(),
18811
- masterKeyVerifier: z27.string()
18812
- });
18813
- nexusProjectKeysSchema = z27.looseObject({
18814
- keys: z27.array(
18815
- z27.looseObject({ wrappedProjectKey: z27.string(), keyVersion: z27.number().int().positive() })
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 = z27.looseObject({
18819
- streamId: z27.string(),
18820
- role: z27.string(),
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 = z27.looseObject({ lease: nexusLeaseSchema });
18826
- nexusStreamHeadSchema = z27.looseObject({
18827
- streamId: z27.string(),
18828
- kind: z27.string().optional(),
18829
- headSeq: z27.number().int().nonnegative(),
18830
- headCheckpointId: z27.string().nullable(),
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: z27.number().int().nonnegative().optional()
19242
+ maxSchemaVersion: z28.number().int().nonnegative().optional()
18836
19243
  });
18837
- nexusActivityEventSchema = z27.looseObject({
18838
- id: z27.union([z27.string(), z27.number()]),
19244
+ nexusActivityEventSchema = z28.looseObject({
19245
+ id: z28.union([z28.string(), z28.number()]),
18839
19246
  at: isoTime2,
18840
- actorUserId: z27.string().nullable().optional(),
18841
- actorDeviceId: z27.string().nullable().optional(),
18842
- requestId: z27.string().nullable().optional(),
18843
- action: z27.string(),
18844
- target: z27.string().nullable().optional(),
18845
- detail: z27.unknown().optional()
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 = z27.looseObject({
18848
- events: z27.array(nexusActivityEventSchema),
18849
- nextBefore: z27.union([z27.string(), z27.number()]).nullable().optional()
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 z28.never();
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 z28.lazy(() => {
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 z28.null();
33418
+ return z29.null();
33011
33419
  }
33012
33420
  if (enumValues.length === 0) {
33013
- return z28.never();
33421
+ return z29.never();
33014
33422
  }
33015
33423
  if (enumValues.length === 1) {
33016
- return z28.literal(enumValues[0]);
33424
+ return z29.literal(enumValues[0]);
33017
33425
  }
33018
33426
  if (enumValues.every((v) => typeof v === "string")) {
33019
- return z28.enum(enumValues);
33427
+ return z29.enum(enumValues);
33020
33428
  }
33021
- const literalSchemas = enumValues.map((v) => z28.literal(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 z28.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
33433
+ return z29.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
33026
33434
  }
33027
33435
  if (schema.const !== void 0) {
33028
- return z28.literal(schema.const);
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 z28.never();
33445
+ return z29.never();
33038
33446
  }
33039
33447
  if (typeSchemas.length === 1) {
33040
33448
  return typeSchemas[0];
33041
33449
  }
33042
- return z28.union(typeSchemas);
33450
+ return z29.union(typeSchemas);
33043
33451
  }
33044
33452
  if (!type) {
33045
- return z28.any();
33453
+ return z29.any();
33046
33454
  }
33047
33455
  let zodSchema2;
33048
33456
  switch (type) {
33049
33457
  case "string": {
33050
- let stringSchema = z28.string();
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(z28.email());
33462
+ stringSchema = stringSchema.check(z29.email());
33055
33463
  } else if (format === "uri" || format === "uri-reference") {
33056
- stringSchema = stringSchema.check(z28.url());
33464
+ stringSchema = stringSchema.check(z29.url());
33057
33465
  } else if (format === "uuid" || format === "guid") {
33058
- stringSchema = stringSchema.check(z28.uuid());
33466
+ stringSchema = stringSchema.check(z29.uuid());
33059
33467
  } else if (format === "date-time") {
33060
- stringSchema = stringSchema.check(z28.iso.datetime());
33468
+ stringSchema = stringSchema.check(z29.iso.datetime());
33061
33469
  } else if (format === "date") {
33062
- stringSchema = stringSchema.check(z28.iso.date());
33470
+ stringSchema = stringSchema.check(z29.iso.date());
33063
33471
  } else if (format === "time") {
33064
- stringSchema = stringSchema.check(z28.iso.time());
33472
+ stringSchema = stringSchema.check(z29.iso.time());
33065
33473
  } else if (format === "duration") {
33066
- stringSchema = stringSchema.check(z28.iso.duration());
33474
+ stringSchema = stringSchema.check(z29.iso.duration());
33067
33475
  } else if (format === "ipv4") {
33068
- stringSchema = stringSchema.check(z28.ipv4());
33476
+ stringSchema = stringSchema.check(z29.ipv4());
33069
33477
  } else if (format === "ipv6") {
33070
- stringSchema = stringSchema.check(z28.ipv6());
33478
+ stringSchema = stringSchema.check(z29.ipv6());
33071
33479
  } else if (format === "mac") {
33072
- stringSchema = stringSchema.check(z28.mac());
33480
+ stringSchema = stringSchema.check(z29.mac());
33073
33481
  } else if (format === "cidr") {
33074
- stringSchema = stringSchema.check(z28.cidrv4());
33482
+ stringSchema = stringSchema.check(z29.cidrv4());
33075
33483
  } else if (format === "cidr-v6") {
33076
- stringSchema = stringSchema.check(z28.cidrv6());
33484
+ stringSchema = stringSchema.check(z29.cidrv6());
33077
33485
  } else if (format === "base64") {
33078
- stringSchema = stringSchema.check(z28.base64());
33486
+ stringSchema = stringSchema.check(z29.base64());
33079
33487
  } else if (format === "base64url") {
33080
- stringSchema = stringSchema.check(z28.base64url());
33488
+ stringSchema = stringSchema.check(z29.base64url());
33081
33489
  } else if (format === "e164") {
33082
- stringSchema = stringSchema.check(z28.e164());
33490
+ stringSchema = stringSchema.check(z29.e164());
33083
33491
  } else if (format === "jwt") {
33084
- stringSchema = stringSchema.check(z28.jwt());
33492
+ stringSchema = stringSchema.check(z29.jwt());
33085
33493
  } else if (format === "emoji") {
33086
- stringSchema = stringSchema.check(z28.emoji());
33494
+ stringSchema = stringSchema.check(z29.emoji());
33087
33495
  } else if (format === "nanoid") {
33088
- stringSchema = stringSchema.check(z28.nanoid());
33496
+ stringSchema = stringSchema.check(z29.nanoid());
33089
33497
  } else if (format === "cuid") {
33090
- stringSchema = stringSchema.check(z28.cuid());
33498
+ stringSchema = stringSchema.check(z29.cuid());
33091
33499
  } else if (format === "cuid2") {
33092
- stringSchema = stringSchema.check(z28.cuid2());
33500
+ stringSchema = stringSchema.check(z29.cuid2());
33093
33501
  } else if (format === "ulid") {
33094
- stringSchema = stringSchema.check(z28.ulid());
33502
+ stringSchema = stringSchema.check(z29.ulid());
33095
33503
  } else if (format === "xid") {
33096
- stringSchema = stringSchema.check(z28.xid());
33504
+ stringSchema = stringSchema.check(z29.xid());
33097
33505
  } else if (format === "ksuid") {
33098
- stringSchema = stringSchema.check(z28.ksuid());
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" ? z28.number().int() : z28.number();
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 = z28.boolean();
33547
+ zodSchema2 = z29.boolean();
33140
33548
  break;
33141
33549
  }
33142
33550
  case "null": {
33143
- zodSchema2 = z28.null();
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) : z28.any();
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 = z28.record(keySchema, valueSchema);
33566
+ zodSchema2 = z29.record(keySchema, valueSchema);
33159
33567
  break;
33160
33568
  }
33161
- const objectSchema2 = z28.object(shape).passthrough();
33162
- const recordSchema = z28.looseRecord(keySchema, valueSchema);
33163
- zodSchema2 = z28.intersection(objectSchema2, recordSchema);
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 = z28.string().regex(new RegExp(pattern));
33173
- looseRecords.push(z28.looseRecord(keySchema, patternValue));
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(z28.object(shape).passthrough());
33585
+ schemasToIntersect.push(z29.object(shape).passthrough());
33178
33586
  }
33179
33587
  schemasToIntersect.push(...looseRecords);
33180
33588
  if (schemasToIntersect.length === 0) {
33181
- zodSchema2 = z28.object({}).passthrough();
33589
+ zodSchema2 = z29.object({}).passthrough();
33182
33590
  } else if (schemasToIntersect.length === 1) {
33183
33591
  zodSchema2 = schemasToIntersect[0];
33184
33592
  } else {
33185
- let result = z28.intersection(schemasToIntersect[0], schemasToIntersect[1]);
33593
+ let result = z29.intersection(schemasToIntersect[0], schemasToIntersect[1]);
33186
33594
  for (let i = 2; i < schemasToIntersect.length; i++) {
33187
- result = z28.intersection(result, schemasToIntersect[i]);
33595
+ result = z29.intersection(result, schemasToIntersect[i]);
33188
33596
  }
33189
33597
  zodSchema2 = result;
33190
33598
  }
33191
33599
  break;
33192
33600
  }
33193
- const objectSchema = z28.object(shape);
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 = z28.tuple(tupleItems).rest(rest);
33618
+ zodSchema2 = z29.tuple(tupleItems).rest(rest);
33211
33619
  } else {
33212
- zodSchema2 = z28.tuple(tupleItems);
33620
+ zodSchema2 = z29.tuple(tupleItems);
33213
33621
  }
33214
33622
  if (typeof schema.minItems === "number") {
33215
- zodSchema2 = zodSchema2.check(z28.minLength(schema.minItems));
33623
+ zodSchema2 = zodSchema2.check(z29.minLength(schema.minItems));
33216
33624
  }
33217
33625
  if (typeof schema.maxItems === "number") {
33218
- zodSchema2 = zodSchema2.check(z28.maxLength(schema.maxItems));
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 = z28.tuple(tupleItems).rest(rest);
33632
+ zodSchema2 = z29.tuple(tupleItems).rest(rest);
33225
33633
  } else {
33226
- zodSchema2 = z28.tuple(tupleItems);
33634
+ zodSchema2 = z29.tuple(tupleItems);
33227
33635
  }
33228
33636
  if (typeof schema.minItems === "number") {
33229
- zodSchema2 = zodSchema2.check(z28.minLength(schema.minItems));
33637
+ zodSchema2 = zodSchema2.check(z29.minLength(schema.minItems));
33230
33638
  }
33231
33639
  if (typeof schema.maxItems === "number") {
33232
- zodSchema2 = zodSchema2.check(z28.maxLength(schema.maxItems));
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 = z28.array(element);
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 = z28.array(z28.any());
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 ? z28.any() : z28.never();
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 = z28.union(options);
33269
- baseSchema = hasExplicitType ? z28.intersection(baseSchema, anyOfUnion) : anyOfUnion;
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 = z28.xor(options);
33274
- baseSchema = hasExplicitType ? z28.intersection(baseSchema, oneOfUnion) : oneOfUnion;
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 : z28.any();
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 = z28.intersection(result, convertSchema(schema.allOf[i], ctx));
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 = z28.nullable(baseSchema);
33697
+ baseSchema = z29.nullable(baseSchema);
33290
33698
  }
33291
33699
  if (schema.readOnly === true) {
33292
- baseSchema = z28.readonly(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 ? z28.any() : z28.never();
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 z28, RECOGNIZED_KEYS;
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
- z28 = {
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, relPath, env = process.env) {
45724
+ function excludeLine(projectDir, relPath2, env = process.env) {
45317
45725
  const prefix = gitOutput(projectDir, ["rev-parse", "--show-prefix"], env) ?? "";
45318
- return `/${prefix}${relPath}`;
45726
+ return `/${prefix}${relPath2}`;
45319
45727
  }
45320
- function excludeHookFileFromGit(projectDir, relPath, marker16 = HOOK_FILE_EXCLUDE_MARKER, env = process.env) {
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", relPath], env) !== null) return false;
45324
- if (gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath], env) !== null) return false;
45325
- const line = excludeLine(projectDir, relPath, env);
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, relPath) {
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, relPath));
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, relPath) {
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", relPath]) !== null) return false;
45352
- return gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath]) === null;
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, relPath) {
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, relPath));
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, relPath) {
45455
- if (gitOutput(projectDir, ["ls-files", "--error-unmatch", relPath]) === null) return false;
45456
- return (gitOutput(projectDir, ["diff", "--name-only", "HEAD", "--", relPath]) ?? "") !== "";
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);