@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
|
@@ -1845,17 +1845,321 @@ var ChangesetEntrySchema = z3.object({
|
|
|
1845
1845
|
});
|
|
1846
1846
|
|
|
1847
1847
|
// packages/contracts/src/config/manifest.ts
|
|
1848
|
-
import { z as
|
|
1848
|
+
import { z as z6 } from "zod";
|
|
1849
1849
|
|
|
1850
|
-
// packages/contracts/src/
|
|
1850
|
+
// packages/contracts/src/orca-execution.ts
|
|
1851
1851
|
import { z as z4 } from "zod";
|
|
1852
|
-
var
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1852
|
+
var identifier = z4.string().min(1);
|
|
1853
|
+
var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
|
|
1854
|
+
var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
|
|
1855
|
+
var orchestrateOrcaConfigSchema = z4.object({
|
|
1856
|
+
agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
|
|
1857
|
+
});
|
|
1858
|
+
var orcaContextSchema = z4.object({
|
|
1859
|
+
runtimeId: identifier,
|
|
1860
|
+
coordinatorHandle: identifier,
|
|
1861
|
+
executionHostId: z4.literal("local")
|
|
1862
|
+
});
|
|
1863
|
+
var orcaRoutingRunSchema = z4.object({
|
|
1864
|
+
runId: identifier.nullable(),
|
|
1865
|
+
unconfiguredAgents: z4.array(orcaAgentSchema)
|
|
1866
|
+
});
|
|
1867
|
+
var orcaLaunchSchema = z4.object({
|
|
1868
|
+
projectId: identifier,
|
|
1869
|
+
projectRoot: identifier,
|
|
1870
|
+
taskId: identifier,
|
|
1871
|
+
instanceId: identifier,
|
|
1872
|
+
workerSessionId: identifier,
|
|
1873
|
+
agentId: identifier,
|
|
1874
|
+
role: z4.enum(["worker", "lead"]),
|
|
1875
|
+
protocol: identifier,
|
|
1876
|
+
worktreePath: identifier,
|
|
1877
|
+
worktreeBranch: identifier,
|
|
1878
|
+
projectHash: identifier,
|
|
1879
|
+
lockToken: identifier,
|
|
1880
|
+
prompt: identifier,
|
|
1881
|
+
harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
|
|
1882
|
+
leadMailbox: identifier.nullable(),
|
|
1883
|
+
model: identifier.optional(),
|
|
1884
|
+
effort: identifier.optional(),
|
|
1885
|
+
accountId: identifier.optional()
|
|
1886
|
+
});
|
|
1887
|
+
var orcaStartBindingSchema = z4.object({
|
|
1888
|
+
runId: identifier.nullable(),
|
|
1889
|
+
orcaTaskId: identifier.nullable(),
|
|
1890
|
+
retryOf: identifier.nullable()
|
|
1891
|
+
});
|
|
1892
|
+
var orcaAttemptSchema = z4.object({
|
|
1893
|
+
backend: z4.literal("orca"),
|
|
1894
|
+
version: z4.literal(1),
|
|
1895
|
+
/** Monotonic local CAS revision; repeated identical observations still serialize. */
|
|
1896
|
+
revision: z4.number().int().nonnegative(),
|
|
1897
|
+
context: orcaContextSchema,
|
|
1898
|
+
launch: orcaLaunchSchema,
|
|
1899
|
+
promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1900
|
+
workspaceId: identifier,
|
|
1901
|
+
workspaceSelector: identifier,
|
|
1902
|
+
state: z4.enum([
|
|
1903
|
+
"prepared",
|
|
1904
|
+
"launching",
|
|
1905
|
+
"ready",
|
|
1906
|
+
"turn_unobserved",
|
|
1907
|
+
"outcome_unknown",
|
|
1908
|
+
"stop_pending",
|
|
1909
|
+
"stop_unknown",
|
|
1910
|
+
"stopped",
|
|
1911
|
+
"failed",
|
|
1912
|
+
"circuit_broken"
|
|
1913
|
+
]),
|
|
1914
|
+
runId: identifier.nullable(),
|
|
1915
|
+
orcaTaskId: identifier.nullable(),
|
|
1916
|
+
dispatchId: identifier.nullable(),
|
|
1917
|
+
retryOf: identifier.nullable(),
|
|
1918
|
+
/** Absent on legacy records, whose original argv cannot safely be reconstructed. */
|
|
1919
|
+
startBinding: orcaStartBindingSchema.optional(),
|
|
1920
|
+
/** UUID reserved before committing a retry; its first send and every replay use this key. */
|
|
1921
|
+
startRequestKey: z4.string().uuid().optional(),
|
|
1922
|
+
startRequestId: identifier.nullable(),
|
|
1923
|
+
/** UUID reserved before committing a stop; its first send and every replay use this key. */
|
|
1924
|
+
stopRequestKey: z4.string().uuid().optional(),
|
|
1925
|
+
/** Orca-issued stop request id, retained only when the stop receipt was received. */
|
|
1926
|
+
stopRequestId: identifier.nullable(),
|
|
1927
|
+
/**
|
|
1928
|
+
* Set when the worker-stop reply came from a runtime that proved it enumerates
|
|
1929
|
+
* every helper it stopped, so an omitted helper list means the worker had none.
|
|
1930
|
+
*/
|
|
1931
|
+
stopHelperEvidence: z4.literal("enumerated").optional(),
|
|
1932
|
+
failureCount: z4.number().int().nonnegative(),
|
|
1933
|
+
resourceState: z4.string(),
|
|
1934
|
+
/** Full receipts retain effects, residual resources and recovery advice. */
|
|
1935
|
+
lastReceipt: z4.string().nullable(),
|
|
1936
|
+
lastError: z4.string().nullable(),
|
|
1937
|
+
/** Confirmed pre-dispatch refusal; never inferred from a process exit. */
|
|
1938
|
+
startRefusal: z4.literal("agent_unconfigured").optional(),
|
|
1939
|
+
observedAt: z4.string()
|
|
1940
|
+
});
|
|
1941
|
+
var orcaWorkerDoneSchema = z4.object({
|
|
1942
|
+
messageId: identifier,
|
|
1943
|
+
runtimeId: identifier,
|
|
1944
|
+
runId: identifier,
|
|
1945
|
+
orcaTaskId: identifier,
|
|
1946
|
+
dispatchId: identifier,
|
|
1947
|
+
senderHandle: identifier,
|
|
1948
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
1949
|
+
body: z4.string(),
|
|
1950
|
+
reportPath: identifier
|
|
1951
|
+
});
|
|
1952
|
+
var orcaWorkerReportSchema = z4.object({
|
|
1953
|
+
event: orcaWorkerDoneSchema,
|
|
1954
|
+
manifestId: identifier,
|
|
1955
|
+
manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1956
|
+
reportText: z4.string().min(1).max(65536),
|
|
1957
|
+
reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1958
|
+
ingestedAt: z4.string().datetime()
|
|
1959
|
+
});
|
|
1960
|
+
var orcaReportDeliverySchema = z4.object({
|
|
1961
|
+
key: identifier,
|
|
1962
|
+
mailbox: identifier.nullable(),
|
|
1963
|
+
state: z4.enum(["pending", "delivered"]),
|
|
1964
|
+
messageId: identifier.nullable(),
|
|
1965
|
+
deliveredAt: z4.string().datetime().nullable(),
|
|
1966
|
+
lastError: z4.string().nullable()
|
|
1967
|
+
});
|
|
1968
|
+
var orcaWorkerSettlementSchema = z4.object({
|
|
1969
|
+
resourceRelease: z4.object({
|
|
1970
|
+
dispatchId: identifier,
|
|
1971
|
+
releasedAt: z4.string().datetime(),
|
|
1972
|
+
receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
|
|
1973
|
+
receipt: identifier
|
|
1974
|
+
}).optional(),
|
|
1975
|
+
retiredAt: z4.string().datetime().optional(),
|
|
1976
|
+
reportDelivery: orcaReportDeliverySchema.optional()
|
|
1977
|
+
});
|
|
1978
|
+
var orcaReportMessageSchema = z4.object({
|
|
1979
|
+
id: identifier,
|
|
1980
|
+
run_id: z4.string().nullable(),
|
|
1981
|
+
delivery_contract: z4.string(),
|
|
1982
|
+
from_handle: z4.string(),
|
|
1983
|
+
to_handle: z4.string(),
|
|
1984
|
+
type: z4.string(),
|
|
1985
|
+
body: z4.string(),
|
|
1986
|
+
payload: z4.string().nullable(),
|
|
1987
|
+
sender_pane_key: z4.string().nullable()
|
|
1988
|
+
});
|
|
1989
|
+
var orcaReportSourceSchema = z4.object({
|
|
1990
|
+
ok: z4.literal(true),
|
|
1991
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
1992
|
+
result: z4.object({
|
|
1993
|
+
messages: z4.array(z4.json()).optional(),
|
|
1994
|
+
dispatch: z4.object({
|
|
1995
|
+
id: identifier,
|
|
1996
|
+
run_id: identifier,
|
|
1997
|
+
task_id: identifier,
|
|
1998
|
+
assignee_handle: identifier,
|
|
1999
|
+
assignee_pane_key: z4.string().nullable(),
|
|
2000
|
+
status: z4.string()
|
|
2001
|
+
}).optional()
|
|
2002
|
+
})
|
|
2003
|
+
});
|
|
2004
|
+
var orcaWorkerDonePayloadSchema = z4.object({
|
|
2005
|
+
taskId: identifier,
|
|
2006
|
+
dispatchId: identifier,
|
|
2007
|
+
outcome: z4.enum(["succeeded", "failed"]),
|
|
2008
|
+
reportPath: identifier
|
|
2009
|
+
});
|
|
2010
|
+
var orcaWorkerRequestSchema = z4.object({
|
|
2011
|
+
action: z4.enum([
|
|
2012
|
+
"show",
|
|
2013
|
+
"read",
|
|
2014
|
+
"recover-start",
|
|
2015
|
+
"recover-stop",
|
|
2016
|
+
"retry",
|
|
2017
|
+
"stop",
|
|
2018
|
+
"ingest-report",
|
|
2019
|
+
"relay-report"
|
|
2020
|
+
]),
|
|
2021
|
+
recordId: identifier,
|
|
2022
|
+
cursor: identifier.optional(),
|
|
2023
|
+
messageId: identifier.optional()
|
|
2024
|
+
}).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
|
|
2025
|
+
message: "A source-pinned cursor is accepted only for read.",
|
|
2026
|
+
path: ["cursor"]
|
|
2027
|
+
}).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
|
|
2028
|
+
message: "ingest-report requires an exact message id; other actions do not accept one.",
|
|
2029
|
+
path: ["messageId"]
|
|
2030
|
+
});
|
|
2031
|
+
var effectSchema = z4.object({
|
|
2032
|
+
kind: z4.string(),
|
|
2033
|
+
role: z4.string().optional(),
|
|
2034
|
+
action: z4.string().optional(),
|
|
2035
|
+
id: z4.string().optional()
|
|
2036
|
+
});
|
|
2037
|
+
var selectionSchema = z4.object({
|
|
2038
|
+
agent: z4.string().nullable().optional(),
|
|
2039
|
+
model: z4.string().nullable().optional(),
|
|
2040
|
+
effort: z4.string().nullable().optional()
|
|
2041
|
+
});
|
|
2042
|
+
var orcaReplySchema = z4.object({
|
|
2043
|
+
ok: z4.boolean(),
|
|
2044
|
+
_meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
|
|
2045
|
+
error: z4.object({
|
|
2046
|
+
code: z4.string(),
|
|
2047
|
+
message: z4.string(),
|
|
2048
|
+
data: z4.object({
|
|
2049
|
+
requestId: identifier.optional(),
|
|
2050
|
+
orchestrationRequestId: identifier.optional(),
|
|
2051
|
+
dispatchId: identifier.optional()
|
|
2052
|
+
}).optional()
|
|
2053
|
+
}).optional(),
|
|
2054
|
+
result: z4.object({
|
|
2055
|
+
state: z4.string().optional(),
|
|
2056
|
+
requestId: identifier.optional(),
|
|
2057
|
+
/**
|
|
2058
|
+
* Mutation ledger identity Orca stamps on every successful mutation result.
|
|
2059
|
+
* @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
|
|
2060
|
+
* result it records (`Jy` in the retained source), so a successful stop can
|
|
2061
|
+
* be bound to the request key this attempt issued.
|
|
2062
|
+
*/
|
|
2063
|
+
mutation: z4.object({
|
|
2064
|
+
requestId: identifier.optional(),
|
|
2065
|
+
replayed: z4.boolean().optional()
|
|
2066
|
+
}).optional(),
|
|
2067
|
+
stage: z4.string().optional(),
|
|
2068
|
+
turnStart: z4.string().optional(),
|
|
2069
|
+
runId: identifier.optional(),
|
|
2070
|
+
run: z4.object({ id: identifier }).nullable().optional(),
|
|
2071
|
+
taskId: identifier.optional(),
|
|
2072
|
+
dispatchId: identifier.optional(),
|
|
2073
|
+
failureCount: z4.number().int().nonnegative().optional(),
|
|
2074
|
+
effects: z4.array(effectSchema).optional(),
|
|
2075
|
+
residualResources: z4.array(effectSchema).optional(),
|
|
2076
|
+
launch: z4.object({ effective: selectionSchema.optional() }).optional(),
|
|
2077
|
+
lastError: z4.string().nullable().optional(),
|
|
2078
|
+
processAction: z4.string().optional(),
|
|
2079
|
+
helpers: z4.array(
|
|
2080
|
+
z4.object({
|
|
2081
|
+
dispatchId: identifier.optional(),
|
|
2082
|
+
creatorDispatchId: identifier.optional(),
|
|
2083
|
+
outcome: z4.string(),
|
|
2084
|
+
keptOpenBy: identifier.optional(),
|
|
2085
|
+
state: z4.string().optional(),
|
|
2086
|
+
lastError: z4.string().nullable().optional()
|
|
2087
|
+
})
|
|
2088
|
+
).optional(),
|
|
2089
|
+
helperStopError: z4.string().nullable().optional(),
|
|
2090
|
+
status: z4.string().optional(),
|
|
2091
|
+
terminal: z4.object({
|
|
2092
|
+
handle: identifier,
|
|
2093
|
+
connected: z4.boolean(),
|
|
2094
|
+
writable: z4.boolean(),
|
|
2095
|
+
executionHostId: identifier
|
|
2096
|
+
}).optional(),
|
|
2097
|
+
runtime: z4.object({
|
|
2098
|
+
runtimeId: identifier,
|
|
2099
|
+
reachable: z4.boolean(),
|
|
2100
|
+
state: z4.string(),
|
|
2101
|
+
capabilities: z4.array(z4.string())
|
|
2102
|
+
}).optional(),
|
|
2103
|
+
worktree: z4.object({
|
|
2104
|
+
id: identifier,
|
|
2105
|
+
path: identifier,
|
|
2106
|
+
branch: identifier,
|
|
2107
|
+
hostId: identifier,
|
|
2108
|
+
address: z4.object({ worktree: identifier }).optional()
|
|
2109
|
+
}).optional(),
|
|
2110
|
+
dispatch: z4.object({
|
|
2111
|
+
id: identifier,
|
|
2112
|
+
runId: identifier,
|
|
2113
|
+
taskId: identifier,
|
|
2114
|
+
/** Direct creator Dispatch that started this one; null for a Run root. */
|
|
2115
|
+
creatorDispatchId: identifier.nullable().optional(),
|
|
2116
|
+
failureCount: z4.number().int().nonnegative()
|
|
2117
|
+
}).optional(),
|
|
2118
|
+
worker: z4.object({
|
|
2119
|
+
dispatchId: identifier,
|
|
2120
|
+
runtimeEpoch: identifier,
|
|
2121
|
+
state: z4.string(),
|
|
2122
|
+
stage: z4.string(),
|
|
2123
|
+
worktreeId: identifier.nullable()
|
|
2124
|
+
}).optional(),
|
|
2125
|
+
observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
|
|
2126
|
+
projection: z4.object({
|
|
2127
|
+
resource: z4.object({
|
|
2128
|
+
state: z4.string(),
|
|
2129
|
+
terminalState: z4.string(),
|
|
2130
|
+
ownerDispatchId: identifier.optional(),
|
|
2131
|
+
releaseState: z4.string().optional()
|
|
2132
|
+
}).optional()
|
|
2133
|
+
}).optional()
|
|
2134
|
+
}).optional()
|
|
2135
|
+
});
|
|
2136
|
+
var orcaCommandRegistrySchema = z4.object({
|
|
2137
|
+
schemaVersion: z4.number().int().positive(),
|
|
2138
|
+
commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
|
|
2139
|
+
});
|
|
2140
|
+
var accountProviderSchema = z4.object({
|
|
2141
|
+
accounts: z4.array(z4.object({})),
|
|
2142
|
+
activeAccountId: identifier.nullable()
|
|
2143
|
+
});
|
|
2144
|
+
var orcaAccountReplySchema = z4.object({
|
|
2145
|
+
ok: z4.literal(true),
|
|
2146
|
+
_meta: z4.object({ runtimeId: identifier }),
|
|
2147
|
+
result: z4.object({
|
|
2148
|
+
codex: accountProviderSchema,
|
|
2149
|
+
opencode: accountProviderSchema,
|
|
2150
|
+
claude: accountProviderSchema
|
|
2151
|
+
})
|
|
2152
|
+
});
|
|
2153
|
+
|
|
2154
|
+
// packages/contracts/src/config/worker-policy.ts
|
|
2155
|
+
import { z as z5 } from "zod";
|
|
2156
|
+
var projectWorkerPolicySchema = z5.object({
|
|
2157
|
+
verification: z5.object({
|
|
2158
|
+
full: z5.enum(["local", "ci"]),
|
|
2159
|
+
local: z5.enum(["single-file", "affected"])
|
|
1856
2160
|
}).strict().optional(),
|
|
1857
|
-
instructions:
|
|
1858
|
-
|
|
2161
|
+
instructions: z5.array(
|
|
2162
|
+
z5.string().min(1).max(512).regex(/\S/).regex(
|
|
1859
2163
|
/^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
|
|
1860
2164
|
"Instructions must be single-line text without control characters or a leading #"
|
|
1861
2165
|
)
|
|
@@ -1883,8 +2187,11 @@ var CLEO_CONFIG_MANIFEST = {
|
|
|
1883
2187
|
path: ".cleo/config.json",
|
|
1884
2188
|
mergePrecedence: 20,
|
|
1885
2189
|
driftDetection: "schema-validate",
|
|
1886
|
-
schema:
|
|
1887
|
-
orchestrate:
|
|
2190
|
+
schema: z6.object({
|
|
2191
|
+
orchestrate: z6.object({
|
|
2192
|
+
workerPolicy: projectWorkerPolicySchema.optional(),
|
|
2193
|
+
orca: orchestrateOrcaConfigSchema.optional()
|
|
2194
|
+
}).passthrough().optional()
|
|
1888
2195
|
}).passthrough()
|
|
1889
2196
|
};
|
|
1890
2197
|
var GLOBAL_CLEO_CONFIG_MANIFEST = {
|
|
@@ -1900,139 +2207,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
|
|
|
1900
2207
|
GLOBAL_CLEO_CONFIG_MANIFEST,
|
|
1901
2208
|
CLEO_CONFIG_MANIFEST
|
|
1902
2209
|
]);
|
|
1903
|
-
var configManifestEntrySchema =
|
|
1904
|
-
id:
|
|
1905
|
-
scope:
|
|
1906
|
-
path:
|
|
1907
|
-
schema:
|
|
1908
|
-
mergePrecedence:
|
|
1909
|
-
driftDetection:
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
2210
|
+
var configManifestEntrySchema = z6.object({
|
|
2211
|
+
id: z6.string().min(1),
|
|
2212
|
+
scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
|
|
2213
|
+
path: z6.string().min(1),
|
|
2214
|
+
schema: z6.unknown().optional(),
|
|
2215
|
+
mergePrecedence: z6.number().int().nonnegative(),
|
|
2216
|
+
driftDetection: z6.union([
|
|
2217
|
+
z6.literal("schema-validate"),
|
|
2218
|
+
z6.literal("staleness-gate"),
|
|
2219
|
+
z6.literal("value-diff"),
|
|
2220
|
+
z6.literal("none")
|
|
1914
2221
|
]),
|
|
1915
|
-
defaults:
|
|
2222
|
+
defaults: z6.record(z6.string(), z6.unknown()).optional()
|
|
1916
2223
|
});
|
|
1917
2224
|
|
|
1918
2225
|
// packages/contracts/src/daemon/health.ts
|
|
1919
|
-
import { z as
|
|
2226
|
+
import { z as z8 } from "zod";
|
|
1920
2227
|
|
|
1921
2228
|
// packages/contracts/src/supervisor-ipc/messages.ts
|
|
1922
|
-
import { z as
|
|
1923
|
-
var EnvPairSchema =
|
|
2229
|
+
import { z as z7 } from "zod";
|
|
2230
|
+
var EnvPairSchema = z7.object({
|
|
1924
2231
|
/** Environment variable name. */
|
|
1925
|
-
key:
|
|
2232
|
+
key: z7.string().min(1),
|
|
1926
2233
|
/** Environment variable value. */
|
|
1927
|
-
value:
|
|
2234
|
+
value: z7.string()
|
|
1928
2235
|
}).strict();
|
|
1929
|
-
var ChildStateSchema =
|
|
1930
|
-
var ChildStatusSchema =
|
|
2236
|
+
var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
|
|
2237
|
+
var ChildStatusSchema = z7.object({
|
|
1931
2238
|
/** Logical id of the child (stable across restarts). */
|
|
1932
|
-
child_id:
|
|
2239
|
+
child_id: z7.string().min(1),
|
|
1933
2240
|
/** Current OS pid (0 when not currently running). */
|
|
1934
|
-
pid:
|
|
2241
|
+
pid: z7.number().int().nonnegative(),
|
|
1935
2242
|
/** Current liveness state. */
|
|
1936
2243
|
state: ChildStateSchema,
|
|
1937
2244
|
/** Total restarts observed for this child. */
|
|
1938
|
-
restart_count:
|
|
2245
|
+
restart_count: z7.number().int().nonnegative()
|
|
1939
2246
|
}).strict();
|
|
1940
|
-
var SpawnRequestSchema =
|
|
2247
|
+
var SpawnRequestSchema = z7.object({
|
|
1941
2248
|
/** Tag discriminating this request variant. */
|
|
1942
|
-
kind:
|
|
2249
|
+
kind: z7.literal("spawn"),
|
|
1943
2250
|
/** Caller-chosen logical id for the child (stable across restarts). */
|
|
1944
|
-
child_id:
|
|
2251
|
+
child_id: z7.string().min(1),
|
|
1945
2252
|
/** Absolute path to the program to execute. */
|
|
1946
|
-
program:
|
|
2253
|
+
program: z7.string().min(1),
|
|
1947
2254
|
/** Arguments passed to the program. */
|
|
1948
|
-
args:
|
|
2255
|
+
args: z7.array(z7.string()).default([]),
|
|
1949
2256
|
/** Environment overrides applied on top of the supervisor's environment. */
|
|
1950
|
-
env:
|
|
2257
|
+
env: z7.array(EnvPairSchema).default([]),
|
|
1951
2258
|
/** Optional working directory for the child. */
|
|
1952
|
-
cwd:
|
|
2259
|
+
cwd: z7.string().optional()
|
|
1953
2260
|
}).strict();
|
|
1954
|
-
var RestartRequestSchema =
|
|
2261
|
+
var RestartRequestSchema = z7.object({
|
|
1955
2262
|
/** Tag discriminating this request variant. */
|
|
1956
|
-
kind:
|
|
2263
|
+
kind: z7.literal("restart"),
|
|
1957
2264
|
/** Logical id of the child to restart. */
|
|
1958
|
-
child_id:
|
|
2265
|
+
child_id: z7.string().min(1)
|
|
1959
2266
|
}).strict();
|
|
1960
|
-
var MonitorRequestSchema =
|
|
2267
|
+
var MonitorRequestSchema = z7.object({
|
|
1961
2268
|
/** Tag discriminating this request variant. */
|
|
1962
|
-
kind:
|
|
2269
|
+
kind: z7.literal("monitor"),
|
|
1963
2270
|
/** Specific child id to monitor; omit to request all children. */
|
|
1964
|
-
child_id:
|
|
2271
|
+
child_id: z7.string().optional()
|
|
1965
2272
|
}).strict();
|
|
1966
|
-
var HealthRequestSchema =
|
|
2273
|
+
var HealthRequestSchema = z7.object({
|
|
1967
2274
|
/** Tag discriminating this request variant. */
|
|
1968
|
-
kind:
|
|
2275
|
+
kind: z7.literal("health")
|
|
1969
2276
|
}).strict();
|
|
1970
|
-
var SupervisorIpcRequestSchema =
|
|
2277
|
+
var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
|
|
1971
2278
|
SpawnRequestSchema,
|
|
1972
2279
|
RestartRequestSchema,
|
|
1973
2280
|
MonitorRequestSchema,
|
|
1974
2281
|
HealthRequestSchema
|
|
1975
2282
|
]);
|
|
1976
|
-
var SpawnedResponseSchema =
|
|
2283
|
+
var SpawnedResponseSchema = z7.object({
|
|
1977
2284
|
/** Tag discriminating this response variant. */
|
|
1978
|
-
kind:
|
|
2285
|
+
kind: z7.literal("spawned"),
|
|
1979
2286
|
/** Logical id of the spawned child. */
|
|
1980
|
-
child_id:
|
|
2287
|
+
child_id: z7.string().min(1),
|
|
1981
2288
|
/** OS pid assigned to the spawned child. */
|
|
1982
|
-
pid:
|
|
2289
|
+
pid: z7.number().int().nonnegative()
|
|
1983
2290
|
}).strict();
|
|
1984
|
-
var RestartedResponseSchema =
|
|
2291
|
+
var RestartedResponseSchema = z7.object({
|
|
1985
2292
|
/** Tag discriminating this response variant. */
|
|
1986
|
-
kind:
|
|
2293
|
+
kind: z7.literal("restarted"),
|
|
1987
2294
|
/** Logical id of the restarted child. */
|
|
1988
|
-
child_id:
|
|
2295
|
+
child_id: z7.string().min(1),
|
|
1989
2296
|
/** New OS pid after the restart. */
|
|
1990
|
-
pid:
|
|
2297
|
+
pid: z7.number().int().nonnegative(),
|
|
1991
2298
|
/** Number of times this child has been restarted in total. */
|
|
1992
|
-
restart_count:
|
|
2299
|
+
restart_count: z7.number().int().nonnegative()
|
|
1993
2300
|
}).strict();
|
|
1994
|
-
var MonitorResponseSchema =
|
|
2301
|
+
var MonitorResponseSchema = z7.object({
|
|
1995
2302
|
/** Tag discriminating this response variant. */
|
|
1996
|
-
kind:
|
|
2303
|
+
kind: z7.literal("monitor"),
|
|
1997
2304
|
/** One row per monitored child. */
|
|
1998
|
-
children:
|
|
2305
|
+
children: z7.array(ChildStatusSchema)
|
|
1999
2306
|
}).strict();
|
|
2000
|
-
var HealthResponseSchema =
|
|
2307
|
+
var HealthResponseSchema = z7.object({
|
|
2001
2308
|
/** Tag discriminating this response variant. */
|
|
2002
|
-
kind:
|
|
2309
|
+
kind: z7.literal("health"),
|
|
2003
2310
|
/** Supervisor process pid. */
|
|
2004
|
-
pid:
|
|
2311
|
+
pid: z7.number().int().nonnegative(),
|
|
2005
2312
|
/** Number of children currently tracked. */
|
|
2006
|
-
child_count:
|
|
2313
|
+
child_count: z7.number().int().nonnegative(),
|
|
2007
2314
|
/** Seconds the supervisor has been running. */
|
|
2008
|
-
uptime_secs:
|
|
2315
|
+
uptime_secs: z7.number().int().nonnegative(),
|
|
2009
2316
|
/** Frozen protocol version the supervisor speaks. */
|
|
2010
|
-
protocol_version:
|
|
2317
|
+
protocol_version: z7.string()
|
|
2011
2318
|
}).strict();
|
|
2012
|
-
var LifecycleEventKindSchema =
|
|
2013
|
-
var LifecycleEventResponseSchema =
|
|
2319
|
+
var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
|
|
2320
|
+
var LifecycleEventResponseSchema = z7.object({
|
|
2014
2321
|
/** Tag discriminating this response variant. */
|
|
2015
|
-
kind:
|
|
2322
|
+
kind: z7.literal("event"),
|
|
2016
2323
|
/** What happened. */
|
|
2017
2324
|
event: LifecycleEventKindSchema,
|
|
2018
2325
|
/** Logical id of the affected child. */
|
|
2019
|
-
child_id:
|
|
2326
|
+
child_id: z7.string().min(1),
|
|
2020
2327
|
/** Exit code, when the OS reported one. */
|
|
2021
|
-
exit_code:
|
|
2328
|
+
exit_code: z7.number().int().optional(),
|
|
2022
2329
|
/** Terminating signal name, when the child was signalled (Unix). */
|
|
2023
|
-
signal:
|
|
2330
|
+
signal: z7.string().optional(),
|
|
2024
2331
|
/** Backoff delay (ms) before the pending restart, when applicable. */
|
|
2025
|
-
restart_delay_ms:
|
|
2332
|
+
restart_delay_ms: z7.number().int().nonnegative().optional()
|
|
2026
2333
|
}).strict();
|
|
2027
|
-
var ErrorResponseSchema =
|
|
2334
|
+
var ErrorResponseSchema = z7.object({
|
|
2028
2335
|
/** Tag discriminating this response variant. */
|
|
2029
|
-
kind:
|
|
2336
|
+
kind: z7.literal("error"),
|
|
2030
2337
|
/** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
|
|
2031
|
-
code:
|
|
2338
|
+
code: z7.string().min(1),
|
|
2032
2339
|
/** Human-readable error message. */
|
|
2033
|
-
message:
|
|
2340
|
+
message: z7.string()
|
|
2034
2341
|
}).strict();
|
|
2035
|
-
var SupervisorIpcResponseSchema =
|
|
2342
|
+
var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
|
|
2036
2343
|
SpawnedResponseSchema,
|
|
2037
2344
|
RestartedResponseSchema,
|
|
2038
2345
|
MonitorResponseSchema,
|
|
@@ -2040,27 +2347,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
|
|
|
2040
2347
|
LifecycleEventResponseSchema,
|
|
2041
2348
|
ErrorResponseSchema
|
|
2042
2349
|
]);
|
|
2043
|
-
var SupervisorIpcRequestEnvelopeSchema =
|
|
2350
|
+
var SupervisorIpcRequestEnvelopeSchema = z7.object({
|
|
2044
2351
|
/** Frozen protocol version. */
|
|
2045
|
-
protocol_version:
|
|
2352
|
+
protocol_version: z7.string(),
|
|
2046
2353
|
/** Correlation id echoed back on the matching response. */
|
|
2047
|
-
id:
|
|
2354
|
+
id: z7.string().min(1),
|
|
2048
2355
|
/** Direction discriminator. */
|
|
2049
|
-
direction:
|
|
2356
|
+
direction: z7.literal("request"),
|
|
2050
2357
|
/** The request body. */
|
|
2051
2358
|
request: SupervisorIpcRequestSchema
|
|
2052
2359
|
}).strict();
|
|
2053
|
-
var SupervisorIpcResponseEnvelopeSchema =
|
|
2360
|
+
var SupervisorIpcResponseEnvelopeSchema = z7.object({
|
|
2054
2361
|
/** Frozen protocol version. */
|
|
2055
|
-
protocol_version:
|
|
2362
|
+
protocol_version: z7.string(),
|
|
2056
2363
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
2057
|
-
id:
|
|
2364
|
+
id: z7.string().min(1),
|
|
2058
2365
|
/** Direction discriminator. */
|
|
2059
|
-
direction:
|
|
2366
|
+
direction: z7.literal("response"),
|
|
2060
2367
|
/** The response body. */
|
|
2061
2368
|
response: SupervisorIpcResponseSchema
|
|
2062
2369
|
}).strict();
|
|
2063
|
-
var SupervisorIpcEnvelopeSchema =
|
|
2370
|
+
var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
|
|
2064
2371
|
SupervisorIpcRequestEnvelopeSchema,
|
|
2065
2372
|
SupervisorIpcResponseEnvelopeSchema
|
|
2066
2373
|
]);
|
|
@@ -2084,17 +2391,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
|
|
|
2084
2391
|
* Optional human-readable detail (e.g. last error message, queue depth).
|
|
2085
2392
|
* Diagnostic only — not part of the supervisor wire contract.
|
|
2086
2393
|
*/
|
|
2087
|
-
detail:
|
|
2394
|
+
detail: z8.string().optional()
|
|
2088
2395
|
}).strict();
|
|
2089
|
-
var HealthStatusSchema =
|
|
2396
|
+
var HealthStatusSchema = z8.object({
|
|
2090
2397
|
/** One health row per registered subsystem. */
|
|
2091
|
-
subsystems:
|
|
2398
|
+
subsystems: z8.array(SubsystemHealthSchema),
|
|
2092
2399
|
/**
|
|
2093
2400
|
* `true` iff every subsystem is in the `running` state. A convenience roll-up
|
|
2094
2401
|
* derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
|
|
2095
2402
|
* {@link summarizeHealth} so producers cannot desync it.
|
|
2096
2403
|
*/
|
|
2097
|
-
allHealthy:
|
|
2404
|
+
allHealthy: z8.boolean()
|
|
2098
2405
|
}).strict();
|
|
2099
2406
|
|
|
2100
2407
|
// packages/contracts/src/db-inventory.json
|
|
@@ -14023,7 +14330,7 @@ var OPERATIONS = [
|
|
|
14023
14330
|
];
|
|
14024
14331
|
|
|
14025
14332
|
// packages/contracts/src/docs/modernize.ts
|
|
14026
|
-
import { z as
|
|
14333
|
+
import { z as z9 } from "zod";
|
|
14027
14334
|
var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
|
|
14028
14335
|
var DOCS_MODERNIZE_OPS = [
|
|
14029
14336
|
"ingest",
|
|
@@ -14037,105 +14344,105 @@ var DOCS_MODERNIZE_OPS = [
|
|
|
14037
14344
|
"reslug",
|
|
14038
14345
|
"link-task"
|
|
14039
14346
|
];
|
|
14040
|
-
var judgmentSchema =
|
|
14041
|
-
question:
|
|
14042
|
-
site:
|
|
14043
|
-
mode:
|
|
14044
|
-
ruleAnswer:
|
|
14045
|
-
decidedAnswer:
|
|
14046
|
-
decidedConfidence:
|
|
14047
|
-
source:
|
|
14048
|
-
acted:
|
|
14347
|
+
var judgmentSchema = z9.object({
|
|
14348
|
+
question: z9.enum(["classify", "merge"]),
|
|
14349
|
+
site: z9.string(),
|
|
14350
|
+
mode: z9.enum(["off", "shadow", "on"]),
|
|
14351
|
+
ruleAnswer: z9.string(),
|
|
14352
|
+
decidedAnswer: z9.string().nullable(),
|
|
14353
|
+
decidedConfidence: z9.number().nullable(),
|
|
14354
|
+
source: z9.enum(["provider", "cache", "fallback"]),
|
|
14355
|
+
acted: z9.string()
|
|
14049
14356
|
});
|
|
14050
|
-
var relPath =
|
|
14051
|
-
var docsModernizePlanSchema =
|
|
14052
|
-
root:
|
|
14053
|
-
generatedAt:
|
|
14054
|
-
mode:
|
|
14055
|
-
counts:
|
|
14056
|
-
rows:
|
|
14057
|
-
|
|
14357
|
+
var relPath = z9.string().min(1).max(1024);
|
|
14358
|
+
var docsModernizePlanSchema = z9.object({
|
|
14359
|
+
root: z9.string().min(1),
|
|
14360
|
+
generatedAt: z9.string(),
|
|
14361
|
+
mode: z9.enum(["tree", "store-only"]),
|
|
14362
|
+
counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
|
|
14363
|
+
rows: z9.array(
|
|
14364
|
+
z9.object({
|
|
14058
14365
|
path: relPath,
|
|
14059
|
-
sha256:
|
|
14060
|
-
kind:
|
|
14061
|
-
slug:
|
|
14062
|
-
title:
|
|
14063
|
-
disposition:
|
|
14064
|
-
target:
|
|
14065
|
-
reasons:
|
|
14066
|
-
judgments:
|
|
14067
|
-
ownerTasks:
|
|
14068
|
-
category:
|
|
14069
|
-
refs:
|
|
14070
|
-
overridden:
|
|
14071
|
-
covers:
|
|
14072
|
-
baselineRemove:
|
|
14366
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
14367
|
+
kind: z9.string().min(1),
|
|
14368
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
14369
|
+
title: z9.string(),
|
|
14370
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
14371
|
+
target: z9.string().min(1).max(1024).nullable(),
|
|
14372
|
+
reasons: z9.array(z9.string()),
|
|
14373
|
+
judgments: z9.array(judgmentSchema),
|
|
14374
|
+
ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
|
|
14375
|
+
category: z9.string(),
|
|
14376
|
+
refs: z9.array(z9.string()),
|
|
14377
|
+
overridden: z9.boolean(),
|
|
14378
|
+
covers: z9.array(z9.string()),
|
|
14379
|
+
baselineRemove: z9.boolean()
|
|
14073
14380
|
})
|
|
14074
14381
|
),
|
|
14075
|
-
linkFixes:
|
|
14076
|
-
|
|
14077
|
-
kind:
|
|
14382
|
+
linkFixes: z9.array(
|
|
14383
|
+
z9.object({
|
|
14384
|
+
kind: z9.literal("link-fix"),
|
|
14078
14385
|
path: relPath,
|
|
14079
|
-
href:
|
|
14080
|
-
newHref:
|
|
14081
|
-
base:
|
|
14082
|
-
sha256:
|
|
14386
|
+
href: z9.string().min(1).max(2048),
|
|
14387
|
+
newHref: z9.string().min(1).max(2048),
|
|
14388
|
+
base: z9.literal("repo").optional(),
|
|
14389
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
14083
14390
|
})
|
|
14084
14391
|
).optional(),
|
|
14085
|
-
repoRoot:
|
|
14392
|
+
repoRoot: z9.string().min(1).optional()
|
|
14086
14393
|
});
|
|
14087
|
-
var docsModernizeOverridesSchema =
|
|
14394
|
+
var docsModernizeOverridesSchema = z9.record(
|
|
14088
14395
|
relPath,
|
|
14089
|
-
|
|
14090
|
-
disposition:
|
|
14091
|
-
target:
|
|
14092
|
-
reason:
|
|
14093
|
-
kind:
|
|
14094
|
-
slug:
|
|
14095
|
-
covers:
|
|
14396
|
+
z9.object({
|
|
14397
|
+
disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
|
|
14398
|
+
target: z9.string().min(1).max(1024).nullable().optional(),
|
|
14399
|
+
reason: z9.string().min(1),
|
|
14400
|
+
kind: z9.string().min(1).optional(),
|
|
14401
|
+
slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
|
|
14402
|
+
covers: z9.array(z9.string()).optional()
|
|
14096
14403
|
})
|
|
14097
14404
|
);
|
|
14098
|
-
var receiptOpSchema =
|
|
14099
|
-
op:
|
|
14100
|
-
state:
|
|
14101
|
-
slug:
|
|
14405
|
+
var receiptOpSchema = z9.object({
|
|
14406
|
+
op: z9.enum(DOCS_MODERNIZE_OPS),
|
|
14407
|
+
state: z9.enum(["pending", "done", "reversed"]),
|
|
14408
|
+
slug: z9.string().nullable(),
|
|
14102
14409
|
path: relPath.nullable(),
|
|
14103
|
-
target:
|
|
14104
|
-
attachmentId:
|
|
14105
|
-
ownerId:
|
|
14106
|
-
beforeSha256:
|
|
14107
|
-
afterSha256:
|
|
14108
|
-
prior:
|
|
14109
|
-
lifecycleStatus:
|
|
14110
|
-
supersededBy:
|
|
14111
|
-
supersedes:
|
|
14112
|
-
previousAttachmentId:
|
|
14113
|
-
newAttachmentId:
|
|
14114
|
-
linkTargets:
|
|
14115
|
-
kind:
|
|
14410
|
+
target: z9.string().nullable(),
|
|
14411
|
+
attachmentId: z9.string().nullable(),
|
|
14412
|
+
ownerId: z9.string().nullable(),
|
|
14413
|
+
beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
14414
|
+
afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
|
|
14415
|
+
prior: z9.object({
|
|
14416
|
+
lifecycleStatus: z9.string().nullable().optional(),
|
|
14417
|
+
supersededBy: z9.string().nullable().optional(),
|
|
14418
|
+
supersedes: z9.string().nullable().optional(),
|
|
14419
|
+
previousAttachmentId: z9.string().nullable().optional(),
|
|
14420
|
+
newAttachmentId: z9.string().nullable().optional(),
|
|
14421
|
+
linkTargets: z9.array(z9.string()).optional(),
|
|
14422
|
+
kind: z9.string().nullable().optional()
|
|
14116
14423
|
}).optional(),
|
|
14117
|
-
base:
|
|
14424
|
+
base: z9.literal("repo").optional()
|
|
14118
14425
|
});
|
|
14119
14426
|
var docsModernizeJournalLineSchema = receiptOpSchema.extend({
|
|
14120
|
-
i:
|
|
14427
|
+
i: z9.number().int().min(0)
|
|
14121
14428
|
});
|
|
14122
|
-
var docsModernizeReceiptSchema =
|
|
14123
|
-
runId:
|
|
14124
|
-
root:
|
|
14125
|
-
appliedAt:
|
|
14126
|
-
planSha256:
|
|
14127
|
-
edgeCount:
|
|
14128
|
-
rolledBackAt:
|
|
14129
|
-
blobs:
|
|
14130
|
-
moves:
|
|
14131
|
-
deleted:
|
|
14132
|
-
ops:
|
|
14133
|
-
durationMs:
|
|
14134
|
-
repoRoot:
|
|
14429
|
+
var docsModernizeReceiptSchema = z9.object({
|
|
14430
|
+
runId: z9.string().regex(/^dm-[\w-]+$/),
|
|
14431
|
+
root: z9.string().min(1),
|
|
14432
|
+
appliedAt: z9.string(),
|
|
14433
|
+
planSha256: z9.string(),
|
|
14434
|
+
edgeCount: z9.number(),
|
|
14435
|
+
rolledBackAt: z9.string().nullable(),
|
|
14436
|
+
blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
|
|
14437
|
+
moves: z9.array(z9.object({ from: relPath, to: relPath })),
|
|
14438
|
+
deleted: z9.array(relPath),
|
|
14439
|
+
ops: z9.array(receiptOpSchema),
|
|
14440
|
+
durationMs: z9.number().optional(),
|
|
14441
|
+
repoRoot: z9.string().min(1).optional()
|
|
14135
14442
|
});
|
|
14136
14443
|
|
|
14137
14444
|
// packages/contracts/src/docs/provenance.ts
|
|
14138
|
-
import { z as
|
|
14445
|
+
import { z as z10 } from "zod";
|
|
14139
14446
|
var PROVENANCE_NODE_KINDS = [
|
|
14140
14447
|
"doc",
|
|
14141
14448
|
"task",
|
|
@@ -14158,96 +14465,96 @@ var DOC_LIFECYCLE_STATUSES = [
|
|
|
14158
14465
|
"archived",
|
|
14159
14466
|
"draft"
|
|
14160
14467
|
];
|
|
14161
|
-
var provenanceNodeKindSchema =
|
|
14162
|
-
var provenanceEdgeRelationSchema =
|
|
14163
|
-
var docLifecycleStatusSchema =
|
|
14468
|
+
var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
|
|
14469
|
+
var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
|
|
14470
|
+
var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
|
|
14164
14471
|
var provenanceNodeBaseFields = {
|
|
14165
|
-
id:
|
|
14166
|
-
title:
|
|
14167
|
-
metadata:
|
|
14472
|
+
id: z10.string().min(1),
|
|
14473
|
+
title: z10.string().min(1),
|
|
14474
|
+
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
14168
14475
|
};
|
|
14169
|
-
var provenanceDocNodeSchema =
|
|
14476
|
+
var provenanceDocNodeSchema = z10.object({
|
|
14170
14477
|
...provenanceNodeBaseFields,
|
|
14171
|
-
kind:
|
|
14172
|
-
slug:
|
|
14173
|
-
docKind:
|
|
14478
|
+
kind: z10.literal("doc"),
|
|
14479
|
+
slug: z10.string().min(1),
|
|
14480
|
+
docKind: z10.string().min(1),
|
|
14174
14481
|
lifecycleStatus: docLifecycleStatusSchema,
|
|
14175
|
-
publishedAt:
|
|
14176
|
-
supersededAt:
|
|
14177
|
-
summary:
|
|
14482
|
+
publishedAt: z10.string().min(1),
|
|
14483
|
+
supersededAt: z10.string().min(1).optional(),
|
|
14484
|
+
summary: z10.string().optional()
|
|
14178
14485
|
});
|
|
14179
|
-
var provenanceTaskNodeSchema =
|
|
14486
|
+
var provenanceTaskNodeSchema = z10.object({
|
|
14180
14487
|
...provenanceNodeBaseFields,
|
|
14181
|
-
kind:
|
|
14182
|
-
taskType:
|
|
14183
|
-
status:
|
|
14488
|
+
kind: z10.literal("task"),
|
|
14489
|
+
taskType: z10.enum(["saga", "epic", "task", "subtask"]),
|
|
14490
|
+
status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
|
|
14184
14491
|
});
|
|
14185
|
-
var provenanceDecisionNodeSchema =
|
|
14492
|
+
var provenanceDecisionNodeSchema = z10.object({
|
|
14186
14493
|
...provenanceNodeBaseFields,
|
|
14187
|
-
kind:
|
|
14188
|
-
outcome:
|
|
14189
|
-
decidedAt:
|
|
14494
|
+
kind: z10.literal("decision"),
|
|
14495
|
+
outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
|
|
14496
|
+
decidedAt: z10.string().min(1)
|
|
14190
14497
|
});
|
|
14191
|
-
var provenanceSessionNodeSchema =
|
|
14498
|
+
var provenanceSessionNodeSchema = z10.object({
|
|
14192
14499
|
...provenanceNodeBaseFields,
|
|
14193
|
-
kind:
|
|
14194
|
-
startedAt:
|
|
14195
|
-
endedAt:
|
|
14500
|
+
kind: z10.literal("session"),
|
|
14501
|
+
startedAt: z10.string().min(1),
|
|
14502
|
+
endedAt: z10.string().min(1).optional()
|
|
14196
14503
|
});
|
|
14197
|
-
var provenanceMemoryNodeSchema =
|
|
14504
|
+
var provenanceMemoryNodeSchema = z10.object({
|
|
14198
14505
|
...provenanceNodeBaseFields,
|
|
14199
|
-
kind:
|
|
14200
|
-
memoryType:
|
|
14201
|
-
recordedAt:
|
|
14506
|
+
kind: z10.literal("memory"),
|
|
14507
|
+
memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
|
|
14508
|
+
recordedAt: z10.string().min(1)
|
|
14202
14509
|
});
|
|
14203
|
-
var provenanceNodeSchema =
|
|
14510
|
+
var provenanceNodeSchema = z10.discriminatedUnion("kind", [
|
|
14204
14511
|
provenanceDocNodeSchema,
|
|
14205
14512
|
provenanceTaskNodeSchema,
|
|
14206
14513
|
provenanceDecisionNodeSchema,
|
|
14207
14514
|
provenanceSessionNodeSchema,
|
|
14208
14515
|
provenanceMemoryNodeSchema
|
|
14209
14516
|
]);
|
|
14210
|
-
var provenanceEdgeSchema =
|
|
14517
|
+
var provenanceEdgeSchema = z10.object({
|
|
14211
14518
|
relation: provenanceEdgeRelationSchema,
|
|
14212
|
-
from:
|
|
14519
|
+
from: z10.string().min(1),
|
|
14213
14520
|
fromKind: provenanceNodeKindSchema,
|
|
14214
|
-
to:
|
|
14521
|
+
to: z10.string().min(1),
|
|
14215
14522
|
toKind: provenanceNodeKindSchema,
|
|
14216
|
-
addedAt:
|
|
14217
|
-
summary:
|
|
14523
|
+
addedAt: z10.string().min(1),
|
|
14524
|
+
summary: z10.string().optional()
|
|
14218
14525
|
});
|
|
14219
|
-
var docProvenanceResponseSchema =
|
|
14220
|
-
nodes:
|
|
14221
|
-
edges:
|
|
14222
|
-
totalNodes:
|
|
14223
|
-
totalEdges:
|
|
14526
|
+
var docProvenanceResponseSchema = z10.object({
|
|
14527
|
+
nodes: z10.array(provenanceNodeSchema).readonly(),
|
|
14528
|
+
edges: z10.array(provenanceEdgeSchema).readonly(),
|
|
14529
|
+
totalNodes: z10.number().int().nonnegative(),
|
|
14530
|
+
totalEdges: z10.number().int().nonnegative()
|
|
14224
14531
|
});
|
|
14225
14532
|
|
|
14226
14533
|
// packages/contracts/src/docs/read.ts
|
|
14227
|
-
import { z as
|
|
14228
|
-
var docFrontmatterSchema =
|
|
14229
|
-
slug:
|
|
14230
|
-
kind:
|
|
14231
|
-
title:
|
|
14232
|
-
summary:
|
|
14233
|
-
lifecycleStatus:
|
|
14234
|
-
docVersion:
|
|
14235
|
-
ownerVersion:
|
|
14236
|
-
supersedes:
|
|
14237
|
-
supersededBy:
|
|
14238
|
-
topics:
|
|
14239
|
-
relatedTasks:
|
|
14240
|
-
sha256:
|
|
14241
|
-
createdAt:
|
|
14534
|
+
import { z as z11 } from "zod";
|
|
14535
|
+
var docFrontmatterSchema = z11.object({
|
|
14536
|
+
slug: z11.string(),
|
|
14537
|
+
kind: z11.string().nullable(),
|
|
14538
|
+
title: z11.string().nullable(),
|
|
14539
|
+
summary: z11.string().nullable(),
|
|
14540
|
+
lifecycleStatus: z11.string(),
|
|
14541
|
+
docVersion: z11.number().int(),
|
|
14542
|
+
ownerVersion: z11.string().nullable(),
|
|
14543
|
+
supersedes: z11.string().nullable(),
|
|
14544
|
+
supersededBy: z11.string().nullable(),
|
|
14545
|
+
topics: z11.array(z11.string()).readonly(),
|
|
14546
|
+
relatedTasks: z11.array(z11.string()).readonly(),
|
|
14547
|
+
sha256: z11.string(),
|
|
14548
|
+
createdAt: z11.string()
|
|
14242
14549
|
});
|
|
14243
|
-
var docBodySchema =
|
|
14244
|
-
encoding:
|
|
14245
|
-
text:
|
|
14246
|
-
base64:
|
|
14247
|
-
sizeBytes:
|
|
14248
|
-
mimeType:
|
|
14550
|
+
var docBodySchema = z11.object({
|
|
14551
|
+
encoding: z11.enum(["utf-8", "base64"]),
|
|
14552
|
+
text: z11.string().optional(),
|
|
14553
|
+
base64: z11.string().optional(),
|
|
14554
|
+
sizeBytes: z11.number().int().nonnegative(),
|
|
14555
|
+
mimeType: z11.string().nullable()
|
|
14249
14556
|
});
|
|
14250
|
-
var docReadResponseSchema =
|
|
14557
|
+
var docReadResponseSchema = z11.object({
|
|
14251
14558
|
frontmatter: docFrontmatterSchema,
|
|
14252
14559
|
body: docBodySchema
|
|
14253
14560
|
});
|
|
@@ -14420,7 +14727,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
|
|
|
14420
14727
|
}
|
|
14421
14728
|
|
|
14422
14729
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
14423
|
-
import { z as
|
|
14730
|
+
import { z as z12 } from "zod";
|
|
14424
14731
|
var EVIDENCE_ATOM_KINDS = [
|
|
14425
14732
|
"commit",
|
|
14426
14733
|
"files",
|
|
@@ -14442,96 +14749,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
|
|
|
14442
14749
|
var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
|
|
14443
14750
|
var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
14444
14751
|
var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
|
|
14445
|
-
var commitAtomSchema =
|
|
14446
|
-
kind:
|
|
14447
|
-
sha:
|
|
14752
|
+
var commitAtomSchema = z12.object({
|
|
14753
|
+
kind: z12.literal("commit"),
|
|
14754
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
|
|
14448
14755
|
});
|
|
14449
|
-
var filesAtomSchema =
|
|
14450
|
-
kind:
|
|
14451
|
-
paths:
|
|
14756
|
+
var filesAtomSchema = z12.object({
|
|
14757
|
+
kind: z12.literal("files"),
|
|
14758
|
+
paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
|
|
14452
14759
|
});
|
|
14453
|
-
var testRunAtomSchema =
|
|
14454
|
-
kind:
|
|
14455
|
-
path:
|
|
14760
|
+
var testRunAtomSchema = z12.object({
|
|
14761
|
+
kind: z12.literal("test-run"),
|
|
14762
|
+
path: z12.string().min(1, "test-run atom requires a non-empty path")
|
|
14456
14763
|
});
|
|
14457
|
-
var qaRunAtomSchema =
|
|
14458
|
-
kind:
|
|
14459
|
-
path:
|
|
14764
|
+
var qaRunAtomSchema = z12.object({
|
|
14765
|
+
kind: z12.literal("qa-run"),
|
|
14766
|
+
path: z12.string().min(1, "qa-run atom requires a non-empty path")
|
|
14460
14767
|
});
|
|
14461
|
-
var toolAtomSchema =
|
|
14462
|
-
kind:
|
|
14463
|
-
tool:
|
|
14768
|
+
var toolAtomSchema = z12.object({
|
|
14769
|
+
kind: z12.literal("tool"),
|
|
14770
|
+
tool: z12.string().min(1, "tool atom requires a non-empty tool name")
|
|
14464
14771
|
});
|
|
14465
|
-
var urlAtomSchema =
|
|
14466
|
-
kind:
|
|
14467
|
-
url:
|
|
14772
|
+
var urlAtomSchema = z12.object({
|
|
14773
|
+
kind: z12.literal("url"),
|
|
14774
|
+
url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
|
|
14468
14775
|
});
|
|
14469
|
-
var noteAtomSchema =
|
|
14470
|
-
kind:
|
|
14471
|
-
note:
|
|
14776
|
+
var noteAtomSchema = z12.object({
|
|
14777
|
+
kind: z12.literal("note"),
|
|
14778
|
+
note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
|
|
14472
14779
|
});
|
|
14473
|
-
var decisionAtomSchema =
|
|
14474
|
-
kind:
|
|
14475
|
-
decisionId:
|
|
14780
|
+
var decisionAtomSchema = z12.object({
|
|
14781
|
+
kind: z12.literal("decision"),
|
|
14782
|
+
decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
|
|
14476
14783
|
});
|
|
14477
|
-
var prAtomSchema =
|
|
14478
|
-
kind:
|
|
14479
|
-
prNumber:
|
|
14480
|
-
componentPrNumber:
|
|
14784
|
+
var prAtomSchema = z12.object({
|
|
14785
|
+
kind: z12.literal("pr"),
|
|
14786
|
+
prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
|
|
14787
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14481
14788
|
/**
|
|
14482
14789
|
* `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
|
|
14483
14790
|
* belongs to, lowercased. Validated against the evidence git root's
|
|
14484
14791
|
* `origin`, since PR numbers are only unique per repository.
|
|
14485
14792
|
*/
|
|
14486
|
-
repo:
|
|
14793
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14487
14794
|
});
|
|
14488
|
-
var ciAtomSchema =
|
|
14489
|
-
kind:
|
|
14490
|
-
prNumber:
|
|
14491
|
-
componentPrNumber:
|
|
14795
|
+
var ciAtomSchema = z12.object({
|
|
14796
|
+
kind: z12.literal("ci"),
|
|
14797
|
+
prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
|
|
14798
|
+
componentPrNumber: z12.number().int().positive().optional(),
|
|
14492
14799
|
/** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
|
|
14493
|
-
repo:
|
|
14800
|
+
repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
|
|
14494
14801
|
});
|
|
14495
|
-
var ciRunAtomSchema =
|
|
14496
|
-
kind:
|
|
14497
|
-
runId:
|
|
14802
|
+
var ciRunAtomSchema = z12.object({
|
|
14803
|
+
kind: z12.literal("ci-run"),
|
|
14804
|
+
runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
|
|
14498
14805
|
});
|
|
14499
|
-
var deployAtomSchema =
|
|
14500
|
-
kind:
|
|
14501
|
-
provider:
|
|
14502
|
-
deploymentId:
|
|
14503
|
-
sha:
|
|
14504
|
-
probeUrl:
|
|
14806
|
+
var deployAtomSchema = z12.object({
|
|
14807
|
+
kind: z12.literal("deploy"),
|
|
14808
|
+
provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
|
|
14809
|
+
deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
|
|
14810
|
+
sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
|
|
14811
|
+
probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
|
|
14505
14812
|
});
|
|
14506
|
-
var locDropAtomSchema =
|
|
14507
|
-
kind:
|
|
14508
|
-
fromLines:
|
|
14509
|
-
toLines:
|
|
14813
|
+
var locDropAtomSchema = z12.object({
|
|
14814
|
+
kind: z12.literal("loc-drop"),
|
|
14815
|
+
fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
|
|
14816
|
+
toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
|
|
14510
14817
|
});
|
|
14511
|
-
var callsiteCoverageAtomSchema =
|
|
14512
|
-
kind:
|
|
14513
|
-
symbolName:
|
|
14514
|
-
relativeSourcePath:
|
|
14818
|
+
var callsiteCoverageAtomSchema = z12.object({
|
|
14819
|
+
kind: z12.literal("callsite-coverage"),
|
|
14820
|
+
symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
14821
|
+
relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
14515
14822
|
});
|
|
14516
14823
|
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}$/;
|
|
14517
14824
|
var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
14518
14825
|
var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
14519
14826
|
var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
14520
|
-
var satisfiesAtomSchema =
|
|
14521
|
-
kind:
|
|
14827
|
+
var satisfiesAtomSchema = z12.object({
|
|
14828
|
+
kind: z12.literal("satisfies"),
|
|
14522
14829
|
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
14523
|
-
targetTaskId:
|
|
14830
|
+
targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
14524
14831
|
/** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
|
|
14525
|
-
targetAcId:
|
|
14832
|
+
targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
|
|
14526
14833
|
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
14527
|
-
targetAcAlias:
|
|
14834
|
+
targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
14528
14835
|
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
14529
|
-
versionPin:
|
|
14836
|
+
versionPin: z12.string().regex(
|
|
14530
14837
|
SATISFIES_VERSION_PIN_REGEX,
|
|
14531
14838
|
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
14532
14839
|
).optional()
|
|
14533
14840
|
});
|
|
14534
|
-
var EvidenceAtomSchema =
|
|
14841
|
+
var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
|
|
14535
14842
|
commitAtomSchema,
|
|
14536
14843
|
filesAtomSchema,
|
|
14537
14844
|
testRunAtomSchema,
|
|
@@ -14593,54 +14900,54 @@ var ATOM_EXAMPLES = Object.freeze({
|
|
|
14593
14900
|
});
|
|
14594
14901
|
|
|
14595
14902
|
// packages/contracts/src/evidence-record-schema.ts
|
|
14596
|
-
import { z as
|
|
14597
|
-
var evidenceBaseSchema =
|
|
14903
|
+
import { z as z13 } from "zod";
|
|
14904
|
+
var evidenceBaseSchema = z13.object({
|
|
14598
14905
|
/** Identity string of the agent that produced this record. */
|
|
14599
|
-
agentIdentity:
|
|
14906
|
+
agentIdentity: z13.string().min(1),
|
|
14600
14907
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
14601
|
-
attachmentSha256:
|
|
14908
|
+
attachmentSha256: z13.string().length(64),
|
|
14602
14909
|
/** ISO 8601 timestamp at which the action ran. */
|
|
14603
|
-
ranAt:
|
|
14910
|
+
ranAt: z13.string().datetime(),
|
|
14604
14911
|
/** Wall-clock duration of the action in milliseconds. */
|
|
14605
|
-
durationMs:
|
|
14912
|
+
durationMs: z13.number().nonnegative()
|
|
14606
14913
|
});
|
|
14607
14914
|
var implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
14608
|
-
kind:
|
|
14609
|
-
phase:
|
|
14610
|
-
filesChanged:
|
|
14611
|
-
linesAdded:
|
|
14612
|
-
linesRemoved:
|
|
14915
|
+
kind: z13.literal("impl-diff"),
|
|
14916
|
+
phase: z13.literal("implement"),
|
|
14917
|
+
filesChanged: z13.array(z13.string().min(1)).min(1),
|
|
14918
|
+
linesAdded: z13.number().int().nonnegative(),
|
|
14919
|
+
linesRemoved: z13.number().int().nonnegative()
|
|
14613
14920
|
});
|
|
14614
14921
|
var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
14615
|
-
kind:
|
|
14616
|
-
phase:
|
|
14617
|
-
reqIdsChecked:
|
|
14618
|
-
passed:
|
|
14619
|
-
details:
|
|
14922
|
+
kind: z13.literal("validate-spec-check"),
|
|
14923
|
+
phase: z13.literal("validate"),
|
|
14924
|
+
reqIdsChecked: z13.array(z13.string().min(1)).min(1),
|
|
14925
|
+
passed: z13.boolean(),
|
|
14926
|
+
details: z13.string().min(1)
|
|
14620
14927
|
});
|
|
14621
14928
|
var testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14622
|
-
kind:
|
|
14623
|
-
phase:
|
|
14624
|
-
command:
|
|
14625
|
-
exitCode:
|
|
14626
|
-
testsPassed:
|
|
14627
|
-
testsFailed:
|
|
14929
|
+
kind: z13.literal("test-output"),
|
|
14930
|
+
phase: z13.literal("test"),
|
|
14931
|
+
command: z13.string().min(1),
|
|
14932
|
+
exitCode: z13.number().int(),
|
|
14933
|
+
testsPassed: z13.number().int().nonnegative(),
|
|
14934
|
+
testsFailed: z13.number().int().nonnegative()
|
|
14628
14935
|
});
|
|
14629
14936
|
var lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
14630
|
-
kind:
|
|
14631
|
-
phase:
|
|
14632
|
-
tool:
|
|
14633
|
-
passed:
|
|
14634
|
-
warnings:
|
|
14635
|
-
errors:
|
|
14937
|
+
kind: z13.literal("lint-report"),
|
|
14938
|
+
phase: z13.enum(["implement", "test"]),
|
|
14939
|
+
tool: z13.string().min(1),
|
|
14940
|
+
passed: z13.boolean(),
|
|
14941
|
+
warnings: z13.number().int().nonnegative(),
|
|
14942
|
+
errors: z13.number().int().nonnegative()
|
|
14636
14943
|
});
|
|
14637
14944
|
var commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
14638
|
-
kind:
|
|
14639
|
-
phase:
|
|
14640
|
-
cmd:
|
|
14641
|
-
exitCode:
|
|
14945
|
+
kind: z13.literal("command-output"),
|
|
14946
|
+
phase: z13.enum(["implement", "validate", "test"]),
|
|
14947
|
+
cmd: z13.string().min(1),
|
|
14948
|
+
exitCode: z13.number().int()
|
|
14642
14949
|
});
|
|
14643
|
-
var evidenceRecordSchema =
|
|
14950
|
+
var evidenceRecordSchema = z13.discriminatedUnion("kind", [
|
|
14644
14951
|
implDiffRecordSchema,
|
|
14645
14952
|
validateSpecCheckRecordSchema,
|
|
14646
14953
|
testOutputRecordSchema,
|
|
@@ -15575,107 +15882,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
|
|
|
15575
15882
|
});
|
|
15576
15883
|
|
|
15577
15884
|
// packages/contracts/src/lease-ipc/messages.ts
|
|
15578
|
-
import { z as
|
|
15579
|
-
var LeaseScopeSchema =
|
|
15580
|
-
var LeaseLaneSchema =
|
|
15581
|
-
var LeaseAcquireRequestSchema =
|
|
15885
|
+
import { z as z14 } from "zod";
|
|
15886
|
+
var LeaseScopeSchema = z14.enum(["project", "global"]);
|
|
15887
|
+
var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
|
|
15888
|
+
var LeaseAcquireRequestSchema = z14.object({
|
|
15582
15889
|
/** Tag discriminating this request variant. */
|
|
15583
|
-
kind:
|
|
15890
|
+
kind: z14.literal("lease_acquire"),
|
|
15584
15891
|
/** The cleo.db scope being arbitrated. */
|
|
15585
15892
|
scope: LeaseScopeSchema,
|
|
15586
15893
|
/** The write lane within the scope. */
|
|
15587
15894
|
lane: LeaseLaneSchema,
|
|
15588
15895
|
/** Process+lane holder identity. */
|
|
15589
|
-
holder_id:
|
|
15896
|
+
holder_id: z14.string().min(1),
|
|
15590
15897
|
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
15591
|
-
priority:
|
|
15898
|
+
priority: z14.number().int().min(0).max(255),
|
|
15592
15899
|
/** Lease time-to-live in milliseconds. */
|
|
15593
|
-
ttl_ms:
|
|
15900
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15594
15901
|
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
15595
|
-
reentrant:
|
|
15902
|
+
reentrant: z14.boolean()
|
|
15596
15903
|
}).strict();
|
|
15597
|
-
var LeaseReleaseRequestSchema =
|
|
15904
|
+
var LeaseReleaseRequestSchema = z14.object({
|
|
15598
15905
|
/** Tag discriminating this request variant. */
|
|
15599
|
-
kind:
|
|
15906
|
+
kind: z14.literal("lease_release"),
|
|
15600
15907
|
/** The cleo.db scope being arbitrated. */
|
|
15601
15908
|
scope: LeaseScopeSchema,
|
|
15602
15909
|
/** The write lane within the scope. */
|
|
15603
15910
|
lane: LeaseLaneSchema,
|
|
15604
15911
|
/** Process+lane holder identity. */
|
|
15605
|
-
holder_id:
|
|
15912
|
+
holder_id: z14.string().min(1),
|
|
15606
15913
|
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
15607
|
-
epoch:
|
|
15914
|
+
epoch: z14.number().int().nonnegative()
|
|
15608
15915
|
}).strict();
|
|
15609
|
-
var LeaseRenewRequestSchema =
|
|
15916
|
+
var LeaseRenewRequestSchema = z14.object({
|
|
15610
15917
|
/** Tag discriminating this request variant. */
|
|
15611
|
-
kind:
|
|
15918
|
+
kind: z14.literal("lease_renew"),
|
|
15612
15919
|
/** The cleo.db scope being arbitrated. */
|
|
15613
15920
|
scope: LeaseScopeSchema,
|
|
15614
15921
|
/** The write lane within the scope. */
|
|
15615
15922
|
lane: LeaseLaneSchema,
|
|
15616
15923
|
/** Process+lane holder identity. */
|
|
15617
|
-
holder_id:
|
|
15924
|
+
holder_id: z14.string().min(1),
|
|
15618
15925
|
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
15619
|
-
epoch:
|
|
15926
|
+
epoch: z14.number().int().nonnegative()
|
|
15620
15927
|
}).strict();
|
|
15621
|
-
var RateCheckRequestSchema =
|
|
15928
|
+
var RateCheckRequestSchema = z14.object({
|
|
15622
15929
|
/** Tag discriminating this request variant. */
|
|
15623
|
-
kind:
|
|
15930
|
+
kind: z14.literal("rate_check"),
|
|
15624
15931
|
/** The cleo.db scope being checked. */
|
|
15625
15932
|
scope: LeaseScopeSchema,
|
|
15626
15933
|
/** The write lane within the scope. */
|
|
15627
15934
|
lane: LeaseLaneSchema,
|
|
15628
15935
|
/** Estimated bytes the caller intends to write. */
|
|
15629
|
-
est_bytes:
|
|
15936
|
+
est_bytes: z14.number().int().nonnegative()
|
|
15630
15937
|
}).strict();
|
|
15631
|
-
var ToolGrantRequestSchema =
|
|
15938
|
+
var ToolGrantRequestSchema = z14.object({
|
|
15632
15939
|
/** Tag discriminating this request variant. */
|
|
15633
|
-
kind:
|
|
15940
|
+
kind: z14.literal("tool_grant"),
|
|
15634
15941
|
/** The tool name being requested. */
|
|
15635
|
-
tool:
|
|
15942
|
+
tool: z14.string().min(1),
|
|
15636
15943
|
/** The requesting holder identity. */
|
|
15637
|
-
holder_id:
|
|
15944
|
+
holder_id: z14.string().min(1)
|
|
15638
15945
|
}).strict();
|
|
15639
|
-
var QueuePriorityClassSchema =
|
|
15640
|
-
var QueueAdmitRequestSchema =
|
|
15946
|
+
var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
|
|
15947
|
+
var QueueAdmitRequestSchema = z14.object({
|
|
15641
15948
|
/** Tag discriminating this request variant. */
|
|
15642
|
-
kind:
|
|
15949
|
+
kind: z14.literal("queue_admit"),
|
|
15643
15950
|
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
15644
|
-
provider:
|
|
15951
|
+
provider: z14.string().min(1),
|
|
15645
15952
|
/** The caller's priority class (lead > worker > background). */
|
|
15646
15953
|
priority_class: QueuePriorityClassSchema,
|
|
15647
15954
|
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
15648
|
-
est_tokens:
|
|
15955
|
+
est_tokens: z14.number().int().nonnegative(),
|
|
15649
15956
|
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
15650
|
-
child_id:
|
|
15957
|
+
child_id: z14.string().min(1)
|
|
15651
15958
|
}).strict();
|
|
15652
|
-
var WorkerHeartbeatRequestSchema =
|
|
15959
|
+
var WorkerHeartbeatRequestSchema = z14.object({
|
|
15653
15960
|
/** Tag discriminating this request variant. */
|
|
15654
|
-
kind:
|
|
15961
|
+
kind: z14.literal("worker_heartbeat"),
|
|
15655
15962
|
/** The logical id of the heartbeating child (matches the registry key). */
|
|
15656
|
-
child_id:
|
|
15963
|
+
child_id: z14.string().min(1),
|
|
15657
15964
|
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
15658
|
-
in_flight_llm:
|
|
15965
|
+
in_flight_llm: z14.boolean()
|
|
15659
15966
|
}).strict();
|
|
15660
|
-
var ResourceAdmitRequestSchema =
|
|
15967
|
+
var ResourceAdmitRequestSchema = z14.object({
|
|
15661
15968
|
/** Tag discriminating this request variant. */
|
|
15662
|
-
kind:
|
|
15969
|
+
kind: z14.literal("resource_admit"),
|
|
15663
15970
|
/** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
|
|
15664
|
-
class:
|
|
15971
|
+
class: z14.string().min(1),
|
|
15665
15972
|
/** The caller holding the slot — process/worktree-unique; the release key. */
|
|
15666
|
-
holder_id:
|
|
15973
|
+
holder_id: z14.string().min(1),
|
|
15667
15974
|
/** The client-computed budget: the max concurrent holders for this class. */
|
|
15668
|
-
budget:
|
|
15975
|
+
budget: z14.number().int().nonnegative()
|
|
15669
15976
|
}).strict();
|
|
15670
|
-
var ResourceReleaseRequestSchema =
|
|
15977
|
+
var ResourceReleaseRequestSchema = z14.object({
|
|
15671
15978
|
/** Tag discriminating this request variant. */
|
|
15672
|
-
kind:
|
|
15979
|
+
kind: z14.literal("resource_release"),
|
|
15673
15980
|
/** The resource class the slot belongs to. */
|
|
15674
|
-
class:
|
|
15981
|
+
class: z14.string().min(1),
|
|
15675
15982
|
/** The holder that was admitted (matches the admit `holder_id`). */
|
|
15676
|
-
holder_id:
|
|
15983
|
+
holder_id: z14.string().min(1)
|
|
15677
15984
|
}).strict();
|
|
15678
|
-
var LeaseIpcRequestSchema =
|
|
15985
|
+
var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
|
|
15679
15986
|
LeaseAcquireRequestSchema,
|
|
15680
15987
|
LeaseReleaseRequestSchema,
|
|
15681
15988
|
LeaseRenewRequestSchema,
|
|
@@ -15686,133 +15993,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
|
|
|
15686
15993
|
ResourceAdmitRequestSchema,
|
|
15687
15994
|
ResourceReleaseRequestSchema
|
|
15688
15995
|
]);
|
|
15689
|
-
var LeaseGrantedResponseSchema =
|
|
15996
|
+
var LeaseGrantedResponseSchema = z14.object({
|
|
15690
15997
|
/** Tag discriminating this response variant. */
|
|
15691
|
-
kind:
|
|
15998
|
+
kind: z14.literal("lease_granted"),
|
|
15692
15999
|
/** The granted cleo.db scope. */
|
|
15693
16000
|
scope: LeaseScopeSchema,
|
|
15694
16001
|
/** The granted write lane. */
|
|
15695
16002
|
lane: LeaseLaneSchema,
|
|
15696
16003
|
/** The holder the lease was granted to. */
|
|
15697
|
-
holder_id:
|
|
16004
|
+
holder_id: z14.string().min(1),
|
|
15698
16005
|
/** The monotonic epoch fence assigned to this grant. */
|
|
15699
|
-
epoch:
|
|
16006
|
+
epoch: z14.number().int().nonnegative(),
|
|
15700
16007
|
/** The lease TTL in milliseconds. */
|
|
15701
|
-
ttl_ms:
|
|
16008
|
+
ttl_ms: z14.number().int().nonnegative(),
|
|
15702
16009
|
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
15703
|
-
expires_at_ms:
|
|
16010
|
+
expires_at_ms: z14.number().int().nonnegative()
|
|
15704
16011
|
}).strict();
|
|
15705
|
-
var LeaseQueuedResponseSchema =
|
|
16012
|
+
var LeaseQueuedResponseSchema = z14.object({
|
|
15706
16013
|
/** Tag discriminating this response variant. */
|
|
15707
|
-
kind:
|
|
16014
|
+
kind: z14.literal("lease_queued"),
|
|
15708
16015
|
/** The queued cleo.db scope. */
|
|
15709
16016
|
scope: LeaseScopeSchema,
|
|
15710
16017
|
/** The queued write lane. */
|
|
15711
16018
|
lane: LeaseLaneSchema,
|
|
15712
16019
|
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
15713
|
-
ticket:
|
|
16020
|
+
ticket: z14.number().int().nonnegative(),
|
|
15714
16021
|
/** Number of waiters ahead of this one. */
|
|
15715
|
-
ahead:
|
|
16022
|
+
ahead: z14.number().int().nonnegative()
|
|
15716
16023
|
}).strict();
|
|
15717
|
-
var LeaseDeniedResponseSchema =
|
|
16024
|
+
var LeaseDeniedResponseSchema = z14.object({
|
|
15718
16025
|
/** Tag discriminating this response variant. */
|
|
15719
|
-
kind:
|
|
16026
|
+
kind: z14.literal("lease_denied"),
|
|
15720
16027
|
/** The denied cleo.db scope. */
|
|
15721
16028
|
scope: LeaseScopeSchema,
|
|
15722
16029
|
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
15723
|
-
code:
|
|
16030
|
+
code: z14.string().min(1),
|
|
15724
16031
|
/** Human-readable denial message. */
|
|
15725
|
-
message:
|
|
16032
|
+
message: z14.string()
|
|
15726
16033
|
}).strict();
|
|
15727
|
-
var RateResultResponseSchema =
|
|
16034
|
+
var RateResultResponseSchema = z14.object({
|
|
15728
16035
|
/** Tag discriminating this response variant. */
|
|
15729
|
-
kind:
|
|
16036
|
+
kind: z14.literal("rate_result"),
|
|
15730
16037
|
/** The checked cleo.db scope. */
|
|
15731
16038
|
scope: LeaseScopeSchema,
|
|
15732
16039
|
/** Whether the write is within budget. */
|
|
15733
|
-
ok:
|
|
16040
|
+
ok: z14.boolean(),
|
|
15734
16041
|
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
15735
|
-
retry_after_ms:
|
|
16042
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15736
16043
|
/** Remaining token budget for the scope. */
|
|
15737
|
-
tokens_remaining:
|
|
16044
|
+
tokens_remaining: z14.number().int().nonnegative()
|
|
15738
16045
|
}).strict();
|
|
15739
|
-
var ToolGrantedResponseSchema =
|
|
16046
|
+
var ToolGrantedResponseSchema = z14.object({
|
|
15740
16047
|
/** Tag discriminating this response variant. */
|
|
15741
|
-
kind:
|
|
16048
|
+
kind: z14.literal("tool_granted"),
|
|
15742
16049
|
/** The granted tool name. */
|
|
15743
|
-
tool:
|
|
16050
|
+
tool: z14.string().min(1),
|
|
15744
16051
|
/** The holder the tool grant was issued to. */
|
|
15745
|
-
holder_id:
|
|
16052
|
+
holder_id: z14.string().min(1)
|
|
15746
16053
|
}).strict();
|
|
15747
|
-
var LeaseRevokedResponseSchema =
|
|
16054
|
+
var LeaseRevokedResponseSchema = z14.object({
|
|
15748
16055
|
/** Tag discriminating this response variant. */
|
|
15749
|
-
kind:
|
|
16056
|
+
kind: z14.literal("lease_revoked"),
|
|
15750
16057
|
/** The revoked cleo.db scope. */
|
|
15751
16058
|
scope: LeaseScopeSchema,
|
|
15752
16059
|
/** The revoked write lane. */
|
|
15753
16060
|
lane: LeaseLaneSchema,
|
|
15754
16061
|
/** The holder whose lease was revoked. */
|
|
15755
|
-
holder_id:
|
|
16062
|
+
holder_id: z14.string().min(1),
|
|
15756
16063
|
/** Human-readable reason for the revocation. */
|
|
15757
|
-
reason:
|
|
16064
|
+
reason: z14.string()
|
|
15758
16065
|
}).strict();
|
|
15759
|
-
var ChildKilledUnresponsiveResponseSchema =
|
|
16066
|
+
var ChildKilledUnresponsiveResponseSchema = z14.object({
|
|
15760
16067
|
/** Tag discriminating this response variant. */
|
|
15761
|
-
kind:
|
|
16068
|
+
kind: z14.literal("child_killed_unresponsive"),
|
|
15762
16069
|
/** Logical id of the killed child. */
|
|
15763
|
-
child_id:
|
|
16070
|
+
child_id: z14.string().min(1),
|
|
15764
16071
|
/** The holder identity the killed child held the lease as. */
|
|
15765
|
-
holder_id:
|
|
16072
|
+
holder_id: z14.string().min(1),
|
|
15766
16073
|
/** The cleo.db scope the killed child held the lease in. */
|
|
15767
16074
|
scope: LeaseScopeSchema,
|
|
15768
16075
|
/** Human-readable reason for the kill. */
|
|
15769
|
-
reason:
|
|
16076
|
+
reason: z14.string()
|
|
15770
16077
|
}).strict();
|
|
15771
|
-
var QueueAdmitDispositionSchema =
|
|
15772
|
-
var QueueAdmitResultResponseSchema =
|
|
16078
|
+
var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
16079
|
+
var QueueAdmitResultResponseSchema = z14.object({
|
|
15773
16080
|
/** Tag discriminating this response variant. */
|
|
15774
|
-
kind:
|
|
16081
|
+
kind: z14.literal("queue_admit_result"),
|
|
15775
16082
|
/** Whether the LLM call was admitted or deferred. */
|
|
15776
16083
|
disposition: QueueAdmitDispositionSchema,
|
|
15777
16084
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15778
|
-
retry_after_ms:
|
|
16085
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15779
16086
|
/** Remaining provider token budget after this decision. */
|
|
15780
|
-
tokens_remaining:
|
|
16087
|
+
tokens_remaining: z14.number().int().nonnegative(),
|
|
15781
16088
|
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
15782
|
-
queue_position:
|
|
16089
|
+
queue_position: z14.number().int().nonnegative()
|
|
15783
16090
|
}).strict();
|
|
15784
|
-
var HeartbeatAckResponseSchema =
|
|
16091
|
+
var HeartbeatAckResponseSchema = z14.object({
|
|
15785
16092
|
/** Tag discriminating this response variant. */
|
|
15786
|
-
kind:
|
|
16093
|
+
kind: z14.literal("heartbeat_ack")
|
|
15787
16094
|
}).strict();
|
|
15788
|
-
var ResourceAdmitDispositionSchema =
|
|
15789
|
-
var ResourceAdmitResultResponseSchema =
|
|
16095
|
+
var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
|
|
16096
|
+
var ResourceAdmitResultResponseSchema = z14.object({
|
|
15790
16097
|
/** Tag discriminating this response variant. */
|
|
15791
|
-
kind:
|
|
16098
|
+
kind: z14.literal("resource_admit_result"),
|
|
15792
16099
|
/** Whether the heavy op was admitted or deferred. */
|
|
15793
16100
|
disposition: ResourceAdmitDispositionSchema,
|
|
15794
16101
|
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
15795
|
-
retry_after_ms:
|
|
16102
|
+
retry_after_ms: z14.number().int().nonnegative(),
|
|
15796
16103
|
/** Remaining slots for the class after this decision. */
|
|
15797
|
-
slots_remaining:
|
|
16104
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15798
16105
|
}).strict();
|
|
15799
|
-
var ResourceReleaseResultResponseSchema =
|
|
16106
|
+
var ResourceReleaseResultResponseSchema = z14.object({
|
|
15800
16107
|
/** Tag discriminating this response variant. */
|
|
15801
|
-
kind:
|
|
16108
|
+
kind: z14.literal("resource_release_result"),
|
|
15802
16109
|
/** Whether a held slot was actually released (false = no such holder). */
|
|
15803
|
-
released:
|
|
16110
|
+
released: z14.boolean(),
|
|
15804
16111
|
/** Remaining in-flight holders for the class after the release. */
|
|
15805
|
-
slots_remaining:
|
|
16112
|
+
slots_remaining: z14.number().int().nonnegative()
|
|
15806
16113
|
}).strict();
|
|
15807
|
-
var LeaseErrorResponseSchema =
|
|
16114
|
+
var LeaseErrorResponseSchema = z14.object({
|
|
15808
16115
|
/** Tag discriminating this response variant. */
|
|
15809
|
-
kind:
|
|
16116
|
+
kind: z14.literal("error"),
|
|
15810
16117
|
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
15811
|
-
code:
|
|
16118
|
+
code: z14.string().min(1),
|
|
15812
16119
|
/** Human-readable error message. */
|
|
15813
|
-
message:
|
|
16120
|
+
message: z14.string()
|
|
15814
16121
|
}).strict();
|
|
15815
|
-
var LeaseIpcResponseSchema =
|
|
16122
|
+
var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
|
|
15816
16123
|
LeaseGrantedResponseSchema,
|
|
15817
16124
|
LeaseQueuedResponseSchema,
|
|
15818
16125
|
LeaseDeniedResponseSchema,
|
|
@@ -15826,27 +16133,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
|
|
|
15826
16133
|
ResourceReleaseResultResponseSchema,
|
|
15827
16134
|
LeaseErrorResponseSchema
|
|
15828
16135
|
]);
|
|
15829
|
-
var LeaseIpcRequestEnvelopeSchema =
|
|
16136
|
+
var LeaseIpcRequestEnvelopeSchema = z14.object({
|
|
15830
16137
|
/** Parallel protocol version. */
|
|
15831
|
-
protocol_version:
|
|
16138
|
+
protocol_version: z14.string(),
|
|
15832
16139
|
/** Correlation id echoed back on the matching response. */
|
|
15833
|
-
id:
|
|
16140
|
+
id: z14.string().min(1),
|
|
15834
16141
|
/** Direction discriminator. */
|
|
15835
|
-
direction:
|
|
16142
|
+
direction: z14.literal("request"),
|
|
15836
16143
|
/** The request body. */
|
|
15837
16144
|
request: LeaseIpcRequestSchema
|
|
15838
16145
|
}).strict();
|
|
15839
|
-
var LeaseIpcResponseEnvelopeSchema =
|
|
16146
|
+
var LeaseIpcResponseEnvelopeSchema = z14.object({
|
|
15840
16147
|
/** Parallel protocol version. */
|
|
15841
|
-
protocol_version:
|
|
16148
|
+
protocol_version: z14.string(),
|
|
15842
16149
|
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
15843
|
-
id:
|
|
16150
|
+
id: z14.string().min(1),
|
|
15844
16151
|
/** Direction discriminator. */
|
|
15845
|
-
direction:
|
|
16152
|
+
direction: z14.literal("response"),
|
|
15846
16153
|
/** The response body. */
|
|
15847
16154
|
response: LeaseIpcResponseSchema
|
|
15848
16155
|
}).strict();
|
|
15849
|
-
var LeaseIpcEnvelopeSchema =
|
|
16156
|
+
var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
|
|
15850
16157
|
LeaseIpcRequestEnvelopeSchema,
|
|
15851
16158
|
LeaseIpcResponseEnvelopeSchema
|
|
15852
16159
|
]);
|
|
@@ -15881,7 +16188,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
|
|
|
15881
16188
|
];
|
|
15882
16189
|
|
|
15883
16190
|
// packages/contracts/src/llm/catalog-schema.ts
|
|
15884
|
-
import { z as
|
|
16191
|
+
import { z as z15 } from "zod";
|
|
15885
16192
|
var CATALOG_MODEL_STATUSES = [
|
|
15886
16193
|
"stable",
|
|
15887
16194
|
"beta",
|
|
@@ -15890,78 +16197,78 @@ var CATALOG_MODEL_STATUSES = [
|
|
|
15890
16197
|
"retired"
|
|
15891
16198
|
];
|
|
15892
16199
|
var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
|
|
15893
|
-
var isoDate =
|
|
15894
|
-
var semver =
|
|
15895
|
-
var catalogModalitiesSchema =
|
|
15896
|
-
input:
|
|
15897
|
-
output:
|
|
16200
|
+
var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
|
|
16201
|
+
var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
|
|
16202
|
+
var catalogModalitiesSchema = z15.object({
|
|
16203
|
+
input: z15.array(z15.string()),
|
|
16204
|
+
output: z15.array(z15.string())
|
|
15898
16205
|
}).strict();
|
|
15899
|
-
var catalogCostSchema =
|
|
15900
|
-
input:
|
|
15901
|
-
output:
|
|
15902
|
-
cache_read:
|
|
15903
|
-
cache_write:
|
|
15904
|
-
context_over_200k:
|
|
16206
|
+
var catalogCostSchema = z15.object({
|
|
16207
|
+
input: z15.number().optional(),
|
|
16208
|
+
output: z15.number().optional(),
|
|
16209
|
+
cache_read: z15.number().optional(),
|
|
16210
|
+
cache_write: z15.number().optional(),
|
|
16211
|
+
context_over_200k: z15.number().optional()
|
|
15905
16212
|
}).strict();
|
|
15906
|
-
var catalogLimitSchema =
|
|
15907
|
-
context:
|
|
15908
|
-
output:
|
|
16213
|
+
var catalogLimitSchema = z15.object({
|
|
16214
|
+
context: z15.number(),
|
|
16215
|
+
output: z15.number()
|
|
15909
16216
|
}).strict();
|
|
15910
|
-
var catalogModelProviderSchema =
|
|
15911
|
-
npm:
|
|
15912
|
-
api:
|
|
16217
|
+
var catalogModelProviderSchema = z15.object({
|
|
16218
|
+
npm: z15.string(),
|
|
16219
|
+
api: z15.string()
|
|
15913
16220
|
}).strict();
|
|
15914
|
-
var catalogModelEntrySchema =
|
|
15915
|
-
id:
|
|
15916
|
-
name:
|
|
15917
|
-
family:
|
|
15918
|
-
attachment:
|
|
15919
|
-
reasoning:
|
|
15920
|
-
temperature:
|
|
15921
|
-
interleaved:
|
|
15922
|
-
tool_call:
|
|
16221
|
+
var catalogModelEntrySchema = z15.object({
|
|
16222
|
+
id: z15.string(),
|
|
16223
|
+
name: z15.string(),
|
|
16224
|
+
family: z15.string(),
|
|
16225
|
+
attachment: z15.boolean(),
|
|
16226
|
+
reasoning: z15.boolean(),
|
|
16227
|
+
temperature: z15.boolean(),
|
|
16228
|
+
interleaved: z15.boolean(),
|
|
16229
|
+
tool_call: z15.boolean(),
|
|
15923
16230
|
modalities: catalogModalitiesSchema,
|
|
15924
16231
|
cost: catalogCostSchema,
|
|
15925
16232
|
limit: catalogLimitSchema,
|
|
15926
|
-
status:
|
|
16233
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15927
16234
|
release_date: isoDate,
|
|
15928
16235
|
provider: catalogModelProviderSchema
|
|
15929
16236
|
}).strict();
|
|
15930
|
-
var catalogProviderSchema =
|
|
15931
|
-
id:
|
|
15932
|
-
endpoint:
|
|
15933
|
-
authTypes:
|
|
15934
|
-
npm:
|
|
16237
|
+
var catalogProviderSchema = z15.object({
|
|
16238
|
+
id: z15.string(),
|
|
16239
|
+
endpoint: z15.string(),
|
|
16240
|
+
authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
|
|
16241
|
+
npm: z15.string().optional()
|
|
15935
16242
|
}).strict();
|
|
15936
|
-
var curatedCatalogSchema =
|
|
15937
|
-
$schema:
|
|
16243
|
+
var curatedCatalogSchema = z15.object({
|
|
16244
|
+
$schema: z15.string().optional(),
|
|
15938
16245
|
version: semver,
|
|
15939
16246
|
lastUpdated: isoDate,
|
|
15940
|
-
providers:
|
|
15941
|
-
models:
|
|
16247
|
+
providers: z15.record(z15.string(), catalogProviderSchema),
|
|
16248
|
+
models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
|
|
15942
16249
|
}).strict();
|
|
15943
|
-
var modelsCatalogRowInsertSchema =
|
|
15944
|
-
id:
|
|
15945
|
-
providerId:
|
|
15946
|
-
name:
|
|
15947
|
-
family:
|
|
15948
|
-
attachment:
|
|
15949
|
-
reasoning:
|
|
15950
|
-
temperature:
|
|
15951
|
-
interleaved:
|
|
15952
|
-
toolCall:
|
|
15953
|
-
modalities:
|
|
15954
|
-
cost:
|
|
15955
|
-
contextLimit:
|
|
15956
|
-
outputLimit:
|
|
15957
|
-
status:
|
|
16250
|
+
var modelsCatalogRowInsertSchema = z15.object({
|
|
16251
|
+
id: z15.string(),
|
|
16252
|
+
providerId: z15.string(),
|
|
16253
|
+
name: z15.string(),
|
|
16254
|
+
family: z15.string(),
|
|
16255
|
+
attachment: z15.boolean(),
|
|
16256
|
+
reasoning: z15.boolean(),
|
|
16257
|
+
temperature: z15.boolean(),
|
|
16258
|
+
interleaved: z15.boolean(),
|
|
16259
|
+
toolCall: z15.boolean(),
|
|
16260
|
+
modalities: z15.string(),
|
|
16261
|
+
cost: z15.string(),
|
|
16262
|
+
contextLimit: z15.number().nullable().optional(),
|
|
16263
|
+
outputLimit: z15.number().nullable().optional(),
|
|
16264
|
+
status: z15.enum(CATALOG_MODEL_STATUSES),
|
|
15958
16265
|
releaseDate: isoDate,
|
|
15959
|
-
modelsDevId:
|
|
15960
|
-
source:
|
|
15961
|
-
seededAt:
|
|
16266
|
+
modelsDevId: z15.string(),
|
|
16267
|
+
source: z15.string(),
|
|
16268
|
+
seededAt: z15.string().optional()
|
|
15962
16269
|
}).strict();
|
|
15963
16270
|
var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
|
|
15964
|
-
seededAt:
|
|
16271
|
+
seededAt: z15.string()
|
|
15965
16272
|
});
|
|
15966
16273
|
|
|
15967
16274
|
// packages/contracts/src/llm/system-of-use.ts
|
|
@@ -16009,7 +16316,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
|
|
|
16009
16316
|
];
|
|
16010
16317
|
|
|
16011
16318
|
// packages/contracts/src/workgraph.ts
|
|
16012
|
-
import { z as
|
|
16319
|
+
import { z as z16 } from "zod";
|
|
16013
16320
|
|
|
16014
16321
|
// packages/contracts/src/status-registry.ts
|
|
16015
16322
|
var TASK_STATUSES = [
|
|
@@ -16024,10 +16331,10 @@ var TASK_STATUSES = [
|
|
|
16024
16331
|
|
|
16025
16332
|
// packages/contracts/src/workgraph.ts
|
|
16026
16333
|
var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
|
|
16027
|
-
var taskTypeSchema =
|
|
16028
|
-
var taskPrioritySchema =
|
|
16029
|
-
var taskStatusSchema =
|
|
16030
|
-
var verificationGateSchema =
|
|
16334
|
+
var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
|
|
16335
|
+
var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
|
|
16336
|
+
var taskStatusSchema = z16.enum(TASK_STATUSES);
|
|
16337
|
+
var verificationGateSchema = z16.enum([
|
|
16031
16338
|
"implemented",
|
|
16032
16339
|
"testsPassed",
|
|
16033
16340
|
"qaPassed",
|
|
@@ -16036,7 +16343,7 @@ var verificationGateSchema = z15.enum([
|
|
|
16036
16343
|
"documented",
|
|
16037
16344
|
"nexusImpact"
|
|
16038
16345
|
]);
|
|
16039
|
-
var workGraphRelationKindSchema =
|
|
16346
|
+
var workGraphRelationKindSchema = z16.enum([
|
|
16040
16347
|
"contains",
|
|
16041
16348
|
"depends_on",
|
|
16042
16349
|
"blocks",
|
|
@@ -16044,317 +16351,317 @@ var workGraphRelationKindSchema = z15.enum([
|
|
|
16044
16351
|
"groups",
|
|
16045
16352
|
"satisfies"
|
|
16046
16353
|
]);
|
|
16047
|
-
var workGraphTraversalDirectionSchema =
|
|
16354
|
+
var workGraphTraversalDirectionSchema = z16.enum([
|
|
16048
16355
|
"ancestors",
|
|
16049
16356
|
"descendants",
|
|
16050
16357
|
"upstream",
|
|
16051
16358
|
"downstream"
|
|
16052
16359
|
]);
|
|
16053
|
-
var workGraphEdgeDirectionSchema =
|
|
16054
|
-
var paginationParamsSchema =
|
|
16055
|
-
cursor:
|
|
16056
|
-
limit:
|
|
16360
|
+
var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
|
|
16361
|
+
var paginationParamsSchema = z16.object({
|
|
16362
|
+
cursor: z16.string().min(1).optional(),
|
|
16363
|
+
limit: z16.number().int().positive().max(500).optional()
|
|
16057
16364
|
});
|
|
16058
|
-
var workGraphNodeSchema =
|
|
16059
|
-
id:
|
|
16365
|
+
var workGraphNodeSchema = z16.object({
|
|
16366
|
+
id: z16.string().min(1),
|
|
16060
16367
|
type: taskTypeSchema,
|
|
16061
|
-
title:
|
|
16368
|
+
title: z16.string(),
|
|
16062
16369
|
status: taskStatusSchema,
|
|
16063
16370
|
priority: taskPrioritySchema,
|
|
16064
|
-
parentId:
|
|
16371
|
+
parentId: z16.string().min(1).optional()
|
|
16065
16372
|
});
|
|
16066
|
-
var workGraphEdgeSchema =
|
|
16067
|
-
fromId:
|
|
16068
|
-
toId:
|
|
16373
|
+
var workGraphEdgeSchema = z16.object({
|
|
16374
|
+
fromId: z16.string().min(1),
|
|
16375
|
+
toId: z16.string().min(1),
|
|
16069
16376
|
kind: workGraphRelationKindSchema
|
|
16070
16377
|
});
|
|
16071
|
-
var workGraphHierarchyEdgeSchema =
|
|
16072
|
-
fromId:
|
|
16073
|
-
toId:
|
|
16074
|
-
kind:
|
|
16378
|
+
var workGraphHierarchyEdgeSchema = z16.object({
|
|
16379
|
+
fromId: z16.string().min(1),
|
|
16380
|
+
toId: z16.string().min(1),
|
|
16381
|
+
kind: z16.literal("contains")
|
|
16075
16382
|
}).strict();
|
|
16076
|
-
var workGraphPageInfoSchema =
|
|
16077
|
-
nextCursor:
|
|
16078
|
-
hasMore:
|
|
16383
|
+
var workGraphPageInfoSchema = z16.object({
|
|
16384
|
+
nextCursor: z16.string().min(1).optional(),
|
|
16385
|
+
hasMore: z16.boolean()
|
|
16079
16386
|
});
|
|
16080
|
-
var workGraphRollupCountsSchema =
|
|
16081
|
-
total:
|
|
16082
|
-
byStatus:
|
|
16083
|
-
byType:
|
|
16387
|
+
var workGraphRollupCountsSchema = z16.object({
|
|
16388
|
+
total: z16.number().int().nonnegative(),
|
|
16389
|
+
byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
|
|
16390
|
+
byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
|
|
16084
16391
|
});
|
|
16085
|
-
var workGraphSubtreePercentagesSchema =
|
|
16086
|
-
done:
|
|
16087
|
-
active:
|
|
16088
|
-
blocked:
|
|
16089
|
-
pending:
|
|
16090
|
-
cancelled:
|
|
16392
|
+
var workGraphSubtreePercentagesSchema = z16.object({
|
|
16393
|
+
done: z16.number().nonnegative(),
|
|
16394
|
+
active: z16.number().nonnegative(),
|
|
16395
|
+
blocked: z16.number().nonnegative(),
|
|
16396
|
+
pending: z16.number().nonnegative(),
|
|
16397
|
+
cancelled: z16.number().nonnegative()
|
|
16091
16398
|
});
|
|
16092
|
-
var workGraphProjectionMismatchSchema =
|
|
16093
|
-
field:
|
|
16094
|
-
expected:
|
|
16095
|
-
actual:
|
|
16399
|
+
var workGraphProjectionMismatchSchema = z16.object({
|
|
16400
|
+
field: z16.string().min(1),
|
|
16401
|
+
expected: z16.number().int().nonnegative(),
|
|
16402
|
+
actual: z16.number().int().nonnegative()
|
|
16096
16403
|
});
|
|
16097
16404
|
var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
|
|
16098
|
-
role:
|
|
16099
|
-
dependencyBlockers:
|
|
16100
|
-
gateBlockers:
|
|
16405
|
+
role: z16.string().min(1).optional(),
|
|
16406
|
+
dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
|
|
16407
|
+
gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
|
|
16101
16408
|
});
|
|
16102
16409
|
var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
|
|
16103
|
-
source:
|
|
16104
|
-
relationType:
|
|
16105
|
-
reason:
|
|
16410
|
+
source: z16.literal("relation"),
|
|
16411
|
+
relationType: z16.enum(TASK_RELATION_TYPES),
|
|
16412
|
+
reason: z16.string().min(1).optional()
|
|
16106
16413
|
});
|
|
16107
16414
|
var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
|
|
16108
|
-
source:
|
|
16109
|
-
kind:
|
|
16415
|
+
source: z16.literal("dependency"),
|
|
16416
|
+
kind: z16.literal("depends_on")
|
|
16110
16417
|
});
|
|
16111
|
-
var workGraphOmissionReasonSchema =
|
|
16418
|
+
var workGraphOmissionReasonSchema = z16.enum([
|
|
16112
16419
|
"budget_exceeded",
|
|
16113
16420
|
"not_requested",
|
|
16114
16421
|
"not_available",
|
|
16115
16422
|
"redacted",
|
|
16116
16423
|
"truncated"
|
|
16117
16424
|
]);
|
|
16118
|
-
var workGraphContextBudgetSchema =
|
|
16119
|
-
tokenBudget:
|
|
16120
|
-
estimatedTokens:
|
|
16121
|
-
remainingTokens:
|
|
16122
|
-
truncated:
|
|
16425
|
+
var workGraphContextBudgetSchema = z16.object({
|
|
16426
|
+
tokenBudget: z16.number().int().nonnegative(),
|
|
16427
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16428
|
+
remainingTokens: z16.number().int().nonnegative(),
|
|
16429
|
+
truncated: z16.boolean()
|
|
16123
16430
|
});
|
|
16124
|
-
var workGraphOmissionSchema =
|
|
16125
|
-
path:
|
|
16431
|
+
var workGraphOmissionSchema = z16.object({
|
|
16432
|
+
path: z16.string().min(1),
|
|
16126
16433
|
reason: workGraphOmissionReasonSchema,
|
|
16127
|
-
message:
|
|
16128
|
-
estimatedTokens:
|
|
16434
|
+
message: z16.string().min(1),
|
|
16435
|
+
estimatedTokens: z16.number().int().nonnegative().optional()
|
|
16129
16436
|
});
|
|
16130
|
-
var workGraphDirectEdgeSchema =
|
|
16437
|
+
var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
|
|
16131
16438
|
workGraphRelationEdgeSchema,
|
|
16132
16439
|
workGraphDependencyEdgeSchema
|
|
16133
16440
|
]);
|
|
16134
16441
|
var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
|
|
16135
|
-
rootId:
|
|
16136
|
-
tokenBudget:
|
|
16137
|
-
includeRelations:
|
|
16138
|
-
includeReadiness:
|
|
16139
|
-
includeRollup:
|
|
16442
|
+
rootId: z16.string().min(1),
|
|
16443
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16444
|
+
includeRelations: z16.boolean().optional(),
|
|
16445
|
+
includeReadiness: z16.boolean().optional(),
|
|
16446
|
+
includeRollup: z16.boolean().optional()
|
|
16140
16447
|
});
|
|
16141
16448
|
var workGraphSliceParamsSchema = paginationParamsSchema.extend({
|
|
16142
|
-
rootId:
|
|
16449
|
+
rootId: z16.string().min(1),
|
|
16143
16450
|
direction: workGraphTraversalDirectionSchema.optional(),
|
|
16144
|
-
maxDepth:
|
|
16145
|
-
includeRelations:
|
|
16451
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16452
|
+
includeRelations: z16.boolean().optional()
|
|
16146
16453
|
});
|
|
16147
|
-
var workGraphSliceSchema =
|
|
16148
|
-
rootId:
|
|
16454
|
+
var workGraphSliceSchema = z16.object({
|
|
16455
|
+
rootId: z16.string().min(1),
|
|
16149
16456
|
direction: workGraphTraversalDirectionSchema,
|
|
16150
|
-
nodes:
|
|
16151
|
-
edges:
|
|
16457
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16458
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
16152
16459
|
pageInfo: workGraphPageInfoSchema,
|
|
16153
|
-
omissions:
|
|
16460
|
+
omissions: z16.array(workGraphOmissionSchema).optional()
|
|
16154
16461
|
});
|
|
16155
|
-
var workGraphReadinessParamsSchema =
|
|
16156
|
-
rootId:
|
|
16157
|
-
role:
|
|
16158
|
-
includeGateBlockers:
|
|
16462
|
+
var workGraphReadinessParamsSchema = z16.object({
|
|
16463
|
+
rootId: z16.string().min(1),
|
|
16464
|
+
role: z16.string().min(1).optional(),
|
|
16465
|
+
includeGateBlockers: z16.boolean().optional()
|
|
16159
16466
|
});
|
|
16160
|
-
var workGraphReadinessResultSchema =
|
|
16161
|
-
rootId:
|
|
16162
|
-
role:
|
|
16163
|
-
ready:
|
|
16164
|
-
warnings:
|
|
16165
|
-
groups:
|
|
16166
|
-
ready:
|
|
16167
|
-
blocked:
|
|
16168
|
-
blockedBy:
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
kind:
|
|
16172
|
-
blockerId:
|
|
16173
|
-
blocks:
|
|
16467
|
+
var workGraphReadinessResultSchema = z16.object({
|
|
16468
|
+
rootId: z16.string().min(1),
|
|
16469
|
+
role: z16.string().min(1).optional(),
|
|
16470
|
+
ready: z16.boolean(),
|
|
16471
|
+
warnings: z16.array(z16.string()),
|
|
16472
|
+
groups: z16.object({
|
|
16473
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16474
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16475
|
+
blockedBy: z16.array(
|
|
16476
|
+
z16.discriminatedUnion("kind", [
|
|
16477
|
+
z16.object({
|
|
16478
|
+
kind: z16.literal("dependency"),
|
|
16479
|
+
blockerId: z16.string().min(1),
|
|
16480
|
+
blocks: z16.array(z16.string().min(1))
|
|
16174
16481
|
}),
|
|
16175
|
-
|
|
16176
|
-
kind:
|
|
16482
|
+
z16.object({
|
|
16483
|
+
kind: z16.literal("gate"),
|
|
16177
16484
|
gate: verificationGateSchema,
|
|
16178
|
-
blocks:
|
|
16485
|
+
blocks: z16.array(z16.string().min(1))
|
|
16179
16486
|
})
|
|
16180
16487
|
])
|
|
16181
16488
|
)
|
|
16182
16489
|
})
|
|
16183
16490
|
});
|
|
16184
|
-
var workGraphContextPackSchema =
|
|
16185
|
-
rootId:
|
|
16186
|
-
generatedAt:
|
|
16491
|
+
var workGraphContextPackSchema = z16.object({
|
|
16492
|
+
rootId: z16.string().min(1),
|
|
16493
|
+
generatedAt: z16.string().min(1),
|
|
16187
16494
|
budget: workGraphContextBudgetSchema,
|
|
16188
16495
|
slice: workGraphSliceSchema,
|
|
16189
|
-
relationEdges:
|
|
16190
|
-
rootId:
|
|
16496
|
+
relationEdges: z16.object({
|
|
16497
|
+
rootId: z16.string().min(1),
|
|
16191
16498
|
direction: workGraphEdgeDirectionSchema,
|
|
16192
|
-
edges:
|
|
16499
|
+
edges: z16.array(workGraphDirectEdgeSchema)
|
|
16193
16500
|
}).optional(),
|
|
16194
16501
|
readiness: workGraphReadinessResultSchema.optional(),
|
|
16195
|
-
rollup:
|
|
16196
|
-
omissions:
|
|
16502
|
+
rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
|
|
16503
|
+
omissions: z16.array(workGraphOmissionSchema)
|
|
16197
16504
|
});
|
|
16198
|
-
var workGraphScaffoldValidateParamsSchema =
|
|
16199
|
-
rootId:
|
|
16200
|
-
nodes:
|
|
16201
|
-
|
|
16202
|
-
id:
|
|
16505
|
+
var workGraphScaffoldValidateParamsSchema = z16.object({
|
|
16506
|
+
rootId: z16.string().min(1),
|
|
16507
|
+
nodes: z16.array(
|
|
16508
|
+
z16.object({
|
|
16509
|
+
id: z16.string().min(1),
|
|
16203
16510
|
type: taskTypeSchema,
|
|
16204
|
-
parentId:
|
|
16511
|
+
parentId: z16.string().min(1).nullable().optional()
|
|
16205
16512
|
})
|
|
16206
16513
|
),
|
|
16207
|
-
edges:
|
|
16208
|
-
dryRun:
|
|
16514
|
+
edges: z16.array(workGraphDirectEdgeSchema).optional(),
|
|
16515
|
+
dryRun: z16.boolean().optional()
|
|
16209
16516
|
});
|
|
16210
|
-
var workGraphScaffoldValidationIssueSchema =
|
|
16211
|
-
code:
|
|
16212
|
-
message:
|
|
16213
|
-
taskId:
|
|
16214
|
-
severity:
|
|
16517
|
+
var workGraphScaffoldValidationIssueSchema = z16.object({
|
|
16518
|
+
code: z16.string().min(1),
|
|
16519
|
+
message: z16.string().min(1),
|
|
16520
|
+
taskId: z16.string().min(1).optional(),
|
|
16521
|
+
severity: z16.enum(["error", "warning"])
|
|
16215
16522
|
});
|
|
16216
|
-
var workGraphScaffoldValidateResultSchema =
|
|
16217
|
-
rootId:
|
|
16218
|
-
valid:
|
|
16219
|
-
dryRun:
|
|
16220
|
-
issues:
|
|
16221
|
-
hierarchy:
|
|
16222
|
-
valid:
|
|
16223
|
-
violations:
|
|
16224
|
-
|
|
16225
|
-
code:
|
|
16226
|
-
taskId:
|
|
16523
|
+
var workGraphScaffoldValidateResultSchema = z16.object({
|
|
16524
|
+
rootId: z16.string().min(1),
|
|
16525
|
+
valid: z16.boolean(),
|
|
16526
|
+
dryRun: z16.boolean(),
|
|
16527
|
+
issues: z16.array(workGraphScaffoldValidationIssueSchema),
|
|
16528
|
+
hierarchy: z16.object({
|
|
16529
|
+
valid: z16.boolean(),
|
|
16530
|
+
violations: z16.array(
|
|
16531
|
+
z16.object({
|
|
16532
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16533
|
+
taskId: z16.string().min(1),
|
|
16227
16534
|
taskType: taskTypeSchema,
|
|
16228
|
-
parentId:
|
|
16535
|
+
parentId: z16.string().min(1).nullable(),
|
|
16229
16536
|
parentType: taskTypeSchema.optional(),
|
|
16230
|
-
message:
|
|
16537
|
+
message: z16.string().min(1)
|
|
16231
16538
|
})
|
|
16232
16539
|
)
|
|
16233
16540
|
})
|
|
16234
16541
|
});
|
|
16235
16542
|
var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
|
|
16236
|
-
apply:
|
|
16543
|
+
apply: z16.boolean().optional()
|
|
16237
16544
|
});
|
|
16238
16545
|
var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
|
|
16239
|
-
applied:
|
|
16240
|
-
nodesChanged:
|
|
16241
|
-
edgesChanged:
|
|
16546
|
+
applied: z16.boolean(),
|
|
16547
|
+
nodesChanged: z16.number().int().nonnegative(),
|
|
16548
|
+
edgesChanged: z16.number().int().nonnegative()
|
|
16242
16549
|
});
|
|
16243
|
-
var workGraphPlanningDocParamsSchema =
|
|
16244
|
-
rootId:
|
|
16245
|
-
audience:
|
|
16246
|
-
tokenBudget:
|
|
16247
|
-
includeRelations:
|
|
16248
|
-
includeReadiness:
|
|
16249
|
-
includeRollup:
|
|
16550
|
+
var workGraphPlanningDocParamsSchema = z16.object({
|
|
16551
|
+
rootId: z16.string().min(1),
|
|
16552
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16553
|
+
tokenBudget: z16.number().int().positive().optional(),
|
|
16554
|
+
includeRelations: z16.boolean().optional(),
|
|
16555
|
+
includeReadiness: z16.boolean().optional(),
|
|
16556
|
+
includeRollup: z16.boolean().optional()
|
|
16250
16557
|
});
|
|
16251
|
-
var workGraphPlanningDocSchema =
|
|
16252
|
-
rootId:
|
|
16253
|
-
generatedAt:
|
|
16254
|
-
audience:
|
|
16255
|
-
title:
|
|
16256
|
-
content:
|
|
16257
|
-
sections:
|
|
16258
|
-
estimatedTokens:
|
|
16259
|
-
budget:
|
|
16260
|
-
tokenBudget:
|
|
16261
|
-
truncated:
|
|
16558
|
+
var workGraphPlanningDocSchema = z16.object({
|
|
16559
|
+
rootId: z16.string().min(1),
|
|
16560
|
+
generatedAt: z16.string().min(1),
|
|
16561
|
+
audience: z16.enum(["agent", "maintainer"]),
|
|
16562
|
+
title: z16.string().min(1),
|
|
16563
|
+
content: z16.string(),
|
|
16564
|
+
sections: z16.array(z16.string().min(1)),
|
|
16565
|
+
estimatedTokens: z16.number().int().nonnegative(),
|
|
16566
|
+
budget: z16.object({
|
|
16567
|
+
tokenBudget: z16.number().int().positive(),
|
|
16568
|
+
truncated: z16.boolean()
|
|
16262
16569
|
}).optional()
|
|
16263
16570
|
});
|
|
16264
16571
|
var tasksTraverseParamsSchema = paginationParamsSchema.extend({
|
|
16265
|
-
rootId:
|
|
16572
|
+
rootId: z16.string().min(1),
|
|
16266
16573
|
direction: workGraphTraversalDirectionSchema,
|
|
16267
|
-
maxDepth:
|
|
16268
|
-
includeRelations:
|
|
16574
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16575
|
+
includeRelations: z16.boolean().optional()
|
|
16269
16576
|
});
|
|
16270
|
-
var tasksTraverseResultSchema =
|
|
16271
|
-
rootId:
|
|
16577
|
+
var tasksTraverseResultSchema = z16.object({
|
|
16578
|
+
rootId: z16.string().min(1),
|
|
16272
16579
|
direction: workGraphTraversalDirectionSchema,
|
|
16273
|
-
nodes:
|
|
16274
|
-
edges:
|
|
16580
|
+
nodes: z16.array(workGraphNodeSchema),
|
|
16581
|
+
edges: z16.array(workGraphEdgeSchema),
|
|
16275
16582
|
pageInfo: workGraphPageInfoSchema
|
|
16276
16583
|
});
|
|
16277
16584
|
var tasksTreeParamsSchema = paginationParamsSchema.extend({
|
|
16278
|
-
rootId:
|
|
16279
|
-
maxDepth:
|
|
16585
|
+
rootId: z16.string().min(1),
|
|
16586
|
+
maxDepth: z16.number().int().nonnegative().optional()
|
|
16280
16587
|
});
|
|
16281
|
-
var tasksTreeResultSchema =
|
|
16282
|
-
rootId:
|
|
16283
|
-
nodes:
|
|
16284
|
-
edges:
|
|
16588
|
+
var tasksTreeResultSchema = z16.object({
|
|
16589
|
+
rootId: z16.string().min(1),
|
|
16590
|
+
nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
|
|
16591
|
+
edges: z16.array(workGraphHierarchyEdgeSchema),
|
|
16285
16592
|
pageInfo: workGraphPageInfoSchema
|
|
16286
16593
|
});
|
|
16287
|
-
var tasksRollupParamsSchema =
|
|
16288
|
-
rootId:
|
|
16594
|
+
var tasksRollupParamsSchema = z16.object({
|
|
16595
|
+
rootId: z16.string().min(1),
|
|
16289
16596
|
expectedDirectRollup: workGraphRollupCountsSchema.optional()
|
|
16290
16597
|
});
|
|
16291
|
-
var tasksRollupResultSchema =
|
|
16292
|
-
rootId:
|
|
16598
|
+
var tasksRollupResultSchema = z16.object({
|
|
16599
|
+
rootId: z16.string().min(1),
|
|
16293
16600
|
direct: workGraphRollupCountsSchema,
|
|
16294
16601
|
subtree: workGraphRollupCountsSchema,
|
|
16295
|
-
percentDenominator:
|
|
16296
|
-
basis:
|
|
16297
|
-
total:
|
|
16298
|
-
description:
|
|
16602
|
+
percentDenominator: z16.object({
|
|
16603
|
+
basis: z16.literal("subtree-total"),
|
|
16604
|
+
total: z16.number().int().nonnegative(),
|
|
16605
|
+
description: z16.string().min(1)
|
|
16299
16606
|
}),
|
|
16300
16607
|
percentages: workGraphSubtreePercentagesSchema,
|
|
16301
|
-
staleProjection:
|
|
16302
|
-
projectionMismatches:
|
|
16608
|
+
staleProjection: z16.boolean(),
|
|
16609
|
+
projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
|
|
16303
16610
|
});
|
|
16304
|
-
var tasksFrontierParamsSchema =
|
|
16305
|
-
rootId:
|
|
16306
|
-
role:
|
|
16611
|
+
var tasksFrontierParamsSchema = z16.object({
|
|
16612
|
+
rootId: z16.string().min(1),
|
|
16613
|
+
role: z16.string().min(1).optional()
|
|
16307
16614
|
});
|
|
16308
|
-
var tasksFrontierResultSchema =
|
|
16309
|
-
rootId:
|
|
16310
|
-
role:
|
|
16311
|
-
groups:
|
|
16312
|
-
ready:
|
|
16313
|
-
blocked:
|
|
16314
|
-
blockedBy:
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
kind:
|
|
16318
|
-
blockerId:
|
|
16319
|
-
blocks:
|
|
16615
|
+
var tasksFrontierResultSchema = z16.object({
|
|
16616
|
+
rootId: z16.string().min(1),
|
|
16617
|
+
role: z16.string().min(1).optional(),
|
|
16618
|
+
groups: z16.object({
|
|
16619
|
+
ready: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16620
|
+
blocked: z16.array(workGraphReadyFrontierTaskSchema),
|
|
16621
|
+
blockedBy: z16.array(
|
|
16622
|
+
z16.discriminatedUnion("kind", [
|
|
16623
|
+
z16.object({
|
|
16624
|
+
kind: z16.literal("dependency"),
|
|
16625
|
+
blockerId: z16.string().min(1),
|
|
16626
|
+
blocks: z16.array(z16.string().min(1))
|
|
16320
16627
|
}),
|
|
16321
|
-
|
|
16322
|
-
kind:
|
|
16628
|
+
z16.object({
|
|
16629
|
+
kind: z16.literal("gate"),
|
|
16323
16630
|
gate: verificationGateSchema,
|
|
16324
|
-
blocks:
|
|
16631
|
+
blocks: z16.array(z16.string().min(1))
|
|
16325
16632
|
})
|
|
16326
16633
|
])
|
|
16327
16634
|
)
|
|
16328
16635
|
})
|
|
16329
16636
|
});
|
|
16330
16637
|
var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
|
|
16331
|
-
rootId:
|
|
16332
|
-
maxDepth:
|
|
16333
|
-
includeRelations:
|
|
16638
|
+
rootId: z16.string().min(1),
|
|
16639
|
+
maxDepth: z16.number().int().nonnegative().optional(),
|
|
16640
|
+
includeRelations: z16.boolean().optional()
|
|
16334
16641
|
});
|
|
16335
|
-
var tasksWorkGraphAuditResultSchema =
|
|
16336
|
-
rootId:
|
|
16337
|
-
hierarchy:
|
|
16338
|
-
valid:
|
|
16339
|
-
violations:
|
|
16340
|
-
|
|
16341
|
-
code:
|
|
16342
|
-
taskId:
|
|
16642
|
+
var tasksWorkGraphAuditResultSchema = z16.object({
|
|
16643
|
+
rootId: z16.string().min(1),
|
|
16644
|
+
hierarchy: z16.object({
|
|
16645
|
+
valid: z16.boolean(),
|
|
16646
|
+
violations: z16.array(
|
|
16647
|
+
z16.object({
|
|
16648
|
+
code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
|
|
16649
|
+
taskId: z16.string().min(1),
|
|
16343
16650
|
taskType: taskTypeSchema,
|
|
16344
|
-
parentId:
|
|
16651
|
+
parentId: z16.string().min(1).nullable(),
|
|
16345
16652
|
parentType: taskTypeSchema.optional(),
|
|
16346
|
-
message:
|
|
16653
|
+
message: z16.string().min(1)
|
|
16347
16654
|
})
|
|
16348
16655
|
)
|
|
16349
16656
|
}),
|
|
16350
16657
|
traversal: tasksTraverseResultSchema,
|
|
16351
16658
|
frontier: tasksFrontierResultSchema,
|
|
16352
16659
|
rollup: tasksRollupResultSchema,
|
|
16353
|
-
relationEdges:
|
|
16354
|
-
rootId:
|
|
16660
|
+
relationEdges: z16.object({
|
|
16661
|
+
rootId: z16.string().min(1),
|
|
16355
16662
|
direction: workGraphEdgeDirectionSchema,
|
|
16356
|
-
edges:
|
|
16357
|
-
|
|
16663
|
+
edges: z16.array(
|
|
16664
|
+
z16.discriminatedUnion("source", [
|
|
16358
16665
|
workGraphRelationEdgeSchema,
|
|
16359
16666
|
workGraphDependencyEdgeSchema
|
|
16360
16667
|
])
|
|
@@ -16363,60 +16670,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
|
|
|
16363
16670
|
});
|
|
16364
16671
|
|
|
16365
16672
|
// packages/contracts/src/operations/docs.ts
|
|
16366
|
-
import { z as
|
|
16367
|
-
var DOCS_PROJECTION_PROPOSAL_SCHEMA =
|
|
16368
|
-
version:
|
|
16369
|
-
operation:
|
|
16370
|
-
identity:
|
|
16371
|
-
projectId:
|
|
16372
|
-
projectRoot:
|
|
16373
|
-
actor:
|
|
16374
|
-
operation:
|
|
16375
|
-
idempotencyKey:
|
|
16673
|
+
import { z as z17 } from "zod";
|
|
16674
|
+
var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
|
|
16675
|
+
version: z17.literal(1),
|
|
16676
|
+
operation: z17.literal("docs.projection"),
|
|
16677
|
+
identity: z17.object({
|
|
16678
|
+
projectId: z17.string().min(1),
|
|
16679
|
+
projectRoot: z17.string().min(1),
|
|
16680
|
+
actor: z17.string().min(1),
|
|
16681
|
+
operation: z17.literal("docs.projection"),
|
|
16682
|
+
idempotencyKey: z17.string().min(1)
|
|
16376
16683
|
}).strict(),
|
|
16377
|
-
source:
|
|
16378
|
-
attachmentId:
|
|
16379
|
-
sha256:
|
|
16380
|
-
ownerId:
|
|
16381
|
-
ownerType:
|
|
16382
|
-
label:
|
|
16684
|
+
source: z17.object({
|
|
16685
|
+
attachmentId: z17.string().min(1),
|
|
16686
|
+
sha256: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16687
|
+
ownerId: z17.string().min(1),
|
|
16688
|
+
ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
|
|
16689
|
+
label: z17.string().min(1)
|
|
16383
16690
|
}).strict(),
|
|
16384
|
-
observation:
|
|
16385
|
-
kind:
|
|
16386
|
-
attachmentId:
|
|
16387
|
-
ownerId:
|
|
16388
|
-
addedAt:
|
|
16389
|
-
slug:
|
|
16390
|
-
type:
|
|
16691
|
+
observation: z17.object({
|
|
16692
|
+
kind: z17.literal("doc-attachment"),
|
|
16693
|
+
attachmentId: z17.string().min(1),
|
|
16694
|
+
ownerId: z17.string().min(1),
|
|
16695
|
+
addedAt: z17.string().min(1),
|
|
16696
|
+
slug: z17.string().optional(),
|
|
16697
|
+
type: z17.string().optional()
|
|
16391
16698
|
}).strict()
|
|
16392
16699
|
}).strict();
|
|
16393
|
-
var DOCS_PROJECTION_RECEIPT_SCHEMA =
|
|
16394
|
-
version:
|
|
16395
|
-
sourceHash:
|
|
16396
|
-
graph:
|
|
16700
|
+
var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
|
|
16701
|
+
version: z17.literal(1),
|
|
16702
|
+
sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
|
|
16703
|
+
graph: z17.enum(["completed", "disabled"]),
|
|
16397
16704
|
/** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
|
|
16398
|
-
observationId:
|
|
16705
|
+
observationId: z17.string().min(1).optional(),
|
|
16399
16706
|
/** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
|
|
16400
|
-
documents:
|
|
16401
|
-
verifiedAt:
|
|
16402
|
-
actor:
|
|
16707
|
+
documents: z17.literal(true).optional(),
|
|
16708
|
+
verifiedAt: z17.string().min(1),
|
|
16709
|
+
actor: z17.string().min(1)
|
|
16403
16710
|
}).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
|
|
16404
16711
|
message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
|
|
16405
16712
|
});
|
|
16406
16713
|
|
|
16407
16714
|
// packages/contracts/src/operations/ensures-schema-registry.ts
|
|
16408
|
-
import { z as
|
|
16409
|
-
var taskTreeEntrySchema =
|
|
16410
|
-
title:
|
|
16411
|
-
acceptance:
|
|
16715
|
+
import { z as z18 } from "zod";
|
|
16716
|
+
var taskTreeEntrySchema = z18.object({
|
|
16717
|
+
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" }),
|
|
16718
|
+
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), {
|
|
16412
16719
|
message: "acceptance array contains no non-empty strings"
|
|
16413
16720
|
}),
|
|
16414
|
-
id:
|
|
16415
|
-
parentId:
|
|
16416
|
-
depends:
|
|
16721
|
+
id: z18.string().optional(),
|
|
16722
|
+
parentId: z18.string().optional(),
|
|
16723
|
+
depends: z18.array(z18.string()).optional()
|
|
16417
16724
|
});
|
|
16418
|
-
var taskTreeSchema =
|
|
16419
|
-
var evidenceSchema =
|
|
16725
|
+
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" });
|
|
16726
|
+
var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
|
|
16420
16727
|
if (value === null || value === void 0) {
|
|
16421
16728
|
ctx.addIssue({
|
|
16422
16729
|
code: "custom",
|
|
@@ -16450,7 +16757,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
|
|
|
16450
16757
|
message: `evidence must be a string, array, or object (got ${typeof value})`
|
|
16451
16758
|
});
|
|
16452
16759
|
});
|
|
16453
|
-
var passthroughSchema =
|
|
16760
|
+
var passthroughSchema = z18.unknown();
|
|
16454
16761
|
var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
|
|
16455
16762
|
// release.cantbook
|
|
16456
16763
|
"version_bump_report",
|
|
@@ -16483,44 +16790,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
|
|
|
16483
16790
|
var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
|
|
16484
16791
|
|
|
16485
16792
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
16486
|
-
import { z as
|
|
16487
|
-
var parsedPrEvidenceAtomSchema =
|
|
16488
|
-
kind:
|
|
16489
|
-
prNumber:
|
|
16793
|
+
import { z as z19 } from "zod";
|
|
16794
|
+
var parsedPrEvidenceAtomSchema = z19.object({
|
|
16795
|
+
kind: z19.literal("pr"),
|
|
16796
|
+
prNumber: z19.number().int().positive()
|
|
16490
16797
|
});
|
|
16491
|
-
var prEvidenceStateModifierSchema =
|
|
16492
|
-
kind:
|
|
16493
|
-
value:
|
|
16798
|
+
var prEvidenceStateModifierSchema = z19.object({
|
|
16799
|
+
kind: z19.literal("state"),
|
|
16800
|
+
value: z19.literal("MERGED")
|
|
16494
16801
|
});
|
|
16495
|
-
var ghPrViewSchema =
|
|
16496
|
-
state:
|
|
16497
|
-
mergedAt:
|
|
16498
|
-
headRefOid:
|
|
16499
|
-
mergeCommit:
|
|
16500
|
-
title:
|
|
16501
|
-
body:
|
|
16502
|
-
headRefName:
|
|
16503
|
-
files:
|
|
16504
|
-
changedFiles:
|
|
16505
|
-
mergeable:
|
|
16506
|
-
statusCheckRollup:
|
|
16507
|
-
|
|
16508
|
-
__typename:
|
|
16509
|
-
name:
|
|
16510
|
-
workflowName:
|
|
16511
|
-
conclusion:
|
|
16512
|
-
status:
|
|
16802
|
+
var ghPrViewSchema = z19.object({
|
|
16803
|
+
state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
16804
|
+
mergedAt: z19.string().nullable(),
|
|
16805
|
+
headRefOid: z19.string().optional(),
|
|
16806
|
+
mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
|
|
16807
|
+
title: z19.string().optional(),
|
|
16808
|
+
body: z19.string().optional(),
|
|
16809
|
+
headRefName: z19.string().optional(),
|
|
16810
|
+
files: z19.array(z19.object({ path: z19.string() })).optional(),
|
|
16811
|
+
changedFiles: z19.number().int().nonnegative().optional(),
|
|
16812
|
+
mergeable: z19.string().optional(),
|
|
16813
|
+
statusCheckRollup: z19.array(
|
|
16814
|
+
z19.object({
|
|
16815
|
+
__typename: z19.string().optional(),
|
|
16816
|
+
name: z19.string().optional(),
|
|
16817
|
+
workflowName: z19.string().optional(),
|
|
16818
|
+
conclusion: z19.string().nullable().optional(),
|
|
16819
|
+
status: z19.string().optional(),
|
|
16513
16820
|
/** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16514
|
-
startedAt:
|
|
16821
|
+
startedAt: z19.string().nullable().optional(),
|
|
16515
16822
|
/** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
|
|
16516
|
-
completedAt:
|
|
16823
|
+
completedAt: z19.string().nullable().optional()
|
|
16517
16824
|
}).passthrough()
|
|
16518
16825
|
).optional().default([])
|
|
16519
16826
|
}).passthrough();
|
|
16520
16827
|
var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
|
|
16521
16828
|
|
|
16522
16829
|
// packages/contracts/src/release/plan.ts
|
|
16523
|
-
import { z as
|
|
16830
|
+
import { z as z20 } from "zod";
|
|
16524
16831
|
var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
|
|
16525
16832
|
var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
16526
16833
|
var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
@@ -16564,20 +16871,20 @@ var RESOLVED_SOURCE = [
|
|
|
16564
16871
|
"language-default",
|
|
16565
16872
|
"legacy-alias"
|
|
16566
16873
|
];
|
|
16567
|
-
var ReleaseChannelSchema =
|
|
16568
|
-
var ReleaseSchemeSchema =
|
|
16569
|
-
var ReleaseKindSchema =
|
|
16570
|
-
var ReleaseStatusSchema =
|
|
16571
|
-
var GateStatusSchema =
|
|
16572
|
-
var GateNameSchema =
|
|
16573
|
-
var PlatformTupleSchema =
|
|
16574
|
-
var PublisherSchema =
|
|
16575
|
-
var TaskKindSchema =
|
|
16576
|
-
var ImpactSchema =
|
|
16577
|
-
var ResolvedSourceSchema =
|
|
16578
|
-
var Iso8601 =
|
|
16579
|
-
var NonEmptyString =
|
|
16580
|
-
var ReleasePlanTaskSchema =
|
|
16874
|
+
var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
|
|
16875
|
+
var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
|
|
16876
|
+
var ReleaseKindSchema = z20.enum(RELEASE_KIND);
|
|
16877
|
+
var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
|
|
16878
|
+
var GateStatusSchema = z20.enum(GATE_STATUS);
|
|
16879
|
+
var GateNameSchema = z20.enum(GATE_NAME);
|
|
16880
|
+
var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
|
|
16881
|
+
var PublisherSchema = z20.enum(PUBLISHER);
|
|
16882
|
+
var TaskKindSchema = z20.enum(TASK_KIND);
|
|
16883
|
+
var ImpactSchema = z20.enum(IMPACT);
|
|
16884
|
+
var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
|
|
16885
|
+
var Iso8601 = z20.iso.datetime({ offset: true });
|
|
16886
|
+
var NonEmptyString = z20.string().min(1);
|
|
16887
|
+
var ReleasePlanTaskSchema = z20.object({
|
|
16581
16888
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
16582
16889
|
id: NonEmptyString,
|
|
16583
16890
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -16585,20 +16892,20 @@ var ReleasePlanTaskSchema = z19.object({
|
|
|
16585
16892
|
/** SemVer impact classification. */
|
|
16586
16893
|
impact: ImpactSchema,
|
|
16587
16894
|
/** Human-readable changelog line for this task. */
|
|
16588
|
-
userFacingSummary:
|
|
16895
|
+
userFacingSummary: z20.string(),
|
|
16589
16896
|
/**
|
|
16590
16897
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
16591
16898
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
16592
16899
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
16593
16900
|
* enforces non-empty via R-301.
|
|
16594
16901
|
*/
|
|
16595
|
-
evidenceAtoms:
|
|
16902
|
+
evidenceAtoms: z20.array(NonEmptyString),
|
|
16596
16903
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
16597
|
-
ivtrPhaseAtPlan:
|
|
16904
|
+
ivtrPhaseAtPlan: z20.string().optional(),
|
|
16598
16905
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
16599
16906
|
epicAncestor: NonEmptyString
|
|
16600
16907
|
});
|
|
16601
|
-
var ReleaseGateSchema =
|
|
16908
|
+
var ReleaseGateSchema = z20.object({
|
|
16602
16909
|
/** Canonical gate name. */
|
|
16603
16910
|
name: GateNameSchema,
|
|
16604
16911
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -16608,11 +16915,11 @@ var ReleaseGateSchema = z19.object({
|
|
|
16608
16915
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
16609
16916
|
lastVerifiedAt: Iso8601,
|
|
16610
16917
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
16611
|
-
resolvedCommand:
|
|
16918
|
+
resolvedCommand: z20.string().optional(),
|
|
16612
16919
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
16613
16920
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
16614
16921
|
});
|
|
16615
|
-
var ReleasePlatformMatrixEntrySchema =
|
|
16922
|
+
var ReleasePlatformMatrixEntrySchema = z20.object({
|
|
16616
16923
|
/** Target platform tuple. */
|
|
16617
16924
|
platform: PlatformTupleSchema,
|
|
16618
16925
|
/** Distribution backend. */
|
|
@@ -16620,47 +16927,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
|
|
|
16620
16927
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
16621
16928
|
package: NonEmptyString,
|
|
16622
16929
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
16623
|
-
smoke:
|
|
16930
|
+
smoke: z20.boolean().default(true).optional()
|
|
16624
16931
|
});
|
|
16625
|
-
var ReleasePreflightSummarySchema =
|
|
16932
|
+
var ReleasePreflightSummarySchema = z20.object({
|
|
16626
16933
|
/** True if esbuild externals are out of sync with package.json. */
|
|
16627
|
-
esbuildExternalsDrift:
|
|
16934
|
+
esbuildExternalsDrift: z20.boolean(),
|
|
16628
16935
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
16629
|
-
lockfileDrift:
|
|
16936
|
+
lockfileDrift: z20.boolean(),
|
|
16630
16937
|
/** True if all epic children are in terminal lifecycle states. */
|
|
16631
|
-
epicCompletenessClean:
|
|
16938
|
+
epicCompletenessClean: z20.boolean(),
|
|
16632
16939
|
/** True if no task appears in multiple in-flight release plans. */
|
|
16633
|
-
doubleListingClean:
|
|
16940
|
+
doubleListingClean: z20.boolean(),
|
|
16634
16941
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
16635
|
-
preflightWarnings:
|
|
16942
|
+
preflightWarnings: z20.array(z20.string()).default([]).optional()
|
|
16636
16943
|
});
|
|
16637
|
-
var ReleasePlanChangelogSchema =
|
|
16944
|
+
var ReleasePlanChangelogSchema = z20.object({
|
|
16638
16945
|
/** `kind=feat` tasks. */
|
|
16639
|
-
features:
|
|
16946
|
+
features: z20.array(NonEmptyString).default([]),
|
|
16640
16947
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
16641
|
-
fixes:
|
|
16948
|
+
fixes: z20.array(NonEmptyString).default([]),
|
|
16642
16949
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
16643
|
-
chores:
|
|
16950
|
+
chores: z20.array(NonEmptyString).default([]),
|
|
16644
16951
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
16645
|
-
breaking:
|
|
16952
|
+
breaking: z20.array(NonEmptyString).default([])
|
|
16646
16953
|
});
|
|
16647
|
-
var ReleasePlanMetaSchema =
|
|
16954
|
+
var ReleasePlanMetaSchema = z20.object({
|
|
16648
16955
|
/** True if this is the project's first ever release. */
|
|
16649
|
-
firstEverRelease:
|
|
16956
|
+
firstEverRelease: z20.boolean().optional(),
|
|
16650
16957
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
16651
|
-
unresolvedTools:
|
|
16958
|
+
unresolvedTools: z20.array(z20.string()).optional(),
|
|
16652
16959
|
/** Project archetype detected at plan time. */
|
|
16653
|
-
archetype:
|
|
16654
|
-
}).catchall(
|
|
16655
|
-
var ReleasePlanSchema =
|
|
16960
|
+
archetype: z20.string().optional()
|
|
16961
|
+
}).catchall(z20.unknown());
|
|
16962
|
+
var ReleasePlanSchema = z20.object({
|
|
16656
16963
|
/** Schema URL for this plan version. */
|
|
16657
|
-
$schema:
|
|
16964
|
+
$schema: z20.string().optional(),
|
|
16658
16965
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
16659
16966
|
version: NonEmptyString,
|
|
16660
16967
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
16661
16968
|
resolvedVersion: NonEmptyString,
|
|
16662
16969
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
16663
|
-
suffixApplied:
|
|
16970
|
+
suffixApplied: z20.boolean(),
|
|
16664
16971
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
16665
16972
|
scheme: ReleaseSchemeSchema,
|
|
16666
16973
|
/** npm dist-tag channel for this release. */
|
|
@@ -16674,7 +16981,7 @@ var ReleasePlanSchema = z19.object({
|
|
|
16674
16981
|
/** Release-kind classification. */
|
|
16675
16982
|
releaseKind: ReleaseKindSchema,
|
|
16676
16983
|
/** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
|
|
16677
|
-
hooksV1Promotion:
|
|
16984
|
+
hooksV1Promotion: z20.boolean().optional(),
|
|
16678
16985
|
/** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
|
|
16679
16986
|
hooksV1Waiver: NonEmptyString.optional(),
|
|
16680
16987
|
/** ISO-8601 timestamp the plan was written. */
|
|
@@ -16685,27 +16992,27 @@ var ReleasePlanSchema = z19.object({
|
|
|
16685
16992
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
16686
16993
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
16687
16994
|
*/
|
|
16688
|
-
previousVersion:
|
|
16995
|
+
previousVersion: z20.string().nullable(),
|
|
16689
16996
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
16690
|
-
previousTag:
|
|
16997
|
+
previousTag: z20.string().nullable(),
|
|
16691
16998
|
/** ISO-8601 timestamp the previous release was published. */
|
|
16692
16999
|
previousShippedAt: Iso8601.nullable(),
|
|
16693
17000
|
/** Tasks rolled into this release. */
|
|
16694
|
-
tasks:
|
|
17001
|
+
tasks: z20.array(ReleasePlanTaskSchema),
|
|
16695
17002
|
/** Bucketed changelog. */
|
|
16696
17003
|
changelog: ReleasePlanChangelogSchema,
|
|
16697
17004
|
/** Per-gate verification status. */
|
|
16698
|
-
gates:
|
|
17005
|
+
gates: z20.array(ReleaseGateSchema),
|
|
16699
17006
|
/** Platform / publisher matrix. */
|
|
16700
|
-
platformMatrix:
|
|
17007
|
+
platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
|
|
16701
17008
|
/** Preflight summary from `cleo release plan`. */
|
|
16702
17009
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
16703
17010
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
16704
|
-
workflowRunUrl:
|
|
17011
|
+
workflowRunUrl: z20.string().nullable(),
|
|
16705
17012
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
16706
|
-
prUrl:
|
|
17013
|
+
prUrl: z20.string().nullable(),
|
|
16707
17014
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
16708
|
-
mergeCommitSha:
|
|
17015
|
+
mergeCommitSha: z20.string().nullable(),
|
|
16709
17016
|
/** Current FSM state per R-302. */
|
|
16710
17017
|
status: ReleaseStatusSchema,
|
|
16711
17018
|
/** Informational / forward-compat metadata. */
|
|
@@ -16735,48 +17042,48 @@ var RESOURCE_CLASSES = Object.freeze([
|
|
|
16735
17042
|
]);
|
|
16736
17043
|
|
|
16737
17044
|
// packages/contracts/src/session-journal.ts
|
|
16738
|
-
import { z as
|
|
17045
|
+
import { z as z21 } from "zod";
|
|
16739
17046
|
var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
16740
|
-
var sessionJournalDoctorSummarySchema =
|
|
17047
|
+
var sessionJournalDoctorSummarySchema = z21.object({
|
|
16741
17048
|
/** `true` when zero noise patterns were detected. */
|
|
16742
|
-
isClean:
|
|
17049
|
+
isClean: z21.boolean(),
|
|
16743
17050
|
/** Total number of noise findings across all patterns. */
|
|
16744
|
-
findingsCount:
|
|
17051
|
+
findingsCount: z21.number().int().nonnegative(),
|
|
16745
17052
|
/** Pattern names that were detected (empty when isClean). */
|
|
16746
|
-
patterns:
|
|
17053
|
+
patterns: z21.array(z21.string()),
|
|
16747
17054
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
16748
|
-
totalScanned:
|
|
17055
|
+
totalScanned: z21.number().int().nonnegative()
|
|
16749
17056
|
});
|
|
16750
|
-
var sessionJournalDebriefSummarySchema =
|
|
17057
|
+
var sessionJournalDebriefSummarySchema = z21.object({
|
|
16751
17058
|
/** First 200 characters of the session end note (if provided). */
|
|
16752
|
-
noteExcerpt:
|
|
17059
|
+
noteExcerpt: z21.string().max(200).optional(),
|
|
16753
17060
|
/** Number of tasks completed during the session. */
|
|
16754
|
-
tasksCompletedCount:
|
|
17061
|
+
tasksCompletedCount: z21.number().int().nonnegative(),
|
|
16755
17062
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
16756
|
-
tasksFocused:
|
|
17063
|
+
tasksFocused: z21.array(z21.string()).max(5).optional()
|
|
16757
17064
|
});
|
|
16758
|
-
var sessionJournalEntrySchema =
|
|
17065
|
+
var sessionJournalEntrySchema = z21.object({
|
|
16759
17066
|
// Identity
|
|
16760
17067
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
16761
|
-
schemaVersion:
|
|
17068
|
+
schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
16762
17069
|
/** ISO 8601 timestamp when the entry was written. */
|
|
16763
|
-
timestamp:
|
|
17070
|
+
timestamp: z21.string(),
|
|
16764
17071
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
16765
|
-
sessionId:
|
|
17072
|
+
sessionId: z21.string(),
|
|
16766
17073
|
/** Event type that triggered this journal entry. */
|
|
16767
|
-
eventType:
|
|
17074
|
+
eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
16768
17075
|
// Session metadata (set on session_start / session_end)
|
|
16769
17076
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
16770
|
-
agentIdentifier:
|
|
17077
|
+
agentIdentifier: z21.string().optional(),
|
|
16771
17078
|
/** Provider adapter ID active for this session. */
|
|
16772
|
-
providerId:
|
|
17079
|
+
providerId: z21.string().optional(),
|
|
16773
17080
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
16774
|
-
scope:
|
|
17081
|
+
scope: z21.string().optional(),
|
|
16775
17082
|
// Session-end fields
|
|
16776
17083
|
/** Duration of the session in seconds (session_end only). */
|
|
16777
|
-
duration:
|
|
17084
|
+
duration: z21.number().int().nonnegative().optional(),
|
|
16778
17085
|
/** Task IDs (not titles) completed during the session. */
|
|
16779
|
-
tasksCompleted:
|
|
17086
|
+
tasksCompleted: z21.array(z21.string()).optional(),
|
|
16780
17087
|
// Doctor summary (T1262 absorbed)
|
|
16781
17088
|
/**
|
|
16782
17089
|
* Compact result of `scanBrainNoise` run at session-end.
|
|
@@ -16791,52 +17098,52 @@ var sessionJournalEntrySchema = z20.object({
|
|
|
16791
17098
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
16792
17099
|
// Optional hash chain
|
|
16793
17100
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
16794
|
-
prevEntryHash:
|
|
17101
|
+
prevEntryHash: z21.string().optional()
|
|
16795
17102
|
});
|
|
16796
17103
|
|
|
16797
17104
|
// packages/contracts/src/task-evidence.ts
|
|
16798
|
-
import { z as
|
|
16799
|
-
var fileEvidenceSchema =
|
|
16800
|
-
kind:
|
|
16801
|
-
sha256:
|
|
16802
|
-
timestamp:
|
|
16803
|
-
path:
|
|
16804
|
-
mime:
|
|
16805
|
-
description:
|
|
17105
|
+
import { z as z22 } from "zod";
|
|
17106
|
+
var fileEvidenceSchema = z22.object({
|
|
17107
|
+
kind: z22.literal("file"),
|
|
17108
|
+
sha256: z22.string().length(64),
|
|
17109
|
+
timestamp: z22.string().datetime(),
|
|
17110
|
+
path: z22.string().min(1),
|
|
17111
|
+
mime: z22.string().optional(),
|
|
17112
|
+
description: z22.string().optional()
|
|
16806
17113
|
});
|
|
16807
|
-
var logEvidenceSchema =
|
|
16808
|
-
kind:
|
|
16809
|
-
sha256:
|
|
16810
|
-
timestamp:
|
|
16811
|
-
source:
|
|
16812
|
-
description:
|
|
17114
|
+
var logEvidenceSchema = z22.object({
|
|
17115
|
+
kind: z22.literal("log"),
|
|
17116
|
+
sha256: z22.string().length(64),
|
|
17117
|
+
timestamp: z22.string().datetime(),
|
|
17118
|
+
source: z22.string().min(1),
|
|
17119
|
+
description: z22.string().optional()
|
|
16813
17120
|
});
|
|
16814
|
-
var screenshotEvidenceSchema =
|
|
16815
|
-
kind:
|
|
16816
|
-
sha256:
|
|
16817
|
-
timestamp:
|
|
16818
|
-
mime:
|
|
16819
|
-
description:
|
|
17121
|
+
var screenshotEvidenceSchema = z22.object({
|
|
17122
|
+
kind: z22.literal("screenshot"),
|
|
17123
|
+
sha256: z22.string().length(64),
|
|
17124
|
+
timestamp: z22.string().datetime(),
|
|
17125
|
+
mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
17126
|
+
description: z22.string().optional()
|
|
16820
17127
|
});
|
|
16821
|
-
var testOutputEvidenceSchema =
|
|
16822
|
-
kind:
|
|
16823
|
-
sha256:
|
|
16824
|
-
timestamp:
|
|
16825
|
-
passed:
|
|
16826
|
-
failed:
|
|
16827
|
-
skipped:
|
|
16828
|
-
exitCode:
|
|
16829
|
-
description:
|
|
17128
|
+
var testOutputEvidenceSchema = z22.object({
|
|
17129
|
+
kind: z22.literal("test-output"),
|
|
17130
|
+
sha256: z22.string().length(64),
|
|
17131
|
+
timestamp: z22.string().datetime(),
|
|
17132
|
+
passed: z22.number().int().nonnegative(),
|
|
17133
|
+
failed: z22.number().int().nonnegative(),
|
|
17134
|
+
skipped: z22.number().int().nonnegative(),
|
|
17135
|
+
exitCode: z22.number().int(),
|
|
17136
|
+
description: z22.string().optional()
|
|
16830
17137
|
});
|
|
16831
|
-
var commandOutputEvidenceSchema =
|
|
16832
|
-
kind:
|
|
16833
|
-
sha256:
|
|
16834
|
-
timestamp:
|
|
16835
|
-
cmd:
|
|
16836
|
-
exitCode:
|
|
16837
|
-
description:
|
|
17138
|
+
var commandOutputEvidenceSchema = z22.object({
|
|
17139
|
+
kind: z22.literal("command-output"),
|
|
17140
|
+
sha256: z22.string().length(64),
|
|
17141
|
+
timestamp: z22.string().datetime(),
|
|
17142
|
+
cmd: z22.string().min(1),
|
|
17143
|
+
exitCode: z22.number().int(),
|
|
17144
|
+
description: z22.string().optional()
|
|
16838
17145
|
});
|
|
16839
|
-
var taskEvidenceSchema =
|
|
17146
|
+
var taskEvidenceSchema = z22.discriminatedUnion("kind", [
|
|
16840
17147
|
fileEvidenceSchema,
|
|
16841
17148
|
logEvidenceSchema,
|
|
16842
17149
|
screenshotEvidenceSchema,
|
|
@@ -16845,8 +17152,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
|
|
|
16845
17152
|
]);
|
|
16846
17153
|
|
|
16847
17154
|
// packages/contracts/src/tasks/archive.ts
|
|
16848
|
-
import { z as
|
|
16849
|
-
var ArchiveReason =
|
|
17155
|
+
import { z as z23 } from "zod";
|
|
17156
|
+
var ArchiveReason = z23.enum([
|
|
16850
17157
|
"verified",
|
|
16851
17158
|
"reconciled",
|
|
16852
17159
|
"superseded",
|
|
@@ -16857,42 +17164,42 @@ var ArchiveReason = z22.enum([
|
|
|
16857
17164
|
var ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
16858
17165
|
|
|
16859
17166
|
// packages/contracts/src/tasks/index.ts
|
|
16860
|
-
import { z as
|
|
16861
|
-
var taskMutationWarningSeveritySchema =
|
|
16862
|
-
var taskMutationWarningSchema =
|
|
16863
|
-
code:
|
|
16864
|
-
message:
|
|
17167
|
+
import { z as z24 } from "zod";
|
|
17168
|
+
var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
|
|
17169
|
+
var taskMutationWarningSchema = z24.object({
|
|
17170
|
+
code: z24.string().min(1),
|
|
17171
|
+
message: z24.string().min(1),
|
|
16865
17172
|
severity: taskMutationWarningSeveritySchema.optional(),
|
|
16866
|
-
taskId:
|
|
16867
|
-
field:
|
|
16868
|
-
index:
|
|
17173
|
+
taskId: z24.string().min(1).optional(),
|
|
17174
|
+
field: z24.string().min(1).optional(),
|
|
17175
|
+
index: z24.number().int().nonnegative().optional()
|
|
16869
17176
|
});
|
|
16870
|
-
var taskMutationDryRunSummarySchema =
|
|
16871
|
-
dryRun:
|
|
16872
|
-
wouldCreate:
|
|
16873
|
-
wouldUpdate:
|
|
16874
|
-
wouldDelete:
|
|
16875
|
-
wouldAffect:
|
|
16876
|
-
validatedCount:
|
|
16877
|
-
insertedCount:
|
|
16878
|
-
updatedCount:
|
|
16879
|
-
deletedCount:
|
|
16880
|
-
warnings:
|
|
17177
|
+
var taskMutationDryRunSummarySchema = z24.object({
|
|
17178
|
+
dryRun: z24.literal(true),
|
|
17179
|
+
wouldCreate: z24.number().int().nonnegative(),
|
|
17180
|
+
wouldUpdate: z24.number().int().nonnegative(),
|
|
17181
|
+
wouldDelete: z24.number().int().nonnegative(),
|
|
17182
|
+
wouldAffect: z24.number().int().nonnegative(),
|
|
17183
|
+
validatedCount: z24.number().int().nonnegative(),
|
|
17184
|
+
insertedCount: z24.literal(0),
|
|
17185
|
+
updatedCount: z24.literal(0),
|
|
17186
|
+
deletedCount: z24.literal(0),
|
|
17187
|
+
warnings: z24.array(taskMutationWarningSchema)
|
|
16881
17188
|
});
|
|
16882
|
-
var taskMutationTaskRecordSchema =
|
|
16883
|
-
var taskMutationEnvelopeSchema =
|
|
16884
|
-
dryRun:
|
|
16885
|
-
created:
|
|
16886
|
-
updated:
|
|
16887
|
-
deleted:
|
|
16888
|
-
affectedCount:
|
|
16889
|
-
mutationWarnings:
|
|
17189
|
+
var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
|
|
17190
|
+
var taskMutationEnvelopeSchema = z24.object({
|
|
17191
|
+
dryRun: z24.boolean().optional(),
|
|
17192
|
+
created: z24.array(taskMutationTaskRecordSchema),
|
|
17193
|
+
updated: z24.array(taskMutationTaskRecordSchema),
|
|
17194
|
+
deleted: z24.array(taskMutationTaskRecordSchema),
|
|
17195
|
+
affectedCount: z24.number().int().nonnegative(),
|
|
17196
|
+
mutationWarnings: z24.array(taskMutationWarningSchema),
|
|
16890
17197
|
dryRunSummary: taskMutationDryRunSummarySchema.optional()
|
|
16891
17198
|
});
|
|
16892
|
-
var completionTaskStatusSchema =
|
|
16893
|
-
var completionCriterionKindSchema =
|
|
16894
|
-
var completionCriterionStatusSchema =
|
|
16895
|
-
var completionBlockerReasonSchema =
|
|
17199
|
+
var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
|
|
17200
|
+
var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
|
|
17201
|
+
var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
|
|
17202
|
+
var completionBlockerReasonSchema = z24.enum([
|
|
16896
17203
|
"missing_evidence_binding",
|
|
16897
17204
|
"child_not_done",
|
|
16898
17205
|
"child_cancelled_requires_waiver",
|
|
@@ -16900,68 +17207,68 @@ var completionBlockerReasonSchema = z23.enum([
|
|
|
16900
17207
|
"child_missing",
|
|
16901
17208
|
"done_parent_stale"
|
|
16902
17209
|
]);
|
|
16903
|
-
var completionStaleReasonSchema =
|
|
16904
|
-
var completionProjectionRepairErrorCodeSchema =
|
|
17210
|
+
var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
|
|
17211
|
+
var completionProjectionRepairErrorCodeSchema = z24.enum([
|
|
16905
17212
|
"projection_not_stale",
|
|
16906
17213
|
"criteria_missing",
|
|
16907
17214
|
"binding_target_missing",
|
|
16908
17215
|
"repair_conflict"
|
|
16909
17216
|
]);
|
|
16910
|
-
var completionCriterionWaiverSchema =
|
|
16911
|
-
criterionAcId:
|
|
16912
|
-
childTaskId:
|
|
16913
|
-
reason:
|
|
16914
|
-
actor:
|
|
16915
|
-
waivedAt:
|
|
17217
|
+
var completionCriterionWaiverSchema = z24.object({
|
|
17218
|
+
criterionAcId: z24.string().min(1),
|
|
17219
|
+
childTaskId: z24.string().min(1),
|
|
17220
|
+
reason: z24.string().min(1),
|
|
17221
|
+
actor: z24.string().min(1),
|
|
17222
|
+
waivedAt: z24.string().min(1)
|
|
16916
17223
|
});
|
|
16917
|
-
var completionCriterionReplacementSchema =
|
|
16918
|
-
criterionAcId:
|
|
16919
|
-
originalChildTaskId:
|
|
16920
|
-
replacementChildTaskId:
|
|
16921
|
-
reason:
|
|
16922
|
-
actor:
|
|
16923
|
-
replacedAt:
|
|
17224
|
+
var completionCriterionReplacementSchema = z24.object({
|
|
17225
|
+
criterionAcId: z24.string().min(1),
|
|
17226
|
+
originalChildTaskId: z24.string().min(1),
|
|
17227
|
+
replacementChildTaskId: z24.string().min(1),
|
|
17228
|
+
reason: z24.string().min(1),
|
|
17229
|
+
actor: z24.string().min(1),
|
|
17230
|
+
replacedAt: z24.string().min(1)
|
|
16924
17231
|
});
|
|
16925
|
-
var completionCriterionEvaluationSchema =
|
|
16926
|
-
acId:
|
|
16927
|
-
alias:
|
|
16928
|
-
text:
|
|
17232
|
+
var completionCriterionEvaluationSchema = z24.object({
|
|
17233
|
+
acId: z24.string().min(1),
|
|
17234
|
+
alias: z24.string().min(1),
|
|
17235
|
+
text: z24.string(),
|
|
16929
17236
|
kind: completionCriterionKindSchema,
|
|
16930
17237
|
status: completionCriterionStatusSchema,
|
|
16931
17238
|
reason: completionBlockerReasonSchema.optional(),
|
|
16932
|
-
targetTaskId:
|
|
17239
|
+
targetTaskId: z24.string().min(1).optional(),
|
|
16933
17240
|
targetTaskStatus: completionTaskStatusSchema.optional(),
|
|
16934
17241
|
waiver: completionCriterionWaiverSchema.optional(),
|
|
16935
17242
|
replacement: completionCriterionReplacementSchema.optional(),
|
|
16936
17243
|
replacementTaskStatus: completionTaskStatusSchema.optional(),
|
|
16937
|
-
evidenceBindings:
|
|
17244
|
+
evidenceBindings: z24.number().int().nonnegative()
|
|
16938
17245
|
});
|
|
16939
17246
|
var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
|
|
16940
|
-
status:
|
|
17247
|
+
status: z24.literal("unsatisfied"),
|
|
16941
17248
|
reason: completionBlockerReasonSchema
|
|
16942
17249
|
});
|
|
16943
|
-
var completionTotalsSchema =
|
|
16944
|
-
criteria:
|
|
16945
|
-
satisfied:
|
|
16946
|
-
unsatisfied:
|
|
16947
|
-
waived:
|
|
16948
|
-
replaced:
|
|
17250
|
+
var completionTotalsSchema = z24.object({
|
|
17251
|
+
criteria: z24.number().int().nonnegative(),
|
|
17252
|
+
satisfied: z24.number().int().nonnegative(),
|
|
17253
|
+
unsatisfied: z24.number().int().nonnegative(),
|
|
17254
|
+
waived: z24.number().int().nonnegative(),
|
|
17255
|
+
replaced: z24.number().int().nonnegative()
|
|
16949
17256
|
});
|
|
16950
|
-
var completionContextPackSchema =
|
|
16951
|
-
taskId:
|
|
16952
|
-
generatedAt:
|
|
16953
|
-
source:
|
|
16954
|
-
window:
|
|
16955
|
-
limit:
|
|
16956
|
-
since:
|
|
16957
|
-
relationDepth:
|
|
16958
|
-
relatedTaskIds:
|
|
17257
|
+
var completionContextPackSchema = z24.object({
|
|
17258
|
+
taskId: z24.string().min(1),
|
|
17259
|
+
generatedAt: z24.string().min(1),
|
|
17260
|
+
source: z24.literal("audit_log"),
|
|
17261
|
+
window: z24.object({
|
|
17262
|
+
limit: z24.number().int().positive(),
|
|
17263
|
+
since: z24.string().min(1).optional(),
|
|
17264
|
+
relationDepth: z24.number().int().nonnegative(),
|
|
17265
|
+
relatedTaskIds: z24.array(z24.string().min(1))
|
|
16959
17266
|
}),
|
|
16960
|
-
events:
|
|
16961
|
-
|
|
16962
|
-
id:
|
|
16963
|
-
timestamp:
|
|
16964
|
-
action:
|
|
17267
|
+
events: z24.array(
|
|
17268
|
+
z24.object({
|
|
17269
|
+
id: z24.string().min(1),
|
|
17270
|
+
timestamp: z24.string().min(1),
|
|
17271
|
+
action: z24.enum([
|
|
16965
17272
|
"task_completed",
|
|
16966
17273
|
"task_reopened",
|
|
16967
17274
|
"task_cancelled",
|
|
@@ -16969,77 +17276,77 @@ var completionContextPackSchema = z23.object({
|
|
|
16969
17276
|
"task_reparented",
|
|
16970
17277
|
"ac_projection_rebuilt"
|
|
16971
17278
|
]),
|
|
16972
|
-
taskId:
|
|
16973
|
-
relation:
|
|
16974
|
-
actor:
|
|
16975
|
-
details:
|
|
16976
|
-
before:
|
|
16977
|
-
after:
|
|
17279
|
+
taskId: z24.string().min(1),
|
|
17280
|
+
relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
|
|
17281
|
+
actor: z24.string().min(1),
|
|
17282
|
+
details: z24.record(z24.string(), z24.unknown()).optional(),
|
|
17283
|
+
before: z24.record(z24.string(), z24.unknown()).optional(),
|
|
17284
|
+
after: z24.record(z24.string(), z24.unknown()).optional()
|
|
16978
17285
|
})
|
|
16979
17286
|
),
|
|
16980
|
-
summary:
|
|
16981
|
-
totalEvents:
|
|
16982
|
-
byAction:
|
|
16983
|
-
byRelation:
|
|
16984
|
-
latestEventAt:
|
|
17287
|
+
summary: z24.object({
|
|
17288
|
+
totalEvents: z24.number().int().nonnegative(),
|
|
17289
|
+
byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
17290
|
+
byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
|
|
17291
|
+
latestEventAt: z24.string().nullable()
|
|
16985
17292
|
})
|
|
16986
17293
|
});
|
|
16987
|
-
var completionEvaluationSchema =
|
|
16988
|
-
taskId:
|
|
17294
|
+
var completionEvaluationSchema = z24.object({
|
|
17295
|
+
taskId: z24.string().min(1),
|
|
16989
17296
|
taskStatus: completionTaskStatusSchema,
|
|
16990
|
-
ready:
|
|
16991
|
-
stale:
|
|
16992
|
-
staleReasons:
|
|
17297
|
+
ready: z24.boolean(),
|
|
17298
|
+
stale: z24.boolean(),
|
|
17299
|
+
staleReasons: z24.array(completionStaleReasonSchema),
|
|
16993
17300
|
contextPack: completionContextPackSchema.optional(),
|
|
16994
|
-
satisfied:
|
|
16995
|
-
unsatisfied:
|
|
16996
|
-
waived:
|
|
16997
|
-
replaced:
|
|
17301
|
+
satisfied: z24.array(completionCriterionEvaluationSchema),
|
|
17302
|
+
unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
|
|
17303
|
+
waived: z24.array(completionCriterionEvaluationSchema),
|
|
17304
|
+
replaced: z24.array(completionCriterionEvaluationSchema),
|
|
16998
17305
|
totals: completionTotalsSchema
|
|
16999
17306
|
});
|
|
17000
|
-
var completionExplanationSchema =
|
|
17001
|
-
taskId:
|
|
17002
|
-
ready:
|
|
17003
|
-
stale:
|
|
17004
|
-
summary:
|
|
17307
|
+
var completionExplanationSchema = z24.object({
|
|
17308
|
+
taskId: z24.string().min(1),
|
|
17309
|
+
ready: z24.boolean(),
|
|
17310
|
+
stale: z24.boolean(),
|
|
17311
|
+
summary: z24.string(),
|
|
17005
17312
|
contextPack: completionContextPackSchema.optional(),
|
|
17006
|
-
blockers:
|
|
17313
|
+
blockers: z24.array(completionCriterionEvaluationSchema)
|
|
17007
17314
|
});
|
|
17008
|
-
var completionListParamsSchema =
|
|
17009
|
-
taskId:
|
|
17315
|
+
var completionListParamsSchema = z24.object({
|
|
17316
|
+
taskId: z24.string().min(1),
|
|
17010
17317
|
status: completionCriterionStatusSchema.optional(),
|
|
17011
17318
|
kind: completionCriterionKindSchema.optional()
|
|
17012
17319
|
});
|
|
17013
|
-
var completionListResultSchema =
|
|
17014
|
-
taskId:
|
|
17015
|
-
criteria:
|
|
17320
|
+
var completionListResultSchema = z24.object({
|
|
17321
|
+
taskId: z24.string().min(1),
|
|
17322
|
+
criteria: z24.array(completionCriterionEvaluationSchema),
|
|
17016
17323
|
totals: completionTotalsSchema
|
|
17017
17324
|
});
|
|
17018
|
-
var completionEvaluateParamsSchema =
|
|
17019
|
-
taskId:
|
|
17020
|
-
includeContext:
|
|
17021
|
-
limit:
|
|
17022
|
-
since:
|
|
17023
|
-
relationDepth:
|
|
17325
|
+
var completionEvaluateParamsSchema = z24.object({
|
|
17326
|
+
taskId: z24.string().min(1),
|
|
17327
|
+
includeContext: z24.boolean().optional(),
|
|
17328
|
+
limit: z24.number().int().positive().optional(),
|
|
17329
|
+
since: z24.string().min(1).optional(),
|
|
17330
|
+
relationDepth: z24.number().int().nonnegative().optional()
|
|
17024
17331
|
});
|
|
17025
|
-
var completionProjectionRepairErrorSchema =
|
|
17332
|
+
var completionProjectionRepairErrorSchema = z24.object({
|
|
17026
17333
|
code: completionProjectionRepairErrorCodeSchema,
|
|
17027
|
-
message:
|
|
17028
|
-
taskId:
|
|
17029
|
-
acId:
|
|
17030
|
-
evidenceAtomId:
|
|
17334
|
+
message: z24.string().min(1),
|
|
17335
|
+
taskId: z24.string().min(1),
|
|
17336
|
+
acId: z24.string().min(1).optional(),
|
|
17337
|
+
evidenceAtomId: z24.string().min(1).optional()
|
|
17031
17338
|
});
|
|
17032
|
-
var completionProjectionRepairParamsSchema =
|
|
17033
|
-
taskId:
|
|
17034
|
-
dryRun:
|
|
17339
|
+
var completionProjectionRepairParamsSchema = z24.object({
|
|
17340
|
+
taskId: z24.string().min(1),
|
|
17341
|
+
dryRun: z24.boolean().optional()
|
|
17035
17342
|
});
|
|
17036
|
-
var completionProjectionRepairResultSchema =
|
|
17037
|
-
taskId:
|
|
17038
|
-
repaired:
|
|
17039
|
-
dryRun:
|
|
17040
|
-
staleBefore:
|
|
17041
|
-
staleAfter:
|
|
17042
|
-
errors:
|
|
17343
|
+
var completionProjectionRepairResultSchema = z24.object({
|
|
17344
|
+
taskId: z24.string().min(1),
|
|
17345
|
+
repaired: z24.boolean(),
|
|
17346
|
+
dryRun: z24.boolean(),
|
|
17347
|
+
staleBefore: z24.boolean(),
|
|
17348
|
+
staleAfter: z24.boolean(),
|
|
17349
|
+
errors: z24.array(completionProjectionRepairErrorSchema)
|
|
17043
17350
|
});
|
|
17044
17351
|
|
|
17045
17352
|
// packages/contracts/src/taxonomy.ts
|
|
@@ -17542,7 +17849,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
|
|
|
17542
17849
|
};
|
|
17543
17850
|
|
|
17544
17851
|
// packages/contracts/src/templates/manifest.ts
|
|
17545
|
-
import { z as
|
|
17852
|
+
import { z as z25 } from "zod";
|
|
17546
17853
|
var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
|
|
17547
17854
|
var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
|
|
17548
17855
|
var TEMPLATE_UPDATE_STRATEGIES = [
|
|
@@ -17559,79 +17866,79 @@ var PLACEHOLDER_SOURCES = [
|
|
|
17559
17866
|
"tool-resolver",
|
|
17560
17867
|
"literal"
|
|
17561
17868
|
];
|
|
17562
|
-
var PlaceholderSpecSchema =
|
|
17869
|
+
var PlaceholderSpecSchema = z25.object({
|
|
17563
17870
|
/**
|
|
17564
17871
|
* Placeholder identifier as it appears in the template body
|
|
17565
17872
|
* (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
|
|
17566
17873
|
*/
|
|
17567
|
-
name:
|
|
17874
|
+
name: z25.string().min(1, "placeholder name must be non-empty"),
|
|
17568
17875
|
/** Resolver source the installer consults for this placeholder. */
|
|
17569
|
-
source:
|
|
17876
|
+
source: z25.enum(PLACEHOLDER_SOURCES),
|
|
17570
17877
|
/**
|
|
17571
17878
|
* Path expression evaluated against `source` (e.g. `engines.node` against
|
|
17572
17879
|
* `project-context`, `defaults.branchModel` against `.cleo/config`).
|
|
17573
17880
|
* For `literal` source, this MAY be the literal value's identifier.
|
|
17574
17881
|
*/
|
|
17575
|
-
sourcePath:
|
|
17882
|
+
sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
|
|
17576
17883
|
/**
|
|
17577
17884
|
* Fallback value used when `source[sourcePath]` resolves to `undefined`.
|
|
17578
17885
|
* `null` is permitted to explicitly mark "no default — failure required".
|
|
17579
17886
|
*/
|
|
17580
|
-
defaultValue:
|
|
17887
|
+
defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
|
|
17581
17888
|
});
|
|
17582
|
-
var TemplateManifestEntrySchema =
|
|
17889
|
+
var TemplateManifestEntrySchema = z25.object({
|
|
17583
17890
|
/** Stable identifier for this template entry. */
|
|
17584
|
-
id:
|
|
17891
|
+
id: z25.string().min(1, "id must be non-empty"),
|
|
17585
17892
|
/** Category of file this template represents. */
|
|
17586
|
-
kind:
|
|
17893
|
+
kind: z25.enum(TEMPLATE_KINDS),
|
|
17587
17894
|
/** Repo-relative path of the template source file. */
|
|
17588
|
-
sourcePath:
|
|
17895
|
+
sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
|
|
17589
17896
|
/** Project-relative path where the rendered template installs. */
|
|
17590
|
-
installPath:
|
|
17897
|
+
installPath: z25.string().min(1, "installPath must be non-empty"),
|
|
17591
17898
|
/** Substitution strategy the installer applies to `sourcePath`. */
|
|
17592
|
-
substitution:
|
|
17899
|
+
substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
|
|
17593
17900
|
/** Declared placeholders this template requires. May be empty. */
|
|
17594
|
-
placeholders:
|
|
17901
|
+
placeholders: z25.array(PlaceholderSpecSchema),
|
|
17595
17902
|
/** Reconciliation policy on upgrade. */
|
|
17596
|
-
updateStrategy:
|
|
17903
|
+
updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
|
|
17597
17904
|
});
|
|
17598
17905
|
|
|
17599
17906
|
// packages/contracts/src/validator/index.ts
|
|
17600
|
-
import { z as
|
|
17907
|
+
import { z as z26 } from "zod";
|
|
17601
17908
|
var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
17602
|
-
var validatorFindingSchema =
|
|
17603
|
-
acId:
|
|
17604
|
-
status:
|
|
17605
|
-
reasoning:
|
|
17606
|
-
evidenceRefs:
|
|
17607
|
-
checkedAt:
|
|
17909
|
+
var validatorFindingSchema = z26.object({
|
|
17910
|
+
acId: z26.string().min(1, "acId must be non-empty"),
|
|
17911
|
+
status: z26.enum(["pass", "fail", "inconclusive"]),
|
|
17912
|
+
reasoning: z26.string().min(1, "reasoning must be non-empty"),
|
|
17913
|
+
evidenceRefs: z26.array(z26.string()).optional(),
|
|
17914
|
+
checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
17608
17915
|
});
|
|
17609
|
-
var validatorAttestationSchema =
|
|
17610
|
-
verdict:
|
|
17611
|
-
taskId:
|
|
17612
|
-
validatorId:
|
|
17613
|
-
findings:
|
|
17916
|
+
var validatorAttestationSchema = z26.object({
|
|
17917
|
+
verdict: z26.literal("attest"),
|
|
17918
|
+
taskId: z26.string().min(1),
|
|
17919
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17920
|
+
findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
17614
17921
|
(findings) => findings.every((f) => f.status === "pass"),
|
|
17615
17922
|
'attestation requires every finding to have status="pass"'
|
|
17616
17923
|
),
|
|
17617
|
-
summary:
|
|
17618
|
-
attestedAt:
|
|
17619
|
-
schemaVersion:
|
|
17924
|
+
summary: z26.string().optional(),
|
|
17925
|
+
attestedAt: z26.string().min(1),
|
|
17926
|
+
schemaVersion: z26.literal("1")
|
|
17620
17927
|
});
|
|
17621
|
-
var validatorRejectionSchema =
|
|
17622
|
-
verdict:
|
|
17623
|
-
taskId:
|
|
17624
|
-
validatorId:
|
|
17625
|
-
findings:
|
|
17928
|
+
var validatorRejectionSchema = z26.object({
|
|
17929
|
+
verdict: z26.literal("reject"),
|
|
17930
|
+
taskId: z26.string().min(1),
|
|
17931
|
+
validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
17932
|
+
findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
17626
17933
|
(findings) => findings.some((f) => f.status !== "pass"),
|
|
17627
17934
|
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
17628
17935
|
),
|
|
17629
|
-
summary:
|
|
17630
|
-
remediationHints:
|
|
17631
|
-
rejectedAt:
|
|
17632
|
-
schemaVersion:
|
|
17936
|
+
summary: z26.string().min(1, "rejection summary must be non-empty"),
|
|
17937
|
+
remediationHints: z26.array(z26.string()).optional(),
|
|
17938
|
+
rejectedAt: z26.string().min(1),
|
|
17939
|
+
schemaVersion: z26.literal("1")
|
|
17633
17940
|
});
|
|
17634
|
-
var validatorVerdictSchema =
|
|
17941
|
+
var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
|
|
17635
17942
|
validatorAttestationSchema,
|
|
17636
17943
|
validatorRejectionSchema
|
|
17637
17944
|
]);
|
|
@@ -18381,7 +18688,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
|
|
|
18381
18688
|
var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
|
|
18382
18689
|
|
|
18383
18690
|
// packages/contracts/src/decide.ts
|
|
18384
|
-
import { z as
|
|
18691
|
+
import { z as z27 } from "zod";
|
|
18385
18692
|
var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
|
|
18386
18693
|
var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
|
|
18387
18694
|
var DECISION_REQUEST_LIMITS = {
|
|
@@ -18403,11 +18710,11 @@ var DECISION_REQUEST_LIMITS = {
|
|
|
18403
18710
|
maxScoreLevels: 10
|
|
18404
18711
|
};
|
|
18405
18712
|
var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
|
|
18406
|
-
var decisionQuestionTypeSchema =
|
|
18407
|
-
var decisionOutcomeSourceSchema =
|
|
18408
|
-
var decisionInstructionsSchema =
|
|
18409
|
-
var unitIntervalSchema =
|
|
18410
|
-
var decisionStateSchema =
|
|
18713
|
+
var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
|
|
18714
|
+
var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
|
|
18715
|
+
var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
|
|
18716
|
+
var unitIntervalSchema = z27.number().min(0).max(1);
|
|
18717
|
+
var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
|
|
18411
18718
|
const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
|
|
18412
18719
|
if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
|
|
18413
18720
|
context.addIssue({
|
|
@@ -18416,34 +18723,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
|
|
|
18416
18723
|
});
|
|
18417
18724
|
}
|
|
18418
18725
|
});
|
|
18419
|
-
var noulDecisionQuestionSchema =
|
|
18420
|
-
type:
|
|
18726
|
+
var noulDecisionQuestionSchema = z27.object({
|
|
18727
|
+
type: z27.literal("noul"),
|
|
18421
18728
|
instructions: decisionInstructionsSchema.optional(),
|
|
18422
|
-
criteria:
|
|
18729
|
+
criteria: z27.string().min(1)
|
|
18423
18730
|
});
|
|
18424
|
-
var choiceDecisionQuestionSchema =
|
|
18425
|
-
type:
|
|
18731
|
+
var choiceDecisionQuestionSchema = z27.object({
|
|
18732
|
+
type: z27.literal("choice"),
|
|
18426
18733
|
instructions: decisionInstructionsSchema.optional(),
|
|
18427
|
-
criteria:
|
|
18734
|
+
criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
|
|
18428
18735
|
message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
|
|
18429
18736
|
})
|
|
18430
18737
|
});
|
|
18431
|
-
var scoreDecisionQuestionSchema =
|
|
18432
|
-
type:
|
|
18738
|
+
var scoreDecisionQuestionSchema = z27.object({
|
|
18739
|
+
type: z27.literal("score"),
|
|
18433
18740
|
instructions: decisionInstructionsSchema.optional(),
|
|
18434
|
-
criteria:
|
|
18741
|
+
criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
|
|
18435
18742
|
});
|
|
18436
|
-
var decisionQuestionSchema =
|
|
18743
|
+
var decisionQuestionSchema = z27.discriminatedUnion("type", [
|
|
18437
18744
|
noulDecisionQuestionSchema,
|
|
18438
18745
|
choiceDecisionQuestionSchema,
|
|
18439
18746
|
scoreDecisionQuestionSchema
|
|
18440
18747
|
]);
|
|
18441
|
-
var decisionRequestSchema =
|
|
18442
|
-
model:
|
|
18443
|
-
lang:
|
|
18444
|
-
cache:
|
|
18748
|
+
var decisionRequestSchema = z27.object({
|
|
18749
|
+
model: z27.string().min(1).optional(),
|
|
18750
|
+
lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
|
|
18751
|
+
cache: z27.boolean().optional(),
|
|
18445
18752
|
state: decisionStateSchema,
|
|
18446
|
-
questions:
|
|
18753
|
+
questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
|
|
18447
18754
|
(questions) => {
|
|
18448
18755
|
const count = Object.keys(questions).length;
|
|
18449
18756
|
return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
|
|
@@ -18453,139 +18760,139 @@ var decisionRequestSchema = z26.object({
|
|
|
18453
18760
|
}
|
|
18454
18761
|
)
|
|
18455
18762
|
});
|
|
18456
|
-
var noulDecisionAnswerSchema =
|
|
18457
|
-
type:
|
|
18458
|
-
value:
|
|
18763
|
+
var noulDecisionAnswerSchema = z27.object({
|
|
18764
|
+
type: z27.literal("noul"),
|
|
18765
|
+
value: z27.boolean(),
|
|
18459
18766
|
probability: unitIntervalSchema,
|
|
18460
18767
|
confidence: unitIntervalSchema
|
|
18461
18768
|
});
|
|
18462
|
-
var choiceDecisionAnswerSchema =
|
|
18463
|
-
type:
|
|
18464
|
-
value:
|
|
18465
|
-
probabilities:
|
|
18769
|
+
var choiceDecisionAnswerSchema = z27.object({
|
|
18770
|
+
type: z27.literal("choice"),
|
|
18771
|
+
value: z27.string().min(1),
|
|
18772
|
+
probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
|
|
18466
18773
|
confidence: unitIntervalSchema
|
|
18467
18774
|
});
|
|
18468
|
-
var scoreDecisionAnswerSchema =
|
|
18469
|
-
type:
|
|
18470
|
-
value:
|
|
18471
|
-
probabilities:
|
|
18775
|
+
var scoreDecisionAnswerSchema = z27.object({
|
|
18776
|
+
type: z27.literal("score"),
|
|
18777
|
+
value: z27.number().int().nonnegative(),
|
|
18778
|
+
probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
|
|
18472
18779
|
confidence: unitIntervalSchema
|
|
18473
18780
|
});
|
|
18474
|
-
var decisionAnswerSchema =
|
|
18781
|
+
var decisionAnswerSchema = z27.discriminatedUnion("type", [
|
|
18475
18782
|
noulDecisionAnswerSchema,
|
|
18476
18783
|
choiceDecisionAnswerSchema,
|
|
18477
18784
|
scoreDecisionAnswerSchema
|
|
18478
18785
|
]);
|
|
18479
|
-
var decisionOutcomeSchema =
|
|
18480
|
-
answers:
|
|
18786
|
+
var decisionOutcomeSchema = z27.object({
|
|
18787
|
+
answers: z27.record(z27.string().min(1), decisionAnswerSchema),
|
|
18481
18788
|
source: decisionOutcomeSourceSchema,
|
|
18482
|
-
requestId:
|
|
18483
|
-
latencyMs:
|
|
18484
|
-
costUsd:
|
|
18485
|
-
costMicros:
|
|
18486
|
-
balanceMicros:
|
|
18487
|
-
checkpoint:
|
|
18488
|
-
inputTokens:
|
|
18789
|
+
requestId: z27.string().min(1).optional(),
|
|
18790
|
+
latencyMs: z27.number().nonnegative(),
|
|
18791
|
+
costUsd: z27.number().nonnegative().optional(),
|
|
18792
|
+
costMicros: z27.number().int().nonnegative().optional(),
|
|
18793
|
+
balanceMicros: z27.number().int().optional(),
|
|
18794
|
+
checkpoint: z27.string().min(1).optional(),
|
|
18795
|
+
inputTokens: z27.number().int().nonnegative().optional()
|
|
18489
18796
|
});
|
|
18490
|
-
var decisionProviderKindSchema =
|
|
18491
|
-
var decisionProviderConfigSchema =
|
|
18492
|
-
baseUrl:
|
|
18797
|
+
var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
|
|
18798
|
+
var decisionProviderConfigSchema = z27.object({
|
|
18799
|
+
baseUrl: z27.url(),
|
|
18493
18800
|
provider: decisionProviderKindSchema.optional()
|
|
18494
18801
|
});
|
|
18495
18802
|
|
|
18496
18803
|
// packages/contracts/src/nexus-account.ts
|
|
18497
|
-
import { z as
|
|
18498
|
-
var nexusAccountUserSchema =
|
|
18499
|
-
id:
|
|
18500
|
-
email:
|
|
18501
|
-
name:
|
|
18804
|
+
import { z as z28 } from "zod";
|
|
18805
|
+
var nexusAccountUserSchema = z28.object({
|
|
18806
|
+
id: z28.string(),
|
|
18807
|
+
email: z28.string(),
|
|
18808
|
+
name: z28.string().nullable().optional()
|
|
18502
18809
|
});
|
|
18503
|
-
var nexusAccountOrganizationSchema =
|
|
18504
|
-
id:
|
|
18505
|
-
name:
|
|
18506
|
-
slug:
|
|
18507
|
-
role:
|
|
18810
|
+
var nexusAccountOrganizationSchema = z28.object({
|
|
18811
|
+
id: z28.string(),
|
|
18812
|
+
name: z28.string(),
|
|
18813
|
+
slug: z28.string().nullable().optional(),
|
|
18814
|
+
role: z28.string().optional(),
|
|
18508
18815
|
/** `true` for the personal organization created at sign-up. */
|
|
18509
|
-
personal:
|
|
18816
|
+
personal: z28.boolean().optional()
|
|
18510
18817
|
});
|
|
18511
|
-
var nexusAccountMeSchema =
|
|
18818
|
+
var nexusAccountMeSchema = z28.object({
|
|
18512
18819
|
user: nexusAccountUserSchema,
|
|
18513
|
-
organizations:
|
|
18820
|
+
organizations: z28.array(nexusAccountOrganizationSchema).default([])
|
|
18514
18821
|
});
|
|
18515
18822
|
|
|
18516
18823
|
// packages/contracts/src/nexus-cloud.ts
|
|
18517
|
-
import { z as
|
|
18824
|
+
import { z as z29 } from "zod";
|
|
18518
18825
|
var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
18519
18826
|
var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
18520
18827
|
var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
18521
|
-
var isoTime =
|
|
18522
|
-
var profile =
|
|
18523
|
-
var deviceState =
|
|
18524
|
-
var nexusCloudCredentialSchema =
|
|
18525
|
-
kind:
|
|
18526
|
-
credentialId:
|
|
18828
|
+
var isoTime = z29.iso.datetime({ offset: true });
|
|
18829
|
+
var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
18830
|
+
var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
18831
|
+
var nexusCloudCredentialSchema = z29.object({
|
|
18832
|
+
kind: z29.enum(["device", "session"]),
|
|
18833
|
+
credentialId: z29.string().nullable().optional(),
|
|
18527
18834
|
profile: profile.optional(),
|
|
18528
|
-
scopes:
|
|
18835
|
+
scopes: z29.array(z29.string()).default([]),
|
|
18529
18836
|
createdAt: isoTime.nullable().optional(),
|
|
18530
18837
|
lastUsedAt: isoTime.nullable().optional(),
|
|
18531
18838
|
/** When the credential expires if it is not used again; null for sessions. */
|
|
18532
18839
|
idleExpiresAt: isoTime.nullable().optional()
|
|
18533
18840
|
});
|
|
18534
|
-
var nexusCloudDeviceSchema =
|
|
18535
|
-
deviceId:
|
|
18536
|
-
name:
|
|
18537
|
-
platform:
|
|
18538
|
-
arch:
|
|
18539
|
-
cliVersion:
|
|
18841
|
+
var nexusCloudDeviceSchema = z29.object({
|
|
18842
|
+
deviceId: z29.string(),
|
|
18843
|
+
name: z29.string(),
|
|
18844
|
+
platform: z29.string().optional(),
|
|
18845
|
+
arch: z29.string().nullable().optional(),
|
|
18846
|
+
cliVersion: z29.string().nullable().optional(),
|
|
18540
18847
|
createdAt: isoTime.optional(),
|
|
18541
18848
|
lastSeenAt: isoTime.nullable().optional(),
|
|
18542
18849
|
state: deviceState,
|
|
18543
18850
|
signedOutAt: isoTime.nullable().optional(),
|
|
18544
18851
|
/** Base64 device certificate; null until the device holds a key grant. */
|
|
18545
|
-
certificate:
|
|
18852
|
+
certificate: z29.string().nullable().optional(),
|
|
18546
18853
|
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
18547
18854
|
profile: profile.optional(),
|
|
18548
18855
|
/** True for the device whose credential made this request. */
|
|
18549
|
-
current:
|
|
18550
|
-
projects:
|
|
18551
|
-
replicas:
|
|
18856
|
+
current: z29.boolean().default(false),
|
|
18857
|
+
projects: z29.number().int().nonnegative().optional(),
|
|
18858
|
+
replicas: z29.number().int().nonnegative().optional(),
|
|
18552
18859
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18553
18860
|
lastPresenceAt: isoTime.nullable().optional()
|
|
18554
18861
|
});
|
|
18555
|
-
var nexusCloudOrganizationSchema =
|
|
18556
|
-
id:
|
|
18557
|
-
name:
|
|
18558
|
-
slug:
|
|
18559
|
-
role:
|
|
18560
|
-
personal:
|
|
18862
|
+
var nexusCloudOrganizationSchema = z29.object({
|
|
18863
|
+
id: z29.string(),
|
|
18864
|
+
name: z29.string(),
|
|
18865
|
+
slug: z29.string().nullable().optional(),
|
|
18866
|
+
role: z29.string().optional(),
|
|
18867
|
+
personal: z29.boolean().optional()
|
|
18561
18868
|
});
|
|
18562
|
-
var nexusCloudUserSchema =
|
|
18563
|
-
id:
|
|
18564
|
-
email:
|
|
18565
|
-
name:
|
|
18869
|
+
var nexusCloudUserSchema = z29.object({
|
|
18870
|
+
id: z29.string(),
|
|
18871
|
+
email: z29.string(),
|
|
18872
|
+
name: z29.string().nullable().optional()
|
|
18566
18873
|
});
|
|
18567
|
-
var nexusCloudWhoamiSchema =
|
|
18874
|
+
var nexusCloudWhoamiSchema = z29.object({
|
|
18568
18875
|
serverTime: isoTime.optional(),
|
|
18569
18876
|
user: nexusCloudUserSchema,
|
|
18570
|
-
organizations:
|
|
18877
|
+
organizations: z29.array(nexusCloudOrganizationSchema).default([]),
|
|
18571
18878
|
credential: nexusCloudCredentialSchema,
|
|
18572
18879
|
/** The calling device; null for a session caller. */
|
|
18573
18880
|
device: nexusCloudDeviceSchema.nullable()
|
|
18574
18881
|
});
|
|
18575
|
-
var nexusCloudDevicePageSchema =
|
|
18576
|
-
devices:
|
|
18577
|
-
nextCursor:
|
|
18578
|
-
truncated:
|
|
18882
|
+
var nexusCloudDevicePageSchema = z29.object({
|
|
18883
|
+
devices: z29.array(nexusCloudDeviceSchema),
|
|
18884
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18885
|
+
truncated: z29.boolean().default(false)
|
|
18579
18886
|
});
|
|
18580
|
-
var nexusCloudPresenceSchema =
|
|
18887
|
+
var nexusCloudPresenceSchema = z29.looseObject({
|
|
18581
18888
|
observedAt: isoTime.optional(),
|
|
18582
|
-
sync:
|
|
18889
|
+
sync: z29.object({ enabled: z29.boolean() }).optional()
|
|
18583
18890
|
});
|
|
18584
|
-
var nexusCloudReplicaSchema =
|
|
18585
|
-
projectId:
|
|
18586
|
-
replicaId:
|
|
18587
|
-
deviceId:
|
|
18588
|
-
deviceName:
|
|
18891
|
+
var nexusCloudReplicaSchema = z29.object({
|
|
18892
|
+
projectId: z29.string(),
|
|
18893
|
+
replicaId: z29.string(),
|
|
18894
|
+
deviceId: z29.string(),
|
|
18895
|
+
deviceName: z29.string(),
|
|
18589
18896
|
deviceState: deviceState.optional(),
|
|
18590
18897
|
attachedAt: isoTime.optional(),
|
|
18591
18898
|
lastSyncAt: isoTime.nullable(),
|
|
@@ -18594,72 +18901,72 @@ var nexusCloudReplicaSchema = z28.object({
|
|
|
18594
18901
|
/** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
|
|
18595
18902
|
retiredAt: isoTime.nullable().optional(),
|
|
18596
18903
|
/** The retired replica's named successor, else null (not retired, or retired with none). */
|
|
18597
|
-
successor:
|
|
18904
|
+
successor: z29.string().nullable().optional()
|
|
18598
18905
|
});
|
|
18599
|
-
var nexusCloudDeviceCountsSchema =
|
|
18600
|
-
active:
|
|
18601
|
-
total:
|
|
18906
|
+
var nexusCloudDeviceCountsSchema = z29.object({
|
|
18907
|
+
active: z29.number().int().nonnegative(),
|
|
18908
|
+
total: z29.number().int().nonnegative()
|
|
18602
18909
|
});
|
|
18603
18910
|
var projectFields = {
|
|
18604
|
-
projectId:
|
|
18605
|
-
label:
|
|
18606
|
-
organizationId:
|
|
18607
|
-
organizationName:
|
|
18608
|
-
remoteUrl:
|
|
18911
|
+
projectId: z29.string(),
|
|
18912
|
+
label: z29.string().nullable(),
|
|
18913
|
+
organizationId: z29.string(),
|
|
18914
|
+
organizationName: z29.string().optional(),
|
|
18915
|
+
remoteUrl: z29.string().nullable().optional(),
|
|
18609
18916
|
createdAt: isoTime.optional()
|
|
18610
18917
|
};
|
|
18611
|
-
var nexusCloudProjectListItemSchema =
|
|
18918
|
+
var nexusCloudProjectListItemSchema = z29.object({
|
|
18612
18919
|
...projectFields,
|
|
18613
|
-
role:
|
|
18920
|
+
role: z29.string(),
|
|
18614
18921
|
/**
|
|
18615
18922
|
* The project name sealed with the project data key (`Project.encryptedName`), base64;
|
|
18616
18923
|
* only a holder of the account key can open it (T13102).
|
|
18617
18924
|
*/
|
|
18618
|
-
encryptedName:
|
|
18619
|
-
streamId:
|
|
18620
|
-
headSeq:
|
|
18925
|
+
encryptedName: z29.string().nullable().optional(),
|
|
18926
|
+
streamId: z29.string().optional(),
|
|
18927
|
+
headSeq: z29.number().int().nonnegative().nullable().optional(),
|
|
18621
18928
|
/** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
|
|
18622
|
-
headCheckpointId:
|
|
18623
|
-
openConflicts:
|
|
18624
|
-
replicas:
|
|
18929
|
+
headCheckpointId: z29.string().nullable().optional(),
|
|
18930
|
+
openConflicts: z29.number().int().nonnegative().optional(),
|
|
18931
|
+
replicas: z29.array(nexusCloudReplicaSchema).default([]),
|
|
18625
18932
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18626
|
-
replicaCount:
|
|
18933
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18627
18934
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18628
18935
|
lastPresenceAt: isoTime.nullable().optional(),
|
|
18629
18936
|
/** This project's replica list was cut at 50 (T12858). */
|
|
18630
|
-
replicasTruncated:
|
|
18937
|
+
replicasTruncated: z29.boolean().default(false)
|
|
18631
18938
|
});
|
|
18632
|
-
var nexusCloudProjectPageSchema =
|
|
18633
|
-
projects:
|
|
18634
|
-
nextCursor:
|
|
18939
|
+
var nexusCloudProjectPageSchema = z29.object({
|
|
18940
|
+
projects: z29.array(nexusCloudProjectListItemSchema),
|
|
18941
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18635
18942
|
/** Anything in the page was cut (the project list or a replica list). */
|
|
18636
|
-
truncated:
|
|
18943
|
+
truncated: z29.boolean().default(false),
|
|
18637
18944
|
/** The project list itself was cut at 1000 (T12858). */
|
|
18638
|
-
projectsTruncated:
|
|
18945
|
+
projectsTruncated: z29.boolean().default(false)
|
|
18639
18946
|
});
|
|
18640
|
-
var nexusCloudProjectDetailSchema =
|
|
18641
|
-
project:
|
|
18642
|
-
role:
|
|
18643
|
-
canTrash:
|
|
18644
|
-
openConflicts:
|
|
18947
|
+
var nexusCloudProjectDetailSchema = z29.object({
|
|
18948
|
+
project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
18949
|
+
role: z29.string(),
|
|
18950
|
+
canTrash: z29.boolean().optional(),
|
|
18951
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18645
18952
|
/** At most 50, oldest attachment first. */
|
|
18646
|
-
replicas:
|
|
18953
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18647
18954
|
devices: nexusCloudDeviceCountsSchema,
|
|
18648
|
-
replicaCount:
|
|
18955
|
+
replicaCount: z29.number().int().nonnegative().optional(),
|
|
18649
18956
|
lastSyncAt: isoTime.nullable().optional(),
|
|
18650
18957
|
/** `replicas` was cut at 50. */
|
|
18651
|
-
truncated:
|
|
18652
|
-
stream:
|
|
18653
|
-
streamId:
|
|
18654
|
-
headSeq:
|
|
18655
|
-
headCheckpointId:
|
|
18958
|
+
truncated: z29.boolean().default(false),
|
|
18959
|
+
stream: z29.object({
|
|
18960
|
+
streamId: z29.string(),
|
|
18961
|
+
headSeq: z29.number().int().nonnegative(),
|
|
18962
|
+
headCheckpointId: z29.string().nullable()
|
|
18656
18963
|
}).nullable()
|
|
18657
18964
|
});
|
|
18658
|
-
var nexusCloudReplicaPageSchema =
|
|
18659
|
-
replicas:
|
|
18965
|
+
var nexusCloudReplicaPageSchema = z29.object({
|
|
18966
|
+
replicas: z29.array(nexusCloudReplicaSchema),
|
|
18660
18967
|
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
18661
|
-
nextCursor:
|
|
18662
|
-
truncated:
|
|
18968
|
+
nextCursor: z29.string().max(512).nullable().default(null),
|
|
18969
|
+
truncated: z29.boolean().default(false)
|
|
18663
18970
|
});
|
|
18664
18971
|
var NEXUS_STATUS_CHECK_IDS = [
|
|
18665
18972
|
"credential.valid",
|
|
@@ -18675,56 +18982,56 @@ var NEXUS_STATUS_CHECK_IDS = [
|
|
|
18675
18982
|
];
|
|
18676
18983
|
var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
18677
18984
|
var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
18678
|
-
var knownCheckId =
|
|
18679
|
-
var nexusCloudStatusCheckSchema =
|
|
18680
|
-
id:
|
|
18681
|
-
ok:
|
|
18682
|
-
required:
|
|
18683
|
-
detail:
|
|
18985
|
+
var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
|
|
18986
|
+
var nexusCloudStatusCheckSchema = z29.object({
|
|
18987
|
+
id: z29.enum(NEXUS_STATUS_CHECK_IDS),
|
|
18988
|
+
ok: z29.boolean(),
|
|
18989
|
+
required: z29.boolean(),
|
|
18990
|
+
detail: z29.string()
|
|
18684
18991
|
});
|
|
18685
|
-
var nexusCloudStatusSchema =
|
|
18992
|
+
var nexusCloudStatusSchema = z29.object({
|
|
18686
18993
|
serverTime: isoTime.optional(),
|
|
18687
|
-
apiVersion:
|
|
18994
|
+
apiVersion: z29.string().optional(),
|
|
18688
18995
|
/**
|
|
18689
18996
|
* Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
|
|
18690
18997
|
* than the list, which therefore support none of them.
|
|
18691
18998
|
*/
|
|
18692
|
-
features:
|
|
18999
|
+
features: z29.array(z29.string()).optional(),
|
|
18693
19000
|
user: nexusCloudUserSchema,
|
|
18694
19001
|
credential: nexusCloudCredentialSchema,
|
|
18695
19002
|
device: nexusCloudDeviceSchema.nullable(),
|
|
18696
|
-
project:
|
|
18697
|
-
projectId:
|
|
18698
|
-
registered:
|
|
18699
|
-
organizationId:
|
|
18700
|
-
organizationName:
|
|
18701
|
-
role:
|
|
19003
|
+
project: z29.object({
|
|
19004
|
+
projectId: z29.string(),
|
|
19005
|
+
registered: z29.boolean(),
|
|
19006
|
+
organizationId: z29.string().nullable(),
|
|
19007
|
+
organizationName: z29.string().nullable(),
|
|
19008
|
+
role: z29.string().nullable()
|
|
18702
19009
|
}).nullable(),
|
|
18703
|
-
replica:
|
|
18704
|
-
replicaId:
|
|
18705
|
-
attached:
|
|
18706
|
-
attachedElsewhere:
|
|
19010
|
+
replica: z29.object({
|
|
19011
|
+
replicaId: z29.string(),
|
|
19012
|
+
attached: z29.boolean(),
|
|
19013
|
+
attachedElsewhere: z29.boolean(),
|
|
18707
19014
|
attachedAt: isoTime.nullable(),
|
|
18708
19015
|
lastSyncAt: isoTime.nullable(),
|
|
18709
19016
|
presenceAt: isoTime.nullable(),
|
|
18710
|
-
lastReplicaSeq:
|
|
19017
|
+
lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
|
|
18711
19018
|
}).nullable(),
|
|
18712
|
-
stream:
|
|
18713
|
-
streamId:
|
|
18714
|
-
headSeq:
|
|
18715
|
-
headCheckpointId:
|
|
18716
|
-
openConflicts:
|
|
19019
|
+
stream: z29.object({
|
|
19020
|
+
streamId: z29.string(),
|
|
19021
|
+
headSeq: z29.number().int().nonnegative(),
|
|
19022
|
+
headCheckpointId: z29.string().nullable(),
|
|
19023
|
+
openConflicts: z29.number().int().nonnegative(),
|
|
18717
19024
|
devices: nexusCloudDeviceCountsSchema
|
|
18718
19025
|
}).nullable(),
|
|
18719
19026
|
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
18720
|
-
checks:
|
|
19027
|
+
checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
|
|
18721
19028
|
(list) => list.flatMap((c) => {
|
|
18722
19029
|
const id = knownCheckId.safeParse(c.id);
|
|
18723
19030
|
return id.success ? [{ ...c, id: id.data }] : [];
|
|
18724
19031
|
})
|
|
18725
19032
|
),
|
|
18726
19033
|
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
18727
|
-
verdict:
|
|
19034
|
+
verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
18728
19035
|
});
|
|
18729
19036
|
var LOGIN = "run `cleo login nexus`";
|
|
18730
19037
|
var SESSION_EXPIRED_LOGIN = {
|
|
@@ -18769,50 +19076,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
|
|
|
18769
19076
|
};
|
|
18770
19077
|
|
|
18771
19078
|
// packages/contracts/src/nexus-vault.ts
|
|
18772
|
-
import { z as
|
|
18773
|
-
var isoTime2 =
|
|
18774
|
-
var uuid =
|
|
18775
|
-
var nexusUserKeysSchema =
|
|
18776
|
-
keyVersion:
|
|
18777
|
-
masterKeyVerifier:
|
|
19079
|
+
import { z as z30 } from "zod";
|
|
19080
|
+
var isoTime2 = z30.iso.datetime({ offset: true });
|
|
19081
|
+
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);
|
|
19082
|
+
var nexusUserKeysSchema = z30.looseObject({
|
|
19083
|
+
keyVersion: z30.number().int().positive(),
|
|
19084
|
+
masterKeyVerifier: z30.string()
|
|
18778
19085
|
});
|
|
18779
|
-
var nexusProjectKeysSchema =
|
|
18780
|
-
keys:
|
|
18781
|
-
|
|
19086
|
+
var nexusProjectKeysSchema = z30.looseObject({
|
|
19087
|
+
keys: z30.array(
|
|
19088
|
+
z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
|
|
18782
19089
|
)
|
|
18783
19090
|
});
|
|
18784
|
-
var nexusLeaseSchema =
|
|
18785
|
-
streamId:
|
|
18786
|
-
role:
|
|
19091
|
+
var nexusLeaseSchema = z30.looseObject({
|
|
19092
|
+
streamId: z30.string(),
|
|
19093
|
+
role: z30.string(),
|
|
18787
19094
|
replicaId: uuid,
|
|
18788
19095
|
expiresAt: isoTime2,
|
|
18789
19096
|
forkedFromReplicaId: uuid.nullable().optional()
|
|
18790
19097
|
});
|
|
18791
|
-
var nexusLeaseAcquireSchema =
|
|
18792
|
-
var nexusStreamHeadSchema =
|
|
18793
|
-
streamId:
|
|
18794
|
-
kind:
|
|
18795
|
-
headSeq:
|
|
18796
|
-
headCheckpointId:
|
|
19098
|
+
var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
|
|
19099
|
+
var nexusStreamHeadSchema = z30.looseObject({
|
|
19100
|
+
streamId: z30.string(),
|
|
19101
|
+
kind: z30.string().optional(),
|
|
19102
|
+
headSeq: z30.number().int().nonnegative(),
|
|
19103
|
+
headCheckpointId: z30.string().nullable(),
|
|
18797
19104
|
/**
|
|
18798
19105
|
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
18799
19106
|
* Absent from an older server.
|
|
18800
19107
|
*/
|
|
18801
|
-
maxSchemaVersion:
|
|
19108
|
+
maxSchemaVersion: z30.number().int().nonnegative().optional()
|
|
18802
19109
|
});
|
|
18803
|
-
var nexusActivityEventSchema =
|
|
18804
|
-
id:
|
|
19110
|
+
var nexusActivityEventSchema = z30.looseObject({
|
|
19111
|
+
id: z30.union([z30.string(), z30.number()]),
|
|
18805
19112
|
at: isoTime2,
|
|
18806
|
-
actorUserId:
|
|
18807
|
-
actorDeviceId:
|
|
18808
|
-
requestId:
|
|
18809
|
-
action:
|
|
18810
|
-
target:
|
|
18811
|
-
detail:
|
|
19113
|
+
actorUserId: z30.string().nullable().optional(),
|
|
19114
|
+
actorDeviceId: z30.string().nullable().optional(),
|
|
19115
|
+
requestId: z30.string().nullable().optional(),
|
|
19116
|
+
action: z30.string(),
|
|
19117
|
+
target: z30.string().nullable().optional(),
|
|
19118
|
+
detail: z30.unknown().optional()
|
|
18812
19119
|
});
|
|
18813
|
-
var nexusActivityPageSchema =
|
|
18814
|
-
events:
|
|
18815
|
-
nextBefore:
|
|
19120
|
+
var nexusActivityPageSchema = z30.looseObject({
|
|
19121
|
+
events: z30.array(nexusActivityEventSchema),
|
|
19122
|
+
nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
|
|
18816
19123
|
});
|
|
18817
19124
|
|
|
18818
19125
|
// packages/adapters/src/providers/codex/spawn.ts
|