@dispatch-foo/protocol 0.0.0 → 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.
- package/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +3 -0
- package/dist/conformance-adapter.d.ts +1 -0
- package/dist/conformance-adapter.js +11 -0
- package/dist/conformance-adapter.js.map +1 -0
- package/dist/conformance.d.ts +243 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +5 -0
- package/dist/constants-CRXF4f7g.js +89 -0
- package/dist/constants-CRXF4f7g.js.map +1 -0
- package/dist/constants-CUM7Sm5u.d.ts +36 -0
- package/dist/constants-CUM7Sm5u.d.ts.map +1 -0
- package/dist/federation/index.d.ts +360 -0
- package/dist/federation/index.d.ts.map +1 -0
- package/dist/federation/index.js +628 -0
- package/dist/federation/index.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/serve-CVPZbCpT.js +672 -0
- package/dist/serve-CVPZbCpT.js.map +1 -0
- package/dist/sqliteStore-BtFP1f8O.d.ts +376 -0
- package/dist/sqliteStore-BtFP1f8O.d.ts.map +1 -0
- package/dist/untrusted-DJNiucEX-tUd9XZzz.d.ts +388 -0
- package/dist/untrusted-DJNiucEX-tUd9XZzz.d.ts.map +1 -0
- package/dist/version-Ds8ZFZLh.js +2490 -0
- package/dist/version-Ds8ZFZLh.js.map +1 -0
- package/package.json +54 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wyat Soule
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @dispatch-foo/protocol
|
|
2
|
+
|
|
3
|
+
The reference implementation of the
|
|
4
|
+
[Dispatch Messaging Protocol](https://dispatch.foo/protocol/) (DMP), under the
|
|
5
|
+
MIT license: address parsing, the message envelope and its validation, gates,
|
|
6
|
+
the delivery engine and a SQLite message store. Dispatch's daemon runs it; any
|
|
7
|
+
host can embed it by implementing `MessagingHost`.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @dispatch-foo/protocol
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
It runs on Node 22.13 or later, and on Bun. Its entry points:
|
|
14
|
+
|
|
15
|
+
- `@dispatch-foo/protocol`: the engine, the store and the envelope rules;
|
|
16
|
+
- `@dispatch-foo/protocol/browser`: the registry constants and gate predicates
|
|
17
|
+
alone, for code that must not reach `node:sqlite`;
|
|
18
|
+
- `@dispatch-foo/protocol/conformance`: the adapter that runs the DMP
|
|
19
|
+
conformance kit against this engine, also installed as the
|
|
20
|
+
`dmp-reference-adapter` bin;
|
|
21
|
+
- `@dispatch-foo/protocol/federation`: the federation wire types of DMP's
|
|
22
|
+
Appendix F.
|
|
23
|
+
|
|
24
|
+
The specification, its registries and its conformance kit are in
|
|
25
|
+
`@dispatch-foo/protocol-spec`.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as GATE_RAISERS, c as MARKERS, d as REF_TYPES, f as SYSTEM_ADDRESS, g as raiserOf, h as isDecidingAuthor, i as ERROR_CODES, l as MAX_ADDRESS_BYTES, m as hasGateData, n as BUILT_IN_KINDS, o as GATE_TYPES, p as gateTypeOf, r as DELIVERY_STATES, s as GateRaiser, t as ADDRESS_SCHEMES, u as MAX_SEGMENT_BYTES } from "./constants-CUM7Sm5u.js";
|
|
2
|
+
export { ADDRESS_SCHEMES, BUILT_IN_KINDS, DELIVERY_STATES, ERROR_CODES, GATE_RAISERS, GATE_TYPES, GateRaiser, MARKERS, MAX_ADDRESS_BYTES, MAX_SEGMENT_BYTES, REF_TYPES, SYSTEM_ADDRESS, gateTypeOf, hasGateData, isDecidingAuthor, raiserOf };
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as GATE_RAISERS, c as MAX_ADDRESS_BYTES, d as SYSTEM_ADDRESS, f as gateTypeOf, h as raiserOf, i as ERROR_CODES, l as MAX_SEGMENT_BYTES, m as isDecidingAuthor, n as BUILT_IN_KINDS, o as GATE_TYPES, p as hasGateData, r as DELIVERY_STATES, s as MARKERS, t as ADDRESS_SCHEMES, u as REF_TYPES } from "./constants-CRXF4f7g.js";
|
|
2
|
+
|
|
3
|
+
export { ADDRESS_SCHEMES, BUILT_IN_KINDS, DELIVERY_STATES, ERROR_CODES, GATE_RAISERS, GATE_TYPES, MARKERS, MAX_ADDRESS_BYTES, MAX_SEGMENT_BYTES, REF_TYPES, SYSTEM_ADDRESS, gateTypeOf, hasGateData, isDecidingAuthor, raiserOf };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./constants-CRXF4f7g.js";
|
|
3
|
+
import "./version-Ds8ZFZLh.js";
|
|
4
|
+
import { n as REFERENCE_HELLO, r as runVector, t as serveStdio } from "./serve-CVPZbCpT.js";
|
|
5
|
+
|
|
6
|
+
//#region src/conformance/stdio.ts
|
|
7
|
+
serveStdio(REFERENCE_HELLO, (vector) => runVector(vector));
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { };
|
|
11
|
+
//# sourceMappingURL=conformance-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance-adapter.js","names":[],"sources":["../src/conformance/stdio.ts"],"sourcesContent":["#!/usr/bin/env node\n// The reference adapter over stdio, for the kit's runner.\nimport { REFERENCE_HELLO, runVector } from './adapter.js';\nimport { serveStdio } from './serve.js';\n\nserveStdio(REFERENCE_HELLO, (vector) => runVector(vector));\n"],"mappings":";;;;;;AAKA,WAAW,kBAAkB,WAAW,UAAU,OAAO,CAAC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import "./constants-CUM7Sm5u.js";
|
|
2
|
+
import { F as Address, T as Message } from "./untrusted-DJNiucEX-tUd9XZzz.js";
|
|
3
|
+
import { O as WakeResult, S as PolicyRuling, _ as ExternalTarget, g as ExternalKind, h as ExternalAdmission, i as SqliteMessageStore, p as Sender, s as DeliveryEngine, x as PolicyRequest, y as MessagingHost } from "./sqliteStore-BtFP1f8O.js";
|
|
4
|
+
|
|
5
|
+
//#region ../protocol-spec/dist/index.d.ts
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/types.d.ts
|
|
9
|
+
declare const VECTOR_CLASSES: readonly ["envelope", "host-core", "a2a-binding", "federation"];
|
|
10
|
+
type VectorClass = (typeof VECTOR_CLASSES)[number];
|
|
11
|
+
declare const LEVELS: readonly ["MUST", "SHOULD", "MAY"];
|
|
12
|
+
type Level = (typeof LEVELS)[number];
|
|
13
|
+
declare const PROFILES: readonly ["core", "dispatch"];
|
|
14
|
+
type Profile = (typeof PROFILES)[number];
|
|
15
|
+
declare const OPS: readonly ["send", "reply", "close", "markRead", "inbox", "thread", "canRead", "openBlocking", "join", "leave", "deliverHeld", "recover", "parseAddress", "validate", "render", "a2a.validate", "a2a.project", "a2a.inbound", "world"];
|
|
16
|
+
type Op = (typeof OPS)[number];
|
|
17
|
+
type Json = null | boolean | number | string | Json[] | JsonObject;
|
|
18
|
+
type JsonObject = {
|
|
19
|
+
[key: string]: Json;
|
|
20
|
+
};
|
|
21
|
+
interface Given {
|
|
22
|
+
clock?: string;
|
|
23
|
+
seed?: number;
|
|
24
|
+
workItems?: {
|
|
25
|
+
id: string;
|
|
26
|
+
liveSession?: string;
|
|
27
|
+
sessions?: string[];
|
|
28
|
+
}[];
|
|
29
|
+
auxSessions?: string[];
|
|
30
|
+
agents?: {
|
|
31
|
+
address: string;
|
|
32
|
+
status: 'pending' | 'approved' | 'revoked';
|
|
33
|
+
muted?: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
channels?: {
|
|
36
|
+
name: string;
|
|
37
|
+
members: string[];
|
|
38
|
+
}[];
|
|
39
|
+
implicit?: Record<string, string[]>;
|
|
40
|
+
owner?: string;
|
|
41
|
+
rulings?: Record<string, 'allow' | 'ask' | 'deny'>;
|
|
42
|
+
wakeResults?: Record<string, {
|
|
43
|
+
ok: true;
|
|
44
|
+
session: string;
|
|
45
|
+
} | {
|
|
46
|
+
ok: false;
|
|
47
|
+
reason: string;
|
|
48
|
+
}>;
|
|
49
|
+
failPush?: string[];
|
|
50
|
+
failOnAnswered?: boolean;
|
|
51
|
+
limits?: {
|
|
52
|
+
urgentPerHour?: number;
|
|
53
|
+
agentTurnsPerThreadPerHour?: number;
|
|
54
|
+
};
|
|
55
|
+
external?: Record<string, 'client' | 'peer'>;
|
|
56
|
+
store?: {
|
|
57
|
+
messages?: JsonObject[];
|
|
58
|
+
deliveries?: JsonObject[];
|
|
59
|
+
appliedGates?: string[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
type Step = {
|
|
63
|
+
op: Op;
|
|
64
|
+
} & JsonObject;
|
|
65
|
+
type StepResult = {
|
|
66
|
+
ok: true;
|
|
67
|
+
result?: Json;
|
|
68
|
+
} | {
|
|
69
|
+
ok: false;
|
|
70
|
+
error: {
|
|
71
|
+
code: string;
|
|
72
|
+
field?: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
interface Expectation {
|
|
76
|
+
steps?: (StepResult | null)[];
|
|
77
|
+
messages?: JsonObject[];
|
|
78
|
+
noOtherMessages?: boolean;
|
|
79
|
+
deliveries?: {
|
|
80
|
+
message: string;
|
|
81
|
+
recipient: string;
|
|
82
|
+
via?: string;
|
|
83
|
+
state?: string;
|
|
84
|
+
session?: string | null;
|
|
85
|
+
}[];
|
|
86
|
+
noDeliveries?: string[];
|
|
87
|
+
calls?: JsonObject[];
|
|
88
|
+
callsInclude?: JsonObject[];
|
|
89
|
+
gateEffects?: string[];
|
|
90
|
+
voided?: string[];
|
|
91
|
+
channels?: {
|
|
92
|
+
name: string;
|
|
93
|
+
members: string[];
|
|
94
|
+
}[];
|
|
95
|
+
render?: {
|
|
96
|
+
step: number;
|
|
97
|
+
text: string;
|
|
98
|
+
}[];
|
|
99
|
+
}
|
|
100
|
+
interface Vector {
|
|
101
|
+
id: string;
|
|
102
|
+
title: string;
|
|
103
|
+
class: VectorClass;
|
|
104
|
+
level: Level;
|
|
105
|
+
profile: Profile;
|
|
106
|
+
sections: string[];
|
|
107
|
+
capability?: string;
|
|
108
|
+
tags?: string[];
|
|
109
|
+
given: Given;
|
|
110
|
+
when: Step[];
|
|
111
|
+
then: Expectation;
|
|
112
|
+
}
|
|
113
|
+
type RunnableVector = Omit<Vector, 'then'>;
|
|
114
|
+
interface RenderForms {
|
|
115
|
+
quotePrefix: string;
|
|
116
|
+
header: string;
|
|
117
|
+
hostLines: string[];
|
|
118
|
+
digestLead: string;
|
|
119
|
+
}
|
|
120
|
+
interface Hello {
|
|
121
|
+
dmp: 'hello';
|
|
122
|
+
implementation: {
|
|
123
|
+
name: string;
|
|
124
|
+
version: string;
|
|
125
|
+
};
|
|
126
|
+
classes: VectorClass[];
|
|
127
|
+
profiles: Profile[];
|
|
128
|
+
capabilities: string[];
|
|
129
|
+
systemAddress: string;
|
|
130
|
+
gateTypes: string[];
|
|
131
|
+
render: RenderForms;
|
|
132
|
+
}
|
|
133
|
+
interface ObservedMessage {
|
|
134
|
+
id: string;
|
|
135
|
+
thread: string;
|
|
136
|
+
replyTo: string | null;
|
|
137
|
+
from: string;
|
|
138
|
+
to: string[];
|
|
139
|
+
kind: string;
|
|
140
|
+
body: string;
|
|
141
|
+
refs: JsonObject[];
|
|
142
|
+
data?: Json;
|
|
143
|
+
urgent: boolean;
|
|
144
|
+
blocking: boolean;
|
|
145
|
+
choices?: string[];
|
|
146
|
+
choice?: string;
|
|
147
|
+
wake: string;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
}
|
|
150
|
+
interface ObservedDelivery {
|
|
151
|
+
id: string;
|
|
152
|
+
message: string;
|
|
153
|
+
recipient: string;
|
|
154
|
+
session: string | null;
|
|
155
|
+
via: string;
|
|
156
|
+
state: string;
|
|
157
|
+
}
|
|
158
|
+
type HookName = 'push' | 'notify' | 'notifyHuman' | 'wake' | 'decide' | 'onAnswered' | 'published' | 'admitExternal';
|
|
159
|
+
type CallRecord = {
|
|
160
|
+
hook: HookName;
|
|
161
|
+
} & {
|
|
162
|
+
[field: string]: string | null;
|
|
163
|
+
};
|
|
164
|
+
interface Observation {
|
|
165
|
+
dmp: 'observation';
|
|
166
|
+
id: string;
|
|
167
|
+
steps: StepResult[];
|
|
168
|
+
messages: ObservedMessage[];
|
|
169
|
+
deliveries: ObservedDelivery[];
|
|
170
|
+
calls: CallRecord[];
|
|
171
|
+
gateEffects: string[];
|
|
172
|
+
voided: string[];
|
|
173
|
+
channels: {
|
|
174
|
+
name: string;
|
|
175
|
+
members: string[];
|
|
176
|
+
}[];
|
|
177
|
+
render: {
|
|
178
|
+
step: number;
|
|
179
|
+
text: string;
|
|
180
|
+
}[];
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/conformance/host.d.ts
|
|
184
|
+
interface World {
|
|
185
|
+
clockMs: number;
|
|
186
|
+
liveRuns: Map<string, string>;
|
|
187
|
+
runTasks: Map<string, string>;
|
|
188
|
+
auxRuns: Set<string>;
|
|
189
|
+
implicit: Map<string, Address[]>;
|
|
190
|
+
owner: Address;
|
|
191
|
+
rulings: Map<Address, PolicyRuling>;
|
|
192
|
+
wakeResults: Map<Address, WakeResult>;
|
|
193
|
+
failPush: Set<string>;
|
|
194
|
+
failOnAnswered: boolean;
|
|
195
|
+
external: Map<Address, 'client' | 'peer'>;
|
|
196
|
+
}
|
|
197
|
+
declare function worldFrom(given: Given): World;
|
|
198
|
+
declare function applyWorld(world: World, change: JsonObject): void;
|
|
199
|
+
declare class ConformanceHost implements MessagingHost {
|
|
200
|
+
readonly world: World;
|
|
201
|
+
readonly calls: CallRecord[];
|
|
202
|
+
constructor(world: World);
|
|
203
|
+
liveRunFor(taskId: string): string | null;
|
|
204
|
+
isLiveRun(runId: string): boolean;
|
|
205
|
+
taskOfRun(runId: string): string | null;
|
|
206
|
+
push(runId: string, _rendered: string, message: Message): Promise<void>;
|
|
207
|
+
notify(runId: string, _digest: string, message: Message): Promise<void>;
|
|
208
|
+
notifyHuman(actor: Address, message: Message): void;
|
|
209
|
+
wake(target: Address, message: Message): Promise<WakeResult>;
|
|
210
|
+
decide(request: PolicyRequest): PolicyRuling;
|
|
211
|
+
owner(): Address;
|
|
212
|
+
implicitMembers(channel: string): Address[];
|
|
213
|
+
onAnswered(question: Message, answer: Message): Promise<void>;
|
|
214
|
+
now(): Date;
|
|
215
|
+
external(address: Address): ExternalKind | null;
|
|
216
|
+
admitExternal(target: ExternalTarget, _sender: Sender, _replyTarget: Message | null, message: Message): ExternalAdmission;
|
|
217
|
+
private settle;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/conformance/errors.d.ts
|
|
221
|
+
declare class UnsupportedOp extends Error {
|
|
222
|
+
constructor(message: string);
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/conformance/adapter.d.ts
|
|
226
|
+
interface OpContext {
|
|
227
|
+
engine: DeliveryEngine;
|
|
228
|
+
store: SqliteMessageStore;
|
|
229
|
+
host: ConformanceHost;
|
|
230
|
+
}
|
|
231
|
+
type OpHandler = (step: Step, ctx: OpContext) => Promise<Json | undefined> | Json | undefined;
|
|
232
|
+
interface AdapterOptions {
|
|
233
|
+
ops?: Record<string, OpHandler>;
|
|
234
|
+
gateTypes?: readonly string[];
|
|
235
|
+
}
|
|
236
|
+
declare const REFERENCE_HELLO: Hello;
|
|
237
|
+
declare function runVector(vector: RunnableVector, options?: AdapterOptions): Promise<Observation>;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/conformance/serve.d.ts
|
|
240
|
+
declare function serveStdio(hello: Hello, run: (vector: RunnableVector) => Promise<Observation>): void;
|
|
241
|
+
//#endregion
|
|
242
|
+
export { type AdapterOptions, ConformanceHost, type OpContext, type OpHandler, REFERENCE_HELLO, UnsupportedOp, type World, applyWorld, runVector, serveStdio, worldFrom };
|
|
243
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","names":["SECTION_NUMBER","RegExp","APPENDIX_HEADING","SPEC_DIR","URL","sectionsOf","listSections","REGISTRY_NAMES","RegistryName","STATUSES","EntryStatus","SCOPES","EntryScope","RAISERS","GateRaiser","RegistryEntry","Record","Registry","REGISTRY_PATH","ENGINE_REGISTRIES","loadRegistry","renderRegistries","driftProblems","VECTOR_CLASSES","VectorClass","LEVELS","Level","PROFILES","Profile","CLAIMS","ClaimName","OPS","Op","CREATING_OPS","Json","JsonObject","SenderSpec","Given","Step","StepResult","Expectation","Vector","RunnableVector","Omit","VectorFile","RenderForms","Hello","ObservedMessage","ObservedDelivery","HookName","CallRecord","Observation","Unsupported","Outcome","VectorResult","ClassTally","Deviation","TckAttestation","Report","Partial","KIT_VERSION","KIT_NAME","FormatError","Error","parseVectorFile","VECTORS_DIR","loadVectors","unimplementedGateType","prepareVector","stripThen","checkRender","checkDigest","bindSymbols","Map","compare","UNTESTED_SECTIONS","A2A_ALLOWED_DEVIATIONS","UsageError","parseDeviations","parseTckAttestation","AdapterError","RunOptions","runConformance","Promise","toJUnit"],"sources":["../../protocol-spec/dist/index.d.ts","../src/conformance/host.ts","../src/conformance/errors.ts","../src/conformance/adapter.ts","../src/conformance/serve.ts"],"sourcesContent":["//#region src/sections.d.ts\ndeclare const SECTION_NUMBER: RegExp;\ndeclare const APPENDIX_HEADING: RegExp;\ndeclare const SPEC_DIR: URL;\ndeclare function sectionsOf(markdown: string): string[];\ndeclare function listSections(specDir: URL): string[];\n//#endregion\n//#region src/registries.d.ts\ndeclare const REGISTRY_NAMES: readonly [\"address-schemes\", \"address-characters\", \"envelope-fields\", \"kinds\", \"ref-types\", \"gate-types\", \"system-markers\", \"delivery-states\", \"error-codes\", \"extension-uris\"];\ntype RegistryName = (typeof REGISTRY_NAMES)[number];\ndeclare const STATUSES: readonly [\"permanent\", \"provisional\", \"appendix\", \"informative\", \"reserved\"];\ntype EntryStatus = (typeof STATUSES)[number];\ndeclare const SCOPES: readonly [\"core\", \"dispatch\", \"a2a\", \"memory\", \"docs\", \"federation\"];\ntype EntryScope = (typeof SCOPES)[number];\ndeclare const RAISERS: readonly [\"system\", \"system-or-decider\", \"session\"];\ntype GateRaiser = (typeof RAISERS)[number];\ninterface RegistryEntry {\n value: string;\n scope: EntryScope;\n status: EntryStatus;\n since: string;\n section: string;\n reference?: string;\n vectors: string[];\n note?: string;\n raisedBy?: GateRaiser;\n choices?: string[];\n data?: Record<string, string>;\n effect?: string;\n internal?: boolean;\n httpStatus?: number;\n}\ntype Registry = Record<RegistryName, RegistryEntry[]>;\ndeclare const REGISTRY_PATH: URL;\ndeclare const ENGINE_REGISTRIES: readonly RegistryName[];\ndeclare function loadRegistry(path?: URL): Registry;\ndeclare function renderRegistries(registry: Registry, version: string): string;\n//#endregion\n//#region src/drift.d.ts\ndeclare function driftProblems(name: string, entries: readonly RegistryEntry[], exported: readonly string[]): string[];\n//#endregion\n//#region src/types.d.ts\ndeclare const VECTOR_CLASSES: readonly [\"envelope\", \"host-core\", \"a2a-binding\", \"federation\"];\ntype VectorClass = (typeof VECTOR_CLASSES)[number];\ndeclare const LEVELS: readonly [\"MUST\", \"SHOULD\", \"MAY\"];\ntype Level = (typeof LEVELS)[number];\ndeclare const PROFILES: readonly [\"core\", \"dispatch\"];\ntype Profile = (typeof PROFILES)[number];\ndeclare const CLAIMS: readonly [\"envelope\", \"core\", \"dispatch-profile\", \"a2a-binding\"];\ntype ClaimName = (typeof CLAIMS)[number];\ndeclare const OPS: readonly [\"send\", \"reply\", \"close\", \"markRead\", \"inbox\", \"thread\", \"canRead\", \"openBlocking\", \"join\", \"leave\", \"deliverHeld\", \"recover\", \"parseAddress\", \"validate\", \"render\", \"a2a.validate\", \"a2a.project\", \"a2a.inbound\", \"world\"];\ntype Op = (typeof OPS)[number];\ndeclare const CREATING_OPS: readonly [\"send\", \"reply\", \"close\", \"a2a.inbound\"];\ntype Json = null | boolean | number | string | Json[] | JsonObject;\ntype JsonObject = {\n [key: string]: Json;\n};\ninterface SenderSpec {\n address: string;\n canDecide: boolean;\n}\ninterface Given {\n clock?: string;\n seed?: number;\n workItems?: {\n id: string;\n liveSession?: string;\n sessions?: string[];\n }[];\n auxSessions?: string[];\n agents?: {\n address: string;\n status: 'pending' | 'approved' | 'revoked';\n muted?: boolean;\n }[];\n channels?: {\n name: string;\n members: string[];\n }[];\n implicit?: Record<string, string[]>;\n owner?: string;\n rulings?: Record<string, 'allow' | 'ask' | 'deny'>;\n wakeResults?: Record<string, {\n ok: true;\n session: string;\n } | {\n ok: false;\n reason: string;\n }>;\n failPush?: string[];\n failOnAnswered?: boolean;\n limits?: {\n urgentPerHour?: number;\n agentTurnsPerThreadPerHour?: number;\n };\n external?: Record<string, 'client' | 'peer'>;\n store?: {\n messages?: JsonObject[];\n deliveries?: JsonObject[];\n appliedGates?: string[];\n };\n}\ntype Step = {\n op: Op;\n} & JsonObject;\ntype StepResult = {\n ok: true;\n result?: Json;\n} | {\n ok: false;\n error: {\n code: string;\n field?: string;\n };\n};\ninterface Expectation {\n steps?: (StepResult | null)[];\n messages?: JsonObject[];\n noOtherMessages?: boolean;\n deliveries?: {\n message: string;\n recipient: string;\n via?: string;\n state?: string;\n session?: string | null;\n }[];\n noDeliveries?: string[];\n calls?: JsonObject[];\n callsInclude?: JsonObject[];\n gateEffects?: string[];\n voided?: string[];\n channels?: {\n name: string;\n members: string[];\n }[];\n render?: {\n step: number;\n text: string;\n }[];\n}\ninterface Vector {\n id: string;\n title: string;\n class: VectorClass;\n level: Level;\n profile: Profile;\n sections: string[];\n capability?: string;\n tags?: string[];\n given: Given;\n when: Step[];\n then: Expectation;\n}\ntype RunnableVector = Omit<Vector, 'then'>;\ninterface VectorFile {\n kit: string;\n class: VectorClass;\n area: string;\n vectors: Vector[];\n}\ninterface RenderForms {\n quotePrefix: string;\n header: string;\n hostLines: string[];\n digestLead: string;\n}\ninterface Hello {\n dmp: 'hello';\n implementation: {\n name: string;\n version: string;\n };\n classes: VectorClass[];\n profiles: Profile[];\n capabilities: string[];\n systemAddress: string;\n gateTypes: string[];\n render: RenderForms;\n}\ninterface ObservedMessage {\n id: string;\n thread: string;\n replyTo: string | null;\n from: string;\n to: string[];\n kind: string;\n body: string;\n refs: JsonObject[];\n data?: Json;\n urgent: boolean;\n blocking: boolean;\n choices?: string[];\n choice?: string;\n wake: string;\n createdAt: string;\n}\ninterface ObservedDelivery {\n id: string;\n message: string;\n recipient: string;\n session: string | null;\n via: string;\n state: string;\n}\ntype HookName = 'push' | 'notify' | 'notifyHuman' | 'wake' | 'decide' | 'onAnswered' | 'published' | 'admitExternal';\ntype CallRecord = {\n hook: HookName;\n} & {\n [field: string]: string | null;\n};\ninterface Observation {\n dmp: 'observation';\n id: string;\n steps: StepResult[];\n messages: ObservedMessage[];\n deliveries: ObservedDelivery[];\n calls: CallRecord[];\n gateEffects: string[];\n voided: string[];\n channels: {\n name: string;\n members: string[];\n }[];\n render: {\n step: number;\n text: string;\n }[];\n}\ninterface Unsupported {\n dmp: 'unsupported';\n id: string;\n reason: string;\n}\ntype Outcome = 'pass' | 'fail' | 'skipped' | 'not-applicable' | 'adapter-error';\ninterface VectorResult {\n id: string;\n class: VectorClass;\n level: Level;\n profile: Profile;\n outcome: Outcome;\n reasons: string[];\n}\ninterface ClassTally {\n pass: number;\n fail: number;\n skipped: number;\n notApplicable: number;\n shouldFailures: number;\n}\ninterface Deviation {\n section: string;\n summary: string;\n}\ninterface TckAttestation {\n commit: string;\n transport: string;\n level: 'must' | 'should' | 'may';\n result: 'pass' | 'fail';\n deviations: string[];\n}\ninterface Report {\n dmp: string;\n kit: string;\n implementation: {\n name: string;\n version: string;\n };\n claims: Partial<Record<ClaimName, 'pass' | 'fail' | 'vectors-only'>>;\n classes: Partial<Record<VectorClass, ClassTally>>;\n vectors: VectorResult[];\n declaredDeviations: Deviation[];\n a2a?: {\n tck: (Omit<TckAttestation, 'deviations'> & {\n attested: true;\n }) | null;\n deviations: string[];\n };\n runner: string;\n date: string;\n}\n//#endregion\n//#region src/version.d.ts\ndeclare const KIT_VERSION: string;\ndeclare const KIT_NAME: string;\n//#endregion\n//#region src/format.d.ts\ndeclare class FormatError extends Error {}\ndeclare function parseVectorFile(raw: unknown, where: string): VectorFile;\n//#endregion\n//#region src/load.d.ts\ndeclare const VECTORS_DIR: URL;\ndeclare function loadVectors(dir?: URL | string): {\n files: VectorFile[];\n vectors: Vector[];\n retired: {\n id: string;\n reason: string;\n }[];\n};\n//#endregion\n//#region src/prepare.d.ts\ndeclare function unimplementedGateType(registry: Registry, hello: Hello): string | null;\ndeclare function prepareVector(vector: Vector, hello: Hello, registry: Registry): {\n vector: Vector;\n notApplicable: boolean;\n};\ndeclare function stripThen(vector: Vector): RunnableVector;\n//#endregion\n//#region src/renderCheck.d.ts\ndeclare function checkRender(text: string, body: string, forms: RenderForms, external: boolean, senderText?: readonly string[]): string[];\ndeclare function checkDigest(text: string, body: string, forms: RenderForms): string[];\n//#endregion\n//#region src/compare.d.ts\ndeclare function bindSymbols(vector: Vector, observation: Observation, hello: Hello): Map<string, string>;\ndeclare function compare(vector: Vector, observation: Observation, hello: Hello): {\n ok: boolean;\n failures: string[];\n};\n//#endregion\n//#region src/deviations.d.ts\ndeclare const UNTESTED_SECTIONS: readonly [\"6.8\", \"9.3\", \"13.1\", \"13.7\", \"13.8\", \"13.9\", \"13.10\", \"13.11\", \"13.16\", \"B.2\"];\ndeclare const A2A_ALLOWED_DEVIATIONS: readonly [\"bounded-blocking-wait\", \"application-json\"];\ndeclare class UsageError extends Error {}\ndeclare function parseDeviations(raw: unknown): Deviation[];\ndeclare function parseTckAttestation(raw: unknown): TckAttestation;\n//#endregion\n//#region src/adapterProcess.d.ts\ndeclare class AdapterError extends Error {}\n//#endregion\n//#region src/runner.d.ts\ninterface RunOptions {\n adapter: string;\n claims: ClaimName[];\n vectorsDir?: URL | string;\n timeoutMs?: number;\n tckAttest?: TckAttestation;\n deviations?: Deviation[];\n vectorsOnly?: boolean;\n log?: (line: string) => void;\n}\ndeclare function runConformance(opts: RunOptions): Promise<Report>;\n//#endregion\n//#region src/junit.d.ts\ndeclare function toJUnit(report: Report): string;\n//#endregion\nexport { A2A_ALLOWED_DEVIATIONS, APPENDIX_HEADING, AdapterError, CLAIMS, CREATING_OPS, type CallRecord, type ClaimName, type ClassTally, type Deviation, ENGINE_REGISTRIES, type EntryScope, type EntryStatus, type Expectation, FormatError, type GateRaiser, type Given, type Hello, type HookName, type Json, type JsonObject, KIT_NAME, KIT_VERSION, LEVELS, type Level, OPS, type Observation, type ObservedDelivery, type ObservedMessage, type Op, type Outcome, PROFILES, type Profile, REGISTRY_NAMES, REGISTRY_PATH, type Registry, type RegistryEntry, type RegistryName, type RenderForms, type Report, type RunOptions, type RunnableVector, SECTION_NUMBER, SPEC_DIR, type SenderSpec, type Step, type StepResult, type TckAttestation, UNTESTED_SECTIONS, type Unsupported, UsageError, VECTORS_DIR, VECTOR_CLASSES, type Vector, type VectorClass, type VectorFile, type VectorResult, bindSymbols, checkDigest, checkRender, compare, driftProblems, listSections, loadRegistry, loadVectors, parseDeviations, parseTckAttestation, parseVectorFile, prepareVector, renderRegistries, runConformance, sectionsOf, stripThen, toJUnit, unimplementedGateType };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AA8JiB;AAEI;cAtHPuB,cAkIHC,EAAAA,SAAAA,CAAAA,UAAAA,EAAAA,WAAAA,EAAAA,aAAAA,EAAAA,YAAAA,CAAAA;KAjINA,WAAAA,GAkIOI,CAAAA,OAlIeL,cAkIfK,CAAAA,CAAAA,MAAAA,CAAAA;cAjIEH,MAqIJoB,EAAAA,SAAAA,CAAAA,MAAAA,EAAAA,QAAAA,EAAAA,KAAAA,CAAAA;KApILnB,KAAAA,GAoIgB,CAAA,OApIAD,MAoIA,CAAA,CAAA,MAAA,CAAA;AAAA,cAnIPE,QAqIW,EAAA,SAAA,CAAA,MAQjBQ,EAAAA,UACK,CAAA;AAAA,KA7IRP,OAAAA,GAqJKoB,CAAAA,OArJarB,QAqJG,CAAA,CAAA,MAAA,CAAA;AAUV,cA5JFI,GAgKJoB,EAAW,SAAA,CAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAAA,aAAA,EAAA,SAAA,EAAA,cAAA,EAAA,UAAA,EAAA,QAAA,EAAA,c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A,ECsEA,IDtEAA;EACDC,QAAAA,CAAAA,OAAAA,ECyEY,ODzEZA,CAAAA,ECyEsB,YDzEtBA,GAAAA,IAAAA;EACAE,aAAAA,CAAAA,MAAAA,EC6EI,cD7EJA,EAAAA,OAAAA,EC8EK,MD9ELA,EAAAA,YAAAA,EC+EU,OD/EVA,GAAAA,IAAAA,EAAAA,OAAAA,ECgFK,ODhFLA,CAAAA,ECiFH,iBDjFGA;EAAW,QAAA,MAAA;AAAA;;;cErJN,aAAA,SAAsB,KAAA;;;;;AFwCrBjB,UGCG,SAAA,CHD4E;EACxFC,MAAAA,EGCK,cHDM;EACFC,KAAAA,EGCL,kBHD+C;EACnDC,IAAAA,EGCG,eHDaD;AAAM;AAEtBG,KGCO,SAAA,GHDA,CAAA,IAAWD,EGEf,IHFeA,EAAQ,GAAA,EGGxB,SHHwB,EAAA,GGI1B,OHJ0B,CGIlB,IHJkB,GAAA,SAAA,CAAA,GGIE,IHJF,GAAA,SAAA;AAGjBI,UGEG,cAAA,CHFuO;EACnPC,GAAAA,CAAAA,EGGG,MHHD,CAAA,MAAWD,EGGK,SHHF,CAAA;EAEhBG,SAAI,CAAA,EAAA,SAAsCA,MAASC,EAAAA;AAAU;AAQxDE,cGmBG,eHnBE,EGmBe,KHnBf;AAkBFrB,iBG8WS,SAAA,CH9WTA,MAAAA,EG+WH,cH/WGA,EAAAA,OAAAA,CAAAA,EGgXF,cHhXEA,CAAAA,EGiXV,OHjXUA,CGiXF,WHjXEA,CAAAA;;;iBIzDG,UAAA,QACP,qBACO,mBAAmB,QAAQ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./constants-CRXF4f7g.js";
|
|
2
|
+
import "./version-Ds8ZFZLh.js";
|
|
3
|
+
import { a as applyWorld, i as ConformanceHost, n as REFERENCE_HELLO, o as worldFrom, r as runVector, s as UnsupportedOp, t as serveStdio } from "./serve-CVPZbCpT.js";
|
|
4
|
+
|
|
5
|
+
export { ConformanceHost, REFERENCE_HELLO, UnsupportedOp, applyWorld, runVector, serveStdio, worldFrom };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
2
|
+
/** The daemon's own identity: sender of gates, notices and breaker flags. */
|
|
3
|
+
const SYSTEM_ADDRESS = "agent:dispatch";
|
|
4
|
+
/** A human or the system: the only authors whose answers take effect. */
|
|
5
|
+
function isDecidingAuthor(address) {
|
|
6
|
+
return address === SYSTEM_ADDRESS || address.startsWith("human:");
|
|
7
|
+
}
|
|
8
|
+
const ADDRESS_SCHEMES = [
|
|
9
|
+
"human",
|
|
10
|
+
"agent",
|
|
11
|
+
"task",
|
|
12
|
+
"run",
|
|
13
|
+
"channel",
|
|
14
|
+
"a2a"
|
|
15
|
+
];
|
|
16
|
+
const BUILT_IN_KINDS = [
|
|
17
|
+
"message",
|
|
18
|
+
"question",
|
|
19
|
+
"answer",
|
|
20
|
+
"handoff",
|
|
21
|
+
"notice"
|
|
22
|
+
];
|
|
23
|
+
const REF_TYPES = [
|
|
24
|
+
"task",
|
|
25
|
+
"run",
|
|
26
|
+
"file",
|
|
27
|
+
"commit",
|
|
28
|
+
"message",
|
|
29
|
+
"doc"
|
|
30
|
+
];
|
|
31
|
+
const GATE_TYPES = [
|
|
32
|
+
"tool-approval",
|
|
33
|
+
"scope",
|
|
34
|
+
"wake",
|
|
35
|
+
"agent-registration",
|
|
36
|
+
"overseer-action",
|
|
37
|
+
"memory",
|
|
38
|
+
"task-proposal",
|
|
39
|
+
"doc"
|
|
40
|
+
];
|
|
41
|
+
const DELIVERY_STATES = [
|
|
42
|
+
"held",
|
|
43
|
+
"sending",
|
|
44
|
+
"pushed",
|
|
45
|
+
"notified",
|
|
46
|
+
"read",
|
|
47
|
+
"answered"
|
|
48
|
+
];
|
|
49
|
+
/** The system markers: `data.type` values that mean something only from the system. */
|
|
50
|
+
const MARKERS = ["x-closed", "x-breaker"];
|
|
51
|
+
/** The engine's error codes and the HTTP status a host answers each with. */
|
|
52
|
+
const ERROR_CODES = {
|
|
53
|
+
invalid: 400,
|
|
54
|
+
forbidden: 403,
|
|
55
|
+
"not-found": 404,
|
|
56
|
+
conflict: 409,
|
|
57
|
+
limited: 429
|
|
58
|
+
};
|
|
59
|
+
const MAX_ADDRESS_BYTES = 256;
|
|
60
|
+
const MAX_SEGMENT_BYTES = 64;
|
|
61
|
+
const GATE_RAISERS = {
|
|
62
|
+
wake: "system",
|
|
63
|
+
"tool-approval": "system",
|
|
64
|
+
scope: "session",
|
|
65
|
+
"agent-registration": "system",
|
|
66
|
+
"overseer-action": "system",
|
|
67
|
+
memory: "system",
|
|
68
|
+
"task-proposal": "system",
|
|
69
|
+
doc: "system"
|
|
70
|
+
};
|
|
71
|
+
function raiserOf(type) {
|
|
72
|
+
return GATE_RAISERS[type] ?? "system";
|
|
73
|
+
}
|
|
74
|
+
function hasGateData(m) {
|
|
75
|
+
const data = m.data;
|
|
76
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) return false;
|
|
77
|
+
const type = data.type;
|
|
78
|
+
return typeof type === "string" && !type.startsWith("x-");
|
|
79
|
+
}
|
|
80
|
+
function gateTypeOf(m, known) {
|
|
81
|
+
if (m.kind !== "question" && m.kind !== "handoff" || !hasGateData(m)) return null;
|
|
82
|
+
const type = m.data.type;
|
|
83
|
+
if (known.has(type)) return type;
|
|
84
|
+
return isDecidingAuthor(m.from ?? "") ? type : null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { GATE_RAISERS as a, MAX_ADDRESS_BYTES as c, SYSTEM_ADDRESS as d, gateTypeOf as f, raiserOf as h, ERROR_CODES as i, MAX_SEGMENT_BYTES as l, isDecidingAuthor as m, BUILT_IN_KINDS as n, GATE_TYPES as o, hasGateData as p, DELIVERY_STATES as r, MARKERS as s, ADDRESS_SCHEMES as t, REF_TYPES as u };
|
|
89
|
+
//# sourceMappingURL=constants-CRXF4f7g.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CRXF4f7g.js","names":["GATE_RAISERS: Readonly<Record<string, GateRaiser>>"],"sources":["../src/constants.ts"],"sourcesContent":["// Registry constants and gate predicates. This module imports nothing, so a\n// browser entry can share it without reaching node:sqlite.\n\n/** The daemon's own identity: sender of gates, notices and breaker flags. */\nexport const SYSTEM_ADDRESS = 'agent:dispatch';\n\n/** A human or the system: the only authors whose answers take effect. */\nexport function isDecidingAuthor(address: string): boolean {\n return address === SYSTEM_ADDRESS || address.startsWith('human:');\n}\n\nexport const ADDRESS_SCHEMES = [\n 'human',\n 'agent',\n 'task',\n 'run',\n 'channel',\n 'a2a',\n] as const;\n\nexport const BUILT_IN_KINDS = [\n 'message',\n 'question',\n 'answer',\n 'handoff',\n 'notice',\n] as const;\n\nexport const REF_TYPES = [\n 'task',\n 'run',\n 'file',\n 'commit',\n 'message',\n 'doc',\n] as const;\n\n// Every gate type this package defines a payload for; a host implements a subset.\nexport const GATE_TYPES = [\n 'tool-approval',\n 'scope',\n 'wake',\n 'agent-registration',\n 'overseer-action',\n 'memory',\n 'task-proposal',\n 'doc',\n] as const;\n\nexport const DELIVERY_STATES = [\n 'held',\n 'sending',\n 'pushed',\n 'notified',\n 'read',\n 'answered',\n] as const;\n\n/** The system markers: `data.type` values that mean something only from the system. */\nexport const MARKERS = ['x-closed', 'x-breaker'] as const;\n\n/** The engine's error codes and the HTTP status a host answers each with. */\nexport const ERROR_CODES = {\n invalid: 400,\n forbidden: 403,\n 'not-found': 404,\n conflict: 409,\n limited: 429,\n} as const;\n\n// Ceilings on one address and on each handle, operator, id and channel segment.\nexport const MAX_ADDRESS_BYTES = 256;\nexport const MAX_SEGMENT_BYTES = 64;\n\nexport type GateRaiser = 'system' | 'system-or-decider' | 'session';\n\n// Who may raise each gate type. A type missing here is system-only.\nexport const GATE_RAISERS: Readonly<Record<string, GateRaiser>> = {\n wake: 'system',\n 'tool-approval': 'system',\n scope: 'session',\n 'agent-registration': 'system',\n 'overseer-action': 'system',\n memory: 'system',\n 'task-proposal': 'system',\n doc: 'system',\n};\n\nexport function raiserOf(type: string): GateRaiser {\n return GATE_RAISERS[type] ?? 'system';\n}\n\n// Gate data: an object `data` whose `type` is a string without the x- prefix,\n// on any kind. Egress and locality use this, known type or not.\nexport function hasGateData(m: { data?: unknown }): boolean {\n const data = m.data;\n if (data === null || typeof data !== 'object' || Array.isArray(data))\n return false;\n const type = (data as { type?: unknown }).type;\n return typeof type === 'string' && !type.startsWith('x-');\n}\n\n// The gate type a question or handoff carries, or null for a plain one: a\n// known type always counts; an unknown one only from the system or a human.\nexport function gateTypeOf(\n m: { kind: string; from?: string; data?: unknown },\n known: ReadonlySet<string>\n): string | null {\n if ((m.kind !== 'question' && m.kind !== 'handoff') || !hasGateData(m))\n return null;\n const type = (m.data as { type: string }).type;\n if (known.has(type)) return type;\n return isDecidingAuthor(m.from ?? '') ? type : null;\n}\n"],"mappings":";;AAIA,MAAa,iBAAiB;;AAG9B,SAAgB,iBAAiB,SAA0B;AACzD,QAAO,YAAY,kBAAkB,QAAQ,WAAW,SAAS;;AAGnE,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,YAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACD;AAGD,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,UAAU,CAAC,YAAY,YAAY;;AAGhD,MAAa,cAAc;CACzB,SAAS;CACT,WAAW;CACX,aAAa;CACb,UAAU;CACV,SAAS;CACV;AAGD,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;AAKjC,MAAaA,eAAqD;CAChE,MAAM;CACN,iBAAiB;CACjB,OAAO;CACP,sBAAsB;CACtB,mBAAmB;CACnB,QAAQ;CACR,iBAAiB;CACjB,KAAK;CACN;AAED,SAAgB,SAAS,MAA0B;AACjD,QAAO,aAAa,SAAS;;AAK/B,SAAgB,YAAY,GAAgC;CAC1D,MAAM,OAAO,EAAE;AACf,KAAI,SAAS,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,KAAK,CAClE,QAAO;CACT,MAAM,OAAQ,KAA4B;AAC1C,QAAO,OAAO,SAAS,YAAY,CAAC,KAAK,WAAW,KAAK;;AAK3D,SAAgB,WACd,GACA,OACe;AACf,KAAK,EAAE,SAAS,cAAc,EAAE,SAAS,aAAc,CAAC,YAAY,EAAE,CACpE,QAAO;CACT,MAAM,OAAQ,EAAE,KAA0B;AAC1C,KAAI,MAAM,IAAI,KAAK,CAAE,QAAO;AAC5B,QAAO,iBAAiB,EAAE,QAAQ,GAAG,GAAG,OAAO"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/constants.d.ts
|
|
2
|
+
/** The daemon's own identity: sender of gates, notices and breaker flags. */
|
|
3
|
+
declare const SYSTEM_ADDRESS = "agent:dispatch";
|
|
4
|
+
/** A human or the system: the only authors whose answers take effect. */
|
|
5
|
+
declare function isDecidingAuthor(address: string): boolean;
|
|
6
|
+
declare const ADDRESS_SCHEMES: readonly ["human", "agent", "task", "run", "channel", "a2a"];
|
|
7
|
+
declare const BUILT_IN_KINDS: readonly ["message", "question", "answer", "handoff", "notice"];
|
|
8
|
+
declare const REF_TYPES: readonly ["task", "run", "file", "commit", "message", "doc"];
|
|
9
|
+
declare const GATE_TYPES: readonly ["tool-approval", "scope", "wake", "agent-registration", "overseer-action", "memory", "task-proposal", "doc"];
|
|
10
|
+
declare const DELIVERY_STATES: readonly ["held", "sending", "pushed", "notified", "read", "answered"];
|
|
11
|
+
/** The system markers: `data.type` values that mean something only from the system. */
|
|
12
|
+
declare const MARKERS: readonly ["x-closed", "x-breaker"];
|
|
13
|
+
/** The engine's error codes and the HTTP status a host answers each with. */
|
|
14
|
+
declare const ERROR_CODES: {
|
|
15
|
+
readonly invalid: 400;
|
|
16
|
+
readonly forbidden: 403;
|
|
17
|
+
readonly 'not-found': 404;
|
|
18
|
+
readonly conflict: 409;
|
|
19
|
+
readonly limited: 429;
|
|
20
|
+
};
|
|
21
|
+
declare const MAX_ADDRESS_BYTES = 256;
|
|
22
|
+
declare const MAX_SEGMENT_BYTES = 64;
|
|
23
|
+
type GateRaiser = 'system' | 'system-or-decider' | 'session';
|
|
24
|
+
declare const GATE_RAISERS: Readonly<Record<string, GateRaiser>>;
|
|
25
|
+
declare function raiserOf(type: string): GateRaiser;
|
|
26
|
+
declare function hasGateData(m: {
|
|
27
|
+
data?: unknown;
|
|
28
|
+
}): boolean;
|
|
29
|
+
declare function gateTypeOf(m: {
|
|
30
|
+
kind: string;
|
|
31
|
+
from?: string;
|
|
32
|
+
data?: unknown;
|
|
33
|
+
}, known: ReadonlySet<string>): string | null;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { GATE_RAISERS as a, MARKERS as c, REF_TYPES as d, SYSTEM_ADDRESS as f, raiserOf as g, isDecidingAuthor as h, ERROR_CODES as i, MAX_ADDRESS_BYTES as l, hasGateData as m, BUILT_IN_KINDS as n, GATE_TYPES as o, gateTypeOf as p, DELIVERY_STATES as r, GateRaiser as s, ADDRESS_SCHEMES as t, MAX_SEGMENT_BYTES as u };
|
|
36
|
+
//# sourceMappingURL=constants-CUM7Sm5u.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CUM7Sm5u.d.ts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";;AAIa,cAAA,cAAA,GAAc,gBAAA;AAG3B;AAIa,iBAJG,gBAAA,CAWN,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAEG,cATA,eAeH,EAAA,SAAA,CAAA,OAAA,EAAA,OAAA,EAAA,MAAA,EAAA,KAAA,EAAA,SAAA,EAAA,KAAA,CAAA;AAEG,cARA,cAeH,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,QAAA,EAAA,SAAA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