ftown-bridge 0.30.85 → 0.30.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/direct-transport/loopback-server.d.ts +26 -4
- package/dist/direct-transport/loopback-server.js +112 -38
- package/dist/direct-transport/loopback-server.js.map +1 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/dist/local-api-server.d.ts +10 -0
- package/dist/local-api-server.js +73 -25
- package/dist/local-api-server.js.map +1 -1
- package/dist/workspace/authority.d.ts +21 -230
- package/dist/workspace/authority.js +86 -239
- package/dist/workspace/authority.js.map +1 -1
- package/dist/workspace/browser-application.d.ts +26 -0
- package/dist/workspace/browser-application.js +10 -0
- package/dist/workspace/browser-application.js.map +1 -0
- package/dist/workspace/browser-authority.d.ts +2 -0
- package/dist/workspace/browser-authority.js +49 -0
- package/dist/workspace/browser-authority.js.map +1 -0
- package/dist/workspace/browser-relay.d.ts +17 -0
- package/dist/workspace/browser-relay.js +222 -0
- package/dist/workspace/browser-relay.js.map +1 -0
- package/dist/workspace/browser-rtc.d.ts +29 -0
- package/dist/workspace/browser-rtc.js +247 -0
- package/dist/workspace/browser-rtc.js.map +1 -0
- package/dist/workspace/browser-session.d.ts +109 -0
- package/dist/workspace/browser-session.js +781 -0
- package/dist/workspace/browser-session.js.map +1 -0
- package/dist/workspace/cli.js +106 -4
- package/dist/workspace/cli.js.map +1 -1
- package/dist/workspace/device.d.ts +9 -4
- package/dist/workspace/device.js +46 -1
- package/dist/workspace/device.js.map +1 -1
- package/dist/workspace/enrollment.d.ts +25 -2
- package/dist/workspace/enrollment.js +141 -25
- package/dist/workspace/enrollment.js.map +1 -1
- package/dist/workspace/listener.js +9 -2
- package/dist/workspace/listener.js.map +1 -1
- package/dist/workspace/pq/bytes.d.ts +15 -0
- package/dist/workspace/pq/bytes.js +80 -0
- package/dist/workspace/pq/bytes.js.map +1 -0
- package/dist/workspace/pq/carrier.d.ts +24 -0
- package/dist/workspace/pq/carrier.js +70 -0
- package/dist/workspace/pq/carrier.js.map +1 -0
- package/dist/workspace/pq/ledger-core.d.ts +597 -0
- package/dist/workspace/pq/ledger-core.js +524 -0
- package/dist/workspace/pq/ledger-core.js.map +1 -0
- package/dist/workspace/pq/pairing-link.d.ts +15 -0
- package/dist/workspace/pq/pairing-link.js +88 -0
- package/dist/workspace/pq/pairing-link.js.map +1 -0
- package/dist/workspace/pq/relay-client.d.ts +76 -0
- package/dist/workspace/pq/relay-client.js +307 -0
- package/dist/workspace/pq/relay-client.js.map +1 -0
- package/dist/workspace/pq/relay-identity.d.ts +7 -0
- package/dist/workspace/pq/relay-identity.js +6 -0
- package/dist/workspace/pq/relay-identity.js.map +1 -0
- package/dist/workspace/pq/relay-stream.d.ts +89 -0
- package/dist/workspace/pq/relay-stream.js +318 -0
- package/dist/workspace/pq/relay-stream.js.map +1 -0
- package/dist/workspace/pq/session-client.d.ts +103 -0
- package/dist/workspace/pq/session-client.js +607 -0
- package/dist/workspace/pq/session-client.js.map +1 -0
- package/dist/workspace/pq/session-protocol.d.ts +226 -0
- package/dist/workspace/pq/session-protocol.js +301 -0
- package/dist/workspace/pq/session-protocol.js.map +1 -0
- package/dist/workspace/rendezvous-client.js +1 -1
- package/dist/workspace/rendezvous-client.js.map +1 -1
- package/dist/workspace/rendezvous-wire.d.ts +33 -4
- package/dist/workspace/rendezvous-wire.js +77 -2
- package/dist/workspace/rendezvous-wire.js.map +1 -1
- package/dist/workspace/rendezvous.js +2 -1
- package/dist/workspace/rendezvous.js.map +1 -1
- package/dist/workspace/runtime.d.ts +4 -0
- package/dist/workspace/runtime.js +11 -1
- package/dist/workspace/runtime.js.map +1 -1
- package/dist/workspace/writer-only.d.ts +3 -1
- package/dist/workspace/writer-only.js +23 -0
- package/dist/workspace/writer-only.js.map +1 -1
- package/package.json +2 -2
- package/skills/ftown/SKILL.md +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** In-memory carrier pair for tests. Delivery is ordered and asynchronous; each write may be delayed. */
|
|
2
|
+
export function carrierPair(options = {}) {
|
|
3
|
+
const kind = options.kind ?? 'relay';
|
|
4
|
+
const delayMs = options.delayMs ?? 0;
|
|
5
|
+
const written = { a: 0, b: 0 };
|
|
6
|
+
const faults = { a: [], b: [] };
|
|
7
|
+
let closed = false;
|
|
8
|
+
let closeError;
|
|
9
|
+
const sides = {
|
|
10
|
+
a: { data: [], close: [], tail: Promise.resolve() },
|
|
11
|
+
b: { data: [], close: [], tail: Promise.resolve() },
|
|
12
|
+
};
|
|
13
|
+
const stalled = [];
|
|
14
|
+
const wait = () => new Promise(resolve => (delayMs > 0 ? setTimeout(resolve, delayMs) : queueMicrotask(resolve)));
|
|
15
|
+
function shutdown(error) {
|
|
16
|
+
if (closed)
|
|
17
|
+
return;
|
|
18
|
+
closed = true;
|
|
19
|
+
closeError = error;
|
|
20
|
+
for (const reject of stalled.splice(0))
|
|
21
|
+
reject();
|
|
22
|
+
// Notify asynchronously so a listener never re-enters the caller of close().
|
|
23
|
+
queueMicrotask(() => {
|
|
24
|
+
for (const side of [sides.a, sides.b])
|
|
25
|
+
for (const listener of side.close.splice(0))
|
|
26
|
+
listener(closeError);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function make(self) {
|
|
30
|
+
const peer = self === 'a' ? sides.b : sides.a;
|
|
31
|
+
const mine = sides[self];
|
|
32
|
+
return {
|
|
33
|
+
kind,
|
|
34
|
+
write(bytes) {
|
|
35
|
+
if (closed)
|
|
36
|
+
return Promise.reject(new Error('Carrier closed'));
|
|
37
|
+
if (!(bytes instanceof Uint8Array))
|
|
38
|
+
return Promise.reject(new Error('Carrier accepts bytes only'));
|
|
39
|
+
const fault = faults[self].shift();
|
|
40
|
+
if (fault === 'stall') {
|
|
41
|
+
return new Promise((_resolve, reject) => { stalled.push(() => reject(new Error('Carrier closed'))); });
|
|
42
|
+
}
|
|
43
|
+
const copy = new Uint8Array(bytes);
|
|
44
|
+
if (fault === 'corrupt' && copy.length)
|
|
45
|
+
copy[copy.length >> 1] ^= 0x01;
|
|
46
|
+
const deliveries = fault === 'drop' ? 0 : fault === 'duplicate' ? 2 : 1;
|
|
47
|
+
const next = mine.tail.then(async () => {
|
|
48
|
+
await wait();
|
|
49
|
+
for (let index = 0; index < deliveries && !closed; index++) {
|
|
50
|
+
written[self] += copy.length;
|
|
51
|
+
for (const listener of peer.data)
|
|
52
|
+
listener(index ? new Uint8Array(copy) : copy);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
mine.tail = next.catch(() => undefined);
|
|
56
|
+
return next;
|
|
57
|
+
},
|
|
58
|
+
onData(listener) { mine.data.push(listener); },
|
|
59
|
+
onClose(listener) {
|
|
60
|
+
if (closed)
|
|
61
|
+
queueMicrotask(() => listener(closeError));
|
|
62
|
+
else
|
|
63
|
+
mine.close.push(listener);
|
|
64
|
+
},
|
|
65
|
+
close() { shutdown(); },
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return [make('a'), make('b'), { inject(from, fault) { faults[from].push(fault); }, written }];
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=carrier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier.js","sourceRoot":"","sources":["../../../src/workspace/pq/carrier.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Bytes } from './bytes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Signed workspace ledger rules shared by the bridge and the browser. The bridge supplies OpenSSL-backed
|
|
5
|
+
* hooks and verifies each signature inline. A browser supplies WebCrypto or bundled hooks, records the
|
|
6
|
+
* signature checks, and trusts the returned state only after all of them pass.
|
|
7
|
+
*/
|
|
8
|
+
export interface LedgerHooks {
|
|
9
|
+
sha256(bytes: Uint8Array): Uint8Array;
|
|
10
|
+
/** Throws unless the value is a canonical ML-DSA-87 SubjectPublicKeyInfo. */
|
|
11
|
+
signingKey(spki: string): void;
|
|
12
|
+
/** Throws unless the value is a canonical ML-KEM-1024 SubjectPublicKeyInfo. */
|
|
13
|
+
kemKey(spki: string): void;
|
|
14
|
+
/** Throws on an invalid signature, or records the check for the caller to complete. */
|
|
15
|
+
verify(publicKey: string, message: Uint8Array, signature: string): void;
|
|
16
|
+
now(): number;
|
|
17
|
+
}
|
|
18
|
+
export declare const MAX_ROSTER_BYTES: number;
|
|
19
|
+
export declare const workspaceRole: z.ZodEnum<{
|
|
20
|
+
bridge: "bridge";
|
|
21
|
+
browser: "browser";
|
|
22
|
+
client: "client";
|
|
23
|
+
"pq-browser": "pq-browser";
|
|
24
|
+
}>;
|
|
25
|
+
declare const policy: z.ZodEnum<{
|
|
26
|
+
strict: "strict";
|
|
27
|
+
standard: "standard";
|
|
28
|
+
}>;
|
|
29
|
+
/** Reported by the enrolling browser and shown to the owner. It is a label, not an attestation. */
|
|
30
|
+
export declare const keyProtection: z.ZodEnum<{
|
|
31
|
+
native: "native";
|
|
32
|
+
wrapped: "wrapped";
|
|
33
|
+
}>;
|
|
34
|
+
export type KeyProtection = z.infer<typeof keyProtection>;
|
|
35
|
+
/** Reported by the enrolling browser: a browser tab or an installed standalone web app. Not attested. */
|
|
36
|
+
export declare const appContext: z.ZodEnum<{
|
|
37
|
+
browser: "browser";
|
|
38
|
+
standalone: "standalone";
|
|
39
|
+
}>;
|
|
40
|
+
export type AppContext = z.infer<typeof appContext>;
|
|
41
|
+
/** A WebAuthn passkey used only for user verification on a workspace account. */
|
|
42
|
+
export declare const accountCredential: z.ZodObject<{
|
|
43
|
+
credentialId: z.ZodString;
|
|
44
|
+
publicKey: z.ZodString;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export type AccountCredential = z.infer<typeof accountCredential>;
|
|
47
|
+
export declare const accountState: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
50
|
+
credentialId: z.ZodString;
|
|
51
|
+
publicKey: z.ZodString;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
revokedCredentials: z.ZodArray<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export type AccountState = z.infer<typeof accountState>;
|
|
56
|
+
export declare const browserDevices: z.ZodObject<{
|
|
57
|
+
version: z.ZodLiteral<1>;
|
|
58
|
+
origin: z.ZodString;
|
|
59
|
+
rpId: z.ZodString;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type BrowserDevices = z.infer<typeof browserDevices>;
|
|
62
|
+
export declare const workspaceMember: z.ZodObject<{
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
role: z.ZodEnum<{
|
|
65
|
+
bridge: "bridge";
|
|
66
|
+
browser: "browser";
|
|
67
|
+
client: "client";
|
|
68
|
+
"pq-browser": "pq-browser";
|
|
69
|
+
}>;
|
|
70
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
label: z.ZodString;
|
|
72
|
+
publicKey: z.ZodString;
|
|
73
|
+
endpoint: z.ZodObject<{
|
|
74
|
+
version: z.ZodLiteral<1>;
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
ownerId: z.ZodString;
|
|
77
|
+
kind: z.ZodEnum<{
|
|
78
|
+
bridge: "bridge";
|
|
79
|
+
browser: "browser";
|
|
80
|
+
"local-cli": "local-cli";
|
|
81
|
+
}>;
|
|
82
|
+
publicKey: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
85
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
87
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
host: z.ZodString;
|
|
89
|
+
port: z.ZodNumber;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
92
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
93
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
94
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
96
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
native: "native";
|
|
99
|
+
wrapped: "wrapped";
|
|
100
|
+
}>>;
|
|
101
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
browser: "browser";
|
|
103
|
+
standalone: "standalone";
|
|
104
|
+
}>>;
|
|
105
|
+
account: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
export type WorkspaceMember = z.infer<typeof workspaceMember>;
|
|
108
|
+
export type WorkspacePolicy = z.infer<typeof policy>;
|
|
109
|
+
declare const delegation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
110
|
+
version: z.ZodLiteral<3>;
|
|
111
|
+
type: z.ZodLiteral<"writer">;
|
|
112
|
+
workspaceId: z.ZodString;
|
|
113
|
+
generation: z.ZodNumber;
|
|
114
|
+
writerId: z.ZodString;
|
|
115
|
+
writerPublicKey: z.ZodString;
|
|
116
|
+
policy: z.ZodEnum<{
|
|
117
|
+
strict: "strict";
|
|
118
|
+
standard: "standard";
|
|
119
|
+
}>;
|
|
120
|
+
members: z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
role: z.ZodEnum<{
|
|
123
|
+
bridge: "bridge";
|
|
124
|
+
browser: "browser";
|
|
125
|
+
client: "client";
|
|
126
|
+
"pq-browser": "pq-browser";
|
|
127
|
+
}>;
|
|
128
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
label: z.ZodString;
|
|
130
|
+
publicKey: z.ZodString;
|
|
131
|
+
endpoint: z.ZodObject<{
|
|
132
|
+
version: z.ZodLiteral<1>;
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
ownerId: z.ZodString;
|
|
135
|
+
kind: z.ZodEnum<{
|
|
136
|
+
bridge: "bridge";
|
|
137
|
+
browser: "browser";
|
|
138
|
+
"local-cli": "local-cli";
|
|
139
|
+
}>;
|
|
140
|
+
publicKey: z.ZodString;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
143
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
145
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
host: z.ZodString;
|
|
147
|
+
port: z.ZodNumber;
|
|
148
|
+
}, z.core.$strict>>;
|
|
149
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
150
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
151
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
152
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
154
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
156
|
+
native: "native";
|
|
157
|
+
wrapped: "wrapped";
|
|
158
|
+
}>>;
|
|
159
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
160
|
+
browser: "browser";
|
|
161
|
+
standalone: "standalone";
|
|
162
|
+
}>>;
|
|
163
|
+
account: z.ZodOptional<z.ZodString>;
|
|
164
|
+
}, z.core.$strict>>;
|
|
165
|
+
revoked: z.ZodArray<z.ZodString>;
|
|
166
|
+
previous: z.ZodNullable<z.ZodObject<{
|
|
167
|
+
generation: z.ZodNumber;
|
|
168
|
+
revision: z.ZodNumber;
|
|
169
|
+
head: z.ZodString;
|
|
170
|
+
}, z.core.$strict>>;
|
|
171
|
+
rendezvousNamespace: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
173
|
+
type: z.ZodLiteral<"writer">;
|
|
174
|
+
workspaceId: z.ZodString;
|
|
175
|
+
generation: z.ZodNumber;
|
|
176
|
+
writerId: z.ZodString;
|
|
177
|
+
writerPublicKey: z.ZodString;
|
|
178
|
+
policy: z.ZodEnum<{
|
|
179
|
+
strict: "strict";
|
|
180
|
+
standard: "standard";
|
|
181
|
+
}>;
|
|
182
|
+
members: z.ZodArray<z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
role: z.ZodEnum<{
|
|
185
|
+
bridge: "bridge";
|
|
186
|
+
browser: "browser";
|
|
187
|
+
client: "client";
|
|
188
|
+
"pq-browser": "pq-browser";
|
|
189
|
+
}>;
|
|
190
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
label: z.ZodString;
|
|
192
|
+
publicKey: z.ZodString;
|
|
193
|
+
endpoint: z.ZodObject<{
|
|
194
|
+
version: z.ZodLiteral<1>;
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
ownerId: z.ZodString;
|
|
197
|
+
kind: z.ZodEnum<{
|
|
198
|
+
bridge: "bridge";
|
|
199
|
+
browser: "browser";
|
|
200
|
+
"local-cli": "local-cli";
|
|
201
|
+
}>;
|
|
202
|
+
publicKey: z.ZodString;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
205
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
206
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
207
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
host: z.ZodString;
|
|
209
|
+
port: z.ZodNumber;
|
|
210
|
+
}, z.core.$strict>>;
|
|
211
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
212
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
213
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
214
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
216
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
217
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
218
|
+
native: "native";
|
|
219
|
+
wrapped: "wrapped";
|
|
220
|
+
}>>;
|
|
221
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
browser: "browser";
|
|
223
|
+
standalone: "standalone";
|
|
224
|
+
}>>;
|
|
225
|
+
account: z.ZodOptional<z.ZodString>;
|
|
226
|
+
}, z.core.$strict>>;
|
|
227
|
+
revoked: z.ZodArray<z.ZodString>;
|
|
228
|
+
previous: z.ZodNullable<z.ZodObject<{
|
|
229
|
+
generation: z.ZodNumber;
|
|
230
|
+
revision: z.ZodNumber;
|
|
231
|
+
head: z.ZodString;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
rendezvousNamespace: z.ZodOptional<z.ZodString>;
|
|
234
|
+
version: z.ZodLiteral<4>;
|
|
235
|
+
browserDevices: z.ZodObject<{
|
|
236
|
+
version: z.ZodLiteral<1>;
|
|
237
|
+
origin: z.ZodString;
|
|
238
|
+
rpId: z.ZodString;
|
|
239
|
+
}, z.core.$strict>;
|
|
240
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
241
|
+
id: z.ZodString;
|
|
242
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
243
|
+
credentialId: z.ZodString;
|
|
244
|
+
publicKey: z.ZodString;
|
|
245
|
+
}, z.core.$strict>>;
|
|
246
|
+
revokedCredentials: z.ZodArray<z.ZodString>;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
}, z.core.$strict>], "version">;
|
|
249
|
+
export type WorkspaceDelegation = z.infer<typeof delegation>;
|
|
250
|
+
export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
251
|
+
type: z.ZodLiteral<"add">;
|
|
252
|
+
member: z.ZodObject<{
|
|
253
|
+
id: z.ZodString;
|
|
254
|
+
role: z.ZodEnum<{
|
|
255
|
+
bridge: "bridge";
|
|
256
|
+
browser: "browser";
|
|
257
|
+
client: "client";
|
|
258
|
+
"pq-browser": "pq-browser";
|
|
259
|
+
}>;
|
|
260
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
261
|
+
label: z.ZodString;
|
|
262
|
+
publicKey: z.ZodString;
|
|
263
|
+
endpoint: z.ZodObject<{
|
|
264
|
+
version: z.ZodLiteral<1>;
|
|
265
|
+
id: z.ZodString;
|
|
266
|
+
ownerId: z.ZodString;
|
|
267
|
+
kind: z.ZodEnum<{
|
|
268
|
+
bridge: "bridge";
|
|
269
|
+
browser: "browser";
|
|
270
|
+
"local-cli": "local-cli";
|
|
271
|
+
}>;
|
|
272
|
+
publicKey: z.ZodString;
|
|
273
|
+
}, z.core.$strict>;
|
|
274
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
275
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
276
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
277
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
host: z.ZodString;
|
|
279
|
+
port: z.ZodNumber;
|
|
280
|
+
}, z.core.$strict>>;
|
|
281
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
282
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
283
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
284
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
286
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
288
|
+
native: "native";
|
|
289
|
+
wrapped: "wrapped";
|
|
290
|
+
}>>;
|
|
291
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
292
|
+
browser: "browser";
|
|
293
|
+
standalone: "standalone";
|
|
294
|
+
}>>;
|
|
295
|
+
account: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
298
|
+
type: z.ZodLiteral<"revoke">;
|
|
299
|
+
id: z.ZodString;
|
|
300
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
301
|
+
type: z.ZodLiteral<"account-credential">;
|
|
302
|
+
account: z.ZodString;
|
|
303
|
+
credential: z.ZodObject<{
|
|
304
|
+
credentialId: z.ZodString;
|
|
305
|
+
publicKey: z.ZodString;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
308
|
+
type: z.ZodLiteral<"account-credential-revoke">;
|
|
309
|
+
account: z.ZodString;
|
|
310
|
+
credentialId: z.ZodString;
|
|
311
|
+
}, z.core.$strict>], "type">;
|
|
312
|
+
export declare const bundleSchema: z.ZodObject<{
|
|
313
|
+
rootPublicKey: z.ZodString;
|
|
314
|
+
delegation: z.ZodObject<{
|
|
315
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
316
|
+
version: z.ZodLiteral<3>;
|
|
317
|
+
type: z.ZodLiteral<"writer">;
|
|
318
|
+
workspaceId: z.ZodString;
|
|
319
|
+
generation: z.ZodNumber;
|
|
320
|
+
writerId: z.ZodString;
|
|
321
|
+
writerPublicKey: z.ZodString;
|
|
322
|
+
policy: z.ZodEnum<{
|
|
323
|
+
strict: "strict";
|
|
324
|
+
standard: "standard";
|
|
325
|
+
}>;
|
|
326
|
+
members: z.ZodArray<z.ZodObject<{
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
role: z.ZodEnum<{
|
|
329
|
+
bridge: "bridge";
|
|
330
|
+
browser: "browser";
|
|
331
|
+
client: "client";
|
|
332
|
+
"pq-browser": "pq-browser";
|
|
333
|
+
}>;
|
|
334
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
label: z.ZodString;
|
|
336
|
+
publicKey: z.ZodString;
|
|
337
|
+
endpoint: z.ZodObject<{
|
|
338
|
+
version: z.ZodLiteral<1>;
|
|
339
|
+
id: z.ZodString;
|
|
340
|
+
ownerId: z.ZodString;
|
|
341
|
+
kind: z.ZodEnum<{
|
|
342
|
+
bridge: "bridge";
|
|
343
|
+
browser: "browser";
|
|
344
|
+
"local-cli": "local-cli";
|
|
345
|
+
}>;
|
|
346
|
+
publicKey: z.ZodString;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
349
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
350
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
351
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
host: z.ZodString;
|
|
353
|
+
port: z.ZodNumber;
|
|
354
|
+
}, z.core.$strict>>;
|
|
355
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
356
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
357
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
358
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
359
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
360
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
361
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
362
|
+
native: "native";
|
|
363
|
+
wrapped: "wrapped";
|
|
364
|
+
}>>;
|
|
365
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
366
|
+
browser: "browser";
|
|
367
|
+
standalone: "standalone";
|
|
368
|
+
}>>;
|
|
369
|
+
account: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strict>>;
|
|
371
|
+
revoked: z.ZodArray<z.ZodString>;
|
|
372
|
+
previous: z.ZodNullable<z.ZodObject<{
|
|
373
|
+
generation: z.ZodNumber;
|
|
374
|
+
revision: z.ZodNumber;
|
|
375
|
+
head: z.ZodString;
|
|
376
|
+
}, z.core.$strict>>;
|
|
377
|
+
rendezvousNamespace: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
379
|
+
type: z.ZodLiteral<"writer">;
|
|
380
|
+
workspaceId: z.ZodString;
|
|
381
|
+
generation: z.ZodNumber;
|
|
382
|
+
writerId: z.ZodString;
|
|
383
|
+
writerPublicKey: z.ZodString;
|
|
384
|
+
policy: z.ZodEnum<{
|
|
385
|
+
strict: "strict";
|
|
386
|
+
standard: "standard";
|
|
387
|
+
}>;
|
|
388
|
+
members: z.ZodArray<z.ZodObject<{
|
|
389
|
+
id: z.ZodString;
|
|
390
|
+
role: z.ZodEnum<{
|
|
391
|
+
bridge: "bridge";
|
|
392
|
+
browser: "browser";
|
|
393
|
+
client: "client";
|
|
394
|
+
"pq-browser": "pq-browser";
|
|
395
|
+
}>;
|
|
396
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
397
|
+
label: z.ZodString;
|
|
398
|
+
publicKey: z.ZodString;
|
|
399
|
+
endpoint: z.ZodObject<{
|
|
400
|
+
version: z.ZodLiteral<1>;
|
|
401
|
+
id: z.ZodString;
|
|
402
|
+
ownerId: z.ZodString;
|
|
403
|
+
kind: z.ZodEnum<{
|
|
404
|
+
bridge: "bridge";
|
|
405
|
+
browser: "browser";
|
|
406
|
+
"local-cli": "local-cli";
|
|
407
|
+
}>;
|
|
408
|
+
publicKey: z.ZodString;
|
|
409
|
+
}, z.core.$strict>;
|
|
410
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
411
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
412
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
413
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
414
|
+
host: z.ZodString;
|
|
415
|
+
port: z.ZodNumber;
|
|
416
|
+
}, z.core.$strict>>;
|
|
417
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
418
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
419
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
420
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
421
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
422
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
423
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
424
|
+
native: "native";
|
|
425
|
+
wrapped: "wrapped";
|
|
426
|
+
}>>;
|
|
427
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
428
|
+
browser: "browser";
|
|
429
|
+
standalone: "standalone";
|
|
430
|
+
}>>;
|
|
431
|
+
account: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, z.core.$strict>>;
|
|
433
|
+
revoked: z.ZodArray<z.ZodString>;
|
|
434
|
+
previous: z.ZodNullable<z.ZodObject<{
|
|
435
|
+
generation: z.ZodNumber;
|
|
436
|
+
revision: z.ZodNumber;
|
|
437
|
+
head: z.ZodString;
|
|
438
|
+
}, z.core.$strict>>;
|
|
439
|
+
rendezvousNamespace: z.ZodOptional<z.ZodString>;
|
|
440
|
+
version: z.ZodLiteral<4>;
|
|
441
|
+
browserDevices: z.ZodObject<{
|
|
442
|
+
version: z.ZodLiteral<1>;
|
|
443
|
+
origin: z.ZodString;
|
|
444
|
+
rpId: z.ZodString;
|
|
445
|
+
}, z.core.$strict>;
|
|
446
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
447
|
+
id: z.ZodString;
|
|
448
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
449
|
+
credentialId: z.ZodString;
|
|
450
|
+
publicKey: z.ZodString;
|
|
451
|
+
}, z.core.$strict>>;
|
|
452
|
+
revokedCredentials: z.ZodArray<z.ZodString>;
|
|
453
|
+
}, z.core.$strict>>;
|
|
454
|
+
}, z.core.$strict>], "version">;
|
|
455
|
+
signature: z.ZodString;
|
|
456
|
+
}, z.core.$strict>;
|
|
457
|
+
records: z.ZodArray<z.ZodObject<{
|
|
458
|
+
body: z.ZodObject<{
|
|
459
|
+
type: z.ZodLiteral<"membership">;
|
|
460
|
+
workspaceId: z.ZodString;
|
|
461
|
+
generation: z.ZodNumber;
|
|
462
|
+
revision: z.ZodNumber;
|
|
463
|
+
previous: z.ZodString;
|
|
464
|
+
op: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
465
|
+
type: z.ZodLiteral<"add">;
|
|
466
|
+
member: z.ZodObject<{
|
|
467
|
+
id: z.ZodString;
|
|
468
|
+
role: z.ZodEnum<{
|
|
469
|
+
bridge: "bridge";
|
|
470
|
+
browser: "browser";
|
|
471
|
+
client: "client";
|
|
472
|
+
"pq-browser": "pq-browser";
|
|
473
|
+
}>;
|
|
474
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
475
|
+
label: z.ZodString;
|
|
476
|
+
publicKey: z.ZodString;
|
|
477
|
+
endpoint: z.ZodObject<{
|
|
478
|
+
version: z.ZodLiteral<1>;
|
|
479
|
+
id: z.ZodString;
|
|
480
|
+
ownerId: z.ZodString;
|
|
481
|
+
kind: z.ZodEnum<{
|
|
482
|
+
bridge: "bridge";
|
|
483
|
+
browser: "browser";
|
|
484
|
+
"local-cli": "local-cli";
|
|
485
|
+
}>;
|
|
486
|
+
publicKey: z.ZodString;
|
|
487
|
+
}, z.core.$strict>;
|
|
488
|
+
authPublicKey: z.ZodOptional<z.ZodString>;
|
|
489
|
+
bridgeId: z.ZodOptional<z.ZodString>;
|
|
490
|
+
certFingerprint: z.ZodOptional<z.ZodString>;
|
|
491
|
+
lan: z.ZodOptional<z.ZodObject<{
|
|
492
|
+
host: z.ZodString;
|
|
493
|
+
port: z.ZodNumber;
|
|
494
|
+
}, z.core.$strict>>;
|
|
495
|
+
browserGatewayOrigin: z.ZodOptional<z.ZodString>;
|
|
496
|
+
rendezvousEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
497
|
+
rendezvousGrantDigest: z.ZodOptional<z.ZodString>;
|
|
498
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
499
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
500
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
501
|
+
keyProtection: z.ZodOptional<z.ZodEnum<{
|
|
502
|
+
native: "native";
|
|
503
|
+
wrapped: "wrapped";
|
|
504
|
+
}>>;
|
|
505
|
+
appContext: z.ZodOptional<z.ZodEnum<{
|
|
506
|
+
browser: "browser";
|
|
507
|
+
standalone: "standalone";
|
|
508
|
+
}>>;
|
|
509
|
+
account: z.ZodOptional<z.ZodString>;
|
|
510
|
+
}, z.core.$strict>;
|
|
511
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
512
|
+
type: z.ZodLiteral<"revoke">;
|
|
513
|
+
id: z.ZodString;
|
|
514
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
515
|
+
type: z.ZodLiteral<"account-credential">;
|
|
516
|
+
account: z.ZodString;
|
|
517
|
+
credential: z.ZodObject<{
|
|
518
|
+
credentialId: z.ZodString;
|
|
519
|
+
publicKey: z.ZodString;
|
|
520
|
+
}, z.core.$strict>;
|
|
521
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
522
|
+
type: z.ZodLiteral<"account-credential-revoke">;
|
|
523
|
+
account: z.ZodString;
|
|
524
|
+
credentialId: z.ZodString;
|
|
525
|
+
}, z.core.$strict>], "type">;
|
|
526
|
+
}, z.core.$strict>;
|
|
527
|
+
signature: z.ZodString;
|
|
528
|
+
}, z.core.$strict>>;
|
|
529
|
+
lease: z.ZodObject<{
|
|
530
|
+
body: z.ZodObject<{
|
|
531
|
+
type: z.ZodLiteral<"lease">;
|
|
532
|
+
workspaceId: z.ZodString;
|
|
533
|
+
generation: z.ZodNumber;
|
|
534
|
+
revision: z.ZodNumber;
|
|
535
|
+
head: z.ZodString;
|
|
536
|
+
issuedAt: z.ZodNumber;
|
|
537
|
+
expiresAt: z.ZodNumber;
|
|
538
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
539
|
+
}, z.core.$strict>;
|
|
540
|
+
signature: z.ZodString;
|
|
541
|
+
}, z.core.$strict>;
|
|
542
|
+
}, z.core.$strict>;
|
|
543
|
+
export type WorkspaceBundle = z.infer<typeof bundleSchema>;
|
|
544
|
+
export interface WorkspaceSnapshot {
|
|
545
|
+
workspaceId: string;
|
|
546
|
+
generation: number;
|
|
547
|
+
revision: number;
|
|
548
|
+
head: string;
|
|
549
|
+
policy: WorkspacePolicy;
|
|
550
|
+
writerId: string;
|
|
551
|
+
leaseUntil: number;
|
|
552
|
+
leaseOrder?: number;
|
|
553
|
+
rendezvousNamespace?: string;
|
|
554
|
+
members: WorkspaceMember[];
|
|
555
|
+
revoked: string[];
|
|
556
|
+
delegationVersion: 3 | 4;
|
|
557
|
+
browserDevices?: BrowserDevices;
|
|
558
|
+
accounts: AccountState[];
|
|
559
|
+
}
|
|
560
|
+
export declare function canonical(value: unknown): string;
|
|
561
|
+
export declare function ledgerDigest(hooks: Pick<LedgerHooks, 'sha256'>, value: Uint8Array | string): string;
|
|
562
|
+
export declare function ledgerChallenge(hooks: Pick<LedgerHooks, 'sha256'>, domain: string, value: unknown): Bytes;
|
|
563
|
+
export declare const ML_DSA_87_SPKI_PREFIX: Bytes;
|
|
564
|
+
export declare const ML_KEM_1024_SPKI_PREFIX: Bytes;
|
|
565
|
+
export declare const ML_DSA_87_PUBLIC_BYTES = 2592;
|
|
566
|
+
export declare const ML_KEM_1024_PUBLIC_BYTES = 1568;
|
|
567
|
+
export declare const ML_DSA_87_SIGNATURE_BYTES = 4627;
|
|
568
|
+
/** Structural check. The raw public key is the suffix after the fixed algorithm header. */
|
|
569
|
+
export declare function mlDsa87Spki(value: string): Bytes;
|
|
570
|
+
export declare function mlKem1024Spki(value: string): Bytes;
|
|
571
|
+
/** An account origin is the dashboard origin that owns the passkey: HTTPS, or the loopback name for development. */
|
|
572
|
+
export declare function validAccountOrigin(origin: string, rpId: string): boolean;
|
|
573
|
+
export declare const BROWSER_DEVICES_UNAUTHORIZED = "Browser devices are not authorized for this workspace";
|
|
574
|
+
export declare function validateMember(input: unknown, workspaceId: string, mode: WorkspacePolicy, hooks: LedgerHooks, options?: {
|
|
575
|
+
browserDevices?: boolean;
|
|
576
|
+
}): WorkspaceMember;
|
|
577
|
+
/** Throws unless the value is a passkey credential with a canonical uncompressed P-256 public key. */
|
|
578
|
+
export declare function validateAccountCredential(input: unknown): AccountCredential;
|
|
579
|
+
/** A passkey names one account, once. A revoked credential id is never reused. */
|
|
580
|
+
export declare function assertCredentialAvailable(accounts: readonly AccountState[], members: readonly WorkspaceMember[], credential: AccountCredential): void;
|
|
581
|
+
export declare function verifyWorkspaceState(value: unknown, expectedWorkspaceId: string, hooks: LedgerHooks): WorkspaceSnapshot;
|
|
582
|
+
export declare function leaseOrdering(state: {
|
|
583
|
+
leaseOrder?: number;
|
|
584
|
+
leaseUntil: number;
|
|
585
|
+
}): number;
|
|
586
|
+
/**
|
|
587
|
+
* Chooses which of two verified bundles a browser keeps, with the same ancestry rules a bridge applies on
|
|
588
|
+
* import. A newer bundle must extend the stored history or, for a new generation, keep every known revocation.
|
|
589
|
+
*/
|
|
590
|
+
export declare function advanceWorkspaceView(previous: WorkspaceBundle | null, next: unknown, workspaceId: string, hooks: LedgerHooks): {
|
|
591
|
+
bundle: WorkspaceBundle;
|
|
592
|
+
state: WorkspaceSnapshot;
|
|
593
|
+
changed: boolean;
|
|
594
|
+
};
|
|
595
|
+
/** A later generation keeps every revoked member, and every revoked passkey while it still admits browser devices. */
|
|
596
|
+
export declare function omitsKnownRevocation(old: Pick<WorkspaceSnapshot, 'revoked' | 'accounts'>, next: Pick<WorkspaceSnapshot, 'revoked' | 'accounts' | 'delegationVersion'>): boolean;
|
|
597
|
+
export {};
|