@hol-org/cigar 0.9.4

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.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +68 -0
  4. package/dist/client.d.ts +16 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +839 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/digest.d.ts +21 -0
  9. package/dist/digest.d.ts.map +1 -0
  10. package/dist/digest.js +406 -0
  11. package/dist/digest.js.map +1 -0
  12. package/dist/errors.d.ts +35 -0
  13. package/dist/errors.d.ts.map +1 -0
  14. package/dist/errors.js +54 -0
  15. package/dist/errors.js.map +1 -0
  16. package/dist/examples/quickstart.d.ts +2 -0
  17. package/dist/examples/quickstart.d.ts.map +1 -0
  18. package/dist/examples/quickstart.js +32 -0
  19. package/dist/examples/quickstart.js.map +1 -0
  20. package/dist/examples/two-agent-observer.d.ts +9 -0
  21. package/dist/examples/two-agent-observer.d.ts.map +1 -0
  22. package/dist/examples/two-agent-observer.js +59 -0
  23. package/dist/examples/two-agent-observer.js.map +1 -0
  24. package/dist/examples/verify-shared-bundle.d.ts +2 -0
  25. package/dist/examples/verify-shared-bundle.d.ts.map +1 -0
  26. package/dist/examples/verify-shared-bundle.js +13 -0
  27. package/dist/examples/verify-shared-bundle.js.map +1 -0
  28. package/dist/generated/cigar_service_pb.d.ts +642 -0
  29. package/dist/generated/cigar_service_pb.d.ts.map +1 -0
  30. package/dist/generated/cigar_service_pb.js +55 -0
  31. package/dist/generated/cigar_service_pb.js.map +1 -0
  32. package/dist/generated/context_abi_pb.d.ts +3429 -0
  33. package/dist/generated/context_abi_pb.d.ts.map +1 -0
  34. package/dist/generated/context_abi_pb.js +1386 -0
  35. package/dist/generated/context_abi_pb.js.map +1 -0
  36. package/dist/generated/errors.d.ts +242 -0
  37. package/dist/generated/errors.d.ts.map +1 -0
  38. package/dist/generated/errors.js +38 -0
  39. package/dist/generated/errors.js.map +1 -0
  40. package/dist/generated/generated/error_codes_pb.d.ts +188 -0
  41. package/dist/generated/generated/error_codes_pb.d.ts.map +1 -0
  42. package/dist/generated/generated/error_codes_pb.js +191 -0
  43. package/dist/generated/generated/error_codes_pb.js.map +1 -0
  44. package/dist/generated/models.d.ts +472 -0
  45. package/dist/generated/models.d.ts.map +1 -0
  46. package/dist/generated/models.js +314 -0
  47. package/dist/generated/models.js.map +1 -0
  48. package/dist/generated/operations.d.ts +912 -0
  49. package/dist/generated/operations.d.ts.map +1 -0
  50. package/dist/generated/operations.js +50 -0
  51. package/dist/generated/operations.js.map +1 -0
  52. package/dist/idempotency.d.ts +3 -0
  53. package/dist/idempotency.d.ts.map +1 -0
  54. package/dist/idempotency.js +16 -0
  55. package/dist/idempotency.js.map +1 -0
  56. package/dist/index.d.ts +13 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +13 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/release.json +6 -0
  61. package/dist/types.d.ts +115 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +3 -0
  64. package/dist/types.js.map +1 -0
  65. package/dist/verify-replay.d.ts +3 -0
  66. package/dist/verify-replay.d.ts.map +1 -0
  67. package/dist/verify-replay.js +391 -0
  68. package/dist/verify-replay.js.map +1 -0
  69. package/dist/verify-vectors.d.ts +3 -0
  70. package/dist/verify-vectors.d.ts.map +1 -0
  71. package/dist/verify-vectors.js +383 -0
  72. package/dist/verify-vectors.js.map +1 -0
  73. package/dist/workflow-session.d.ts +93 -0
  74. package/dist/workflow-session.d.ts.map +1 -0
  75. package/dist/workflow-session.js +550 -0
  76. package/dist/workflow-session.js.map +1 -0
  77. package/fixtures/semantic-bundle-v1.json +13 -0
  78. package/package.json +60 -0
