@nextera.one/axis-server-sdk 1.5.0 → 1.7.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/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ModuleRef, DiscoveryService, MetadataScanner, Reflector } from '@nestjs
2
2
  import { A as AxisFrame$2 } from './index-1uEwnW-w.js';
3
3
  export { a as AxisBinaryFrame, b as AxisError, c as AxisFrameZ, d as computeReceiptHash, e as computeSignaturePayload, i as core, f as decodeFrame, g as encodeFrame, h as generateEd25519KeyPair, j as getSignTarget, s as sha256, k as signFrame, v as verifyFrameSignature } from './index-1uEwnW-w.js';
4
4
  import { PROOF_LOOM, TLV_LOOM_PRESENCE_ID, TLV_LOOM_THREAD_HASH, TLV_LOOM_WRIT } from '@nextera.one/axis-protocol';
5
- export { AXIS_MAGIC, AXIS_VERSION, TLV as AxisTlvType, BodyProfile, ERR_BAD_SIGNATURE, ERR_CONTRACT_VIOLATION, ERR_INVALID_PACKET, ERR_REPLAY_DETECTED, FLAG_BODY_TLV, FLAG_CHAIN_REQ, FLAG_HAS_WITNESS, MAX_BODY_LEN, MAX_FRAME_LEN, MAX_HDR_LEN, MAX_SIG_LEN, NCERT_ALG, NCERT_EXP, NCERT_ISSUER_KID, NCERT_KID, NCERT_NBF, NCERT_NODE_ID, NCERT_PAYLOAD, NCERT_PUB, NCERT_SCOPE, NCERT_SIG, PROOF_CAPSULE, PROOF_JWT, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofType, TLV, TLV_ACTOR_ID, TLV_AUD, TLV_BODY_ARR, TLV_BODY_OBJ, TLV_CAPSULE, TLV_EFFECT, TLV_ERROR_CODE, TLV_ERROR_MSG, TLV_INDEX, TLV_INTENT, TLV_KID, TLV_LOOM_PRESENCE_ID, TLV_LOOM_THREAD_HASH, TLV_LOOM_WRIT, TLV_NODE, TLV_NODE_CERT_HASH, TLV_NODE_KID, TLV_NONCE, TLV_OFFSET, TLV_OK, TLV_PID, TLV_PREV_HASH, TLV_PROOF_REF, TLV_PROOF_TYPE, TLV_REALM, TLV_RECEIPT_HASH, TLV_RID, TLV_SHA256_CHUNK, TLV_TRACE_ID, TLV_TS, TLV_UPLOAD_ID, decodeArray, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeTLVs, encodeVarint, varintLength } from '@nextera.one/axis-protocol';
5
+ export { AXIS_MAGIC, AXIS_VERSION, TLV as AxisTlvType, BodyProfile, ERR_BAD_SIGNATURE, ERR_CONTRACT_VIOLATION, ERR_INVALID_PACKET, ERR_REPLAY_DETECTED, FLAG_BODY_TLV, FLAG_CHAIN_REQ, FLAG_HAS_WITNESS, MAX_BODY_LEN, MAX_FRAME_LEN, MAX_HDR_LEN, MAX_SIG_LEN, NCERT_ALG, NCERT_EXP, NCERT_ISSUER_KID, NCERT_KID, NCERT_NBF, NCERT_NODE_ID, NCERT_PAYLOAD, NCERT_PUB, NCERT_SCOPE, NCERT_SIG, PROOF_CAPSULE, PROOF_JWT, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofType, TLV, TLV_ACTOR_ID, TLV_AUD, TLV_BODY_ARR, TLV_BODY_OBJ, TLV_CAPSULE, TLV_EFFECT, TLV_ERROR_CODE, TLV_ERROR_MSG, TLV_INDEX, TLV_INTENT, TLV_KID, TLV_LOOM_PRESENCE_ID, TLV_LOOM_THREAD_HASH, TLV_LOOM_WRIT, TLV_NODE, TLV_NODE_CERT_HASH, TLV_NODE_KID, TLV_NONCE, TLV_OFFSET, TLV_OK, TLV_PID, TLV_LOOM_PRESENCE_ID as TLV_PRESENCE_ID, TLV_PREV_HASH, TLV_PROOF_REF, TLV_PROOF_TYPE, TLV_REALM, TLV_RECEIPT_HASH, TLV_RID, TLV_SHA256_CHUNK, TLV_LOOM_THREAD_HASH as TLV_THREAD_HASH, TLV_TRACE_ID, TLV_TS, TLV_UPLOAD_ID, TLV_LOOM_WRIT as TLV_WRIT, decodeArray, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeTLVs, encodeVarint, varintLength } from '@nextera.one/axis-protocol';
6
6
  import { OnModuleInit, OnApplicationBootstrap } from '@nestjs/common';
7
7
  import { ConfigService } from '@nestjs/config';
8
8
  import * as z from 'zod';
@@ -115,193 +115,776 @@ declare abstract class AxisResponseDto extends AxisTlvDto {
115
115
  updated_by?: string;
116
116
  }
117
117
 
