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