@@ -0,0 +1,314 @@
1
+ // @generated by sdk/generate_clients.py; do not edit.
2
+ import { ValidationError } from "../errors.js";
3
+ function fail(path, message) { throw new ValidationError(`${path}: ${message}`); }
4
+ function matchesSchemaPattern(pattern, value, path) {
5
+ switch (pattern) {
6
+ case "^1220[0-9a-f]{64}$": return /^1220[0-9a-f]{64}$/u.test(value);
7
+ case "^[!-~]+$": return /^[!-~]+$/u.test(value);
8
+ case "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$": return /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u.test(value);
9
+ case "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$": return /^[A-Za-z0-9!#$&^_.+-]+\/[A-Za-z0-9!#$&^_.+-]+$/u.test(value);
10
+ case "^[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$": return /^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/u.test(value);
11
+ case "^[A-Za-z0-9._~-]+$": return /^[A-Za-z0-9._~-]+$/u.test(value);
12
+ case "^[A-Za-z][A-Za-z0-9+.-]*:[^\\x00-\\x20]+$": return /^[A-Za-z][A-Za-z0-9+.-]*:[^\x00-\x20]+$/u.test(value);
13
+ case "^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)*$": return /^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)*$/u.test(value);
14
+ case "^[a-z0-9][a-z0-9._/-]{0,127}$": return /^[a-z0-9][a-z0-9._\/-]{0,127}$/u.test(value);
15
+ case "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$": return /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\.v[1-9][0-9]{0,4}$/u.test(value);
16
+ case "^[a-z][a-z0-9_]*$": return /^[a-z][a-z0-9_]*$/u.test(value);
17
+ default: fail(path, "schema uses an unsupported pattern");
18
+ }
19
+ }
20
+ function validateContextBlockReceipts(value, path) {
21
+ if (!Array.isArray(value))
22
+ fail(path, "expected context block array");
23
+ value.forEach((block, index) => {
24
+ if (typeof block !== "object" || block === null || Array.isArray(block))
25
+ fail(`${path}/${index}`, "expected context block");
26
+ const record = block;
27
+ const representation = record["representation"];
28
+ const receiptRequired = representation === "extracted" || representation === "summarized";
29
+ const receiptPresent = Object.hasOwn(record, "transform_receipt");
30
+ if (receiptRequired !== receiptPresent) {
31
+ fail(`${path}/${index}/transform_receipt`, "extracted and summarized representations require exactly one transform receipt");
32
+ }
33
+ });
34
+ }
35
+ function validateSemantic(name, value) {
36
+ if (typeof value !== "object" || value === null || Array.isArray(value))
37
+ return;
38
+ const record = value;
39
+ if (name === "ContextBundle") {
40
+ validateContextBlockReceipts(record["blocks"], `${name}/blocks`);
41
+ }
42
+ else if (name === "ContextDeltaResponse") {
43
+ const delta = record["delta"];
44
+ if (typeof delta !== "object" || delta === null || Array.isArray(delta))
45
+ fail(`${name}/delta`, "expected context delta");
46
+ validateContextBlockReceipts(delta["added_blocks"], `${name}/delta/added_blocks`);
47
+ }
48
+ }
49
+ function validate(schema, value, root, path, depth = 0, budget = { nodes: 0 }) {
50
+ if (depth > 64 || ++budget.nodes > 100_000)
51
+ fail(path, "payload exceeds nesting or node bounds");
52
+ const reference = schema["$ref"];
53
+ if (typeof reference === "string") {
54
+ const name = reference.replace("#/$defs/", "");
55
+ const definitions = root["$defs"];
56
+ if (typeof definitions !== "object" || definitions === null || Array.isArray(definitions))
57
+ fail(path, "schema reference is unresolved");
58
+ const target = definitions[name];
59
+ if (typeof target !== "object" || target === null || Array.isArray(target))
60
+ fail(path, "schema reference is unresolved");
61
+ validate(target, value, root, path, depth + 1, budget);
62
+ return;
63
+ }
64
+ const alternatives = schema["oneOf"] ?? schema["anyOf"];
65
+ if (Array.isArray(alternatives)) {
66
+ let matches = 0;
67
+ for (const alternative of alternatives) {
68
+ try {
69
+ validate(alternative, value, root, path, depth + 1, budget);
70
+ matches += 1;
71
+ }
72
+ catch { /* oneOf probe */ }
73
+ }
74
+ if ("oneOf" in schema ? matches !== 1 : matches < 1)
75
+ fail(path, "value does not match its schema variants");
76
+ return;
77
+ }
78
+ if ("const" in schema && value !== schema["const"])
79
+ fail(path, "value differs from its const");
80
+ const declared = schema["type"];
81
+ if (Array.isArray(declared)) {
82
+ let matches = 0;
83
+ for (const kind of declared) {
84
+ try {
85
+ validate({ ...schema, type: kind }, value, root, path, depth + 1, budget);
86
+ matches += 1;
87
+ }
88
+ catch { /* union probe */ }
89
+ }
90
+ if (matches !== 1)
91
+ fail(path, "value does not match its type union");
92
+ return;
93
+ }
94
+ if (declared === "null") {
95
+ if (value !== null)
96
+ fail(path, "expected null");
97
+ return;
98
+ }
99
+ if (declared === "string") {
100
+ if (typeof value !== "string")
101
+ fail(path, "expected string");
102
+ const length = Buffer.byteLength(value);
103
+ if (typeof schema["minLength"] === "number" && length < schema["minLength"])
104
+ fail(path, "string is too short");
105
+ if (typeof schema["maxLength"] === "number" && length > schema["maxLength"])
106
+ fail(path, "string is too long");
107
+ if (schema["pattern"] !== undefined && !matchesSchemaPattern(schema["pattern"], value, path))
108
+ fail(path, "string does not match pattern");
109
+ return;
110
+ }
111
+ if (declared === "integer" || declared === "number") {
112
+ const wide = schema["format"] === "int64" || schema["format"] === "uint64";
113
+ let numeric;
114
+ if (wide && typeof value === "bigint")
115
+ numeric = value;
116
+ else if (!wide && typeof value === "number" && Number.isSafeInteger(value))
117
+ numeric = BigInt(value);
118
+ else
119
+ fail(path, "expected exact integer");
120
+ if (typeof schema["minimum"] === "number" && numeric < BigInt(schema["minimum"]))
121
+ fail(path, "integer is below minimum");
122
+ if (typeof schema["maximum"] === "number" && numeric > BigInt(schema["maximum"]))
123
+ fail(path, "integer exceeds maximum");
124
+ return;
125
+ }
126
+ if (declared === "boolean") {
127
+ if (typeof value !== "boolean")
128
+ fail(path, "expected boolean");
129
+ return;
130
+ }
131
+ if (declared === "array") {
132
+ if (!Array.isArray(value))
133
+ fail(path, "expected array");
134
+ if (typeof schema["minItems"] === "number" && value.length < schema["minItems"])
135
+ fail(path, "array is too short");
136
+ if (typeof schema["maxItems"] === "number" && value.length > schema["maxItems"])
137
+ fail(path, "array is too long");
138
+ const itemSchema = schema["items"];
139
+ if (typeof itemSchema === "object" && itemSchema !== null)
140
+ value.forEach((item, index) => validate(itemSchema, item, root, `${path}/${index}`, depth + 1, budget));
141
+ return;
142
+ }
143
+ if (declared === "object" || "properties" in schema || "additionalProperties" in schema) {
144
+ if (typeof value !== "object" || value === null || Array.isArray(value))
145
+ fail(path, "expected object");
146
+ const record = value;
147
+ const properties = (schema["properties"] ?? {});
148
+ const patternProperties = (schema["patternProperties"] ?? {});
149
+ const required = new Set(Array.isArray(schema["required"]) ? schema["required"] : []);
150
+ for (const name of required)
151
+ if (!(name in record))
152
+ fail(`${path}/${name}`, "required field is missing");
153
+ if (typeof schema["minProperties"] === "number" && Object.keys(record).length < schema["minProperties"])
154
+ fail(path, "object has too few fields");
155
+ if (typeof schema["maxProperties"] === "number" && Object.keys(record).length > schema["maxProperties"])
156
+ fail(path, "object has too many fields");
157
+ for (const [name, child] of Object.entries(record)) {
158
+ const childSchema = properties[name];
159
+ if (childSchema !== undefined)
160
+ validate(childSchema, child, root, `${path}/${name}`, depth + 1, budget);
161
+ else {
162
+ const matches = Object.entries(patternProperties).filter(([pattern]) => matchesSchemaPattern(pattern, name, path));
163
+ if (matches.length > 0)
164
+ for (const [, matched] of matches)
165
+ validate(matched, child, root, `${path}/${name}`, depth + 1, budget);
166
+ else if (schema["additionalProperties"] === false)
167
+ fail(`${path}/${name}`, "unknown field");
168
+ else if (typeof schema["additionalProperties"] === "object" && schema["additionalProperties"] !== null)
169
+ validate(schema["additionalProperties"], child, root, `${path}/${name}`, depth + 1, budget);
170
+ }
171
+ }
172
+ }
173
+ }
174
+ function coerce(schema, value, root) {
175
+ const reference = schema["$ref"];
176
+ if (typeof reference === "string") {
177
+ const definitions = root["$defs"];
178
+ return coerce(definitions[reference.replace("#/$defs/", "")] ?? {}, value, root);
179
+ }
180
+ const alternatives = schema["oneOf"] ?? schema["anyOf"];
181
+ if (Array.isArray(alternatives)) {
182
+ for (const alternative of alternatives) {
183
+ try {
184
+ validate(alternative, value, root, "payload");
185
+ return coerce(alternative, value, root);
186
+ }
187
+ catch { /* variant probe */ }
188
+ }
189
+ return value;
190
+ }
191
+ const declared = schema["type"];
192
+ if (Array.isArray(declared)) {
193
+ for (const kind of declared) {
194
+ try {
195
+ return coerce({ ...schema, type: kind }, value, root);
196
+ }
197
+ catch { /* union probe */ }
198
+ }
199
+ }
200
+ if (declared === "integer") {
201
+ const wide = schema["format"] === "int64" || schema["format"] === "uint64";
202
+ if (wide && typeof value === "number" && Number.isSafeInteger(value))
203
+ return BigInt(value);
204
+ if (!wide && typeof value === "bigint" && value >= BigInt(Number.MIN_SAFE_INTEGER) && value <= BigInt(Number.MAX_SAFE_INTEGER))
205
+ return Number(value);
206
+ }
207
+ if (declared === "array" && Array.isArray(value)) {
208
+ const item = schema["items"];
209
+ return item === undefined ? value : value.map((child) => coerce(item, child, root));
210
+ }
211
+ if ((declared === "object" || "properties" in schema) && typeof value === "object" && value !== null && !Array.isArray(value)) {
212
+ const properties = (schema["properties"] ?? {});
213
+ const patterns = (schema["patternProperties"] ?? {});
214
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => {
215
+ const matched = properties[key] ?? Object.entries(patterns).find(([pattern]) => matchesSchemaPattern(pattern, key, "payload"))?.[1];
216
+ return [key, matched === undefined ? child : coerce(matched, child, root)];
217
+ }));
218
+ }
219
+ return value;
220
+ }
221
+ function deepFreeze(value, depth = 0, budget = { nodes: 0 }) {
222
+ if (depth > 64 || ++budget.nodes > 100_000)
223
+ fail("payload", "value exceeds nesting or node bounds");
224
+ if (typeof value === "object" && value !== null) {
225
+ for (const child of Object.values(value))
226
+ deepFreeze(child, depth + 1, budget);
227
+ Object.freeze(value);
228
+ }
229
+ return value;
230
+ }
231
+ function payloadModel(name, schema) {
232
+ const frozenSchema = deepFreeze(schema);
233
+ return Object.freeze({
234
+ name,
235
+ schema: frozenSchema,
236
+ create(value) {
237
+ const normalized = coerce(frozenSchema, structuredClone(value), frozenSchema);
238
+ validate(frozenSchema, normalized, frozenSchema, name);
239
+ validateSemantic(name, normalized);
240
+ return deepFreeze(normalized);
241
+ },
242
+ });
243
+ }
244
+ export const AcceptHandoffRequest = payloadModel("AcceptHandoffRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/AcceptHandoffRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Existing handoff acceptance request; recipient authority is server-derived.", "properties": { "handoff_id": { "description": "Handoff addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "target_plan_id": { "description": "Persisted recipient-specific target plan.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["handoff_id", "target_plan_id"], "title": "AcceptHandoffRequest", "type": "object" });
245
+ export const AtomBatchResponse = payloadModel("AtomBatchResponse", { "$defs": { "AtomKind": { "description": "Closed semantic atom kind registry for v1.", "oneOf": [{ "const": "instruction", "description": "Governed instruction content.", "type": "string" }, { "const": "source_code", "description": "Exact source code.", "type": "string" }, { "const": "documentation", "description": "Human-facing documentation.", "type": "string" }, { "const": "decision", "description": "Durable decision or rationale.", "type": "string" }, { "const": "conversation", "description": "Conversation-derived context.", "type": "string" }, { "const": "tool_result", "description": "Tool observation or result.", "type": "string" }, { "const": "schema", "description": "Machine-readable schema.", "type": "string" }, { "const": "policy", "description": "Policy source material.", "type": "string" }, { "const": "test", "description": "Test or verification material.", "type": "string" }, { "const": "artifact", "description": "Build or release artifact metadata.", "type": "string" }] }, "AtomLookupResult": { "description": "One result in an ordered exact atom lookup.", "oneOf": [{ "additionalProperties": false, "description": "The exact atom was visible and retained.", "properties": { "atom": { "$ref": "#/$defs/ContextAtomV1", "description": "Authorized immutable atom." }, "outcome": { "const": "found", "type": "string" } }, "required": ["outcome", "atom"], "type": "object" }, { "additionalProperties": false, "description": "The atom was absent or existence-hidden.", "properties": { "atom_id": { "description": "Requested logical atom identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "outcome": { "const": "missing", "type": "string" } }, "required": ["outcome", "atom_id"], "type": "object" }] }, "AtomPayload": { "description": "Atom content representation. Null and floating-point payload states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Exact bounded UTF-8 content.", "properties": { "type": { "const": "inline_text", "type": "string" }, "value": { "maxLength": 1048576, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Structured canonical value without null or floating point.", "properties": { "type": { "const": "structured", "type": "string" }, "value": { "$ref": "#/$defs/CanonicalValue" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Content-addressed external blob.", "properties": { "type": { "const": "blob", "type": "string" }, "value": { "$ref": "#/$defs/BlobRef" } }, "required": ["type", "value"], "type": "object" }] }, "BlobRef": { "additionalProperties": false, "description": "Reference to encrypted content-addressed payload bytes.", "properties": { "digest": { "description": "Exact content digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "media_type": { "description": "Payload media type.", "maxLength": 255, "minLength": 3, "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$", "type": "string" }, "size_bytes": { "description": "Plaintext payload size before encryption.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["digest", "size_bytes", "media_type"], "type": "object" }, "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "Classification": { "description": "Closed information-classification states.", "oneOf": [{ "const": "public", "description": "Safe for unrestricted publication.", "type": "string" }, { "const": "internal", "description": "Restricted to the owning organization.", "type": "string" }, { "const": "confidential", "description": "Confidential protected context.", "type": "string" }, { "const": "restricted", "description": "Highest sensitivity requiring explicit grants.", "type": "string" }] }, "ContextAtomV1": { "additionalProperties": false, "description": "Immutable v1 catalog atom with complete provenance and governance envelopes.", "properties": { "atom_id": { "description": "Unique immutable record identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "content_digest": { "description": "Digest of the exact content payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Bounded stable extension map." }, "governance": { "$ref": "#/$defs/GovernanceEnvelope", "description": "Governance gates." }, "kind": { "$ref": "#/$defs/AtomKind", "description": "Semantic atom kind." }, "lifecycle": { "$ref": "#/$defs/Lifecycle", "description": "Current immutable lifecycle state." }, "lineage_id": { "description": "Stable semantic lineage identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "payload": { "$ref": "#/$defs/AtomPayload", "description": "Protected payload representation." }, "quality": { "$ref": "#/$defs/QualityEnvelope", "description": "Bounded quality signals." }, "retrieval": { "$ref": "#/$defs/RetrievalEnvelope", "description": "Policy-subordinate retrieval metadata." }, "schema_version": { "description": "Must be `cigar.atom.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "scope": { "$ref": "#/$defs/ScopeEnvelope", "description": "Tenant and project scope." }, "source": { "$ref": "#/$defs/SourceDescriptor", "description": "Immutable source coordinates." }, "superseded_by": { "description": "Required successor for a superseded record and forbidden otherwise.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "temporal": { "$ref": "#/$defs/TemporalEnvelope", "description": "Valid and observation time coordinates." }, "version_id": { "description": "Digest-derived semantic version identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["schema_version", "atom_id", "lineage_id", "version_id", "content_digest", "kind", "payload", "source", "scope", "temporal", "governance", "quality", "retrieval", "lifecycle", "extensions"], "type": "object" }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "GovernanceEnvelope": { "additionalProperties": false, "description": "Governance metadata required before retrieval or compilation.", "properties": { "allowed_purposes": { "description": "Sorted unique allowed-purpose selectors.", "items": { "maxLength": 512, "minLength": 1, "type": "string" }, "maxItems": 256, "minItems": 1, "type": "array" }, "classification": { "$ref": "#/$defs/Classification", "description": "Information classification." }, "instruction_authority": { "$ref": "#/$defs/InstructionAuthority", "description": "Authority of any instruction-like content." }, "processor_constraints": { "description": "Sorted unique processor constraints.", "items": { "maxLength": 512, "minLength": 1, "type": "string" }, "maxItems": 256, "type": "array" } }, "required": ["classification", "allowed_purposes", "processor_constraints", "instruction_authority"], "type": "object" }, "InstructionAuthority": { "description": "Closed instruction-authority levels used by non-bypassable policy gates.", "oneOf": [{ "const": "data", "description": "Content is data and cannot issue instructions.", "type": "string" }, { "const": "advisory", "description": "Advisory material that may inform but cannot override project rules.", "type": "string" }, { "const": "project", "description": "Project-authorized instructions.", "type": "string" }, { "const": "system", "description": "System-authorized instructions.", "type": "string" }] }, "Lifecycle": { "description": "Closed immutable atom lifecycle.", "oneOf": [{ "const": "active", "description": "Eligible for governed selection.", "type": "string" }, { "const": "superseded", "description": "Replaced by another immutable version.", "type": "string" }, { "const": "tombstoned", "description": "Logically removed but retained for provenance.", "type": "string" }, { "const": "quarantined", "description": "Withheld due to integrity or security concerns.", "type": "string" }] }, "QualityEnvelope": { "additionalProperties": false, "description": "Bounded quality signals used by deterministic planning.", "properties": { "authority": { "description": "Non-zero authority tier; larger is more authoritative.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "confidence": { "description": "Fixed-point confidence in millionths.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "coverage": { "description": "Fixed-point source coverage in millionths.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" } }, "required": ["confidence", "coverage", "authority"], "type": "object" }, "RetrievalEnvelope": { "additionalProperties": false, "description": "Retrieval-only metadata that never overrides current policy.", "properties": { "embedding_eligible": { "description": "Whether policy may permit an embedding request.", "type": "boolean" }, "exact_terms": { "description": "Sorted unique exact retrieval terms.", "items": { "maxLength": 512, "minLength": 1, "type": "string" }, "maxItems": 1024, "type": "array" }, "lexical_enabled": { "description": "Whether lexical indexing may include protected content through an authorized index.", "type": "boolean" } }, "required": ["exact_terms", "lexical_enabled", "embedding_eligible"], "type": "object" }, "ScopeEnvelope": { "additionalProperties": false, "description": "Tenant and project isolation coordinates.", "properties": { "project_ids": { "description": "Sorted unique project identities authorized to observe the atom.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 256, "minItems": 1, "type": "array" }, "tenant_id": { "description": "Owning tenant identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["tenant_id", "project_ids"], "type": "object" }, "SourceDescriptor": { "additionalProperties": false, "description": "Immutable source snapshot coordinates for an atom.", "properties": { "relative_path": { "contentEncoding": "base64url", "description": "Exact path bytes relative to the connector root, when applicable.", "maxLength": 5462, "minLength": 2, "type": "string" }, "revision": { "description": "Connector-specific immutable source revision.", "maxLength": 512, "minLength": 1, "type": "string" }, "snapshot_digest": { "description": "Digest of the atomic source snapshot.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "uri": { "description": "Absolute source URI.", "maxLength": 4096, "minLength": 1, "pattern": "^[A-Za-z][A-Za-z0-9+.-]*:[^\\x00-\\x20]+$", "type": "string" } }, "required": ["uri", "revision", "snapshot_digest"], "type": "object" }, "TemporalEnvelope": { "additionalProperties": false, "description": "Bitemporal truth envelope for catalog selection.", "properties": { "observed_at": { "description": "Time at which CIGAR observed this version.", "format": "date-time", "type": "string" }, "valid_from": { "description": "Earliest valid semantic time.", "format": "date-time", "type": "string" }, "valid_until": { "description": "Exclusive semantic validity end, when known.", "format": "date-time", "type": "string" } }, "required": ["valid_from", "observed_at"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/AtomBatchResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Ordered atom lookup response preserving exact request order.", "properties": { "results": { "description": "Exactly one result for each requested atom identity, in request order.", "items": { "$ref": "#/$defs/AtomLookupResult" }, "maxItems": 1000, "minItems": 1, "type": "array" } }, "required": ["results"], "title": "AtomBatchResponse", "type": "object" });
246
+ export const AtomIdRequest = payloadModel("AtomIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/AtomIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one logical atom.", "properties": { "atom_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["atom_id"], "title": "AtomIdRequest", "type": "object" });
247
+ export const AuthorizeEffectRequest = payloadModel("AuthorizeEffectRequest", { "$defs": { "ApprovalKind": { "description": "Closed approval provenance.", "oneOf": [{ "const": "human", "description": "Explicit human approval.", "type": "string" }, { "const": "policy", "description": "Policy-authorized automated approval for eligible risk.", "type": "string" }] }, "EffectApprovalDraft": { "additionalProperties": false, "description": "Approval semantics supplied by a caller; approver identity and times are server-derived.", "properties": { "approval_id": { "description": "Caller-selected approval identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "conditions_digest": { "description": "Digest of approval conditions and limits.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "kind": { "$ref": "#/$defs/ApprovalKind", "description": "Approval provenance class." }, "ttl_seconds": { "description": "Requested approval lifetime from server observation time.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["approval_id", "conditions_digest", "kind", "ttl_seconds"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/AuthorizeEffectRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Effect authorization request over one exact durable revision.", "properties": { "approval": { "anyOf": [{ "$ref": "#/$defs/EffectApprovalDraft" }], "description": "Optional explicit approval; low-risk policy may permit absence." }, "effect_id": { "description": "Effect addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["effect_id"], "title": "AuthorizeEffectRequest", "type": "object" });
248
+ export const BatchAtomsRequest = payloadModel("BatchAtomsRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/BatchAtomsRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Ordered exact atom lookup request.", "properties": { "atom_ids": { "description": "Sorted unique atom identities.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 1000, "minItems": 1, "type": "array" } }, "required": ["atom_ids"], "title": "BatchAtomsRequest", "type": "object" });
249
+ export const BundleIdRequest = payloadModel("BundleIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/BundleIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one immutable context bundle.", "properties": { "bundle_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["bundle_id"], "title": "BundleIdRequest", "type": "object" });
250
+ export const CapabilitiesResponse = payloadModel("CapabilitiesResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CapabilitiesResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Public compatibility and bounded capability document.", "properties": { "api_version": { "description": "Supported API line.", "maxLength": 256, "minLength": 1, "type": "string" }, "extensions": { "description": "Sorted enabled extension identifiers.", "items": { "maxLength": 256, "minLength": 1, "type": "string" }, "maxItems": 256, "type": "array" }, "max_event_bytes": { "description": "Maximum event payload bytes.", "format": "uint32", "minimum": 0, "type": "integer" }, "max_page_size": { "description": "Maximum page size.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "max_payload_bytes": { "description": "Maximum canonical operation payload bytes.", "format": "uint32", "minimum": 0, "type": "integer" }, "profiles": { "description": "Sorted enabled deployment profiles.", "items": { "maxLength": 256, "minLength": 1, "type": "string" }, "maxItems": 256, "type": "array" }, "protocol_version": { "description": "Supported protocol line.", "maxLength": 256, "minLength": 1, "type": "string" } }, "required": ["api_version", "protocol_version", "profiles", "extensions", "max_payload_bytes", "max_event_bytes", "max_page_size"], "title": "CapabilitiesResponse", "type": "object" });
251
+ export const CatalogQueryResponse = payloadModel("CatalogQueryResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CatalogQueryResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Bounded metadata-only catalog query response.", "properties": { "degraded": { "description": "Whether an optional index channel degraded safely.", "type": "boolean" }, "query_digest": { "description": "Fingerprint of the exact query plan and snapshot.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "version_ids": { "description": "Ordered authorized semantic versions.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1000, "type": "array" } }, "required": ["version_ids", "query_digest", "degraded"], "title": "CatalogQueryResponse", "type": "object" });
252
+ export const CheckpointSpaceRequest = payloadModel("CheckpointSpaceRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CheckpointSpaceRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Explicit focus checkpoint request.", "properties": { "focus_id": { "description": "Exact focus to checkpoint.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "space_id": { "description": "Context space addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id", "focus_id"], "title": "CheckpointSpaceRequest", "type": "object" });
253
+ export const CompareLiveReplayRequest = payloadModel("CompareLiveReplayRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CompareLiveReplayRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Live comparison request referencing a separately verified one-use authorization.", "properties": { "live_authorization_id": { "description": "Server-persisted live authorization identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "replay_id": { "description": "Persisted replay job addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["replay_id", "live_authorization_id"], "title": "CompareLiveReplayRequest", "type": "object" });
254
+ export const CompensateEffectRequest = payloadModel("CompensateEffectRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CompensateEffectRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Requests compensation through one separately prepared and authorized child effect.", "properties": { "compensation_effect_id": { "description": "Separately authorized compensation effect.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "compensation_spec_digest": { "description": "Digest of the original compensation specification.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "effect_id": { "description": "Original effect addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["effect_id", "compensation_effect_id", "compensation_spec_digest"], "title": "CompensateEffectRequest", "type": "object" });
255
+ export const CompileContextBundleRequest = payloadModel("CompileContextBundleRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CompileContextBundleRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request to persist or retrieve the bundle produced by a retained plan.", "properties": { "plan_id": { "description": "Persisted plan identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["plan_id"], "title": "CompileContextBundleRequest", "type": "object" });
256
+ export const CompileContextDeltaRequest = payloadModel("CompileContextDeltaRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CompileContextDeltaRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request for an exact delta from a base bundle to a retained target plan.", "properties": { "base_bundle_id": { "description": "Exact immutable base bundle.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "target_plan_id": { "description": "Persisted target plan whose output becomes the delta target.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["base_bundle_id", "target_plan_id"], "title": "CompileContextDeltaRequest", "type": "object" });
257
+ export const ConfigurationResponse = payloadModel("ConfigurationResponse", { "$defs": { "PublicDeploymentMode": { "description": "Closed redacted daemon deployment mode.", "oneOf": [{ "const": "local", "description": "Permission-restricted local service.", "type": "string" }, { "const": "shared", "description": "TLS-authenticated shared service.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ConfigurationResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Redacted public configuration summary.", "properties": { "grpc_enabled": { "description": "Whether gRPC is enabled.", "type": "boolean" }, "http_enabled": { "description": "Whether HTTP is enabled.", "type": "boolean" }, "local_ipc": { "description": "Whether local IPC is enabled.", "type": "boolean" }, "max_request_bytes": { "description": "Maximum expanded request bytes.", "format": "uint32", "minimum": 0, "type": "integer" }, "max_timeout_ms": { "description": "Maximum request timeout milliseconds.", "format": "uint64", "minimum": 0, "type": "integer" }, "mode": { "$ref": "#/$defs/PublicDeploymentMode", "description": "Deployment mode." } }, "required": ["mode", "local_ipc", "http_enabled", "grpc_enabled", "max_request_bytes", "max_timeout_ms"], "title": "ConfigurationResponse", "type": "object" });
258
+ export const ConflictListResponse = payloadModel("ConflictListResponse", { "$defs": { "ConflictSummary": { "additionalProperties": false, "description": "Disclosure-safe durable conflict summary.", "properties": { "base_commit_id": { "description": "Exact immutable merge base.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "conflict_id": { "description": "Stable conflict identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "resolver": { "description": "Required resolver class symbol.", "maxLength": 64, "minLength": 1, "type": "string" } }, "required": ["conflict_id", "base_commit_id", "resolver"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ConflictListResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Bounded conflict list response.", "properties": { "conflicts": { "description": "Sorted conflict summaries.", "items": { "$ref": "#/$defs/ConflictSummary" }, "maxItems": 1000, "type": "array" } }, "required": ["conflicts"], "title": "ConflictListResponse", "type": "object" });
259
+ export const ConflictResolutionResponse = payloadModel("ConflictResolutionResponse", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextCommit": { "additionalProperties": false, "description": "Immutable context-space commit.", "properties": { "author_id": { "description": "Authenticated author.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "commit_id": { "description": "Content-derived commit identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "committed_at": { "description": "Commit time.", "format": "date-time", "type": "string" }, "events": { "description": "Ordered immutable events.", "items": { "$ref": "#/$defs/CoordinationEvent" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "parent_commit_id": { "description": "Parent commit, absent only for sequence one.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "policy_snapshot_digest": { "description": "Policy snapshot used for publication.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 65536, "minLength": 1, "type": "string" }, "root_digest": { "description": "Resulting context-space root digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-commit.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "sequence": { "description": "Monotonic sequence beginning at one.", "format": "uint64", "minimum": 0, "type": "integer" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["schema_version", "commit_id", "space_id", "sequence", "author_id", "purpose", "events", "root_digest", "policy_snapshot_digest", "committed_at", "extensions"], "type": "object" }, "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ConflictResolutionResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Receipt for one resolved stable conflict.", "properties": { "commit": { "$ref": "#/$defs/ContextCommit", "description": "Immutable commit produced after resolution." }, "conflict_id": { "description": "Consumed conflict identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["conflict_id", "commit"], "title": "ConflictResolutionResponse", "type": "object" });
260
+ export const ContextBundle = payloadModel("ContextBundle", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextBlock": { "additionalProperties": false, "description": "One packed, provenance-complete semantic block.", "properties": { "block_id": { "description": "Content-derived block identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "content_digest": { "description": "Exact digest of rendered block content.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "lane": { "$ref": "#/$defs/LaneKind", "description": "Destination lane." }, "provenance": { "description": "Sorted unique catalog versions that prove provenance.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "representation": { "$ref": "#/$defs/RepresentationKind", "description": "Representation kind." }, "token_count": { "description": "Exact physical tokens under the target tokenizer.", "format": "uint32", "minimum": 0, "type": "integer" }, "transform_receipt": { "description": "Evidence receipt for a non-exact transform.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["block_id", "lane", "representation", "content_digest", "token_count", "provenance"], "type": "object" }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "LaneKind": { "description": "Standard deterministic context lanes.", "oneOf": [{ "const": "rules", "description": "Non-bypassable rules and instructions.", "type": "string" }, { "const": "task", "description": "Current task statement and exact constraints.", "type": "string" }, { "const": "evidence", "description": "Source, documentation, and verification evidence.", "type": "string" }, { "const": "history", "description": "Prior decisions and relevant history.", "type": "string" }, { "const": "tools", "description": "Tool contracts and capability descriptions.", "type": "string" }] }, "RepresentationKind": { "description": "Evidence-carrying representation selected for one context block.", "oneOf": [{ "const": "exact", "description": "Exact source content.", "type": "string" }, { "const": "extracted", "description": "Deterministically extracted source span.", "type": "string" }, { "const": "summarized", "description": "Evidence-backed deterministic summary.", "type": "string" }, { "const": "redacted", "description": "Redacted marker with no protected content.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ContextBundle.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Deterministically ordered bundle ready for materialization.", "properties": { "blocks": { "description": "Ordered blocks grouped by standard lane ordering.", "items": { "$ref": "#/$defs/ContextBlock" }, "maxItems": 10000, "type": "array" }, "bundle_id": { "description": "Content-derived bundle identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "contract_digest": { "description": "Normalized contract digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "manifest_digest": { "description": "Selection manifest digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-bundle.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "total_tokens": { "description": "Exact total physical tokens across blocks.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["schema_version", "bundle_id", "contract_digest", "manifest_digest", "blocks", "total_tokens", "extensions"], "title": "ContextBundle", "type": "object" });
261
+ export const ContextCommit = payloadModel("ContextCommit", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ContextCommit.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Immutable context-space commit.", "properties": { "author_id": { "description": "Authenticated author.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "commit_id": { "description": "Content-derived commit identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "committed_at": { "description": "Commit time.", "format": "date-time", "type": "string" }, "events": { "description": "Ordered immutable events.", "items": { "$ref": "#/$defs/CoordinationEvent" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "parent_commit_id": { "description": "Parent commit, absent only for sequence one.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "policy_snapshot_digest": { "description": "Policy snapshot used for publication.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 65536, "minLength": 1, "type": "string" }, "root_digest": { "description": "Resulting context-space root digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-commit.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "sequence": { "description": "Monotonic sequence beginning at one.", "format": "uint64", "minimum": 0, "type": "integer" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["schema_version", "commit_id", "space_id", "sequence", "author_id", "purpose", "events", "root_digest", "policy_snapshot_digest", "committed_at", "extensions"], "title": "ContextCommit", "type": "object" });
262
+ export const ContextDeltaResponse = payloadModel("ContextDeltaResponse", { "$defs": { "ContextBlock": { "additionalProperties": false, "description": "One packed, provenance-complete semantic block.", "properties": { "block_id": { "description": "Content-derived block identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "content_digest": { "description": "Exact digest of rendered block content.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "lane": { "$ref": "#/$defs/LaneKind", "description": "Destination lane." }, "provenance": { "description": "Sorted unique catalog versions that prove provenance.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "representation": { "$ref": "#/$defs/RepresentationKind", "description": "Representation kind." }, "token_count": { "description": "Exact physical tokens under the target tokenizer.", "format": "uint32", "minimum": 0, "type": "integer" }, "transform_receipt": { "description": "Evidence receipt for a non-exact transform.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["block_id", "lane", "representation", "content_digest", "token_count", "provenance"], "type": "object" }, "ContextDelta": { "additionalProperties": false, "description": "Deterministic block delta between two bundle identities.", "properties": { "added_blocks": { "description": "Sorted unique blocks added or replaced.", "items": { "$ref": "#/$defs/ContextBlock" }, "maxItems": 10000, "type": "array" }, "base_bundle_id": { "description": "Required provider-present base bundle.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "removed_block_ids": { "description": "Sorted unique block identities removed from the base.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "resulting_tokens": { "description": "Exact token count after applying the delta.", "format": "uint32", "minimum": 0, "type": "integer" }, "schema_version": { "description": "Must be `cigar.context-delta.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "target_bundle_id": { "description": "Resulting target bundle.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["schema_version", "base_bundle_id", "target_bundle_id", "added_blocks", "removed_block_ids", "resulting_tokens"], "type": "object" }, "LaneKind": { "description": "Standard deterministic context lanes.", "oneOf": [{ "const": "rules", "description": "Non-bypassable rules and instructions.", "type": "string" }, { "const": "task", "description": "Current task statement and exact constraints.", "type": "string" }, { "const": "evidence", "description": "Source, documentation, and verification evidence.", "type": "string" }, { "const": "history", "description": "Prior decisions and relevant history.", "type": "string" }, { "const": "tools", "description": "Tool contracts and capability descriptions.", "type": "string" }] }, "RepresentationKind": { "description": "Evidence-carrying representation selected for one context block.", "oneOf": [{ "const": "exact", "description": "Exact source content.", "type": "string" }, { "const": "extracted", "description": "Deterministically extracted source span.", "type": "string" }, { "const": "summarized", "description": "Evidence-backed deterministic summary.", "type": "string" }, { "const": "redacted", "description": "Redacted marker with no protected content.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ContextDeltaResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Sealed delta and its exact canonical digest.", "properties": { "delta": { "$ref": "#/$defs/ContextDelta", "description": "Deterministic block delta." }, "delta_digest": { "description": "Digest of the exact delta record.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["delta", "delta_digest"], "title": "ContextDeltaResponse", "type": "object" });
263
+ export const ContextExplanationResponse = payloadModel("ContextExplanationResponse", { "$defs": { "CandidateDisposition": { "description": "Deterministic disposition of one retrieval candidate.", "oneOf": [{ "additionalProperties": false, "description": "Selected into a specific lane with a fixed-point score.", "properties": { "lane": { "$ref": "#/$defs/LaneKind", "description": "Selected lane." }, "score": { "description": "Deterministic score in millionths.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "state": { "const": "selected", "type": "string" } }, "required": ["state", "lane", "score"], "type": "object" }, { "additionalProperties": false, "description": "Excluded with a stable reason.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary exclusion reason." }, "state": { "const": "excluded", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Redacted while preserving safe explanation that a candidate existed.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary redaction reason." }, "state": { "const": "redacted", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Required selector had no authorized matching candidate.", "properties": { "state": { "const": "required_missing", "type": "string" } }, "required": ["state"], "type": "object" }] }, "ContextExplanationEntry": { "additionalProperties": false, "description": "One disclosure-filtered explanation entry.", "properties": { "disposition": { "$ref": "#/$defs/CandidateDisposition", "description": "Final deterministic disposition." }, "version_id": { "description": "Authorized semantic version.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["version_id", "disposition"], "type": "object" }, "DispositionReason": { "description": "Stable exclusion and non-selection reason codes.", "oneOf": [{ "const": "scope_denied", "description": "Candidate was outside the authorized scope.", "type": "string" }, { "const": "purpose_denied", "description": "Purpose did not authorize candidate use.", "type": "string" }, { "const": "temporal_mismatch", "description": "Candidate was temporally ineligible.", "type": "string" }, { "const": "trust_insufficient", "description": "Candidate trust or authority was insufficient.", "type": "string" }, { "const": "instruction_authority_denied", "description": "Instruction authority was insufficient.", "type": "string" }, { "const": "processor_denied", "description": "Processor constraints were not satisfied.", "type": "string" }, { "const": "integrity_failed", "description": "Integrity verification failed.", "type": "string" }, { "const": "budget_displaced", "description": "A higher-ranked candidate displaced this one under budget.", "type": "string" }, { "const": "lifecycle_ineligible", "description": "Candidate was superseded or tombstoned.", "type": "string" }, { "const": "conflict_lost", "description": "Candidate conflicted with a mandatory higher-authority item.", "type": "string" }, { "const": "required_missing", "description": "Required context could not be found.", "type": "string" }] }, "LaneKind": { "description": "Standard deterministic context lanes.", "oneOf": [{ "const": "rules", "description": "Non-bypassable rules and instructions.", "type": "string" }, { "const": "task", "description": "Current task statement and exact constraints.", "type": "string" }, { "const": "evidence", "description": "Source, documentation, and verification evidence.", "type": "string" }, { "const": "history", "description": "Prior decisions and relevant history.", "type": "string" }, { "const": "tools", "description": "Tool contracts and capability descriptions.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ContextExplanationResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Disclosure-filtered explanation result.", "properties": { "entries": { "description": "Sorted authorized entries only.", "items": { "$ref": "#/$defs/ContextExplanationEntry" }, "maxItems": 1000, "type": "array" } }, "required": ["entries"], "title": "ContextExplanationResponse", "type": "object" });
264
+ export const ContextPlanResponse = payloadModel("ContextPlanResponse", { "$defs": { "CandidateDisposition": { "description": "Deterministic disposition of one retrieval candidate.", "oneOf": [{ "additionalProperties": false, "description": "Selected into a specific lane with a fixed-point score.", "properties": { "lane": { "$ref": "#/$defs/LaneKind", "description": "Selected lane." }, "score": { "description": "Deterministic score in millionths.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "state": { "const": "selected", "type": "string" } }, "required": ["state", "lane", "score"], "type": "object" }, { "additionalProperties": false, "description": "Excluded with a stable reason.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary exclusion reason." }, "state": { "const": "excluded", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Redacted while preserving safe explanation that a candidate existed.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary redaction reason." }, "state": { "const": "redacted", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Required selector had no authorized matching candidate.", "properties": { "state": { "const": "required_missing", "type": "string" } }, "required": ["state"], "type": "object" }] }, "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextPlan": { "additionalProperties": false, "description": "Deterministic planner output before representation transforms and packing.", "properties": { "catalog_watermark": { "description": "Catalog/index watermark used for retrieval.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "contract_digest": { "description": "Digest of the normalized input contract.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "dispositions": { "description": "Sorted disposition table containing every considered candidate.", "items": { "maxItems": 2, "minItems": 2, "prefixItems": [{ "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, { "$ref": "#/$defs/CandidateDisposition" }], "type": "array" }, "maxItems": 10000, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "lanes": { "description": "Sorted unique lanes.", "items": { "$ref": "#/$defs/PlanLane" }, "maxItems": 32, "minItems": 1, "type": "array" }, "plan_id": { "description": "Unique plan observation identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-plan.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "total_input_tokens": { "description": "Exact aggregate input-token budget.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["schema_version", "plan_id", "contract_digest", "catalog_watermark", "total_input_tokens", "lanes", "dispositions", "extensions"], "type": "object" }, "DispositionReason": { "description": "Stable exclusion and non-selection reason codes.", "oneOf": [{ "const": "scope_denied", "description": "Candidate was outside the authorized scope.", "type": "string" }, { "const": "purpose_denied", "description": "Purpose did not authorize candidate use.", "type": "string" }, { "const": "temporal_mismatch", "description": "Candidate was temporally ineligible.", "type": "string" }, { "const": "trust_insufficient", "description": "Candidate trust or authority was insufficient.", "type": "string" }, { "const": "instruction_authority_denied", "description": "Instruction authority was insufficient.", "type": "string" }, { "const": "processor_denied", "description": "Processor constraints were not satisfied.", "type": "string" }, { "const": "integrity_failed", "description": "Integrity verification failed.", "type": "string" }, { "const": "budget_displaced", "description": "A higher-ranked candidate displaced this one under budget.", "type": "string" }, { "const": "lifecycle_ineligible", "description": "Candidate was superseded or tombstoned.", "type": "string" }, { "const": "conflict_lost", "description": "Candidate conflicted with a mandatory higher-authority item.", "type": "string" }, { "const": "required_missing", "description": "Required context could not be found.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "LaneKind": { "description": "Standard deterministic context lanes.", "oneOf": [{ "const": "rules", "description": "Non-bypassable rules and instructions.", "type": "string" }, { "const": "task", "description": "Current task statement and exact constraints.", "type": "string" }, { "const": "evidence", "description": "Source, documentation, and verification evidence.", "type": "string" }, { "const": "history", "description": "Prior decisions and relevant history.", "type": "string" }, { "const": "tools", "description": "Tool contracts and capability descriptions.", "type": "string" }] }, "PlanLane": { "additionalProperties": false, "description": "One standard lane in a deterministic context plan.", "properties": { "budget_tokens": { "description": "Exact token budget for this lane.", "format": "uint32", "minimum": 0, "type": "integer" }, "candidate_versions": { "description": "Sorted unique candidate semantic versions assigned to the lane.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "kind": { "$ref": "#/$defs/LaneKind", "description": "Lane kind." } }, "required": ["kind", "budget_tokens", "candidate_versions"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ContextPlanResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Persisted plan-backed compile output returned by planning.", "properties": { "bundle_id": { "description": "Bundle already compiled and persisted from the plan.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "manifest_digest": { "description": "Complete protected manifest digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "plan": { "$ref": "#/$defs/ContextPlan", "description": "Deterministic context plan." } }, "required": ["plan", "bundle_id", "manifest_digest"], "title": "ContextPlanResponse", "type": "object" });
265
+ export const CreateContextPlanRequest = payloadModel("CreateContextPlanRequest", { "$defs": { "AtomKind": { "description": "Closed semantic atom kind registry for v1.", "oneOf": [{ "const": "instruction", "description": "Governed instruction content.", "type": "string" }, { "const": "source_code", "description": "Exact source code.", "type": "string" }, { "const": "documentation", "description": "Human-facing documentation.", "type": "string" }, { "const": "decision", "description": "Durable decision or rationale.", "type": "string" }, { "const": "conversation", "description": "Conversation-derived context.", "type": "string" }, { "const": "tool_result", "description": "Tool observation or result.", "type": "string" }, { "const": "schema", "description": "Machine-readable schema.", "type": "string" }, { "const": "policy", "description": "Policy source material.", "type": "string" }, { "const": "test", "description": "Test or verification material.", "type": "string" }, { "const": "artifact", "description": "Build or release artifact metadata.", "type": "string" }] }, "Budget": { "additionalProperties": false, "description": "Exact integer token budget and lane allocation.", "properties": { "lane_input_tokens": { "additionalProperties": { "format": "uint32", "minimum": 0, "type": "integer" }, "description": "Exact input allocation by standard lane.", "maxProperties": 5, "minProperties": 1, "type": "object" }, "output_reserve_tokens": { "description": "Output tokens reserved at the target consumer.", "format": "uint32", "minimum": 0, "type": "integer" }, "total_input_tokens": { "description": "Total physical input-token maximum.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["total_input_tokens", "output_reserve_tokens", "lane_input_tokens"], "type": "object" }, "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ConsistencyMode": { "description": "Closed catalog/index consistency modes.", "oneOf": [{ "const": "snapshot", "description": "Require the requested immutable snapshot exactly.", "type": "string" }, { "const": "strong", "description": "Require indexes caught up to the current catalog watermark.", "type": "string" }, { "const": "bounded_staleness", "description": "Permit bounded index staleness described by the contract.", "type": "string" }] }, "ContextContract": { "additionalProperties": false, "description": "Canonical normalized input to deterministic context compilation.", "properties": { "budget": { "$ref": "#/$defs/Budget", "description": "Exact input and output budget." }, "consistency": { "$ref": "#/$defs/ConsistencyMode", "description": "Catalog/index consistency mode." }, "context_space_id": { "description": "Context space when compiling from a branch or overlay.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "job_goal": { "description": "Human job goal; normalized before this record is hashed.", "maxLength": 65536, "minLength": 1, "type": "string" }, "maximum_staleness": { "description": "Maximum permitted staleness for bounded-staleness mode only.", "format": "uint64", "maximum": 315576000000000000, "minimum": 0, "type": "integer" }, "operation_class": { "$ref": "#/$defs/OperationClass", "description": "Capability-relevant operation class." }, "principal_id": { "description": "Authenticated principal identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "project_ids": { "description": "Sorted unique project scope; may be empty only with a context space.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 256, "type": "array" }, "purpose": { "description": "Declared use purpose.", "maxLength": 512, "minLength": 1, "type": "string" }, "requirements": { "description": "Required semantic context selectors.", "items": { "$ref": "#/$defs/ContextRequirement" }, "maxItems": 1024, "type": "array" }, "schema_version": { "description": "Must be `cigar.context-contract.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "target": { "$ref": "#/$defs/TargetProfile", "description": "Target consumer compatibility profile." } }, "required": ["schema_version", "job_goal", "operation_class", "principal_id", "purpose", "project_ids", "target", "budget", "requirements", "consistency", "extensions"], "type": "object" }, "ContextRequirement": { "additionalProperties": false, "description": "One semantic context requirement in a compilation contract.", "properties": { "blocking": { "description": "Whether missing authorized data blocks compilation.", "type": "boolean" }, "maximum_age": { "description": "Maximum observation age when temporal selection applies.", "format": "uint64", "maximum": 315576000000000000, "minimum": 0, "type": "integer" }, "minimum_authority": { "description": "Minimum accepted authority tier.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "minimum_coverage": { "description": "Minimum fixed-point source coverage.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "selector": { "$ref": "#/$defs/RequirementSelector", "description": "Exact or retrieval selector." }, "semantic_type": { "$ref": "#/$defs/AtomKind", "description": "Required semantic atom kind." } }, "required": ["semantic_type", "selector", "minimum_authority", "minimum_coverage", "blocking"], "type": "object" }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "OperationClass": { "description": "Closed operation classes used by capability and policy gates.", "oneOf": [{ "const": "read", "description": "Read-only context use.", "type": "string" }, { "const": "code_change", "description": "Local source or artifact modification.", "type": "string" }, { "const": "analysis", "description": "Analysis that must not dispatch mutations.", "type": "string" }, { "const": "external_mutation", "description": "Operation that may request a mediated external effect.", "type": "string" }] }, "RequirementSelector": { "description": "Exact or query selector for required semantic context.", "oneOf": [{ "additionalProperties": false, "description": "Require one exact immutable semantic version.", "properties": { "type": { "const": "exact", "type": "string" }, "value": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Execute a bounded authorized retrieval query.", "properties": { "type": { "const": "query", "type": "string" }, "value": { "maxLength": 16384, "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }] }, "TargetProfile": { "additionalProperties": false, "description": "Consumer, tokenizer, and materializer compatibility target.", "properties": { "materializer_fingerprint": { "description": "Immutable materializer implementation fingerprint.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "max_context_tokens": { "description": "Target context-window maximum.", "format": "uint32", "minimum": 0, "type": "integer" }, "model_family": { "description": "Model or consumer family identifier.", "maxLength": 256, "minLength": 1, "type": "string" }, "provider": { "description": "Provider family identifier.", "maxLength": 256, "minLength": 1, "type": "string" }, "tokenizer_fingerprint": { "description": "Immutable tokenizer implementation fingerprint.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["provider", "model_family", "tokenizer_fingerprint", "materializer_fingerprint", "max_context_tokens"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/CreateContextPlanRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Full planning request whose trusted frozen inputs are derived by the service.", "properties": { "contract": { "$ref": "#/$defs/ContextContract", "description": "Caller-authored context contract." } }, "required": ["contract"], "title": "CreateContextPlanRequest", "type": "object" });
266
+ export const CreateHandoffRequest = payloadModel("CreateHandoffRequest", { "$defs": { "Budget": { "additionalProperties": false, "description": "Exact integer token budget and lane allocation.", "properties": { "lane_input_tokens": { "additionalProperties": { "format": "uint32", "minimum": 0, "type": "integer" }, "description": "Exact input allocation by standard lane.", "maxProperties": 5, "minProperties": 1, "type": "object" }, "output_reserve_tokens": { "description": "Output tokens reserved at the target consumer.", "format": "uint32", "minimum": 0, "type": "integer" }, "total_input_tokens": { "description": "Total physical input-token maximum.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["total_input_tokens", "output_reserve_tokens", "lane_input_tokens"], "type": "object" }, "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] }, "CoordinationTopic": { "description": "Closed subscription topics declared by a handoff.", "oneOf": [{ "const": "atom_invalidation", "description": "Atom invalidation events.", "type": "string" }, { "const": "bundle_invalidation", "description": "Bundle invalidation events.", "type": "string" }, { "const": "task_checkpoint", "description": "Task checkpoint events.", "type": "string" }, { "const": "handoff_revocation", "description": "Handoff revocation events.", "type": "string" }, { "const": "effect_state", "description": "Effect state changes.", "type": "string" }, { "const": "policy_snapshot", "description": "Policy snapshot changes.", "type": "string" }] }, "HandoffReferences": { "additionalProperties": false, "description": "Typed references carried by a handoff instead of a parent transcript.", "properties": { "artifacts": { "description": "Sorted artifact references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "decisions": { "description": "Sorted decision references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "effects": { "description": "Sorted effect journal record references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "sources": { "description": "Sorted source version references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "states": { "description": "Sorted task-state references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "uncertainties": { "description": "Sorted uncertainty references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" } }, "required": ["sources", "states", "decisions", "artifacts", "uncertainties", "effects"], "type": "object" }, "RecipientSelector": { "description": "Recipient selector bound into a handoff capsule.", "oneOf": [{ "additionalProperties": false, "description": "Exact recipient principal.", "properties": { "type": { "const": "principal", "type": "string" }, "value": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded recipient role resolved again during acceptance.", "properties": { "type": { "const": "role", "type": "string" }, "value": { "maxLength": 512, "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/CreateHandoffRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Caller-authored handoff draft excluding authority, clock, key, and nonce fields.", "properties": { "acceptance_criteria": { "description": "Bounded acceptance criteria.", "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, "maxItems": 256, "minItems": 1, "type": "array" }, "audience": { "description": "Runtime audience selector.", "maxLength": 256, "minLength": 1, "type": "string" }, "budget": { "$ref": "#/$defs/Budget", "description": "Recipient compilation ceiling." }, "bundle_id": { "description": "Source bundle identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "recipient": { "$ref": "#/$defs/RecipientSelector", "description": "Intended principal or role." }, "references": { "$ref": "#/$defs/HandoffReferences", "description": "Typed references only." }, "requested_capabilities": { "description": "Sorted requested capabilities.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "requested_projects": { "description": "Sorted requested project scope.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 64, "type": "array" }, "reusable": { "description": "Whether multiple acceptances are requested.", "type": "boolean" }, "task": { "description": "Bounded task statement.", "maxLength": 4096, "minLength": 1, "type": "string" }, "topics": { "description": "Sorted requested event topics.", "items": { "$ref": "#/$defs/CoordinationTopic" }, "maxItems": 64, "type": "array" }, "ttl_seconds": { "description": "Requested lifetime from server observation time.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["recipient", "task", "acceptance_criteria", "requested_projects", "requested_capabilities", "budget", "topics", "references", "bundle_id", "audience", "ttl_seconds", "reusable"], "title": "CreateHandoffRequest", "type": "object" });
267
+ export const CreateHandoffResponse = payloadModel("CreateHandoffResponse", { "$defs": { "Budget": { "additionalProperties": false, "description": "Exact integer token budget and lane allocation.", "properties": { "lane_input_tokens": { "additionalProperties": { "format": "uint32", "minimum": 0, "type": "integer" }, "description": "Exact input allocation by standard lane.", "maxProperties": 5, "minProperties": 1, "type": "object" }, "output_reserve_tokens": { "description": "Output tokens reserved at the target consumer.", "format": "uint32", "minimum": 0, "type": "integer" }, "total_input_tokens": { "description": "Total physical input-token maximum.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["total_input_tokens", "output_reserve_tokens", "lane_input_tokens"], "type": "object" }, "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] }, "CoordinationTopic": { "description": "Closed subscription topics declared by a handoff.", "oneOf": [{ "const": "atom_invalidation", "description": "Atom invalidation events.", "type": "string" }, { "const": "bundle_invalidation", "description": "Bundle invalidation events.", "type": "string" }, { "const": "task_checkpoint", "description": "Task checkpoint events.", "type": "string" }, { "const": "handoff_revocation", "description": "Handoff revocation events.", "type": "string" }, { "const": "effect_state", "description": "Effect state changes.", "type": "string" }, { "const": "policy_snapshot", "description": "Policy snapshot changes.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "HandoffCapsule": { "additionalProperties": false, "description": "Signed portable handoff capsule.", "properties": { "acceptance_criteria": { "description": "Bounded acceptance criteria.", "items": { "maxLength": 65536, "minLength": 1, "type": "string" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "audience": { "description": "Signed audience identifier.", "maxLength": 512, "minLength": 1, "type": "string" }, "budget": { "$ref": "#/$defs/Budget", "description": "Recipient compilation budget ceiling." }, "bundle_id": { "description": "Issuer bundle at handoff creation.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "created_at": { "description": "Capsule creation time.", "format": "date-time", "type": "string" }, "delegated_capabilities": { "description": "Sorted attenuated capabilities delegated by the issuer.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 128, "type": "array" }, "expires_at": { "description": "Exclusive capsule expiry.", "format": "date-time", "type": "string" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "handoff_id": { "description": "Unique capsule identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "issuer_id": { "description": "Issuing principal.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "issuer_key_id": { "description": "Issuer signing-key identifier.", "maxLength": 512, "minLength": 1, "type": "string" }, "nonce": { "description": "Replay-protection nonce encoded as unpadded base64url in JSON.", "maxLength": 86, "minLength": 2, "type": "string" }, "project_ids": { "description": "Sorted exact project scope.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 256, "minItems": 1, "type": "array" }, "recipient": { "$ref": "#/$defs/RecipientSelector", "description": "Recipient selector and audience binding." }, "references": { "$ref": "#/$defs/HandoffReferences", "description": "Typed references; unrestricted transcript is intentionally absent." }, "rejected_capabilities": { "description": "Sorted requested capabilities rejected during creation.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 128, "type": "array" }, "reusable": { "description": "Whether multiple valid acceptances are permitted.", "type": "boolean" }, "schema_version": { "description": "Must be `cigar.handoff.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "signature": { "description": "Ed25519 signature bytes populated by WP02.", "maxLength": 683, "minLength": 2, "type": "string" }, "task": { "description": "Bounded task statement.", "maxLength": 65536, "minLength": 1, "type": "string" }, "topics": { "description": "Sorted declared subscription topics.", "items": { "$ref": "#/$defs/CoordinationTopic" }, "maxItems": 32, "type": "array" } }, "required": ["schema_version", "handoff_id", "issuer_id", "recipient", "task", "acceptance_criteria", "project_ids", "delegated_capabilities", "rejected_capabilities", "budget", "topics", "references", "bundle_id", "audience", "created_at", "expires_at", "nonce", "reusable", "issuer_key_id", "signature", "extensions"], "type": "object" }, "HandoffPreviewResponse": { "additionalProperties": false, "description": "Exact disclosure and attenuation preview for an existing handoff.", "properties": { "accepted_capabilities": { "description": "Capabilities retained after attenuation.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "accepted_projects": { "description": "Projects retained after attenuation.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 64, "type": "array" }, "handoff_id": { "description": "Persisted handoff identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "reference_count": { "description": "Typed reference count.", "format": "uint32", "minimum": 0, "type": "integer" }, "rejected_capabilities": { "description": "Capabilities rejected during attenuation.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "rejected_projects": { "description": "Projects rejected without content disclosure.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 64, "type": "array" } }, "required": ["handoff_id", "accepted_projects", "rejected_projects", "accepted_capabilities", "rejected_capabilities", "reference_count"], "type": "object" }, "HandoffReferences": { "additionalProperties": false, "description": "Typed references carried by a handoff instead of a parent transcript.", "properties": { "artifacts": { "description": "Sorted artifact references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "decisions": { "description": "Sorted decision references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "effects": { "description": "Sorted effect journal record references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "sources": { "description": "Sorted source version references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "states": { "description": "Sorted task-state references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" }, "uncertainties": { "description": "Sorted uncertainty references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" } }, "required": ["sources", "states", "decisions", "artifacts", "uncertainties", "effects"], "type": "object" }, "RecipientSelector": { "description": "Recipient selector bound into a handoff capsule.", "oneOf": [{ "additionalProperties": false, "description": "Exact recipient principal.", "properties": { "type": { "const": "principal", "type": "string" }, "value": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded recipient role resolved again during acceptance.", "properties": { "type": { "const": "role", "type": "string" }, "value": { "maxLength": 512, "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/CreateHandoffResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Signed handoff and its disclosure preview.", "properties": { "capsule": { "$ref": "#/$defs/HandoffCapsule", "description": "Persisted signed capsule." }, "preview": { "$ref": "#/$defs/HandoffPreviewResponse", "description": "Disclosure-safe attenuation preview." } }, "required": ["capsule", "preview"], "title": "CreateHandoffResponse", "type": "object" });
268
+ export const CreateReplayRequest = payloadModel("CreateReplayRequest", { "$defs": { "ReplayMode": { "description": "Closed replay execution mode.", "oneOf": [{ "const": "evidence_reproduction", "description": "Verify retained source, policy, index, manifest, and bundle evidence.", "type": "string" }, { "const": "invocation_reproduction", "description": "Reconstruct exact declared invocation without invoking dependencies.", "type": "string" }, { "const": "observational", "description": "Substitute recorded observations under denied egress.", "type": "string" }, { "const": "live_comparison", "description": "Invoke configured dependencies as a new explicitly authorized execution.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/CreateReplayRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Replay job creation input excluding requester identity and live authorization proof.", "properties": { "decision_id": { "description": "Source decision to reconstruct.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "mode": { "$ref": "#/$defs/ReplayMode", "description": "Requested replay mode." }, "simulate_effects": { "description": "Whether all effects remain simulated.", "type": "boolean" } }, "required": ["decision_id", "mode", "simulate_effects"], "title": "CreateReplayRequest", "type": "object" });
269
+ export const CreateSpaceRequest = payloadModel("CreateSpaceRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/CreateSpaceRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Caller-controlled context-space hierarchy excluding the server-derived tenant and author.", "properties": { "branch_id": { "description": "Branch or worktree identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "project_id": { "description": "Active project identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "purpose": { "description": "Bounded semantic purpose.", "maxLength": 4096, "minLength": 1, "type": "string" }, "session_id": { "description": "Session identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "task_id": { "description": "Task identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "workspace_id": { "description": "Workspace identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["workspace_id", "project_id", "branch_id", "task_id", "session_id", "purpose"], "title": "CreateSpaceRequest", "type": "object" });
270
+ export const DiagnosticsResponse = payloadModel("DiagnosticsResponse", { "$defs": { "DiagnosticCounter": { "additionalProperties": false, "description": "One explicitly typed public telemetry counter.", "properties": { "name": { "description": "Stable public metric name.", "maxLength": 128, "minLength": 1, "type": "string" }, "value": { "description": "Monotonic or point-in-time unsigned value.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["name", "value"], "type": "object" }, "QueueDiagnostic": { "additionalProperties": false, "description": "One bounded content-free worker queue diagnostic.", "properties": { "capacity": { "description": "Fixed queue capacity.", "format": "uint32", "minimum": 0, "type": "integer" }, "depth": { "description": "Current queue depth.", "format": "uint32", "minimum": 0, "type": "integer" }, "name": { "description": "Stable queue name.", "maxLength": 64, "minLength": 1, "type": "string" }, "rejected": { "description": "Rejected enqueue count.", "format": "uint64", "minimum": 0, "type": "integer" }, "worker_healthy": { "description": "Whether a worker heartbeat is currently healthy.", "type": "boolean" } }, "required": ["name", "capacity", "depth", "rejected", "worker_healthy"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/DiagnosticsResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Content-safe bounded diagnostic response.", "properties": { "counters": { "description": "Sorted stable public telemetry counters.", "items": { "$ref": "#/$defs/DiagnosticCounter" }, "maxItems": 512, "type": "array" }, "queues": { "description": "Sorted queue diagnostics.", "items": { "$ref": "#/$defs/QueueDiagnostic" }, "maxItems": 64, "type": "array" }, "ready": { "description": "Whether request admission is currently open.", "type": "boolean" } }, "required": ["ready", "queues", "counters"], "title": "DiagnosticsResponse", "type": "object" });
271
+ export const DiscoverSourcesRequest = payloadModel("DiscoverSourcesRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/DiscoverSourcesRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Bounded source-discovery request; roots and policy remain server-owned.", "properties": { "include_paths": { "description": "Sorted source-relative paths requested as policy-subordinate overrides.", "items": { "contentEncoding": "base64url", "description": "Unpadded base64url encoding of 1..=4096 relative-path bytes; decoded bytes must be non-absolute and NUL-free.", "maxLength": 5462, "minLength": 2, "type": "string" }, "maxItems": 1024, "type": "array" }, "source_id": { "description": "Persisted source configuration selected by the caller.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["source_id", "include_paths"], "title": "DiscoverSourcesRequest", "type": "object" });
272
+ export const DiscoveryPlanResponse = payloadModel("DiscoveryPlanResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/DiscoveryPlanResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Disclosure-safe discovery result.", "properties": { "included_bytes": { "description": "Eligible aggregate source bytes.", "format": "uint64", "minimum": 0, "type": "integer" }, "included_count": { "description": "Eligible source item count.", "format": "uint64", "minimum": 0, "type": "integer" }, "plan_digest": { "description": "Exact normalized discovery-plan digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "source_id": { "description": "Persisted source configuration.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["source_id", "included_count", "included_bytes", "plan_digest"], "title": "DiscoveryPlanResponse", "type": "object" });
273
+ export const EffectIdRequest = payloadModel("EffectIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/EffectIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one durable effect.", "properties": { "effect_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["effect_id"], "title": "EffectIdRequest", "type": "object" });
274
+ export const EffectStatusResponse = payloadModel("EffectStatusResponse", { "$defs": { "EffectState": { "description": "Closed effect journal projection states.", "oneOf": [{ "const": "prepared", "description": "Durable intent exists and no external action occurred.", "type": "string" }, { "const": "pending_approval", "description": "Intent is waiting for required approval.", "type": "string" }, { "const": "authorized", "description": "Current policy, capability, and approval authorize dispatch.", "type": "string" }, { "const": "dispatching", "description": "An approved worker owns a durable fenced attempt.", "type": "string" }, { "const": "succeeded", "description": "Connector and verification confirm success.", "type": "string" }, { "const": "failed", "description": "Connector or reconciliation confirms failure.", "type": "string" }, { "const": "unknown", "description": "Remote execution outcome is ambiguous.", "type": "string" }, { "const": "authorized_for_retry", "description": "Reconciliation proved that another same-key attempt is safe.", "type": "string" }, { "const": "manual_resolution", "description": "A human or authoritative external record resolved ambiguity.", "type": "string" }, { "const": "rejected", "description": "Approval was explicitly rejected.", "type": "string" }, { "const": "expired", "description": "Approval or intent expired before dispatch.", "type": "string" }, { "const": "cancelled", "description": "Intent was cancelled before an irreversible transition.", "type": "string" }, { "const": "compensation_pending", "description": "Compensation was requested for a succeeded effect.", "type": "string" }, { "const": "compensating", "description": "A fenced compensation attempt is in flight.", "type": "string" }, { "const": "compensated", "description": "Compensation is confirmed complete.", "type": "string" }, { "const": "compensation_failed", "description": "Compensation is confirmed failed.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/EffectStatusResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Disclosure-safe current effect projection.", "properties": { "attempt_count": { "description": "Number of durable dispatch attempts.", "format": "uint32", "minimum": 0, "type": "integer" }, "effect_id": { "description": "Logical effect identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "effect_version": { "description": "Monotonic effect version.", "format": "uint64", "minimum": 0, "type": "integer" }, "intent_digest": { "description": "Exact intent digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "reconciliation_count": { "description": "Number of reconciliation observations.", "format": "uint32", "minimum": 0, "type": "integer" }, "state": { "$ref": "#/$defs/EffectState", "description": "Current closed state." } }, "required": ["effect_id", "state", "effect_version", "intent_digest", "attempt_count", "reconciliation_count"], "title": "EffectStatusResponse", "type": "object" });
275
+ export const EmptyRequest = payloadModel("EmptyRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/EmptyRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Exact empty-map request used by operational methods.", "title": "EmptyRequest", "type": "object" });
276
+ export const ExplainContextBundleRequest = payloadModel("ExplainContextBundleRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/ExplainContextBundleRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Disclosure-filtered bundle explanation query.", "properties": { "bundle_id": { "description": "Immutable bundle addressed by the route.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "version_ids": { "description": "Sorted candidate versions the caller asks to explain; authorization is re-derived.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1000, "type": "array" } }, "required": ["bundle_id", "version_ids"], "title": "ExplainContextBundleRequest", "type": "object" });
277
+ export const ForkSpaceRequest = payloadModel("ForkSpaceRequest", { "$defs": { "SpaceFork": { "description": "Closed kind of context-space fork.", "oneOf": [{ "additionalProperties": false, "description": "Creates a private overlay over one exact immutable base.", "properties": { "base_commit_id": { "description": "Exact merge base.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "kind": { "const": "private_overlay", "type": "string" }, "ttl_seconds": { "description": "Requested bounded lifetime from server observation time.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["kind", "base_commit_id", "ttl_seconds"], "type": "object" }, { "additionalProperties": false, "description": "Creates a resumable focus branch.", "properties": { "focus_id": { "description": "Caller-selected focus identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "const": "focus_branch", "type": "string" }, "label": { "description": "Bounded display label.", "maxLength": 256, "minLength": 1, "type": "string" }, "offline": { "description": "Whether the new focus begins offline.", "type": "boolean" } }, "required": ["kind", "focus_id", "label", "offline"], "type": "object" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ForkSpaceRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Tagged private-overlay or focus-branch fork request.", "properties": { "fork": { "$ref": "#/$defs/SpaceFork", "description": "Closed fork specification." }, "space_id": { "description": "Context space addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id", "fork"], "title": "ForkSpaceRequest", "type": "object" });
278
+ export const HandoffAcceptance = payloadModel("HandoffAcceptance", { "$defs": { "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/HandoffAcceptance.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Persisted recipient-specific handoff acceptance receipt.", "properties": { "acceptance_id": { "description": "Unique acceptance identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "accepted_at": { "description": "Acceptance time.", "format": "date-time", "type": "string" }, "accepted_capabilities": { "description": "Sorted capabilities accepted after current-policy reauthorization.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 128, "type": "array" }, "acknowledgement_digest": { "description": "Recipient acknowledgement digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "bundle_id": { "description": "Recipient-specific bundle identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "handoff_id": { "description": "Accepted capsule identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "policy_digest": { "description": "Current policy decision digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "recipient_id": { "description": "Actual authenticated recipient.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "rejected_capabilities": { "description": "Sorted capabilities rejected at acceptance.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 128, "type": "array" }, "schema_version": { "description": "Must be `cigar.handoff-acceptance.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "unavailable_references": { "description": "Sorted inaccessible references without content disclosure.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "type": "array" } }, "required": ["schema_version", "acceptance_id", "handoff_id", "recipient_id", "accepted_capabilities", "rejected_capabilities", "unavailable_references", "policy_digest", "bundle_id", "accepted_at", "acknowledgement_digest"], "title": "HandoffAcceptance", "type": "object" });
279
+ export const HandoffIdRequest = payloadModel("HandoffIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/HandoffIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one persisted handoff.", "properties": { "handoff_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["handoff_id"], "title": "HandoffIdRequest", "type": "object" });
280
+ export const HandoffMergeResponse = payloadModel("HandoffMergeResponse", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextCommit": { "additionalProperties": false, "description": "Immutable context-space commit.", "properties": { "author_id": { "description": "Authenticated author.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "commit_id": { "description": "Content-derived commit identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "committed_at": { "description": "Commit time.", "format": "date-time", "type": "string" }, "events": { "description": "Ordered immutable events.", "items": { "$ref": "#/$defs/CoordinationEvent" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "parent_commit_id": { "description": "Parent commit, absent only for sequence one.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "policy_snapshot_digest": { "description": "Policy snapshot used for publication.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 65536, "minLength": 1, "type": "string" }, "root_digest": { "description": "Resulting context-space root digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-commit.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "sequence": { "description": "Monotonic sequence beginning at one.", "format": "uint64", "minimum": 0, "type": "integer" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["schema_version", "commit_id", "space_id", "sequence", "author_id", "purpose", "events", "root_digest", "policy_snapshot_digest", "committed_at", "extensions"], "type": "object" }, "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/HandoffMergeResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Result of proposing and publishing a recorded handoff delta.", "properties": { "commit": { "anyOf": [{ "$ref": "#/$defs/ContextCommit" }], "description": "New or deduplicated parent commit when publication completed." }, "conflict_ids": { "description": "Conflicts retained for typed resolution.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "delta_id": { "description": "Recorded delta identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "proposed_versions": { "description": "Versions proposed into the parent overlay.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "rejected_versions": { "description": "Versions rejected by current authorization.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" } }, "required": ["delta_id", "proposed_versions", "rejected_versions", "conflict_ids"], "title": "HandoffMergeResponse", "type": "object" });
281
+ export const HandoffPreviewResponse = payloadModel("HandoffPreviewResponse", { "$defs": { "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/HandoffPreviewResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Exact disclosure and attenuation preview for an existing handoff.", "properties": { "accepted_capabilities": { "description": "Capabilities retained after attenuation.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "accepted_projects": { "description": "Projects retained after attenuation.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 64, "type": "array" }, "handoff_id": { "description": "Persisted handoff identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "reference_count": { "description": "Typed reference count.", "format": "uint32", "minimum": 0, "type": "integer" }, "rejected_capabilities": { "description": "Capabilities rejected during attenuation.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "rejected_projects": { "description": "Projects rejected without content disclosure.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 64, "type": "array" } }, "required": ["handoff_id", "accepted_projects", "rejected_projects", "accepted_capabilities", "rejected_capabilities", "reference_count"], "title": "HandoffPreviewResponse", "type": "object" });
282
+ export const HandoffResultReceipt = payloadModel("HandoffResultReceipt", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/HandoffResultReceipt.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Receipt for one immutable child result.", "properties": { "delta_id": { "description": "Persisted child-result identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "handoff_id": { "description": "Owning handoff identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "result_digest": { "description": "Exact result digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "revision": { "description": "Durable revision after publication.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["delta_id", "handoff_id", "result_digest", "revision"], "title": "HandoffResultReceipt", "type": "object" });
283
+ export const IngestCatalogRequest = payloadModel("IngestCatalogRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/IngestCatalogRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Source ingestion request bound to one accepted discovery plan.", "properties": { "plan_digest": { "description": "Exact discovery-plan digest accepted by the caller.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "source_id": { "description": "Persisted source configuration.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["source_id", "plan_digest"], "title": "IngestCatalogRequest", "type": "object" });
284
+ export const IngestionReceiptResponse = payloadModel("IngestionReceiptResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/IngestionReceiptResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Content-safe ingestion publication result.", "properties": { "publication_digest": { "description": "Exact publication digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "published_atoms": { "description": "Newly published atom versions.", "format": "uint64", "minimum": 0, "type": "integer" }, "revision": { "description": "Repository revision after publication.", "format": "uint64", "minimum": 0, "type": "integer" }, "snapshot_id": { "description": "Published immutable snapshot identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "tombstoned_atoms": { "description": "Newly published tombstones.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["revision", "snapshot_id", "published_atoms", "tombstoned_atoms", "publication_digest"], "title": "IngestionReceiptResponse", "type": "object" });
285
+ export const LivenessResponse = payloadModel("LivenessResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/LivenessResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Content-free liveness response.", "properties": { "live": { "description": "True while the process event loop can serve requests.", "type": "boolean" } }, "required": ["live"], "title": "LivenessResponse", "type": "object" });
286
+ export const MaterializationResponse = payloadModel("MaterializationResponse", { "$defs": { "MaterializedContext": { "additionalProperties": false, "description": "Provider-ready bytes with exact tokenizer and materializer evidence.", "properties": { "bundle_id": { "description": "Source bundle identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "bytes": { "description": "Provider-ready bytes encoded as unpadded base64url in JSON.", "maxLength": 89478486, "minLength": 2, "type": "string" }, "materializer_fingerprint": { "description": "Materializer fingerprint used for rendering.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "media_type": { "description": "Target media type.", "maxLength": 255, "minLength": 3, "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$", "type": "string" }, "schema_version": { "description": "Must be `cigar.materialized-context.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "token_count": { "description": "Exact physical tokens under the recorded tokenizer.", "format": "uint32", "minimum": 0, "type": "integer" }, "tokenizer_fingerprint": { "description": "Tokenizer fingerprint used for accounting.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["schema_version", "bundle_id", "media_type", "bytes", "token_count", "tokenizer_fingerprint", "materializer_fingerprint"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/MaterializationResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Exact materialization plus physical token accounting.", "properties": { "context": { "$ref": "#/$defs/MaterializedContext", "description": "Provider-ready immutable materialization." }, "physical_input_tokens": { "description": "Exact physical input tokens.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["context", "physical_input_tokens"], "title": "MaterializationResponse", "type": "object" });
287
+ export const MaterializeContextBundleRequest = payloadModel("MaterializeContextBundleRequest", { "$defs": { "MaterializationProfile": { "description": "Closed materialization profile exposed by the v1 service boundary.", "oneOf": [{ "const": "canonical_json", "description": "Canonical structured JSON materialization.", "type": "string" }, { "const": "claude_prompt", "description": "Claude-compatible structured prompt materialization.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/MaterializeContextBundleRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Materialization request over one retained bundle.", "properties": { "bundle_id": { "description": "Immutable bundle addressed by the route.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "profile": { "$ref": "#/$defs/MaterializationProfile", "description": "Closed requested framing profile." } }, "required": ["bundle_id", "profile"], "title": "MaterializeContextBundleRequest", "type": "object" });
288
+ export const MergeHandoffRequest = payloadModel("MergeHandoffRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/MergeHandoffRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request merging one previously recorded child result.", "properties": { "delta_id": { "description": "Persisted child-result identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "handoff_id": { "description": "Handoff addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "overlay_id": { "description": "Parent owner-private overlay.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "space_id": { "description": "Parent context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["handoff_id", "delta_id", "space_id", "overlay_id"], "title": "MergeHandoffRequest", "type": "object" });
289
+ export const MetricsResponse = payloadModel("MetricsResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/MetricsResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Bounded OpenMetrics response shared by embedded and network modes.", "properties": { "media_type": { "description": "Exact OpenMetrics media type.", "maxLength": 128, "minLength": 1, "type": "string" }, "text": { "description": "Content-safe OpenMetrics text exposition.", "maxLength": 16777216, "type": "string" } }, "required": ["media_type", "text"], "title": "MetricsResponse", "type": "object" });
290
+ export const MutationReceipt = payloadModel("MutationReceipt", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/MutationReceipt.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Content-safe receipt for a durable mutation.", "properties": { "replayed": { "description": "Whether the exact idempotent result was replayed.", "type": "boolean" }, "resource_id": { "description": "Logical resource changed by the mutation.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "revision": { "description": "Monotonic durable revision after the change.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["resource_id", "revision", "replayed"], "title": "MutationReceipt", "type": "object" });
291
+ export const PrepareEffectRequest = payloadModel("PrepareEffectRequest", { "$defs": { "BlobRef": { "additionalProperties": false, "description": "Reference to encrypted content-addressed payload bytes.", "properties": { "digest": { "description": "Exact content digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "media_type": { "description": "Payload media type.", "maxLength": 255, "minLength": 3, "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$", "type": "string" }, "size_bytes": { "description": "Plaintext payload size before encryption.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["digest", "size_bytes", "media_type"], "type": "object" }, "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] }, "CompensationSpec": { "additionalProperties": false, "description": "Optional compensation operation bound into an original effect intent.", "properties": { "arguments_digest": { "description": "Digest of normalized compensation arguments.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "encrypted_arguments": { "$ref": "#/$defs/BlobRef", "description": "Protected compensation arguments." }, "operation": { "description": "Connector operation used for compensation.", "maxLength": 1024, "minLength": 1, "type": "string" } }, "required": ["operation", "arguments_digest", "encrypted_arguments"], "type": "object" }, "RetryPolicy": { "description": "Closed safe retry strategies declared at intent creation.", "oneOf": [{ "additionalProperties": false, "description": "Never redispatch automatically.", "properties": { "type": { "const": "never", "type": "string" } }, "required": ["type"], "type": "object" }, { "additionalProperties": false, "description": "Connector guarantees same-key idempotency for a bounded number of attempts.", "properties": { "max_attempts": { "description": "Maximum total dispatch attempts including the first.", "format": "uint16", "maximum": 65535, "minimum": 1, "type": "integer" }, "type": { "const": "same_key_idempotent", "type": "string" } }, "required": ["type", "max_attempts"], "type": "object" }, { "additionalProperties": false, "description": "Reconciliation must prove non-execution before a retry authorization.", "properties": { "type": { "const": "reconcile_before_retry", "type": "string" } }, "required": ["type"], "type": "object" }] }, "RiskLevel": { "description": "Closed effect risk classification.", "oneOf": [{ "const": "low", "description": "Reversible low-impact mutation.", "type": "string" }, { "const": "medium", "description": "Bounded mutation with material consequences.", "type": "string" }, { "const": "high", "description": "High-impact or difficult-to-reverse mutation.", "type": "string" }, { "const": "critical", "description": "Critical irreversible or security-sensitive mutation.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/PrepareEffectRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Caller-authored effect intent excluding clocks, actor authority, and dispatch permits.", "properties": { "arguments_digest": { "description": "Digest of normalized arguments.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "bundle_id": { "description": "Source context bundle.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "compensation": { "anyOf": [{ "$ref": "#/$defs/CompensationSpec" }], "description": "Optional separately authorized compensation description." }, "connector": { "description": "Registered connector selector.", "maxLength": 256, "minLength": 1, "type": "string" }, "encrypted_arguments": { "$ref": "#/$defs/BlobRef", "description": "Protected normalized argument reference." }, "idempotency_scope": { "description": "Normalized connector idempotency scope.", "maxLength": 256, "minLength": 1, "type": "string" }, "operation": { "description": "Connector operation selector.", "maxLength": 256, "minLength": 1, "type": "string" }, "preconditions": { "description": "Sorted precondition digests.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 256, "type": "array" }, "required_capability": { "$ref": "#/$defs/Capability", "description": "Capability the service must verify at authorization and dispatch." }, "result_schema_digest": { "description": "Expected result schema digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "retry_policy": { "$ref": "#/$defs/RetryPolicy", "description": "Safe retry strategy." }, "risk": { "$ref": "#/$defs/RiskLevel", "description": "Risk classification." }, "source_decision_id": { "description": "Source decision record.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "target": { "description": "Bounded target selector.", "maxLength": 256, "minLength": 1, "type": "string" }, "ttl_seconds": { "description": "Requested lifetime from server observation time.", "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["connector", "operation", "arguments_digest", "encrypted_arguments", "target", "preconditions", "result_schema_digest", "risk", "source_decision_id", "bundle_id", "required_capability", "idempotency_scope", "retry_policy", "ttl_seconds"], "title": "PrepareEffectRequest", "type": "object" });
292
+ export const PublishSpaceRequest = payloadModel("PublishSpaceRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/PublishSpaceRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Optimistic overlay publication request.", "properties": { "overlay_id": { "description": "Exact owner-private overlay.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 4096, "minLength": 1, "type": "string" }, "space_id": { "description": "Context space addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id", "overlay_id", "purpose"], "title": "PublishSpaceRequest", "type": "object" });
293
+ export const QueryCatalogRequest = payloadModel("QueryCatalogRequest", { "$defs": { "AtomKind": { "description": "Closed semantic atom kind registry for v1.", "oneOf": [{ "const": "instruction", "description": "Governed instruction content.", "type": "string" }, { "const": "source_code", "description": "Exact source code.", "type": "string" }, { "const": "documentation", "description": "Human-facing documentation.", "type": "string" }, { "const": "decision", "description": "Durable decision or rationale.", "type": "string" }, { "const": "conversation", "description": "Conversation-derived context.", "type": "string" }, { "const": "tool_result", "description": "Tool observation or result.", "type": "string" }, { "const": "schema", "description": "Machine-readable schema.", "type": "string" }, { "const": "policy", "description": "Policy source material.", "type": "string" }, { "const": "test", "description": "Test or verification material.", "type": "string" }, { "const": "artifact", "description": "Build or release artifact metadata.", "type": "string" }] }, "ContextRequirement": { "additionalProperties": false, "description": "One semantic context requirement in a compilation contract.", "properties": { "blocking": { "description": "Whether missing authorized data blocks compilation.", "type": "boolean" }, "maximum_age": { "description": "Maximum observation age when temporal selection applies.", "format": "uint64", "maximum": 315576000000000000, "minimum": 0, "type": "integer" }, "minimum_authority": { "description": "Minimum accepted authority tier.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "minimum_coverage": { "description": "Minimum fixed-point source coverage.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "selector": { "$ref": "#/$defs/RequirementSelector", "description": "Exact or retrieval selector." }, "semantic_type": { "$ref": "#/$defs/AtomKind", "description": "Required semantic atom kind." } }, "required": ["semantic_type", "selector", "minimum_authority", "minimum_coverage", "blocking"], "type": "object" }, "RequirementSelector": { "description": "Exact or query selector for required semantic context.", "oneOf": [{ "additionalProperties": false, "description": "Require one exact immutable semantic version.", "properties": { "type": { "const": "exact", "type": "string" }, "value": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Execute a bounded authorized retrieval query.", "properties": { "type": { "const": "query", "type": "string" }, "value": { "maxLength": 16384, "minLength": 1, "type": "string" } }, "required": ["type", "value"], "type": "object" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/QueryCatalogRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Authorized catalog query inputs; authorization partitions remain server-owned.", "properties": { "max_results": { "description": "Caller ceiling, additionally capped by envelope and server limits.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "requirements": { "description": "Ordered context requirements to query.", "items": { "$ref": "#/$defs/ContextRequirement" }, "maxItems": 256, "minItems": 1, "type": "array" } }, "required": ["requirements", "max_results"], "title": "QueryCatalogRequest", "type": "object" });
294
+ export const ReadinessResponse = payloadModel("ReadinessResponse", { "$defs": { "ComponentHealth": { "additionalProperties": false, "description": "Content-safe component health observation.", "properties": { "name": { "description": "Stable component name.", "maxLength": 256, "minLength": 1, "type": "string" }, "reason": { "anyOf": [{ "$ref": "#/$defs/ErrorCode" }], "description": "Stable reason code when not healthy." }, "status": { "$ref": "#/$defs/HealthStatus", "description": "Current component status." } }, "required": ["name", "status"], "type": "object" }, "ErrorCode": { "description": "Stable closed public error codes. Numeric and transport mappings are frozen in `spec/errors`.", "oneOf": [{ "const": "INVALID_ARGUMENT", "description": "Caller input is structurally invalid.", "type": "string" }, { "const": "LIMIT_EXCEEDED", "description": "A named resource limit was exceeded.", "type": "string" }, { "const": "UNSUPPORTED_SCHEMA", "description": "Schema major or form is unsupported.", "type": "string" }, { "const": "UNKNOWN_PRINCIPAL", "description": "Authenticated principal is unknown.", "type": "string" }, { "const": "INVALID_CAPABILITY", "description": "Capability is malformed or insufficient.", "type": "string" }, { "const": "CAPABILITY_EXPIRED", "description": "Capability is expired.", "type": "string" }, { "const": "SOURCE_UNAVAILABLE", "description": "Source connector is unavailable.", "type": "string" }, { "const": "SNAPSHOT_INCOMPLETE", "description": "Source snapshot is incomplete.", "type": "string" }, { "const": "INTEGRITY_FAILURE", "description": "Integrity verification failed.", "type": "string" }, { "const": "INDEX_STALE", "description": "Index watermark is stale.", "type": "string" }, { "const": "INDEX_UNAVAILABLE", "description": "Required index is unavailable.", "type": "string" }, { "const": "CONSISTENCY_UNSATISFIED", "description": "Requested consistency could not be satisfied.", "type": "string" }, { "const": "POLICY_DENIED", "description": "Policy denied the operation.", "type": "string" }, { "const": "PROCESSOR_DENIED", "description": "Processor constraints denied the operation.", "type": "string" }, { "const": "INSTRUCTION_AUTHORITY_DENIED", "description": "Instruction authority was insufficient.", "type": "string" }, { "const": "BUDGET_UNSATISFIABLE", "description": "Required budget cannot be satisfied.", "type": "string" }, { "const": "MISSING_REQUIRED_CONTEXT", "description": "Required authorized context is missing.", "type": "string" }, { "const": "UNRESOLVED_CRITICAL_CONFLICT", "description": "Critical semantic conflict remains unresolved.", "type": "string" }, { "const": "DELTA_BASE_MISMATCH", "description": "Delta base does not match provider-present state.", "type": "string" }, { "const": "BUNDLE_INVALIDATED", "description": "Bundle was invalidated.", "type": "string" }, { "const": "REVISION_CONFLICT", "description": "Optimistic revision does not match.", "type": "string" }, { "const": "HANDOFF_EXPIRED", "description": "Handoff expired.", "type": "string" }, { "const": "HANDOFF_RECIPIENT_MISMATCH", "description": "Handoff recipient does not match.", "type": "string" }, { "const": "APPROVAL_REQUIRED", "description": "Effect requires approval.", "type": "string" }, { "const": "APPROVAL_STALE", "description": "Approval no longer binds current semantics or time.", "type": "string" }, { "const": "EFFECT_UNKNOWN", "description": "External effect outcome is unknown.", "type": "string" }, { "const": "UNSAFE_RETRY", "description": "Effect cannot be safely retried.", "type": "string" }, { "const": "REPLAY_INCOMPLETE", "description": "Replay lacks required dependencies.", "type": "string" }, { "const": "DEPENDENCY_UNAVAILABLE", "description": "Named dependency is unavailable.", "type": "string" }, { "const": "LIVE_AUTHORIZATION_REQUIRED", "description": "Live operation requires explicit new authorization.", "type": "string" }, { "const": "RATE_LIMITED", "description": "Request rate limit was reached.", "type": "string" }, { "const": "DEADLINE_EXCEEDED", "description": "Request deadline elapsed.", "type": "string" }, { "const": "DEPENDENCY_DEGRADED", "description": "Dependency is degraded.", "type": "string" }, { "const": "INTERNAL", "description": "Internal error hidden behind a correlation ID.", "type": "string" }] }, "HealthReport": { "additionalProperties": false, "description": "Aggregate service health report.", "properties": { "components": { "description": "Sorted unique component observations.", "items": { "$ref": "#/$defs/ComponentHealth" }, "maxItems": 256, "type": "array" }, "observed_at": { "description": "Observation time.", "format": "date-time", "type": "string" }, "schema_version": { "description": "Must be `cigar.health-report.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "status": { "$ref": "#/$defs/HealthStatus", "description": "Aggregate status equal to the worst component status." } }, "required": ["schema_version", "status", "components", "observed_at"], "type": "object" }, "HealthStatus": { "description": "Closed operational health status.", "oneOf": [{ "const": "healthy", "description": "Component is operating normally.", "type": "string" }, { "const": "degraded", "description": "Component is available with reduced guarantees or capacity.", "type": "string" }, { "const": "unhealthy", "description": "Component is not available for required operations.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ReadinessResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Structured readiness response retaining every content-free component observation.", "properties": { "dependency_report": { "$ref": "#/$defs/HealthReport", "description": "Complete dependency report." }, "gate_open": { "description": "Whether startup and shutdown admission gate is open.", "type": "boolean" }, "ready": { "description": "Whether the process is ready for governed traffic.", "type": "boolean" } }, "required": ["gate_open", "ready", "dependency_report"], "title": "ReadinessResponse", "type": "object" });
295
+ export const RecordHandoffResultRequest = payloadModel("RecordHandoffResultRequest", { "$defs": { "Capability": { "description": "Closed capabilities that may be granted and attenuated.", "oneOf": [{ "const": "read_context", "description": "Observe authorized context records.", "type": "string" }, { "const": "compile_context", "description": "Compile an authorized context bundle.", "type": "string" }, { "const": "write_overlay", "description": "Propose private overlay mutations.", "type": "string" }, { "const": "publish_overlay", "description": "Publish an overlay through optimistic merge.", "type": "string" }, { "const": "create_handoff", "description": "Create a handoff capsule.", "type": "string" }, { "const": "accept_handoff", "description": "Accept a handoff capsule.", "type": "string" }, { "const": "invoke_tool", "description": "Invoke a mediated tool.", "type": "string" }, { "const": "propose_effect", "description": "Propose an external effect intent.", "type": "string" }, { "const": "approve_effect", "description": "Approve an external effect.", "type": "string" }, { "const": "reconcile_effect", "description": "Reconcile an unknown effect.", "type": "string" }] }, "ResultClaim": { "additionalProperties": false, "description": "Evidence-backed claim returned by a child agent.", "properties": { "claim": { "description": "Bounded claim text.", "maxLength": 65536, "minLength": 1, "type": "string" }, "evidence": { "description": "Sorted unique evidence versions.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 10000, "minItems": 1, "type": "array" } }, "required": ["claim", "evidence"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/RecordHandoffResultRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Child-result payload excluding the authenticated producer and server-generated delta identity.", "properties": { "artifacts": { "description": "Sorted artifact references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "base_commit_id": { "description": "Exact parent base commit.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "blockers": { "description": "Bounded blockers.", "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, "maxItems": 1024, "type": "array" }, "claims": { "description": "Evidence-backed result claims.", "items": { "$ref": "#/$defs/ResultClaim" }, "maxItems": 1024, "type": "array" }, "decisions": { "description": "Sorted decision references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "effect_references": { "description": "Sorted effect references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "handoff_id": { "description": "Handoff addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "requested_followup_capabilities": { "description": "Sorted follow-up capabilities requested but not granted.", "items": { "$ref": "#/$defs/Capability" }, "maxItems": 64, "type": "array" }, "source_changes": { "description": "Sorted source-change references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" }, "unresolved_questions": { "description": "Bounded unresolved questions.", "items": { "maxLength": 4096, "minLength": 1, "type": "string" }, "maxItems": 1024, "type": "array" }, "verifier_receipts": { "description": "Sorted verifier receipt references.", "items": { "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "maxItems": 1024, "type": "array" } }, "required": ["handoff_id", "base_commit_id", "claims", "decisions", "artifacts", "source_changes", "verifier_receipts", "unresolved_questions", "blockers", "effect_references", "requested_followup_capabilities"], "title": "RecordHandoffResultRequest", "type": "object" });
296
+ export const ReplayCompleteness = payloadModel("ReplayCompleteness", { "$defs": { "DependencyKind": { "description": "Dependency categories reported by replay completeness.", "oneOf": [{ "const": "source", "description": "Source snapshot or atom.", "type": "string" }, { "const": "blob", "description": "Protected blob.", "type": "string" }, { "const": "policy", "description": "Policy snapshot.", "type": "string" }, { "const": "index", "description": "Index generation.", "type": "string" }, { "const": "manifest", "description": "Selection manifest.", "type": "string" }, { "const": "bundle", "description": "Context bundle.", "type": "string" }, { "const": "tokenizer", "description": "Tokenizer implementation.", "type": "string" }, { "const": "adapter", "description": "Provider adapter.", "type": "string" }, { "const": "consumer", "description": "Consumer runtime.", "type": "string" }, { "const": "tool_schema", "description": "Tool schema.", "type": "string" }, { "const": "environment", "description": "Declared environment component.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ReplayCompleteness.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Explicit available and missing replay dependencies.", "properties": { "available": { "description": "Sorted available dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" }, "missing": { "description": "Sorted missing dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" } }, "required": ["available", "missing"], "title": "ReplayCompleteness", "type": "object" });
297
+ export const ReplayExecution = payloadModel("ReplayExecution", { "$defs": { "DependencyKind": { "description": "Dependency categories reported by replay completeness.", "oneOf": [{ "const": "source", "description": "Source snapshot or atom.", "type": "string" }, { "const": "blob", "description": "Protected blob.", "type": "string" }, { "const": "policy", "description": "Policy snapshot.", "type": "string" }, { "const": "index", "description": "Index generation.", "type": "string" }, { "const": "manifest", "description": "Selection manifest.", "type": "string" }, { "const": "bundle", "description": "Context bundle.", "type": "string" }, { "const": "tokenizer", "description": "Tokenizer implementation.", "type": "string" }, { "const": "adapter", "description": "Provider adapter.", "type": "string" }, { "const": "consumer", "description": "Consumer runtime.", "type": "string" }, { "const": "tool_schema", "description": "Tool schema.", "type": "string" }, { "const": "environment", "description": "Declared environment component.", "type": "string" }] }, "ReplayCompleteness": { "additionalProperties": false, "description": "Explicit available and missing replay dependencies.", "properties": { "available": { "description": "Sorted available dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" }, "missing": { "description": "Sorted missing dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" } }, "required": ["available", "missing"], "type": "object" }, "ReplayMode": { "description": "Closed replay execution mode.", "oneOf": [{ "const": "evidence_reproduction", "description": "Verify retained source, policy, index, manifest, and bundle evidence.", "type": "string" }, { "const": "invocation_reproduction", "description": "Reconstruct exact declared invocation without invoking dependencies.", "type": "string" }, { "const": "observational", "description": "Substitute recorded observations under denied egress.", "type": "string" }, { "const": "live_comparison", "description": "Invoke configured dependencies as a new explicitly authorized execution.", "type": "string" }] }, "ReplayStatus": { "description": "Closed replay execution status.", "oneOf": [{ "const": "running", "description": "Execution is currently running.", "type": "string" }, { "const": "complete", "description": "Requested replay completed.", "type": "string" }, { "const": "failed", "description": "Replay failed validation or execution.", "type": "string" }, { "const": "incomplete", "description": "Replay stopped due to missing dependencies.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ReplayExecution.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "One new replay execution; never mutates the source decision.", "properties": { "completed_at": { "description": "Completion time when terminal.", "format": "date-time", "type": "string" }, "completeness": { "$ref": "#/$defs/ReplayCompleteness", "description": "Dependency completeness." }, "effect_dispatch_permitted": { "description": "Whether newly authorized effect dispatch was enabled.", "type": "boolean" }, "egress_permitted": { "description": "Whether network egress was enabled.", "type": "boolean" }, "execution_id": { "description": "Unique execution identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "mode": { "$ref": "#/$defs/ReplayMode", "description": "Executed mode." }, "observation_digest": { "description": "Recorded or live observation digest when available.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "reconstructed_input_digest": { "description": "Reconstructed consumer input digest when available.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "request_id": { "description": "Source request identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.replay-execution.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "started_at": { "description": "Start time.", "format": "date-time", "type": "string" }, "status": { "$ref": "#/$defs/ReplayStatus", "description": "Execution status." } }, "required": ["schema_version", "execution_id", "request_id", "mode", "status", "completeness", "egress_permitted", "effect_dispatch_permitted", "started_at"], "title": "ReplayExecution", "type": "object" });
298
+ export const ReplayIdRequest = payloadModel("ReplayIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/ReplayIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one persisted replay job.", "properties": { "replay_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["replay_id"], "title": "ReplayIdRequest", "type": "object" });
299
+ export const ReplayJobResponse = payloadModel("ReplayJobResponse", { "$defs": { "DependencyKind": { "description": "Dependency categories reported by replay completeness.", "oneOf": [{ "const": "source", "description": "Source snapshot or atom.", "type": "string" }, { "const": "blob", "description": "Protected blob.", "type": "string" }, { "const": "policy", "description": "Policy snapshot.", "type": "string" }, { "const": "index", "description": "Index generation.", "type": "string" }, { "const": "manifest", "description": "Selection manifest.", "type": "string" }, { "const": "bundle", "description": "Context bundle.", "type": "string" }, { "const": "tokenizer", "description": "Tokenizer implementation.", "type": "string" }, { "const": "adapter", "description": "Provider adapter.", "type": "string" }, { "const": "consumer", "description": "Consumer runtime.", "type": "string" }, { "const": "tool_schema", "description": "Tool schema.", "type": "string" }, { "const": "environment", "description": "Declared environment component.", "type": "string" }] }, "ReplayCompleteness": { "additionalProperties": false, "description": "Explicit available and missing replay dependencies.", "properties": { "available": { "description": "Sorted available dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" }, "missing": { "description": "Sorted missing dependency categories.", "items": { "$ref": "#/$defs/DependencyKind" }, "maxItems": 10000, "type": "array" } }, "required": ["available", "missing"], "type": "object" }, "ReplayExecution": { "additionalProperties": false, "description": "One new replay execution; never mutates the source decision.", "properties": { "completed_at": { "description": "Completion time when terminal.", "format": "date-time", "type": "string" }, "completeness": { "$ref": "#/$defs/ReplayCompleteness", "description": "Dependency completeness." }, "effect_dispatch_permitted": { "description": "Whether newly authorized effect dispatch was enabled.", "type": "boolean" }, "egress_permitted": { "description": "Whether network egress was enabled.", "type": "boolean" }, "execution_id": { "description": "Unique execution identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "mode": { "$ref": "#/$defs/ReplayMode", "description": "Executed mode." }, "observation_digest": { "description": "Recorded or live observation digest when available.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "reconstructed_input_digest": { "description": "Reconstructed consumer input digest when available.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "request_id": { "description": "Source request identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.replay-execution.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "started_at": { "description": "Start time.", "format": "date-time", "type": "string" }, "status": { "$ref": "#/$defs/ReplayStatus", "description": "Execution status." } }, "required": ["schema_version", "execution_id", "request_id", "mode", "status", "completeness", "egress_permitted", "effect_dispatch_permitted", "started_at"], "type": "object" }, "ReplayJobStatus": { "description": "Closed persisted replay-job state.", "oneOf": [{ "const": "running", "description": "Evidence or invocation replay is executing.", "type": "string" }, { "const": "complete", "description": "Evidence or invocation replay completed during creation.", "type": "string" }, { "const": "pending_observational", "description": "Observational replay is retained for the run operation.", "type": "string" }, { "const": "pending_live", "description": "Live comparison is retained for explicit authorization and compare.", "type": "string" }, { "const": "incomplete", "description": "Replay lacks one or more exact dependencies.", "type": "string" }, { "const": "failed", "description": "Replay failed without exposing protected details.", "type": "string" }] }, "ReplayMode": { "description": "Closed replay execution mode.", "oneOf": [{ "const": "evidence_reproduction", "description": "Verify retained source, policy, index, manifest, and bundle evidence.", "type": "string" }, { "const": "invocation_reproduction", "description": "Reconstruct exact declared invocation without invoking dependencies.", "type": "string" }, { "const": "observational", "description": "Substitute recorded observations under denied egress.", "type": "string" }, { "const": "live_comparison", "description": "Invoke configured dependencies as a new explicitly authorized execution.", "type": "string" }] }, "ReplayStatus": { "description": "Closed replay execution status.", "oneOf": [{ "const": "running", "description": "Execution is currently running.", "type": "string" }, { "const": "complete", "description": "Requested replay completed.", "type": "string" }, { "const": "failed", "description": "Replay failed validation or execution.", "type": "string" }, { "const": "incomplete", "description": "Replay stopped due to missing dependencies.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ReplayJobResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Persisted replay job and optional immediate evidence/invocation execution.", "properties": { "execution": { "anyOf": [{ "$ref": "#/$defs/ReplayExecution" }], "description": "Immediate execution for evidence or invocation mode." }, "mode": { "$ref": "#/$defs/ReplayMode", "description": "Requested replay mode." }, "replay_id": { "description": "Stable replay job identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "status": { "$ref": "#/$defs/ReplayJobStatus", "description": "Current job status." } }, "required": ["replay_id", "mode", "status"], "title": "ReplayJobResponse", "type": "object" });
300
+ export const ResolveSpaceConflictRequest = payloadModel("ResolveSpaceConflictRequest", { "$defs": { "ConflictResolution": { "description": "Closed typed conflict resolution choice.", "oneOf": [{ "additionalProperties": false, "description": "Retains the immutable base value.", "properties": { "choice": { "const": "base", "type": "string" } }, "required": ["choice"], "type": "object" }, { "additionalProperties": false, "description": "Retains the current canonical value.", "properties": { "choice": { "const": "current", "type": "string" } }, "required": ["choice"], "type": "object" }, { "additionalProperties": false, "description": "Accepts the owner-private proposed value.", "properties": { "choice": { "const": "proposed", "type": "string" } }, "required": ["choice"], "type": "object" }, { "additionalProperties": false, "description": "Applies a separately persisted typed decision.", "properties": { "choice": { "const": "typed_decision", "type": "string" }, "decision_id": { "description": "Exact decision record version.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["choice", "decision_id"], "type": "object" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/ResolveSpaceConflictRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request resolving one durable stable conflict identity.", "properties": { "conflict_id": { "description": "Stable conflict addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "resolution": { "$ref": "#/$defs/ConflictResolution", "description": "Closed typed resolution." }, "space_id": { "description": "Context space addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id", "conflict_id", "resolution"], "title": "ResolveSpaceConflictRequest", "type": "object" });
301
+ export const RevalidationResponse = payloadModel("RevalidationResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/RevalidationResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Current validity result for a retained bundle.", "properties": { "bundle_id": { "description": "Revalidated immutable bundle.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "reasons": { "description": "Sorted stable invalidation reason symbols.", "items": { "maxLength": 256, "minLength": 1, "type": "string" }, "maxItems": 256, "type": "array" }, "valid": { "description": "Whether every frozen dependency remains valid and authorized.", "type": "boolean" } }, "required": ["bundle_id", "valid", "reasons"], "title": "RevalidationResponse", "type": "object" });
302
+ export const RevokeHandoffRequest = payloadModel("RevokeHandoffRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/RevokeHandoffRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Handoff revocation request with content-safe evidence.", "properties": { "handoff_id": { "description": "Handoff addressed by the route.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "reason_digest": { "description": "Digest of the authorized revocation reason/evidence.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["handoff_id", "reason_digest"], "title": "RevokeHandoffRequest", "type": "object" });
303
+ export const SelectionManifest = payloadModel("SelectionManifest", { "$defs": { "CandidateDisposition": { "description": "Deterministic disposition of one retrieval candidate.", "oneOf": [{ "additionalProperties": false, "description": "Selected into a specific lane with a fixed-point score.", "properties": { "lane": { "$ref": "#/$defs/LaneKind", "description": "Selected lane." }, "score": { "description": "Deterministic score in millionths.", "format": "uint32", "maximum": 1000000, "minimum": 0, "type": "integer" }, "state": { "const": "selected", "type": "string" } }, "required": ["state", "lane", "score"], "type": "object" }, { "additionalProperties": false, "description": "Excluded with a stable reason.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary exclusion reason." }, "state": { "const": "excluded", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Redacted while preserving safe explanation that a candidate existed.", "properties": { "reason": { "$ref": "#/$defs/DispositionReason", "description": "Primary redaction reason." }, "state": { "const": "redacted", "type": "string" } }, "required": ["state", "reason"], "type": "object" }, { "additionalProperties": false, "description": "Required selector had no authorized matching candidate.", "properties": { "state": { "const": "required_missing", "type": "string" } }, "required": ["state"], "type": "object" }] }, "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "DispositionReason": { "description": "Stable exclusion and non-selection reason codes.", "oneOf": [{ "const": "scope_denied", "description": "Candidate was outside the authorized scope.", "type": "string" }, { "const": "purpose_denied", "description": "Purpose did not authorize candidate use.", "type": "string" }, { "const": "temporal_mismatch", "description": "Candidate was temporally ineligible.", "type": "string" }, { "const": "trust_insufficient", "description": "Candidate trust or authority was insufficient.", "type": "string" }, { "const": "instruction_authority_denied", "description": "Instruction authority was insufficient.", "type": "string" }, { "const": "processor_denied", "description": "Processor constraints were not satisfied.", "type": "string" }, { "const": "integrity_failed", "description": "Integrity verification failed.", "type": "string" }, { "const": "budget_displaced", "description": "A higher-ranked candidate displaced this one under budget.", "type": "string" }, { "const": "lifecycle_ineligible", "description": "Candidate was superseded or tombstoned.", "type": "string" }, { "const": "conflict_lost", "description": "Candidate conflicted with a mandatory higher-authority item.", "type": "string" }, { "const": "required_missing", "description": "Required context could not be found.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" }, "LaneKind": { "description": "Standard deterministic context lanes.", "oneOf": [{ "const": "rules", "description": "Non-bypassable rules and instructions.", "type": "string" }, { "const": "task", "description": "Current task statement and exact constraints.", "type": "string" }, { "const": "evidence", "description": "Source, documentation, and verification evidence.", "type": "string" }, { "const": "history", "description": "Prior decisions and relevant history.", "type": "string" }, { "const": "tools", "description": "Tool contracts and capability descriptions.", "type": "string" }] }, "ManifestEntry": { "additionalProperties": false, "description": "Complete explanation entry for one considered catalog version.", "properties": { "disposition": { "$ref": "#/$defs/CandidateDisposition", "description": "Final deterministic disposition." }, "provenance_digest": { "description": "Digest proving catalog-derived provenance.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "reason_codes": { "description": "Sorted unique supplementary reason codes.", "items": { "$ref": "#/$defs/DispositionReason" }, "maxItems": 64, "type": "array" }, "version_id": { "description": "Considered catalog version.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["version_id", "disposition", "reason_codes", "provenance_digest"], "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/SelectionManifest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Complete selection and exclusion explanation for a bundle.", "properties": { "contract_digest": { "description": "Normalized contract digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "entries": { "description": "Sorted unique entry for every considered candidate.", "items": { "$ref": "#/$defs/ManifestEntry" }, "maxItems": 10000, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "manifest_id": { "description": "Content-derived manifest identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.selection-manifest.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" } }, "required": ["schema_version", "manifest_id", "contract_digest", "entries", "extensions"], "title": "SelectionManifest", "type": "object" });
304
+ export const SourceIdRequest = payloadModel("SourceIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/SourceIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one persisted source.", "properties": { "source_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["source_id"], "title": "SourceIdRequest", "type": "object" });
305
+ export const SourceStatusResponse = payloadModel("SourceStatusResponse", { "$defs": { "SourceStatus": { "description": "Closed content-free source health state.", "oneOf": [{ "const": "ready", "description": "Source can serve bounded operations.", "type": "string" }, { "const": "degraded", "description": "Source can serve reads but requires refresh.", "type": "string" }, { "const": "unavailable", "description": "Source cannot safely serve requests.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/SourceStatusResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Content-free source health response.", "properties": { "source_id": { "description": "Persisted source configuration.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "status": { "$ref": "#/$defs/SourceStatus", "description": "Current health state." }, "watermark": { "description": "Last observed connector watermark.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": ["source_id", "status", "watermark"], "title": "SourceStatusResponse", "type": "object" });
306
+ export const SpaceCheckpointResponse = payloadModel("SpaceCheckpointResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpaceCheckpointResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Durable focus checkpoint response.", "properties": { "commit_id": { "description": "Exact immutable checkpoint commit.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "focus_id": { "description": "Checkpointed focus identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["focus_id", "commit_id"], "title": "SpaceCheckpointResponse", "type": "object" });
307
+ export const SpaceEventPayload = payloadModel("SpaceEventPayload", { "$defs": { "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpaceEventPayload.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Typed context-space stream event.", "properties": { "event": { "$ref": "#/$defs/CoordinationEvent", "description": "Immutable coordination event." }, "project_id": { "description": "Disclosure-scoped project identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id", "project_id", "event"], "title": "SpaceEventPayload", "type": "object" });
308
+ export const SpaceForkResponse = payloadModel("SpaceForkResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpaceForkResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Disclosure-safe fork result.", "oneOf": [{ "additionalProperties": false, "description": "A private overlay was created.", "properties": { "base_commit_id": { "description": "Exact immutable merge base.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "kind": { "const": "private_overlay", "type": "string" }, "overlay_id": { "description": "New overlay identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["kind", "overlay_id", "base_commit_id"], "type": "object" }, { "additionalProperties": false, "description": "A focus branch was created.", "properties": { "focus_id": { "description": "New focus identity.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "fork_commit_id": { "description": "Exact fork commit.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "kind": { "const": "focus_branch", "type": "string" } }, "required": ["kind", "focus_id", "fork_commit_id"], "type": "object" }], "title": "SpaceForkResponse" });
309
+ export const SpaceIdRequest = payloadModel("SpaceIdRequest", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpaceIdRequest.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Request addressing one context space.", "properties": { "space_id": { "description": "Exact resource identity, reconciled with the transport path.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["space_id"], "title": "SpaceIdRequest", "type": "object" });
310
+ export const SpaceLogResponse = payloadModel("SpaceLogResponse", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextCommit": { "additionalProperties": false, "description": "Immutable context-space commit.", "properties": { "author_id": { "description": "Authenticated author.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "commit_id": { "description": "Content-derived commit identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "committed_at": { "description": "Commit time.", "format": "date-time", "type": "string" }, "events": { "description": "Ordered immutable events.", "items": { "$ref": "#/$defs/CoordinationEvent" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "parent_commit_id": { "description": "Parent commit, absent only for sequence one.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "policy_snapshot_digest": { "description": "Policy snapshot used for publication.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 65536, "minLength": 1, "type": "string" }, "root_digest": { "description": "Resulting context-space root digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-commit.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "sequence": { "description": "Monotonic sequence beginning at one.", "format": "uint64", "minimum": 0, "type": "integer" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["schema_version", "commit_id", "space_id", "sequence", "author_id", "purpose", "events", "root_digest", "policy_snapshot_digest", "committed_at", "extensions"], "type": "object" }, "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpaceLogResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Bounded immutable context-space history page.", "properties": { "commits": { "description": "Ordered commits for the pinned snapshot.", "items": { "$ref": "#/$defs/ContextCommit" }, "maxItems": 1000, "type": "array" } }, "required": ["commits"], "title": "SpaceLogResponse", "type": "object" });
311
+ export const SpacePublishResponse = payloadModel("SpacePublishResponse", { "$defs": { "CanonicalValue": { "description": "Canonical extension value; null and floating-point states are unrepresentable.", "oneOf": [{ "additionalProperties": false, "description": "Boolean value.", "properties": { "type": { "const": "boolean", "type": "string" }, "value": { "type": "boolean" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Signed integer value.", "properties": { "type": { "const": "integer", "type": "string" }, "value": { "format": "int64", "type": "integer" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded UTF-8 text.", "properties": { "type": { "const": "text", "type": "string" }, "value": { "maxLength": 65536, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Bounded byte string. JSON wire generation replaces the derived array form with base64url.", "properties": { "type": { "const": "bytes", "type": "string" }, "value": { "maxLength": 87382, "type": "string" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Ordered values.", "properties": { "type": { "const": "array", "type": "string" }, "value": { "items": { "$ref": "#/$defs/CanonicalValue" }, "maxItems": 256, "type": "array" } }, "required": ["type", "value"], "type": "object" }, { "additionalProperties": false, "description": "Deterministically ordered string-keyed values.", "properties": { "type": { "const": "object", "type": "string" }, "value": { "additionalProperties": { "$ref": "#/$defs/CanonicalValue" }, "maxProperties": 256, "type": "object" } }, "required": ["type", "value"], "type": "object" }] }, "ContextCommit": { "additionalProperties": false, "description": "Immutable context-space commit.", "properties": { "author_id": { "description": "Authenticated author.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "commit_id": { "description": "Content-derived commit identity.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "committed_at": { "description": "Commit time.", "format": "date-time", "type": "string" }, "events": { "description": "Ordered immutable events.", "items": { "$ref": "#/$defs/CoordinationEvent" }, "maxItems": 10000, "minItems": 1, "type": "array" }, "extensions": { "$ref": "#/$defs/ExtensionMap", "description": "Stable bounded extensions." }, "parent_commit_id": { "description": "Parent commit, absent only for sequence one.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "policy_snapshot_digest": { "description": "Policy snapshot used for publication.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "purpose": { "description": "Bounded publication purpose.", "maxLength": 65536, "minLength": 1, "type": "string" }, "root_digest": { "description": "Resulting context-space root digest.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" }, "schema_version": { "description": "Must be `cigar.context-commit.v1`.", "maxLength": 71, "minLength": 4, "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*\\.v[1-9][0-9]{0,4}$", "type": "string" }, "sequence": { "description": "Monotonic sequence beginning at one.", "format": "uint64", "minimum": 0, "type": "integer" }, "space_id": { "description": "Owning context space.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" } }, "required": ["schema_version", "commit_id", "space_id", "sequence", "author_id", "purpose", "events", "root_digest", "policy_snapshot_digest", "committed_at", "extensions"], "type": "object" }, "CoordinationEvent": { "additionalProperties": false, "description": "One immutable ordered event in a context commit.", "properties": { "event_id": { "description": "Globally unique event identity for deduplication.", "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "kind": { "$ref": "#/$defs/CoordinationEventKind", "description": "Closed event kind." }, "payload_digest": { "description": "Digest of the typed event payload.", "maxLength": 68, "minLength": 68, "pattern": "^1220[0-9a-f]{64}$", "type": "string" } }, "required": ["event_id", "kind", "payload_digest"], "type": "object" }, "CoordinationEventKind": { "description": "Required coordination event kinds.", "oneOf": [{ "const": "context_committed", "description": "Immutable context commit was published.", "type": "string" }, { "const": "atom_invalidated", "description": "Atom became invalid for current selection.", "type": "string" }, { "const": "bundle_invalidated", "description": "Compiled bundle became invalid.", "type": "string" }, { "const": "task_checkpointed", "description": "Task checkpoint was recorded.", "type": "string" }, { "const": "handoff_created", "description": "Handoff capsule was created.", "type": "string" }, { "const": "handoff_accepted", "description": "Handoff was accepted.", "type": "string" }, { "const": "handoff_revoked", "description": "Handoff was revoked.", "type": "string" }, { "const": "agent_result_proposed", "description": "Child result was proposed.", "type": "string" }, { "const": "merge_conflict_created", "description": "Typed merge conflict was created.", "type": "string" }, { "const": "effect_state_changed", "description": "Effect journal state changed.", "type": "string" }, { "const": "policy_snapshot_changed", "description": "Policy snapshot changed.", "type": "string" }] }, "ExtensionMap": { "additionalProperties": false, "description": "Deterministically ordered and bounded extension collection.", "maxProperties": 64, "patternProperties": { "^[a-z0-9][a-z0-9._/-]{0,127}$": { "$ref": "#/$defs/CanonicalValue" } }, "type": "object" } }, "$id": "https://cigar.dev/schemas/api-payload-types-v1/SpacePublishResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Closed publication outcome without exposing private conflicting values.", "oneOf": [{ "additionalProperties": false, "description": "A new commit became canonical.", "properties": { "commit": { "$ref": "#/$defs/ContextCommit", "description": "Immutable published commit." }, "outcome": { "const": "published", "type": "string" } }, "required": ["outcome", "commit"], "type": "object" }, { "additionalProperties": false, "description": "Publication made no semantic change.", "properties": { "commit": { "$ref": "#/$defs/ContextCommit", "description": "Existing immutable head." }, "outcome": { "const": "deduplicated", "type": "string" } }, "required": ["outcome", "commit"], "type": "object" }, { "additionalProperties": false, "description": "Conflicts were durably retained for later resolution.", "properties": { "conflict_ids": { "description": "Sorted stable conflict identities.", "items": { "maxLength": 36, "minLength": 36, "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", "type": "string" }, "maxItems": 1024, "minItems": 1, "type": "array" }, "outcome": { "const": "conflicted", "type": "string" } }, "required": ["outcome", "conflict_ids"], "type": "object" }], "title": "SpacePublishResponse" });
312
+ export const StreamOpenResponse = payloadModel("StreamOpenResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/StreamOpenResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Marker response for successful stream establishment.", "title": "StreamOpenResponse", "type": "object" });
313
+ export const VersionResponse = payloadModel("VersionResponse", { "$id": "https://cigar.dev/schemas/api-payload-types-v1/VersionResponse.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "Stable build and protocol compatibility response.", "properties": { "build_profile": { "description": "Release or debug build class.", "maxLength": 256, "minLength": 1, "type": "string" }, "enabled_features": { "description": "Sorted compile-time public feature names.", "items": { "maxLength": 256, "minLength": 1, "type": "string" }, "maxItems": 256, "type": "array" }, "protocol_max": { "description": "Maximum accepted protocol line.", "maxLength": 256, "minLength": 1, "type": "string" }, "protocol_min": { "description": "Minimum accepted protocol.", "maxLength": 256, "minLength": 1, "type": "string" }, "source_revision": { "description": "Source revision or `unknown`.", "maxLength": 256, "minLength": 1, "type": "string" }, "version": { "description": "Package semantic version.", "maxLength": 256, "minLength": 1, "type": "string" } }, "required": ["version", "source_revision", "protocol_min", "protocol_max", "build_profile", "enabled_features"], "title": "VersionResponse", "type": "object" });
314
+ //# sourceMappingURL=models.js.map