@davesheffer/hunch 1.31.1 → 1.32.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.
- package/README.md +1 -0
- package/dist/cli/automaticReviewMemory.d.ts +13 -0
- package/dist/cli/dna.d.ts +2 -0
- package/dist/cli/index.d.ts +16 -0
- package/dist/cli/index.js +602 -43
- package/dist/cli/integrations.d.ts +2 -0
- package/dist/cli/integrations.js +5 -2
- package/dist/cli/invocation.d.ts +35 -0
- package/dist/cli/preflight.d.ts +1 -0
- package/dist/cli/reviewMemory.d.ts +4 -0
- package/dist/cli/reviewMemoryProvider.d.ts +14 -0
- package/dist/cli/serve.d.ts +2 -0
- package/dist/cli/taskReport.d.ts +6 -0
- package/dist/cli/taskReport.js +124 -0
- package/dist/cli/update.d.ts +14 -0
- package/dist/client/state.d.ts +248 -0
- package/dist/constitution/adapters.d.ts +29 -0
- package/dist/constitution/behaviorAttestationBinding.d.ts +3 -0
- package/dist/constitution/behaviorEvaluator.d.ts +8 -0
- package/dist/constitution/behaviorProof.d.ts +9 -0
- package/dist/constitution/behaviorWorkspace.d.ts +25 -0
- package/dist/constitution/bootstrap.d.ts +30 -0
- package/dist/constitution/canonical.d.ts +15 -0
- package/dist/constitution/card.d.ts +58 -0
- package/dist/constitution/compiler.d.ts +52 -0
- package/dist/constitution/composition.d.ts +10 -0
- package/dist/constitution/corpus.d.ts +7 -0
- package/dist/constitution/correctionPolicyMaterializer.d.ts +57 -0
- package/dist/constitution/delta.d.ts +4 -0
- package/dist/constitution/disposition.d.ts +20 -0
- package/dist/constitution/evaluator.d.ts +47 -0
- package/dist/constitution/experiment.d.ts +466 -0
- package/dist/constitution/experimentRunner.d.ts +7 -0
- package/dist/constitution/g2.d.ts +209 -0
- package/dist/constitution/g2BehaviorAttestation.d.ts +45 -0
- package/dist/constitution/g2BehaviorCandidates.d.ts +123 -0
- package/dist/constitution/g2BehaviorDependencies.d.ts +83 -0
- package/dist/constitution/g2BehaviorMaterialization.d.ts +77 -0
- package/dist/constitution/g2BehaviorPolicyMaterializer.d.ts +48 -0
- package/dist/constitution/g2CandidateAttestation.d.ts +43 -0
- package/dist/constitution/g2Candidates.d.ts +80 -0
- package/dist/constitution/g2Drills.d.ts +33 -0
- package/dist/constitution/g3.d.ts +311 -0
- package/dist/constitution/g3Conformance.d.ts +33 -0
- package/dist/constitution/lifecycle.d.ts +25 -0
- package/dist/constitution/mutation.d.ts +15 -0
- package/dist/constitution/nodeTestEvidence.d.ts +13 -0
- package/dist/constitution/plan.d.ts +18 -0
- package/dist/constitution/policyRuntime.d.ts +5 -0
- package/dist/constitution/proof.d.ts +11 -0
- package/dist/constitution/repairPolicies.d.ts +34 -0
- package/dist/constitution/replacementFreeGit.d.ts +14 -0
- package/dist/constitution/replay.d.ts +40 -0
- package/dist/constitution/replayCache.d.ts +14 -0
- package/dist/constitution/replayWorker.d.ts +1 -0
- package/dist/constitution/repository.d.ts +129 -0
- package/dist/constitution/safeCheckout.d.ts +9 -0
- package/dist/constitution/schema.d.ts +1763 -0
- package/dist/constitution/scorecard.d.ts +219 -0
- package/dist/constitution/service.d.ts +398 -0
- package/dist/constitution/shadow.d.ts +54 -0
- package/dist/constitution/sourceMutation.d.ts +15 -0
- package/dist/constitution/staticGraphBaseline.d.ts +13 -0
- package/dist/constitution/structural.d.ts +64 -0
- package/dist/core/agenthook.d.ts +63 -0
- package/dist/core/agenthook.js +1 -0
- package/dist/core/automaticReviewMemory.d.ts +60 -0
- package/dist/core/autoreview.d.ts +66 -0
- package/dist/core/canonicalOrder.d.ts +3 -0
- package/dist/core/capturetoken.d.ts +19 -0
- package/dist/core/changeIdentity.d.ts +22 -0
- package/dist/core/changeProof.d.ts +14 -0
- package/dist/core/checkreport.d.ts +140 -0
- package/dist/core/commitrepair.d.ts +171 -0
- package/dist/core/commitrepair.js +238 -0
- package/dist/core/compare.d.ts +21 -0
- package/dist/core/config.d.ts +20 -0
- package/dist/core/conformance.d.ts +35 -0
- package/dist/core/constraintmatch.d.ts +54 -0
- package/dist/core/correction.d.ts +42 -0
- package/dist/core/correctionStage.d.ts +224 -0
- package/dist/core/declarationClusters.d.ts +149 -0
- package/dist/core/delivery.d.ts +110 -0
- package/dist/core/docanchors.d.ts +32 -0
- package/dist/core/docscan.d.ts +26 -0
- package/dist/core/drift.d.ts +13 -0
- package/dist/core/drift.js +31 -1
- package/dist/core/dupdetect.d.ts +43 -0
- package/dist/core/escalations.d.ts +129 -0
- package/dist/core/escalations.js +165 -0
- package/dist/core/events.d.ts +29 -0
- package/dist/core/evidenceMap.d.ts +164 -0
- package/dist/core/externalImports.d.ts +8 -0
- package/dist/core/format.d.ts +13 -0
- package/dist/core/glob.d.ts +9 -0
- package/dist/core/groundingLag.d.ts +84 -0
- package/dist/core/groundingLag.js +16 -2
- package/dist/core/groundingMerge.d.ts +15 -0
- package/dist/core/groundingMerge.js +95 -0
- package/dist/core/hookcache.d.ts +10 -0
- package/dist/core/hookpolicy.d.ts +47 -0
- package/dist/core/ids.d.ts +36 -0
- package/dist/core/importReview.d.ts +30 -0
- package/dist/core/io.d.ts +23 -0
- package/dist/core/jsonc.d.ts +4 -0
- package/dist/core/landscapeAdoption.d.ts +66 -0
- package/dist/core/landscapeDelivery.d.ts +76 -0
- package/dist/core/memorylog.d.ts +37 -0
- package/dist/core/migrate.d.ts +28 -0
- package/dist/core/outcomeExperience.d.ts +89 -0
- package/dist/core/overlaySafety.d.ts +24 -0
- package/dist/core/overlaySafety.js +7 -1
- package/dist/core/paths.d.ts +31 -0
- package/dist/core/pipeline.d.ts +289 -0
- package/dist/core/premises.d.ts +43 -0
- package/dist/core/provenance.d.ts +21 -0
- package/dist/core/publication.d.ts +54 -0
- package/dist/core/refrepair.d.ts +24 -0
- package/dist/core/refrepair.js +1 -1
- package/dist/core/relativeImports.d.ts +11 -0
- package/dist/core/repair.d.ts +44 -0
- package/dist/core/repairqueue.d.ts +40 -0
- package/dist/core/repairqueue.js +133 -0
- package/dist/core/reviewMemory.d.ts +40 -0
- package/dist/core/reviewqueue.d.ts +54 -0
- package/dist/core/safeRepoFile.d.ts +20 -0
- package/dist/core/served.d.ts +57 -0
- package/dist/core/served.js +14 -0
- package/dist/core/stateContract.d.ts +979 -0
- package/dist/core/stateDelivery.d.ts +78 -0
- package/dist/core/stateRecords.d.ts +383 -0
- package/dist/core/stats.d.ts +88 -0
- package/dist/core/strictgate.d.ts +33 -0
- package/dist/core/taskReport.d.ts +226 -0
- package/dist/core/taskReport.js +514 -0
- package/dist/core/taskReportCapture.d.ts +8 -0
- package/dist/core/taskReportCapture.js +36 -0
- package/dist/core/taskReportEvidence.d.ts +26 -0
- package/dist/core/taskReportEvidence.js +268 -0
- package/dist/core/taskReportHook.d.ts +20 -0
- package/dist/core/taskReportHook.js +76 -0
- package/dist/core/taskReportPaths.d.ts +3 -0
- package/dist/core/taskReportPaths.js +23 -0
- package/dist/core/taskReportPublic.d.ts +31 -0
- package/dist/core/taskReportPublic.js +45 -0
- package/dist/core/taskReportRender.d.ts +6 -0
- package/dist/core/taskReportRender.js +97 -0
- package/dist/core/topics.d.ts +73 -0
- package/dist/core/types.d.ts +1239 -0
- package/dist/core/version.d.ts +10 -0
- package/dist/eval/guards.d.ts +45 -0
- package/dist/eval/harness.d.ts +58 -0
- package/dist/extractors/adrImport.d.ts +59 -0
- package/dist/extractors/comments.d.ts +7 -0
- package/dist/extractors/correctionSources.d.ts +11 -0
- package/dist/extractors/diff.d.ts +40 -0
- package/dist/extractors/git.d.ts +304 -0
- package/dist/extractors/git.js +208 -20
- package/dist/extractors/helm.d.ts +31 -0
- package/dist/extractors/indexer.d.ts +55 -0
- package/dist/extractors/landscapeDiscovery.d.ts +41 -0
- package/dist/extractors/languages.d.ts +77 -0
- package/dist/extractors/nativeTreeSitter.d.ts +16 -0
- package/dist/extractors/parse.d.ts +54 -0
- package/dist/extractors/php.d.ts +26 -0
- package/dist/extractors/repoSource.d.ts +53 -0
- package/dist/extractors/testreport.d.ts +36 -0
- package/dist/integrations/ciAction.d.ts +8 -0
- package/dist/integrations/claudeConfig.d.ts +44 -0
- package/dist/integrations/claudemd.d.ts +13 -0
- package/dist/integrations/claudemd.js +11 -2
- package/dist/integrations/gitignore.d.ts +16 -0
- package/dist/integrations/gitignore.js +7 -0
- package/dist/integrations/health.d.ts +74 -0
- package/dist/integrations/hooks.d.ts +41 -0
- package/dist/integrations/hooks.js +92 -66
- package/dist/integrations/madrExport.d.ts +39 -0
- package/dist/integrations/madrManifest.d.ts +69 -0
- package/dist/integrations/mergeDriver.d.ts +3 -0
- package/dist/integrations/mergeDriver.js +25 -8
- package/dist/integrations/probe.d.ts +4 -0
- package/dist/integrations/providers.d.ts +103 -0
- package/dist/integrations/scaffold.d.ts +29 -0
- package/dist/integrations/sync.d.ts +30 -0
- package/dist/integrations/sync.js +3 -2
- package/dist/integrations/team.d.ts +70 -0
- package/dist/integrations/worktree.d.ts +8 -0
- package/dist/mcp/roots.d.ts +16 -0
- package/dist/mcp/server.d.ts +36 -0
- package/dist/mcp/server.js +74 -22
- package/dist/mcp/taskReportTools.d.ts +3 -0
- package/dist/mcp/taskReportTools.js +106 -0
- package/dist/serve/app.d.ts +36 -0
- package/dist/serve/config.d.ts +100 -0
- package/dist/serve/writelock.d.ts +22 -0
- package/dist/store/changeLedger.d.ts +132 -0
- package/dist/store/compact.d.ts +33 -0
- package/dist/store/db.d.ts +9 -0
- package/dist/store/embedder.d.ts +32 -0
- package/dist/store/hunchStore.d.ts +624 -0
- package/dist/store/hunchStore.js +6 -3
- package/dist/store/jsonStore.d.ts +125 -0
- package/dist/store/merge.d.ts +39 -0
- package/dist/store/privateMigrate.d.ts +24 -0
- package/dist/store/replay.d.ts +56 -0
- package/dist/store/schema.d.ts +17 -0
- package/dist/store/stateBinding.d.ts +145 -0
- package/dist/store/stateCapture.d.ts +15 -0
- package/dist/synthesis/cliAdapter.d.ts +22 -0
- package/dist/synthesis/initiator.d.ts +13 -0
- package/dist/synthesis/provider.d.ts +307 -0
- package/dist/synthesis/synthesize.d.ts +117 -0
- package/dist/synthesis/tripwires.d.ts +9 -0
- package/dist/taskReports.d.ts +76 -0
- package/dist/taskReports.js +67 -0
- package/dist/wiki/adopt.d.ts +22 -0
- package/dist/wiki/graph.d.ts +87 -0
- package/dist/wiki/wiki.d.ts +242 -0
- package/package.json +6 -5
- package/server.json +2 -2
|
@@ -0,0 +1,979 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type DeliveryEnvelope } from "./delivery.js";
|
|
3
|
+
import { type Scope, type ActionReceipt, type Commitment, type DerivedState } from "./stateRecords.js";
|
|
4
|
+
export * from "./stateRecords.js";
|
|
5
|
+
export declare const STATE_CONTRACT_VERSION: "nuryel.state/1";
|
|
6
|
+
export declare const STATE_READ_VERSION: "nuryel.state.read/1";
|
|
7
|
+
export declare const STATE_WRITE_VERSION: "nuryel.state.write/1";
|
|
8
|
+
export declare const STATE_SUBSCRIBE_VERSION: "nuryel.state.subscribe/1";
|
|
9
|
+
export declare const STATE_RECORDS_VERSION: "nuryel.state.records/1";
|
|
10
|
+
export declare const STATE_CAPTURE_VERSION: "nuryel.state.capture/1";
|
|
11
|
+
export declare const STATE_CAPTURE_BATCH_VERSION: "nuryel.state.capture-batch/1";
|
|
12
|
+
export declare const STATE_OBSERVATION_LINKS_VERSION: "nuryel.observation-links/1";
|
|
13
|
+
export declare const STATE_OBSERVATION_REVIEW_VERSION: "nuryel.observation-review/1";
|
|
14
|
+
export declare const STATE_OBSERVATION_PAGES_VERSION: "nuryel.observation-pages/1";
|
|
15
|
+
/** Capabilities a server advertises; a client that needs one the server lacks gets a typed
|
|
16
|
+
* `unsupported`, never a compatible-looking degraded answer. */
|
|
17
|
+
export declare const STATE_CAPABILITIES: readonly ["nuryel.state.read/1", "nuryel.state.write/1", "nuryel.state.subscribe/1", "nuryel.state.records/1", "nuryel.state.capture/1", "nuryel.state.capture-batch/1", "nuryel.observation-links/1", "nuryel.observation-review/1", "nuryel.observation-pages/1", "nuryel.receipt/1", "nuryel.commitment/1", "nuryel.derived/1", "nuryel.entity/1", "nuryel.relationship/1"];
|
|
18
|
+
export type StateCapability = (typeof STATE_CAPABILITIES)[number];
|
|
19
|
+
/** Who is reading or writing. Grants are the scopes the principal may see; authorization is
|
|
20
|
+
* decided BEFORE retrieval against these, never after ranking. */
|
|
21
|
+
export declare const PrincipalSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
service: "service";
|
|
25
|
+
human: "human";
|
|
26
|
+
agent: "agent";
|
|
27
|
+
}>;
|
|
28
|
+
display: z.ZodOptional<z.ZodString>;
|
|
29
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
30
|
+
kind: z.ZodEnum<{
|
|
31
|
+
repository: "repository";
|
|
32
|
+
organization: "organization";
|
|
33
|
+
team: "team";
|
|
34
|
+
user: "user";
|
|
35
|
+
}>;
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type Principal = z.infer<typeof PrincipalSchema>;
|
|
40
|
+
/** One relevant assertion, never a whole conversation. Source text is transient input:
|
|
41
|
+
* only its exact supporting excerpt and a hashed external pointer may reach the store. */
|
|
42
|
+
export declare const CaptureRequestSchema: z.ZodObject<{
|
|
43
|
+
schema: z.ZodLiteral<"nuryel.state.capture/1">;
|
|
44
|
+
principal: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
kind: z.ZodEnum<{
|
|
47
|
+
service: "service";
|
|
48
|
+
human: "human";
|
|
49
|
+
agent: "agent";
|
|
50
|
+
}>;
|
|
51
|
+
display: z.ZodOptional<z.ZodString>;
|
|
52
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
53
|
+
kind: z.ZodEnum<{
|
|
54
|
+
repository: "repository";
|
|
55
|
+
organization: "organization";
|
|
56
|
+
team: "team";
|
|
57
|
+
user: "user";
|
|
58
|
+
}>;
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
scope: z.ZodObject<{
|
|
63
|
+
kind: z.ZodEnum<{
|
|
64
|
+
repository: "repository";
|
|
65
|
+
organization: "organization";
|
|
66
|
+
team: "team";
|
|
67
|
+
user: "user";
|
|
68
|
+
}>;
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
subject: z.ZodString;
|
|
72
|
+
statement: z.ZodString;
|
|
73
|
+
relevance: z.ZodObject<{
|
|
74
|
+
use: z.ZodEnum<{
|
|
75
|
+
decision: "decision";
|
|
76
|
+
constraint: "constraint";
|
|
77
|
+
preference: "preference";
|
|
78
|
+
operational_fact: "operational_fact";
|
|
79
|
+
ongoing_issue: "ongoing_issue";
|
|
80
|
+
}>;
|
|
81
|
+
reason: z.ZodString;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
84
|
+
ref: z.ZodObject<{
|
|
85
|
+
system: z.ZodString;
|
|
86
|
+
object_type: z.ZodString;
|
|
87
|
+
object_key: z.ZodString;
|
|
88
|
+
version: z.ZodOptional<z.ZodString>;
|
|
89
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
90
|
+
observed_at: z.ZodString;
|
|
91
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
source_text: z.ZodString;
|
|
94
|
+
excerpt: z.ZodString;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export type CaptureRequest = z.infer<typeof CaptureRequestSchema>;
|
|
98
|
+
/** Sources cross the transport once; assertions name only their supporting excerpts. */
|
|
99
|
+
export declare const CaptureBatchRequestSchema: z.ZodObject<{
|
|
100
|
+
schema: z.ZodLiteral<"nuryel.state.capture-batch/1">;
|
|
101
|
+
principal: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
kind: z.ZodEnum<{
|
|
104
|
+
service: "service";
|
|
105
|
+
human: "human";
|
|
106
|
+
agent: "agent";
|
|
107
|
+
}>;
|
|
108
|
+
display: z.ZodOptional<z.ZodString>;
|
|
109
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
110
|
+
kind: z.ZodEnum<{
|
|
111
|
+
repository: "repository";
|
|
112
|
+
organization: "organization";
|
|
113
|
+
team: "team";
|
|
114
|
+
user: "user";
|
|
115
|
+
}>;
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
scope: z.ZodObject<{
|
|
120
|
+
kind: z.ZodEnum<{
|
|
121
|
+
repository: "repository";
|
|
122
|
+
organization: "organization";
|
|
123
|
+
team: "team";
|
|
124
|
+
user: "user";
|
|
125
|
+
}>;
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
129
|
+
ref: z.ZodObject<{
|
|
130
|
+
system: z.ZodString;
|
|
131
|
+
object_type: z.ZodString;
|
|
132
|
+
object_key: z.ZodString;
|
|
133
|
+
version: z.ZodOptional<z.ZodString>;
|
|
134
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
135
|
+
observed_at: z.ZodString;
|
|
136
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
source_text: z.ZodString;
|
|
139
|
+
}, z.core.$strict>>;
|
|
140
|
+
observations: z.ZodArray<z.ZodObject<{
|
|
141
|
+
relevance: z.ZodObject<{
|
|
142
|
+
use: z.ZodEnum<{
|
|
143
|
+
decision: "decision";
|
|
144
|
+
constraint: "constraint";
|
|
145
|
+
preference: "preference";
|
|
146
|
+
operational_fact: "operational_fact";
|
|
147
|
+
ongoing_issue: "ongoing_issue";
|
|
148
|
+
}>;
|
|
149
|
+
reason: z.ZodString;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
subject: z.ZodString;
|
|
152
|
+
statement: z.ZodString;
|
|
153
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
154
|
+
source: z.ZodNumber;
|
|
155
|
+
excerpt: z.ZodString;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
reviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
|
+
record_id: z.ZodString;
|
|
160
|
+
expected_hash: z.ZodString;
|
|
161
|
+
reason: z.ZodString;
|
|
162
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
163
|
+
source: z.ZodNumber;
|
|
164
|
+
excerpt: z.ZodString;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
}, z.core.$strict>>>;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
export type CaptureBatchRequest = z.infer<typeof CaptureBatchRequestSchema>;
|
|
169
|
+
export declare const CAPTURE_TRANSFORM = "agent-capture/1:";
|
|
170
|
+
export declare const normalizeAssertion: (text: string) => string;
|
|
171
|
+
export declare function captureTransform(scope: Scope, subject: string, statement: string, evidence: {
|
|
172
|
+
source: string;
|
|
173
|
+
excerpt: string;
|
|
174
|
+
}[]): string;
|
|
175
|
+
export declare const STATE_FACETS: readonly ["decisions", "constraints", "bugs", "findings", "receipts", "commitments", "derived", "entities", "relationships"];
|
|
176
|
+
export type StateFacet = (typeof STATE_FACETS)[number];
|
|
177
|
+
/** Union read: the partitions a principal wants in ONE answer. `scope` stays required (it is the
|
|
178
|
+
* primary partition; its envelope and receipt lead the response). An entry the principal is not
|
|
179
|
+
* granted is NAMED in `denied_scopes` — it never refuses the whole call, and is never described. */
|
|
180
|
+
export declare const ReadScopesSchema: z.ZodArray<z.ZodObject<{
|
|
181
|
+
kind: z.ZodEnum<{
|
|
182
|
+
repository: "repository";
|
|
183
|
+
organization: "organization";
|
|
184
|
+
team: "team";
|
|
185
|
+
user: "user";
|
|
186
|
+
}>;
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
export declare const ObservationCursorSchema: z.ZodObject<{
|
|
190
|
+
snapshot_hash: z.ZodString;
|
|
191
|
+
offset: z.ZodNumber;
|
|
192
|
+
}, z.core.$strict>;
|
|
193
|
+
export declare const ReadRequestSchema: z.ZodObject<{
|
|
194
|
+
schema: z.ZodLiteral<"nuryel.state.read/1">;
|
|
195
|
+
principal: z.ZodObject<{
|
|
196
|
+
id: z.ZodString;
|
|
197
|
+
kind: z.ZodEnum<{
|
|
198
|
+
service: "service";
|
|
199
|
+
human: "human";
|
|
200
|
+
agent: "agent";
|
|
201
|
+
}>;
|
|
202
|
+
display: z.ZodOptional<z.ZodString>;
|
|
203
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
204
|
+
kind: z.ZodEnum<{
|
|
205
|
+
repository: "repository";
|
|
206
|
+
organization: "organization";
|
|
207
|
+
team: "team";
|
|
208
|
+
user: "user";
|
|
209
|
+
}>;
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
}, z.core.$strict>>;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
scope: z.ZodObject<{
|
|
214
|
+
kind: z.ZodEnum<{
|
|
215
|
+
repository: "repository";
|
|
216
|
+
organization: "organization";
|
|
217
|
+
team: "team";
|
|
218
|
+
user: "user";
|
|
219
|
+
}>;
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
223
|
+
kind: z.ZodEnum<{
|
|
224
|
+
repository: "repository";
|
|
225
|
+
organization: "organization";
|
|
226
|
+
team: "team";
|
|
227
|
+
user: "user";
|
|
228
|
+
}>;
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
}, z.core.$strict>>>;
|
|
231
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
232
|
+
task: z.ZodOptional<z.ZodString>;
|
|
233
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
234
|
+
builder: "builder";
|
|
235
|
+
reviewer: "reviewer";
|
|
236
|
+
architect: "architect";
|
|
237
|
+
}>>;
|
|
238
|
+
budget_tokens: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
facets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
240
|
+
decisions: "decisions";
|
|
241
|
+
constraints: "constraints";
|
|
242
|
+
bugs: "bugs";
|
|
243
|
+
findings: "findings";
|
|
244
|
+
receipts: "receipts";
|
|
245
|
+
commitments: "commitments";
|
|
246
|
+
derived: "derived";
|
|
247
|
+
entities: "entities";
|
|
248
|
+
relationships: "relationships";
|
|
249
|
+
}>>>;
|
|
250
|
+
observed_page: z.ZodOptional<z.ZodObject<{
|
|
251
|
+
cursor: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
snapshot_hash: z.ZodString;
|
|
253
|
+
offset: z.ZodNumber;
|
|
254
|
+
}, z.core.$strict>>;
|
|
255
|
+
}, z.core.$strict>>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
export type ReadRequest = z.infer<typeof ReadRequestSchema>;
|
|
258
|
+
declare const StateRefSchema: z.ZodObject<{
|
|
259
|
+
facet: z.ZodEnum<{
|
|
260
|
+
decisions: "decisions";
|
|
261
|
+
constraints: "constraints";
|
|
262
|
+
bugs: "bugs";
|
|
263
|
+
findings: "findings";
|
|
264
|
+
receipts: "receipts";
|
|
265
|
+
commitments: "commitments";
|
|
266
|
+
derived: "derived";
|
|
267
|
+
entities: "entities";
|
|
268
|
+
relationships: "relationships";
|
|
269
|
+
}>;
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
record_hash: z.ZodString;
|
|
272
|
+
scope: z.ZodObject<{
|
|
273
|
+
kind: z.ZodEnum<{
|
|
274
|
+
repository: "repository";
|
|
275
|
+
organization: "organization";
|
|
276
|
+
team: "team";
|
|
277
|
+
user: "user";
|
|
278
|
+
}>;
|
|
279
|
+
id: z.ZodString;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
export type StateRef = z.infer<typeof StateRefSchema>;
|
|
283
|
+
/** The system-of-record answer for a subject: what is true now, on what it rests, what would
|
|
284
|
+
* invalidate it. Carried beside the existing delivery envelope, under the same receipt. */
|
|
285
|
+
export declare const StateOfRecordSchema: z.ZodObject<{
|
|
286
|
+
subject: z.ZodString;
|
|
287
|
+
current: z.ZodArray<z.ZodObject<{
|
|
288
|
+
facet: z.ZodEnum<{
|
|
289
|
+
decisions: "decisions";
|
|
290
|
+
constraints: "constraints";
|
|
291
|
+
bugs: "bugs";
|
|
292
|
+
findings: "findings";
|
|
293
|
+
receipts: "receipts";
|
|
294
|
+
commitments: "commitments";
|
|
295
|
+
derived: "derived";
|
|
296
|
+
entities: "entities";
|
|
297
|
+
relationships: "relationships";
|
|
298
|
+
}>;
|
|
299
|
+
id: z.ZodString;
|
|
300
|
+
record_hash: z.ZodString;
|
|
301
|
+
scope: z.ZodObject<{
|
|
302
|
+
kind: z.ZodEnum<{
|
|
303
|
+
repository: "repository";
|
|
304
|
+
organization: "organization";
|
|
305
|
+
team: "team";
|
|
306
|
+
user: "user";
|
|
307
|
+
}>;
|
|
308
|
+
id: z.ZodString;
|
|
309
|
+
}, z.core.$strict>;
|
|
310
|
+
}, z.core.$strict>>;
|
|
311
|
+
in_force: z.ZodArray<z.ZodObject<{
|
|
312
|
+
facet: z.ZodEnum<{
|
|
313
|
+
decisions: "decisions";
|
|
314
|
+
constraints: "constraints";
|
|
315
|
+
bugs: "bugs";
|
|
316
|
+
findings: "findings";
|
|
317
|
+
receipts: "receipts";
|
|
318
|
+
commitments: "commitments";
|
|
319
|
+
derived: "derived";
|
|
320
|
+
entities: "entities";
|
|
321
|
+
relationships: "relationships";
|
|
322
|
+
}>;
|
|
323
|
+
id: z.ZodString;
|
|
324
|
+
record_hash: z.ZodString;
|
|
325
|
+
scope: z.ZodObject<{
|
|
326
|
+
kind: z.ZodEnum<{
|
|
327
|
+
repository: "repository";
|
|
328
|
+
organization: "organization";
|
|
329
|
+
team: "team";
|
|
330
|
+
user: "user";
|
|
331
|
+
}>;
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
}, z.core.$strict>;
|
|
334
|
+
}, z.core.$strict>>;
|
|
335
|
+
done: z.ZodArray<z.ZodObject<{
|
|
336
|
+
facet: z.ZodEnum<{
|
|
337
|
+
decisions: "decisions";
|
|
338
|
+
constraints: "constraints";
|
|
339
|
+
bugs: "bugs";
|
|
340
|
+
findings: "findings";
|
|
341
|
+
receipts: "receipts";
|
|
342
|
+
commitments: "commitments";
|
|
343
|
+
derived: "derived";
|
|
344
|
+
entities: "entities";
|
|
345
|
+
relationships: "relationships";
|
|
346
|
+
}>;
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
record_hash: z.ZodString;
|
|
349
|
+
scope: z.ZodObject<{
|
|
350
|
+
kind: z.ZodEnum<{
|
|
351
|
+
repository: "repository";
|
|
352
|
+
organization: "organization";
|
|
353
|
+
team: "team";
|
|
354
|
+
user: "user";
|
|
355
|
+
}>;
|
|
356
|
+
id: z.ZodString;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
}, z.core.$strict>>;
|
|
359
|
+
observed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
360
|
+
facet: z.ZodEnum<{
|
|
361
|
+
decisions: "decisions";
|
|
362
|
+
constraints: "constraints";
|
|
363
|
+
bugs: "bugs";
|
|
364
|
+
findings: "findings";
|
|
365
|
+
receipts: "receipts";
|
|
366
|
+
commitments: "commitments";
|
|
367
|
+
derived: "derived";
|
|
368
|
+
entities: "entities";
|
|
369
|
+
relationships: "relationships";
|
|
370
|
+
}>;
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
record_hash: z.ZodString;
|
|
373
|
+
scope: z.ZodObject<{
|
|
374
|
+
kind: z.ZodEnum<{
|
|
375
|
+
repository: "repository";
|
|
376
|
+
organization: "organization";
|
|
377
|
+
team: "team";
|
|
378
|
+
user: "user";
|
|
379
|
+
}>;
|
|
380
|
+
id: z.ZodString;
|
|
381
|
+
}, z.core.$strict>;
|
|
382
|
+
}, z.core.$strict>>>;
|
|
383
|
+
observed_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
384
|
+
observed_page: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
snapshot_hash: z.ZodString;
|
|
386
|
+
total: z.ZodNumber;
|
|
387
|
+
next_cursor: z.ZodNullable<z.ZodObject<{
|
|
388
|
+
snapshot_hash: z.ZodString;
|
|
389
|
+
offset: z.ZodNumber;
|
|
390
|
+
}, z.core.$strict>>;
|
|
391
|
+
}, z.core.$strict>>;
|
|
392
|
+
relationships_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
393
|
+
depends_on: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
394
|
+
kind: z.ZodLiteral<"record">;
|
|
395
|
+
id: z.ZodString;
|
|
396
|
+
record_hash: z.ZodString;
|
|
397
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
398
|
+
kind: z.ZodEnum<{
|
|
399
|
+
repository: "repository";
|
|
400
|
+
organization: "organization";
|
|
401
|
+
team: "team";
|
|
402
|
+
user: "user";
|
|
403
|
+
}>;
|
|
404
|
+
id: z.ZodString;
|
|
405
|
+
}, z.core.$strict>>;
|
|
406
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
407
|
+
kind: z.ZodLiteral<"external">;
|
|
408
|
+
ref: z.ZodObject<{
|
|
409
|
+
system: z.ZodString;
|
|
410
|
+
object_type: z.ZodString;
|
|
411
|
+
object_key: z.ZodString;
|
|
412
|
+
version: z.ZodOptional<z.ZodString>;
|
|
413
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
414
|
+
observed_at: z.ZodString;
|
|
415
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
416
|
+
}, z.core.$strict>;
|
|
417
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
418
|
+
kind: z.ZodLiteral<"schema">;
|
|
419
|
+
name: z.ZodString;
|
|
420
|
+
fingerprint: z.ZodString;
|
|
421
|
+
}, z.core.$strict>], "kind">>;
|
|
422
|
+
invalidated_by: z.ZodArray<z.ZodString>;
|
|
423
|
+
}, z.core.$strict>;
|
|
424
|
+
export type StateOfRecord = z.infer<typeof StateOfRecordSchema>;
|
|
425
|
+
export declare const ReadResponseSchema: z.ZodObject<{
|
|
426
|
+
schema: z.ZodLiteral<"nuryel.state.read/1">;
|
|
427
|
+
receipt_id: z.ZodString;
|
|
428
|
+
scope: z.ZodObject<{
|
|
429
|
+
kind: z.ZodEnum<{
|
|
430
|
+
repository: "repository";
|
|
431
|
+
organization: "organization";
|
|
432
|
+
team: "team";
|
|
433
|
+
user: "user";
|
|
434
|
+
}>;
|
|
435
|
+
id: z.ZodString;
|
|
436
|
+
}, z.core.$strict>;
|
|
437
|
+
state_of_record: z.ZodNullable<z.ZodObject<{
|
|
438
|
+
subject: z.ZodString;
|
|
439
|
+
current: z.ZodArray<z.ZodObject<{
|
|
440
|
+
facet: z.ZodEnum<{
|
|
441
|
+
decisions: "decisions";
|
|
442
|
+
constraints: "constraints";
|
|
443
|
+
bugs: "bugs";
|
|
444
|
+
findings: "findings";
|
|
445
|
+
receipts: "receipts";
|
|
446
|
+
commitments: "commitments";
|
|
447
|
+
derived: "derived";
|
|
448
|
+
entities: "entities";
|
|
449
|
+
relationships: "relationships";
|
|
450
|
+
}>;
|
|
451
|
+
id: z.ZodString;
|
|
452
|
+
record_hash: z.ZodString;
|
|
453
|
+
scope: z.ZodObject<{
|
|
454
|
+
kind: z.ZodEnum<{
|
|
455
|
+
repository: "repository";
|
|
456
|
+
organization: "organization";
|
|
457
|
+
team: "team";
|
|
458
|
+
user: "user";
|
|
459
|
+
}>;
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
}, z.core.$strict>;
|
|
462
|
+
}, z.core.$strict>>;
|
|
463
|
+
in_force: z.ZodArray<z.ZodObject<{
|
|
464
|
+
facet: z.ZodEnum<{
|
|
465
|
+
decisions: "decisions";
|
|
466
|
+
constraints: "constraints";
|
|
467
|
+
bugs: "bugs";
|
|
468
|
+
findings: "findings";
|
|
469
|
+
receipts: "receipts";
|
|
470
|
+
commitments: "commitments";
|
|
471
|
+
derived: "derived";
|
|
472
|
+
entities: "entities";
|
|
473
|
+
relationships: "relationships";
|
|
474
|
+
}>;
|
|
475
|
+
id: z.ZodString;
|
|
476
|
+
record_hash: z.ZodString;
|
|
477
|
+
scope: z.ZodObject<{
|
|
478
|
+
kind: z.ZodEnum<{
|
|
479
|
+
repository: "repository";
|
|
480
|
+
organization: "organization";
|
|
481
|
+
team: "team";
|
|
482
|
+
user: "user";
|
|
483
|
+
}>;
|
|
484
|
+
id: z.ZodString;
|
|
485
|
+
}, z.core.$strict>;
|
|
486
|
+
}, z.core.$strict>>;
|
|
487
|
+
done: z.ZodArray<z.ZodObject<{
|
|
488
|
+
facet: z.ZodEnum<{
|
|
489
|
+
decisions: "decisions";
|
|
490
|
+
constraints: "constraints";
|
|
491
|
+
bugs: "bugs";
|
|
492
|
+
findings: "findings";
|
|
493
|
+
receipts: "receipts";
|
|
494
|
+
commitments: "commitments";
|
|
495
|
+
derived: "derived";
|
|
496
|
+
entities: "entities";
|
|
497
|
+
relationships: "relationships";
|
|
498
|
+
}>;
|
|
499
|
+
id: z.ZodString;
|
|
500
|
+
record_hash: z.ZodString;
|
|
501
|
+
scope: z.ZodObject<{
|
|
502
|
+
kind: z.ZodEnum<{
|
|
503
|
+
repository: "repository";
|
|
504
|
+
organization: "organization";
|
|
505
|
+
team: "team";
|
|
506
|
+
user: "user";
|
|
507
|
+
}>;
|
|
508
|
+
id: z.ZodString;
|
|
509
|
+
}, z.core.$strict>;
|
|
510
|
+
}, z.core.$strict>>;
|
|
511
|
+
observed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
512
|
+
facet: z.ZodEnum<{
|
|
513
|
+
decisions: "decisions";
|
|
514
|
+
constraints: "constraints";
|
|
515
|
+
bugs: "bugs";
|
|
516
|
+
findings: "findings";
|
|
517
|
+
receipts: "receipts";
|
|
518
|
+
commitments: "commitments";
|
|
519
|
+
derived: "derived";
|
|
520
|
+
entities: "entities";
|
|
521
|
+
relationships: "relationships";
|
|
522
|
+
}>;
|
|
523
|
+
id: z.ZodString;
|
|
524
|
+
record_hash: z.ZodString;
|
|
525
|
+
scope: z.ZodObject<{
|
|
526
|
+
kind: z.ZodEnum<{
|
|
527
|
+
repository: "repository";
|
|
528
|
+
organization: "organization";
|
|
529
|
+
team: "team";
|
|
530
|
+
user: "user";
|
|
531
|
+
}>;
|
|
532
|
+
id: z.ZodString;
|
|
533
|
+
}, z.core.$strict>;
|
|
534
|
+
}, z.core.$strict>>>;
|
|
535
|
+
observed_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
536
|
+
observed_page: z.ZodOptional<z.ZodObject<{
|
|
537
|
+
snapshot_hash: z.ZodString;
|
|
538
|
+
total: z.ZodNumber;
|
|
539
|
+
next_cursor: z.ZodNullable<z.ZodObject<{
|
|
540
|
+
snapshot_hash: z.ZodString;
|
|
541
|
+
offset: z.ZodNumber;
|
|
542
|
+
}, z.core.$strict>>;
|
|
543
|
+
}, z.core.$strict>>;
|
|
544
|
+
relationships_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
545
|
+
depends_on: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
546
|
+
kind: z.ZodLiteral<"record">;
|
|
547
|
+
id: z.ZodString;
|
|
548
|
+
record_hash: z.ZodString;
|
|
549
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
550
|
+
kind: z.ZodEnum<{
|
|
551
|
+
repository: "repository";
|
|
552
|
+
organization: "organization";
|
|
553
|
+
team: "team";
|
|
554
|
+
user: "user";
|
|
555
|
+
}>;
|
|
556
|
+
id: z.ZodString;
|
|
557
|
+
}, z.core.$strict>>;
|
|
558
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
559
|
+
kind: z.ZodLiteral<"external">;
|
|
560
|
+
ref: z.ZodObject<{
|
|
561
|
+
system: z.ZodString;
|
|
562
|
+
object_type: z.ZodString;
|
|
563
|
+
object_key: z.ZodString;
|
|
564
|
+
version: z.ZodOptional<z.ZodString>;
|
|
565
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
566
|
+
observed_at: z.ZodString;
|
|
567
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
568
|
+
}, z.core.$strict>;
|
|
569
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
570
|
+
kind: z.ZodLiteral<"schema">;
|
|
571
|
+
name: z.ZodString;
|
|
572
|
+
fingerprint: z.ZodString;
|
|
573
|
+
}, z.core.$strict>], "kind">>;
|
|
574
|
+
invalidated_by: z.ZodArray<z.ZodString>;
|
|
575
|
+
}, z.core.$strict>>;
|
|
576
|
+
denied_scopes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
577
|
+
kind: z.ZodEnum<{
|
|
578
|
+
repository: "repository";
|
|
579
|
+
organization: "organization";
|
|
580
|
+
team: "team";
|
|
581
|
+
user: "user";
|
|
582
|
+
}>;
|
|
583
|
+
id: z.ZodString;
|
|
584
|
+
}, z.core.$strict>>>;
|
|
585
|
+
records: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
586
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
587
|
+
kind: z.ZodEnum<{
|
|
588
|
+
repository: "repository";
|
|
589
|
+
organization: "organization";
|
|
590
|
+
team: "team";
|
|
591
|
+
user: "user";
|
|
592
|
+
}>;
|
|
593
|
+
id: z.ZodString;
|
|
594
|
+
}, z.core.$strict>>>;
|
|
595
|
+
receipts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
596
|
+
scope: z.ZodObject<{
|
|
597
|
+
kind: z.ZodEnum<{
|
|
598
|
+
repository: "repository";
|
|
599
|
+
organization: "organization";
|
|
600
|
+
team: "team";
|
|
601
|
+
user: "user";
|
|
602
|
+
}>;
|
|
603
|
+
id: z.ZodString;
|
|
604
|
+
}, z.core.$strict>;
|
|
605
|
+
receipt_id: z.ZodString;
|
|
606
|
+
}, z.core.$strict>>>;
|
|
607
|
+
}, z.core.$strict>;
|
|
608
|
+
export type ReadResponse = z.infer<typeof ReadResponseSchema>;
|
|
609
|
+
export declare const WriteRequestSchema: z.ZodObject<{
|
|
610
|
+
schema: z.ZodLiteral<"nuryel.state.write/1">;
|
|
611
|
+
principal: z.ZodObject<{
|
|
612
|
+
id: z.ZodString;
|
|
613
|
+
kind: z.ZodEnum<{
|
|
614
|
+
service: "service";
|
|
615
|
+
human: "human";
|
|
616
|
+
agent: "agent";
|
|
617
|
+
}>;
|
|
618
|
+
display: z.ZodOptional<z.ZodString>;
|
|
619
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
620
|
+
kind: z.ZodEnum<{
|
|
621
|
+
repository: "repository";
|
|
622
|
+
organization: "organization";
|
|
623
|
+
team: "team";
|
|
624
|
+
user: "user";
|
|
625
|
+
}>;
|
|
626
|
+
id: z.ZodString;
|
|
627
|
+
}, z.core.$strict>>;
|
|
628
|
+
}, z.core.$strict>;
|
|
629
|
+
scope: z.ZodObject<{
|
|
630
|
+
kind: z.ZodEnum<{
|
|
631
|
+
repository: "repository";
|
|
632
|
+
organization: "organization";
|
|
633
|
+
team: "team";
|
|
634
|
+
user: "user";
|
|
635
|
+
}>;
|
|
636
|
+
id: z.ZodString;
|
|
637
|
+
}, z.core.$strict>;
|
|
638
|
+
facet: z.ZodEnum<{
|
|
639
|
+
decisions: "decisions";
|
|
640
|
+
constraints: "constraints";
|
|
641
|
+
bugs: "bugs";
|
|
642
|
+
findings: "findings";
|
|
643
|
+
receipts: "receipts";
|
|
644
|
+
commitments: "commitments";
|
|
645
|
+
derived: "derived";
|
|
646
|
+
entities: "entities";
|
|
647
|
+
relationships: "relationships";
|
|
648
|
+
}>;
|
|
649
|
+
record: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
650
|
+
idempotency_key: z.ZodString;
|
|
651
|
+
expected_version: z.ZodDefault<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
652
|
+
supersedes: z.ZodOptional<z.ZodString>;
|
|
653
|
+
cause: z.ZodOptional<z.ZodObject<{
|
|
654
|
+
kind: z.ZodLiteral<"external">;
|
|
655
|
+
ref: z.ZodObject<{
|
|
656
|
+
system: z.ZodString;
|
|
657
|
+
object_type: z.ZodString;
|
|
658
|
+
object_key: z.ZodString;
|
|
659
|
+
version: z.ZodOptional<z.ZodString>;
|
|
660
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
661
|
+
observed_at: z.ZodString;
|
|
662
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
663
|
+
}, z.core.$strict>;
|
|
664
|
+
}, z.core.$strict>>;
|
|
665
|
+
}, z.core.$strict>;
|
|
666
|
+
export type WriteRequest = z.infer<typeof WriteRequestSchema>;
|
|
667
|
+
export declare const DURABILITY: readonly ["pushed", "committed", "local"];
|
|
668
|
+
export declare const WriteResultSchema: z.ZodObject<{
|
|
669
|
+
schema: z.ZodLiteral<"nuryel.state.write/1">;
|
|
670
|
+
record_id: z.ZodString;
|
|
671
|
+
record_hash: z.ZodString;
|
|
672
|
+
durability: z.ZodEnum<{
|
|
673
|
+
committed: "committed";
|
|
674
|
+
pushed: "pushed";
|
|
675
|
+
local: "local";
|
|
676
|
+
}>;
|
|
677
|
+
outcome: z.ZodEnum<{
|
|
678
|
+
updated: "updated";
|
|
679
|
+
superseded: "superseded";
|
|
680
|
+
created: "created";
|
|
681
|
+
replayed: "replayed";
|
|
682
|
+
}>;
|
|
683
|
+
conflict: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
684
|
+
incumbent_id: z.ZodString;
|
|
685
|
+
reason: z.ZodString;
|
|
686
|
+
}, z.core.$strict>>>;
|
|
687
|
+
record: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
688
|
+
}, z.core.$strict>;
|
|
689
|
+
export type WriteResult = z.infer<typeof WriteResultSchema>;
|
|
690
|
+
export declare const CaptureBatchResultSchema: z.ZodObject<{
|
|
691
|
+
schema: z.ZodLiteral<"nuryel.state.capture-batch/1">;
|
|
692
|
+
results: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
693
|
+
index: z.ZodNumber;
|
|
694
|
+
status: z.ZodLiteral<"saved">;
|
|
695
|
+
result: z.ZodObject<{
|
|
696
|
+
schema: z.ZodLiteral<"nuryel.state.write/1">;
|
|
697
|
+
record_id: z.ZodString;
|
|
698
|
+
record_hash: z.ZodString;
|
|
699
|
+
durability: z.ZodEnum<{
|
|
700
|
+
committed: "committed";
|
|
701
|
+
pushed: "pushed";
|
|
702
|
+
local: "local";
|
|
703
|
+
}>;
|
|
704
|
+
outcome: z.ZodEnum<{
|
|
705
|
+
updated: "updated";
|
|
706
|
+
superseded: "superseded";
|
|
707
|
+
created: "created";
|
|
708
|
+
replayed: "replayed";
|
|
709
|
+
}>;
|
|
710
|
+
conflict: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
711
|
+
incumbent_id: z.ZodString;
|
|
712
|
+
reason: z.ZodString;
|
|
713
|
+
}, z.core.$strict>>>;
|
|
714
|
+
record: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
715
|
+
}, z.core.$strict>;
|
|
716
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
717
|
+
index: z.ZodNumber;
|
|
718
|
+
status: z.ZodLiteral<"refused">;
|
|
719
|
+
code: z.ZodString;
|
|
720
|
+
message: z.ZodString;
|
|
721
|
+
}, z.core.$strict>], "status">>;
|
|
722
|
+
reviews: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
723
|
+
index: z.ZodNumber;
|
|
724
|
+
status: z.ZodLiteral<"saved">;
|
|
725
|
+
result: z.ZodObject<{
|
|
726
|
+
schema: z.ZodLiteral<"nuryel.state.write/1">;
|
|
727
|
+
record_id: z.ZodString;
|
|
728
|
+
record_hash: z.ZodString;
|
|
729
|
+
durability: z.ZodEnum<{
|
|
730
|
+
committed: "committed";
|
|
731
|
+
pushed: "pushed";
|
|
732
|
+
local: "local";
|
|
733
|
+
}>;
|
|
734
|
+
outcome: z.ZodEnum<{
|
|
735
|
+
updated: "updated";
|
|
736
|
+
superseded: "superseded";
|
|
737
|
+
created: "created";
|
|
738
|
+
replayed: "replayed";
|
|
739
|
+
}>;
|
|
740
|
+
conflict: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
741
|
+
incumbent_id: z.ZodString;
|
|
742
|
+
reason: z.ZodString;
|
|
743
|
+
}, z.core.$strict>>>;
|
|
744
|
+
record: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
745
|
+
}, z.core.$strict>;
|
|
746
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
747
|
+
index: z.ZodNumber;
|
|
748
|
+
status: z.ZodLiteral<"refused">;
|
|
749
|
+
code: z.ZodString;
|
|
750
|
+
message: z.ZodString;
|
|
751
|
+
}, z.core.$strict>], "status">>>;
|
|
752
|
+
}, z.core.$strict>;
|
|
753
|
+
export type CaptureBatchResult = z.infer<typeof CaptureBatchResultSchema>;
|
|
754
|
+
export declare const SubscribeRequestSchema: z.ZodObject<{
|
|
755
|
+
schema: z.ZodLiteral<"nuryel.state.subscribe/1">;
|
|
756
|
+
principal: z.ZodObject<{
|
|
757
|
+
id: z.ZodString;
|
|
758
|
+
kind: z.ZodEnum<{
|
|
759
|
+
service: "service";
|
|
760
|
+
human: "human";
|
|
761
|
+
agent: "agent";
|
|
762
|
+
}>;
|
|
763
|
+
display: z.ZodOptional<z.ZodString>;
|
|
764
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
765
|
+
kind: z.ZodEnum<{
|
|
766
|
+
repository: "repository";
|
|
767
|
+
organization: "organization";
|
|
768
|
+
team: "team";
|
|
769
|
+
user: "user";
|
|
770
|
+
}>;
|
|
771
|
+
id: z.ZodString;
|
|
772
|
+
}, z.core.$strict>>;
|
|
773
|
+
}, z.core.$strict>;
|
|
774
|
+
scope: z.ZodObject<{
|
|
775
|
+
kind: z.ZodEnum<{
|
|
776
|
+
repository: "repository";
|
|
777
|
+
organization: "organization";
|
|
778
|
+
team: "team";
|
|
779
|
+
user: "user";
|
|
780
|
+
}>;
|
|
781
|
+
id: z.ZodString;
|
|
782
|
+
}, z.core.$strict>;
|
|
783
|
+
after_seq: z.ZodNumber;
|
|
784
|
+
subjects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
785
|
+
facets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
786
|
+
decisions: "decisions";
|
|
787
|
+
constraints: "constraints";
|
|
788
|
+
bugs: "bugs";
|
|
789
|
+
findings: "findings";
|
|
790
|
+
receipts: "receipts";
|
|
791
|
+
commitments: "commitments";
|
|
792
|
+
derived: "derived";
|
|
793
|
+
entities: "entities";
|
|
794
|
+
relationships: "relationships";
|
|
795
|
+
}>>>;
|
|
796
|
+
}, z.core.$strict>;
|
|
797
|
+
export type SubscribeRequest = z.infer<typeof SubscribeRequestSchema>;
|
|
798
|
+
export declare const ChangeEventSchema: z.ZodObject<{
|
|
799
|
+
schema: z.ZodLiteral<"nuryel.state.subscribe/1">;
|
|
800
|
+
seq: z.ZodNumber;
|
|
801
|
+
at: z.ZodString;
|
|
802
|
+
scope: z.ZodObject<{
|
|
803
|
+
kind: z.ZodEnum<{
|
|
804
|
+
repository: "repository";
|
|
805
|
+
organization: "organization";
|
|
806
|
+
team: "team";
|
|
807
|
+
user: "user";
|
|
808
|
+
}>;
|
|
809
|
+
id: z.ZodString;
|
|
810
|
+
}, z.core.$strict>;
|
|
811
|
+
facet: z.ZodEnum<{
|
|
812
|
+
decisions: "decisions";
|
|
813
|
+
constraints: "constraints";
|
|
814
|
+
bugs: "bugs";
|
|
815
|
+
findings: "findings";
|
|
816
|
+
receipts: "receipts";
|
|
817
|
+
commitments: "commitments";
|
|
818
|
+
derived: "derived";
|
|
819
|
+
entities: "entities";
|
|
820
|
+
relationships: "relationships";
|
|
821
|
+
}>;
|
|
822
|
+
record_id: z.ZodString;
|
|
823
|
+
record_hash: z.ZodString;
|
|
824
|
+
change: z.ZodEnum<{
|
|
825
|
+
updated: "updated";
|
|
826
|
+
retired: "retired";
|
|
827
|
+
superseded: "superseded";
|
|
828
|
+
created: "created";
|
|
829
|
+
invalidated: "invalidated";
|
|
830
|
+
}>;
|
|
831
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
832
|
+
invalidates: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
833
|
+
cause: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
834
|
+
kind: z.ZodLiteral<"receipt">;
|
|
835
|
+
receipt_id: z.ZodString;
|
|
836
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
837
|
+
kind: z.ZodLiteral<"external">;
|
|
838
|
+
ref: z.ZodObject<{
|
|
839
|
+
system: z.ZodString;
|
|
840
|
+
object_type: z.ZodString;
|
|
841
|
+
object_key: z.ZodString;
|
|
842
|
+
version: z.ZodOptional<z.ZodString>;
|
|
843
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
844
|
+
observed_at: z.ZodString;
|
|
845
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
846
|
+
}, z.core.$strict>;
|
|
847
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
848
|
+
kind: z.ZodLiteral<"write">;
|
|
849
|
+
principal: z.ZodString;
|
|
850
|
+
}, z.core.$strict>]>>;
|
|
851
|
+
}, z.core.$strict>;
|
|
852
|
+
export type ChangeEvent = z.infer<typeof ChangeEventSchema>;
|
|
853
|
+
/** records — fetch records by id, grants first. A subscribe event names a record; this is how
|
|
854
|
+
* a consumer gets its body without a subject read. Ids outside the grants are named in
|
|
855
|
+
* `denied`, unknown ids in `missing`; neither is silently dropped. */
|
|
856
|
+
export declare const RecordsRequestSchema: z.ZodObject<{
|
|
857
|
+
schema: z.ZodLiteral<"nuryel.state.records/1">;
|
|
858
|
+
principal: z.ZodObject<{
|
|
859
|
+
id: z.ZodString;
|
|
860
|
+
kind: z.ZodEnum<{
|
|
861
|
+
service: "service";
|
|
862
|
+
human: "human";
|
|
863
|
+
agent: "agent";
|
|
864
|
+
}>;
|
|
865
|
+
display: z.ZodOptional<z.ZodString>;
|
|
866
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
867
|
+
kind: z.ZodEnum<{
|
|
868
|
+
repository: "repository";
|
|
869
|
+
organization: "organization";
|
|
870
|
+
team: "team";
|
|
871
|
+
user: "user";
|
|
872
|
+
}>;
|
|
873
|
+
id: z.ZodString;
|
|
874
|
+
}, z.core.$strict>>;
|
|
875
|
+
}, z.core.$strict>;
|
|
876
|
+
scope: z.ZodObject<{
|
|
877
|
+
kind: z.ZodEnum<{
|
|
878
|
+
repository: "repository";
|
|
879
|
+
organization: "organization";
|
|
880
|
+
team: "team";
|
|
881
|
+
user: "user";
|
|
882
|
+
}>;
|
|
883
|
+
id: z.ZodString;
|
|
884
|
+
}, z.core.$strict>;
|
|
885
|
+
ids: z.ZodArray<z.ZodString>;
|
|
886
|
+
}, z.core.$strict>;
|
|
887
|
+
export type RecordsRequest = z.infer<typeof RecordsRequestSchema>;
|
|
888
|
+
export declare const RecordsResponseSchema: z.ZodObject<{
|
|
889
|
+
schema: z.ZodLiteral<"nuryel.state.records/1">;
|
|
890
|
+
scope: z.ZodObject<{
|
|
891
|
+
kind: z.ZodEnum<{
|
|
892
|
+
repository: "repository";
|
|
893
|
+
organization: "organization";
|
|
894
|
+
team: "team";
|
|
895
|
+
user: "user";
|
|
896
|
+
}>;
|
|
897
|
+
id: z.ZodString;
|
|
898
|
+
}, z.core.$strict>;
|
|
899
|
+
records: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
900
|
+
facets: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
901
|
+
decisions: "decisions";
|
|
902
|
+
constraints: "constraints";
|
|
903
|
+
bugs: "bugs";
|
|
904
|
+
findings: "findings";
|
|
905
|
+
receipts: "receipts";
|
|
906
|
+
commitments: "commitments";
|
|
907
|
+
derived: "derived";
|
|
908
|
+
entities: "entities";
|
|
909
|
+
relationships: "relationships";
|
|
910
|
+
}>>;
|
|
911
|
+
missing: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
912
|
+
denied: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
913
|
+
}, z.core.$strict>;
|
|
914
|
+
export type RecordsResponse = z.infer<typeof RecordsResponseSchema>;
|
|
915
|
+
export declare const CapabilityNegotiationSchema: z.ZodObject<{
|
|
916
|
+
protocol: z.ZodLiteral<"nuryel.state/1">;
|
|
917
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
918
|
+
}, z.core.$strict>;
|
|
919
|
+
export declare function negotiate(offered: readonly string[], required?: readonly string[]): {
|
|
920
|
+
supported: string[];
|
|
921
|
+
unsupported: string[];
|
|
922
|
+
};
|
|
923
|
+
/** Canonical JSON: keys sorted by code unit at every level, `undefined` dropped, non-finite
|
|
924
|
+
* numbers rejected. Two records with the same facts hash the same regardless of who wrote them. */
|
|
925
|
+
export declare function canonicalize(value: unknown): unknown;
|
|
926
|
+
export declare function stateHash(value: unknown): string;
|
|
927
|
+
/** Identity = what makes two receipts the same action: who did what to which object, with which
|
|
928
|
+
* request. Re-sending the same action replays the same receipt instead of minting a second one. */
|
|
929
|
+
export declare function actionReceiptId(r: Pick<ActionReceipt, "scope" | "actor" | "action_kind" | "target" | "request_fingerprint"> & {
|
|
930
|
+
idempotency_key?: string;
|
|
931
|
+
}): string;
|
|
932
|
+
export declare function commitmentId(c: Pick<Commitment, "scope" | "subject" | "title" | "owner" | "due">): string;
|
|
933
|
+
export declare function derivedId(d: Pick<DerivedState, "scope" | "subject" | "transform_version" | "dependencies">): string;
|
|
934
|
+
export declare const STATE_INVARIANTS: readonly [{
|
|
935
|
+
readonly id: "authorization-before-retrieval";
|
|
936
|
+
readonly statement: "A record outside the principal's grants never enters a candidate set; filtering after ranking is a violation.";
|
|
937
|
+
}, {
|
|
938
|
+
readonly id: "similarity-never-authorizes";
|
|
939
|
+
readonly statement: "Semantic similarity may find candidates; only deterministic dependency, freshness and grant checks make a record current or visible.";
|
|
940
|
+
}, {
|
|
941
|
+
readonly id: "never-in-request-path";
|
|
942
|
+
readonly statement: "Nuryel is read and written by orchestrators; it never proxies, fetches or stores on an agent's behalf. A gate that checks state and refuses is allowed; an intermediary is not.";
|
|
943
|
+
}, {
|
|
944
|
+
readonly id: "provenance-on-every-write";
|
|
945
|
+
readonly statement: "Every write carries provenance and an idempotency key; a replay returns the original record, never a duplicate.";
|
|
946
|
+
}, {
|
|
947
|
+
readonly id: "one-live-decision-per-topic";
|
|
948
|
+
readonly statement: "A second live decision on a topic is refused with the incumbent named; supersession is explicit.";
|
|
949
|
+
}, {
|
|
950
|
+
readonly id: "external-truth-stays-external";
|
|
951
|
+
readonly statement: "External systems remain authoritative for their own content; Nuryel holds credential-free pointers, versions and hashes, never mirrored bodies.";
|
|
952
|
+
}, {
|
|
953
|
+
readonly id: "derived-state-carries-dependencies";
|
|
954
|
+
readonly statement: "A derived statement without dependencies cannot be invalidated and is therefore not state.";
|
|
955
|
+
}, {
|
|
956
|
+
readonly id: "one-entity-per-external-ref";
|
|
957
|
+
readonly statement: "One external record is one entity in a partition: a second active entity carrying an external key an incumbent already carries is refused with the incumbent named, and a subject written as that record's external key is refused with the entity's id named. Identity is explicit refs, never similarity; merge is explicit — a retired entity names the survivor in `merged_into`, the ledger holds the `retired` event, nothing under the old id is rewritten and reads resolve to the survivor — and split is the explicit reverse; never a silent rewrite.";
|
|
958
|
+
}, {
|
|
959
|
+
readonly id: "human-correction-outranks-agent-writes";
|
|
960
|
+
readonly statement: "A record a human confirmed is never overwritten or superseded by an agent or service principal: the agent may replay it, write derived state back stale with the external cause that moved, or close a commitment with a receipt on record. Changing what the human said takes a human.";
|
|
961
|
+
}, {
|
|
962
|
+
readonly id: "derived-state-writer-owns-currentness";
|
|
963
|
+
readonly statement: "No source writes the drawer. The writer of a current derived statement owns keeping its dependencies true: re-validate them on a schedule or on a source event, and write the statement back stale with the moved pointer as cause when one no longer holds. Without this duty an agent may capture source-backed observations only as unknown; observations never assert currentness.";
|
|
964
|
+
}];
|
|
965
|
+
/** The memory supply chain's top tier: a record whose provenance a human signed. Same tier rule
|
|
966
|
+
* as the strict gate's (strictgate.isHumanConfirmed), applied to a record instead of a source. */
|
|
967
|
+
export declare function isHumanConfirmed(record: unknown): boolean;
|
|
968
|
+
/** authorization-before-retrieval, checked on the way OUT as well: nothing in a read response
|
|
969
|
+
* may sit outside the principal's grants. Bindings must also filter on the way in. */
|
|
970
|
+
export declare function assertReadWithinGrants(principal: Principal, response: ReadResponse): void;
|
|
971
|
+
/** provenance-on-every-write + scope agreement between the envelope and the record. */
|
|
972
|
+
export declare function assertWriteWellFormed(request: WriteRequest): void;
|
|
973
|
+
/** derived-state-carries-dependencies + content integrity. */
|
|
974
|
+
export declare function assertDerivedState(d: DerivedState): void;
|
|
975
|
+
/** Subscribe streams are strictly ordered per scope; a gap or regression means the caller must
|
|
976
|
+
* resynchronize instead of trusting what it holds. */
|
|
977
|
+
export declare function assertChangeSequence(events: readonly ChangeEvent[], afterSeq: number): void;
|
|
978
|
+
/** A delivery envelope is the read receipt this contract reuses unchanged. */
|
|
979
|
+
export declare function receiptOf(envelope: Pick<DeliveryEnvelope, "receipt_id">): string;
|