@cleocode/adapters 2026.11.1-canary.9 → 2026.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.source-stamp.json +1 -1
- package/dist/index.js +1691 -1354
- package/dist/index.js.map +3 -3
- package/dist/orca-execution.d.ts +90 -0
- package/dist/orca-execution.d.ts.map +1 -0
- package/dist/orca-execution.js +843 -0
- package/dist/orca-execution.js.map +6 -0
- package/dist/providers/claude-code/index.js +1689 -1357
- package/dist/providers/claude-code/index.js.map +3 -3
- package/dist/providers/claude-code/lead-session.d.ts +8 -5
- package/dist/providers/claude-code/lead-session.d.ts.map +1 -1
- package/dist/providers/claude-sdk/index.js +1674 -1352
- package/dist/providers/claude-sdk/index.js.map +3 -3
- package/dist/providers/claude-sdk/spawn.d.ts.map +1 -1
- package/dist/providers/codex/index.js +1540 -1233
- package/dist/providers/codex/index.js.map +3 -3
- package/dist/providers/gemini-cli/index.js +1540 -1233
- package/dist/providers/gemini-cli/index.js.map +3 -3
- package/dist/providers/kimi/index.js +1540 -1233
- package/dist/providers/kimi/index.js.map +3 -3
- package/dist/providers/openai-sdk/index.js +1660 -1353
- package/dist/providers/openai-sdk/index.js.map +3 -3
- package/dist/providers/opencode/index.js +1540 -1233
- package/dist/providers/opencode/index.js.map +3 -3
- package/dist/providers/pi/index.js +1540 -1233
- package/dist/providers/pi/index.js.map +3 -3
- package/package.json +10 -6
- package/src/__tests__/orca-execution-fixture.ts +422 -0
- package/src/__tests__/orca-execution.test.ts +1357 -0
- package/src/__tests__/orca-plugin-panel.test.ts +661 -0
- package/src/__tests__/orca-plugin.test.ts +660 -0
- package/src/orca-execution.ts +1193 -0
- package/src/providers/claude-code/__tests__/lead-mcp.test.ts +27 -2
- package/src/providers/claude-code/lead-session.ts +21 -8
- package/src/providers/claude-sdk/__tests__/spawn.test.ts +19 -0
- package/src/providers/claude-sdk/spawn.ts +14 -0
- package/src/providers/shared/__tests__/lead-tool-strip.test.ts +1 -1
|
@@ -1722,17 +1722,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
1722
1722
|
});
|
|
1723
1723
|
|
|
1724
1724
|
// packages/contracts/src/config/manifest.ts
|
|
1725
|
-
import { z as
|
|
1725
|
+
import { z as z6 } from "zod";
|
|
1726
1726
|
|
|
1727
|
-
// packages/contracts/src/
|
|
1727
|
+
// packages/contracts/src/orca-execution.ts
|
|
1728
1728
|
import { z as z4 } from "zod";
|
|
1729
|
-
var
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1729
|
+
var identifier = z4.string().min(1);
|
|
1730
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
1731
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
1732
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
1733
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
1734
|
+
});
|
|
1735
|
+
var orcaContextSchema = z4.object({
|
|
1736
|
+
runtimeId: identifier,
|
|
1737
|
+
coordinatorHandle: identifier,
|
|
1738
|
+
executionHostId: z4.literal("local")
|
|
1739
|
+
});
|
|
1740
|
+
var orcaRoutingRunSchema = z4.object({
|
|
1741
|
+
runId: identifier.nullable(),
|
|
1742
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
1743
|
+
});
|
|
1744
|
+
var orcaLaunchSchema = z4.object({
|
|
1745
|
+
projectId: identifier,
|
|
1746
|
+
projectRoot: identifier,
|
|
1747
|
+
taskId: identifier,
|
|
1748
|
+
instanceId: identifier,
|
|
1749
|
+
workerSessionId: identifier,
|
|
1750
|
+
agentId: identifier,
|
|
1751
|
+
role: z4.enum(["worker", "lead"]),
|
|
1752
|
+
protocol: identifier,
|
|
1753
|
+
worktreePath: identifier,
|
|
1754
|
+
worktreeBranch: identifier,
|
|
1755
|
+
projectHash: identifier,
|
|
1756
|
+
lockToken: identifier,
|
|
1757
|
+
prompt: identifier,
|
|
1758
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
1759
|
+
leadMailbox: identifier.nullable(),
|
|
1760
|
+
model: identifier.optional(),
|
|
1761
|
+
effort: identifier.optional(),
|
|
1762
|
+
accountId: identifier.optional()
|
|
1763
|
+
});
|
|
1764
|
+
var orcaStartBindingSchema = z4.object({
|
|
1765
|
+
runId: identifier.nullable(),
|
|
1766
|
+
orcaTaskId: identifier.nullable(),
|
|
1767
|
+
retryOf: identifier.nullable()
|
|
1768
|
+
});
|
|
1769
|
+
var orcaAttemptSchema = z4.object({
|
|
1770
|
+
backend: z4.literal("orca"),
|
|
1771
|
+
version: z4.literal(1),
|
|
1772
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
1773
|
+
revision: z4.number().int().nonnegative(),
|
|
1774
|
+
context: orcaContextSchema,
|
|
1775
|
+
launch: orcaLaunchSchema,
|
|
1776
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1777
|
+
workspaceId: identifier,
|
|
1778
|
+
workspaceSelector: identifier,
|
|
1779
|
+
state: z4.enum([
|
|
1780
|
+
"prepared",
|
|
1781
|
+
"launching",
|
|
1782
|
+
"ready",
|
|
1783
|
+
"turn_unobserved",
|
|
1784
|
+
"outcome_unknown",
|
|
1785
|
+
"stop_pending",
|
|
1786
|
+
"stop_unknown",
|
|
1787
|
+
"stopped",
|
|
1788
|
+
"failed",
|
|
1789
|
+
"circuit_broken"
|
|
1790
|
+
]),
|
|
1791
|
+
runId: identifier.nullable(),
|
|
1792
|
+
orcaTaskId: identifier.nullable(),
|
|
1793
|
+
dispatchId: identifier.nullable(),
|
|
1794
|
+
retryOf: identifier.nullable(),
|
|
1795
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
1796
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
1797
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
1798
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
1799
|
+
startRequestId: identifier.nullable(),
|
|
1800
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
1801
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
1802
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
1803
|
+
stopRequestId: identifier.nullable(),
|
|
1804
|
+
/**
|
|
1805
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
1806
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
1807
|
+
*/
|
|
1808
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
1809
|
+
failureCount: z4.number().int().nonnegative(),
|
|
1810
|
+
resourceState: z4.string(),
|
|
1811
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
1812
|
+
lastReceipt: z4.string().nullable(),
|
|
1813
|
+
lastError: z4.string().nullable(),
|
|
1814
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
1815
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
1816
|
+
observedAt: z4.string()
|
|
1817
|
+
});
|
|
1818
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
1819
|
+
messageId: identifier,
|
|
1820
|
+
runtimeId: identifier,
|
|
1821
|
+
runId: identifier,
|
|
1822
|
+
orcaTaskId: identifier,
|
|
1823
|
+
dispatchId: identifier,
|
|
1824
|
+
senderHandle: identifier,
|
|
1825
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1826
|
+
body: z4.string(),
|
|
1827
|
+
reportPath: identifier
|
|
1828
|
+
});
|
|
1829
|
+
var orcaWorkerReportSchema = z4.object({
|
|
1830
|
+
event: orcaWorkerDoneSchema,
|
|
1831
|
+
manifestId: identifier,
|
|
1832
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1833
|
+
reportText: z4.string().min(1).max(65536),
|
|
1834
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1835
|
+
ingestedAt: z4.string().datetime()
|
|
1836
|
+
});
|
|
1837
|
+
var orcaReportDeliverySchema = z4.object({
|
|
1838
|
+
key: identifier,
|
|
1839
|
+
mailbox: identifier.nullable(),
|
|
1840
|
+
state: z4.enum(["pending", "delivered"]),
|
|
1841
|
+
messageId: identifier.nullable(),
|
|
1842
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
1843
|
+
lastError: z4.string().nullable()
|
|
1844
|
+
});
|
|
1845
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
1846
|
+
resourceRelease: z4.object({
|
|
1847
|
+
dispatchId: identifier,
|
|
1848
|
+
releasedAt: z4.string().datetime(),
|
|
1849
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1850
|
+
receipt: identifier
|
|
1851
|
+
}).optional(),
|
|
1852
|
+
retiredAt: z4.string().datetime().optional(),
|
|
1853
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
1854
|
+
});
|
|
1855
|
+
var orcaReportMessageSchema = z4.object({
|
|
1856
|
+
id: identifier,
|
|
1857
|
+
run_id: z4.string().nullable(),
|
|
1858
|
+
delivery_contract: z4.string(),
|
|
1859
|
+
from_handle: z4.string(),
|
|
1860
|
+
to_handle: z4.string(),
|
|
1861
|
+
type: z4.string(),
|
|
1862
|
+
body: z4.string(),
|
|
1863
|
+
payload: z4.string().nullable(),
|
|
1864
|
+
sender_pane_key: z4.string().nullable()
|
|
1865
|
+
});
|
|
1866
|
+
var orcaReportSourceSchema = z4.object({
|
|
1867
|
+
ok: z4.literal(true),
|
|
1868
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1869
|
+
result: z4.object({
|
|
1870
|
+
messages: z4.array(z4.json()).optional(),
|
|
1871
|
+
dispatch: z4.object({
|
|
1872
|
+
id: identifier,
|
|
1873
|
+
run_id: identifier,
|
|
1874
|
+
task_id: identifier,
|
|
1875
|
+
assignee_handle: identifier,
|
|
1876
|
+
assignee_pane_key: z4.string().nullable(),
|
|
1877
|
+
status: z4.string()
|
|
1878
|
+
}).optional()
|
|
1879
|
+
})
|
|
1880
|
+
});
|
|
1881
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
1882
|
+
taskId: identifier,
|
|
1883
|
+
dispatchId: identifier,
|
|
1884
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1885
|
+
reportPath: identifier
|
|
1886
|
+
});
|
|
1887
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
1888
|
+
action: z4.enum([
|
|
1889
|
+
"show",
|
|
1890
|
+
"read",
|
|
1891
|
+
"recover-start",
|
|
1892
|
+
"recover-stop",
|
|
1893
|
+
"retry",
|
|
1894
|
+
"stop",
|
|
1895
|
+
"ingest-report",
|
|
1896
|
+
"relay-report"
|
|
1897
|
+
]),
|
|
1898
|
+
recordId: identifier,
|
|
1899
|
+
cursor: identifier.optional(),
|
|
1900
|
+
messageId: identifier.optional()
|
|
1901
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
1902
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
1903
|
+
path: ["cursor"]
|
|
1904
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
1905
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
1906
|
+
path: ["messageId"]
|
|
1907
|
+
});
|
|
1908
|
+
var effectSchema = z4.object({
|
|
1909
|
+
kind: z4.string(),
|
|
1910
|
+
role: z4.string().optional(),
|
|
1911
|
+
action: z4.string().optional(),
|
|
1912
|
+
id: z4.string().optional()
|
|
1913
|
+
});
|
|
1914
|
+
var selectionSchema = z4.object({
|
|
1915
|
+
agent: z4.string().nullable().optional(),
|
|
1916
|
+
model: z4.string().nullable().optional(),
|
|
1917
|
+
effort: z4.string().nullable().optional()
|
|
1918
|
+
});
|
|
1919
|
+
var orcaReplySchema = z4.object({
|
|
1920
|
+
ok: z4.boolean(),
|
|
1921
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
1922
|
+
error: z4.object({
|
|
1923
|
+
code: z4.string(),
|
|
1924
|
+
message: z4.string(),
|
|
1925
|
+
data: z4.object({
|
|
1926
|
+
requestId: identifier.optional(),
|
|
1927
|
+
orchestrationRequestId: identifier.optional(),
|
|
1928
|
+
dispatchId: identifier.optional()
|
|
1929
|
+
}).optional()
|
|
1930
|
+
}).optional(),
|
|
1931
|
+
result: z4.object({
|
|
1932
|
+
state: z4.string().optional(),
|
|
1933
|
+
requestId: identifier.optional(),
|
|
1934
|
+
/**
|
|
1935
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
1936
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
1937
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
1938
|
+
* be bound to the request key this attempt issued.
|
|
1939
|
+
*/
|
|
1940
|
+
mutation: z4.object({
|
|
1941
|
+
requestId: identifier.optional(),
|
|
1942
|
+
replayed: z4.boolean().optional()
|
|
1943
|
+
}).optional(),
|
|
1944
|
+
stage: z4.string().optional(),
|
|
1945
|
+
turnStart: z4.string().optional(),
|
|
1946
|
+
runId: identifier.optional(),
|
|
1947
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
1948
|
+
taskId: identifier.optional(),
|
|
1949
|
+
dispatchId: identifier.optional(),
|
|
1950
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
1951
|
+
effects: z4.array(effectSchema).optional(),
|
|
1952
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
1953
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
1954
|
+
lastError: z4.string().nullable().optional(),
|
|
1955
|
+
processAction: z4.string().optional(),
|
|
1956
|
+
helpers: z4.array(
|
|
1957
|
+
z4.object({
|
|
1958
|
+
dispatchId: identifier.optional(),
|
|
1959
|
+
creatorDispatchId: identifier.optional(),
|
|
1960
|
+
outcome: z4.string(),
|
|
1961
|
+
keptOpenBy: identifier.optional(),
|
|
1962
|
+
state: z4.string().optional(),
|
|
1963
|
+
lastError: z4.string().nullable().optional()
|
|
1964
|
+
})
|
|
1965
|
+
).optional(),
|
|
1966
|
+
helperStopError: z4.string().nullable().optional(),
|
|
1967
|
+
status: z4.string().optional(),
|
|
1968
|
+
terminal: z4.object({
|
|
1969
|
+
handle: identifier,
|
|
1970
|
+
connected: z4.boolean(),
|
|
1971
|
+
writable: z4.boolean(),
|
|
1972
|
+
executionHostId: identifier
|
|
1973
|
+
}).optional(),
|
|
1974
|
+
runtime: z4.object({
|
|
1975
|
+
runtimeId: identifier,
|
|
1976
|
+
reachable: z4.boolean(),
|
|
1977
|
+
state: z4.string(),
|
|
1978
|
+
capabilities: z4.array(z4.string())
|
|
1979
|
+
}).optional(),
|
|
1980
|
+
worktree: z4.object({
|
|
1981
|
+
id: identifier,
|
|
1982
|
+
path: identifier,
|
|
1983
|
+
branch: identifier,
|
|
1984
|
+
hostId: identifier,
|
|
1985
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
1986
|
+
}).optional(),
|
|
1987
|
+
dispatch: z4.object({
|
|
1988
|
+
id: identifier,
|
|
1989
|
+
runId: identifier,
|
|
1990
|
+
taskId: identifier,
|
|
1991
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
1992
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
1993
|
+
failureCount: z4.number().int().nonnegative()
|
|
1994
|
+
}).optional(),
|
|
1995
|
+
worker: z4.object({
|
|
1996
|
+
dispatchId: identifier,
|
|
1997
|
+
runtimeEpoch: identifier,
|
|
1998
|
+
state: z4.string(),
|
|
1999
|
+
stage: z4.string(),
|
|
2000
|
+
worktreeId: identifier.nullable()
|
|
2001
|
+
}).optional(),
|
|
2002
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
2003
|
+
projection: z4.object({
|
|
2004
|
+
resource: z4.object({
|
|
2005
|
+
state: z4.string(),
|
|
2006
|
+
terminalState: z4.string(),
|
|
2007
|
+
ownerDispatchId: identifier.optional(),
|
|
2008
|
+
releaseState: z4.string().optional()
|
|
2009
|
+
}).optional()
|
|
2010
|
+
}).optional()
|
|
2011
|
+
}).optional()
|
|
2012
|
+
});
|
|
2013
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
2014
|
+
schemaVersion: z4.number().int().positive(),
|
|
2015
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
2016
|
+
});
|
|
2017
|
+
var accountProviderSchema = z4.object({
|
|
2018
|
+
accounts: z4.array(z4.object({})),
|
|
2019
|
+
activeAccountId: identifier.nullable()
|
|
2020
|
+
});
|
|
2021
|
+
var orcaAccountReplySchema = z4.object({
|
|
2022
|
+
ok: z4.literal(true),
|
|
2023
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
2024
|
+
result: z4.object({
|
|
2025
|
+
codex: accountProviderSchema,
|
|
2026
|
+
opencode: accountProviderSchema,
|
|
2027
|
+
claude: accountProviderSchema
|
|
2028
|
+
})
|
|
2029
|
+
});
|
|
2030
|
+
|
|
2031
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
2032
|
+
import { z as z5 } from "zod";
|
|
2033
|
+
var projectWorkerPolicySchema = z5.object({
|
|
2034
|
+
verification: z5.object({
|
|
2035
|
+
full: z5.enum(["local", "ci"]),
|
|
2036
|
+
local: z5.enum(["single-file", "affected"])
|
|
1733
2037
|
}).strict().optional(),
|
|
1734
|
-
instructions:
|
|
1735
|
-
|
|
2038
|
+
instructions: z5.array(
|
|
2039
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
1736
2040
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
1737
2041
|
"Instructions must be single-line text without control characters or a leading #"
|
|
1738
2042
|
)
|
|
@@ -1760,8 +2064,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
1760
2064
|
path: ".cleo/config.json",
|
|
1761
2065
|
mergePrecedence: 20,
|
|
1762
2066
|
driftDetection: "schema-validate",
|
|
1763
|
-
schema:
|
|
1764
|
-
orchestrate:
|
|
2067
|
+
schema: z6.object({
|
|
2068
|
+
orchestrate: z6.object({
|
|
2069
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
2070
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
2071
|
+
}).passthrough().optional()
|
|
1765
2072
|
}).passthrough()
|
|
1766
2073
|
};
|
|
1767
2074
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -1777,139 +2084,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
1777
2084
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
1778
2085
|
CLEO_CONFIG_MANIFEST
|
|
1779
2086
|
]);
|
|
1780
|
-
var configManifestEntrySchema =
|
|
1781
|
-
id:
|
|
1782
|
-
scope:
|
|
1783
|
-
path:
|
|
1784
|
-
schema:
|
|
1785
|
-
mergePrecedence:
|
|
1786
|
-
driftDetection:
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
2087
|
+
var configManifestEntrySchema = z6.object({
|
|
2088
|
+
id: z6.string().min(1),
|
|
2089
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
2090
|
+
path: z6.string().min(1),
|
|
2091
|
+
schema: z6.unknown().optional(),
|
|
2092
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
2093
|
+
driftDetection: z6.union([
|
|
2094
|
+
z6.literal("schema-validate"),
|
|
2095
|
+
z6.literal("staleness-gate"),
|
|
2096
|
+
z6.literal("value-diff"),
|
|
2097
|
+
z6.literal("none")
|
|
1791
2098
|
]),
|
|
1792
|
-
defaults:
|
|
2099
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
1793
2100
|
});
|
|
1794
2101
|
|
|
1795
2102
|
// packages/contracts/src/daemon/health.ts
|
|
1796
|
-
import { z as
|
|
2103
|
+
import { z as z8 } from "zod";
|
|
1797
2104
|
|
|
1798
2105
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
1799
|
-
import { z as
|
|
1800
|
-
var EnvPairSchema =
|
|
2106
|
+
import { z as z7 } from "zod";
|
|
2107
|
+
var EnvPairSchema = z7.object({
|
|
1801
2108
|
/** Environment variable name. */
|
|
1802
|
-
key:
|
|
2109
|
+
key: z7.string().min(1),
|
|
1803
2110
|
/** Environment variable value. */
|
|
1804
|
-
value:
|
|
2111
|
+
value: z7.string()
|
|
1805
2112
|
}).strict();
|
|
1806
|
-
var ChildStateSchema =
|
|
1807
|
-
var ChildStatusSchema =
|
|
2113
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
2114
|
+
var ChildStatusSchema = z7.object({
|
|
1808
2115
|
/** Logical id of the child (stable across restarts). */
|
|
1809
|
-
child_id:
|
|
2116
|
+
child_id: z7.string().min(1),
|
|
1810
2117
|
/** Current OS pid (0 when not currently running). */
|
|
1811
|
-
pid:
|
|
2118
|
+
pid: z7.number().int().nonnegative(),
|
|
1812
2119
|
/** Current liveness state. */
|
|
1813
2120
|
state: ChildStateSchema,
|
|
1814
2121
|
/** Total restarts observed for this child. */
|
|
1815
|
-
restart_count:
|
|
2122
|
+
restart_count: z7.number().int().nonnegative()
|
|
1816
2123
|
}).strict();
|
|
1817
|
-
var SpawnRequestSchema =
|
|
2124
|
+
var SpawnRequestSchema = z7.object({
|
|
1818
2125
|
/** Tag discriminating this request variant. */
|
|
1819
|
-
kind:
|
|
2126
|
+
kind: z7.literal("spawn"),
|
|
1820
2127
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
1821
|
-
child_id:
|
|
2128
|
+
child_id: z7.string().min(1),
|
|
1822
2129
|
/** Absolute path to the program to execute. */
|
|
1823
|
-
program:
|
|
2130
|
+
program: z7.string().min(1),
|
|
1824
2131
|
/** Arguments passed to the program. */
|
|
1825
|
-
args:
|
|
2132
|
+
args: z7.array(z7.string()).default([]),
|
|
1826
2133
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
1827
|
-
env:
|
|
2134
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
1828
2135
|
/** Optional working directory for the child. */
|
|
1829
|
-
cwd:
|
|
2136
|
+
cwd: z7.string().optional()
|
|
1830
2137
|
}).strict();
|
|
1831
|
-
var RestartRequestSchema =
|
|
2138
|
+
var RestartRequestSchema = z7.object({
|
|
1832
2139
|
/** Tag discriminating this request variant. */
|
|
1833
|
-
kind:
|
|
2140
|
+
kind: z7.literal("restart"),
|
|
1834
2141
|
/** Logical id of the child to restart. */
|
|
1835
|
-
child_id:
|
|
2142
|
+
child_id: z7.string().min(1)
|
|
1836
2143
|
}).strict();
|
|
1837
|
-
var MonitorRequestSchema =
|
|
2144
|
+
var MonitorRequestSchema = z7.object({
|
|
1838
2145
|
/** Tag discriminating this request variant. */
|
|
1839
|
-
kind:
|
|
2146
|
+
kind: z7.literal("monitor"),
|
|
1840
2147
|
/** Specific child id to monitor; omit to request all children. */
|
|
1841
|
-
child_id:
|
|
2148
|
+
child_id: z7.string().optional()
|
|
1842
2149
|
}).strict();
|
|
1843
|
-
var HealthRequestSchema =
|
|
2150
|
+
var HealthRequestSchema = z7.object({
|
|
1844
2151
|
/** Tag discriminating this request variant. */
|
|
1845
|
-
kind:
|
|
2152
|
+
kind: z7.literal("health")
|
|
1846
2153
|
}).strict();
|
|
1847
|
-
var SupervisorIpcRequestSchema =
|
|
2154
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
1848
2155
|
SpawnRequestSchema,
|
|
1849
2156
|
RestartRequestSchema,
|
|
1850
2157
|
MonitorRequestSchema,
|
|
1851
2158
|
HealthRequestSchema
|
|
1852
2159
|
]);
|
|
1853
|
-
var SpawnedResponseSchema =
|
|
2160
|
+
var SpawnedResponseSchema = z7.object({
|
|
1854
2161
|
/** Tag discriminating this response variant. */
|
|
1855
|
-
kind:
|
|
2162
|
+
kind: z7.literal("spawned"),
|
|
1856
2163
|
/** Logical id of the spawned child. */
|
|
1857
|
-
child_id:
|
|
2164
|
+
child_id: z7.string().min(1),
|
|
1858
2165
|
/** OS pid assigned to the spawned child. */
|
|
1859
|
-
pid:
|
|
2166
|
+
pid: z7.number().int().nonnegative()
|
|
1860
2167
|
}).strict();
|
|
1861
|
-
var RestartedResponseSchema =
|
|
2168
|
+
var RestartedResponseSchema = z7.object({
|
|
1862
2169
|
/** Tag discriminating this response variant. */
|
|
1863
|
-
kind:
|
|
2170
|
+
kind: z7.literal("restarted"),
|
|
1864
2171
|
/** Logical id of the restarted child. */
|
|
1865
|
-
child_id:
|
|
2172
|
+
child_id: z7.string().min(1),
|
|
1866
2173
|
/** New OS pid after the restart. */
|
|
1867
|
-
pid:
|
|
2174
|
+
pid: z7.number().int().nonnegative(),
|
|
1868
2175
|
/** Number of times this child has been restarted in total. */
|
|
1869
|
-
restart_count:
|
|
2176
|
+
restart_count: z7.number().int().nonnegative()
|
|
1870
2177
|
}).strict();
|
|
1871
|
-
var MonitorResponseSchema =
|
|
2178
|
+
var MonitorResponseSchema = z7.object({
|
|
1872
2179
|
/** Tag discriminating this response variant. */
|
|
1873
|
-
kind:
|
|
2180
|
+
kind: z7.literal("monitor"),
|
|
1874
2181
|
/** One row per monitored child. */
|
|
1875
|
-
children:
|
|
2182
|
+
children: z7.array(ChildStatusSchema)
|
|
1876
2183
|
}).strict();
|
|
1877
|
-
var HealthResponseSchema =
|
|
2184
|
+
var HealthResponseSchema = z7.object({
|
|
1878
2185
|
/** Tag discriminating this response variant. */
|
|
1879
|
-
kind:
|
|
2186
|
+
kind: z7.literal("health"),
|
|
1880
2187
|
/** Supervisor process pid. */
|
|
1881
|
-
pid:
|
|
2188
|
+
pid: z7.number().int().nonnegative(),
|
|
1882
2189
|
/** Number of children currently tracked. */
|
|
1883
|
-
child_count:
|
|
2190
|
+
child_count: z7.number().int().nonnegative(),
|
|
1884
2191
|
/** Seconds the supervisor has been running. */
|
|
1885
|
-
uptime_secs:
|
|
2192
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
1886
2193
|
/** Frozen protocol version the supervisor speaks. */
|
|
1887
|
-
protocol_version:
|
|
2194
|
+
protocol_version: z7.string()
|
|
1888
2195
|
}).strict();
|
|
1889
|
-
var LifecycleEventKindSchema =
|
|
1890
|
-
var LifecycleEventResponseSchema =
|
|
2196
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
2197
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
1891
2198
|
/** Tag discriminating this response variant. */
|
|
1892
|
-
kind:
|
|
2199
|
+
kind: z7.literal("event"),
|
|
1893
2200
|
/** What happened. */
|
|
1894
2201
|
event: LifecycleEventKindSchema,
|
|
1895
2202
|
/** Logical id of the affected child. */
|
|
1896
|
-
child_id:
|
|
2203
|
+
child_id: z7.string().min(1),
|
|
1897
2204
|
/** Exit code, when the OS reported one. */
|
|
1898
|
-
exit_code:
|
|
2205
|
+
exit_code: z7.number().int().optional(),
|
|
1899
2206
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
1900
|
-
signal:
|
|
2207
|
+
signal: z7.string().optional(),
|
|
1901
2208
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
1902
|
-
restart_delay_ms:
|
|
2209
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
1903
2210
|
}).strict();
|
|
1904
|
-
var ErrorResponseSchema =
|
|
2211
|
+
var ErrorResponseSchema = z7.object({
|
|
1905
2212
|
/** Tag discriminating this response variant. */
|
|
1906
|
-
kind:
|
|
2213
|
+
kind: z7.literal("error"),
|
|
1907
2214
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
1908
|
-
code:
|
|
2215
|
+
code: z7.string().min(1),
|
|
1909
2216
|
/** Human-readable error message. */
|
|
1910
|
-
message:
|
|
2217
|
+
message: z7.string()
|
|
1911
2218
|
}).strict();
|
|
1912
|
-
var SupervisorIpcResponseSchema =
|
|
2219
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
1913
2220
|
SpawnedResponseSchema,
|
|
1914
2221
|
RestartedResponseSchema,
|
|
1915
2222
|
MonitorResponseSchema,
|
|
@@ -1917,27 +2224,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
1917
2224
|
LifecycleEventResponseSchema,
|
|
1918
2225
|
ErrorResponseSchema
|
|
1919
2226
|
]);
|
|
1920
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
2227
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
1921
2228
|
/** Frozen protocol version. */
|
|
1922
|
-
protocol_version:
|
|
2229
|
+
protocol_version: z7.string(),
|
|
1923
2230
|
/** Correlation id echoed back on the matching response. */
|
|
1924
|
-
id:
|
|
2231
|
+
id: z7.string().min(1),
|
|
1925
2232
|
/** Direction discriminator. */
|
|
1926
|
-
direction:
|
|
2233
|
+
direction: z7.literal("request"),
|
|
1927
2234
|
/** The request body. */
|
|
1928
2235
|
request: SupervisorIpcRequestSchema
|
|
1929
2236
|
}).strict();
|
|
1930
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
2237
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
1931
2238
|
/** Frozen protocol version. */
|
|
1932
|
-
protocol_version:
|
|
2239
|
+
protocol_version: z7.string(),
|
|
1933
2240
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
1934
|
-
id:
|
|
2241
|
+
id: z7.string().min(1),
|
|
1935
2242
|
/** Direction discriminator. */
|
|
1936
|
-
direction:
|
|
2243
|
+
direction: z7.literal("response"),
|
|
1937
2244
|
/** The response body. */
|
|
1938
2245
|
response: SupervisorIpcResponseSchema
|
|
1939
2246
|
}).strict();
|
|
1940
|
-
var SupervisorIpcEnvelopeSchema =
|
|
2247
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
1941
2248
|
SupervisorIpcRequestEnvelopeSchema,
|
|
1942
2249
|
SupervisorIpcResponseEnvelopeSchema
|
|
1943
2250
|
]);
|
|
@@ -1961,17 +2268,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
1961
2268
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
1962
2269
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
1963
2270
|
*/
|
|
1964
|
-
detail:
|
|
2271
|
+
detail: z8.string().optional()
|
|
1965
2272
|
}).strict();
|
|
1966
|
-
var HealthStatusSchema =
|
|
2273
|
+
var HealthStatusSchema = z8.object({
|
|
1967
2274
|
/** One health row per registered subsystem. */
|
|
1968
|
-
subsystems:
|
|
2275
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
1969
2276
|
/**
|
|
1970
2277
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
1971
2278
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
1972
2279
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
1973
2280
|
*/
|
|
1974
|
-
allHealthy:
|
|
2281
|
+
allHealthy: z8.boolean()
|
|
1975
2282
|
}).strict();
|
|
1976
2283
|
|
|
1977
2284
|
// packages/contracts/src/db-inventory.json
|
|
@@ -13900,7 +14207,7 @@ var OPERATIONS = [
|
|
|
13900
14207
|
];
|
|
13901
14208
|
|
|
13902
14209
|
// packages/contracts/src/docs/modernize.ts
|
|
13903
|
-
import { z as
|
|
14210
|
+
import { z as z9 } from "zod";
|
|
13904
14211
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
13905
14212
|
var DOCS_MODERNIZE_OPS = [
|
|
13906
14213
|
"ingest",
|
|
@@ -13914,105 +14221,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
13914
14221
|
"reslug",
|
|
13915
14222
|
"link-task"
|
|
13916
14223
|
];
|
|
13917
|
-
var judgmentSchema =
|
|
13918
|
-
question:
|
|
13919
|
-
site:
|
|
13920
|
-
mode:
|
|
13921
|
-
ruleAnswer:
|
|
13922
|
-
decidedAnswer:
|
|
13923
|
-
decidedConfidence:
|
|
13924
|
-
source:
|
|
13925
|
-
acted:
|
|
14224
|
+
var judgmentSchema = z9.object({
|
|
14225
|
+
question: z9.enum(["classify", "merge"]),
|
|
14226
|
+
site: z9.string(),
|
|
14227
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
14228
|
+
ruleAnswer: z9.string(),
|
|
14229
|
+
decidedAnswer: z9.string().nullable(),
|
|
14230
|
+
decidedConfidence: z9.number().nullable(),
|
|
14231
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
14232
|
+
acted: z9.string()
|
|
13926
14233
|
});
|
|
13927
|
-
var relPath =
|
|
13928
|
-
var docsModernizePlanSchema =
|
|
13929
|
-
root:
|
|
13930
|
-
generatedAt:
|
|
13931
|
-
mode:
|
|
13932
|
-
counts:
|
|
13933
|
-
rows:
|
|
13934
|
-
|
|
14234
|
+
var relPath = z9.string().min(1).max(1024);
|
|
14235
|
+
var docsModernizePlanSchema = z9.object({
|
|
14236
|
+
root: z9.string().min(1),
|
|
14237
|
+
generatedAt: z9.string(),
|
|
14238
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
14239
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
14240
|
+
rows: z9.array(
|
|
14241
|
+
z9.object({
|
|
13935
14242
|
path: relPath,
|
|
13936
|
-
sha256:
|
|
13937
|
-
kind:
|
|
13938
|
-
slug:
|
|
13939
|
-
title:
|
|
13940
|
-
disposition:
|
|
13941
|
-
target:
|
|
13942
|
-
reasons:
|
|
13943
|
-
judgments:
|
|
13944
|
-
ownerTasks:
|
|
13945
|
-
category:
|
|
13946
|
-
refs:
|
|
13947
|
-
overridden:
|
|
13948
|
-
covers:
|
|
13949
|
-
baselineRemove:
|
|
14243
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
14244
|
+
kind: z9.string().min(1),
|
|
14245
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
14246
|
+
title: z9.string(),
|
|
14247
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
14248
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
14249
|
+
reasons: z9.array(z9.string()),
|
|
14250
|
+
judgments: z9.array(judgmentSchema),
|
|
14251
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
14252
|
+
category: z9.string(),
|
|
14253
|
+
refs: z9.array(z9.string()),
|
|
14254
|
+
overridden: z9.boolean(),
|
|
14255
|
+
covers: z9.array(z9.string()),
|
|
14256
|
+
baselineRemove: z9.boolean()
|
|
13950
14257
|
})
|
|
13951
14258
|
),
|
|
13952
|
-
linkFixes:
|
|
13953
|
-
|
|
13954
|
-
kind:
|
|
14259
|
+
linkFixes: z9.array(
|
|
14260
|
+
z9.object({
|
|
14261
|
+
kind: z9.literal("link-fix"),
|
|
13955
14262
|
path: relPath,
|
|
13956
|
-
href:
|
|
13957
|
-
newHref:
|
|
13958
|
-
base:
|
|
13959
|
-
sha256:
|
|
14263
|
+
href: z9.string().min(1).max(2048),
|
|
14264
|
+
newHref: z9.string().min(1).max(2048),
|
|
14265
|
+
base: z9.literal("repo").optional(),
|
|
14266
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
13960
14267
|
})
|
|
13961
14268
|
).optional(),
|
|
13962
|
-
repoRoot:
|
|
14269
|
+
repoRoot: z9.string().min(1).optional()
|
|
13963
14270
|
});
|
|
13964
|
-
var docsModernizeOverridesSchema =
|
|
14271
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
13965
14272
|
relPath,
|
|
13966
|
-
|
|
13967
|
-
disposition:
|
|
13968
|
-
target:
|
|
13969
|
-
reason:
|
|
13970
|
-
kind:
|
|
13971
|
-
slug:
|
|
13972
|
-
covers:
|
|
14273
|
+
z9.object({
|
|
14274
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
14275
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
14276
|
+
reason: z9.string().min(1),
|
|
14277
|
+
kind: z9.string().min(1).optional(),
|
|
14278
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
14279
|
+
covers: z9.array(z9.string()).optional()
|
|
13973
14280
|
})
|
|
13974
14281
|
);
|
|
13975
|
-
var receiptOpSchema =
|
|
13976
|
-
op:
|
|
13977
|
-
state:
|
|
13978
|
-
slug:
|
|
14282
|
+
var receiptOpSchema = z9.object({
|
|
14283
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
14284
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
14285
|
+
slug: z9.string().nullable(),
|
|
13979
14286
|
path: relPath.nullable(),
|
|
13980
|
-
target:
|
|
13981
|
-
attachmentId:
|
|
13982
|
-
ownerId:
|
|
13983
|
-
beforeSha256:
|
|
13984
|
-
afterSha256:
|
|
13985
|
-
prior:
|
|
13986
|
-
lifecycleStatus:
|
|
13987
|
-
supersededBy:
|
|
13988
|
-
supersedes:
|
|
13989
|
-
previousAttachmentId:
|
|
13990
|
-
newAttachmentId:
|
|
13991
|
-
linkTargets:
|
|
13992
|
-
kind:
|
|
14287
|
+
target: z9.string().nullable(),
|
|
14288
|
+
attachmentId: z9.string().nullable(),
|
|
14289
|
+
ownerId: z9.string().nullable(),
|
|
14290
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
14291
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
14292
|
+
prior: z9.object({
|
|
14293
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
14294
|
+
supersededBy: z9.string().nullable().optional(),
|
|
14295
|
+
supersedes: z9.string().nullable().optional(),
|
|
14296
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
14297
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
14298
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
14299
|
+
kind: z9.string().nullable().optional()
|
|
13993
14300
|
}).optional(),
|
|
13994
|
-
base:
|
|
14301
|
+
base: z9.literal("repo").optional()
|
|
13995
14302
|
});
|
|
13996
14303
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
13997
|
-
i:
|
|
14304
|
+
i: z9.number().int().min(0)
|
|
13998
14305
|
});
|
|
13999
|
-
var docsModernizeReceiptSchema =
|
|
14000
|
-
runId:
|
|
14001
|
-
root:
|
|
14002
|
-
appliedAt:
|
|
14003
|
-
planSha256:
|
|
14004
|
-
edgeCount:
|
|
14005
|
-
rolledBackAt:
|
|
14006
|
-
blobs:
|
|
14007
|
-
moves:
|
|
14008
|
-
deleted:
|
|
14009
|
-
ops:
|
|
14010
|
-
durationMs:
|
|
14011
|
-
repoRoot:
|
|
14306
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
14307
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
14308
|
+
root: z9.string().min(1),
|
|
14309
|
+
appliedAt: z9.string(),
|
|
14310
|
+
planSha256: z9.string(),
|
|
14311
|
+
edgeCount: z9.number(),
|
|
14312
|
+
rolledBackAt: z9.string().nullable(),
|
|
14313
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
14314
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
14315
|
+
deleted: z9.array(relPath),
|
|
14316
|
+
ops: z9.array(receiptOpSchema),
|
|
14317
|
+
durationMs: z9.number().optional(),
|
|
14318
|
+
repoRoot: z9.string().min(1).optional()
|
|
14012
14319
|
});
|
|
14013
14320
|
|
|
14014
14321
|
// packages/contracts/src/docs/provenance.ts
|
|
14015
|
-
import { z as
|
|
14322
|
+
import { z as z10 } from "zod";
|
|
14016
14323
|
var PROVENANCE_NODE_KINDS = [
|
|
14017
14324
|
"doc",
|
|
14018
14325
|
"task",
|
|
@@ -14035,96 +14342,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
14035
14342
|
"archived",
|
|
14036
14343
|
"draft"
|
|
14037
14344
|
];
|
|
14038
|
-
var provenanceNodeKindSchema =
|
|
14039
|
-
var provenanceEdgeRelationSchema =
|
|
14040
|
-
var docLifecycleStatusSchema =
|
|
14345
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
14346
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
14347
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
14041
14348
|
var provenanceNodeBaseFields = {
|
|
14042
|
-
id:
|
|
14043
|
-
title:
|
|
14044
|
-
metadata:
|
|
14349
|
+
id: z10.string().min(1),
|
|
14350
|
+
title: z10.string().min(1),
|
|
14351
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
14045
14352
|
};
|
|
14046
|
-
var provenanceDocNodeSchema =
|
|
14353
|
+
var provenanceDocNodeSchema = z10.object({
|
|
14047
14354
|
...provenanceNodeBaseFields,
|
|
14048
|
-
kind:
|
|
14049
|
-
slug:
|
|
14050
|
-
docKind:
|
|
14355
|
+
kind: z10.literal("doc"),
|
|
14356
|
+
slug: z10.string().min(1),
|
|
14357
|
+
docKind: z10.string().min(1),
|
|
14051
14358
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
14052
|
-
publishedAt:
|
|
14053
|
-
supersededAt:
|
|
14054
|
-
summary:
|
|
14359
|
+
publishedAt: z10.string().min(1),
|
|
14360
|
+
supersededAt: z10.string().min(1).optional(),
|
|
14361
|
+
summary: z10.string().optional()
|
|
14055
14362
|
});
|
|
14056
|
-
var provenanceTaskNodeSchema =
|
|
14363
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
14057
14364
|
...provenanceNodeBaseFields,
|
|
14058
|
-
kind:
|
|
14059
|
-
taskType:
|
|
14060
|
-
status:
|
|
14365
|
+
kind: z10.literal("task"),
|
|
14366
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
14367
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
14061
14368
|
});
|
|
14062
|
-
var provenanceDecisionNodeSchema =
|
|
14369
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
14063
14370
|
...provenanceNodeBaseFields,
|
|
14064
|
-
kind:
|
|
14065
|
-
outcome:
|
|
14066
|
-
decidedAt:
|
|
14371
|
+
kind: z10.literal("decision"),
|
|
14372
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
14373
|
+
decidedAt: z10.string().min(1)
|
|
14067
14374
|
});
|
|
14068
|
-
var provenanceSessionNodeSchema =
|
|
14375
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
14069
14376
|
...provenanceNodeBaseFields,
|
|
14070
|
-
kind:
|
|
14071
|
-
startedAt:
|
|
14072
|
-
endedAt:
|
|
14377
|
+
kind: z10.literal("session"),
|
|
14378
|
+
startedAt: z10.string().min(1),
|
|
14379
|
+
endedAt: z10.string().min(1).optional()
|
|
14073
14380
|
});
|
|
14074
|
-
var provenanceMemoryNodeSchema =
|
|
14381
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
14075
14382
|
...provenanceNodeBaseFields,
|
|
14076
|
-
kind:
|
|
14077
|
-
memoryType:
|
|
14078
|
-
recordedAt:
|
|
14383
|
+
kind: z10.literal("memory"),
|
|
14384
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
14385
|
+
recordedAt: z10.string().min(1)
|
|
14079
14386
|
});
|
|
14080
|
-
var provenanceNodeSchema =
|
|
14387
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
14081
14388
|
provenanceDocNodeSchema,
|
|
14082
14389
|
provenanceTaskNodeSchema,
|
|
14083
14390
|
provenanceDecisionNodeSchema,
|
|
14084
14391
|
provenanceSessionNodeSchema,
|
|
14085
14392
|
provenanceMemoryNodeSchema
|
|
14086
14393
|
]);
|
|
14087
|
-
var provenanceEdgeSchema =
|
|
14394
|
+
var provenanceEdgeSchema = z10.object({
|
|
14088
14395
|
relation: provenanceEdgeRelationSchema,
|
|
14089
|
-
from:
|
|
14396
|
+
from: z10.string().min(1),
|
|
14090
14397
|
fromKind: provenanceNodeKindSchema,
|
|
14091
|
-
to:
|
|
14398
|
+
to: z10.string().min(1),
|
|
14092
14399
|
toKind: provenanceNodeKindSchema,
|
|
14093
|
-
addedAt:
|
|
14094
|
-
summary:
|
|
14400
|
+
addedAt: z10.string().min(1),
|
|
14401
|
+
summary: z10.string().optional()
|
|
14095
14402
|
});
|
|
14096
|
-
var docProvenanceResponseSchema =
|
|
14097
|
-
nodes:
|
|
14098
|
-
edges:
|
|
14099
|
-
totalNodes:
|
|
14100
|
-
totalEdges:
|
|
14403
|
+
var docProvenanceResponseSchema = z10.object({
|
|
14404
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
14405
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
14406
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
14407
|
+
totalEdges: z10.number().int().nonnegative()
|
|
14101
14408
|
});
|
|
14102
14409
|
|
|
14103
14410
|
// packages/contracts/src/docs/read.ts
|
|
14104
|
-
import { z as
|
|
14105
|
-
var docFrontmatterSchema =
|
|
14106
|
-
slug:
|
|
14107
|
-
kind:
|
|
14108
|
-
title:
|
|
14109
|
-
summary:
|
|
14110
|
-
lifecycleStatus:
|
|
14111
|
-
docVersion:
|
|
14112
|
-
ownerVersion:
|
|
14113
|
-
supersedes:
|
|
14114
|
-
supersededBy:
|
|
14115
|
-
topics:
|
|
14116
|
-
relatedTasks:
|
|
14117
|
-
sha256:
|
|
14118
|
-
createdAt:
|
|
14411
|
+
import { z as z11 } from "zod";
|
|
14412
|
+
var docFrontmatterSchema = z11.object({
|
|
14413
|
+
slug: z11.string(),
|
|
14414
|
+
kind: z11.string().nullable(),
|
|
14415
|
+
title: z11.string().nullable(),
|
|
14416
|
+
summary: z11.string().nullable(),
|
|
14417
|
+
lifecycleStatus: z11.string(),
|
|
14418
|
+
docVersion: z11.number().int(),
|
|
14419
|
+
ownerVersion: z11.string().nullable(),
|
|
14420
|
+
supersedes: z11.string().nullable(),
|
|
14421
|
+
supersededBy: z11.string().nullable(),
|
|
14422
|
+
topics: z11.array(z11.string()).readonly(),
|
|
14423
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
14424
|
+
sha256: z11.string(),
|
|
14425
|
+
createdAt: z11.string()
|
|
14119
14426
|
});
|
|
14120
|
-
var docBodySchema =
|
|
14121
|
-
encoding:
|
|
14122
|
-
text:
|
|
14123
|
-
base64:
|
|
14124
|
-
sizeBytes:
|
|
14125
|
-
mimeType:
|
|
14427
|
+
var docBodySchema = z11.object({
|
|
14428
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
14429
|
+
text: z11.string().optional(),
|
|
14430
|
+
base64: z11.string().optional(),
|
|
14431
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
14432
|
+
mimeType: z11.string().nullable()
|
|
14126
14433
|
});
|
|
14127
|
-
var docReadResponseSchema =
|
|
14434
|
+
var docReadResponseSchema = z11.object({
|
|
14128
14435
|
frontmatter: docFrontmatterSchema,
|
|
14129
14436
|
body: docBodySchema
|
|
14130
14437
|
});
|
|
@@ -14283,7 +14590,7 @@ var TASK_RELATION_TYPES = [
|
|
|
14283
14590
|
var E_LEAD_TOOLS_UNSTRIPPED = "E_LEAD_TOOLS_UNSTRIPPED";
|
|
14284
14591
|
|
|
14285
14592
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
14286
|
-
import { z as
|
|
14593
|
+
import { z as z12 } from "zod";
|
|
14287
14594
|
var EVIDENCE_ATOM_KINDS = [
|
|
14288
14595
|
"commit",
|
|
14289
14596
|
"files",
|
|
@@ -14305,96 +14612,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
14305
14612
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
14306
14613
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
14307
14614
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
14308
|
-
var commitAtomSchema =
|
|
14309
|
-
kind:
|
|
14310
|
-
sha:
|
|
14615
|
+
var commitAtomSchema = z12.object({
|
|
14616
|
+
kind: z12.literal("commit"),
|
|
14617
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
14311
14618
|
});
|
|
14312
|
-
var filesAtomSchema =
|
|
14313
|
-
kind:
|
|
14314
|
-
paths:
|
|
14619
|
+
var filesAtomSchema = z12.object({
|
|
14620
|
+
kind: z12.literal("files"),
|
|
14621
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
14315
14622
|
});
|
|
14316
|
-
var testRunAtomSchema =
|
|
14317
|
-
kind:
|
|
14318
|
-
path:
|
|
14623
|
+
var testRunAtomSchema = z12.object({
|
|
14624
|
+
kind: z12.literal("test-run"),
|
|
14625
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
14319
14626
|
});
|
|
14320
|
-
var qaRunAtomSchema =
|
|
14321
|
-
kind:
|
|
14322
|
-
path:
|
|
14627
|
+
var qaRunAtomSchema = z12.object({
|
|
14628
|
+
kind: z12.literal("qa-run"),
|
|
14629
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
14323
14630
|
});
|
|
14324
|
-
var toolAtomSchema =
|
|
14325
|
-
kind:
|
|
14326
|
-
tool:
|
|
14631
|
+
var toolAtomSchema = z12.object({
|
|
14632
|
+
kind: z12.literal("tool"),
|
|
14633
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
14327
14634
|
});
|
|
14328
|
-
var urlAtomSchema =
|
|
14329
|
-
kind:
|
|
14330
|
-
url:
|
|
14635
|
+
var urlAtomSchema = z12.object({
|
|
14636
|
+
kind: z12.literal("url"),
|
|
14637
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
14331
14638
|
});
|
|
14332
|
-
var noteAtomSchema =
|
|
14333
|
-
kind:
|
|
14334
|
-
note:
|
|
14639
|
+
var noteAtomSchema = z12.object({
|
|
14640
|
+
kind: z12.literal("note"),
|
|
14641
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
14335
14642
|
});
|
|
14336
|
-
var decisionAtomSchema =
|
|
14337
|
-
kind:
|
|
14338
|
-
decisionId:
|
|
14643
|
+
var decisionAtomSchema = z12.object({
|
|
14644
|
+
kind: z12.literal("decision"),
|
|
14645
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
14339
14646
|
});
|
|
14340
|
-
var prAtomSchema =
|
|
14341
|
-
kind:
|
|
14342
|
-
prNumber:
|
|
14343
|
-
componentPrNumber:
|
|
14647
|
+
var prAtomSchema = z12.object({
|
|
14648
|
+
kind: z12.literal("pr"),
|
|
14649
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
14650
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14344
14651
|
/**
|
|
14345
14652
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
14346
14653
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
14347
14654
|
* `origin`, since PR numbers are only unique per repository.
|
|
14348
14655
|
*/
|
|
14349
|
-
repo:
|
|
14656
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14350
14657
|
});
|
|
14351
|
-
var ciAtomSchema =
|
|
14352
|
-
kind:
|
|
14353
|
-
prNumber:
|
|
14354
|
-
componentPrNumber:
|
|
14658
|
+
var ciAtomSchema = z12.object({
|
|
14659
|
+
kind: z12.literal("ci"),
|
|
14660
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
14661
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14355
14662
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
14356
|
-
repo:
|
|
14663
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14357
14664
|
});
|
|
14358
|
-
var ciRunAtomSchema =
|
|
14359
|
-
kind:
|
|
14360
|
-
runId:
|
|
14665
|
+
var ciRunAtomSchema = z12.object({
|
|
14666
|
+
kind: z12.literal("ci-run"),
|
|
14667
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
14361
14668
|
});
|
|
14362
|
-
var deployAtomSchema =
|
|
14363
|
-
kind:
|
|
14364
|
-
provider:
|
|
14365
|
-
deploymentId:
|
|
14366
|
-
sha:
|
|
14367
|
-
probeUrl:
|
|
14669
|
+
var deployAtomSchema = z12.object({
|
|
14670
|
+
kind: z12.literal("deploy"),
|
|
14671
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
14672
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
14673
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
14674
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
14368
14675
|
});
|
|
14369
|
-
var locDropAtomSchema =
|
|
14370
|
-
kind:
|
|
14371
|
-
fromLines:
|
|
14372
|
-
toLines:
|
|
14676
|
+
var locDropAtomSchema = z12.object({
|
|
14677
|
+
kind: z12.literal("loc-drop"),
|
|
14678
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
14679
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
14373
14680
|
});
|
|
14374
|
-
var callsiteCoverageAtomSchema =
|
|
14375
|
-
kind:
|
|
14376
|
-
symbolName:
|
|
14377
|
-
relativeSourcePath:
|
|
14681
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
14682
|
+
kind: z12.literal("callsite-coverage"),
|
|
14683
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
14684
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
14378
14685
|
});
|
|
14379
14686
|
var 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}$/;
|
|
14380
14687
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
14381
14688
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
14382
14689
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
14383
|
-
var satisfiesAtomSchema =
|
|
14384
|
-
kind:
|
|
14690
|
+
var satisfiesAtomSchema = z12.object({
|
|
14691
|
+
kind: z12.literal("satisfies"),
|
|
14385
14692
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
14386
|
-
targetTaskId:
|
|
14693
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
14387
14694
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
14388
|
-
targetAcId:
|
|
14695
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
14389
14696
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
14390
|
-
targetAcAlias:
|
|
14697
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
14391
14698
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
14392
|
-
versionPin:
|
|
14699
|
+
versionPin: z12.string().regex(
|
|
14393
14700
|
SATISFIES_VERSION_PIN_REGEX,
|
|
14394
14701
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
14395
14702
|
).optional()
|
|
14396
14703
|
});
|
|
14397
|
-
var EvidenceAtomSchema =
|
|
14704
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
14398
14705
|
commitAtomSchema,
|
|
14399
14706
|
filesAtomSchema,
|
|
14400
14707
|
testRunAtomSchema,
|
|
@@ -14456,54 +14763,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
14456
14763
|
});
|
|
14457
14764
|
|
|
14458
14765
|
// packages/contracts/src/evidence-record-schema.ts
|
|
14459
|
-
import { z as
|
|
14460
|
-
var evidenceBaseSchema =
|
|
14766
|
+
import { z as z13 } from "zod";
|
|
14767
|
+
var evidenceBaseSchema = z13.object({
|
|
14461
14768
|
/** Identity string of the agent that produced this record. */
|
|
14462
|
-
agentIdentity:
|
|
14769
|
+
agentIdentity: z13.string().min(1),
|
|
14463
14770
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
14464
|
-
attachmentSha256:
|
|
14771
|
+
attachmentSha256: z13.string().length(64),
|
|
14465
14772
|
/** ISO 8601 timestamp at which the action ran. */
|
|
14466
|
-
ranAt:
|
|
14773
|
+
ranAt: z13.string().datetime(),
|
|
14467
14774
|
/** Wall-clock duration of the action in milliseconds. */
|
|
14468
|
-
durationMs:
|
|
14775
|
+
durationMs: z13.number().nonnegative()
|
|
14469
14776
|
});
|
|
14470
14777
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
14471
|
-
kind:
|
|
14472
|
-
phase:
|
|
14473
|
-
filesChanged:
|
|
14474
|
-
linesAdded:
|
|
14475
|
-
linesRemoved:
|
|
14778
|
+
kind: z13.literal("impl-diff"),
|
|
14779
|
+
phase: z13.literal("implement"),
|
|
14780
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
14781
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
14782
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
14476
14783
|
});
|
|
14477
14784
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
14478
|
-
kind:
|
|
14479
|
-
phase:
|
|
14480
|
-
reqIdsChecked:
|
|
14481
|
-
passed:
|
|
14482
|
-
details:
|
|
14785
|
+
kind: z13.literal("validate-spec-check"),
|
|
14786
|
+
phase: z13.literal("validate"),
|
|
14787
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
14788
|
+
passed: z13.boolean(),
|
|
14789
|
+
details: z13.string().min(1)
|
|
14483
14790
|
});
|
|
14484
14791
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14485
|
-
kind:
|
|
14486
|
-
phase:
|
|
14487
|
-
command:
|
|
14488
|
-
exitCode:
|
|
14489
|
-
testsPassed:
|
|
14490
|
-
testsFailed:
|
|
14792
|
+
kind: z13.literal("test-output"),
|
|
14793
|
+
phase: z13.literal("test"),
|
|
14794
|
+
command: z13.string().min(1),
|
|
14795
|
+
exitCode: z13.number().int(),
|
|
14796
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
14797
|
+
testsFailed: z13.number().int().nonnegative()
|
|
14491
14798
|
});
|
|
14492
14799
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
14493
|
-
kind:
|
|
14494
|
-
phase:
|
|
14495
|
-
tool:
|
|
14496
|
-
passed:
|
|
14497
|
-
warnings:
|
|
14498
|
-
errors:
|
|
14800
|
+
kind: z13.literal("lint-report"),
|
|
14801
|
+
phase: z13.enum(["implement", "test"]),
|
|
14802
|
+
tool: z13.string().min(1),
|
|
14803
|
+
passed: z13.boolean(),
|
|
14804
|
+
warnings: z13.number().int().nonnegative(),
|
|
14805
|
+
errors: z13.number().int().nonnegative()
|
|
14499
14806
|
});
|
|
14500
14807
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14501
|
-
kind:
|
|
14502
|
-
phase:
|
|
14503
|
-
cmd:
|
|
14504
|
-
exitCode:
|
|
14808
|
+
kind: z13.literal("command-output"),
|
|
14809
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
14810
|
+
cmd: z13.string().min(1),
|
|
14811
|
+
exitCode: z13.number().int()
|
|
14505
14812
|
});
|
|
14506
|
-
var evidenceRecordSchema =
|
|
14813
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
14507
14814
|
implDiffRecordSchema,
|
|
14508
14815
|
validateSpecCheckRecordSchema,
|
|
14509
14816
|
testOutputRecordSchema,
|
|
@@ -15438,107 +15745,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
15438
15745
|
});
|
|
15439
15746
|
|
|
15440
15747
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
15441
|
-
import { z as
|
|
15442
|
-
var LeaseScopeSchema =
|
|
15443
|
-
var LeaseLaneSchema =
|
|
15444
|
-
var LeaseAcquireRequestSchema =
|
|
15748
|
+
import { z as z14 } from "zod";
|
|
15749
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
15750
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
15751
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
15445
15752
|
/** Tag discriminating this request variant. */
|
|
15446
|
-
kind:
|
|
15753
|
+
kind: z14.literal("lease_acquire"),
|
|
15447
15754
|
/** The cleo.db scope being arbitrated. */
|
|
15448
15755
|
scope: LeaseScopeSchema,
|
|
15449
15756
|
/** The write lane within the scope. */
|
|
15450
15757
|
lane: LeaseLaneSchema,
|
|
15451
15758
|
/** Process+lane holder identity. */
|
|
15452
|
-
holder_id:
|
|
15759
|
+
holder_id: z14.string().min(1),
|
|
15453
15760
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
15454
|
-
priority:
|
|
15761
|
+
priority: z14.number().int().min(0).max(255),
|
|
15455
15762
|
/** Lease time-to-live in milliseconds. */
|
|
15456
|
-
ttl_ms:
|
|
15763
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15457
15764
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
15458
|
-
reentrant:
|
|
15765
|
+
reentrant: z14.boolean()
|
|
15459
15766
|
}).strict();
|
|
15460
|
-
var LeaseReleaseRequestSchema =
|
|
15767
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
15461
15768
|
/** Tag discriminating this request variant. */
|
|
15462
|
-
kind:
|
|
15769
|
+
kind: z14.literal("lease_release"),
|
|
15463
15770
|
/** The cleo.db scope being arbitrated. */
|
|
15464
15771
|
scope: LeaseScopeSchema,
|
|
15465
15772
|
/** The write lane within the scope. */
|
|
15466
15773
|
lane: LeaseLaneSchema,
|
|
15467
15774
|
/** Process+lane holder identity. */
|
|
15468
|
-
holder_id:
|
|
15775
|
+
holder_id: z14.string().min(1),
|
|
15469
15776
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
15470
|
-
epoch:
|
|
15777
|
+
epoch: z14.number().int().nonnegative()
|
|
15471
15778
|
}).strict();
|
|
15472
|
-
var LeaseRenewRequestSchema =
|
|
15779
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
15473
15780
|
/** Tag discriminating this request variant. */
|
|
15474
|
-
kind:
|
|
15781
|
+
kind: z14.literal("lease_renew"),
|
|
15475
15782
|
/** The cleo.db scope being arbitrated. */
|
|
15476
15783
|
scope: LeaseScopeSchema,
|
|
15477
15784
|
/** The write lane within the scope. */
|
|
15478
15785
|
lane: LeaseLaneSchema,
|
|
15479
15786
|
/** Process+lane holder identity. */
|
|
15480
|
-
holder_id:
|
|
15787
|
+
holder_id: z14.string().min(1),
|
|
15481
15788
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
15482
|
-
epoch:
|
|
15789
|
+
epoch: z14.number().int().nonnegative()
|
|
15483
15790
|
}).strict();
|
|
15484
|
-
var RateCheckRequestSchema =
|
|
15791
|
+
var RateCheckRequestSchema = z14.object({
|
|
15485
15792
|
/** Tag discriminating this request variant. */
|
|
15486
|
-
kind:
|
|
15793
|
+
kind: z14.literal("rate_check"),
|
|
15487
15794
|
/** The cleo.db scope being checked. */
|
|
15488
15795
|
scope: LeaseScopeSchema,
|
|
15489
15796
|
/** The write lane within the scope. */
|
|
15490
15797
|
lane: LeaseLaneSchema,
|
|
15491
15798
|
/** Estimated bytes the caller intends to write. */
|
|
15492
|
-
est_bytes:
|
|
15799
|
+
est_bytes: z14.number().int().nonnegative()
|
|
15493
15800
|
}).strict();
|
|
15494
|
-
var ToolGrantRequestSchema =
|
|
15801
|
+
var ToolGrantRequestSchema = z14.object({
|
|
15495
15802
|
/** Tag discriminating this request variant. */
|
|
15496
|
-
kind:
|
|
15803
|
+
kind: z14.literal("tool_grant"),
|
|
15497
15804
|
/** The tool name being requested. */
|
|
15498
|
-
tool:
|
|
15805
|
+
tool: z14.string().min(1),
|
|
15499
15806
|
/** The requesting holder identity. */
|
|
15500
|
-
holder_id:
|
|
15807
|
+
holder_id: z14.string().min(1)
|
|
15501
15808
|
}).strict();
|
|
15502
|
-
var QueuePriorityClassSchema =
|
|
15503
|
-
var QueueAdmitRequestSchema =
|
|
15809
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
15810
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
15504
15811
|
/** Tag discriminating this request variant. */
|
|
15505
|
-
kind:
|
|
15812
|
+
kind: z14.literal("queue_admit"),
|
|
15506
15813
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
15507
|
-
provider:
|
|
15814
|
+
provider: z14.string().min(1),
|
|
15508
15815
|
/** The caller's priority class (lead > worker > background). */
|
|
15509
15816
|
priority_class: QueuePriorityClassSchema,
|
|
15510
15817
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
15511
|
-
est_tokens:
|
|
15818
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
15512
15819
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
15513
|
-
child_id:
|
|
15820
|
+
child_id: z14.string().min(1)
|
|
15514
15821
|
}).strict();
|
|
15515
|
-
var WorkerHeartbeatRequestSchema =
|
|
15822
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
15516
15823
|
/** Tag discriminating this request variant. */
|
|
15517
|
-
kind:
|
|
15824
|
+
kind: z14.literal("worker_heartbeat"),
|
|
15518
15825
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
15519
|
-
child_id:
|
|
15826
|
+
child_id: z14.string().min(1),
|
|
15520
15827
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
15521
|
-
in_flight_llm:
|
|
15828
|
+
in_flight_llm: z14.boolean()
|
|
15522
15829
|
}).strict();
|
|
15523
|
-
var ResourceAdmitRequestSchema =
|
|
15830
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
15524
15831
|
/** Tag discriminating this request variant. */
|
|
15525
|
-
kind:
|
|
15832
|
+
kind: z14.literal("resource_admit"),
|
|
15526
15833
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
15527
|
-
class:
|
|
15834
|
+
class: z14.string().min(1),
|
|
15528
15835
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
15529
|
-
holder_id:
|
|
15836
|
+
holder_id: z14.string().min(1),
|
|
15530
15837
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
15531
|
-
budget:
|
|
15838
|
+
budget: z14.number().int().nonnegative()
|
|
15532
15839
|
}).strict();
|
|
15533
|
-
var ResourceReleaseRequestSchema =
|
|
15840
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
15534
15841
|
/** Tag discriminating this request variant. */
|
|
15535
|
-
kind:
|
|
15842
|
+
kind: z14.literal("resource_release"),
|
|
15536
15843
|
/** The resource class the slot belongs to. */
|
|
15537
|
-
class:
|
|
15844
|
+
class: z14.string().min(1),
|
|
15538
15845
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
15539
|
-
holder_id:
|
|
15846
|
+
holder_id: z14.string().min(1)
|
|
15540
15847
|
}).strict();
|
|
15541
|
-
var LeaseIpcRequestSchema =
|
|
15848
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
15542
15849
|
LeaseAcquireRequestSchema,
|
|
15543
15850
|
LeaseReleaseRequestSchema,
|
|
15544
15851
|
LeaseRenewRequestSchema,
|
|
@@ -15549,133 +15856,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
15549
15856
|
ResourceAdmitRequestSchema,
|
|
15550
15857
|
ResourceReleaseRequestSchema
|
|
15551
15858
|
]);
|
|
15552
|
-
var LeaseGrantedResponseSchema =
|
|
15859
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
15553
15860
|
/** Tag discriminating this response variant. */
|
|
15554
|
-
kind:
|
|
15861
|
+
kind: z14.literal("lease_granted"),
|
|
15555
15862
|
/** The granted cleo.db scope. */
|
|
15556
15863
|
scope: LeaseScopeSchema,
|
|
15557
15864
|
/** The granted write lane. */
|
|
15558
15865
|
lane: LeaseLaneSchema,
|
|
15559
15866
|
/** The holder the lease was granted to. */
|
|
15560
|
-
holder_id:
|
|
15867
|
+
holder_id: z14.string().min(1),
|
|
15561
15868
|
/** The monotonic epoch fence assigned to this grant. */
|
|
15562
|
-
epoch:
|
|
15869
|
+
epoch: z14.number().int().nonnegative(),
|
|
15563
15870
|
/** The lease TTL in milliseconds. */
|
|
15564
|
-
ttl_ms:
|
|
15871
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15565
15872
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
15566
|
-
expires_at_ms:
|
|
15873
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
15567
15874
|
}).strict();
|
|
15568
|
-
var LeaseQueuedResponseSchema =
|
|
15875
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
15569
15876
|
/** Tag discriminating this response variant. */
|
|
15570
|
-
kind:
|
|
15877
|
+
kind: z14.literal("lease_queued"),
|
|
15571
15878
|
/** The queued cleo.db scope. */
|
|
15572
15879
|
scope: LeaseScopeSchema,
|
|
15573
15880
|
/** The queued write lane. */
|
|
15574
15881
|
lane: LeaseLaneSchema,
|
|
15575
15882
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
15576
|
-
ticket:
|
|
15883
|
+
ticket: z14.number().int().nonnegative(),
|
|
15577
15884
|
/** Number of waiters ahead of this one. */
|
|
15578
|
-
ahead:
|
|
15885
|
+
ahead: z14.number().int().nonnegative()
|
|
15579
15886
|
}).strict();
|
|
15580
|
-
var LeaseDeniedResponseSchema =
|
|
15887
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
15581
15888
|
/** Tag discriminating this response variant. */
|
|
15582
|
-
kind:
|
|
15889
|
+
kind: z14.literal("lease_denied"),
|
|
15583
15890
|
/** The denied cleo.db scope. */
|
|
15584
15891
|
scope: LeaseScopeSchema,
|
|
15585
15892
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
15586
|
-
code:
|
|
15893
|
+
code: z14.string().min(1),
|
|
15587
15894
|
/** Human-readable denial message. */
|
|
15588
|
-
message:
|
|
15895
|
+
message: z14.string()
|
|
15589
15896
|
}).strict();
|
|
15590
|
-
var RateResultResponseSchema =
|
|
15897
|
+
var RateResultResponseSchema = z14.object({
|
|
15591
15898
|
/** Tag discriminating this response variant. */
|
|
15592
|
-
kind:
|
|
15899
|
+
kind: z14.literal("rate_result"),
|
|
15593
15900
|
/** The checked cleo.db scope. */
|
|
15594
15901
|
scope: LeaseScopeSchema,
|
|
15595
15902
|
/** Whether the write is within budget. */
|
|
15596
|
-
ok:
|
|
15903
|
+
ok: z14.boolean(),
|
|
15597
15904
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
15598
|
-
retry_after_ms:
|
|
15905
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15599
15906
|
/** Remaining token budget for the scope. */
|
|
15600
|
-
tokens_remaining:
|
|
15907
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
15601
15908
|
}).strict();
|
|
15602
|
-
var ToolGrantedResponseSchema =
|
|
15909
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
15603
15910
|
/** Tag discriminating this response variant. */
|
|
15604
|
-
kind:
|
|
15911
|
+
kind: z14.literal("tool_granted"),
|
|
15605
15912
|
/** The granted tool name. */
|
|
15606
|
-
tool:
|
|
15913
|
+
tool: z14.string().min(1),
|
|
15607
15914
|
/** The holder the tool grant was issued to. */
|
|
15608
|
-
holder_id:
|
|
15915
|
+
holder_id: z14.string().min(1)
|
|
15609
15916
|
}).strict();
|
|
15610
|
-
var LeaseRevokedResponseSchema =
|
|
15917
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
15611
15918
|
/** Tag discriminating this response variant. */
|
|
15612
|
-
kind:
|
|
15919
|
+
kind: z14.literal("lease_revoked"),
|
|
15613
15920
|
/** The revoked cleo.db scope. */
|
|
15614
15921
|
scope: LeaseScopeSchema,
|
|
15615
15922
|
/** The revoked write lane. */
|
|
15616
15923
|
lane: LeaseLaneSchema,
|
|
15617
15924
|
/** The holder whose lease was revoked. */
|
|
15618
|
-
holder_id:
|
|
15925
|
+
holder_id: z14.string().min(1),
|
|
15619
15926
|
/** Human-readable reason for the revocation. */
|
|
15620
|
-
reason:
|
|
15927
|
+
reason: z14.string()
|
|
15621
15928
|
}).strict();
|
|
15622
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
15929
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
15623
15930
|
/** Tag discriminating this response variant. */
|
|
15624
|
-
kind:
|
|
15931
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
15625
15932
|
/** Logical id of the killed child. */
|
|
15626
|
-
child_id:
|
|
15933
|
+
child_id: z14.string().min(1),
|
|
15627
15934
|
/** The holder identity the killed child held the lease as. */
|
|
15628
|
-
holder_id:
|
|
15935
|
+
holder_id: z14.string().min(1),
|
|
15629
15936
|
/** The cleo.db scope the killed child held the lease in. */
|
|
15630
15937
|
scope: LeaseScopeSchema,
|
|
15631
15938
|
/** Human-readable reason for the kill. */
|
|
15632
|
-
reason:
|
|
15939
|
+
reason: z14.string()
|
|
15633
15940
|
}).strict();
|
|
15634
|
-
var QueueAdmitDispositionSchema =
|
|
15635
|
-
var QueueAdmitResultResponseSchema =
|
|
15941
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15942
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
15636
15943
|
/** Tag discriminating this response variant. */
|
|
15637
|
-
kind:
|
|
15944
|
+
kind: z14.literal("queue_admit_result"),
|
|
15638
15945
|
/** Whether the LLM call was admitted or deferred. */
|
|
15639
15946
|
disposition: QueueAdmitDispositionSchema,
|
|
15640
15947
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15641
|
-
retry_after_ms:
|
|
15948
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15642
15949
|
/** Remaining provider token budget after this decision. */
|
|
15643
|
-
tokens_remaining:
|
|
15950
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
15644
15951
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
15645
|
-
queue_position:
|
|
15952
|
+
queue_position: z14.number().int().nonnegative()
|
|
15646
15953
|
}).strict();
|
|
15647
|
-
var HeartbeatAckResponseSchema =
|
|
15954
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
15648
15955
|
/** Tag discriminating this response variant. */
|
|
15649
|
-
kind:
|
|
15956
|
+
kind: z14.literal("heartbeat_ack")
|
|
15650
15957
|
}).strict();
|
|
15651
|
-
var ResourceAdmitDispositionSchema =
|
|
15652
|
-
var ResourceAdmitResultResponseSchema =
|
|
15958
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
15959
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
15653
15960
|
/** Tag discriminating this response variant. */
|
|
15654
|
-
kind:
|
|
15961
|
+
kind: z14.literal("resource_admit_result"),
|
|
15655
15962
|
/** Whether the heavy op was admitted or deferred. */
|
|
15656
15963
|
disposition: ResourceAdmitDispositionSchema,
|
|
15657
15964
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15658
|
-
retry_after_ms:
|
|
15965
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15659
15966
|
/** Remaining slots for the class after this decision. */
|
|
15660
|
-
slots_remaining:
|
|
15967
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15661
15968
|
}).strict();
|
|
15662
|
-
var ResourceReleaseResultResponseSchema =
|
|
15969
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
15663
15970
|
/** Tag discriminating this response variant. */
|
|
15664
|
-
kind:
|
|
15971
|
+
kind: z14.literal("resource_release_result"),
|
|
15665
15972
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
15666
|
-
released:
|
|
15973
|
+
released: z14.boolean(),
|
|
15667
15974
|
/** Remaining in-flight holders for the class after the release. */
|
|
15668
|
-
slots_remaining:
|
|
15975
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15669
15976
|
}).strict();
|
|
15670
|
-
var LeaseErrorResponseSchema =
|
|
15977
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
15671
15978
|
/** Tag discriminating this response variant. */
|
|
15672
|
-
kind:
|
|
15979
|
+
kind: z14.literal("error"),
|
|
15673
15980
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
15674
|
-
code:
|
|
15981
|
+
code: z14.string().min(1),
|
|
15675
15982
|
/** Human-readable error message. */
|
|
15676
|
-
message:
|
|
15983
|
+
message: z14.string()
|
|
15677
15984
|
}).strict();
|
|
15678
|
-
var LeaseIpcResponseSchema =
|
|
15985
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
15679
15986
|
LeaseGrantedResponseSchema,
|
|
15680
15987
|
LeaseQueuedResponseSchema,
|
|
15681
15988
|
LeaseDeniedResponseSchema,
|
|
@@ -15689,27 +15996,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
15689
15996
|
ResourceReleaseResultResponseSchema,
|
|
15690
15997
|
LeaseErrorResponseSchema
|
|
15691
15998
|
]);
|
|
15692
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
15999
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
15693
16000
|
/** Parallel protocol version. */
|
|
15694
|
-
protocol_version:
|
|
16001
|
+
protocol_version: z14.string(),
|
|
15695
16002
|
/** Correlation id echoed back on the matching response. */
|
|
15696
|
-
id:
|
|
16003
|
+
id: z14.string().min(1),
|
|
15697
16004
|
/** Direction discriminator. */
|
|
15698
|
-
direction:
|
|
16005
|
+
direction: z14.literal("request"),
|
|
15699
16006
|
/** The request body. */
|
|
15700
16007
|
request: LeaseIpcRequestSchema
|
|
15701
16008
|
}).strict();
|
|
15702
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
16009
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
15703
16010
|
/** Parallel protocol version. */
|
|
15704
|
-
protocol_version:
|
|
16011
|
+
protocol_version: z14.string(),
|
|
15705
16012
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
15706
|
-
id:
|
|
16013
|
+
id: z14.string().min(1),
|
|
15707
16014
|
/** Direction discriminator. */
|
|
15708
|
-
direction:
|
|
16015
|
+
direction: z14.literal("response"),
|
|
15709
16016
|
/** The response body. */
|
|
15710
16017
|
response: LeaseIpcResponseSchema
|
|
15711
16018
|
}).strict();
|
|
15712
|
-
var LeaseIpcEnvelopeSchema =
|
|
16019
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
15713
16020
|
LeaseIpcRequestEnvelopeSchema,
|
|
15714
16021
|
LeaseIpcResponseEnvelopeSchema
|
|
15715
16022
|
]);
|
|
@@ -15744,7 +16051,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
15744
16051
|
];
|
|
15745
16052
|
|
|
15746
16053
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
15747
|
-
import { z as
|
|
16054
|
+
import { z as z15 } from "zod";
|
|
15748
16055
|
var CATALOG_MODEL_STATUSES = [
|
|
15749
16056
|
"stable",
|
|
15750
16057
|
"beta",
|
|
@@ -15753,78 +16060,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
15753
16060
|
"retired"
|
|
15754
16061
|
];
|
|
15755
16062
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
15756
|
-
var isoDate =
|
|
15757
|
-
var semver =
|
|
15758
|
-
var catalogModalitiesSchema =
|
|
15759
|
-
input:
|
|
15760
|
-
output:
|
|
16063
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
16064
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
16065
|
+
var catalogModalitiesSchema = z15.object({
|
|
16066
|
+
input: z15.array(z15.string()),
|
|
16067
|
+
output: z15.array(z15.string())
|
|
15761
16068
|
}).strict();
|
|
15762
|
-
var catalogCostSchema =
|
|
15763
|
-
input:
|
|
15764
|
-
output:
|
|
15765
|
-
cache_read:
|
|
15766
|
-
cache_write:
|
|
15767
|
-
context_over_200k:
|
|
16069
|
+
var catalogCostSchema = z15.object({
|
|
16070
|
+
input: z15.number().optional(),
|
|
16071
|
+
output: z15.number().optional(),
|
|
16072
|
+
cache_read: z15.number().optional(),
|
|
16073
|
+
cache_write: z15.number().optional(),
|
|
16074
|
+
context_over_200k: z15.number().optional()
|
|
15768
16075
|
}).strict();
|
|
15769
|
-
var catalogLimitSchema =
|
|
15770
|
-
context:
|
|
15771
|
-
output:
|
|
16076
|
+
var catalogLimitSchema = z15.object({
|
|
16077
|
+
context: z15.number(),
|
|
16078
|
+
output: z15.number()
|
|
15772
16079
|
}).strict();
|
|
15773
|
-
var catalogModelProviderSchema =
|
|
15774
|
-
npm:
|
|
15775
|
-
api:
|
|
16080
|
+
var catalogModelProviderSchema = z15.object({
|
|
16081
|
+
npm: z15.string(),
|
|
16082
|
+
api: z15.string()
|
|
15776
16083
|
}).strict();
|
|
15777
|
-
var catalogModelEntrySchema =
|
|
15778
|
-
id:
|
|
15779
|
-
name:
|
|
15780
|
-
family:
|
|
15781
|
-
attachment:
|
|
15782
|
-
reasoning:
|
|
15783
|
-
temperature:
|
|
15784
|
-
interleaved:
|
|
15785
|
-
tool_call:
|
|
16084
|
+
var catalogModelEntrySchema = z15.object({
|
|
16085
|
+
id: z15.string(),
|
|
16086
|
+
name: z15.string(),
|
|
16087
|
+
family: z15.string(),
|
|
16088
|
+
attachment: z15.boolean(),
|
|
16089
|
+
reasoning: z15.boolean(),
|
|
16090
|
+
temperature: z15.boolean(),
|
|
16091
|
+
interleaved: z15.boolean(),
|
|
16092
|
+
tool_call: z15.boolean(),
|
|
15786
16093
|
modalities: catalogModalitiesSchema,
|
|
15787
16094
|
cost: catalogCostSchema,
|
|
15788
16095
|
limit: catalogLimitSchema,
|
|
15789
|
-
status:
|
|
16096
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15790
16097
|
release_date: isoDate,
|
|
15791
16098
|
provider: catalogModelProviderSchema
|
|
15792
16099
|
}).strict();
|
|
15793
|
-
var catalogProviderSchema =
|
|
15794
|
-
id:
|
|
15795
|
-
endpoint:
|
|
15796
|
-
authTypes:
|
|
15797
|
-
npm:
|
|
16100
|
+
var catalogProviderSchema = z15.object({
|
|
16101
|
+
id: z15.string(),
|
|
16102
|
+
endpoint: z15.string(),
|
|
16103
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
16104
|
+
npm: z15.string().optional()
|
|
15798
16105
|
}).strict();
|
|
15799
|
-
var curatedCatalogSchema =
|
|
15800
|
-
$schema:
|
|
16106
|
+
var curatedCatalogSchema = z15.object({
|
|
16107
|
+
$schema: z15.string().optional(),
|
|
15801
16108
|
version: semver,
|
|
15802
16109
|
lastUpdated: isoDate,
|
|
15803
|
-
providers:
|
|
15804
|
-
models:
|
|
16110
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
16111
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
15805
16112
|
}).strict();
|
|
15806
|
-
var modelsCatalogRowInsertSchema =
|
|
15807
|
-
id:
|
|
15808
|
-
providerId:
|
|
15809
|
-
name:
|
|
15810
|
-
family:
|
|
15811
|
-
attachment:
|
|
15812
|
-
reasoning:
|
|
15813
|
-
temperature:
|
|
15814
|
-
interleaved:
|
|
15815
|
-
toolCall:
|
|
15816
|
-
modalities:
|
|
15817
|
-
cost:
|
|
15818
|
-
contextLimit:
|
|
15819
|
-
outputLimit:
|
|
15820
|
-
status:
|
|
16113
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
16114
|
+
id: z15.string(),
|
|
16115
|
+
providerId: z15.string(),
|
|
16116
|
+
name: z15.string(),
|
|
16117
|
+
family: z15.string(),
|
|
16118
|
+
attachment: z15.boolean(),
|
|
16119
|
+
reasoning: z15.boolean(),
|
|
16120
|
+
temperature: z15.boolean(),
|
|
16121
|
+
interleaved: z15.boolean(),
|
|
16122
|
+
toolCall: z15.boolean(),
|
|
16123
|
+
modalities: z15.string(),
|
|
16124
|
+
cost: z15.string(),
|
|
16125
|
+
contextLimit: z15.number().nullable().optional(),
|
|
16126
|
+
outputLimit: z15.number().nullable().optional(),
|
|
16127
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15821
16128
|
releaseDate: isoDate,
|
|
15822
|
-
modelsDevId:
|
|
15823
|
-
source:
|
|
15824
|
-
seededAt:
|
|
16129
|
+
modelsDevId: z15.string(),
|
|
16130
|
+
source: z15.string(),
|
|
16131
|
+
seededAt: z15.string().optional()
|
|
15825
16132
|
}).strict();
|
|
15826
16133
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
15827
|
-
seededAt:
|
|
16134
|
+
seededAt: z15.string()
|
|
15828
16135
|
});
|
|
15829
16136
|
|
|
15830
16137
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -15872,7 +16179,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
15872
16179
|
];
|
|
15873
16180
|
|
|
15874
16181
|
// packages/contracts/src/workgraph.ts
|
|
15875
|
-
import { z as
|
|
16182
|
+
import { z as z16 } from "zod";
|
|
15876
16183
|
|
|
15877
16184
|
// packages/contracts/src/status-registry.ts
|
|
15878
16185
|
var TASK_STATUSES = [
|
|
@@ -15887,10 +16194,10 @@ var TASK_STATUSES = [
|
|
|
15887
16194
|
|
|
15888
16195
|
// packages/contracts/src/workgraph.ts
|
|
15889
16196
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
15890
|
-
var taskTypeSchema =
|
|
15891
|
-
var taskPrioritySchema =
|
|
15892
|
-
var taskStatusSchema =
|
|
15893
|
-
var verificationGateSchema =
|
|
16197
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
16198
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
16199
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
16200
|
+
var verificationGateSchema = z16.enum([
|
|
15894
16201
|
"implemented",
|
|
15895
16202
|
"testsPassed",
|
|
15896
16203
|
"qaPassed",
|
|
@@ -15899,7 +16206,7 @@ var verificationGateSchema = z15.enum([
|
|
|
15899
16206
|
"documented",
|
|
15900
16207
|
"nexusImpact"
|
|
15901
16208
|
]);
|
|
15902
|
-
var workGraphRelationKindSchema =
|
|
16209
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
15903
16210
|
"contains",
|
|
15904
16211
|
"depends_on",
|
|
15905
16212
|
"blocks",
|
|
@@ -15907,317 +16214,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
15907
16214
|
"groups",
|
|
15908
16215
|
"satisfies"
|
|
15909
16216
|
]);
|
|
15910
|
-
var workGraphTraversalDirectionSchema =
|
|
16217
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
15911
16218
|
"ancestors",
|
|
15912
16219
|
"descendants",
|
|
15913
16220
|
"upstream",
|
|
15914
16221
|
"downstream"
|
|
15915
16222
|
]);
|
|
15916
|
-
var workGraphEdgeDirectionSchema =
|
|
15917
|
-
var paginationParamsSchema =
|
|
15918
|
-
cursor:
|
|
15919
|
-
limit:
|
|
16223
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
16224
|
+
var paginationParamsSchema = z16.object({
|
|
16225
|
+
cursor: z16.string().min(1).optional(),
|
|
16226
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
15920
16227
|
});
|
|
15921
|
-
var workGraphNodeSchema =
|
|
15922
|
-
id:
|
|
16228
|
+
var workGraphNodeSchema = z16.object({
|
|
16229
|
+
id: z16.string().min(1),
|
|
15923
16230
|
type: taskTypeSchema,
|
|
15924
|
-
title:
|
|
16231
|
+
title: z16.string(),
|
|
15925
16232
|
status: taskStatusSchema,
|
|
15926
16233
|
priority: taskPrioritySchema,
|
|
15927
|
-
parentId:
|
|
16234
|
+
parentId: z16.string().min(1).optional()
|
|
15928
16235
|
});
|
|
15929
|
-
var workGraphEdgeSchema =
|
|
15930
|
-
fromId:
|
|
15931
|
-
toId:
|
|
16236
|
+
var workGraphEdgeSchema = z16.object({
|
|
16237
|
+
fromId: z16.string().min(1),
|
|
16238
|
+
toId: z16.string().min(1),
|
|
15932
16239
|
kind: workGraphRelationKindSchema
|
|
15933
16240
|
});
|
|
15934
|
-
var workGraphHierarchyEdgeSchema =
|
|
15935
|
-
fromId:
|
|
15936
|
-
toId:
|
|
15937
|
-
kind:
|
|
16241
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
16242
|
+
fromId: z16.string().min(1),
|
|
16243
|
+
toId: z16.string().min(1),
|
|
16244
|
+
kind: z16.literal("contains")
|
|
15938
16245
|
}).strict();
|
|
15939
|
-
var workGraphPageInfoSchema =
|
|
15940
|
-
nextCursor:
|
|
15941
|
-
hasMore:
|
|
16246
|
+
var workGraphPageInfoSchema = z16.object({
|
|
16247
|
+
nextCursor: z16.string().min(1).optional(),
|
|
16248
|
+
hasMore: z16.boolean()
|
|
15942
16249
|
});
|
|
15943
|
-
var workGraphRollupCountsSchema =
|
|
15944
|
-
total:
|
|
15945
|
-
byStatus:
|
|
15946
|
-
byType:
|
|
16250
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
16251
|
+
total: z16.number().int().nonnegative(),
|
|
16252
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
16253
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
15947
16254
|
});
|
|
15948
|
-
var workGraphSubtreePercentagesSchema =
|
|
15949
|
-
done:
|
|
15950
|
-
active:
|
|
15951
|
-
blocked:
|
|
15952
|
-
pending:
|
|
15953
|
-
cancelled:
|
|
16255
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
16256
|
+
done: z16.number().nonnegative(),
|
|
16257
|
+
active: z16.number().nonnegative(),
|
|
16258
|
+
blocked: z16.number().nonnegative(),
|
|
16259
|
+
pending: z16.number().nonnegative(),
|
|
16260
|
+
cancelled: z16.number().nonnegative()
|
|
15954
16261
|
});
|
|
15955
|
-
var workGraphProjectionMismatchSchema =
|
|
15956
|
-
field:
|
|
15957
|
-
expected:
|
|
15958
|
-
actual:
|
|
16262
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
16263
|
+
field: z16.string().min(1),
|
|
16264
|
+
expected: z16.number().int().nonnegative(),
|
|
16265
|
+
actual: z16.number().int().nonnegative()
|
|
15959
16266
|
});
|
|
15960
16267
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
15961
|
-
role:
|
|
15962
|
-
dependencyBlockers:
|
|
15963
|
-
gateBlockers:
|
|
16268
|
+
role: z16.string().min(1).optional(),
|
|
16269
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
16270
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
15964
16271
|
});
|
|
15965
16272
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
15966
|
-
source:
|
|
15967
|
-
relationType:
|
|
15968
|
-
reason:
|
|
16273
|
+
source: z16.literal("relation"),
|
|
16274
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
16275
|
+
reason: z16.string().min(1).optional()
|
|
15969
16276
|
});
|
|
15970
16277
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
15971
|
-
source:
|
|
15972
|
-
kind:
|
|
16278
|
+
source: z16.literal("dependency"),
|
|
16279
|
+
kind: z16.literal("depends_on")
|
|
15973
16280
|
});
|
|
15974
|
-
var workGraphOmissionReasonSchema =
|
|
16281
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
15975
16282
|
"budget_exceeded",
|
|
15976
16283
|
"not_requested",
|
|
15977
16284
|
"not_available",
|
|
15978
16285
|
"redacted",
|
|
15979
16286
|
"truncated"
|
|
15980
16287
|
]);
|
|
15981
|
-
var workGraphContextBudgetSchema =
|
|
15982
|
-
tokenBudget:
|
|
15983
|
-
estimatedTokens:
|
|
15984
|
-
remainingTokens:
|
|
15985
|
-
truncated:
|
|
16288
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
16289
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
16290
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16291
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
16292
|
+
truncated: z16.boolean()
|
|
15986
16293
|
});
|
|
15987
|
-
var workGraphOmissionSchema =
|
|
15988
|
-
path:
|
|
16294
|
+
var workGraphOmissionSchema = z16.object({
|
|
16295
|
+
path: z16.string().min(1),
|
|
15989
16296
|
reason: workGraphOmissionReasonSchema,
|
|
15990
|
-
message:
|
|
15991
|
-
estimatedTokens:
|
|
16297
|
+
message: z16.string().min(1),
|
|
16298
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
15992
16299
|
});
|
|
15993
|
-
var workGraphDirectEdgeSchema =
|
|
16300
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
15994
16301
|
workGraphRelationEdgeSchema,
|
|
15995
16302
|
workGraphDependencyEdgeSchema
|
|
15996
16303
|
]);
|
|
15997
16304
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
15998
|
-
rootId:
|
|
15999
|
-
tokenBudget:
|
|
16000
|
-
includeRelations:
|
|
16001
|
-
includeReadiness:
|
|
16002
|
-
includeRollup:
|
|
16305
|
+
rootId: z16.string().min(1),
|
|
16306
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16307
|
+
includeRelations: z16.boolean().optional(),
|
|
16308
|
+
includeReadiness: z16.boolean().optional(),
|
|
16309
|
+
includeRollup: z16.boolean().optional()
|
|
16003
16310
|
});
|
|
16004
16311
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
16005
|
-
rootId:
|
|
16312
|
+
rootId: z16.string().min(1),
|
|
16006
16313
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
16007
|
-
maxDepth:
|
|
16008
|
-
includeRelations:
|
|
16314
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16315
|
+
includeRelations: z16.boolean().optional()
|
|
16009
16316
|
});
|
|
16010
|
-
var workGraphSliceSchema =
|
|
16011
|
-
rootId:
|
|
16317
|
+
var workGraphSliceSchema = z16.object({
|
|
16318
|
+
rootId: z16.string().min(1),
|
|
16012
16319
|
direction: workGraphTraversalDirectionSchema,
|
|
16013
|
-
nodes:
|
|
16014
|
-
edges:
|
|
16320
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16321
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
16015
16322
|
pageInfo: workGraphPageInfoSchema,
|
|
16016
|
-
omissions:
|
|
16323
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
16017
16324
|
});
|
|
16018
|
-
var workGraphReadinessParamsSchema =
|
|
16019
|
-
rootId:
|
|
16020
|
-
role:
|
|
16021
|
-
includeGateBlockers:
|
|
16325
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
16326
|
+
rootId: z16.string().min(1),
|
|
16327
|
+
role: z16.string().min(1).optional(),
|
|
16328
|
+
includeGateBlockers: z16.boolean().optional()
|
|
16022
16329
|
});
|
|
16023
|
-
var workGraphReadinessResultSchema =
|
|
16024
|
-
rootId:
|
|
16025
|
-
role:
|
|
16026
|
-
ready:
|
|
16027
|
-
warnings:
|
|
16028
|
-
groups:
|
|
16029
|
-
ready:
|
|
16030
|
-
blocked:
|
|
16031
|
-
blockedBy:
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
kind:
|
|
16035
|
-
blockerId:
|
|
16036
|
-
blocks:
|
|
16330
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
16331
|
+
rootId: z16.string().min(1),
|
|
16332
|
+
role: z16.string().min(1).optional(),
|
|
16333
|
+
ready: z16.boolean(),
|
|
16334
|
+
warnings: z16.array(z16.string()),
|
|
16335
|
+
groups: z16.object({
|
|
16336
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16337
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16338
|
+
blockedBy: z16.array(
|
|
16339
|
+
z16.discriminatedUnion("kind", [
|
|
16340
|
+
z16.object({
|
|
16341
|
+
kind: z16.literal("dependency"),
|
|
16342
|
+
blockerId: z16.string().min(1),
|
|
16343
|
+
blocks: z16.array(z16.string().min(1))
|
|
16037
16344
|
}),
|
|
16038
|
-
|
|
16039
|
-
kind:
|
|
16345
|
+
z16.object({
|
|
16346
|
+
kind: z16.literal("gate"),
|
|
16040
16347
|
gate: verificationGateSchema,
|
|
16041
|
-
blocks:
|
|
16348
|
+
blocks: z16.array(z16.string().min(1))
|
|
16042
16349
|
})
|
|
16043
16350
|
])
|
|
16044
16351
|
)
|
|
16045
16352
|
})
|
|
16046
16353
|
});
|
|
16047
|
-
var workGraphContextPackSchema =
|
|
16048
|
-
rootId:
|
|
16049
|
-
generatedAt:
|
|
16354
|
+
var workGraphContextPackSchema = z16.object({
|
|
16355
|
+
rootId: z16.string().min(1),
|
|
16356
|
+
generatedAt: z16.string().min(1),
|
|
16050
16357
|
budget: workGraphContextBudgetSchema,
|
|
16051
16358
|
slice: workGraphSliceSchema,
|
|
16052
|
-
relationEdges:
|
|
16053
|
-
rootId:
|
|
16359
|
+
relationEdges: z16.object({
|
|
16360
|
+
rootId: z16.string().min(1),
|
|
16054
16361
|
direction: workGraphEdgeDirectionSchema,
|
|
16055
|
-
edges:
|
|
16362
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
16056
16363
|
}).optional(),
|
|
16057
16364
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
16058
|
-
rollup:
|
|
16059
|
-
omissions:
|
|
16365
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
16366
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
16060
16367
|
});
|
|
16061
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
16062
|
-
rootId:
|
|
16063
|
-
nodes:
|
|
16064
|
-
|
|
16065
|
-
id:
|
|
16368
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
16369
|
+
rootId: z16.string().min(1),
|
|
16370
|
+
nodes: z16.array(
|
|
16371
|
+
z16.object({
|
|
16372
|
+
id: z16.string().min(1),
|
|
16066
16373
|
type: taskTypeSchema,
|
|
16067
|
-
parentId:
|
|
16374
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
16068
16375
|
})
|
|
16069
16376
|
),
|
|
16070
|
-
edges:
|
|
16071
|
-
dryRun:
|
|
16377
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
16378
|
+
dryRun: z16.boolean().optional()
|
|
16072
16379
|
});
|
|
16073
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
16074
|
-
code:
|
|
16075
|
-
message:
|
|
16076
|
-
taskId:
|
|
16077
|
-
severity:
|
|
16380
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
16381
|
+
code: z16.string().min(1),
|
|
16382
|
+
message: z16.string().min(1),
|
|
16383
|
+
taskId: z16.string().min(1).optional(),
|
|
16384
|
+
severity: z16.enum(["error", "warning"])
|
|
16078
16385
|
});
|
|
16079
|
-
var workGraphScaffoldValidateResultSchema =
|
|
16080
|
-
rootId:
|
|
16081
|
-
valid:
|
|
16082
|
-
dryRun:
|
|
16083
|
-
issues:
|
|
16084
|
-
hierarchy:
|
|
16085
|
-
valid:
|
|
16086
|
-
violations:
|
|
16087
|
-
|
|
16088
|
-
code:
|
|
16089
|
-
taskId:
|
|
16386
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
16387
|
+
rootId: z16.string().min(1),
|
|
16388
|
+
valid: z16.boolean(),
|
|
16389
|
+
dryRun: z16.boolean(),
|
|
16390
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
16391
|
+
hierarchy: z16.object({
|
|
16392
|
+
valid: z16.boolean(),
|
|
16393
|
+
violations: z16.array(
|
|
16394
|
+
z16.object({
|
|
16395
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16396
|
+
taskId: z16.string().min(1),
|
|
16090
16397
|
taskType: taskTypeSchema,
|
|
16091
|
-
parentId:
|
|
16398
|
+
parentId: z16.string().min(1).nullable(),
|
|
16092
16399
|
parentType: taskTypeSchema.optional(),
|
|
16093
|
-
message:
|
|
16400
|
+
message: z16.string().min(1)
|
|
16094
16401
|
})
|
|
16095
16402
|
)
|
|
16096
16403
|
})
|
|
16097
16404
|
});
|
|
16098
16405
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
16099
|
-
apply:
|
|
16406
|
+
apply: z16.boolean().optional()
|
|
16100
16407
|
});
|
|
16101
16408
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
16102
|
-
applied:
|
|
16103
|
-
nodesChanged:
|
|
16104
|
-
edgesChanged:
|
|
16409
|
+
applied: z16.boolean(),
|
|
16410
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
16411
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
16105
16412
|
});
|
|
16106
|
-
var workGraphPlanningDocParamsSchema =
|
|
16107
|
-
rootId:
|
|
16108
|
-
audience:
|
|
16109
|
-
tokenBudget:
|
|
16110
|
-
includeRelations:
|
|
16111
|
-
includeReadiness:
|
|
16112
|
-
includeRollup:
|
|
16413
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
16414
|
+
rootId: z16.string().min(1),
|
|
16415
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16416
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16417
|
+
includeRelations: z16.boolean().optional(),
|
|
16418
|
+
includeReadiness: z16.boolean().optional(),
|
|
16419
|
+
includeRollup: z16.boolean().optional()
|
|
16113
16420
|
});
|
|
16114
|
-
var workGraphPlanningDocSchema =
|
|
16115
|
-
rootId:
|
|
16116
|
-
generatedAt:
|
|
16117
|
-
audience:
|
|
16118
|
-
title:
|
|
16119
|
-
content:
|
|
16120
|
-
sections:
|
|
16121
|
-
estimatedTokens:
|
|
16122
|
-
budget:
|
|
16123
|
-
tokenBudget:
|
|
16124
|
-
truncated:
|
|
16421
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
16422
|
+
rootId: z16.string().min(1),
|
|
16423
|
+
generatedAt: z16.string().min(1),
|
|
16424
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16425
|
+
title: z16.string().min(1),
|
|
16426
|
+
content: z16.string(),
|
|
16427
|
+
sections: z16.array(z16.string().min(1)),
|
|
16428
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16429
|
+
budget: z16.object({
|
|
16430
|
+
tokenBudget: z16.number().int().positive(),
|
|
16431
|
+
truncated: z16.boolean()
|
|
16125
16432
|
}).optional()
|
|
16126
16433
|
});
|
|
16127
16434
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
16128
|
-
rootId:
|
|
16435
|
+
rootId: z16.string().min(1),
|
|
16129
16436
|
direction: workGraphTraversalDirectionSchema,
|
|
16130
|
-
maxDepth:
|
|
16131
|
-
includeRelations:
|
|
16437
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16438
|
+
includeRelations: z16.boolean().optional()
|
|
16132
16439
|
});
|
|
16133
|
-
var tasksTraverseResultSchema =
|
|
16134
|
-
rootId:
|
|
16440
|
+
var tasksTraverseResultSchema = z16.object({
|
|
16441
|
+
rootId: z16.string().min(1),
|
|
16135
16442
|
direction: workGraphTraversalDirectionSchema,
|
|
16136
|
-
nodes:
|
|
16137
|
-
edges:
|
|
16443
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16444
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
16138
16445
|
pageInfo: workGraphPageInfoSchema
|
|
16139
16446
|
});
|
|
16140
16447
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
16141
|
-
rootId:
|
|
16142
|
-
maxDepth:
|
|
16448
|
+
rootId: z16.string().min(1),
|
|
16449
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
16143
16450
|
});
|
|
16144
|
-
var tasksTreeResultSchema =
|
|
16145
|
-
rootId:
|
|
16146
|
-
nodes:
|
|
16147
|
-
edges:
|
|
16451
|
+
var tasksTreeResultSchema = z16.object({
|
|
16452
|
+
rootId: z16.string().min(1),
|
|
16453
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
16454
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
16148
16455
|
pageInfo: workGraphPageInfoSchema
|
|
16149
16456
|
});
|
|
16150
|
-
var tasksRollupParamsSchema =
|
|
16151
|
-
rootId:
|
|
16457
|
+
var tasksRollupParamsSchema = z16.object({
|
|
16458
|
+
rootId: z16.string().min(1),
|
|
16152
16459
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
16153
16460
|
});
|
|
16154
|
-
var tasksRollupResultSchema =
|
|
16155
|
-
rootId:
|
|
16461
|
+
var tasksRollupResultSchema = z16.object({
|
|
16462
|
+
rootId: z16.string().min(1),
|
|
16156
16463
|
direct: workGraphRollupCountsSchema,
|
|
16157
16464
|
subtree: workGraphRollupCountsSchema,
|
|
16158
|
-
percentDenominator:
|
|
16159
|
-
basis:
|
|
16160
|
-
total:
|
|
16161
|
-
description:
|
|
16465
|
+
percentDenominator: z16.object({
|
|
16466
|
+
basis: z16.literal("subtree-total"),
|
|
16467
|
+
total: z16.number().int().nonnegative(),
|
|
16468
|
+
description: z16.string().min(1)
|
|
16162
16469
|
}),
|
|
16163
16470
|
percentages: workGraphSubtreePercentagesSchema,
|
|
16164
|
-
staleProjection:
|
|
16165
|
-
projectionMismatches:
|
|
16471
|
+
staleProjection: z16.boolean(),
|
|
16472
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
16166
16473
|
});
|
|
16167
|
-
var tasksFrontierParamsSchema =
|
|
16168
|
-
rootId:
|
|
16169
|
-
role:
|
|
16474
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
16475
|
+
rootId: z16.string().min(1),
|
|
16476
|
+
role: z16.string().min(1).optional()
|
|
16170
16477
|
});
|
|
16171
|
-
var tasksFrontierResultSchema =
|
|
16172
|
-
rootId:
|
|
16173
|
-
role:
|
|
16174
|
-
groups:
|
|
16175
|
-
ready:
|
|
16176
|
-
blocked:
|
|
16177
|
-
blockedBy:
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
kind:
|
|
16181
|
-
blockerId:
|
|
16182
|
-
blocks:
|
|
16478
|
+
var tasksFrontierResultSchema = z16.object({
|
|
16479
|
+
rootId: z16.string().min(1),
|
|
16480
|
+
role: z16.string().min(1).optional(),
|
|
16481
|
+
groups: z16.object({
|
|
16482
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16483
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16484
|
+
blockedBy: z16.array(
|
|
16485
|
+
z16.discriminatedUnion("kind", [
|
|
16486
|
+
z16.object({
|
|
16487
|
+
kind: z16.literal("dependency"),
|
|
16488
|
+
blockerId: z16.string().min(1),
|
|
16489
|
+
blocks: z16.array(z16.string().min(1))
|
|
16183
16490
|
}),
|
|
16184
|
-
|
|
16185
|
-
kind:
|
|
16491
|
+
z16.object({
|
|
16492
|
+
kind: z16.literal("gate"),
|
|
16186
16493
|
gate: verificationGateSchema,
|
|
16187
|
-
blocks:
|
|
16494
|
+
blocks: z16.array(z16.string().min(1))
|
|
16188
16495
|
})
|
|
16189
16496
|
])
|
|
16190
16497
|
)
|
|
16191
16498
|
})
|
|
16192
16499
|
});
|
|
16193
16500
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
16194
|
-
rootId:
|
|
16195
|
-
maxDepth:
|
|
16196
|
-
includeRelations:
|
|
16501
|
+
rootId: z16.string().min(1),
|
|
16502
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16503
|
+
includeRelations: z16.boolean().optional()
|
|
16197
16504
|
});
|
|
16198
|
-
var tasksWorkGraphAuditResultSchema =
|
|
16199
|
-
rootId:
|
|
16200
|
-
hierarchy:
|
|
16201
|
-
valid:
|
|
16202
|
-
violations:
|
|
16203
|
-
|
|
16204
|
-
code:
|
|
16205
|
-
taskId:
|
|
16505
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
16506
|
+
rootId: z16.string().min(1),
|
|
16507
|
+
hierarchy: z16.object({
|
|
16508
|
+
valid: z16.boolean(),
|
|
16509
|
+
violations: z16.array(
|
|
16510
|
+
z16.object({
|
|
16511
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16512
|
+
taskId: z16.string().min(1),
|
|
16206
16513
|
taskType: taskTypeSchema,
|
|
16207
|
-
parentId:
|
|
16514
|
+
parentId: z16.string().min(1).nullable(),
|
|
16208
16515
|
parentType: taskTypeSchema.optional(),
|
|
16209
|
-
message:
|
|
16516
|
+
message: z16.string().min(1)
|
|
16210
16517
|
})
|
|
16211
16518
|
)
|
|
16212
16519
|
}),
|
|
16213
16520
|
traversal: tasksTraverseResultSchema,
|
|
16214
16521
|
frontier: tasksFrontierResultSchema,
|
|
16215
16522
|
rollup: tasksRollupResultSchema,
|
|
16216
|
-
relationEdges:
|
|
16217
|
-
rootId:
|
|
16523
|
+
relationEdges: z16.object({
|
|
16524
|
+
rootId: z16.string().min(1),
|
|
16218
16525
|
direction: workGraphEdgeDirectionSchema,
|
|
16219
|
-
edges:
|
|
16220
|
-
|
|
16526
|
+
edges: z16.array(
|
|
16527
|
+
z16.discriminatedUnion("source", [
|
|
16221
16528
|
workGraphRelationEdgeSchema,
|
|
16222
16529
|
workGraphDependencyEdgeSchema
|
|
16223
16530
|
])
|
|
@@ -16226,60 +16533,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
16226
16533
|
});
|
|
16227
16534
|
|
|
16228
16535
|
// packages/contracts/src/operations/docs.ts
|
|
16229
|
-
import { z as
|
|
16230
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
16231
|
-
version:
|
|
16232
|
-
operation:
|
|
16233
|
-
identity:
|
|
16234
|
-
projectId:
|
|
16235
|
-
projectRoot:
|
|
16236
|
-
actor:
|
|
16237
|
-
operation:
|
|
16238
|
-
idempotencyKey:
|
|
16536
|
+
import { z as z17 } from "zod";
|
|
16537
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
16538
|
+
version: z17.literal(1),
|
|
16539
|
+
operation: z17.literal("docs.projection"),
|
|
16540
|
+
identity: z17.object({
|
|
16541
|
+
projectId: z17.string().min(1),
|
|
16542
|
+
projectRoot: z17.string().min(1),
|
|
16543
|
+
actor: z17.string().min(1),
|
|
16544
|
+
operation: z17.literal("docs.projection"),
|
|
16545
|
+
idempotencyKey: z17.string().min(1)
|
|
16239
16546
|
}).strict(),
|
|
16240
|
-
source:
|
|
16241
|
-
attachmentId:
|
|
16242
|
-
sha256:
|
|
16243
|
-
ownerId:
|
|
16244
|
-
ownerType:
|
|
16245
|
-
label:
|
|
16547
|
+
source: z17.object({
|
|
16548
|
+
attachmentId: z17.string().min(1),
|
|
16549
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16550
|
+
ownerId: z17.string().min(1),
|
|
16551
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
16552
|
+
label: z17.string().min(1)
|
|
16246
16553
|
}).strict(),
|
|
16247
|
-
observation:
|
|
16248
|
-
kind:
|
|
16249
|
-
attachmentId:
|
|
16250
|
-
ownerId:
|
|
16251
|
-
addedAt:
|
|
16252
|
-
slug:
|
|
16253
|
-
type:
|
|
16554
|
+
observation: z17.object({
|
|
16555
|
+
kind: z17.literal("doc-attachment"),
|
|
16556
|
+
attachmentId: z17.string().min(1),
|
|
16557
|
+
ownerId: z17.string().min(1),
|
|
16558
|
+
addedAt: z17.string().min(1),
|
|
16559
|
+
slug: z17.string().optional(),
|
|
16560
|
+
type: z17.string().optional()
|
|
16254
16561
|
}).strict()
|
|
16255
16562
|
}).strict();
|
|
16256
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
16257
|
-
version:
|
|
16258
|
-
sourceHash:
|
|
16259
|
-
graph:
|
|
16563
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
16564
|
+
version: z17.literal(1),
|
|
16565
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16566
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
16260
16567
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
16261
|
-
observationId:
|
|
16568
|
+
observationId: z17.string().min(1).optional(),
|
|
16262
16569
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
16263
|
-
documents:
|
|
16264
|
-
verifiedAt:
|
|
16265
|
-
actor:
|
|
16570
|
+
documents: z17.literal(true).optional(),
|
|
16571
|
+
verifiedAt: z17.string().min(1),
|
|
16572
|
+
actor: z17.string().min(1)
|
|
16266
16573
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
16267
16574
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
16268
16575
|
});
|
|
16269
16576
|
|
|
16270
16577
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
16271
|
-
import { z as
|
|
16272
|
-
var taskTreeEntrySchema =
|
|
16273
|
-
title:
|
|
16274
|
-
acceptance:
|
|
16578
|
+
import { z as z18 } from "zod";
|
|
16579
|
+
var taskTreeEntrySchema = z18.object({
|
|
16580
|
+
title: z18.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
|
|
16581
|
+
acceptance: z18.array(z18.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), {
|
|
16275
16582
|
message: "acceptance array contains no non-empty strings"
|
|
16276
16583
|
}),
|
|
16277
|
-
id:
|
|
16278
|
-
parentId:
|
|
16279
|
-
depends:
|
|
16584
|
+
id: z18.string().optional(),
|
|
16585
|
+
parentId: z18.string().optional(),
|
|
16586
|
+
depends: z18.array(z18.string()).optional()
|
|
16280
16587
|
});
|
|
16281
|
-
var taskTreeSchema =
|
|
16282
|
-
var evidenceSchema =
|
|
16588
|
+
var taskTreeSchema = z18.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" });
|
|
16589
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
16283
16590
|
if (value === null || value === void 0) {
|
|
16284
16591
|
ctx.addIssue({
|
|
16285
16592
|
code: "custom",
|
|
@@ -16313,7 +16620,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
16313
16620
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
16314
16621
|
});
|
|
16315
16622
|
});
|
|
16316
|
-
var passthroughSchema =
|
|
16623
|
+
var passthroughSchema = z18.unknown();
|
|
16317
16624
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
16318
16625
|
// release.cantbook
|
|
16319
16626
|
"version_bump_report",
|
|
@@ -16346,44 +16653,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
16346
16653
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
16347
16654
|
|
|
16348
16655
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
16349
|
-
import { z as
|
|
16350
|
-
var parsedPrEvidenceAtomSchema =
|
|
16351
|
-
kind:
|
|
16352
|
-
prNumber:
|
|
16656
|
+
import { z as z19 } from "zod";
|
|
16657
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
16658
|
+
kind: z19.literal("pr"),
|
|
16659
|
+
prNumber: z19.number().int().positive()
|
|
16353
16660
|
});
|
|
16354
|
-
var prEvidenceStateModifierSchema =
|
|
16355
|
-
kind:
|
|
16356
|
-
value:
|
|
16661
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
16662
|
+
kind: z19.literal("state"),
|
|
16663
|
+
value: z19.literal("MERGED")
|
|
16357
16664
|
});
|
|
16358
|
-
var ghPrViewSchema =
|
|
16359
|
-
state:
|
|
16360
|
-
mergedAt:
|
|
16361
|
-
headRefOid:
|
|
16362
|
-
mergeCommit:
|
|
16363
|
-
title:
|
|
16364
|
-
body:
|
|
16365
|
-
headRefName:
|
|
16366
|
-
files:
|
|
16367
|
-
changedFiles:
|
|
16368
|
-
mergeable:
|
|
16369
|
-
statusCheckRollup:
|
|
16370
|
-
|
|
16371
|
-
__typename:
|
|
16372
|
-
name:
|
|
16373
|
-
workflowName:
|
|
16374
|
-
conclusion:
|
|
16375
|
-
status:
|
|
16665
|
+
var ghPrViewSchema = z19.object({
|
|
16666
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
16667
|
+
mergedAt: z19.string().nullable(),
|
|
16668
|
+
headRefOid: z19.string().optional(),
|
|
16669
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
16670
|
+
title: z19.string().optional(),
|
|
16671
|
+
body: z19.string().optional(),
|
|
16672
|
+
headRefName: z19.string().optional(),
|
|
16673
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
16674
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
16675
|
+
mergeable: z19.string().optional(),
|
|
16676
|
+
statusCheckRollup: z19.array(
|
|
16677
|
+
z19.object({
|
|
16678
|
+
__typename: z19.string().optional(),
|
|
16679
|
+
name: z19.string().optional(),
|
|
16680
|
+
workflowName: z19.string().optional(),
|
|
16681
|
+
conclusion: z19.string().nullable().optional(),
|
|
16682
|
+
status: z19.string().optional(),
|
|
16376
16683
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16377
|
-
startedAt:
|
|
16684
|
+
startedAt: z19.string().nullable().optional(),
|
|
16378
16685
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16379
|
-
completedAt:
|
|
16686
|
+
completedAt: z19.string().nullable().optional()
|
|
16380
16687
|
}).passthrough()
|
|
16381
16688
|
).optional().default([])
|
|
16382
16689
|
}).passthrough();
|
|
16383
16690
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
16384
16691
|
|
|
16385
16692
|
// packages/contracts/src/release/plan.ts
|
|
16386
|
-
import { z as
|
|
16693
|
+
import { z as z20 } from "zod";
|
|
16387
16694
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
16388
16695
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
16389
16696
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -16427,20 +16734,20 @@ var RESOLVED_SOURCE = [
|
|
|
16427
16734
|
"language-default",
|
|
16428
16735
|
"legacy-alias"
|
|
16429
16736
|
];
|
|
16430
|
-
var ReleaseChannelSchema =
|
|
16431
|
-
var ReleaseSchemeSchema =
|
|
16432
|
-
var ReleaseKindSchema =
|
|
16433
|
-
var ReleaseStatusSchema =
|
|
16434
|
-
var GateStatusSchema =
|
|
16435
|
-
var GateNameSchema =
|
|
16436
|
-
var PlatformTupleSchema =
|
|
16437
|
-
var PublisherSchema =
|
|
16438
|
-
var TaskKindSchema =
|
|
16439
|
-
var ImpactSchema =
|
|
16440
|
-
var ResolvedSourceSchema =
|
|
16441
|
-
var Iso8601 =
|
|
16442
|
-
var NonEmptyString =
|
|
16443
|
-
var ReleasePlanTaskSchema =
|
|
16737
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
16738
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
16739
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
16740
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
16741
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
16742
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
16743
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
16744
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
16745
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
16746
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
16747
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
16748
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
16749
|
+
var NonEmptyString = z20.string().min(1);
|
|
16750
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
16444
16751
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
16445
16752
|
id: NonEmptyString,
|
|
16446
16753
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -16448,20 +16755,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
16448
16755
|
/** SemVer impact classification. */
|
|
16449
16756
|
impact: ImpactSchema,
|
|
16450
16757
|
/** Human-readable changelog line for this task. */
|
|
16451
|
-
userFacingSummary:
|
|
16758
|
+
userFacingSummary: z20.string(),
|
|
16452
16759
|
/**
|
|
16453
16760
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
16454
16761
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
16455
16762
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
16456
16763
|
* enforces non-empty via R-301.
|
|
16457
16764
|
*/
|
|
16458
|
-
evidenceAtoms:
|
|
16765
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
16459
16766
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
16460
|
-
ivtrPhaseAtPlan:
|
|
16767
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
16461
16768
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
16462
16769
|
epicAncestor: NonEmptyString
|
|
16463
16770
|
});
|
|
16464
|
-
var ReleaseGateSchema =
|
|
16771
|
+
var ReleaseGateSchema = z20.object({
|
|
16465
16772
|
/** Canonical gate name. */
|
|
16466
16773
|
name: GateNameSchema,
|
|
16467
16774
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -16471,11 +16778,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
16471
16778
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
16472
16779
|
lastVerifiedAt: Iso8601,
|
|
16473
16780
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
16474
|
-
resolvedCommand:
|
|
16781
|
+
resolvedCommand: z20.string().optional(),
|
|
16475
16782
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
16476
16783
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
16477
16784
|
});
|
|
16478
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
16785
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
16479
16786
|
/** Target platform tuple. */
|
|
16480
16787
|
platform: PlatformTupleSchema,
|
|
16481
16788
|
/** Distribution backend. */
|
|
@@ -16483,47 +16790,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
16483
16790
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
16484
16791
|
package: NonEmptyString,
|
|
16485
16792
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
16486
|
-
smoke:
|
|
16793
|
+
smoke: z20.boolean().default(true).optional()
|
|
16487
16794
|
});
|
|
16488
|
-
var ReleasePreflightSummarySchema =
|
|
16795
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
16489
16796
|
/** True if esbuild externals are out of sync with package.json. */
|
|
16490
|
-
esbuildExternalsDrift:
|
|
16797
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
16491
16798
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
16492
|
-
lockfileDrift:
|
|
16799
|
+
lockfileDrift: z20.boolean(),
|
|
16493
16800
|
/** True if all epic children are in terminal lifecycle states. */
|
|
16494
|
-
epicCompletenessClean:
|
|
16801
|
+
epicCompletenessClean: z20.boolean(),
|
|
16495
16802
|
/** True if no task appears in multiple in-flight release plans. */
|
|
16496
|
-
doubleListingClean:
|
|
16803
|
+
doubleListingClean: z20.boolean(),
|
|
16497
16804
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
16498
|
-
preflightWarnings:
|
|
16805
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
16499
16806
|
});
|
|
16500
|
-
var ReleasePlanChangelogSchema =
|
|
16807
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
16501
16808
|
/** `kind=feat` tasks. */
|
|
16502
|
-
features:
|
|
16809
|
+
features: z20.array(NonEmptyString).default([]),
|
|
16503
16810
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
16504
|
-
fixes:
|
|
16811
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
16505
16812
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
16506
|
-
chores:
|
|
16813
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
16507
16814
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
16508
|
-
breaking:
|
|
16815
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
16509
16816
|
});
|
|
16510
|
-
var ReleasePlanMetaSchema =
|
|
16817
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
16511
16818
|
/** True if this is the project's first ever release. */
|
|
16512
|
-
firstEverRelease:
|
|
16819
|
+
firstEverRelease: z20.boolean().optional(),
|
|
16513
16820
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
16514
|
-
unresolvedTools:
|
|
16821
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
16515
16822
|
/** Project archetype detected at plan time. */
|
|
16516
|
-
archetype:
|
|
16517
|
-
}).catchall(
|
|
16518
|
-
var ReleasePlanSchema =
|
|
16823
|
+
archetype: z20.string().optional()
|
|
16824
|
+
}).catchall(z20.unknown());
|
|
16825
|
+
var ReleasePlanSchema = z20.object({
|
|
16519
16826
|
/** Schema URL for this plan version. */
|
|
16520
|
-
$schema:
|
|
16827
|
+
$schema: z20.string().optional(),
|
|
16521
16828
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
16522
16829
|
version: NonEmptyString,
|
|
16523
16830
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
16524
16831
|
resolvedVersion: NonEmptyString,
|
|
16525
16832
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
16526
|
-
suffixApplied:
|
|
16833
|
+
suffixApplied: z20.boolean(),
|
|
16527
16834
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
16528
16835
|
scheme: ReleaseSchemeSchema,
|
|
16529
16836
|
/** npm dist-tag channel for this release. */
|
|
@@ -16537,7 +16844,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
16537
16844
|
/** Release-kind classification. */
|
|
16538
16845
|
releaseKind: ReleaseKindSchema,
|
|
16539
16846
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
16540
|
-
hooksV1Promotion:
|
|
16847
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
16541
16848
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
16542
16849
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
16543
16850
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -16548,27 +16855,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
16548
16855
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
16549
16856
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
16550
16857
|
*/
|
|
16551
|
-
previousVersion:
|
|
16858
|
+
previousVersion: z20.string().nullable(),
|
|
16552
16859
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
16553
|
-
previousTag:
|
|
16860
|
+
previousTag: z20.string().nullable(),
|
|
16554
16861
|
/** ISO-8601 timestamp the previous release was published. */
|
|
16555
16862
|
previousShippedAt: Iso8601.nullable(),
|
|
16556
16863
|
/** Tasks rolled into this release. */
|
|
16557
|
-
tasks:
|
|
16864
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
16558
16865
|
/** Bucketed changelog. */
|
|
16559
16866
|
changelog: ReleasePlanChangelogSchema,
|
|
16560
16867
|
/** Per-gate verification status. */
|
|
16561
|
-
gates:
|
|
16868
|
+
gates: z20.array(ReleaseGateSchema),
|
|
16562
16869
|
/** Platform / publisher matrix. */
|
|
16563
|
-
platformMatrix:
|
|
16870
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
16564
16871
|
/** Preflight summary from `cleo release plan`. */
|
|
16565
16872
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
16566
16873
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
16567
|
-
workflowRunUrl:
|
|
16874
|
+
workflowRunUrl: z20.string().nullable(),
|
|
16568
16875
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
16569
|
-
prUrl:
|
|
16876
|
+
prUrl: z20.string().nullable(),
|
|
16570
16877
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
16571
|
-
mergeCommitSha:
|
|
16878
|
+
mergeCommitSha: z20.string().nullable(),
|
|
16572
16879
|
/** Current FSM state per R-302. */
|
|
16573
16880
|
status: ReleaseStatusSchema,
|
|
16574
16881
|
/** Informational / forward-compat metadata. */
|
|
@@ -16598,48 +16905,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
16598
16905
|
]);
|
|
16599
16906
|
|
|
16600
16907
|
// packages/contracts/src/session-journal.ts
|
|
16601
|
-
import { z as
|
|
16908
|
+
import { z as z21 } from "zod";
|
|
16602
16909
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
16603
|
-
var sessionJournalDoctorSummarySchema =
|
|
16910
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
16604
16911
|
/** `true` when zero noise patterns were detected. */
|
|
16605
|
-
isClean:
|
|
16912
|
+
isClean: z21.boolean(),
|
|
16606
16913
|
/** Total number of noise findings across all patterns. */
|
|
16607
|
-
findingsCount:
|
|
16914
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
16608
16915
|
/** Pattern names that were detected (empty when isClean). */
|
|
16609
|
-
patterns:
|
|
16916
|
+
patterns: z21.array(z21.string()),
|
|
16610
16917
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
16611
|
-
totalScanned:
|
|
16918
|
+
totalScanned: z21.number().int().nonnegative()
|
|
16612
16919
|
});
|
|
16613
|
-
var sessionJournalDebriefSummarySchema =
|
|
16920
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
16614
16921
|
/** First 200 characters of the session end note (if provided). */
|
|
16615
|
-
noteExcerpt:
|
|
16922
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
16616
16923
|
/** Number of tasks completed during the session. */
|
|
16617
|
-
tasksCompletedCount:
|
|
16924
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
16618
16925
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
16619
|
-
tasksFocused:
|
|
16926
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
16620
16927
|
});
|
|
16621
|
-
var sessionJournalEntrySchema =
|
|
16928
|
+
var sessionJournalEntrySchema = z21.object({
|
|
16622
16929
|
// Identity
|
|
16623
16930
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
16624
|
-
schemaVersion:
|
|
16931
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
16625
16932
|
/** ISO 8601 timestamp when the entry was written. */
|
|
16626
|
-
timestamp:
|
|
16933
|
+
timestamp: z21.string(),
|
|
16627
16934
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
16628
|
-
sessionId:
|
|
16935
|
+
sessionId: z21.string(),
|
|
16629
16936
|
/** Event type that triggered this journal entry. */
|
|
16630
|
-
eventType:
|
|
16937
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
16631
16938
|
// Session metadata (set on session_start / session_end)
|
|
16632
16939
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
16633
|
-
agentIdentifier:
|
|
16940
|
+
agentIdentifier: z21.string().optional(),
|
|
16634
16941
|
/** Provider adapter ID active for this session. */
|
|
16635
|
-
providerId:
|
|
16942
|
+
providerId: z21.string().optional(),
|
|
16636
16943
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
16637
|
-
scope:
|
|
16944
|
+
scope: z21.string().optional(),
|
|
16638
16945
|
// Session-end fields
|
|
16639
16946
|
/** Duration of the session in seconds (session_end only). */
|
|
16640
|
-
duration:
|
|
16947
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
16641
16948
|
/** Task IDs (not titles) completed during the session. */
|
|
16642
|
-
tasksCompleted:
|
|
16949
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
16643
16950
|
// Doctor summary (T1262 absorbed)
|
|
16644
16951
|
/**
|
|
16645
16952
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -16654,52 +16961,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
16654
16961
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
16655
16962
|
// Optional hash chain
|
|
16656
16963
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
16657
|
-
prevEntryHash:
|
|
16964
|
+
prevEntryHash: z21.string().optional()
|
|
16658
16965
|
});
|
|
16659
16966
|
|
|
16660
16967
|
// packages/contracts/src/task-evidence.ts
|
|
16661
|
-
import { z as
|
|
16662
|
-
var fileEvidenceSchema =
|
|
16663
|
-
kind:
|
|
16664
|
-
sha256:
|
|
16665
|
-
timestamp:
|
|
16666
|
-
path:
|
|
16667
|
-
mime:
|
|
16668
|
-
description:
|
|
16968
|
+
import { z as z22 } from "zod";
|
|
16969
|
+
var fileEvidenceSchema = z22.object({
|
|
16970
|
+
kind: z22.literal("file"),
|
|
16971
|
+
sha256: z22.string().length(64),
|
|
16972
|
+
timestamp: z22.string().datetime(),
|
|
16973
|
+
path: z22.string().min(1),
|
|
16974
|
+
mime: z22.string().optional(),
|
|
16975
|
+
description: z22.string().optional()
|
|
16669
16976
|
});
|
|
16670
|
-
var logEvidenceSchema =
|
|
16671
|
-
kind:
|
|
16672
|
-
sha256:
|
|
16673
|
-
timestamp:
|
|
16674
|
-
source:
|
|
16675
|
-
description:
|
|
16977
|
+
var logEvidenceSchema = z22.object({
|
|
16978
|
+
kind: z22.literal("log"),
|
|
16979
|
+
sha256: z22.string().length(64),
|
|
16980
|
+
timestamp: z22.string().datetime(),
|
|
16981
|
+
source: z22.string().min(1),
|
|
16982
|
+
description: z22.string().optional()
|
|
16676
16983
|
});
|
|
16677
|
-
var screenshotEvidenceSchema =
|
|
16678
|
-
kind:
|
|
16679
|
-
sha256:
|
|
16680
|
-
timestamp:
|
|
16681
|
-
mime:
|
|
16682
|
-
description:
|
|
16984
|
+
var screenshotEvidenceSchema = z22.object({
|
|
16985
|
+
kind: z22.literal("screenshot"),
|
|
16986
|
+
sha256: z22.string().length(64),
|
|
16987
|
+
timestamp: z22.string().datetime(),
|
|
16988
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
16989
|
+
description: z22.string().optional()
|
|
16683
16990
|
});
|
|
16684
|
-
var testOutputEvidenceSchema =
|
|
16685
|
-
kind:
|
|
16686
|
-
sha256:
|
|
16687
|
-
timestamp:
|
|
16688
|
-
passed:
|
|
16689
|
-
failed:
|
|
16690
|
-
skipped:
|
|
16691
|
-
exitCode:
|
|
16692
|
-
description:
|
|
16991
|
+
var testOutputEvidenceSchema = z22.object({
|
|
16992
|
+
kind: z22.literal("test-output"),
|
|
16993
|
+
sha256: z22.string().length(64),
|
|
16994
|
+
timestamp: z22.string().datetime(),
|
|
16995
|
+
passed: z22.number().int().nonnegative(),
|
|
16996
|
+
failed: z22.number().int().nonnegative(),
|
|
16997
|
+
skipped: z22.number().int().nonnegative(),
|
|
16998
|
+
exitCode: z22.number().int(),
|
|
16999
|
+
description: z22.string().optional()
|
|
16693
17000
|
});
|
|
16694
|
-
var commandOutputEvidenceSchema =
|
|
16695
|
-
kind:
|
|
16696
|
-
sha256:
|
|
16697
|
-
timestamp:
|
|
16698
|
-
cmd:
|
|
16699
|
-
exitCode:
|
|
16700
|
-
description:
|
|
17001
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
17002
|
+
kind: z22.literal("command-output"),
|
|
17003
|
+
sha256: z22.string().length(64),
|
|
17004
|
+
timestamp: z22.string().datetime(),
|
|
17005
|
+
cmd: z22.string().min(1),
|
|
17006
|
+
exitCode: z22.number().int(),
|
|
17007
|
+
description: z22.string().optional()
|
|
16701
17008
|
});
|
|
16702
|
-
var taskEvidenceSchema =
|
|
17009
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
16703
17010
|
fileEvidenceSchema,
|
|
16704
17011
|
logEvidenceSchema,
|
|
16705
17012
|
screenshotEvidenceSchema,
|
|
@@ -16708,8 +17015,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
16708
17015
|
]);
|
|
16709
17016
|
|
|
16710
17017
|
// packages/contracts/src/tasks/archive.ts
|
|
16711
|
-
import { z as
|
|
16712
|
-
var ArchiveReason =
|
|
17018
|
+
import { z as z23 } from "zod";
|
|
17019
|
+
var ArchiveReason = z23.enum([
|
|
16713
17020
|
"verified",
|
|
16714
17021
|
"reconciled",
|
|
16715
17022
|
"superseded",
|
|
@@ -16720,42 +17027,42 @@ var ArchiveReason = z22.enum([
|
|
|
16720
17027
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
16721
17028
|
|
|
16722
17029
|
// packages/contracts/src/tasks/index.ts
|
|
16723
|
-
import { z as
|
|
16724
|
-
var taskMutationWarningSeveritySchema =
|
|
16725
|
-
var taskMutationWarningSchema =
|
|
16726
|
-
code:
|
|
16727
|
-
message:
|
|
17030
|
+
import { z as z24 } from "zod";
|
|
17031
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
17032
|
+
var taskMutationWarningSchema = z24.object({
|
|
17033
|
+
code: z24.string().min(1),
|
|
17034
|
+
message: z24.string().min(1),
|
|
16728
17035
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
16729
|
-
taskId:
|
|
16730
|
-
field:
|
|
16731
|
-
index:
|
|
17036
|
+
taskId: z24.string().min(1).optional(),
|
|
17037
|
+
field: z24.string().min(1).optional(),
|
|
17038
|
+
index: z24.number().int().nonnegative().optional()
|
|
16732
17039
|
});
|
|
16733
|
-
var taskMutationDryRunSummarySchema =
|
|
16734
|
-
dryRun:
|
|
16735
|
-
wouldCreate:
|
|
16736
|
-
wouldUpdate:
|
|
16737
|
-
wouldDelete:
|
|
16738
|
-
wouldAffect:
|
|
16739
|
-
validatedCount:
|
|
16740
|
-
insertedCount:
|
|
16741
|
-
updatedCount:
|
|
16742
|
-
deletedCount:
|
|
16743
|
-
warnings:
|
|
17040
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
17041
|
+
dryRun: z24.literal(true),
|
|
17042
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
17043
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
17044
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
17045
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
17046
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
17047
|
+
insertedCount: z24.literal(0),
|
|
17048
|
+
updatedCount: z24.literal(0),
|
|
17049
|
+
deletedCount: z24.literal(0),
|
|
17050
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
16744
17051
|
});
|
|
16745
|
-
var taskMutationTaskRecordSchema =
|
|
16746
|
-
var taskMutationEnvelopeSchema =
|
|
16747
|
-
dryRun:
|
|
16748
|
-
created:
|
|
16749
|
-
updated:
|
|
16750
|
-
deleted:
|
|
16751
|
-
affectedCount:
|
|
16752
|
-
mutationWarnings:
|
|
17052
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
17053
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
17054
|
+
dryRun: z24.boolean().optional(),
|
|
17055
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
17056
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
17057
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
17058
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
17059
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
16753
17060
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
16754
17061
|
});
|
|
16755
|
-
var completionTaskStatusSchema =
|
|
16756
|
-
var completionCriterionKindSchema =
|
|
16757
|
-
var completionCriterionStatusSchema =
|
|
16758
|
-
var completionBlockerReasonSchema =
|
|
17062
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
17063
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
17064
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
17065
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
16759
17066
|
"missing_evidence_binding",
|
|
16760
17067
|
"child_not_done",
|
|
16761
17068
|
"child_cancelled_requires_waiver",
|
|
@@ -16763,68 +17070,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
16763
17070
|
"child_missing",
|
|
16764
17071
|
"done_parent_stale"
|
|
16765
17072
|
]);
|
|
16766
|
-
var completionStaleReasonSchema =
|
|
16767
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
17073
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
17074
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
16768
17075
|
"projection_not_stale",
|
|
16769
17076
|
"criteria_missing",
|
|
16770
17077
|
"binding_target_missing",
|
|
16771
17078
|
"repair_conflict"
|
|
16772
17079
|
]);
|
|
16773
|
-
var completionCriterionWaiverSchema =
|
|
16774
|
-
criterionAcId:
|
|
16775
|
-
childTaskId:
|
|
16776
|
-
reason:
|
|
16777
|
-
actor:
|
|
16778
|
-
waivedAt:
|
|
17080
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
17081
|
+
criterionAcId: z24.string().min(1),
|
|
17082
|
+
childTaskId: z24.string().min(1),
|
|
17083
|
+
reason: z24.string().min(1),
|
|
17084
|
+
actor: z24.string().min(1),
|
|
17085
|
+
waivedAt: z24.string().min(1)
|
|
16779
17086
|
});
|
|
16780
|
-
var completionCriterionReplacementSchema =
|
|
16781
|
-
criterionAcId:
|
|
16782
|
-
originalChildTaskId:
|
|
16783
|
-
replacementChildTaskId:
|
|
16784
|
-
reason:
|
|
16785
|
-
actor:
|
|
16786
|
-
replacedAt:
|
|
17087
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
17088
|
+
criterionAcId: z24.string().min(1),
|
|
17089
|
+
originalChildTaskId: z24.string().min(1),
|
|
17090
|
+
replacementChildTaskId: z24.string().min(1),
|
|
17091
|
+
reason: z24.string().min(1),
|
|
17092
|
+
actor: z24.string().min(1),
|
|
17093
|
+
replacedAt: z24.string().min(1)
|
|
16787
17094
|
});
|
|
16788
|
-
var completionCriterionEvaluationSchema =
|
|
16789
|
-
acId:
|
|
16790
|
-
alias:
|
|
16791
|
-
text:
|
|
17095
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
17096
|
+
acId: z24.string().min(1),
|
|
17097
|
+
alias: z24.string().min(1),
|
|
17098
|
+
text: z24.string(),
|
|
16792
17099
|
kind: completionCriterionKindSchema,
|
|
16793
17100
|
status: completionCriterionStatusSchema,
|
|
16794
17101
|
reason: completionBlockerReasonSchema.optional(),
|
|
16795
|
-
targetTaskId:
|
|
17102
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
16796
17103
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
16797
17104
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
16798
17105
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
16799
17106
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
16800
|
-
evidenceBindings:
|
|
17107
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
16801
17108
|
});
|
|
16802
17109
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
16803
|
-
status:
|
|
17110
|
+
status: z24.literal("unsatisfied"),
|
|
16804
17111
|
reason: completionBlockerReasonSchema
|
|
16805
17112
|
});
|
|
16806
|
-
var completionTotalsSchema =
|
|
16807
|
-
criteria:
|
|
16808
|
-
satisfied:
|
|
16809
|
-
unsatisfied:
|
|
16810
|
-
waived:
|
|
16811
|
-
replaced:
|
|
17113
|
+
var completionTotalsSchema = z24.object({
|
|
17114
|
+
criteria: z24.number().int().nonnegative(),
|
|
17115
|
+
satisfied: z24.number().int().nonnegative(),
|
|
17116
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
17117
|
+
waived: z24.number().int().nonnegative(),
|
|
17118
|
+
replaced: z24.number().int().nonnegative()
|
|
16812
17119
|
});
|
|
16813
|
-
var completionContextPackSchema =
|
|
16814
|
-
taskId:
|
|
16815
|
-
generatedAt:
|
|
16816
|
-
source:
|
|
16817
|
-
window:
|
|
16818
|
-
limit:
|
|
16819
|
-
since:
|
|
16820
|
-
relationDepth:
|
|
16821
|
-
relatedTaskIds:
|
|
17120
|
+
var completionContextPackSchema = z24.object({
|
|
17121
|
+
taskId: z24.string().min(1),
|
|
17122
|
+
generatedAt: z24.string().min(1),
|
|
17123
|
+
source: z24.literal("audit_log"),
|
|
17124
|
+
window: z24.object({
|
|
17125
|
+
limit: z24.number().int().positive(),
|
|
17126
|
+
since: z24.string().min(1).optional(),
|
|
17127
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
17128
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
16822
17129
|
}),
|
|
16823
|
-
events:
|
|
16824
|
-
|
|
16825
|
-
id:
|
|
16826
|
-
timestamp:
|
|
16827
|
-
action:
|
|
17130
|
+
events: z24.array(
|
|
17131
|
+
z24.object({
|
|
17132
|
+
id: z24.string().min(1),
|
|
17133
|
+
timestamp: z24.string().min(1),
|
|
17134
|
+
action: z24.enum([
|
|
16828
17135
|
"task_completed",
|
|
16829
17136
|
"task_reopened",
|
|
16830
17137
|
"task_cancelled",
|
|
@@ -16832,77 +17139,77 @@ var completionContextPackSchema = z23.object({
|
|
|
16832
17139
|
"task_reparented",
|
|
16833
17140
|
"ac_projection_rebuilt"
|
|
16834
17141
|
]),
|
|
16835
|
-
taskId:
|
|
16836
|
-
relation:
|
|
16837
|
-
actor:
|
|
16838
|
-
details:
|
|
16839
|
-
before:
|
|
16840
|
-
after:
|
|
17142
|
+
taskId: z24.string().min(1),
|
|
17143
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
17144
|
+
actor: z24.string().min(1),
|
|
17145
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
17146
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
17147
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
16841
17148
|
})
|
|
16842
17149
|
),
|
|
16843
|
-
summary:
|
|
16844
|
-
totalEvents:
|
|
16845
|
-
byAction:
|
|
16846
|
-
byRelation:
|
|
16847
|
-
latestEventAt:
|
|
17150
|
+
summary: z24.object({
|
|
17151
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
17152
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
17153
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
17154
|
+
latestEventAt: z24.string().nullable()
|
|
16848
17155
|
})
|
|
16849
17156
|
});
|
|
16850
|
-
var completionEvaluationSchema =
|
|
16851
|
-
taskId:
|
|
17157
|
+
var completionEvaluationSchema = z24.object({
|
|
17158
|
+
taskId: z24.string().min(1),
|
|
16852
17159
|
taskStatus: completionTaskStatusSchema,
|
|
16853
|
-
ready:
|
|
16854
|
-
stale:
|
|
16855
|
-
staleReasons:
|
|
17160
|
+
ready: z24.boolean(),
|
|
17161
|
+
stale: z24.boolean(),
|
|
17162
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
16856
17163
|
contextPack: completionContextPackSchema.optional(),
|
|
16857
|
-
satisfied:
|
|
16858
|
-
unsatisfied:
|
|
16859
|
-
waived:
|
|
16860
|
-
replaced:
|
|
17164
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
17165
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
17166
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
17167
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
16861
17168
|
totals: completionTotalsSchema
|
|
16862
17169
|
});
|
|
16863
|
-
var completionExplanationSchema =
|
|
16864
|
-
taskId:
|
|
16865
|
-
ready:
|
|
16866
|
-
stale:
|
|
16867
|
-
summary:
|
|
17170
|
+
var completionExplanationSchema = z24.object({
|
|
17171
|
+
taskId: z24.string().min(1),
|
|
17172
|
+
ready: z24.boolean(),
|
|
17173
|
+
stale: z24.boolean(),
|
|
17174
|
+
summary: z24.string(),
|
|
16868
17175
|
contextPack: completionContextPackSchema.optional(),
|
|
16869
|
-
blockers:
|
|
17176
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
16870
17177
|
});
|
|
16871
|
-
var completionListParamsSchema =
|
|
16872
|
-
taskId:
|
|
17178
|
+
var completionListParamsSchema = z24.object({
|
|
17179
|
+
taskId: z24.string().min(1),
|
|
16873
17180
|
status: completionCriterionStatusSchema.optional(),
|
|
16874
17181
|
kind: completionCriterionKindSchema.optional()
|
|
16875
17182
|
});
|
|
16876
|
-
var completionListResultSchema =
|
|
16877
|
-
taskId:
|
|
16878
|
-
criteria:
|
|
17183
|
+
var completionListResultSchema = z24.object({
|
|
17184
|
+
taskId: z24.string().min(1),
|
|
17185
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
16879
17186
|
totals: completionTotalsSchema
|
|
16880
17187
|
});
|
|
16881
|
-
var completionEvaluateParamsSchema =
|
|
16882
|
-
taskId:
|
|
16883
|
-
includeContext:
|
|
16884
|
-
limit:
|
|
16885
|
-
since:
|
|
16886
|
-
relationDepth:
|
|
17188
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
17189
|
+
taskId: z24.string().min(1),
|
|
17190
|
+
includeContext: z24.boolean().optional(),
|
|
17191
|
+
limit: z24.number().int().positive().optional(),
|
|
17192
|
+
since: z24.string().min(1).optional(),
|
|
17193
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
16887
17194
|
});
|
|
16888
|
-
var completionProjectionRepairErrorSchema =
|
|
17195
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
16889
17196
|
code: completionProjectionRepairErrorCodeSchema,
|
|
16890
|
-
message:
|
|
16891
|
-
taskId:
|
|
16892
|
-
acId:
|
|
16893
|
-
evidenceAtomId:
|
|
17197
|
+
message: z24.string().min(1),
|
|
17198
|
+
taskId: z24.string().min(1),
|
|
17199
|
+
acId: z24.string().min(1).optional(),
|
|
17200
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
16894
17201
|
});
|
|
16895
|
-
var completionProjectionRepairParamsSchema =
|
|
16896
|
-
taskId:
|
|
16897
|
-
dryRun:
|
|
17202
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
17203
|
+
taskId: z24.string().min(1),
|
|
17204
|
+
dryRun: z24.boolean().optional()
|
|
16898
17205
|
});
|
|
16899
|
-
var completionProjectionRepairResultSchema =
|
|
16900
|
-
taskId:
|
|
16901
|
-
repaired:
|
|
16902
|
-
dryRun:
|
|
16903
|
-
staleBefore:
|
|
16904
|
-
staleAfter:
|
|
16905
|
-
errors:
|
|
17206
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
17207
|
+
taskId: z24.string().min(1),
|
|
17208
|
+
repaired: z24.boolean(),
|
|
17209
|
+
dryRun: z24.boolean(),
|
|
17210
|
+
staleBefore: z24.boolean(),
|
|
17211
|
+
staleAfter: z24.boolean(),
|
|
17212
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
16906
17213
|
});
|
|
16907
17214
|
|
|
16908
17215
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -17405,7 +17712,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
17405
17712
|
};
|
|
17406
17713
|
|
|
17407
17714
|
// packages/contracts/src/templates/manifest.ts
|
|
17408
|
-
import { z as
|
|
17715
|
+
import { z as z25 } from "zod";
|
|
17409
17716
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
17410
17717
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
17411
17718
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -17422,79 +17729,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
17422
17729
|
"tool-resolver",
|
|
17423
17730
|
"literal"
|
|
17424
17731
|
];
|
|
17425
|
-
var PlaceholderSpecSchema =
|
|
17732
|
+
var PlaceholderSpecSchema = z25.object({
|
|
17426
17733
|
/**
|
|
17427
17734
|
* Placeholder identifier as it appears in the template body
|
|
17428
17735
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
17429
17736
|
*/
|
|
17430
|
-
name:
|
|
17737
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
17431
17738
|
/** Resolver source the installer consults for this placeholder. */
|
|
17432
|
-
source:
|
|
17739
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
17433
17740
|
/**
|
|
17434
17741
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
17435
17742
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
17436
17743
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
17437
17744
|
*/
|
|
17438
|
-
sourcePath:
|
|
17745
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
17439
17746
|
/**
|
|
17440
17747
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
17441
17748
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
17442
17749
|
*/
|
|
17443
|
-
defaultValue:
|
|
17750
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
17444
17751
|
});
|
|
17445
|
-
var TemplateManifestEntrySchema =
|
|
17752
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
17446
17753
|
/** Stable identifier for this template entry. */
|
|
17447
|
-
id:
|
|
17754
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
17448
17755
|
/** Category of file this template represents. */
|
|
17449
|
-
kind:
|
|
17756
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
17450
17757
|
/** Repo-relative path of the template source file. */
|
|
17451
|
-
sourcePath:
|
|
17758
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
17452
17759
|
/** Project-relative path where the rendered template installs. */
|
|
17453
|
-
installPath:
|
|
17760
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
17454
17761
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
17455
|
-
substitution:
|
|
17762
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
17456
17763
|
/** Declared placeholders this template requires. May be empty. */
|
|
17457
|
-
placeholders:
|
|
17764
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
17458
17765
|
/** Reconciliation policy on upgrade. */
|
|
17459
|
-
updateStrategy:
|
|
17766
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
17460
17767
|
});
|
|
17461
17768
|
|
|
17462
17769
|
// packages/contracts/src/validator/index.ts
|
|
17463
|
-
import { z as
|
|
17770
|
+
import { z as z26 } from "zod";
|
|
17464
17771
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
17465
|
-
var validatorFindingSchema =
|
|
17466
|
-
acId:
|
|
17467
|
-
status:
|
|
17468
|
-
reasoning:
|
|
17469
|
-
evidenceRefs:
|
|
17470
|
-
checkedAt:
|
|
17772
|
+
var validatorFindingSchema = z26.object({
|
|
17773
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
17774
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
17775
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
17776
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
17777
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
17471
17778
|
});
|
|
17472
|
-
var validatorAttestationSchema =
|
|
17473
|
-
verdict:
|
|
17474
|
-
taskId:
|
|
17475
|
-
validatorId:
|
|
17476
|
-
findings:
|
|
17779
|
+
var validatorAttestationSchema = z26.object({
|
|
17780
|
+
verdict: z26.literal("attest"),
|
|
17781
|
+
taskId: z26.string().min(1),
|
|
17782
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17783
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
17477
17784
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
17478
17785
|
'attestation requires every finding to have status="pass"'
|
|
17479
17786
|
),
|
|
17480
|
-
summary:
|
|
17481
|
-
attestedAt:
|
|
17482
|
-
schemaVersion:
|
|
17787
|
+
summary: z26.string().optional(),
|
|
17788
|
+
attestedAt: z26.string().min(1),
|
|
17789
|
+
schemaVersion: z26.literal("1")
|
|
17483
17790
|
});
|
|
17484
|
-
var validatorRejectionSchema =
|
|
17485
|
-
verdict:
|
|
17486
|
-
taskId:
|
|
17487
|
-
validatorId:
|
|
17488
|
-
findings:
|
|
17791
|
+
var validatorRejectionSchema = z26.object({
|
|
17792
|
+
verdict: z26.literal("reject"),
|
|
17793
|
+
taskId: z26.string().min(1),
|
|
17794
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17795
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
17489
17796
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
17490
17797
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
17491
17798
|
),
|
|
17492
|
-
summary:
|
|
17493
|
-
remediationHints:
|
|
17494
|
-
rejectedAt:
|
|
17495
|
-
schemaVersion:
|
|
17799
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
17800
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
17801
|
+
rejectedAt: z26.string().min(1),
|
|
17802
|
+
schemaVersion: z26.literal("1")
|
|
17496
17803
|
});
|
|
17497
|
-
var validatorVerdictSchema =
|
|
17804
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
17498
17805
|
validatorAttestationSchema,
|
|
17499
17806
|
validatorRejectionSchema
|
|
17500
17807
|
]);
|
|
@@ -18244,7 +18551,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
18244
18551
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
18245
18552
|
|
|
18246
18553
|
// packages/contracts/src/decide.ts
|
|
18247
|
-
import { z as
|
|
18554
|
+
import { z as z27 } from "zod";
|
|
18248
18555
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
18249
18556
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
18250
18557
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -18266,11 +18573,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
18266
18573
|
maxScoreLevels: 10
|
|
18267
18574
|
};
|
|
18268
18575
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
18269
|
-
var decisionQuestionTypeSchema =
|
|
18270
|
-
var decisionOutcomeSourceSchema =
|
|
18271
|
-
var decisionInstructionsSchema =
|
|
18272
|
-
var unitIntervalSchema =
|
|
18273
|
-
var decisionStateSchema =
|
|
18576
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
18577
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
18578
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
18579
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
18580
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
18274
18581
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
18275
18582
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
18276
18583
|
context.addIssue({
|
|
@@ -18279,34 +18586,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
18279
18586
|
});
|
|
18280
18587
|
}
|
|
18281
18588
|
});
|
|
18282
|
-
var noulDecisionQuestionSchema =
|
|
18283
|
-
type:
|
|
18589
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
18590
|
+
type: z27.literal("noul"),
|
|
18284
18591
|
instructions: decisionInstructionsSchema.optional(),
|
|
18285
|
-
criteria:
|
|
18592
|
+
criteria: z27.string().min(1)
|
|
18286
18593
|
});
|
|
18287
|
-
var choiceDecisionQuestionSchema =
|
|
18288
|
-
type:
|
|
18594
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
18595
|
+
type: z27.literal("choice"),
|
|
18289
18596
|
instructions: decisionInstructionsSchema.optional(),
|
|
18290
|
-
criteria:
|
|
18597
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
18291
18598
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
18292
18599
|
})
|
|
18293
18600
|
});
|
|
18294
|
-
var scoreDecisionQuestionSchema =
|
|
18295
|
-
type:
|
|
18601
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
18602
|
+
type: z27.literal("score"),
|
|
18296
18603
|
instructions: decisionInstructionsSchema.optional(),
|
|
18297
|
-
criteria:
|
|
18604
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
18298
18605
|
});
|
|
18299
|
-
var decisionQuestionSchema =
|
|
18606
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
18300
18607
|
noulDecisionQuestionSchema,
|
|
18301
18608
|
choiceDecisionQuestionSchema,
|
|
18302
18609
|
scoreDecisionQuestionSchema
|
|
18303
18610
|
]);
|
|
18304
|
-
var decisionRequestSchema =
|
|
18305
|
-
model:
|
|
18306
|
-
lang:
|
|
18307
|
-
cache:
|
|
18611
|
+
var decisionRequestSchema = z27.object({
|
|
18612
|
+
model: z27.string().min(1).optional(),
|
|
18613
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
18614
|
+
cache: z27.boolean().optional(),
|
|
18308
18615
|
state: decisionStateSchema,
|
|
18309
|
-
questions:
|
|
18616
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
18310
18617
|
(questions) => {
|
|
18311
18618
|
const count = Object.keys(questions).length;
|
|
18312
18619
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -18316,139 +18623,139 @@ var decisionRequestSchema = z26.object({
|
|
|
18316
18623
|
}
|
|
18317
18624
|
)
|
|
18318
18625
|
});
|
|
18319
|
-
var noulDecisionAnswerSchema =
|
|
18320
|
-
type:
|
|
18321
|
-
value:
|
|
18626
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
18627
|
+
type: z27.literal("noul"),
|
|
18628
|
+
value: z27.boolean(),
|
|
18322
18629
|
probability: unitIntervalSchema,
|
|
18323
18630
|
confidence: unitIntervalSchema
|
|
18324
18631
|
});
|
|
18325
|
-
var choiceDecisionAnswerSchema =
|
|
18326
|
-
type:
|
|
18327
|
-
value:
|
|
18328
|
-
probabilities:
|
|
18632
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
18633
|
+
type: z27.literal("choice"),
|
|
18634
|
+
value: z27.string().min(1),
|
|
18635
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
18329
18636
|
confidence: unitIntervalSchema
|
|
18330
18637
|
});
|
|
18331
|
-
var scoreDecisionAnswerSchema =
|
|
18332
|
-
type:
|
|
18333
|
-
value:
|
|
18334
|
-
probabilities:
|
|
18638
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
18639
|
+
type: z27.literal("score"),
|
|
18640
|
+
value: z27.number().int().nonnegative(),
|
|
18641
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
18335
18642
|
confidence: unitIntervalSchema
|
|
18336
18643
|
});
|
|
18337
|
-
var decisionAnswerSchema =
|
|
18644
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
18338
18645
|
noulDecisionAnswerSchema,
|
|
18339
18646
|
choiceDecisionAnswerSchema,
|
|
18340
18647
|
scoreDecisionAnswerSchema
|
|
18341
18648
|
]);
|
|
18342
|
-
var decisionOutcomeSchema =
|
|
18343
|
-
answers:
|
|
18649
|
+
var decisionOutcomeSchema = z27.object({
|
|
18650
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
18344
18651
|
source: decisionOutcomeSourceSchema,
|
|
18345
|
-
requestId:
|
|
18346
|
-
latencyMs:
|
|
18347
|
-
costUsd:
|
|
18348
|
-
costMicros:
|
|
18349
|
-
balanceMicros:
|
|
18350
|
-
checkpoint:
|
|
18351
|
-
inputTokens:
|
|
18652
|
+
requestId: z27.string().min(1).optional(),
|
|
18653
|
+
latencyMs: z27.number().nonnegative(),
|
|
18654
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
18655
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
18656
|
+
balanceMicros: z27.number().int().optional(),
|
|
18657
|
+
checkpoint: z27.string().min(1).optional(),
|
|
18658
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
18352
18659
|
});
|
|
18353
|
-
var decisionProviderKindSchema =
|
|
18354
|
-
var decisionProviderConfigSchema =
|
|
18355
|
-
baseUrl:
|
|
18660
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
18661
|
+
var decisionProviderConfigSchema = z27.object({
|
|
18662
|
+
baseUrl: z27.url(),
|
|
18356
18663
|
provider: decisionProviderKindSchema.optional()
|
|
18357
18664
|
});
|
|
18358
18665
|
|
|
18359
18666
|
// packages/contracts/src/nexus-account.ts
|
|
18360
|
-
import { z as
|
|
18361
|
-
var nexusAccountUserSchema =
|
|
18362
|
-
id:
|
|
18363
|
-
email:
|
|
18364
|
-
name:
|
|
18667
|
+
import { z as z28 } from "zod";
|
|
18668
|
+
var nexusAccountUserSchema = z28.object({
|
|
18669
|
+
id: z28.string(),
|
|
18670
|
+
email: z28.string(),
|
|
18671
|
+
name: z28.string().nullable().optional()
|
|
18365
18672
|
});
|
|
18366
|
-
var nexusAccountOrganizationSchema =
|
|
18367
|
-
id:
|
|
18368
|
-
name:
|
|
18369
|
-
slug:
|
|
18370
|
-
role:
|
|
18673
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
18674
|
+
id: z28.string(),
|
|
18675
|
+
name: z28.string(),
|
|
18676
|
+
slug: z28.string().nullable().optional(),
|
|
18677
|
+
role: z28.string().optional(),
|
|
18371
18678
|
/** `true` for the personal organization created at sign-up. */
|
|
18372
|
-
personal:
|
|
18679
|
+
personal: z28.boolean().optional()
|
|
18373
18680
|
});
|
|
18374
|
-
var nexusAccountMeSchema =
|
|
18681
|
+
var nexusAccountMeSchema = z28.object({
|
|
18375
18682
|
user: nexusAccountUserSchema,
|
|
18376
|
-
organizations:
|
|
18683
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
18377
18684
|
});
|
|
18378
18685
|
|
|
18379
18686
|
// packages/contracts/src/nexus-cloud.ts
|
|
18380
|
-
import { z as
|
|
18687
|
+
import { z as z29 } from "zod";
|
|
18381
18688
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
18382
18689
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
18383
18690
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
18384
|
-
var isoTime =
|
|
18385
|
-
var profile =
|
|
18386
|
-
var deviceState =
|
|
18387
|
-
var nexusCloudCredentialSchema =
|
|
18388
|
-
kind:
|
|
18389
|
-
credentialId:
|
|
18691
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
18692
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
18693
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
18694
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
18695
|
+
kind: z29.enum(["device", "session"]),
|
|
18696
|
+
credentialId: z29.string().nullable().optional(),
|
|
18390
18697
|
profile: profile.optional(),
|
|
18391
|
-
scopes:
|
|
18698
|
+
scopes: z29.array(z29.string()).default([]),
|
|
18392
18699
|
createdAt: isoTime.nullable().optional(),
|
|
18393
18700
|
lastUsedAt: isoTime.nullable().optional(),
|
|
18394
18701
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
18395
18702
|
idleExpiresAt: isoTime.nullable().optional()
|
|
18396
18703
|
});
|
|
18397
|
-
var nexusCloudDeviceSchema =
|
|
18398
|
-
deviceId:
|
|
18399
|
-
name:
|
|
18400
|
-
platform:
|
|
18401
|
-
arch:
|
|
18402
|
-
cliVersion:
|
|
18704
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
18705
|
+
deviceId: z29.string(),
|
|
18706
|
+
name: z29.string(),
|
|
18707
|
+
platform: z29.string().optional(),
|
|
18708
|
+
arch: z29.string().nullable().optional(),
|
|
18709
|
+
cliVersion: z29.string().nullable().optional(),
|
|
18403
18710
|
createdAt: isoTime.optional(),
|
|
18404
18711
|
lastSeenAt: isoTime.nullable().optional(),
|
|
18405
18712
|
state: deviceState,
|
|
18406
18713
|
signedOutAt: isoTime.nullable().optional(),
|
|
18407
18714
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
18408
|
-
certificate:
|
|
18715
|
+
certificate: z29.string().nullable().optional(),
|
|
18409
18716
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
18410
18717
|
profile: profile.optional(),
|
|
18411
18718
|
/** True for the device whose credential made this request. */
|
|
18412
|
-
current:
|
|
18413
|
-
projects:
|
|
18414
|
-
replicas:
|
|
18719
|
+
current: z29.boolean().default(false),
|
|
18720
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
18721
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
18415
18722
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18416
18723
|
lastPresenceAt: isoTime.nullable().optional()
|
|
18417
18724
|
});
|
|
18418
|
-
var nexusCloudOrganizationSchema =
|
|
18419
|
-
id:
|
|
18420
|
-
name:
|
|
18421
|
-
slug:
|
|
18422
|
-
role:
|
|
18423
|
-
personal:
|
|
18725
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
18726
|
+
id: z29.string(),
|
|
18727
|
+
name: z29.string(),
|
|
18728
|
+
slug: z29.string().nullable().optional(),
|
|
18729
|
+
role: z29.string().optional(),
|
|
18730
|
+
personal: z29.boolean().optional()
|
|
18424
18731
|
});
|
|
18425
|
-
var nexusCloudUserSchema =
|
|
18426
|
-
id:
|
|
18427
|
-
email:
|
|
18428
|
-
name:
|
|
18732
|
+
var nexusCloudUserSchema = z29.object({
|
|
18733
|
+
id: z29.string(),
|
|
18734
|
+
email: z29.string(),
|
|
18735
|
+
name: z29.string().nullable().optional()
|
|
18429
18736
|
});
|
|
18430
|
-
var nexusCloudWhoamiSchema =
|
|
18737
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
18431
18738
|
serverTime: isoTime.optional(),
|
|
18432
18739
|
user: nexusCloudUserSchema,
|
|
18433
|
-
organizations:
|
|
18740
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
18434
18741
|
credential: nexusCloudCredentialSchema,
|
|
18435
18742
|
/** The calling device; null for a session caller. */
|
|
18436
18743
|
device: nexusCloudDeviceSchema.nullable()
|
|
18437
18744
|
});
|
|
18438
|
-
var nexusCloudDevicePageSchema =
|
|
18439
|
-
devices:
|
|
18440
|
-
nextCursor:
|
|
18441
|
-
truncated:
|
|
18745
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
18746
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
18747
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18748
|
+
truncated: z29.boolean().default(false)
|
|
18442
18749
|
});
|
|
18443
|
-
var nexusCloudPresenceSchema =
|
|
18750
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
18444
18751
|
observedAt: isoTime.optional(),
|
|
18445
|
-
sync:
|
|
18752
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
18446
18753
|
});
|
|
18447
|
-
var nexusCloudReplicaSchema =
|
|
18448
|
-
projectId:
|
|
18449
|
-
replicaId:
|
|
18450
|
-
deviceId:
|
|
18451
|
-
deviceName:
|
|
18754
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
18755
|
+
projectId: z29.string(),
|
|
18756
|
+
replicaId: z29.string(),
|
|
18757
|
+
deviceId: z29.string(),
|
|
18758
|
+
deviceName: z29.string(),
|
|
18452
18759
|
deviceState: deviceState.optional(),
|
|
18453
18760
|
attachedAt: isoTime.optional(),
|
|
18454
18761
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -18457,72 +18764,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
18457
18764
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
18458
18765
|
retiredAt: isoTime.nullable().optional(),
|
|
18459
18766
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
18460
|
-
successor:
|
|
18767
|
+
successor: z29.string().nullable().optional()
|
|
18461
18768
|
});
|
|
18462
|
-
var nexusCloudDeviceCountsSchema =
|
|
18463
|
-
active:
|
|
18464
|
-
total:
|
|
18769
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
18770
|
+
active: z29.number().int().nonnegative(),
|
|
18771
|
+
total: z29.number().int().nonnegative()
|
|
18465
18772
|
});
|
|
18466
18773
|
var projectFields = {
|
|
18467
|
-
projectId:
|
|
18468
|
-
label:
|
|
18469
|
-
organizationId:
|
|
18470
|
-
organizationName:
|
|
18471
|
-
remoteUrl:
|
|
18774
|
+
projectId: z29.string(),
|
|
18775
|
+
label: z29.string().nullable(),
|
|
18776
|
+
organizationId: z29.string(),
|
|
18777
|
+
organizationName: z29.string().optional(),
|
|
18778
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
18472
18779
|
createdAt: isoTime.optional()
|
|
18473
18780
|
};
|
|
18474
|
-
var nexusCloudProjectListItemSchema =
|
|
18781
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
18475
18782
|
...projectFields,
|
|
18476
|
-
role:
|
|
18783
|
+
role: z29.string(),
|
|
18477
18784
|
/**
|
|
18478
18785
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
18479
18786
|
* only a holder of the account key can open it (T13102).
|
|
18480
18787
|
*/
|
|
18481
|
-
encryptedName:
|
|
18482
|
-
streamId:
|
|
18483
|
-
headSeq:
|
|
18788
|
+
encryptedName: z29.string().nullable().optional(),
|
|
18789
|
+
streamId: z29.string().optional(),
|
|
18790
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
18484
18791
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
18485
|
-
headCheckpointId:
|
|
18486
|
-
openConflicts:
|
|
18487
|
-
replicas:
|
|
18792
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
18793
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
18794
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
18488
18795
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18489
|
-
replicaCount:
|
|
18796
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18490
18797
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18491
18798
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
18492
18799
|
/** This project's replica list was cut at 50 (T12858). */
|
|
18493
|
-
replicasTruncated:
|
|
18800
|
+
replicasTruncated: z29.boolean().default(false)
|
|
18494
18801
|
});
|
|
18495
|
-
var nexusCloudProjectPageSchema =
|
|
18496
|
-
projects:
|
|
18497
|
-
nextCursor:
|
|
18802
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
18803
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
18804
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18498
18805
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
18499
|
-
truncated:
|
|
18806
|
+
truncated: z29.boolean().default(false),
|
|
18500
18807
|
/** The project list itself was cut at 1000 (T12858). */
|
|
18501
|
-
projectsTruncated:
|
|
18808
|
+
projectsTruncated: z29.boolean().default(false)
|
|
18502
18809
|
});
|
|
18503
|
-
var nexusCloudProjectDetailSchema =
|
|
18504
|
-
project:
|
|
18505
|
-
role:
|
|
18506
|
-
canTrash:
|
|
18507
|
-
openConflicts:
|
|
18810
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
18811
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
18812
|
+
role: z29.string(),
|
|
18813
|
+
canTrash: z29.boolean().optional(),
|
|
18814
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18508
18815
|
/** At most 50, oldest attachment first. */
|
|
18509
|
-
replicas:
|
|
18816
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18510
18817
|
devices: nexusCloudDeviceCountsSchema,
|
|
18511
|
-
replicaCount:
|
|
18818
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18512
18819
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18513
18820
|
/** `replicas` was cut at 50. */
|
|
18514
|
-
truncated:
|
|
18515
|
-
stream:
|
|
18516
|
-
streamId:
|
|
18517
|
-
headSeq:
|
|
18518
|
-
headCheckpointId:
|
|
18821
|
+
truncated: z29.boolean().default(false),
|
|
18822
|
+
stream: z29.object({
|
|
18823
|
+
streamId: z29.string(),
|
|
18824
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18825
|
+
headCheckpointId: z29.string().nullable()
|
|
18519
18826
|
}).nullable()
|
|
18520
18827
|
});
|
|
18521
|
-
var nexusCloudReplicaPageSchema =
|
|
18522
|
-
replicas:
|
|
18828
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
18829
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18523
18830
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18524
|
-
nextCursor:
|
|
18525
|
-
truncated:
|
|
18831
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18832
|
+
truncated: z29.boolean().default(false)
|
|
18526
18833
|
});
|
|
18527
18834
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
18528
18835
|
"credential.valid",
|
|
@@ -18538,56 +18845,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
18538
18845
|
];
|
|
18539
18846
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
18540
18847
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
18541
|
-
var knownCheckId =
|
|
18542
|
-
var nexusCloudStatusCheckSchema =
|
|
18543
|
-
id:
|
|
18544
|
-
ok:
|
|
18545
|
-
required:
|
|
18546
|
-
detail:
|
|
18848
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
18849
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
18850
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
18851
|
+
ok: z29.boolean(),
|
|
18852
|
+
required: z29.boolean(),
|
|
18853
|
+
detail: z29.string()
|
|
18547
18854
|
});
|
|
18548
|
-
var nexusCloudStatusSchema =
|
|
18855
|
+
var nexusCloudStatusSchema = z29.object({
|
|
18549
18856
|
serverTime: isoTime.optional(),
|
|
18550
|
-
apiVersion:
|
|
18857
|
+
apiVersion: z29.string().optional(),
|
|
18551
18858
|
/**
|
|
18552
18859
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
18553
18860
|
* than the list, which therefore support none of them.
|
|
18554
18861
|
*/
|
|
18555
|
-
features:
|
|
18862
|
+
features: z29.array(z29.string()).optional(),
|
|
18556
18863
|
user: nexusCloudUserSchema,
|
|
18557
18864
|
credential: nexusCloudCredentialSchema,
|
|
18558
18865
|
device: nexusCloudDeviceSchema.nullable(),
|
|
18559
|
-
project:
|
|
18560
|
-
projectId:
|
|
18561
|
-
registered:
|
|
18562
|
-
organizationId:
|
|
18563
|
-
organizationName:
|
|
18564
|
-
role:
|
|
18866
|
+
project: z29.object({
|
|
18867
|
+
projectId: z29.string(),
|
|
18868
|
+
registered: z29.boolean(),
|
|
18869
|
+
organizationId: z29.string().nullable(),
|
|
18870
|
+
organizationName: z29.string().nullable(),
|
|
18871
|
+
role: z29.string().nullable()
|
|
18565
18872
|
}).nullable(),
|
|
18566
|
-
replica:
|
|
18567
|
-
replicaId:
|
|
18568
|
-
attached:
|
|
18569
|
-
attachedElsewhere:
|
|
18873
|
+
replica: z29.object({
|
|
18874
|
+
replicaId: z29.string(),
|
|
18875
|
+
attached: z29.boolean(),
|
|
18876
|
+
attachedElsewhere: z29.boolean(),
|
|
18570
18877
|
attachedAt: isoTime.nullable(),
|
|
18571
18878
|
lastSyncAt: isoTime.nullable(),
|
|
18572
18879
|
presenceAt: isoTime.nullable(),
|
|
18573
|
-
lastReplicaSeq:
|
|
18880
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
18574
18881
|
}).nullable(),
|
|
18575
|
-
stream:
|
|
18576
|
-
streamId:
|
|
18577
|
-
headSeq:
|
|
18578
|
-
headCheckpointId:
|
|
18579
|
-
openConflicts:
|
|
18882
|
+
stream: z29.object({
|
|
18883
|
+
streamId: z29.string(),
|
|
18884
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18885
|
+
headCheckpointId: z29.string().nullable(),
|
|
18886
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18580
18887
|
devices: nexusCloudDeviceCountsSchema
|
|
18581
18888
|
}).nullable(),
|
|
18582
18889
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
18583
|
-
checks:
|
|
18890
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
18584
18891
|
(list) => list.flatMap((c) => {
|
|
18585
18892
|
const id = knownCheckId.safeParse(c.id);
|
|
18586
18893
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
18587
18894
|
})
|
|
18588
18895
|
),
|
|
18589
18896
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
18590
|
-
verdict:
|
|
18897
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
18591
18898
|
});
|
|
18592
18899
|
var LOGIN = "run `cleo login nexus`";
|
|
18593
18900
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -18632,50 +18939,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
18632
18939
|
};
|
|
18633
18940
|
|
|
18634
18941
|
// packages/contracts/src/nexus-vault.ts
|
|
18635
|
-
import { z as
|
|
18636
|
-
var isoTime2 =
|
|
18637
|
-
var uuid =
|
|
18638
|
-
var nexusUserKeysSchema =
|
|
18639
|
-
keyVersion:
|
|
18640
|
-
masterKeyVerifier:
|
|
18942
|
+
import { z as z30 } from "zod";
|
|
18943
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
18944
|
+
var uuid = z30.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
|
|
18945
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
18946
|
+
keyVersion: z30.number().int().positive(),
|
|
18947
|
+
masterKeyVerifier: z30.string()
|
|
18641
18948
|
});
|
|
18642
|
-
var nexusProjectKeysSchema =
|
|
18643
|
-
keys:
|
|
18644
|
-
|
|
18949
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
18950
|
+
keys: z30.array(
|
|
18951
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
18645
18952
|
)
|
|
18646
18953
|
});
|
|
18647
|
-
var nexusLeaseSchema =
|
|
18648
|
-
streamId:
|
|
18649
|
-
role:
|
|
18954
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
18955
|
+
streamId: z30.string(),
|
|
18956
|
+
role: z30.string(),
|
|
18650
18957
|
replicaId: uuid,
|
|
18651
18958
|
expiresAt: isoTime2,
|
|
18652
18959
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
18653
18960
|
});
|
|
18654
|
-
var nexusLeaseAcquireSchema =
|
|
18655
|
-
var nexusStreamHeadSchema =
|
|
18656
|
-
streamId:
|
|
18657
|
-
kind:
|
|
18658
|
-
headSeq:
|
|
18659
|
-
headCheckpointId:
|
|
18961
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
18962
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
18963
|
+
streamId: z30.string(),
|
|
18964
|
+
kind: z30.string().optional(),
|
|
18965
|
+
headSeq: z30.number().int().nonnegative(),
|
|
18966
|
+
headCheckpointId: z30.string().nullable(),
|
|
18660
18967
|
/**
|
|
18661
18968
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
18662
18969
|
* Absent from an older server.
|
|
18663
18970
|
*/
|
|
18664
|
-
maxSchemaVersion:
|
|
18971
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
18665
18972
|
});
|
|
18666
|
-
var nexusActivityEventSchema =
|
|
18667
|
-
id:
|
|
18973
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
18974
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
18668
18975
|
at: isoTime2,
|
|
18669
|
-
actorUserId:
|
|
18670
|
-
actorDeviceId:
|
|
18671
|
-
requestId:
|
|
18672
|
-
action:
|
|
18673
|
-
target:
|
|
18674
|
-
detail:
|
|
18976
|
+
actorUserId: z30.string().nullable().optional(),
|
|
18977
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
18978
|
+
requestId: z30.string().nullable().optional(),
|
|
18979
|
+
action: z30.string(),
|
|
18980
|
+
target: z30.string().nullable().optional(),
|
|
18981
|
+
detail: z30.unknown().optional()
|
|
18675
18982
|
});
|
|
18676
|
-
var nexusActivityPageSchema =
|
|
18677
|
-
events:
|
|
18678
|
-
nextBefore:
|
|
18983
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
18984
|
+
events: z30.array(nexusActivityEventSchema),
|
|
18985
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
18679
18986
|
});
|
|
18680
18987
|
|
|
18681
18988
|
// packages/adapters/src/providers/shared/lead-tool-strip.ts
|