118
- interface IntentSchema$1 {
118
+ declare const CCE_PROTOCOL_VERSION: "cce-v1";
119
+ declare const CCE_DERIVATION: {
120
+ readonly REQUEST: "axis:cce:req:v1";
121
+ readonly RESPONSE: "axis:cce:resp:v1";
122
+ readonly WITNESS: "axis:cce:witness:v1";
123
+ };
124
+ type CceAlgorithm = "AES-256-GCM";
125
+ type CceKemAlgorithm = "X25519" | "RSA-OAEP-256";
126
+ type CceKdfAlgorithm = "HKDF-SHA256";
127
+ declare const CCE_AES_KEY_BYTES = 32;
128
+ declare const CCE_IV_BYTES = 12;
129
+ declare const CCE_TAG_BYTES = 16;
130
+ declare const CCE_NONCE_BYTES = 32;
131
+ interface CceCapsuleClaims {
132
+ capsule_id: string;
133
+ ver: typeof CCE_PROTOCOL_VERSION;
134
+ sub: string;
135
+ kid: string;
119
136
  intent: string;
120
- version: number;
121
- bodyProfile: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
122
- fields: Array<{
123
- name: string;
124
- tlv: number;
125
- kind: IntentTlvField["kind"];
126
- required?: boolean;
127
- maxLen?: number;
128
- max?: string;
129
- scope?: "header" | "body";
130
- }>;
131
- }
132
- interface AxisEffect {
133
- ok: boolean;
134
- effect: string;
135
- body?: Uint8Array;
136
- headers?: Map<number, Uint8Array>;
137
- metadata?: any;
137
+ aud: string;
138
+ tps_from: number;
139
+ tps_to: number;
140
+ capsule_nonce: string;
141
+ challenge_id: string;
142
+ policy_hash?: string;
143
+ iat: number;
144
+ exp: number;
145
+ mode: "SINGLE_USE" | "SESSION";
146
+ scope?: string[];
147
+ constraints?: CceConstraints;
148
+ issuer_sig: CceSignature;
149
+ }
150
+ interface CceConstraints {
151
+ max_payload_bytes?: number;
152
+ ip_allow?: string[];
153
+ device_allow?: string[];
154
+ country_allow?: string[];
155
+ }
156
+ interface CceSignature {
157
+ alg: "EdDSA" | "ES256";
158
+ kid: string;
159
+ value: string;
138
160
  }
139
- declare class IntentRouter {
140
- private readonly moduleRef?;
141
- private readonly logger;
142
- private static readonly BUILTIN_INTENTS;
143
- private handlers;
144
- private intentSensors;
145
- private intentDecoders;
146
- private intentSchemas;
147
- private intentValidators;
148
- private intentKinds;
149
- constructor(moduleRef?: ModuleRef | undefined);
150
- getSchema(intent: string): IntentSchema$1 | undefined;
151
- getValidators(intent: string): Map<number, TlvValidatorFn[]> | undefined;
152
- has(intent: string): boolean;
153
- getRegisteredIntents(): string[];
154
- getIntentEntry(intent: string): {
155
- schema?: IntentSchema$1;
156
- validators?: Map<number, TlvValidatorFn[]>;
157
- hasSensors: boolean;
158
- builtin: boolean;
159
- kind?: IntentKind;
160
- } | null;
161
- register(intent: string, handler: any): void;
162
- registerHandler(instance: any): void;
163
- route(frame: AxisFrame$2): Promise<AxisEffect>;
164
- private logIntent;
165
- registerIntentMeta(intent: string, proto: object, methodName: string, handlerSensors?: Function[]): void;
166
- private runIntentSensors;
167
- private storeSchema;
161
+ interface CceRequestEnvelope {
162
+ ver: typeof CCE_PROTOCOL_VERSION;
163
+ request_id: string;
164
+ correlation_id: string;
165
+ client_kid: string;
166
+ capsule: CceCapsuleClaims;
167
+ encrypted_key: CceEncryptedKey;
168
+ encrypted_payload: CceEncryptedPayload;
169
+ request_nonce: string;
170
+ client_sig: CceSignature;
171
+ content_type: string;
172
+ algorithms: CceAlgorithmDescriptor;
173
+ aad_descriptor?: string;
174
+ }
175
+ interface CceEncryptedKey {
176
+ alg: CceKemAlgorithm;
177
+ axis_kid: string;
178
+ ciphertext: string;
179
+ ephemeral_pk?: string;
180
+ }
181
+ interface CceEncryptedPayload {
182
+ alg: CceAlgorithm;
183
+ iv: string;
184
+ ciphertext: string;
185
+ tag: string;
186
+ }
187
+ interface CceAlgorithmDescriptor {
188
+ kem: CceKemAlgorithm;
189
+ enc: CceAlgorithm;
190
+ kdf: CceKdfAlgorithm;
191
+ sig: "EdDSA" | "ES256";
192
+ }
193
+ interface CceResponseEnvelope {
194
+ ver: typeof CCE_PROTOCOL_VERSION;
195
+ response_id: string;
196
+ request_id: string;
197
+ correlation_id: string;
198
+ encrypted_key: CceEncryptedKey;
199
+ encrypted_payload: CceEncryptedPayload;
200
+ response_nonce: string;
201
+ axis_sig: CceSignature;
202
+ witness_ref?: string;
203
+ algorithms: CceAlgorithmDescriptor;
204
+ status: CceResponseStatus;
205
+ }
206
+ type CceResponseStatus = "SUCCESS" | "DENIED" | "PARTIAL" | "FAILED" | "ERROR";
207
+ interface CceExecutionContext {
208
+ execution_key_hash: string;
209
+ request_id: string;
210
+ capsule_id: string;
211
+ sub: string;
212
+ kid: string;
213
+ intent: string;
214
+ aud: string;
215
+ tps_from: number;
216
+ tps_to: number;
217
+ policy_hash?: string;
218
+ derived_at: number;
219
+ valid: boolean;
168
220
  }
169
-
170
- declare const BAND: {
171
- readonly WIRE: 0;
172
- readonly IDENTITY: 40;
173
- readonly POLICY: 90;
174
- readonly CONTENT: 140;
175
- readonly BUSINESS: 200;
176
- readonly AUDIT: 900;
221
+ interface CceWitnessRecord {
222
+ witness_id: string;
223
+ request_id: string;
224
+ capsule_id: string;
225
+ sub: string;
226
+ intent: string;
227
+ aud: string;
228
+ tps_from: number;
229
+ tps_to: number;
230
+ timestamp: number;
231
+ verification: {
232
+ client_sig: boolean;
233
+ capsule_sig: boolean;
234
+ tps_valid: boolean;
235
+ audience_match: boolean;
236
+ intent_match: boolean;
237
+ replay_clean: boolean;
238
+ nonce_unique: boolean;
239
+ decryption_ok: boolean;
240
+ };
241
+ execution: {
242
+ status: CceResponseStatus;
243
+ handler_duration_ms: number;
244
+ effect?: string;
245
+ };
246
+ response_encrypted: boolean;
247
+ execution_context_hash: string;
248
+ request_payload_hash?: string;
249
+ response_payload_hash?: string;
250
+ }
251
+ declare const CCE_ERROR: {
252
+ readonly INVALID_ENVELOPE: "CCE_INVALID_ENVELOPE";
253
+ readonly UNSUPPORTED_VERSION: "CCE_UNSUPPORTED_VERSION";
254
+ readonly MISSING_CAPSULE: "CCE_MISSING_CAPSULE";
255
+ readonly MISSING_ENCRYPTED_KEY: "CCE_MISSING_ENCRYPTED_KEY";
256
+ readonly CLIENT_SIG_INVALID: "CCE_CLIENT_SIG_INVALID";
257
+ readonly CLIENT_KEY_NOT_FOUND: "CCE_CLIENT_KEY_NOT_FOUND";
258
+ readonly CAPSULE_SIG_INVALID: "CCE_CAPSULE_SIG_INVALID";
259
+ readonly CAPSULE_EXPIRED: "CCE_CAPSULE_EXPIRED";
260
+ readonly CAPSULE_NOT_YET_VALID: "CCE_CAPSULE_NOT_YET_VALID";
261
+ readonly CAPSULE_REVOKED: "CCE_CAPSULE_REVOKED";
262
+ readonly CAPSULE_CONSUMED: "CCE_CAPSULE_CONSUMED";
263
+ readonly AUDIENCE_MISMATCH: "CCE_AUDIENCE_MISMATCH";
264
+ readonly INTENT_MISMATCH: "CCE_INTENT_MISMATCH";
265
+ readonly TPS_WINDOW_EXPIRED: "CCE_TPS_WINDOW_EXPIRED";
266
+ readonly TPS_WINDOW_FUTURE: "CCE_TPS_WINDOW_FUTURE";
267
+ readonly REPLAY_DETECTED: "CCE_REPLAY_DETECTED";
268
+ readonly NONCE_REUSED: "CCE_NONCE_REUSED";
269
+ readonly DECRYPTION_FAILED: "CCE_DECRYPTION_FAILED";
270
+ readonly KEY_UNWRAP_FAILED: "CCE_KEY_UNWRAP_FAILED";
271
+ readonly AEAD_TAG_MISMATCH: "CCE_AEAD_TAG_MISMATCH";
272
+ readonly PAYLOAD_TOO_LARGE: "CCE_PAYLOAD_TOO_LARGE";
273
+ readonly PAYLOAD_SCHEMA_INVALID: "CCE_PAYLOAD_SCHEMA_INVALID";
274
+ readonly INTENT_SCHEMA_MISMATCH: "CCE_INTENT_SCHEMA_MISMATCH";
275
+ readonly POLICY_DENIED: "CCE_POLICY_DENIED";
276
+ readonly CONSTRAINT_VIOLATED: "CCE_CONSTRAINT_VIOLATED";
277
+ readonly HANDLER_NOT_FOUND: "CCE_HANDLER_NOT_FOUND";
278
+ readonly HANDLER_EXECUTION_FAILED: "CCE_HANDLER_EXECUTION_FAILED";
279
+ readonly HANDLER_TIMEOUT: "CCE_HANDLER_TIMEOUT";
280
+ readonly RESPONSE_ENCRYPTION_FAILED: "CCE_RESPONSE_ENCRYPTION_FAILED";
177
281
  };
178
- type SensorBand = keyof typeof BAND;
179
- declare const PRE_DECODE_BOUNDARY = 40;
180
-
181
- declare function stableJsonStringify(value: unknown): string;
282
+ type CceErrorCode = (typeof CCE_ERROR)[keyof typeof CCE_ERROR];
283
+ declare class CceError extends Error {
284
+ readonly code: CceErrorCode;
285
+ readonly metadata?: Record<string, unknown> | undefined;
286
+ constructor(code: CceErrorCode, message: string, metadata?: Record<string, unknown> | undefined);
287
+ get clientSafe(): boolean;
288
+ toClientError(): {
289
+ code: CceErrorCode;
290
+ message: string;
291
+ };
292
+ }
182
293
 
183
- interface ObservationStage {
184
- name: string;
185
- status: 'ok' | 'fail' | 'skip';
186
- startMs: number;
187
- endMs?: number;
188
- durationMs?: number;
189
- reason?: string;
190
- code?: string;
294
+ interface CceClientKeyEncryptor {
295
+ wrapKey(aesKey: Uint8Array, clientKid: string, clientPublicKeyHex: string): Promise<CceEncryptedKey>;
191
296
  }
192
- interface ObservationSensor {
193
- name: string;
194
- allowed: boolean;
195
- riskScore: number;
196
- durationMs: number;
197
- reasons: string[];
198
- code?: string;
297
+ interface CceAxisSigner {
298
+ sign(payload: Uint8Array): Promise<CceSignature>;
199
299
  }
200
- interface AxisObservation {
201
- id: string;
202
- startMs: number;
203
- transport: 'http' | 'ws';
204
- ip?: string;
205
- intent?: string;
206
- actorId?: string;
207
- capsuleId?: string;
208
- stages: ObservationStage[];
209
- sensors: ObservationSensor[];
210
- decision?: 'ALLOW' | 'DENY';
211
- resultCode?: string;
212
- statusCode?: number;
213
- endMs?: number;
214
- durationMs?: number;
215
- facts: Record<string, unknown>;
300
+ interface CceResponseOptions {
301
+ request: CceRequestEnvelope;
302
+ capsule: CceCapsuleClaims;
303
+ status: CceResponseStatus;
304
+ body: Uint8Array;
305
+ clientPublicKeyHex: string;
306
+ witnessRef?: string;
216
307
  }
217
- declare function createObservation(transport: 'http' | 'ws', ip?: string): AxisObservation;
218
- declare function startStage(obs: AxisObservation, name: string): ObservationStage;
219
- declare function endStage(stage: ObservationStage, status?: 'ok' | 'fail' | 'skip', reason?: string, code?: string): void;
220
- declare function recordSensor(obs: AxisObservation, name: string, allowed: boolean, riskScore: number, durationMs: number, reasons: string[], code?: string): void;
221
- declare function finalizeObservation(obs: AxisObservation, decision: 'ALLOW' | 'DENY', statusCode: number, resultCode?: string): void;
308
+ declare function buildCceResponse(options: CceResponseOptions, clientKeyEncryptor: CceClientKeyEncryptor, axisSigner: CceAxisSigner): Promise<{
309
+ envelope: CceResponseEnvelope;
310
+ responsePayloadHash: string;
311
+ }>;
312
+ declare function buildCceErrorResponse(requestId: string, correlationId: string, status: CceResponseStatus, errorCode: string, message: string): {
313
+ ver: string;
314
+ request_id: string;
315
+ correlation_id: string;
316
+ status: CceResponseStatus;
317
+ error: {
318
+ code: string;
319
+ message: string;
320
+ };
321
+ };
222
322
 
223
- interface ObservationQueueMessage {
224
- v: 1;
225
- observation: AxisObservation;
226
- attempts: number;
227
- firstEnqueuedAt: number;
228
- lastEnqueuedAt: number;
229
- sourceNodeId: string;
230
- lastError?: string;
323
+ interface CceWitnessStore {
324
+ record(witness: CceWitnessRecord): Promise<void>;
325
+ }
326
+ declare class InMemoryCceWitnessStore implements CceWitnessStore {
327
+ readonly records: CceWitnessRecord[];
328
+ record(witness: CceWitnessRecord): Promise<void>;
329
+ getByRequestId(requestId: string): CceWitnessRecord | undefined;
330
+ getByCapsuleId(capsuleId: string): CceWitnessRecord[];
331
+ }
332
+ interface CceVerificationState {
333
+ clientSigVerified: boolean;
334
+ capsuleSigVerified: boolean;
335
+ tpsValid: boolean;
336
+ audienceMatch: boolean;
337
+ intentMatch: boolean;
338
+ replayClean: boolean;
339
+ nonceUnique: boolean;
340
+ decryptionOk: boolean;
341
+ }
342
+ declare function buildWitnessRecord(envelope: CceRequestEnvelope, capsule: CceCapsuleClaims, verification: CceVerificationState, execution: {
343
+ status: CceResponseStatus;
344
+ handlerDurationMs: number;
345
+ effect?: string;
346
+ }, options: {
347
+ axisLocalSecret: string;
348
+ requestPayload?: Uint8Array;
349
+ responsePayload?: Uint8Array;
350
+ responseEncrypted: boolean;
351
+ }): CceWitnessRecord;
352
+ declare function extractVerificationState(metadata: Record<string, any>): CceVerificationState;
353
+
354
+ type AxisAlg$1 = 'EdDSA' | 'ES256' | 'RS256';
355
+ type CapsuleStatus = 'ACTIVE' | 'CONSUMED' | 'REVOKED' | 'EXPIRED';
356
+ type CapsuleMode = 'SINGLE_USE' | 'MULTI_USE';
357
+ type KeyStatus = 'ACTIVE' | 'GRACE' | 'REVOKED' | 'RETIRED';
358
+ interface AxisSig$1 {
359
+ alg: AxisAlg$1;
360
+ kid: string;
361
+ value: string;
231
362
  }
232
- interface ObservationQueueConfig {
233
- enabled: boolean;
234
- workerEnabled: boolean;
235
- streamKey: string;
236
- deadLetterStreamKey: string;
237
- groupName: string;
238
- consumerName: string;
239
- readBlockMs: number;
240
- readBatchSize: number;
241
- reclaimIdleMs: number;
242
- reclaimBatchSize: number;
243
- maxRetries: number;
244
- maxStreamLength: number;
245
- workerConcurrency: number;
363
+ interface AxisPacket$1<T = any> {
364
+ v: 1;
365
+ pid: string;
366
+ nonce: string;
367
+ ts: number;
368
+ actorId: string;
369
+ opcode: string;
370
+ body: T;
371
+ sig: AxisSig$1;
246
372
  }
247
-
248
- interface ObservationStreamEntry {
249
- id: string;
250
- message: ObservationQueueMessage;
373
+ interface AxisCapsuleConstraints {
374
+ maxAmount?: number;
375
+ maxCount?: number;
376
+ ttlSeconds?: number;
377
+ ipCidrAllow?: string[];
378
+ countryAllow?: string[];
379
+ deviceIdAllow?: string[];
380
+ sessionIdLock?: string;
381
+ nonceRequired?: boolean;
251
382
  }
252
- declare function buildQueueMessage(observation: AxisObservation, sourceNodeId: string, previous?: ObservationQueueMessage, lastError?: string): ObservationQueueMessage;
253
- declare function encodeQueueMessage(message: ObservationQueueMessage): string;
254
- declare function decodeQueueMessage(raw: string): ObservationQueueMessage | null;
255
- declare function parseStreamEntries(raw: any): ObservationStreamEntry[];
256
- declare function parseAutoClaimEntries(raw: any): ObservationStreamEntry[];
257
-
258
- interface ObservationWitnessSummary {
259
- intent?: string;
260
- actorId?: string;
261
- decision?: string;
262
- statusCode?: number;
263
- durationMs?: number;
264
- sensorCount: number;
265
- stageCount: number;
383
+ interface TickWindow {
384
+ start: number;
385
+ end: number;
266
386
  }
267
- interface UnsignedObservationWitness {
387
+ interface AxisCapsulePayload {
268
388
  v: 1;
269
- observationId: string;
270
- payloadHash: string;
271
- sealedAt: number;
272
- summary: ObservationWitnessSummary;
273
- }
274
- declare function canonicalizeObservation(obs: AxisObservation): string;
275
- declare function hashObservation(obs: AxisObservation): string;
276
- declare function buildUnsignedWitness(obs: AxisObservation): UnsignedObservationWitness | null;
277
-
278
- interface ResponseObserverContext {
389
+ capsuleId: string;
279
390
  actorId: string;
391
+ issuer: string;
392
+ audience: string;
393
+ subject?: string;
280
394
  intent: string;
395
+ scopes: string[];
396
+ actions?: string[];
397
+ iat: number;
398
+ nbf?: number;
399
+ exp: number;
400
+ tickWindow?: TickWindow;
401
+ mode: CapsuleMode;
402
+ maxUses: number;
403
+ nonceSeed?: string;
404
+ policyRefs?: string[];
405
+ riskScore?: number;
406
+ constraints?: AxisCapsuleConstraints;
407
+ meta?: Record<string, unknown>;
281
408
  }
282
- interface ResponseContract {
283
- ok: boolean;
284
- effect: string;
285
- body?: Uint8Array;
286
- headers?: Map<number, Uint8Array>;
409
+ interface AxisCapsule {
410
+ payload: AxisCapsulePayload;
411
+ sig: AxisSig$1;
287
412
  }
288
- interface ObserverVerdict {
289
- passed: boolean;
290
- code?: string;
291
- reason?: string;
413
+ interface CapsuleIssueBody {
414
+ intent: string;
415
+ audience: string;
416
+ scopes: string[];
417
+ subject?: string;
418
+ mode: CapsuleMode;
419
+ maxUses?: number;
420
+ expSeconds?: number;
421
+ constraints?: AxisCapsuleConstraints;
422
+ hints?: {
423
+ ip?: string;
424
+ ua?: string;
425
+ deviceId?: string;
426
+ geo?: string;
427
+ };
292
428
  }
293
- declare function verifyResponse(ctx: ResponseObserverContext, response: ResponseContract): ObserverVerdict;
294
-
295
- declare const ATS1_HDR: {
296
- readonly INTENT_ID: 1;
297
- readonly ACTOR_KEY_ID: 2;
298
- readonly CAPSULE_ID: 3;
299
- readonly NONCE: 4;
300
- readonly TS_MS: 5;
301
- readonly SCHEMA_ID: 6;
302
- readonly BODY_HASH: 7;
303
- readonly TRACE_ID: 8;
304
- };
429
+ interface CapsuleBatchBody extends Omit<CapsuleIssueBody, 'mode' | 'maxUses'> {
430
+ count: number;
431
+ mode: 'SINGLE_USE';
432
+ }
433
+ interface IntentExecBody {
434
+ intent: string;
435
+ capsule: AxisCapsule;
436
+ execNonce?: string;
437
+ args: Record<string, any>;
438
+ }
439
+ interface CapsuleRevokeBody {
440
+ capsuleId: string;
441
+ reason: string;
442
+ }
443
+ interface AxisResponse$1<T = any> {
444
+ ok: boolean;
445
+ pid: string;
446
+ decisionId: string;
447
+ code: string;
448
+ message?: string;
449
+ data?: T;
450
+ meta?: Record<string, unknown>;
451
+ }
452
+ interface CapsuleIssueResult {
453
+ capsule: AxisCapsule;
454
+ }
455
+ interface CapsuleBatchResult {
456
+ capsules: AxisCapsule[];
457
+ }
458
+ interface ActorKeyRecord {
459
+ id: Buffer;
460
+ actor_id: string;
461
+ key_id: string;
462
+ algorithm: string;
463
+ public_key: Buffer;
464
+ purpose: string;
465
+ status: KeyStatus;
466
+ is_primary: boolean;
467
+ not_before: Date | null;
468
+ expires_at: Date | null;
469
+ rotated_from_key_id: string | null;
470
+ revoked_at: Date | null;
471
+ revocation_reason: string | null;
472
+ metadata: any;
473
+ created_at: Date;
474
+ updated_at: Date;
475
+ }
476
+ interface IssuerKeyRecord {
477
+ id: Buffer;
478
+ kid: string;
479
+ issuer_id: string;
480
+ alg: string;
481
+ public_key_pem: string;
482
+ status: KeyStatus;
483
+ not_before: Date | null;
484
+ not_after: Date | null;
485
+ fingerprint: string | null;
486
+ metadata: any;
487
+ created_at: Date;
488
+ updated_at: Date;
489
+ }
490
+ interface CapsuleRecord {
491
+ id: Buffer;
492
+ capsule_id: string;
493
+ actor_id: string;
494
+ intent: string;
495
+ audience: string;
496
+ issuer: string;
497
+ subject: string | null;
498
+ status: CapsuleStatus;
499
+ mode: CapsuleMode;
500
+ max_uses: number;
501
+ used_count: number;
502
+ iat: Date;
503
+ nbf: Date | null;
504
+ exp: Date;
505
+ scopes_json: any;
506
+ constraints_json: any;
507
+ policy_refs_json: any;
508
+ risk_score: number | null;
509
+ payload_hash: Buffer;
510
+ sig_alg: string;
511
+ sig_kid: string;
512
+ sig_value: Buffer;
513
+ created_at: Date;
514
+ updated_at: Date;
515
+ last_used_at: Date | null;
516
+ }
517
+
518
+ type AxisAlg = Extract<AxisAlg$1, 'EdDSA'>;
519
+ type AxisSig = AxisSig$1 & {
520
+ alg: AxisAlg;
521
+ };
522
+ interface AxisFrame$1<T = any> {
523
+ v: 1;
524
+ pid: string;
525
+ nonce: string;
526
+ ts: number;
527
+ actorId: string;
528
+ aud?: string;
529
+ opcode: string;
530
+ headers: Map<number, Uint8Array>;
531
+ body: T;
532
+ sig: AxisSig;
533
+ }
534
+ type AxisResponse<T = any> = AxisResponse$1<T> & {
535
+ policyRefs?: string[];
536
+ riskScore?: number;
537
+ };
538
+ interface AxisObservedContext {
539
+ ip?: string;
540
+ ua?: string;
541
+ geo?: string;
542
+ }
543
+ interface AxisRequestContext {
544
+ observed: AxisObservedContext;
545
+ actorKeyKid?: string;
546
+ issuerKeyKid?: string;
547
+ decisionId: string;
548
+ actorId: string;
549
+ aud?: string;
550
+ opcode: string;
551
+ deviceId?: string;
552
+ sessionId?: string;
553
+ }
554
+
555
+ interface SensorPhaseMetadata {
556
+ phase: 'PRE_DECODE' | 'POST_DECODE';
557
+ dependencies?: string[];
558
+ asyncOk?: boolean;
559
+ cryptoOk?: boolean;
560
+ description?: string;
561
+ }
562
+ interface AxisSensor {
563
+ readonly name: string;
564
+ readonly order?: number;
565
+ phase?: SensorPhaseMetadata | 'PRE_DECODE' | 'POST_DECODE';
566
+ supports?(input: SensorInput): boolean;
567
+ run(input: SensorInput): Promise<SensorDecision>;
568
+ }
569
+ interface AxisSensorInit extends AxisSensor {
570
+ onModuleInit?(): void | Promise<void>;
571
+ }
572
+ interface AxisPreSensor extends AxisSensor {
573
+ phase: 'PRE_DECODE';
574
+ }
575
+ interface AxisPostSensor extends AxisSensor {
576
+ phase: 'POST_DECODE';
577
+ }
578
+ interface SensorInput {
579
+ rawBytes?: Buffer | Uint8Array;
580
+ intent?: string;
581
+ ip?: string;
582
+ path?: string;
583
+ contentLength?: number;
584
+ peek?: Uint8Array;
585
+ country?: string;
586
+ clientId?: string;
587
+ isWs?: boolean;
588
+ metadata?: Record<string, any>;
589
+ actorId?: string;
590
+ opcode?: string;
591
+ aud?: string;
592
+ observed?: AxisObservedContext;
593
+ frameBody?: any;
594
+ deviceId?: string;
595
+ sessionId?: string;
596
+ packet?: Record<string, any>;
597
+ [key: string]: any;
598
+ }
599
+ declare enum Decision {
600
+ ALLOW = "ALLOW",
601
+ DENY = "DENY",
602
+ THROTTLE = "THROTTLE",
603
+ FLAG = "FLAG"
604
+ }
605
+ type SensorDecision = {
606
+ decision?: Decision;
607
+ allow: boolean;
608
+ riskScore: number;
609
+ reasons: string[];
610
+ code?: string;
611
+ retryAfterMs?: number;
612
+ scoreDelta?: number;
613
+ tags?: Record<string, any>;
614
+ meta?: any;
615
+ tighten?: {
616
+ expSecondsMax?: number;
617
+ constraintsPatch?: Record<string, any>;
618
+ };
619
+ } | {
620
+ action: 'ALLOW';
621
+ meta?: any;
622
+ } | {
623
+ action: 'DENY';
624
+ code: string;
625
+ reason?: string;
626
+ retryAfterMs?: number;
627
+ meta?: any;
628
+ } | {
629
+ action: 'THROTTLE';
630
+ retryAfterMs: number;
631
+ meta?: any;
632
+ } | {
633
+ action: 'FLAG';
634
+ scoreDelta: number;
635
+ reasons: string[];
636
+ meta?: any;
637
+ };
638
+ type SensorMinifiedDecision = {
639
+ allow: boolean;
640
+ riskScore: number;
641
+ reasons: string[];
642
+ tags?: Record<string, any>;
643
+ meta?: any;
644
+ tighten?: {
645
+ expSecondsMax?: number;
646
+ constraintsPatch?: Record<string, any>;
647
+ };
648
+ retryAfterMs?: number;
649
+ };
650
+ declare function normalizeSensorDecision(sensorDecision: SensorDecision): SensorMinifiedDecision;
651
+ declare const SensorDecisions: {
652
+ allow(meta?: any, tags?: Record<string, any>): SensorDecision;
653
+ deny(code: string, reason?: string, meta?: any): SensorDecision;
654
+ throttle(retryAfterMs: number, meta?: any): SensorDecision;
655
+ flag(scoreDelta: number, reasons: string[], meta?: any): SensorDecision;
656
+ };
657
+
658
+ type CceHandler = (payload: Uint8Array, context: CceHandlerContext) => Promise<CceHandlerResult>;
659
+ interface CceHandlerContext {
660
+ capsule: CceCapsuleClaims;
661
+ executionContext: CceExecutionContext;
662
+ envelope: CceRequestEnvelope;
663
+ clientPublicKeyHex: string;
664
+ intent: string;
665
+ sub: string;
666
+ }
667
+ interface CceHandlerResult {
668
+ status: CceResponseStatus;
669
+ body: Uint8Array;
670
+ effect?: string;
671
+ }
672
+ interface CcePipelineConfig {
673
+ axisLocalSecret: string;
674
+ axisAudience: string;
675
+ sensors: AxisSensor[];
676
+ handlers: Map<string, CceHandler>;
677
+ witnessStore: CceWitnessStore;
678
+ clientKeyEncryptor: CceClientKeyEncryptor;
679
+ axisSigner: CceAxisSigner;
680
+ }
681
+ type CcePipelineResult = {
682
+ ok: true;
683
+ response: CceResponseEnvelope;
684
+ witnessId: string;
685
+ } | {
686
+ ok: false;
687
+ error: {
688
+ code: string;
689
+ message: string;
690
+ };
691
+ status: CceResponseStatus;
692
+ };
693
+ declare function executeCcePipeline(envelope: CceRequestEnvelope, config: CcePipelineConfig): Promise<CcePipelineResult>;
694
+
695
+ interface IntentSchema$1 {
696
+ intent: string;
697
+ version: number;
698
+ bodyProfile: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
699
+ fields: Array<{
700
+ name: string;
701
+ tlv: number;
702
+ kind: IntentTlvField["kind"];
703
+ required?: boolean;
704
+ maxLen?: number;
705
+ max?: string;
706
+ scope?: "header" | "body";
707
+ }>;
708
+ }
709
+ interface AxisEffect {
710
+ ok: boolean;
711
+ effect: string;
712
+ body?: Uint8Array;
713
+ headers?: Map<number, Uint8Array>;
714
+ metadata?: any;
715
+ }
716
+ declare class IntentRouter {
717
+ private readonly moduleRef?;
718
+ private readonly logger;
719
+ private static readonly BUILTIN_INTENTS;
720
+ private handlers;
721
+ private intentSensors;
722
+ private intentDecoders;
723
+ private intentSchemas;
724
+ private intentValidators;
725
+ private intentKinds;
726
+ private cceHandlers;
727
+ private ccePipelineConfig;
728
+ constructor(moduleRef?: ModuleRef | undefined);
729
+ getSchema(intent: string): IntentSchema$1 | undefined;
730
+ getValidators(intent: string): Map<number, TlvValidatorFn[]> | undefined;
731
+ has(intent: string): boolean;
732
+ getRegisteredIntents(): string[];
733
+ getIntentEntry(intent: string): {
734
+ schema?: IntentSchema$1;
735
+ validators?: Map<number, TlvValidatorFn[]>;
736
+ hasSensors: boolean;
737
+ builtin: boolean;
738
+ kind?: IntentKind;
739
+ } | null;
740
+ register(intent: string, handler: any): void;
741
+ registerHandler(instance: any): void;
742
+ route(frame: AxisFrame$2): Promise<AxisEffect>;
743
+ private logIntent;
744
+ registerIntentMeta(intent: string, proto: object, methodName: string, handlerSensors?: Function[]): void;
745
+ private runIntentSensors;
746
+ configureCce(config: Omit<CcePipelineConfig, "handlers">): void;
747
+ registerCceHandler(intent: string, handler: CceHandler): void;
748
+ hasCceHandler(intent: string): boolean;
749
+ routeCce(envelope: CceRequestEnvelope): Promise<CcePipelineResult>;
750
+ private storeSchema;
751
+ }
752
+
753
+ declare const BAND: {
754
+ readonly WIRE: 0;
755
+ readonly IDENTITY: 40;
756
+ readonly POLICY: 90;
757
+ readonly CONTENT: 140;
758
+ readonly BUSINESS: 200;
759
+ readonly AUDIT: 900;
760
+ };
761
+ type SensorBand = keyof typeof BAND;
762
+ declare const PRE_DECODE_BOUNDARY = 40;
763
+
764
+ declare function stableJsonStringify(value: unknown): string;
765
+
766
+ interface ObservationStage {
767
+ name: string;
768
+ status: 'ok' | 'fail' | 'skip';
769
+ startMs: number;
770
+ endMs?: number;
771
+ durationMs?: number;
772
+ reason?: string;
773
+ code?: string;
774
+ }
775
+ interface ObservationSensor {
776
+ name: string;
777
+ allowed: boolean;
778
+ riskScore: number;
779
+ durationMs: number;
780
+ reasons: string[];
781
+ code?: string;
782
+ }
783
+ interface AxisObservation {
784
+ id: string;
785
+ startMs: number;
786
+ transport: 'http' | 'ws';
787
+ ip?: string;
788
+ intent?: string;
789
+ actorId?: string;
790
+ capsuleId?: string;
791
+ stages: ObservationStage[];
792
+ sensors: ObservationSensor[];
793
+ decision?: 'ALLOW' | 'DENY';
794
+ resultCode?: string;
795
+ statusCode?: number;
796
+ endMs?: number;
797
+ durationMs?: number;
798
+ facts: Record<string, unknown>;
799
+ }
800
+ declare function createObservation(transport: 'http' | 'ws', ip?: string): AxisObservation;
801
+ declare function startStage(obs: AxisObservation, name: string): ObservationStage;
802
+ declare function endStage(stage: ObservationStage, status?: 'ok' | 'fail' | 'skip', reason?: string, code?: string): void;
803
+ declare function recordSensor(obs: AxisObservation, name: string, allowed: boolean, riskScore: number, durationMs: number, reasons: string[], code?: string): void;
804
+ declare function finalizeObservation(obs: AxisObservation, decision: 'ALLOW' | 'DENY', statusCode: number, resultCode?: string): void;
805
+
806
+ interface ObservationQueueMessage {
807
+ v: 1;
808
+ observation: AxisObservation;
809
+ attempts: number;
810
+ firstEnqueuedAt: number;
811
+ lastEnqueuedAt: number;
812
+ sourceNodeId: string;
813
+ lastError?: string;
814
+ }
815
+ interface ObservationQueueConfig {
816
+ enabled: boolean;
817
+ workerEnabled: boolean;
818
+ streamKey: string;
819
+ deadLetterStreamKey: string;
820
+ groupName: string;
821
+ consumerName: string;
822
+ readBlockMs: number;
823
+ readBatchSize: number;
824
+ reclaimIdleMs: number;
825
+ reclaimBatchSize: number;
826
+ maxRetries: number;
827
+ maxStreamLength: number;
828
+ workerConcurrency: number;
829
+ }
830
+
831
+ interface ObservationStreamEntry {
832
+ id: string;
833
+ message: ObservationQueueMessage;
834
+ }
835
+ declare function buildQueueMessage(observation: AxisObservation, sourceNodeId: string, previous?: ObservationQueueMessage, lastError?: string): ObservationQueueMessage;
836
+ declare function encodeQueueMessage(message: ObservationQueueMessage): string;
837
+ declare function decodeQueueMessage(raw: string): ObservationQueueMessage | null;
838
+ declare function parseStreamEntries(raw: any): ObservationStreamEntry[];
839
+ declare function parseAutoClaimEntries(raw: any): ObservationStreamEntry[];
840
+
841
+ interface ObservationWitnessSummary {
842
+ intent?: string;
843
+ actorId?: string;
844
+ decision?: string;
845
+ statusCode?: number;
846
+ durationMs?: number;
847
+ sensorCount: number;
848
+ stageCount: number;
849
+ }
850
+ interface UnsignedObservationWitness {
851
+ v: 1;
852
+ observationId: string;
853
+ payloadHash: string;
854
+ sealedAt: number;
855
+ summary: ObservationWitnessSummary;
856
+ }
857
+ declare function canonicalizeObservation(obs: AxisObservation): string;
858
+ declare function hashObservation(obs: AxisObservation): string;
859
+ declare function buildUnsignedWitness(obs: AxisObservation): UnsignedObservationWitness | null;
860
+
861
+ interface ResponseObserverContext {
862
+ actorId: string;
863
+ intent: string;
864
+ }
865
+ interface ResponseContract {
866
+ ok: boolean;
867
+ effect: string;
868
+ body?: Uint8Array;
869
+ headers?: Map<number, Uint8Array>;
870
+ }
871
+ interface ObserverVerdict {
872
+ passed: boolean;
873
+ code?: string;
874
+ reason?: string;
875
+ }
876
+ declare function verifyResponse(ctx: ResponseObserverContext, response: ResponseContract): ObserverVerdict;
877
+
878
+ declare const ATS1_HDR: {
879
+ readonly INTENT_ID: 1;
880
+ readonly ACTOR_KEY_ID: 2;
881
+ readonly CAPSULE_ID: 3;
882
+ readonly NONCE: 4;
883
+ readonly TS_MS: 5;
884
+ readonly SCHEMA_ID: 6;
885
+ readonly BODY_HASH: 7;
886
+ readonly TRACE_ID: 8;
887
+ };
305
888
  declare const ATS1_SCHEMA: {
306
889
  readonly PASSKEY_LOGIN_OPTIONS_REQ: 2001;
307
890
  readonly PASSKEY_LOGIN_OPTIONS_RES: 2002;
@@ -446,289 +1029,125 @@ declare const ats1_tlvsToLogicalBody: typeof tlvsToLogicalBody;
446
1029
  declare const ats1_tlvsToMap: typeof tlvsToMap;
447
1030
  declare const ats1_validateTLVsAgainstSchema: typeof validateTLVsAgainstSchema;
448
1031
  declare namespace ats1 {
449
- export { type ats1_Ats1FieldDescriptor as Ats1FieldDescriptor, type ats1_Ats1FieldType as Ats1FieldType, type ats1_Ats1Limits as Ats1Limits, type ats1_Ats1SchemaDescriptor as Ats1SchemaDescriptor, type ats1_AxisHeaderLogical as AxisHeaderLogical, type ats1_AxisLogicalRequest as AxisLogicalRequest, ats1_DEFAULT_LIMITS as DEFAULT_LIMITS, type ats1_DecodedTlv as DecodedTlv, type ats1_DecodedTlvMap as DecodedTlvMap, ats1_HDR_TAGS as HDR_TAGS, ats1_Schema2001_PasskeyLoginOptionsReq as Schema2001_PasskeyLoginOptionsReq, ats1_Schema3100_DeviceContext as Schema3100_DeviceContext, ats1_Schema4001_LoginWithDeviceReq as Schema4001_LoginWithDeviceReq, type ats1_SensorInputLike as SensorInputLike, ats1_decodeAxisHeaderFromTLVs as decodeAxisHeaderFromTLVs, ats1_decodeAxisRequestBinary as decodeAxisRequestBinary, ats1_decodeTLVStream as decodeTLVStream, ats1_decodeU64BE as decodeU64BE, ats1_decodeUVarint as decodeUVarint, ats1_encodeAxisHeaderToTLVs as encodeAxisHeaderToTLVs, ats1_encodeAxisRequestBinary as encodeAxisRequestBinary, ats1_encodeTLV as encodeTLV, ats1_encodeTLVStreamCanonical as encodeTLVStreamCanonical, ats1_encodeU64BE as encodeU64BE, ats1_encodeUVarint as encodeUVarint, ats1_logicalBodyToTLVs as logicalBodyToTLVs, ats1_sha256 as sha256, ats1_tlvsToLogicalBody as tlvsToLogicalBody, ats1_tlvsToMap as tlvsToMap, ats1_validateTLVsAgainstSchema as validateTLVsAgainstSchema };
450
- }
451
-
452
- declare function buildAts1Hdr(params: {
453
- intentId: number;
454
- schemaId: number;
455
- actorKeyId?: Buffer;
456
- capsuleId?: Buffer;
457
- traceId?: Buffer;
458
- tsMs?: bigint;
459
- nonce?: Buffer;
460
- bodyHash?: Buffer;
461
- }): Buffer;
462
- declare function packPasskeyLoginOptionsReq(params: {
463
- intentId: number;
464
- username: string;
465
- actorKeyId?: Buffer;
466
- capsuleId?: Buffer;
467
- traceId?: Buffer;
468
- }): {
469
- hdr: Buffer<ArrayBufferLike>;
470
- body: Buffer<ArrayBufferLike>;
471
- };
472
- declare function unpackPasskeyLoginOptionsReq(body: Buffer): {
473
- username: string;
474
- };
475
- declare const Schema2021_PasskeyRegisterOptionsReq: Ats1SchemaDescriptor;
476
- declare const Schema2011_PasskeyLoginVerifyReq: Ats1SchemaDescriptor;
477
- declare function packPasskeyRegisterOptionsReq(params: {
1032
+ export { type ats1_Ats1FieldDescriptor as Ats1FieldDescriptor, type ats1_Ats1FieldType as Ats1FieldType, type ats1_Ats1Limits as Ats1Limits, type ats1_Ats1SchemaDescriptor as Ats1SchemaDescriptor, type ats1_AxisHeaderLogical as AxisHeaderLogical, type ats1_AxisLogicalRequest as AxisLogicalRequest, ats1_DEFAULT_LIMITS as DEFAULT_LIMITS, type ats1_DecodedTlv as DecodedTlv, type ats1_DecodedTlvMap as DecodedTlvMap, ats1_HDR_TAGS as HDR_TAGS, ats1_Schema2001_PasskeyLoginOptionsReq as Schema2001_PasskeyLoginOptionsReq, ats1_Schema3100_DeviceContext as Schema3100_DeviceContext, ats1_Schema4001_LoginWithDeviceReq as Schema4001_LoginWithDeviceReq, type ats1_SensorInputLike as SensorInputLike, ats1_decodeAxisHeaderFromTLVs as decodeAxisHeaderFromTLVs, ats1_decodeAxisRequestBinary as decodeAxisRequestBinary, ats1_decodeTLVStream as decodeTLVStream, ats1_decodeU64BE as decodeU64BE, ats1_decodeUVarint as decodeUVarint, ats1_encodeAxisHeaderToTLVs as encodeAxisHeaderToTLVs, ats1_encodeAxisRequestBinary as encodeAxisRequestBinary, ats1_encodeTLV as encodeTLV, ats1_encodeTLVStreamCanonical as encodeTLVStreamCanonical, ats1_encodeU64BE as encodeU64BE, ats1_encodeUVarint as encodeUVarint, ats1_logicalBodyToTLVs as logicalBodyToTLVs, ats1_sha256 as sha256, ats1_tlvsToLogicalBody as tlvsToLogicalBody, ats1_tlvsToMap as tlvsToMap, ats1_validateTLVsAgainstSchema as validateTLVsAgainstSchema };
1033
+ }
1034
+
1035
+ declare function buildAts1Hdr(params: {
478
1036
  intentId: number;
479
- username: string;
1037
+ schemaId: number;
480
1038
  actorKeyId?: Buffer;
1039
+ capsuleId?: Buffer;
481
1040
  traceId?: Buffer;
482
- }): {
483
- hdr: Buffer<ArrayBufferLike>;
484
- body: Buffer<ArrayBufferLike>;
485
- };
486
- declare function unpackPasskeyRegisterOptionsReq(body: Buffer): {
487
- username: string;
488
- };
489
- declare function packPasskeyLoginVerifyReq(params: {
1041
+ tsMs?: bigint;
1042
+ nonce?: Buffer;
1043
+ bodyHash?: Buffer;
1044
+ }): Buffer;
1045
+ declare function packPasskeyLoginOptionsReq(params: {
490
1046
  intentId: number;
491
1047
  username: string;
492
- credentialId: Buffer;
493
- clientDataJSON: Buffer;
494
- authenticatorData: Buffer;
495
- signature: Buffer;
496
- userHandle?: Buffer;
497
1048
  actorKeyId?: Buffer;
1049
+ capsuleId?: Buffer;
498
1050
  traceId?: Buffer;
499
1051
  }): {
500
1052
  hdr: Buffer<ArrayBufferLike>;
501
1053
  body: Buffer<ArrayBufferLike>;
502
- };
503
- declare function unpackPasskeyLoginVerifyReq(body: Buffer): {
504
- username: string;
505
- credentialId: Buffer;
506
- clientDataJSON: Buffer;
507
- authenticatorData: Buffer;
508
- signature: Buffer;
509
- userHandle: Buffer | undefined;
510
- };
511
- declare const Schema2002_PasskeyLoginOptionsRes: Ats1SchemaDescriptor;
512
- declare function packPasskeyLoginOptionsRes(params: {
513
- challenge: string;
514
- timeout?: number;
515
- rpId?: string;
516
- userVerification?: string;
517
- allowCredentials?: {
518
- id: string;
519
- type: string;
520
- transports?: string[];
521
- }[];
522
- }): Buffer;
523
- declare const Schema2012_PasskeyLoginVerifyRes: Ats1SchemaDescriptor;
524
- declare function packPasskeyLoginVerifyRes(params: {
525
- actorId: string;
526
- keyId: string;
527
- capsule: Buffer;
528
- expiresAt: bigint;
529
- }): Buffer;
530
-
531
- type Axis1FrameToEncode = {
532
- ver: number;
533
- flags: number;
534
- hdr: Buffer;
535
- body: Buffer;
536
- sig: Buffer;
537
- };
538
- declare function encodeAxis1Frame(f: Axis1FrameToEncode): Buffer;
539
-
540
- declare function axis1SigningBytes(params: {
541
- ver: number;
542
- flags: number;
543
- hdr: Buffer;
544
- body: Buffer;
545
- }): Buffer;
546
-
547
- declare function encVarint(x: bigint): Buffer;
548
- declare function varintU(x: number | bigint): Buffer;
549
- declare function u64be(x: bigint): Buffer;
550
- declare function utf8(s: string): Buffer;
551
- declare function bytes(b: Uint8Array | Buffer): Buffer;
552
- declare function nonce16(): Buffer;
553
- declare function tlv(type: number, value: Buffer): Buffer;
554
- declare function buildTLVs(items: {
555
- type: number;
556
- value: Buffer;
557
- }[], opts?: {
558
- allowDupTypes?: Set<number>;
559
- }): Buffer;
560
-
561
- declare function b64urlEncode(buf: Buffer): string;
562
- declare function b64urlDecode(str: string): Buffer;
563
- declare function b64urlEncodeString(str: string, encoding?: BufferEncoding): string;
564
- declare function b64urlDecodeString(str: string, encoding?: BufferEncoding): string;
565
-
566
- declare function canonicalJson(value: any): string;
567
- declare function canonicalJsonExcluding(obj: Record<string, any>, exclude: string[]): string;
568
-
569
- type AxisAlg$1 = 'EdDSA' | 'ES256' | 'RS256';
570
- type CapsuleStatus = 'ACTIVE' | 'CONSUMED' | 'REVOKED' | 'EXPIRED';
571
- type CapsuleMode = 'SINGLE_USE' | 'MULTI_USE';
572
- type KeyStatus = 'ACTIVE' | 'GRACE' | 'REVOKED' | 'RETIRED';
573
- interface AxisSig$1 {
574
- alg: AxisAlg$1;
575
- kid: string;
576
- value: string;
577
- }
578
- interface AxisPacket$1<T = any> {
579
- v: 1;
580
- pid: string;
581
- nonce: string;
582
- ts: number;
583
- actorId: string;
584
- opcode: string;
585
- body: T;
586
- sig: AxisSig$1;
587
- }
588
- interface AxisCapsuleConstraints {
589
- maxAmount?: number;
590
- maxCount?: number;
591
- ttlSeconds?: number;
592
- ipCidrAllow?: string[];
593
- countryAllow?: string[];
594
- deviceIdAllow?: string[];
595
- sessionIdLock?: string;
596
- nonceRequired?: boolean;
597
- }
598
- interface TickWindow {
599
- start: number;
600
- end: number;
601
- }
602
- interface AxisCapsulePayload {
603
- v: 1;
604
- capsuleId: string;
605
- actorId: string;
606
- issuer: string;
607
- audience: string;
608
- subject?: string;
609
- intent: string;
610
- scopes: string[];
611
- actions?: string[];
612
- iat: number;
613
- nbf?: number;
614
- exp: number;
615
- tickWindow?: TickWindow;
616
- mode: CapsuleMode;
617
- maxUses: number;
618
- nonceSeed?: string;
619
- policyRefs?: string[];
620
- riskScore?: number;
621
- constraints?: AxisCapsuleConstraints;
622
- meta?: Record<string, unknown>;
623
- }
624
- interface AxisCapsule {
625
- payload: AxisCapsulePayload;
626
- sig: AxisSig$1;
627
- }
628
- interface CapsuleIssueBody {
629
- intent: string;
630
- audience: string;
631
- scopes: string[];
632
- subject?: string;
633
- mode: CapsuleMode;
634
- maxUses?: number;
635
- expSeconds?: number;
636
- constraints?: AxisCapsuleConstraints;
637
- hints?: {
638
- ip?: string;
639
- ua?: string;
640
- deviceId?: string;
641
- geo?: string;
642
- };
643
- }
644
- interface CapsuleBatchBody extends Omit<CapsuleIssueBody, 'mode' | 'maxUses'> {
645
- count: number;
646
- mode: 'SINGLE_USE';
647
- }
648
- interface IntentExecBody {
649
- intent: string;
650
- capsule: AxisCapsule;
651
- execNonce?: string;
652
- args: Record<string, any>;
653
- }
654
- interface CapsuleRevokeBody {
655
- capsuleId: string;
656
- reason: string;
657
- }
658
- interface AxisResponse$1<T = any> {
659
- ok: boolean;
660
- pid: string;
661
- decisionId: string;
662
- code: string;
663
- message?: string;
664
- data?: T;
665
- meta?: Record<string, unknown>;
666
- }
667
- interface CapsuleIssueResult {
668
- capsule: AxisCapsule;
669
- }
670
- interface CapsuleBatchResult {
671
- capsules: AxisCapsule[];
672
- }
673
- interface ActorKeyRecord {
674
- id: Buffer;
675
- actor_id: string;
676
- key_id: string;
677
- algorithm: string;
678
- public_key: Buffer;
679
- purpose: string;
680
- status: KeyStatus;
681
- is_primary: boolean;
682
- not_before: Date | null;
683
- expires_at: Date | null;
684
- rotated_from_key_id: string | null;
685
- revoked_at: Date | null;
686
- revocation_reason: string | null;
687
- metadata: any;
688
- created_at: Date;
689
- updated_at: Date;
690
- }
691
- interface IssuerKeyRecord {
692
- id: Buffer;
693
- kid: string;
694
- issuer_id: string;
695
- alg: string;
696
- public_key_pem: string;
697
- status: KeyStatus;
698
- not_before: Date | null;
699
- not_after: Date | null;
700
- fingerprint: string | null;
701
- metadata: any;
702
- created_at: Date;
703
- updated_at: Date;
704
- }
705
- interface CapsuleRecord {
706
- id: Buffer;
707
- capsule_id: string;
708
- actor_id: string;
709
- intent: string;
710
- audience: string;
711
- issuer: string;
712
- subject: string | null;
713
- status: CapsuleStatus;
714
- mode: CapsuleMode;
715
- max_uses: number;
716
- used_count: number;
717
- iat: Date;
718
- nbf: Date | null;
719
- exp: Date;
720
- scopes_json: any;
721
- constraints_json: any;
722
- policy_refs_json: any;
723
- risk_score: number | null;
724
- payload_hash: Buffer;
725
- sig_alg: string;
726
- sig_kid: string;
727
- sig_value: Buffer;
728
- created_at: Date;
729
- updated_at: Date;
730
- last_used_at: Date | null;
731
- }
1054
+ };
1055
+ declare function unpackPasskeyLoginOptionsReq(body: Buffer): {
1056
+ username: string;
1057
+ };
1058
+ declare const Schema2021_PasskeyRegisterOptionsReq: Ats1SchemaDescriptor;
1059
+ declare const Schema2011_PasskeyLoginVerifyReq: Ats1SchemaDescriptor;
1060
+ declare function packPasskeyRegisterOptionsReq(params: {
1061
+ intentId: number;
1062
+ username: string;
1063
+ actorKeyId?: Buffer;
1064
+ traceId?: Buffer;
1065
+ }): {
1066
+ hdr: Buffer<ArrayBufferLike>;
1067
+ body: Buffer<ArrayBufferLike>;
1068
+ };
1069
+ declare function unpackPasskeyRegisterOptionsReq(body: Buffer): {
1070
+ username: string;
1071
+ };
1072
+ declare function packPasskeyLoginVerifyReq(params: {
1073
+ intentId: number;
1074
+ username: string;
1075
+ credentialId: Buffer;
1076
+ clientDataJSON: Buffer;
1077
+ authenticatorData: Buffer;
1078
+ signature: Buffer;
1079
+ userHandle?: Buffer;
1080
+ actorKeyId?: Buffer;
1081
+ traceId?: Buffer;
1082
+ }): {
1083
+ hdr: Buffer<ArrayBufferLike>;
1084
+ body: Buffer<ArrayBufferLike>;
1085
+ };
1086
+ declare function unpackPasskeyLoginVerifyReq(body: Buffer): {
1087
+ username: string;
1088
+ credentialId: Buffer;
1089
+ clientDataJSON: Buffer;
1090
+ authenticatorData: Buffer;
1091
+ signature: Buffer;
1092
+ userHandle: Buffer | undefined;
1093
+ };
1094
+ declare const Schema2002_PasskeyLoginOptionsRes: Ats1SchemaDescriptor;
1095
+ declare function packPasskeyLoginOptionsRes(params: {
1096
+ challenge: string;
1097
+ timeout?: number;
1098
+ rpId?: string;
1099
+ userVerification?: string;
1100
+ allowCredentials?: {
1101
+ id: string;
1102
+ type: string;
1103
+ transports?: string[];
1104
+ }[];
1105
+ }): Buffer;
1106
+ declare const Schema2012_PasskeyLoginVerifyRes: Ats1SchemaDescriptor;
1107
+ declare function packPasskeyLoginVerifyRes(params: {
1108
+ actorId: string;
1109
+ keyId: string;
1110
+ capsule: Buffer;
1111
+ expiresAt: bigint;
1112
+ }): Buffer;
1113
+
1114
+ type Axis1FrameToEncode = {
1115
+ ver: number;
1116
+ flags: number;
1117
+ hdr: Buffer;
1118
+ body: Buffer;
1119
+ sig: Buffer;
1120
+ };
1121
+ declare function encodeAxis1Frame(f: Axis1FrameToEncode): Buffer;
1122
+
1123
+ declare function axis1SigningBytes(params: {
1124
+ ver: number;
1125
+ flags: number;
1126
+ hdr: Buffer;
1127
+ body: Buffer;
1128
+ }): Buffer;
1129
+
1130
+ declare function encVarint(x: bigint): Buffer;
1131
+ declare function varintU(x: number | bigint): Buffer;
1132
+ declare function u64be(x: bigint): Buffer;
1133
+ declare function utf8(s: string): Buffer;
1134
+ declare function bytes(b: Uint8Array | Buffer): Buffer;
1135
+ declare function nonce16(): Buffer;
1136
+ declare function tlv(type: number, value: Buffer): Buffer;
1137
+ declare function buildTLVs(items: {
1138
+ type: number;
1139
+ value: Buffer;
1140
+ }[], opts?: {
1141
+ allowDupTypes?: Set<number>;
1142
+ }): Buffer;
1143
+
1144
+ declare function b64urlEncode(buf: Buffer): string;
1145
+ declare function b64urlDecode(str: string): Buffer;
1146
+ declare function b64urlEncodeString(str: string, encoding?: BufferEncoding): string;
1147
+ declare function b64urlDecodeString(str: string, encoding?: BufferEncoding): string;
1148
+
1149
+ declare function canonicalJson(value: any): string;
1150
+ declare function canonicalJsonExcluding(obj: Record<string, any>, exclude: string[]): string;
732
1151
 
733
1152
  declare class ContractViolationError extends Error {
734
1153
  code: string;
@@ -765,185 +1184,45 @@ interface ExecutionContract {
765
1184
  maxMemoryMb?: number;
766
1185
  }
767
1186
  declare const DEFAULT_CONTRACTS: Record<string, ExecutionContract>;
768
- declare const FALLBACK_CONTRACT: ExecutionContract;
769
-
770
- type Axis1DecodedFrame = {
771
- ver: number;
772
- flags: number;
773
- hdr: Buffer;
774
- body: Buffer;
775
- sig: Buffer;
776
- frameSize: number;
777
- };
778
- declare function decodeAxis1Frame(buf: Buffer): Axis1DecodedFrame;
779
-
780
- declare const T: {
781
- INTENT: number;
782
- PID: number;
783
- INTENT_VERSION: number;
784
- ACTOR_ID: number;
785
- CAPSULE_ID: number;
786
- NONCE: number;
787
- TS_MS: number;
788
- PROOF_TYPE: number;
789
- BODY: number;
790
- JSON: number;
791
- };
792
- type AxisPacket = {
793
- intent: string;
794
- intentVersion: number;
795
- actorId: string;
796
- capsuleId?: Buffer;
797
- pid: Buffer;
798
- nonce: Buffer;
799
- tsMs: bigint;
800
- headersMap: Map<number, Buffer[]>;
801
- bodyMap: Map<number, Buffer[]>;
802
- hdrBytes: Buffer;
803
- bodyBytes: Buffer;
804
- sig: Buffer;
805
- };
806
- declare function buildPacket(hdr: Buffer, body: Buffer, sig: Buffer, flags?: number): AxisPacket;
807
-
808
- type AxisAlg = Extract<AxisAlg$1, 'EdDSA'>;
809
- type AxisSig = AxisSig$1 & {
810
- alg: AxisAlg;
811
- };
812
- interface AxisFrame$1<T = any> {
813
- v: 1;
814
- pid: string;
815
- nonce: string;
816
- ts: number;
817
- actorId: string;
818
- aud?: string;
819
- opcode: string;
820
- headers: Map<number, Uint8Array>;
821
- body: T;
822
- sig: AxisSig;
823
- }
824
- type AxisResponse<T = any> = AxisResponse$1<T> & {
825
- policyRefs?: string[];
826
- riskScore?: number;
827
- };
828
- interface AxisObservedContext {
829
- ip?: string;
830
- ua?: string;
831
- geo?: string;
832
- }
833
- interface AxisRequestContext {
834
- observed: AxisObservedContext;
835
- actorKeyKid?: string;
836
- issuerKeyKid?: string;
837
- decisionId: string;
838
- actorId: string;
839
- aud?: string;
840
- opcode: string;
841
- deviceId?: string;
842
- sessionId?: string;
843
- }
844
-
845
- interface SensorPhaseMetadata {
846
- phase: 'PRE_DECODE' | 'POST_DECODE';
847
- dependencies?: string[];
848
- asyncOk?: boolean;
849
- cryptoOk?: boolean;
850
- description?: string;
851
- }
852
- interface AxisSensor {
853
- readonly name: string;
854
- readonly order?: number;
855
- phase?: SensorPhaseMetadata | 'PRE_DECODE' | 'POST_DECODE';
856
- supports?(input: SensorInput): boolean;
857
- run(input: SensorInput): Promise<SensorDecision>;
858
- }
859
- interface AxisSensorInit extends AxisSensor {
860
- onModuleInit?(): void | Promise<void>;
861
- }
862
- interface AxisPreSensor extends AxisSensor {
863
- phase: 'PRE_DECODE';
864
- }
865
- interface AxisPostSensor extends AxisSensor {
866
- phase: 'POST_DECODE';
867
- }
868
- interface SensorInput {
869
- rawBytes?: Buffer | Uint8Array;
870
- intent?: string;
871
- ip?: string;
872
- path?: string;
873
- contentLength?: number;
874
- peek?: Uint8Array;
875
- country?: string;
876
- clientId?: string;
877
- isWs?: boolean;
878
- metadata?: Record<string, any>;
879
- actorId?: string;
880
- opcode?: string;
881
- aud?: string;
882
- observed?: AxisObservedContext;
883
- frameBody?: any;
884
- deviceId?: string;
885
- sessionId?: string;
886
- packet?: Record<string, any>;
887
- [key: string]: any;
888
- }
889
- declare enum Decision {
890
- ALLOW = "ALLOW",
891
- DENY = "DENY",
892
- THROTTLE = "THROTTLE",
893
- FLAG = "FLAG"
894
- }
895
- type SensorDecision = {
896
- decision?: Decision;
897
- allow: boolean;
898
- riskScore: number;
899
- reasons: string[];
900
- code?: string;
901
- retryAfterMs?: number;
902
- scoreDelta?: number;
903
- tags?: Record<string, any>;
904
- meta?: any;
905
- tighten?: {
906
- expSecondsMax?: number;
907
- constraintsPatch?: Record<string, any>;
908
- };
909
- } | {
910
- action: 'ALLOW';
911
- meta?: any;
912
- } | {
913
- action: 'DENY';
914
- code: string;
915
- reason?: string;
916
- retryAfterMs?: number;
917
- meta?: any;
918
- } | {
919
- action: 'THROTTLE';
920
- retryAfterMs: number;
921
- meta?: any;
922
- } | {
923
- action: 'FLAG';
924
- scoreDelta: number;
925
- reasons: string[];
926
- meta?: any;
1187
+ declare const FALLBACK_CONTRACT: ExecutionContract;
1188
+
1189
+ type Axis1DecodedFrame = {
1190
+ ver: number;
1191
+ flags: number;
1192
+ hdr: Buffer;
1193
+ body: Buffer;
1194
+ sig: Buffer;
1195
+ frameSize: number;
927
1196
  };
928
- type SensorMinifiedDecision = {
929
- allow: boolean;
930
- riskScore: number;
931
- reasons: string[];
932
- tags?: Record<string, any>;
933
- meta?: any;
934
- tighten?: {
935
- expSecondsMax?: number;
936
- constraintsPatch?: Record<string, any>;
937
- };
938
- retryAfterMs?: number;
1197
+ declare function decodeAxis1Frame(buf: Buffer): Axis1DecodedFrame;
1198
+
1199
+ declare const T: {
1200
+ INTENT: number;
1201
+ PID: number;
1202
+ INTENT_VERSION: number;
1203
+ ACTOR_ID: number;
1204
+ CAPSULE_ID: number;
1205
+ NONCE: number;
1206
+ TS_MS: number;
1207
+ PROOF_TYPE: number;
1208
+ BODY: number;
1209
+ JSON: number;
939
1210
  };
940
- declare function normalizeSensorDecision(sensorDecision: SensorDecision): SensorMinifiedDecision;
941
- declare const SensorDecisions: {
942
- allow(meta?: any, tags?: Record<string, any>): SensorDecision;
943
- deny(code: string, reason?: string, meta?: any): SensorDecision;
944
- throttle(retryAfterMs: number, meta?: any): SensorDecision;
945
- flag(scoreDelta: number, reasons: string[], meta?: any): SensorDecision;
1211
+ type AxisPacket = {
1212
+ intent: string;
1213
+ intentVersion: number;
1214
+ actorId: string;
1215
+ capsuleId?: Buffer;
1216
+ pid: Buffer;
1217
+ nonce: Buffer;
1218
+ tsMs: bigint;
1219
+ headersMap: Map<number, Buffer[]>;
1220
+ bodyMap: Map<number, Buffer[]>;
1221
+ hdrBytes: Buffer;
1222
+ bodyBytes: Buffer;
1223
+ sig: Buffer;
946
1224
  };
1225
+ declare function buildPacket(hdr: Buffer, body: Buffer, sig: Buffer, flags?: number): AxisPacket;
947
1226
 
948
1227
  interface AxisHandler {
949
1228
  readonly name: string;
@@ -1623,84 +1902,451 @@ declare enum ProofType$1 {
1623
1902
  DEVICE_SE = 4,
1624
1903
  WITNESS_SIG = 5
1625
1904
  }
1626
- declare const AxisContextZ: z.ZodObject<{
1627
- pid: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1628
- ts: z.ZodBigInt;
1629
- intent: z.ZodString;
1630
- actorId: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1631
- proofType: z.ZodEnum<typeof ProofType$1>;
1632
- proofRef: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1633
- nonce: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1634
- ip: z.ZodString;
1635
- nodeCertHash: z.ZodOptional<z.ZodString>;
1636
- capsule: z.ZodOptional<z.ZodObject<{
1637
- id: z.ZodString;
1638
- claims: z.ZodObject<{
1639
- capsuleId: z.ZodString;
1640
- allowIntents: z.ZodArray<z.ZodString>;
1641
- limits: z.ZodOptional<z.ZodObject<{
1642
- maxBodyBytes: z.ZodOptional<z.ZodNumber>;
1643
- }, z.core.$strip>>;
1644
- scopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1645
- }, z.core.$strip>;
1646
- issuedAt: z.ZodNumber;
1647
- expiresAt: z.ZodNumber;
1648
- tier: z.ZodEnum<{
1649
- FREE: "FREE";
1650
- STANDARD: "STANDARD";
1651
- PREMIUM: "PREMIUM";
1652
- }>;
1653
- }, z.core.$strip>>;
1654
- passport: z.ZodOptional<z.ZodObject<{
1655
- id: z.ZodString;
1656
- public_key: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1657
- status: z.ZodEnum<{
1658
- ACTIVE: "ACTIVE";
1659
- REVOKED: "REVOKED";
1660
- EXPIRED: "EXPIRED";
1661
- PENDING: "PENDING";
1662
- }>;
1663
- issuedAt: z.ZodNumber;
1664
- expiresAt: z.ZodOptional<z.ZodNumber>;
1665
- }, z.core.$strip>>;
1666
- meter: z.ZodOptional<z.ZodAny>;
1667
- }, z.core.$strip>;
1668
- type AxisContext = z.infer<typeof AxisContextZ>;
1669
- declare const AxisErrorZ: z.ZodObject<{
1670
- code: z.ZodString;
1671
- message: z.ZodString;
1672
- httpStatus: z.ZodNumber;
1673
- }, z.core.$strip>;
1674
- type AxisError = z.infer<typeof AxisErrorZ>;
1905
+ declare const AxisContextZ: z.ZodObject<{
1906
+ pid: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1907
+ ts: z.ZodBigInt;
1908
+ intent: z.ZodString;
1909
+ actorId: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1910
+ proofType: z.ZodEnum<typeof ProofType$1>;
1911
+ proofRef: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1912
+ nonce: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1913
+ ip: z.ZodString;
1914
+ nodeCertHash: z.ZodOptional<z.ZodString>;
1915
+ capsule: z.ZodOptional<z.ZodObject<{
1916
+ id: z.ZodString;
1917
+ claims: z.ZodObject<{
1918
+ capsuleId: z.ZodString;
1919
+ allowIntents: z.ZodArray<z.ZodString>;
1920
+ limits: z.ZodOptional<z.ZodObject<{
1921
+ maxBodyBytes: z.ZodOptional<z.ZodNumber>;
1922
+ }, z.core.$strip>>;
1923
+ scopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1924
+ }, z.core.$strip>;
1925
+ issuedAt: z.ZodNumber;
1926
+ expiresAt: z.ZodNumber;
1927
+ tier: z.ZodEnum<{
1928
+ FREE: "FREE";
1929
+ STANDARD: "STANDARD";
1930
+ PREMIUM: "PREMIUM";
1931
+ }>;
1932
+ }, z.core.$strip>>;
1933
+ passport: z.ZodOptional<z.ZodObject<{
1934
+ id: z.ZodString;
1935
+ public_key: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
1936
+ status: z.ZodEnum<{
1937
+ ACTIVE: "ACTIVE";
1938
+ REVOKED: "REVOKED";
1939
+ EXPIRED: "EXPIRED";
1940
+ PENDING: "PENDING";
1941
+ }>;
1942
+ issuedAt: z.ZodNumber;
1943
+ expiresAt: z.ZodOptional<z.ZodNumber>;
1944
+ }, z.core.$strip>>;
1945
+ meter: z.ZodOptional<z.ZodAny>;
1946
+ }, z.core.$strip>;
1947
+ type AxisContext = z.infer<typeof AxisContextZ>;
1948
+ declare const AxisErrorZ: z.ZodObject<{
1949
+ code: z.ZodString;
1950
+ message: z.ZodString;
1951
+ httpStatus: z.ZodNumber;
1952
+ }, z.core.$strip>;
1953
+ type AxisError = z.infer<typeof AxisErrorZ>;
1954
+
1955
+ interface AxisDecoded {
1956
+ frame: Axis1DecodedFrame;
1957
+ packet: AxisPacket;
1958
+ axisCtx: AxisContext;
1959
+ correlationId: Buffer;
1960
+ correlationIdHex: string;
1961
+ sensorInput: SensorInput;
1962
+ extra: {
1963
+ ip?: string;
1964
+ demoPubkeyHex?: string;
1965
+ };
1966
+ observation: AxisObservation;
1967
+ }
1968
+
1969
+ interface ChainResult {
1970
+ allowed: boolean;
1971
+ scoreDelta: number;
1972
+ statusCode: number;
1973
+ body?: string | Buffer | Uint8Array;
1974
+ headers?: Map<number, Uint8Array>;
1975
+ }
1976
+ declare class AxisSensorChainService {
1977
+ private readonly registry;
1978
+ constructor(registry: SensorRegistry);
1979
+ evaluate(input: SensorInput, phase?: 'PRE_DECODE' | 'POST_DECODE' | 'BOTH', baseDecision?: SensorDecision): Promise<SensorDecision>;
1980
+ evaluatePre(input: SensorInput): Promise<SensorDecision>;
1981
+ evaluatePost(input: SensorInput, baseDecision?: SensorDecision): Promise<SensorDecision>;
1982
+ private evaluateSensors;
1983
+ }
1984
+
1985
+ type AxisTlvDtoCtor<T = object> = new (...args: never[]) => T;
1986
+ declare function encodeAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>): Uint8Array;
1987
+
1988
+ interface PresenceDeclaration {
1989
+ softid: string;
1990
+ device_meta?: {
1991
+ fingerprint?: string;
1992
+ platform?: string;
1993
+ user_agent?: string;
1994
+ };
1995
+ }
1996
+ interface PresenceChallenge {
1997
+ challenge_id: string;
1998
+ nonce: string;
1999
+ temporal_anchor: number;
2000
+ ttl_ms: number;
2001
+ expires_at: number;
2002
+ }
2003
+ interface PresenceProof {
2004
+ challenge_id: string;
2005
+ signature: string;
2006
+ public_key: string;
2007
+ kid?: string;
2008
+ }
2009
+ interface PresenceReceipt {
2010
+ presence_id: string;
2011
+ softid: string;
2012
+ anchor_reflection: string;
2013
+ scope: {
2014
+ ip?: string;
2015
+ device_fingerprint?: string;
2016
+ };
2017
+ issued_at: number;
2018
+ expires_at: number;
2019
+ renewed_at?: number;
2020
+ }
2021
+ type PresenceStatus = 'active' | 'expired' | 'revoked';
2022
+ interface WritHead {
2023
+ tid: string;
2024
+ seq: number;
2025
+ }
2026
+ interface WritBody {
2027
+ who: string;
2028
+ act: string;
2029
+ res: string;
2030
+ law: string;
2031
+ }
2032
+ interface WritMeta {
2033
+ iat: number;
2034
+ exp: number;
2035
+ prev: string;
2036
+ }
2037
+ interface WritSignature {
2038
+ alg: 'ed25519';
2039
+ value: string;
2040
+ kid?: string;
2041
+ }
2042
+ interface Writ {
2043
+ head: WritHead;
2044
+ body: WritBody;
2045
+ meta: WritMeta;
2046
+ sig: WritSignature;
2047
+ }
2048
+ type GrantType = 'sovereign' | 'delegated' | 'system';
2049
+ interface GrantCapability {
2050
+ oec: string;
2051
+ scope: string;
2052
+ limit?: {
2053
+ rate?: string;
2054
+ amount?: number;
2055
+ depth?: string;
2056
+ };
2057
+ }
2058
+ interface GrantMeta {
2059
+ iat: number;
2060
+ exp: number;
2061
+ revocable: boolean;
2062
+ version: number;
2063
+ contract_ref?: string;
2064
+ }
2065
+ interface Grant {
2066
+ grant_id: string;
2067
+ issuer: string;
2068
+ subject: string;
2069
+ grant_type: GrantType;
2070
+ caps: GrantCapability[];
2071
+ meta: GrantMeta;
2072
+ sig: WritSignature;
2073
+ }
2074
+ type GrantStatus = 'active' | 'revoked' | 'expired';
2075
+ interface LoomReceipt {
2076
+ receipt_id: string;
2077
+ writ_hash: string;
2078
+ thread_id: string;
2079
+ sequence: number;
2080
+ effect: string;
2081
+ hash: string;
2082
+ prev_hash: string | null;
2083
+ executed_at: number;
2084
+ metadata?: Record<string, unknown>;
2085
+ }
2086
+ interface ThreadState {
2087
+ thread_id: string;
2088
+ softid: string;
2089
+ last_receipt_hash: string;
2090
+ sequence: number;
2091
+ updated_at: number;
2092
+ }
2093
+ type RevocationTargetType = 'grant' | 'presence' | 'softid';
2094
+ interface Revocation {
2095
+ revocation_id: string;
2096
+ target_type: RevocationTargetType;
2097
+ target_id: string;
2098
+ issuer_softid: string;
2099
+ reason?: string;
2100
+ effective_at: number;
2101
+ sig_value: string;
2102
+ }
2103
+ interface LoomValidationResult {
2104
+ valid: boolean;
2105
+ error?: string;
2106
+ code?: string;
2107
+ }
2108
+ interface PresenceVerifyResult extends LoomValidationResult {
2109
+ presence?: PresenceReceipt;
2110
+ }
2111
+ interface WritValidationResult extends LoomValidationResult {
2112
+ writ?: Writ;
2113
+ gate_failed?: 'temporal' | 'causal' | 'legal' | 'authentic';
2114
+ }
2115
+ interface GrantValidationResult extends LoomValidationResult {
2116
+ grant?: Grant;
2117
+ }
1675
2118
 
1676
- interface AxisDecoded {
1677
- frame: Axis1DecodedFrame;
1678
- packet: AxisPacket;
1679
- axisCtx: AxisContext;
1680
- correlationId: Buffer;
1681
- correlationIdHex: string;
1682
- sensorInput: SensorInput;
1683
- extra: {
1684
- ip?: string;
1685
- demoPubkeyHex?: string;
1686
- };
1687
- observation: AxisObservation;
2119
+ declare function deriveAnchorReflection(softid: string, context?: string, scope?: string): string;
2120
+ declare function canonicalizeWrit(writ: Omit<Writ, 'sig'>): string;
2121
+ declare function canonicalizeGrant(grant: Omit<Grant, 'sig'>): string;
2122
+
2123
+ interface CceDerivationInput {
2124
+ axisLocalSecret: string;
2125
+ capsule: CceCapsuleClaims;
2126
+ requestNonce: string;
2127
+ responseNonce?: string;
2128
+ }
2129
+ declare function deriveRequestExecutionKey(input: CceDerivationInput): Uint8Array;
2130
+ declare function deriveResponseExecutionKey(input: CceDerivationInput & {
2131
+ responseNonce: string;
2132
+ }): Uint8Array;
2133
+ declare function deriveWitnessKey(input: CceDerivationInput): Uint8Array;
2134
+ declare function buildExecutionContext(input: CceDerivationInput, requestId: string): CceExecutionContext;
2135
+ declare function generateCceNonce(): string;
2136
+
2137
+ interface CceAxisKeyProvider {
2138
+ unwrapKey(encryptedKeyB64: string, algorithm: string, axisKid: string, ephemeralPkB64?: string): Promise<Uint8Array | null>;
2139
+ }
2140
+ interface CceAesGcmProvider {
2141
+ decrypt(key: Uint8Array, iv: Uint8Array, ciphertext: Uint8Array, tag: Uint8Array, aad?: Uint8Array): Promise<Uint8Array | null>;
2142
+ }
2143
+ declare class CcePayloadDecryptionSensor implements AxisSensor {
2144
+ private readonly keyProvider;
2145
+ private readonly aesProvider;
2146
+ private readonly maxPayloadBytes;
2147
+ readonly name = "cce.payload.decryption";
2148
+ readonly order = 145;
2149
+ readonly phase: "POST_DECODE";
2150
+ constructor(keyProvider: CceAxisKeyProvider, aesProvider: CceAesGcmProvider, maxPayloadBytes?: number);
2151
+ supports(input: SensorInput): boolean;
2152
+ run(input: SensorInput): Promise<SensorDecision>;
1688
2153
  }
1689
2154
 
1690
- interface ChainResult {
1691
- allowed: boolean;
1692
- scoreDelta: number;
1693
- statusCode: number;
1694
- body?: string | Buffer | Uint8Array;
1695
- headers?: Map<number, Uint8Array>;
2155
+ declare function aesGcmEncrypt(key: Uint8Array, plaintext: Uint8Array, aad?: Uint8Array): {
2156
+ iv: Uint8Array;
2157
+ ciphertext: Uint8Array;
2158
+ tag: Uint8Array;
2159
+ };
2160
+ declare function aesGcmDecrypt(key: Uint8Array, iv: Uint8Array, ciphertext: Uint8Array, tag: Uint8Array, aad?: Uint8Array): Uint8Array | null;
2161
+ declare function generateAesKey(): Uint8Array;
2162
+ declare function generateIv(): Uint8Array;
2163
+ declare function base64UrlEncode(bytes: Uint8Array): string;
2164
+ declare function base64UrlDecode(input: string): Uint8Array;
2165
+ declare function hashPayload(payload: Uint8Array): string;
2166
+
2167
+ declare const nodeAesGcmProvider: CceAesGcmProvider;
2168
+
2169
+ declare class CceEnvelopeValidationSensor implements AxisSensor {
2170
+ readonly name = "cce.envelope.validation";
2171
+ readonly order = 5;
2172
+ readonly phase: "PRE_DECODE";
2173
+ supports(input: SensorInput): boolean;
2174
+ run(input: SensorInput): Promise<SensorDecision>;
1696
2175
  }
1697
- declare class AxisSensorChainService {
1698
- private readonly registry;
1699
- constructor(registry: SensorRegistry);
1700
- evaluate(input: SensorInput, phase?: 'PRE_DECODE' | 'POST_DECODE' | 'BOTH', baseDecision?: SensorDecision): Promise<SensorDecision>;
1701
- evaluatePre(input: SensorInput): Promise<SensorDecision>;
1702
- evaluatePost(input: SensorInput, baseDecision?: SensorDecision): Promise<SensorDecision>;
1703
- private evaluateSensors;
2176
+
2177
+ interface CceClientKeyResolver {
2178
+ resolve(kid: string): Promise<{
2179
+ publicKeyHex: string;
2180
+ alg: string;
2181
+ } | null>;
2182
+ }
2183
+ interface CceSignatureVerifier {
2184
+ verify(message: Uint8Array, signatureHex: string, publicKeyHex: string, alg: string): Promise<boolean>;
2185
+ }
2186
+ declare class CceClientSignatureSensor implements AxisSensor {
2187
+ private readonly keyResolver;
2188
+ private readonly signatureVerifier;
2189
+ readonly name = "cce.client.signature";
2190
+ readonly order = 45;
2191
+ readonly phase: "POST_DECODE";
2192
+ constructor(keyResolver: CceClientKeyResolver, signatureVerifier: CceSignatureVerifier);
2193
+ supports(input: SensorInput): boolean;
2194
+ run(input: SensorInput): Promise<SensorDecision>;
2195
+ }
2196
+
2197
+ interface CceIssuerKeyResolver {
2198
+ resolve(kid: string): Promise<{
2199
+ publicKeyHex: string;
2200
+ } | null>;
2201
+ }
2202
+ interface CceCapsuleSignatureVerifier {
2203
+ verify(claims: Omit<CceCapsuleClaims, "issuer_sig">, signature: {
2204
+ alg: string;
2205
+ kid: string;
2206
+ value: string;
2207
+ }, publicKeyHex: string): Promise<boolean>;
2208
+ }
2209
+ declare class CceCapsuleVerificationSensor implements AxisSensor {
2210
+ private readonly issuerKeyResolver;
2211
+ private readonly capsuleVerifier;
2212
+ readonly name = "cce.capsule.verification";
2213
+ readonly order = 50;
2214
+ readonly phase: "POST_DECODE";
2215
+ constructor(issuerKeyResolver: CceIssuerKeyResolver, capsuleVerifier: CceCapsuleSignatureVerifier);
2216
+ supports(input: SensorInput): boolean;
2217
+ run(input: SensorInput): Promise<SensorDecision>;
2218
+ }
2219
+
2220
+ declare class CceTpsWindowSensor implements AxisSensor {
2221
+ private readonly skewMs;
2222
+ readonly name = "cce.tps.window";
2223
+ readonly order = 92;
2224
+ readonly phase: "POST_DECODE";
2225
+ constructor(skewMs?: number);
2226
+ supports(input: SensorInput): boolean;
2227
+ run(input: SensorInput): Promise<SensorDecision>;
2228
+ }
2229
+
2230
+ declare class CceAudienceIntentBindingSensor implements AxisSensor {
2231
+ private readonly axisAudience;
2232
+ readonly name = "cce.audience.intent.binding";
2233
+ readonly order = 95;
2234
+ readonly phase: "POST_DECODE";
2235
+ constructor(axisAudience: string);
2236
+ supports(input: SensorInput): boolean;
2237
+ run(input: SensorInput): Promise<SensorDecision>;
2238
+ }
2239
+
2240
+ interface CceReplayStore {
2241
+ checkAndMark(key: string, ttlMs: number): Promise<boolean>;
2242
+ isCapsuleConsumed(capsuleId: string): Promise<boolean>;
2243
+ markCapsuleConsumed(capsuleId: string, ttlMs: number): Promise<void>;
2244
+ isCapsuleRevoked(capsuleId: string): Promise<boolean>;
2245
+ }
2246
+ declare class InMemoryCceReplayStore implements CceReplayStore {
2247
+ private nonces;
2248
+ private consumed;
2249
+ private revoked;
2250
+ checkAndMark(key: string, ttlMs: number): Promise<boolean>;
2251
+ isCapsuleConsumed(capsuleId: string): Promise<boolean>;
2252
+ markCapsuleConsumed(capsuleId: string, _ttlMs: number): Promise<void>;
2253
+ isCapsuleRevoked(capsuleId: string): Promise<boolean>;
2254
+ revoke(capsuleId: string): void;
2255
+ private cleanup;
2256
+ }
2257
+ declare class CceReplayProtectionSensor implements AxisSensor {
2258
+ private readonly replayStore;
2259
+ readonly name = "cce.replay.protection";
2260
+ readonly order = 98;
2261
+ readonly phase: "POST_DECODE";
2262
+ private readonly nonceTtlMs;
2263
+ constructor(replayStore: CceReplayStore, options?: {
2264
+ nonceTtlMs?: number;
2265
+ });
2266
+ supports(input: SensorInput): boolean;
2267
+ run(input: SensorInput): Promise<SensorDecision>;
2268
+ }
2269
+
2270
+ declare const index$9_CCE_AES_KEY_BYTES: typeof CCE_AES_KEY_BYTES;
2271
+ declare const index$9_CCE_DERIVATION: typeof CCE_DERIVATION;
2272
+ declare const index$9_CCE_ERROR: typeof CCE_ERROR;
2273
+ declare const index$9_CCE_IV_BYTES: typeof CCE_IV_BYTES;
2274
+ declare const index$9_CCE_NONCE_BYTES: typeof CCE_NONCE_BYTES;
2275
+ declare const index$9_CCE_PROTOCOL_VERSION: typeof CCE_PROTOCOL_VERSION;
2276
+ declare const index$9_CCE_TAG_BYTES: typeof CCE_TAG_BYTES;
2277
+ type index$9_CceAesGcmProvider = CceAesGcmProvider;
2278
+ type index$9_CceAlgorithm = CceAlgorithm;
2279
+ type index$9_CceAlgorithmDescriptor = CceAlgorithmDescriptor;
2280
+ type index$9_CceAudienceIntentBindingSensor = CceAudienceIntentBindingSensor;
2281
+ declare const index$9_CceAudienceIntentBindingSensor: typeof CceAudienceIntentBindingSensor;
2282
+ type index$9_CceAxisKeyProvider = CceAxisKeyProvider;
2283
+ type index$9_CceAxisSigner = CceAxisSigner;
2284
+ type index$9_CceCapsuleClaims = CceCapsuleClaims;
2285
+ type index$9_CceCapsuleSignatureVerifier = CceCapsuleSignatureVerifier;
2286
+ type index$9_CceCapsuleVerificationSensor = CceCapsuleVerificationSensor;
2287
+ declare const index$9_CceCapsuleVerificationSensor: typeof CceCapsuleVerificationSensor;
2288
+ type index$9_CceClientKeyEncryptor = CceClientKeyEncryptor;
2289
+ type index$9_CceClientKeyResolver = CceClientKeyResolver;
2290
+ type index$9_CceClientSignatureSensor = CceClientSignatureSensor;
2291
+ declare const index$9_CceClientSignatureSensor: typeof CceClientSignatureSensor;
2292
+ type index$9_CceConstraints = CceConstraints;
2293
+ type index$9_CceDerivationInput = CceDerivationInput;
2294
+ type index$9_CceEncryptedKey = CceEncryptedKey;
2295
+ type index$9_CceEncryptedPayload = CceEncryptedPayload;
2296
+ type index$9_CceEnvelopeValidationSensor = CceEnvelopeValidationSensor;
2297
+ declare const index$9_CceEnvelopeValidationSensor: typeof CceEnvelopeValidationSensor;
2298
+ type index$9_CceError = CceError;
2299
+ declare const index$9_CceError: typeof CceError;
2300
+ type index$9_CceErrorCode = CceErrorCode;
2301
+ type index$9_CceExecutionContext = CceExecutionContext;
2302
+ type index$9_CceHandler = CceHandler;
2303
+ type index$9_CceHandlerContext = CceHandlerContext;
2304
+ type index$9_CceHandlerResult = CceHandlerResult;
2305
+ type index$9_CceIssuerKeyResolver = CceIssuerKeyResolver;
2306
+ type index$9_CceKdfAlgorithm = CceKdfAlgorithm;
2307
+ type index$9_CceKemAlgorithm = CceKemAlgorithm;
2308
+ type index$9_CcePayloadDecryptionSensor = CcePayloadDecryptionSensor;
2309
+ declare const index$9_CcePayloadDecryptionSensor: typeof CcePayloadDecryptionSensor;
2310
+ type index$9_CcePipelineConfig = CcePipelineConfig;
2311
+ type index$9_CcePipelineResult = CcePipelineResult;
2312
+ type index$9_CceReplayProtectionSensor = CceReplayProtectionSensor;
2313
+ declare const index$9_CceReplayProtectionSensor: typeof CceReplayProtectionSensor;
2314
+ type index$9_CceReplayStore = CceReplayStore;
2315
+ type index$9_CceRequestEnvelope = CceRequestEnvelope;
2316
+ type index$9_CceResponseEnvelope = CceResponseEnvelope;
2317
+ type index$9_CceResponseOptions = CceResponseOptions;
2318
+ type index$9_CceResponseStatus = CceResponseStatus;
2319
+ type index$9_CceSignature = CceSignature;
2320
+ type index$9_CceSignatureVerifier = CceSignatureVerifier;
2321
+ type index$9_CceTpsWindowSensor = CceTpsWindowSensor;
2322
+ declare const index$9_CceTpsWindowSensor: typeof CceTpsWindowSensor;
2323
+ type index$9_CceVerificationState = CceVerificationState;
2324
+ type index$9_CceWitnessRecord = CceWitnessRecord;
2325
+ type index$9_CceWitnessStore = CceWitnessStore;
2326
+ type index$9_InMemoryCceReplayStore = InMemoryCceReplayStore;
2327
+ declare const index$9_InMemoryCceReplayStore: typeof InMemoryCceReplayStore;
2328
+ type index$9_InMemoryCceWitnessStore = InMemoryCceWitnessStore;
2329
+ declare const index$9_InMemoryCceWitnessStore: typeof InMemoryCceWitnessStore;
2330
+ declare const index$9_aesGcmDecrypt: typeof aesGcmDecrypt;
2331
+ declare const index$9_aesGcmEncrypt: typeof aesGcmEncrypt;
2332
+ declare const index$9_base64UrlDecode: typeof base64UrlDecode;
2333
+ declare const index$9_base64UrlEncode: typeof base64UrlEncode;
2334
+ declare const index$9_buildCceErrorResponse: typeof buildCceErrorResponse;
2335
+ declare const index$9_buildCceResponse: typeof buildCceResponse;
2336
+ declare const index$9_buildExecutionContext: typeof buildExecutionContext;
2337
+ declare const index$9_buildWitnessRecord: typeof buildWitnessRecord;
2338
+ declare const index$9_deriveRequestExecutionKey: typeof deriveRequestExecutionKey;
2339
+ declare const index$9_deriveResponseExecutionKey: typeof deriveResponseExecutionKey;
2340
+ declare const index$9_deriveWitnessKey: typeof deriveWitnessKey;
2341
+ declare const index$9_executeCcePipeline: typeof executeCcePipeline;
2342
+ declare const index$9_extractVerificationState: typeof extractVerificationState;
2343
+ declare const index$9_generateAesKey: typeof generateAesKey;
2344
+ declare const index$9_generateCceNonce: typeof generateCceNonce;
2345
+ declare const index$9_generateIv: typeof generateIv;
2346
+ declare const index$9_hashPayload: typeof hashPayload;
2347
+ declare const index$9_nodeAesGcmProvider: typeof nodeAesGcmProvider;
2348
+ declare namespace index$9 {
2349
+ export { index$9_CCE_AES_KEY_BYTES as CCE_AES_KEY_BYTES, index$9_CCE_DERIVATION as CCE_DERIVATION, index$9_CCE_ERROR as CCE_ERROR, index$9_CCE_IV_BYTES as CCE_IV_BYTES, index$9_CCE_NONCE_BYTES as CCE_NONCE_BYTES, index$9_CCE_PROTOCOL_VERSION as CCE_PROTOCOL_VERSION, index$9_CCE_TAG_BYTES as CCE_TAG_BYTES, type index$9_CceAesGcmProvider as CceAesGcmProvider, type index$9_CceAlgorithm as CceAlgorithm, type index$9_CceAlgorithmDescriptor as CceAlgorithmDescriptor, index$9_CceAudienceIntentBindingSensor as CceAudienceIntentBindingSensor, type index$9_CceAxisKeyProvider as CceAxisKeyProvider, type index$9_CceAxisSigner as CceAxisSigner, type index$9_CceCapsuleClaims as CceCapsuleClaims, type index$9_CceCapsuleSignatureVerifier as CceCapsuleSignatureVerifier, index$9_CceCapsuleVerificationSensor as CceCapsuleVerificationSensor, type index$9_CceClientKeyEncryptor as CceClientKeyEncryptor, type index$9_CceClientKeyResolver as CceClientKeyResolver, index$9_CceClientSignatureSensor as CceClientSignatureSensor, type index$9_CceConstraints as CceConstraints, type index$9_CceDerivationInput as CceDerivationInput, type index$9_CceEncryptedKey as CceEncryptedKey, type index$9_CceEncryptedPayload as CceEncryptedPayload, index$9_CceEnvelopeValidationSensor as CceEnvelopeValidationSensor, index$9_CceError as CceError, type index$9_CceErrorCode as CceErrorCode, type index$9_CceExecutionContext as CceExecutionContext, type index$9_CceHandler as CceHandler, type index$9_CceHandlerContext as CceHandlerContext, type index$9_CceHandlerResult as CceHandlerResult, type index$9_CceIssuerKeyResolver as CceIssuerKeyResolver, type index$9_CceKdfAlgorithm as CceKdfAlgorithm, type index$9_CceKemAlgorithm as CceKemAlgorithm, index$9_CcePayloadDecryptionSensor as CcePayloadDecryptionSensor, type index$9_CcePipelineConfig as CcePipelineConfig, type index$9_CcePipelineResult as CcePipelineResult, index$9_CceReplayProtectionSensor as CceReplayProtectionSensor, type index$9_CceReplayStore as CceReplayStore, type index$9_CceRequestEnvelope as CceRequestEnvelope, type index$9_CceResponseEnvelope as CceResponseEnvelope, type index$9_CceResponseOptions as CceResponseOptions, type index$9_CceResponseStatus as CceResponseStatus, type index$9_CceSignature as CceSignature, type index$9_CceSignatureVerifier as CceSignatureVerifier, index$9_CceTpsWindowSensor as CceTpsWindowSensor, type index$9_CceVerificationState as CceVerificationState, type index$9_CceWitnessRecord as CceWitnessRecord, type index$9_CceWitnessStore as CceWitnessStore, index$9_InMemoryCceReplayStore as InMemoryCceReplayStore, index$9_InMemoryCceWitnessStore as InMemoryCceWitnessStore, index$9_aesGcmDecrypt as aesGcmDecrypt, index$9_aesGcmEncrypt as aesGcmEncrypt, index$9_base64UrlDecode as base64UrlDecode, index$9_base64UrlEncode as base64UrlEncode, index$9_buildCceErrorResponse as buildCceErrorResponse, index$9_buildCceResponse as buildCceResponse, index$9_buildExecutionContext as buildExecutionContext, index$9_buildWitnessRecord as buildWitnessRecord, index$9_deriveRequestExecutionKey as deriveRequestExecutionKey, index$9_deriveResponseExecutionKey as deriveResponseExecutionKey, index$9_deriveWitnessKey as deriveWitnessKey, index$9_executeCcePipeline as executeCcePipeline, index$9_extractVerificationState as extractVerificationState, index$9_generateAesKey as generateAesKey, index$9_generateCceNonce as generateCceNonce, index$9_generateIv as generateIv, index$9_hashPayload as hashPayload, index$9_nodeAesGcmProvider as nodeAesGcmProvider };
1704
2350
  }
1705
2351
 
1706
2352
  type ProofType = 1 | 2 | 3 | 4;
@@ -1848,157 +2494,40 @@ type index$5_HandlerDiscoveryService = HandlerDiscoveryService;
1848
2494
  declare const index$5_HandlerDiscoveryService: typeof HandlerDiscoveryService;
1849
2495
  type index$5_IntentRouter = IntentRouter;
1850
2496
  declare const index$5_IntentRouter: typeof IntentRouter;
2497
+ type index$5_ObservationQueueConfig = ObservationQueueConfig;
2498
+ type index$5_ObservationQueueMessage = ObservationQueueMessage;
1851
2499
  type index$5_ObservationSensor = ObservationSensor;
1852
2500
  type index$5_ObservationStage = ObservationStage;
2501
+ type index$5_ObservationStreamEntry = ObservationStreamEntry;
2502
+ type index$5_ObservationWitnessSummary = ObservationWitnessSummary;
2503
+ type index$5_ObserverVerdict = ObserverVerdict;
1853
2504
  declare const index$5_PRE_DECODE_BOUNDARY: typeof PRE_DECODE_BOUNDARY;
2505
+ type index$5_ResponseContract = ResponseContract;
2506
+ type index$5_ResponseObserverContext = ResponseObserverContext;
1854
2507
  type index$5_SensorBand = SensorBand;
1855
2508
  type index$5_SensorDiscoveryService = SensorDiscoveryService;
1856
2509
  declare const index$5_SensorDiscoveryService: typeof SensorDiscoveryService;
1857
2510
  type index$5_SensorRegistry = SensorRegistry;
1858
2511
  declare const index$5_SensorRegistry: typeof SensorRegistry;
2512
+ type index$5_UnsignedObservationWitness = UnsignedObservationWitness;
2513
+ declare const index$5_buildQueueMessage: typeof buildQueueMessage;
2514
+ declare const index$5_buildUnsignedWitness: typeof buildUnsignedWitness;
2515
+ declare const index$5_canonicalizeObservation: typeof canonicalizeObservation;
1859
2516
  declare const index$5_createObservation: typeof createObservation;
2517
+ declare const index$5_decodeQueueMessage: typeof decodeQueueMessage;
2518
+ declare const index$5_encodeQueueMessage: typeof encodeQueueMessage;
1860
2519
  declare const index$5_endStage: typeof endStage;
1861
2520
  declare const index$5_finalizeObservation: typeof finalizeObservation;
2521
+ declare const index$5_hashObservation: typeof hashObservation;
2522
+ declare const index$5_parseAutoClaimEntries: typeof parseAutoClaimEntries;
2523
+ declare const index$5_parseStreamEntries: typeof parseStreamEntries;
1862
2524
  declare const index$5_recordSensor: typeof recordSensor;
2525
+ declare const index$5_stableJsonStringify: typeof stableJsonStringify;
1863
2526
  declare const index$5_startStage: typeof startStage;
2527
+ declare const index$5_verifyResponse: typeof verifyResponse;
1864
2528
  declare namespace index$5 {
1865
- export { type index$5_AxisDecoded as AxisDecoded, type index$5_AxisEffect as AxisEffect, type index$5_AxisObservation as AxisObservation, index$5_BAND as BAND, index$5_HandlerDiscoveryService as HandlerDiscoveryService, index$5_IntentRouter as IntentRouter, type IntentSchema$1 as IntentSchema, type index$5_ObservationSensor as ObservationSensor, type index$5_ObservationStage as ObservationStage, index$5_PRE_DECODE_BOUNDARY as PRE_DECODE_BOUNDARY, type index$5_SensorBand as SensorBand, index$5_SensorDiscoveryService as SensorDiscoveryService, index$5_SensorRegistry as SensorRegistry, index$5_createObservation as createObservation, index$5_endStage as endStage, index$5_finalizeObservation as finalizeObservation, index$6 as observation, index$5_recordSensor as recordSensor, index$5_startStage as startStage };
1866
- }
1867
-
1868
- interface PresenceDeclaration {
1869
- softid: string;
1870
- device_meta?: {
1871
- fingerprint?: string;
1872
- platform?: string;
1873
- user_agent?: string;
1874
- };
1875
- }
1876
- interface PresenceChallenge {
1877
- challenge_id: string;
1878
- nonce: string;
1879
- temporal_anchor: number;
1880
- ttl_ms: number;
1881
- expires_at: number;
1882
- }
1883
- interface PresenceProof {
1884
- challenge_id: string;
1885
- signature: string;
1886
- public_key: string;
1887
- kid?: string;
1888
- }
1889
- interface PresenceReceipt {
1890
- presence_id: string;
1891
- softid: string;
1892
- anchor_reflection: string;
1893
- scope: {
1894
- ip?: string;
1895
- device_fingerprint?: string;
1896
- };
1897
- issued_at: number;
1898
- expires_at: number;
1899
- renewed_at?: number;
1900
- }
1901
- type PresenceStatus = 'active' | 'expired' | 'revoked';
1902
- interface WritHead {
1903
- tid: string;
1904
- seq: number;
1905
- }
1906
- interface WritBody {
1907
- who: string;
1908
- act: string;
1909
- res: string;
1910
- law: string;
1911
- }
1912
- interface WritMeta {
1913
- iat: number;
1914
- exp: number;
1915
- prev: string;
1916
- }
1917
- interface WritSignature {
1918
- alg: 'ed25519';
1919
- value: string;
1920
- kid?: string;
1921
- }
1922
- interface Writ {
1923
- head: WritHead;
1924
- body: WritBody;
1925
- meta: WritMeta;
1926
- sig: WritSignature;
1927
- }
1928
- type GrantType = 'sovereign' | 'delegated' | 'system';
1929
- interface GrantCapability {
1930
- oec: string;
1931
- scope: string;
1932
- limit?: {
1933
- rate?: string;
1934
- amount?: number;
1935
- depth?: string;
1936
- };
1937
- }
1938
- interface GrantMeta {
1939
- iat: number;
1940
- exp: number;
1941
- revocable: boolean;
1942
- version: number;
1943
- contract_ref?: string;
1944
- }
1945
- interface Grant {
1946
- grant_id: string;
1947
- issuer: string;
1948
- subject: string;
1949
- grant_type: GrantType;
1950
- caps: GrantCapability[];
1951
- meta: GrantMeta;
1952
- sig: WritSignature;
1953
- }
1954
- type GrantStatus = 'active' | 'revoked' | 'expired';
1955
- interface LoomReceipt {
1956
- receipt_id: string;
1957
- writ_hash: string;
1958
- thread_id: string;
1959
- sequence: number;
1960
- effect: string;
1961
- hash: string;
1962
- prev_hash: string | null;
1963
- executed_at: number;
1964
- metadata?: Record<string, unknown>;
1965
- }
1966
- interface ThreadState {
1967
- thread_id: string;
1968
- softid: string;
1969
- last_receipt_hash: string;
1970
- sequence: number;
1971
- updated_at: number;
2529
+ export { type index$5_AxisDecoded as AxisDecoded, type index$5_AxisEffect as AxisEffect, type index$5_AxisObservation as AxisObservation, index$5_BAND as BAND, index$5_HandlerDiscoveryService as HandlerDiscoveryService, index$5_IntentRouter as IntentRouter, type IntentSchema$1 as IntentSchema, type index$5_ObservationQueueConfig as ObservationQueueConfig, type index$5_ObservationQueueMessage as ObservationQueueMessage, type index$5_ObservationSensor as ObservationSensor, type index$5_ObservationStage as ObservationStage, type index$5_ObservationStreamEntry as ObservationStreamEntry, type index$5_ObservationWitnessSummary as ObservationWitnessSummary, type index$5_ObserverVerdict as ObserverVerdict, index$5_PRE_DECODE_BOUNDARY as PRE_DECODE_BOUNDARY, type index$5_ResponseContract as ResponseContract, type index$5_ResponseObserverContext as ResponseObserverContext, type index$5_SensorBand as SensorBand, index$5_SensorDiscoveryService as SensorDiscoveryService, index$5_SensorRegistry as SensorRegistry, type index$5_UnsignedObservationWitness as UnsignedObservationWitness, index$5_buildQueueMessage as buildQueueMessage, index$5_buildUnsignedWitness as buildUnsignedWitness, index$5_canonicalizeObservation as canonicalizeObservation, index$5_createObservation as createObservation, index$5_decodeQueueMessage as decodeQueueMessage, index$5_encodeQueueMessage as encodeQueueMessage, index$5_endStage as endStage, index$5_finalizeObservation as finalizeObservation, index$5_hashObservation as hashObservation, index$6 as observation, index$5_parseAutoClaimEntries as parseAutoClaimEntries, index$5_parseStreamEntries as parseStreamEntries, index$5_recordSensor as recordSensor, index$5_stableJsonStringify as stableJsonStringify, index$5_startStage as startStage, index$5_verifyResponse as verifyResponse };
1972
2530
  }
1973
- type RevocationTargetType = 'grant' | 'presence' | 'softid';
1974
- interface Revocation {
1975
- revocation_id: string;
1976
- target_type: RevocationTargetType;
1977
- target_id: string;
1978
- issuer_softid: string;
1979
- reason?: string;
1980
- effective_at: number;
1981
- sig_value: string;
1982
- }
1983
- interface LoomValidationResult {
1984
- valid: boolean;
1985
- error?: string;
1986
- code?: string;
1987
- }
1988
- interface PresenceVerifyResult extends LoomValidationResult {
1989
- presence?: PresenceReceipt;
1990
- }
1991
- interface WritValidationResult extends LoomValidationResult {
1992
- writ?: Writ;
1993
- gate_failed?: 'temporal' | 'causal' | 'legal' | 'authentic';
1994
- }
1995
- interface GrantValidationResult extends LoomValidationResult {
1996
- grant?: Grant;
1997
- }
1998
-
1999
- declare function deriveAnchorReflection(softid: string, context?: string, scope?: string): string;
2000
- declare function canonicalizeWrit(writ: Omit<Writ, 'sig'>): string;
2001
- declare function canonicalizeGrant(grant: Omit<Grant, 'sig'>): string;
2002
2531
 
2003
2532
  type index$4_Grant = Grant;
2004
2533
  type index$4_GrantCapability = GrantCapability;
@@ -2368,12 +2897,9 @@ declare namespace index$1 {
2368
2897
  export { index$1_AccessProfileResolverSensor as AccessProfileResolverSensor, index$1_BodyBudgetSensor as BodyBudgetSensor, index$1_CapabilityEnforcementSensor as CapabilityEnforcementSensor, index$1_ChunkHashSensor as ChunkHashSensor, index$1_EntropySensor as EntropySensor, index$1_ExecutionTimeoutSensor as ExecutionTimeoutSensor, index$1_FrameBudgetSensor as FrameBudgetSensor, index$1_FrameHeaderSanitySensor as FrameHeaderSanitySensor, index$1_HeaderTLVLimitSensor as HeaderTLVLimitSensor, index$1_IntentAllowlistSensor as IntentAllowlistSensor, index$1_IntentRegistrySensor as IntentRegistrySensor, index$1_ProofPresenceSensor as ProofPresenceSensor, index$1_ProtocolStrictSensor as ProtocolStrictSensor, index$1_ReceiptPolicySensor as ReceiptPolicySensor, index$1_SchemaValidationSensor as SchemaValidationSensor, index$1_StreamScopeSensor as StreamScopeSensor, index$1_TLVParseSensor as TLVParseSensor, index$1_VarintHardeningSensor as VarintHardeningSensor };
2369
2898
  }
2370
2899
 
2371
- type AxisTlvDtoCtor<T = object> = new (...args: never[]) => T;
2372
- declare function encodeAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>): Uint8Array;
2373
-
2374
2900
  declare const index_encodeAxisTlvDto: typeof encodeAxisTlvDto;
2375
2901
  declare namespace index {
2376
2902
  export { index_encodeAxisTlvDto as encodeAxisTlvDto };
2377
2903
  }
2378
2904
 
2379
- export { ATS1_HDR, ATS1_SCHEMA, AXIS_OPCODES, AXIS_UPLOAD_FILE_STORE, AXIS_UPLOAD_RECEIPT_SIGNER, AXIS_UPLOAD_SESSION_STORE, ats1 as Ats1Codec, type Axis1DecodedFrame, type Axis1FrameToEncode, type AxisAlg$1 as AxisAlg, type AxisPacket as AxisBinaryPacket, type AxisCapsule, type AxisCapsuleConstraints, type AxisCapsulePayload, AxisContext$1 as AxisContext, type AxisCrudHandler, type AxisDecoded, AxisDemoPubkey, type AxisEffect, AxisFilesDownloadHandler, AxisFilesFinalizeHandler, AxisFrame$2 as AxisFrame, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIp, type AxisAlg as AxisJsonAlg, type AxisFrame$1 as AxisJsonFrame, type AxisResponse as AxisJsonResponse, type AxisSig as AxisJsonSig, type AxisObservation, type AxisObservedContext, type AxisPacket$1 as AxisPacket, T as AxisPacketTags, AxisPartialType, type AxisPostSensor, type AxisPreSensor, AxisRaw, type AxisRequestContext, type AxisRequestData, AxisResponseDto, type AxisSensor, AxisSensorChainService, type AxisSensorInit, type AxisSig$1 as AxisSig, AxisTlvDto, BAND, CAPABILITIES, type Capability, type CapsuleMode, type ChainResult, ContractViolationError, DEFAULT_CONTRACTS, DEFAULT_TIMEOUT, Decision, DiskUploadFileStore, type DtoSchema, type ExecutionContract, ExecutionMeter, type ExecutionMetrics, FALLBACK_CONTRACT, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, HandlerDiscoveryService, HandlerSensors, INTENT_BODY_KEY, INTENT_METADATA_KEY, INTENT_REQUIREMENTS, INTENT_ROUTES_KEY, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, Intent, IntentBody, type IntentDefinition, type IntentKind, type IntentOptions, type IntentRoute, IntentRouter, IntentSensitivity, IntentSensors, type IntentTlvField, type KeyStatus, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationSensor, type ObservationStage, type ObservationStreamEntry, type ObservationWitnessSummary, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, type ResponseContract, type ResponseObserverContext, RiskDecision, type RiskEvaluation, type RiskSignal, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, type SensorDecision, SensorDecisions, SensorDiscoveryService, type SensorInput, type SensorMinifiedDecision, type SensorOptions, type SensorPhase, type SensorPhaseMetadata, SensorRegistry, TLV_FIELDS_KEY, TLV_VALIDATORS_KEY, TlvEnum, TlvField, type TlvFieldKind, type TlvFieldMeta, type TlvFieldOptions, TlvMinLen, TlvRange, TlvUtf8Pattern, TlvValidate, type TlvValidatorFn, type TlvValidatorMeta, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, axis1SigningBytes, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeObservation, classifyIntent, createObservation, index$8 as crypto, decodeAxis1Frame, decodeQueueMessage, index$7 as decorators, encVarint, encodeAxis1Frame, encodeQueueMessage, endStage, index$5 as engine, extractDtoSchema, finalizeObservation, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isTimestampValid, index$4 as loom, nonce16, normalizeSensorDecision, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, recordSensor, resolveTimeout, index$3 as schemas, index$2 as security, sensitivityName, index$1 as sensors, stableJsonStringify, startStage, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, utf8, index as utils, validateFrameShape, varintU, verifyResponse };
2905
+ export { ATS1_HDR, ATS1_SCHEMA, AXIS_OPCODES, AXIS_UPLOAD_FILE_STORE, AXIS_UPLOAD_RECEIPT_SIGNER, AXIS_UPLOAD_SESSION_STORE, ats1 as Ats1Codec, type Axis1DecodedFrame, type Axis1FrameToEncode, type AxisAlg$1 as AxisAlg, type AxisPacket as AxisBinaryPacket, type AxisCapsule, type AxisCapsuleConstraints, type AxisCapsulePayload, AxisContext$1 as AxisContext, type AxisCrudHandler, type AxisDecoded, AxisDemoPubkey, type AxisEffect, AxisFilesDownloadHandler, AxisFilesFinalizeHandler, AxisFrame$2 as AxisFrame, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIp, type AxisAlg as AxisJsonAlg, type AxisFrame$1 as AxisJsonFrame, type AxisResponse as AxisJsonResponse, type AxisSig as AxisJsonSig, type AxisObservation, type AxisObservedContext, type AxisPacket$1 as AxisPacket, T as AxisPacketTags, AxisPartialType, type AxisPostSensor, type AxisPreSensor, AxisRaw, type AxisRequestContext, type AxisRequestData, AxisResponseDto, type AxisSensor, AxisSensorChainService, type AxisSensorInit, type AxisSig$1 as AxisSig, AxisTlvDto, BAND, CAPABILITIES, CCE_ERROR, CCE_PROTOCOL_VERSION, type Capability, type CapsuleMode, type CceCapsuleClaims as CceCapsuleClaimsType, CceError, type CceExecutionContext as CceExecutionContextType, type CceHandler, type CceHandlerContext, type CceHandlerResult, type CcePipelineConfig, type CcePipelineResult, type CceRequestEnvelope as CceRequestEnvelopeType, type CceResponseEnvelope as CceResponseEnvelopeType, type CceWitnessRecord as CceWitnessRecordType, type ChainResult, ContractViolationError, DEFAULT_CONTRACTS, DEFAULT_TIMEOUT, Decision, DiskUploadFileStore, type DtoSchema, type ExecutionContract, ExecutionMeter, type ExecutionMetrics, FALLBACK_CONTRACT, type Grant, type GrantCapability, type GrantMeta, type GrantStatus, type GrantType, type GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, HandlerDiscoveryService, HandlerSensors, INTENT_BODY_KEY, INTENT_METADATA_KEY, INTENT_REQUIREMENTS, INTENT_ROUTES_KEY, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, Intent, IntentBody, type IntentDefinition, type IntentKind, type IntentOptions, type IntentRoute, IntentRouter, IntentSensitivity, IntentSensors, type IntentTlvField, type KeyStatus, type LoomReceipt, type LoomValidationResult, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationSensor, type ObservationStage, type ObservationStreamEntry, type ObservationWitnessSummary, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, type PresenceChallenge, type PresenceDeclaration, type PresenceProof, type PresenceReceipt, type PresenceStatus, type PresenceVerifyResult, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, type ResponseContract, verifyResponse as ResponseObserver, type ResponseObserverContext, type Revocation, type RevocationTargetType, RiskDecision, type RiskEvaluation, type RiskSignal, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, type SensorDecision, SensorDecisions, SensorDiscoveryService, type SensorInput, type SensorMinifiedDecision, type SensorOptions, type SensorPhase, type SensorPhaseMetadata, SensorRegistry, TLV_FIELDS_KEY, TLV_VALIDATORS_KEY, type ThreadState, TlvEnum, TlvField, type TlvFieldKind, type TlvFieldMeta, type TlvFieldOptions, TlvMinLen, TlvRange, TlvUtf8Pattern, TlvValidate, type TlvValidatorFn, type TlvValidatorMeta, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, type Writ, type WritBody, type WritHead, type WritMeta, type WritSignature, type WritValidationResult, axis1SigningBytes, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeGrant, canonicalizeObservation, canonicalizeWrit, index$9 as cce, classifyIntent, createObservation, index$8 as crypto, decodeAxis1Frame, decodeQueueMessage, index$7 as decorators, deriveAnchorReflection, encVarint, encodeAxis1Frame, encodeAxisTlvDto, encodeQueueMessage, endStage, index$5 as engine, executeCcePipeline, extractDtoSchema, finalizeObservation, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isTimestampValid, index$4 as loom, nonce16, normalizeSensorDecision, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, recordSensor, resolveTimeout, index$3 as schemas, index$2 as security, sensitivityName, index$1 as sensors, stableJsonStringify, startStage, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, utf8, index as utils, validateFrameShape, varintU, verifyResponse };