@sharedcontext/sdk 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,588 @@
1
+ import type { Json } from "../canonical.js";
2
+ /** crates/sharedcontext/src/work/types.rs SessionRef */
3
+ export type SessionRef = {
4
+ /** at most 64 bytes (MAX_AGENT_CLI_BYTES) */
5
+ "agent_cli"?: string | null;
6
+ /** at most 128 bytes (MAX_SESSION_ID_BYTES) */
7
+ "session_id"?: string;
8
+ [key: string]: unknown;
9
+ };
10
+ /** crates/sharedcontext/src/work/types.rs Repo */
11
+ export type Repo = {
12
+ "host"?: string;
13
+ "owner"?: string;
14
+ "name"?: string;
15
+ [key: string]: unknown;
16
+ };
17
+ /** sharedcontext/1.1: a repository is {host, owner, name}, each non-empty; its repo key is the lower-case string host/owner/name, and two repositories are the same when their keys are equal. crates/sharedcontext/src/work/types.rs Repo (key, is_complete). Lenient at its own level as 1.0's nested objects are; the log refuses unknown nested fields (named by path), which this schema does not yet express for any nested object. */
18
+ export type RepoRef = {
19
+ "host": string;
20
+ "owner": string;
21
+ "name": string;
22
+ [key: string]: unknown;
23
+ };
24
+ /** sharedcontext/1.1: one entry of project.created.repos; default_branch per repository. crates/sharedcontext/src/work/types.rs RepoEntry. */
25
+ export type RepoEntry = {
26
+ "default_branch"?: string | null;
27
+ [key: string]: unknown;
28
+ } & (RepoRef);
29
+ /** sharedcontext/1.1: a registry actor's scope: a repo key (lower-case host/owner/name) or "*" for a project-wide adapter (an issue tracker). crates/sharedcontext/src/signed/registry.rs Actor.repo; crates/sharedcontext/src/work/multirepo.rs. */
30
+ export type RepoKey = string;
31
+ /** crates/sharedcontext/src/work/types.rs PrRef */
32
+ export type PrRef = {
33
+ "host"?: string;
34
+ "owner"?: string;
35
+ "repo"?: string;
36
+ "number"?: number;
37
+ [key: string]: unknown;
38
+ };
39
+ /** crates/sharedcontext/src/work/types.rs Origin */
40
+ export type Origin = {
41
+ "source"?: string;
42
+ "ref"?: string | null;
43
+ [key: string]: unknown;
44
+ };
45
+ /** crates/sharedcontext/src/work/types.rs Marker: a sha plus a time, never a key */
46
+ export type Marker = {
47
+ "sha"?: string | null;
48
+ "run_id"?: string | null;
49
+ "at"?: number | null;
50
+ [key: string]: unknown;
51
+ };
52
+ /** crates/sharedcontext/src/work/types.rs Horizon (unix seconds) */
53
+ export type Horizon = {
54
+ "from"?: number;
55
+ "to"?: number;
56
+ [key: string]: unknown;
57
+ };
58
+ /** crates/sharedcontext/src/work/types.rs Measure */
59
+ export type Measure = {
60
+ "name"?: string;
61
+ /** integer; the unit carries the scale */
62
+ "target"?: number | null;
63
+ "unit"?: string;
64
+ "source"?: string;
65
+ /** crates/sharedcontext/src/work/log.rs: MEASURE_DIRECTIONS; at_least when absent */
66
+ "direction"?: "at_least" | "at_most" | null;
67
+ [key: string]: unknown;
68
+ };
69
+ /** crates/sharedcontext/src/work/types.rs SplitPart */
70
+ export type SplitPart = {
71
+ "node_id"?: string;
72
+ "title"?: string | null;
73
+ "body"?: string | null;
74
+ "severity"?: string | null;
75
+ "covers"?: string[];
76
+ [key: string]: unknown;
77
+ };
78
+ /** crates/sharedcontext/src/work/types.rs CloseEvidence */
79
+ export type CloseEvidence = {
80
+ "run_id"?: string;
81
+ "record_digest"?: string | null;
82
+ "sha"?: string | null;
83
+ "facts_digest"?: string | null;
84
+ "rules_digest"?: string | null;
85
+ "covered"?: string[];
86
+ [key: string]: unknown;
87
+ };
88
+ /** crates/sharedcontext/src/work/types.rs Override */
89
+ export type Override = {
90
+ "reason"?: string;
91
+ "policy_clause"?: string;
92
+ [key: string]: unknown;
93
+ };
94
+ /** crates/sharedcontext/src/work/types.rs Cancel */
95
+ export type Cancel = {
96
+ "reason"?: string;
97
+ [key: string]: unknown;
98
+ };
99
+ /** crates/sharedcontext/src/work/types.rs Unverified */
100
+ export type Unverified = {
101
+ "system"?: string;
102
+ "external_state"?: string;
103
+ "actor"?: string | null;
104
+ [key: string]: unknown;
105
+ };
106
+ /** crates/sharedcontext/src/work/types.rs ClosedAt */
107
+ export type ClosedAt = {
108
+ "sha"?: string | null;
109
+ "at"?: number | null;
110
+ [key: string]: unknown;
111
+ };
112
+ /** crates/sharedcontext/src/work/types.rs RegressionEvidence */
113
+ export type RegressionEvidence = {
114
+ "run_id"?: string;
115
+ "sha"?: string | null;
116
+ "seen"?: string[];
117
+ [key: string]: unknown;
118
+ };
119
+ /** crates/sharedcontext/src/work/types.rs Blob */
120
+ export type Blob = {
121
+ "digest"?: string;
122
+ "media_type"?: string;
123
+ "bytes"?: number;
124
+ [key: string]: unknown;
125
+ };
126
+ /** crates/sharedcontext/src/work/types.rs Gate */
127
+ export type Gate = {
128
+ /** gate kinds come from the policy (GATE_KINDS is the default list, crates/sharedcontext/src/work/policy.rs) */
129
+ "kind"?: string;
130
+ "ref"?: string;
131
+ [key: string]: unknown;
132
+ };
133
+ /** crates/sharedcontext/src/work/types.rs Verdict */
134
+ export type Verdict = {
135
+ "finding_fp"?: string;
136
+ "verdict"?: string;
137
+ "record_ref"?: string | null;
138
+ [key: string]: unknown;
139
+ };
140
+ /** crates/sharedcontext/src/work/types.rs Provenance: the log refuses keys outside this list inside source (invalid_value, unknown_provenance_fields) */
141
+ export type Provenance = {
142
+ "system"?: string;
143
+ /** crates/sharedcontext/src/work/log.rs: PROVENANCE_VIA */
144
+ "via"?: "webhook" | "poll" | "reconcile" | null;
145
+ "id"?: string | null;
146
+ "url"?: string | null;
147
+ "actor"?: string | null;
148
+ "delivered_at"?: number | null;
149
+ };
150
+ /** crates/sharedcontext/src/work/types.rs Scope */
151
+ export type Scope = {
152
+ "kind"?: string;
153
+ "id"?: string;
154
+ [key: string]: unknown;
155
+ };
156
+ /** crates/sharedcontext/src/work/types.rs Flags */
157
+ export type Flags = {
158
+ "enrol_agents"?: boolean;
159
+ "create_skills"?: boolean;
160
+ "assign_work"?: boolean;
161
+ [key: string]: unknown;
162
+ };
163
+ /** crates/sharedcontext/src/signed/registry.rs Limits: both fields required (no serde default) */
164
+ export type Limits = {
165
+ "events_per_min": number;
166
+ "open_claims": number;
167
+ [key: string]: unknown;
168
+ };
169
+ /** crates/sharedcontext/src/signed/registry.rs Actor: role required; sharedcontext/1.1: repo, skip_serializing_if None, so a registry without it keeps its policy digest */
170
+ export type Actor = {
171
+ /** crates/sharedcontext/src/work/log.rs: signed::ROLES, checked on project.policy_set */
172
+ "role": "agent" | "person" | "steward" | "system" | "adapter";
173
+ "label"?: string;
174
+ /** crates/sharedcontext/src/signed/registry.rs STAGES; default nonprod */
175
+ "stage"?: "shadow" | "nonprod" | "prod";
176
+ "limits"?: Limits;
177
+ "owner"?: string | null;
178
+ "expires_at"?: number | null;
179
+ /** The scope of an adapter-role key. Absent serializes as today, so existing policy digests are unchanged; read as "*" while the project has one active repository. */
180
+ "repo"?: RepoKey;
181
+ [key: string]: unknown;
182
+ };
183
+ /** crates/sharedcontext/src/work/types.rs ProfileFields */
184
+ export type ProfileFields = {
185
+ "org"?: string | null;
186
+ "teams"?: string[];
187
+ "member_id"?: string | null;
188
+ "role"?: string | null;
189
+ "flags"?: (null | Flags);
190
+ /** crates/sharedcontext/src/work/log.rs: TRUST_LEVELS */
191
+ "trust"?: "standard" | "review" | null;
192
+ /** crates/sharedcontext/src/work/log.rs: LIFECYCLES */
193
+ "lifecycle"?: "active" | "paused" | "retired" | null;
194
+ [key: string]: unknown;
195
+ };
196
+ /** Not event content. sharedcontext/1.1: the service's policy file, not the log. {"<repo key>": {field: owner}} overrides single fields for one repository; the native-only list (state, claims, covers, evidence, keys) cannot be overridden (a policy load error). An older service silently ignores it, so the service upgrades first. crates/sharedcontext/src/work/policy.rs Policy.field_ownership_by_repo, multirepo.rs. */
197
+ export type PolicyFieldOwnershipByRepo = {
198
+ [key: string]: {
199
+ [key: string]: string;
200
+ };
201
+ };
202
+ /** Not event content. sharedcontext/1.1: the reject repo_out_of_scope, a new reject name with no v bump. Refused: a write by a repo-scoped key on a node whose resolved repo is another one; the build checks every node write of a scoped key, not only the types first listed (ref.set, adapter.synced, change.external_event, external.state_changed, gate.cleared{approval}, node.updated of an owned field, node.created{origin: adapter}). Checked before field_not_owned. crates/sharedcontext/src/work/multirepo.rs; crates/sharedcontext/src/signed/verifier.rs RejectReason::RepoOutOfScope. Open point: a node of a project with no repository has no node_repo, and the build sends null there, which this shape refuses; reachable only with a scoped key in a repository-less project. */
203
+ export type RejectRepoOutOfScope = {
204
+ "reason": "repo_out_of_scope";
205
+ "detail": {
206
+ "key_repo": RepoKey;
207
+ "node_repo": RepoKey;
208
+ [key: string]: unknown;
209
+ };
210
+ [key: string]: unknown;
211
+ };
212
+ /** crates/sharedcontext/src/work/types.rs ProjectCreated. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. sharedcontext/1.1: repos, at least one, the first primary; repo (the 1.0 form) or repos, never both (invalid_value). A repo-only project stays valid and folds as repos: [{...repo, default_branch}] (ProjectCreated.repos). */
213
+ export type ProjectCreated = {
214
+ "name"?: string;
215
+ "repo"?: (null | Repo);
216
+ "default_branch"?: string | null;
217
+ "policy_ref"?: string | null;
218
+ /** At least one; the first is the primary repo. Duplicate repo keys are refused by the log (invalid_value); JSON Schema here cannot compare keys. */
219
+ "repos"?: RepoEntry[];
220
+ };
221
+ /** crates/sharedcontext/src/work/types.rs ProjectPolicySet. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
222
+ export type ProjectPolicySet = {
223
+ "policy_ref"?: string;
224
+ "effective_from_seq"?: number | null;
225
+ /** hex pubkey → actor */
226
+ "actors"?: {
227
+ [key: string]: Actor;
228
+ } | null;
229
+ /** any JSON value */
230
+ "params"?: Json;
231
+ };
232
+ /** crates/sharedcontext/src/work/types.rs NodeCreated. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. sharedcontext/1.1: repo, NodeCreated.repo. */
233
+ export type NodeCreated = {
234
+ /** crates/sharedcontext/src/work/log.rs: NODE_KINDS */
235
+ "kind"?: "epic" | "issue" | "task" | "subtask" | "change" | "goal";
236
+ "title"?: string | null;
237
+ "body"?: string | null;
238
+ "parent"?: string | null;
239
+ "origin"?: (null | Origin);
240
+ "labels"?: string[];
241
+ "severity"?: string | null;
242
+ "priority"?: string | null;
243
+ "cluster_key"?: string | null;
244
+ "fp_scheme"?: string | null;
245
+ "covers"?: string[];
246
+ "declaration_ref"?: string | null;
247
+ "opened_at"?: (null | Marker);
248
+ "pr"?: (null | PrRef);
249
+ "for"?: string[];
250
+ "base_sha"?: string | null;
251
+ "head_sha"?: string | null;
252
+ "owner"?: string | null;
253
+ "horizon"?: (null | Horizon);
254
+ "weight"?: number | null;
255
+ "measures"?: Measure[];
256
+ /** Optional for any kind. A change resolves to exactly one repo: repo, else pr's, else the only active repo; in a project with two or more active repos a change with neither is refused (invalid_value, detail `repo required`), and repo and pr must agree. Fixed at creation. */
257
+ "repo"?: (null | RepoRef);
258
+ };
259
+ /** crates/sharedcontext/src/work/types.rs NodeUpdated. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
260
+ export type NodeUpdated = {
261
+ /** field → new value */
262
+ "patch"?: {
263
+ [key: string]: Json;
264
+ };
265
+ "reason"?: string | null;
266
+ };
267
+ /** crates/sharedcontext/src/work/types.rs NodeMoved. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
268
+ export type NodeMoved = {
269
+ "parent"?: string | null;
270
+ };
271
+ /** crates/sharedcontext/src/work/types.rs NodeLinked. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
272
+ export type NodeLinked = {
273
+ /** crates/sharedcontext/src/work/log.rs: EDGES (invalid_edge) */
274
+ "edge"?: "blocks" | "relates" | "duplicates" | "split_from" | "merged_into" | "derived_from" | "serves";
275
+ "to"?: string;
276
+ };
277
+ /** crates/sharedcontext/src/work/types.rs NodeLinked. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
278
+ export type NodeUnlinked = {
279
+ /** crates/sharedcontext/src/work/log.rs: EDGES (invalid_edge) */
280
+ "edge"?: "blocks" | "relates" | "duplicates" | "split_from" | "merged_into" | "derived_from" | "serves";
281
+ "to"?: string;
282
+ };
283
+ /** crates/sharedcontext/src/work/types.rs NodeSplit. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
284
+ export type NodeSplit = {
285
+ "into"?: SplitPart[];
286
+ };
287
+ /** crates/sharedcontext/src/work/types.rs NodeMerged. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
288
+ export type NodeMerged = {
289
+ "into"?: string;
290
+ };
291
+ /** crates/sharedcontext/src/work/types.rs NodeClosed. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
292
+ export type NodeClosed = {
293
+ /** crates/sharedcontext/src/work/log.rs: OUTCOMES; a goal's close takes GOAL_OUTCOMES (done, cancelled) */
294
+ "outcome"?: "done" | "cancelled" | "duplicate";
295
+ "evidence"?: (null | CloseEvidence);
296
+ "override"?: (null | Override);
297
+ "cancel"?: (null | Cancel);
298
+ "unverified"?: (null | Unverified);
299
+ "closed_at"?: (null | ClosedAt);
300
+ "reason"?: string | null;
301
+ };
302
+ /** crates/sharedcontext/src/work/types.rs NodeReopened. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
303
+ export type NodeReopened = {
304
+ /** crates/sharedcontext/src/work/log.rs: REOPEN_CAUSES */
305
+ "cause"?: "regression" | "override_reversed" | "cancel_reversed";
306
+ "evidence"?: (null | RegressionEvidence);
307
+ "reason"?: string | null;
308
+ };
309
+ /** crates/sharedcontext/src/work/types.rs NoteAdded. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
310
+ export type NoteAdded = {
311
+ /** crates/sharedcontext/src/work/types.rs: NOTE_LAYERS */
312
+ "layer"?: "pinned" | "working" | "summary";
313
+ "text"?: string | null;
314
+ "blob"?: (null | Blob);
315
+ "supersedes"?: string | null;
316
+ "session"?: (null | SessionRef);
317
+ };
318
+ /** crates/sharedcontext/src/work/types.rs ContextPinned. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
319
+ export type ContextPinned = {
320
+ "text"?: string | null;
321
+ "blob"?: (null | Blob);
322
+ "supersedes"?: string | null;
323
+ "session"?: (null | SessionRef);
324
+ };
325
+ /** crates/sharedcontext/src/work/types.rs ClaimTaken. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
326
+ export type ClaimTaken = {
327
+ "lease_s"?: number | null;
328
+ /** crates/sharedcontext/src/work/log.rs: CLAIM_INTENTS */
329
+ "intent"?: "fix" | "triage" | "review" | "verify";
330
+ "on_sha"?: string | null;
331
+ "session"?: (null | SessionRef);
332
+ };
333
+ /** crates/sharedcontext/src/work/types.rs ClaimRenewed. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
334
+ export type ClaimRenewed = {
335
+ "lease_s"?: number | null;
336
+ "progress"?: string | null;
337
+ "session"?: (null | SessionRef);
338
+ };
339
+ /** crates/sharedcontext/src/work/types.rs ClaimReleased. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
340
+ export type ClaimReleased = {
341
+ /** crates/sharedcontext/src/work/log.rs: RELEASE_REASONS; handoff also needs a p tag */
342
+ "reason"?: "done" | "blocked" | "handoff" | "abandoned" | "needs_input";
343
+ "to"?: string | null;
344
+ "session"?: (null | SessionRef);
345
+ };
346
+ /** crates/sharedcontext/src/work/types.rs ClaimExpired. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
347
+ export type ClaimExpired = {
348
+ "claim"?: string;
349
+ "lease_until"?: number;
350
+ "swept_at"?: number;
351
+ };
352
+ /** crates/sharedcontext/src/work/types.rs StateTransitioned. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
353
+ export type StateTransitioned = {
354
+ "from"?: string;
355
+ "to"?: string;
356
+ "reason"?: string | null;
357
+ "by_rule"?: string | null;
358
+ "gate"?: (null | Gate);
359
+ };
360
+ /** crates/sharedcontext/src/work/types.rs GateCleared. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
361
+ export type GateCleared = {
362
+ "ref"?: string;
363
+ "reason"?: string | null;
364
+ };
365
+ /** crates/sharedcontext/src/work/types.rs EvidenceAttached. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
366
+ export type EvidenceAttached = {
367
+ "run_id"?: string;
368
+ "record_digest"?: string | null;
369
+ "sha"?: string | null;
370
+ "stage"?: string;
371
+ "verdicts"?: Verdict[];
372
+ "coverage"?: string;
373
+ "confidence"?: string;
374
+ };
375
+ /** crates/sharedcontext/src/work/types.rs FindingsSeen. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
376
+ export type FindingsSeen = {
377
+ "run_id"?: string;
378
+ "sha"?: string | null;
379
+ "seen"?: string[];
380
+ "gone"?: string[];
381
+ "fp_scheme"?: string;
382
+ };
383
+ /** crates/sharedcontext/src/work/types.rs RefSet. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. sharedcontext/1.1: repo, RefSet.repo. */
384
+ export type RefSet = {
385
+ "system"?: string;
386
+ "external_id"?: string;
387
+ "url"?: string | null;
388
+ "fields_owned"?: string[];
389
+ /** the whole current list for this system; absent leaves it as it was */
390
+ "blocked_by"?: string[] | null;
391
+ /** Required when the signing key is scoped to one repository, and equal to the node's resolved repo; a "*"-scoped key or a steward sends none (checked when present). A log rule, so the shape keeps it optional. */
392
+ "repo"?: (null | RepoRef);
393
+ };
394
+ /** crates/sharedcontext/src/work/types.rs AdapterSynced. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
395
+ export type AdapterSynced = {
396
+ "system"?: string;
397
+ "external_id"?: string;
398
+ "direction"?: string;
399
+ "fields"?: string[];
400
+ "external_version"?: string | null;
401
+ "source"?: (null | Provenance);
402
+ };
403
+ /** crates/sharedcontext/src/work/types.rs ChangeExternalEvent. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. sharedcontext/1.1: repo, ChangeExternalEvent.repo. */
404
+ export type ChangeExternalEvent = {
405
+ "system"?: string;
406
+ /** crates/sharedcontext/src/work/log.rs: EXTERNAL_EVENTS */
407
+ "event"?: "opened" | "synchronized" | "review_requested" | "approved" | "merged" | "closed";
408
+ "head_sha"?: string | null;
409
+ "merge_sha"?: string | null;
410
+ "at"?: number | null;
411
+ "ref"?: string | null;
412
+ "pr"?: (null | PrRef);
413
+ "external_status"?: string | null;
414
+ "source"?: (null | Provenance);
415
+ /** Required in a project with two or more active repositories and equal to the node's resolved repo; optional (checked when present) in a single-repo project. The requirement is a log rule, so the shape keeps it optional. */
416
+ "repo"?: (null | RepoRef);
417
+ };
418
+ /** crates/sharedcontext/src/work/types.rs ExternalStateChanged. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
419
+ export type ExternalStateChanged = {
420
+ "system"?: string;
421
+ "from"?: string | null;
422
+ "to"?: string;
423
+ "actor"?: string | null;
424
+ "ref"?: string | null;
425
+ "at"?: number | null;
426
+ "reason"?: string | null;
427
+ "external_status"?: string | null;
428
+ "source"?: (null | Provenance);
429
+ };
430
+ /** crates/sharedcontext/src/work/types.rs GoalMeasuresSet. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
431
+ export type GoalMeasuresSet = {
432
+ "measures"?: Measure[];
433
+ "reason"?: string | null;
434
+ };
435
+ /** crates/sharedcontext/src/work/types.rs MeasureObserved. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
436
+ export type MeasureObserved = {
437
+ "measure"?: string;
438
+ "value"?: number | null;
439
+ "at"?: number;
440
+ "source_ref"?: string | null;
441
+ };
442
+ /** crates/sharedcontext/src/work/types.rs ActorEnrolled. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
443
+ export type ActorEnrolled = {
444
+ "pubkey"?: string;
445
+ "sponsor"?: string;
446
+ "label"?: string;
447
+ /** crates/sharedcontext/src/work/log.rs: signed::STAGES */
448
+ "stage"?: "shadow" | "nonprod" | "prod" | null;
449
+ "limits"?: (null | Limits);
450
+ "expires_at"?: number | null;
451
+ "profile"?: (null | ProfileFields);
452
+ };
453
+ /** crates/sharedcontext/src/work/types.rs ProfileSet (flattens ProfileFields). Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
454
+ export type ProjectProfileSet = {
455
+ "pubkey"?: string;
456
+ /** crates/sharedcontext/src/work/types.rs MEMBER_KINDS */
457
+ "kind"?: "person" | "agent";
458
+ "sponsor"?: string | null;
459
+ "reason"?: string | null;
460
+ "org"?: string | null;
461
+ "teams"?: string[];
462
+ "member_id"?: string | null;
463
+ "role"?: string | null;
464
+ "flags"?: (null | Flags);
465
+ /** crates/sharedcontext/src/work/log.rs: TRUST_LEVELS */
466
+ "trust"?: "standard" | "review" | null;
467
+ /** crates/sharedcontext/src/work/log.rs: LIFECYCLES */
468
+ "lifecycle"?: "active" | "paused" | "retired" | null;
469
+ };
470
+ /** crates/sharedcontext/src/work/types.rs BudgetSet. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
471
+ export type ProjectBudgetSet = {
472
+ "id"?: string;
473
+ "scope"?: {
474
+ /** crates/sharedcontext/src/work/log.rs: BUDGET_SCOPES */
475
+ "kind"?: "org" | "team" | "project" | "goal" | "agent" | "session";
476
+ [key: string]: unknown;
477
+ } & (Scope);
478
+ /** crates/sharedcontext/src/work/log.rs: BUDGET_METRICS */
479
+ "metric"?: "billed_cents" | "tokens" | "compute_minutes";
480
+ /** crates/sharedcontext/src/work/log.rs: BUDGET_WINDOWS */
481
+ "window"?: "calendar_month_utc" | "lifetime";
482
+ "amount"?: number | null;
483
+ "warn_percent"?: number | null;
484
+ "hard_stop"?: boolean;
485
+ /** block (default) · allow */
486
+ "unpriced"?: string | null;
487
+ /** false withdraws the budget; default true */
488
+ "active"?: boolean | null;
489
+ "reason"?: string | null;
490
+ };
491
+ /** crates/sharedcontext/src/work/types.rs RuleSet. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
492
+ export type ProjectRuleSet = {
493
+ "id"?: string;
494
+ "scope"?: {
495
+ /** crates/sharedcontext/src/work/log.rs: RULE_SCOPES */
496
+ "kind"?: "org" | "team" | "agent" | "member";
497
+ [key: string]: unknown;
498
+ } & (Scope);
499
+ /** crates/sharedcontext/src/work/log.rs: RULE_EFFECTS */
500
+ "effect"?: "permit" | "forbid";
501
+ "actions"?: string[];
502
+ "active"?: boolean | null;
503
+ "reason"?: string | null;
504
+ };
505
+ /** crates/sharedcontext/src/work/types.rs BudgetIncident. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
506
+ export type ProjectBudgetIncident = {
507
+ "budget"?: string;
508
+ "scope"?: Scope;
509
+ "metric"?: string;
510
+ "window"?: string;
511
+ "spent"?: number;
512
+ "amount"?: number;
513
+ /** the cost.recorded event that crossed the limit */
514
+ "cost"?: string;
515
+ "node"?: string | null;
516
+ "unpriced"?: boolean;
517
+ };
518
+ /** crates/sharedcontext/src/work/types.rs CostRecorded. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
519
+ export type CostRecorded = {
520
+ "agent"?: string;
521
+ "node"?: string | null;
522
+ "goal"?: string | null;
523
+ "job"?: string | null;
524
+ "session"?: string | null;
525
+ "provider"?: string;
526
+ "biller"?: string;
527
+ /** crates/sharedcontext/src/work/log.rs: BILLING_TYPES */
528
+ "billing_type"?: "metered" | "subscription_included" | "subscription_overage";
529
+ "amount"?: number | null;
530
+ /** crates/sharedcontext/src/work/log.rs: BUDGET_METRICS as the unit */
531
+ "unit"?: "billed_cents" | "tokens" | "compute_minutes";
532
+ "unpriced"?: boolean;
533
+ "idempotency_key"?: string;
534
+ };
535
+ /** crates/sharedcontext/src/work/types.rs GateApproved. Top-level fields are strict: the log refuses any other (unknown_field); nested objects are lenient except source. */
536
+ export type GateApproved = {
537
+ /** the open approval gate */
538
+ "ref"?: string;
539
+ "reason"?: string | null;
540
+ };
541
+ /** sharedcontext/1.1: crates/sharedcontext/src/work/types.rs ProjectRepoSet; steward-signed, tag j and no n. Adds a repository or changes the default_branch or state of a listed one, keyed by repo key. Never removes. Log rules (not shape): archiving the only active repository is refused; activating a second repository is refused while any adapter key in the registry has no repo. Top-level fields are strict: the log refuses any other (unknown_field). */
542
+ export type ProjectRepoSet = {
543
+ "repo": RepoRef;
544
+ "default_branch"?: string | null;
545
+ "state": "active" | "archived";
546
+ };
547
+ /** The content of each event type of content.schema.json, keyed by its `w` tag. */
548
+ export interface ContentByType {
549
+ "project.created": ProjectCreated;
550
+ "project.policy_set": ProjectPolicySet;
551
+ "node.created": NodeCreated;
552
+ "node.updated": NodeUpdated;
553
+ "node.moved": NodeMoved;
554
+ "node.linked": NodeLinked;
555
+ "node.unlinked": NodeUnlinked;
556
+ "node.split": NodeSplit;
557
+ "node.merged": NodeMerged;
558
+ "node.closed": NodeClosed;
559
+ "node.reopened": NodeReopened;
560
+ "note.added": NoteAdded;
561
+ "context.pinned": ContextPinned;
562
+ "claim.taken": ClaimTaken;
563
+ "claim.renewed": ClaimRenewed;
564
+ "claim.released": ClaimReleased;
565
+ "claim.expired": ClaimExpired;
566
+ "state.transitioned": StateTransitioned;
567
+ "gate.cleared": GateCleared;
568
+ "evidence.attached": EvidenceAttached;
569
+ "findings.seen": FindingsSeen;
570
+ "ref.set": RefSet;
571
+ "adapter.synced": AdapterSynced;
572
+ "change.external_event": ChangeExternalEvent;
573
+ "external.state_changed": ExternalStateChanged;
574
+ "goal.measures_set": GoalMeasuresSet;
575
+ "measure.observed": MeasureObserved;
576
+ "actor.enrolled": ActorEnrolled;
577
+ "project.profile_set": ProjectProfileSet;
578
+ "project.budget_set": ProjectBudgetSet;
579
+ "project.rule_set": ProjectRuleSet;
580
+ "project.budget_incident": ProjectBudgetIncident;
581
+ "cost.recorded": CostRecorded;
582
+ "gate.approved": GateApproved;
583
+ "project.repo_set": ProjectRepoSet;
584
+ }
585
+ /** An event type of content.schema.json. */
586
+ export type EventType = keyof ContentByType;
587
+ /** The event types of content.schema.json, in its order. */
588
+ export declare const EVENT_TYPES: readonly EventType[];
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/generate.mjs from schemas/sharedcontext-1/. Do not edit.
2
+ /** The event types of content.schema.json, in its order. */
3
+ export const EVENT_TYPES = ["project.created", "project.policy_set", "node.created", "node.updated", "node.moved", "node.linked", "node.unlinked", "node.split", "node.merged", "node.closed", "node.reopened", "note.added", "context.pinned", "claim.taken", "claim.renewed", "claim.released", "claim.expired", "state.transitioned", "gate.cleared", "evidence.attached", "findings.seen", "ref.set", "adapter.synced", "change.external_event", "external.state_changed", "goal.measures_set", "measure.observed", "actor.enrolled", "project.profile_set", "project.budget_set", "project.rule_set", "project.budget_incident", "cost.recorded", "gate.approved", "project.repo_set"];
@@ -0,0 +1,5 @@
1
+ /** The schema files of sharedcontext/1, by their path in the contract's folder. */
2
+ export declare const SCHEMA_FILES: readonly ["changes.schema.json", "content.schema.json", "context.schema.json", "event.schema.json", "execution.schema.json", "history/content-1.0.schema.json", "lineage.schema.json", "mcp-tools.schema.json", "stored-event.schema.json"];
3
+ export type SchemaFile = (typeof SCHEMA_FILES)[number];
4
+ /** Each schema file's exact text. */
5
+ export declare const SCHEMA_TEXT: Readonly<Record<SchemaFile, string>>;