@nextera.one/axis-server-sdk 2.2.1 → 2.2.2

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.
Files changed (49) hide show
  1. package/dist/axis-sensor-GBEI3Fab.d.mts +209 -0
  2. package/dist/axis-sensor-GBEI3Fab.d.ts +209 -0
  3. package/dist/cce/index.d.mts +162 -0
  4. package/dist/cce/index.d.ts +162 -0
  5. package/dist/cce/index.js +1502 -0
  6. package/dist/cce/index.js.map +1 -0
  7. package/dist/cce/index.mjs +1442 -0
  8. package/dist/cce/index.mjs.map +1 -0
  9. package/dist/cce-pipeline-B-zUBHo3.d.mts +294 -0
  10. package/dist/cce-pipeline-DbGBSsCG.d.ts +294 -0
  11. package/dist/idel/index.d.mts +24 -0
  12. package/dist/idel/index.d.ts +24 -0
  13. package/dist/idel/index.js +306 -0
  14. package/dist/idel/index.js.map +1 -0
  15. package/dist/idel/index.mjs +279 -0
  16. package/dist/idel/index.mjs.map +1 -0
  17. package/dist/idel.types-DuUAcOnQ.d.mts +83 -0
  18. package/dist/idel.types-DuUAcOnQ.d.ts +83 -0
  19. package/dist/index-B2G6cbRL.d.mts +824 -0
  20. package/dist/index-DbSxdR0f.d.ts +824 -0
  21. package/dist/index-_S4fmVUJ.d.mts +501 -0
  22. package/dist/index-l3Hhirqb.d.ts +501 -0
  23. package/dist/index.d.mts +91 -1891
  24. package/dist/index.d.ts +91 -1891
  25. package/dist/index.js +9339 -5123
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +10326 -5816
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/needle/index.d.mts +4 -0
  30. package/dist/needle/index.d.ts +4 -0
  31. package/dist/needle/index.js +3499 -0
  32. package/dist/needle/index.js.map +1 -0
  33. package/dist/needle/index.mjs +3528 -0
  34. package/dist/needle/index.mjs.map +1 -0
  35. package/dist/sensors/index.d.mts +5 -0
  36. package/dist/sensors/index.d.ts +5 -0
  37. package/dist/sensors/index.js +12860 -0
  38. package/dist/sensors/index.js.map +1 -0
  39. package/dist/sensors/index.mjs +12928 -0
  40. package/dist/sensors/index.mjs.map +1 -0
  41. package/dist/timeline/index.d.mts +54 -0
  42. package/dist/timeline/index.d.ts +54 -0
  43. package/dist/timeline/index.js +389 -0
  44. package/dist/timeline/index.js.map +1 -0
  45. package/dist/timeline/index.mjs +362 -0
  46. package/dist/timeline/index.mjs.map +1 -0
  47. package/dist/timeline.types-Cn0aqbUj.d.mts +125 -0
  48. package/dist/timeline.types-Cn0aqbUj.d.ts +125 -0
  49. package/package.json +28 -10
@@ -0,0 +1,824 @@
1
+ import { A as AxisSensor, m as AxisPreSensor, l as AxisPostSensor, S as SensorInput, a as SensorDecision } from './axis-sensor-GBEI3Fab.js';
2
+ import { x as CcePipelineConfig, s as CceHandler, b as CceRequestEnvelope, y as CcePipelineResult } from './cce-pipeline-DbGBSsCG.js';
3
+ import { AxisFrame } from '@nextera.one/axis-protocol';
4
+ import * as z from 'zod';
5
+
6
+ type AxisExecutionMode = 'strict' | 'parallel' | 'best_effort' | 'atomic';
7
+ type AxisObserverEvent = 'intent.received' | 'intent.completed' | 'intent.failed' | 'chain.received' | 'chain.admitted' | 'chain.completed' | 'chain.failed' | 'chain.partial' | 'step.started' | 'step.completed' | 'step.failed' | 'step.blocked' | 'step.skipped' | 'signature.verified' | 'decryption.succeeded' | 'sensor.passed' | 'sensor.failed' | 'handler.completed' | 'proof.recorded';
8
+ interface AxisCapsuleRef {
9
+ capsuleId?: string;
10
+ scope?: string | string[];
11
+ scopeMode?: 'chain' | 'step' | 'chain+step';
12
+ proofRequired?: boolean;
13
+ metadata?: Record<string, unknown>;
14
+ }
15
+ interface AxisKeyExchangeRef {
16
+ profile?: string;
17
+ sessionId?: string;
18
+ clientKid?: string;
19
+ serverKid?: string;
20
+ algorithm?: string;
21
+ derivedKeyRef?: string;
22
+ required?: boolean;
23
+ metadata?: Record<string, unknown>;
24
+ }
25
+ interface AxisIntentEnvelope<TPayload = unknown> {
26
+ intent: string;
27
+ handler?: string;
28
+ payload: TPayload;
29
+ capsule?: AxisCapsuleRef;
30
+ keyExchange?: AxisKeyExchangeRef;
31
+ observerTags?: string[];
32
+ proofRequired?: boolean;
33
+ metadata?: Record<string, unknown>;
34
+ }
35
+ interface AxisChainStep<TInput = unknown> {
36
+ stepId: string;
37
+ intent: string;
38
+ handler?: string;
39
+ input?: TInput;
40
+ dependsOn?: string[];
41
+ onSuccess?: string[];
42
+ onFailure?: string[];
43
+ capsuleScope?: string | string[];
44
+ observerTags?: string[];
45
+ proofRequired?: boolean;
46
+ keyExchange?: AxisKeyExchangeRef;
47
+ metadata?: Record<string, unknown>;
48
+ }
49
+ interface AxisChainEncryption {
50
+ enabled?: boolean;
51
+ profile?: string;
52
+ keyExchange?: AxisKeyExchangeRef;
53
+ }
54
+ interface AxisChainEnvelope<TInput = unknown> {
55
+ chainId: string;
56
+ subject?: string;
57
+ issuer?: string;
58
+ issuedAtTps?: string | number;
59
+ expiresAtTps?: string | number;
60
+ mode: AxisExecutionMode;
61
+ signature?: string;
62
+ encryption?: AxisChainEncryption;
63
+ capsule?: AxisCapsuleRef;
64
+ keyExchange?: AxisKeyExchangeRef;
65
+ observerTags?: string[];
66
+ dynamic?: boolean;
67
+ metadata?: Record<string, unknown>;
68
+ steps: Array<AxisChainStep<TInput>>;
69
+ }
70
+ interface AxisChainRequest<TInput = unknown, TCapsule = Record<string, unknown>> {
71
+ envelope: AxisChainEnvelope<TInput>;
72
+ capsule?: TCapsule;
73
+ actorId?: string;
74
+ }
75
+ type AxisChainStepStatus = 'SUCCEEDED' | 'FAILED' | 'BLOCKED' | 'SKIPPED';
76
+ interface AxisChainStepResult<TOutput = unknown> {
77
+ stepId: string;
78
+ intent: string;
79
+ status: AxisChainStepStatus;
80
+ effect?: string;
81
+ output?: TOutput;
82
+ error?: string;
83
+ dependsOn?: string[];
84
+ startedAt: number;
85
+ finishedAt: number;
86
+ proofHash?: string;
87
+ observerTags?: string[];
88
+ metadata?: Record<string, unknown>;
89
+ }
90
+ type AxisChainStatus = 'SUCCEEDED' | 'FAILED' | 'PARTIAL';
91
+ interface AxisChainResult<TOutput = unknown> {
92
+ chainId: string;
93
+ mode: AxisExecutionMode;
94
+ status: AxisChainStatus;
95
+ completedSteps: number;
96
+ failedSteps: number;
97
+ blockedSteps: number;
98
+ skippedSteps: number;
99
+ startedAt: number;
100
+ finishedAt: number;
101
+ results: Array<AxisChainStepResult<TOutput>>;
102
+ rollback?: {
103
+ supported: boolean;
104
+ attempted: boolean;
105
+ reason?: string;
106
+ };
107
+ metadata?: Record<string, unknown>;
108
+ }
109
+ interface ChainOptions {
110
+ mode?: AxisExecutionMode;
111
+ allowPartial?: boolean;
112
+ dynamic?: boolean;
113
+ proofRequired?: boolean;
114
+ capsuleScope?: string | string[];
115
+ observerTags?: string[];
116
+ keyExchangeRequired?: boolean;
117
+ }
118
+ interface RegisteredChainConfig extends ChainOptions {
119
+ enabled: boolean;
120
+ }
121
+
122
+ declare const CAPSULE_POLICY_METADATA_KEY = "axis:capsule:policy";
123
+ type CapsuleScopeMode = "all" | "any";
124
+ interface CapsulePolicyOptions {
125
+ required?: boolean;
126
+ scopes?: string | string[];
127
+ scopeMode?: CapsuleScopeMode;
128
+ intentBound?: boolean;
129
+ allowCapsuleRef?: boolean;
130
+ }
131
+ declare function CapsulePolicy(options?: CapsulePolicyOptions): ClassDecorator & MethodDecorator;
132
+
133
+ interface ExecutionContract {
134
+ maxDbWrites: number;
135
+ maxDbReads?: number;
136
+ maxExternalCalls: number;
137
+ maxTimeMs: number;
138
+ allowedEffects: string[];
139
+ maxMemoryMb?: number;
140
+ }
141
+ declare const DEFAULT_CONTRACTS: Record<string, ExecutionContract>;
142
+ declare const FALLBACK_CONTRACT: ExecutionContract;
143
+
144
+ declare const ProofKindZ: z.ZodEnum<{
145
+ NONE: "NONE";
146
+ CAPSULE: "CAPSULE";
147
+ PASSPORT: "PASSPORT";
148
+ MTLS: "MTLS";
149
+ JWT: "JWT";
150
+ }>;
151
+ type ProofKind = z.infer<typeof ProofKindZ>;
152
+ declare const ProofPresenceInputZ: z.ZodObject<{
153
+ profile: z.ZodEnum<{
154
+ PUBLIC: "PUBLIC";
155
+ PARTNER: "PARTNER";
156
+ INTERNAL: "INTERNAL";
157
+ NODE: "NODE";
158
+ }>;
159
+ visibility: z.ZodEnum<{
160
+ PUBLIC: "PUBLIC";
161
+ GUARDED: "GUARDED";
162
+ }>;
163
+ requiredProof: z.ZodArray<z.ZodEnum<{
164
+ NONE: "NONE";
165
+ CAPSULE: "CAPSULE";
166
+ PASSPORT: "PASSPORT";
167
+ MTLS: "MTLS";
168
+ JWT: "JWT";
169
+ }>>;
170
+ hasCapsule: z.ZodBoolean;
171
+ hasPassportSignature: z.ZodBoolean;
172
+ intent: z.ZodString;
173
+ }, z.z.core.$strip>;
174
+ type ProofPresenceInput = z.infer<typeof ProofPresenceInputZ>;
175
+ declare const SensitivityLevelZ: z.ZodEnum<{
176
+ LOW: "LOW";
177
+ MEDIUM: "MEDIUM";
178
+ HIGH: "HIGH";
179
+ CRITICAL: "CRITICAL";
180
+ }>;
181
+ type SensitivityLevel = z.infer<typeof SensitivityLevelZ>;
182
+ declare enum ProofType {
183
+ CAPSULE = 1,
184
+ JWT = 2,
185
+ MTLS_ID = 3,
186
+ DEVICE_SE = 4,
187
+ WITNESS_SIG = 5
188
+ }
189
+ declare const AxisContextZ: z.ZodObject<{
190
+ pid: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
191
+ ts: z.ZodBigInt;
192
+ intent: z.ZodString;
193
+ actorId: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
194
+ proofType: z.ZodEnum<typeof ProofType>;
195
+ proofRef: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
196
+ nonce: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
197
+ ip: z.ZodString;
198
+ nodeCertHash: z.ZodOptional<z.ZodString>;
199
+ capsule: z.ZodOptional<z.ZodObject<{
200
+ id: z.ZodString;
201
+ claims: z.ZodObject<{
202
+ capsuleId: z.ZodString;
203
+ allowIntents: z.ZodArray<z.ZodString>;
204
+ limits: z.ZodOptional<z.ZodObject<{
205
+ maxBodyBytes: z.ZodOptional<z.ZodNumber>;
206
+ }, z.z.core.$strip>>;
207
+ scopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
208
+ }, z.z.core.$strip>;
209
+ issuedAt: z.ZodNumber;
210
+ expiresAt: z.ZodNumber;
211
+ tier: z.ZodEnum<{
212
+ FREE: "FREE";
213
+ STANDARD: "STANDARD";
214
+ PREMIUM: "PREMIUM";
215
+ }>;
216
+ }, z.z.core.$strip>>;
217
+ passport: z.ZodOptional<z.ZodObject<{
218
+ id: z.ZodString;
219
+ public_key: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
220
+ status: z.ZodEnum<{
221
+ ACTIVE: "ACTIVE";
222
+ REVOKED: "REVOKED";
223
+ EXPIRED: "EXPIRED";
224
+ PENDING: "PENDING";
225
+ }>;
226
+ issuedAt: z.ZodNumber;
227
+ expiresAt: z.ZodOptional<z.ZodNumber>;
228
+ }, z.z.core.$strip>>;
229
+ meter: z.ZodOptional<z.ZodAny>;
230
+ }, z.z.core.$strip>;
231
+ type AxisContext = z.infer<typeof AxisContextZ>;
232
+
233
+ declare const AXIS_META_KEY = "axis:axis";
234
+ declare const SENSITIVITY_METADATA_KEY = "axis:sensitivity";
235
+ declare const CONTRACT_METADATA_KEY = "axis:contract";
236
+ declare const REQUIRED_PROOF_METADATA_KEY = "axis:required_proof";
237
+ type RequiredProofKind = ProofKind | "WITNESS";
238
+ declare function Sensitivity(level: SensitivityLevel): ClassDecorator & MethodDecorator;
239
+ declare function Contract(options: Partial<ExecutionContract>): ClassDecorator & MethodDecorator;
240
+ declare function RequiredProof(proofs: [RequiredProofKind, ...RequiredProofKind[]]): ClassDecorator & MethodDecorator;
241
+ declare function Capsule(): ClassDecorator & MethodDecorator;
242
+ declare function Witness(): ClassDecorator & MethodDecorator;
243
+ declare function Axis(): ClassDecorator;
244
+ declare const AXIS_PUBLIC_KEY = "axis:public";
245
+ declare function AxisPublic(): ClassDecorator & MethodDecorator;
246
+ declare const AXIS_ANONYMOUS_KEY = "axis:anonymous";
247
+ declare function AxisAnonymous(): ClassDecorator & MethodDecorator;
248
+ declare const AXIS_RATE_LIMIT_KEY = "axis:rateLimit";
249
+ interface AxisRateLimitConfig {
250
+ max: number;
251
+ windowSec: number;
252
+ key?: string;
253
+ }
254
+ declare function AxisRateLimit(config: AxisRateLimitConfig): MethodDecorator;
255
+
256
+ declare const INTENT_METADATA_KEY = "axis:intent";
257
+ declare const INTENT_ROUTES_KEY = "axis:intent_routes";
258
+ type IntentKind = "create" | "read" | "update" | "delete" | "action";
259
+ type AxisIntentSensorRef = string | Function;
260
+ interface AxisIntentSensorOptions {
261
+ is?: AxisIntentSensorRef[];
262
+ }
263
+ interface IntentTlvField {
264
+ name: string;
265
+ tag: number;
266
+ kind: "utf8" | "u64" | "bytes" | "bytes16" | "bool" | "obj" | "arr";
267
+ required?: boolean;
268
+ maxLen?: number;
269
+ max?: string;
270
+ scope?: "header" | "body";
271
+ }
272
+ interface IntentRoute extends AxisIntentSensorOptions {
273
+ action: string;
274
+ methodName: string | symbol;
275
+ absolute?: boolean;
276
+ frame?: boolean;
277
+ kind?: IntentKind;
278
+ sensitivity?: SensitivityLevel;
279
+ chain?: boolean | ChainOptions;
280
+ bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
281
+ tlv?: IntentTlvField[];
282
+ dto?: Function;
283
+ }
284
+ interface IntentOptions extends AxisIntentSensorOptions {
285
+ kind?: IntentKind;
286
+ sensitivity?: SensitivityLevel;
287
+ absolute?: boolean;
288
+ frame?: boolean;
289
+ chain?: boolean | ChainOptions;
290
+ bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
291
+ tlv?: IntentTlvField[];
292
+ dto?: Function;
293
+ decoder?: (buf: Buffer) => any;
294
+ }
295
+ declare function Intent(action: string, options?: IntentOptions): MethodDecorator;
296
+
297
+ declare const OBSERVER_METADATA_KEY = "axis:observer";
298
+ declare const OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
299
+ type AxisObserverRef = string | Function;
300
+ interface AxisObserverDefinition {
301
+ name?: string;
302
+ tags?: string[];
303
+ events?: AxisObserverEvent[];
304
+ intents?: string[];
305
+ handlers?: string[];
306
+ }
307
+ interface AxisObserverBinding {
308
+ refs: AxisObserverRef[];
309
+ tags?: string[];
310
+ events?: AxisObserverEvent[];
311
+ }
312
+ interface AxisObserverBindingOptions {
313
+ use: AxisObserverRef | AxisObserverRef[];
314
+ tags?: string[];
315
+ events?: AxisObserverEvent[];
316
+ }
317
+ declare function Observer(input?: AxisObserverDefinition | AxisObserverBindingOptions | AxisObserverRef | AxisObserverRef[]): ClassDecorator & MethodDecorator;
318
+
319
+ declare const TLV_FIELDS_KEY = "axis:tlv:fields";
320
+ declare const TLV_VALIDATORS_KEY = "axis:tlv:validators";
321
+ type TlvFieldKind = 'utf8' | 'u64' | 'bytes' | 'bytes16' | 'bool' | 'obj' | 'arr';
322
+ interface TlvFieldOptions {
323
+ kind: TlvFieldKind;
324
+ required?: boolean;
325
+ maxLen?: number;
326
+ max?: string;
327
+ scope?: 'header' | 'body';
328
+ }
329
+ interface TlvFieldMeta {
330
+ property: string;
331
+ tag: number;
332
+ options: TlvFieldOptions;
333
+ }
334
+ type TlvValidatorFn = (value: Uint8Array, property: string) => string | null | undefined;
335
+ interface TlvValidatorMeta {
336
+ property: string;
337
+ tag: number;
338
+ validators: TlvValidatorFn[];
339
+ }
340
+ declare function TlvField(tag: number, options: TlvFieldOptions): PropertyDecorator;
341
+ declare function TlvValidate(validator: TlvValidatorFn): PropertyDecorator;
342
+ declare function TlvUtf8Pattern(pattern: RegExp, message?: string): PropertyDecorator;
343
+ declare function TlvMinLen(min: number, message?: string): PropertyDecorator;
344
+ declare function TlvEnum(allowed: string[], message?: string): PropertyDecorator;
345
+ declare function TlvRange(min: bigint, max: bigint, message?: string): PropertyDecorator;
346
+
347
+ interface AxisDependencyResolver {
348
+ resolve<T = unknown>(token: string | Function): T | undefined;
349
+ }
350
+
351
+ interface AxisConfigReader {
352
+ get<T = string>(key: string): T | undefined;
353
+ }
354
+ declare class SensorRegistry {
355
+ private readonly configService?;
356
+ private sensors;
357
+ private sensorsByName;
358
+ private sensorsByType;
359
+ private readonly logger;
360
+ constructor(configService?: AxisConfigReader | undefined);
361
+ register(sensor: AxisSensor): void;
362
+ list(): AxisSensor[];
363
+ resolve(ref: AxisIntentSensorRef): AxisSensor | undefined;
364
+ getByName(name: string): AxisSensor | undefined;
365
+ getPreDecodeSensors(): AxisPreSensor[];
366
+ getPostDecodeSensors(): AxisPostSensor[];
367
+ getSensorCountByPhase(): {
368
+ preDecodeCount: number;
369
+ postDecodeCount: number;
370
+ };
371
+ clear(): void;
372
+ private isPreDecodeSensor;
373
+ private isPostDecodeSensor;
374
+ private indexSensor;
375
+ }
376
+
377
+ interface IntentSchema {
378
+ intent: string;
379
+ version: number;
380
+ bodyProfile: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
381
+ fields: Array<{
382
+ name: string;
383
+ tlv: number;
384
+ kind: IntentTlvField["kind"];
385
+ required?: boolean;
386
+ maxLen?: number;
387
+ max?: string;
388
+ scope?: "header" | "body";
389
+ }>;
390
+ }
391
+ interface AxisEffect {
392
+ ok: boolean;
393
+ effect: string;
394
+ body?: Uint8Array;
395
+ headers?: Map<number, Uint8Array>;
396
+ metadata?: any;
397
+ }
398
+ declare class IntentRouter {
399
+ private readonly logger;
400
+ private readonly decoder;
401
+ private readonly encoder;
402
+ private readonly dependencyResolver?;
403
+ private readonly observerDispatcher?;
404
+ private readonly sensorRegistry?;
405
+ private static readonly BUILTIN_INTENTS;
406
+ private handlers;
407
+ private intentSensors;
408
+ private intentDecoders;
409
+ private intentSchemas;
410
+ private intentValidators;
411
+ private intentKinds;
412
+ private intentChains;
413
+ private intentObservers;
414
+ private intentCapsulePolicies;
415
+ private intentSensitivity;
416
+ private intentContracts;
417
+ private intentRequiredProof;
418
+ private publicIntents;
419
+ private anonymousIntents;
420
+ private intentRateLimits;
421
+ private cceHandlers;
422
+ private ccePipelineConfig;
423
+ constructor(dependencyResolver?: AxisDependencyResolver, observerDispatcher?: ObserverDispatcherService, sensorRegistry?: SensorRegistry);
424
+ getSchema(intent: string): IntentSchema | undefined;
425
+ getValidators(intent: string): Map<number, TlvValidatorFn[]> | undefined;
426
+ has(intent: string): boolean;
427
+ getRegisteredIntents(): string[];
428
+ getIntentEntry(intent: string): {
429
+ schema?: IntentSchema;
430
+ validators?: Map<number, TlvValidatorFn[]>;
431
+ hasSensors: boolean;
432
+ builtin: boolean;
433
+ kind?: IntentKind;
434
+ chain?: RegisteredChainConfig;
435
+ capsulePolicy?: CapsulePolicyOptions;
436
+ observerCount: number;
437
+ } | null;
438
+ getChainConfig(intent: string): RegisteredChainConfig | undefined;
439
+ getObservers(intent: string): AxisObserverBinding[];
440
+ register(intent: string, handler: any): void;
441
+ registerHandler(instance: any): void;
442
+ route(frame: AxisFrame): Promise<AxisEffect>;
443
+ private logIntent;
444
+ registerIntentMeta(intent: string, proto: object, methodName: string, handlerSensors?: AxisIntentSensorRef[], handlerObservers?: AxisObserverBinding[]): void;
445
+ getSensitivity(intent: string): SensitivityLevel | undefined;
446
+ getContract(intent: string): Record<string, any> | undefined;
447
+ getRequiredProof(intent: string): RequiredProofKind[] | undefined;
448
+ isPublic(intent: string): boolean;
449
+ isAnonymous(intent: string): boolean;
450
+ getRateLimit(intent: string): AxisRateLimitConfig | undefined;
451
+ private emitIntentObservers;
452
+ private runIntentSensors;
453
+ private resolveIntentSensor;
454
+ private getEffectiveCapsulePolicy;
455
+ private enforceCapsulePolicy;
456
+ private executeChainRequest;
457
+ private parseIntentExecBody;
458
+ private parseChainRequestBody;
459
+ private isChainRequestLike;
460
+ private isChainEnvelopeLike;
461
+ private encodeJson;
462
+ private getActorIdFromFrame;
463
+ private getProofRefFromFrame;
464
+ private hasCapsuleReference;
465
+ private getHeaderValue;
466
+ private identifiersMatch;
467
+ private extractInlineCapsuleId;
468
+ private toInlineCapsuleRecord;
469
+ private toScopeList;
470
+ configureCce(config: Omit<CcePipelineConfig, "handlers">): void;
471
+ registerCceHandler(intent: string, handler: CceHandler): void;
472
+ hasCceHandler(intent: string): boolean;
473
+ routeCce(envelope: CceRequestEnvelope): Promise<CcePipelineResult>;
474
+ private storeSchema;
475
+ }
476
+
477
+ interface AxisObserverContext {
478
+ event: AxisObserverEvent;
479
+ timestamp: number;
480
+ intent?: string;
481
+ chainId?: string;
482
+ stepId?: string;
483
+ handler?: string;
484
+ frame?: AxisFrame;
485
+ envelope?: AxisChainEnvelope;
486
+ step?: AxisChainStep;
487
+ effect?: AxisEffect;
488
+ result?: AxisChainStepResult | AxisChainResult;
489
+ error?: string;
490
+ observerTags?: string[];
491
+ capsule?: AxisCapsuleRef;
492
+ keyExchange?: AxisKeyExchangeRef;
493
+ metadata?: Record<string, unknown>;
494
+ }
495
+ interface AxisIntentObserver {
496
+ readonly name: string;
497
+ supports?(context: AxisObserverContext): boolean;
498
+ observe(context: AxisObserverContext): Promise<void> | void;
499
+ }
500
+ interface AxisObserverRegistration {
501
+ name: string;
502
+ instance: AxisIntentObserver;
503
+ tags: string[];
504
+ events?: AxisObserverEvent[];
505
+ intents?: string[];
506
+ handlers?: string[];
507
+ }
508
+
509
+ declare class ObserverRegistry {
510
+ private readonly logger;
511
+ private readonly byName;
512
+ private readonly byType;
513
+ register(instance: AxisIntentObserver, meta?: AxisObserverDefinition): void;
514
+ resolve(ref: AxisObserverRef): AxisObserverRegistration | undefined;
515
+ list(): AxisObserverRegistration[];
516
+ clear(): void;
517
+ }
518
+
519
+ declare class ObserverDispatcherService {
520
+ private readonly registry;
521
+ private readonly logger;
522
+ constructor(registry: ObserverRegistry);
523
+ dispatch(bindings: AxisObserverBinding[] | undefined, context: AxisObserverContext): Promise<void>;
524
+ }
525
+
526
+ type AxisLawDecision = "allow" | "deny" | "conditional";
527
+ interface AxisLawArticleSummary {
528
+ article_id: string;
529
+ article_type?: string;
530
+ decision?: string;
531
+ reason?: string;
532
+ }
533
+ interface AxisLawEvaluationContext {
534
+ actorId?: string;
535
+ intent?: string;
536
+ audience?: string;
537
+ tps?: string | number;
538
+ country?: string;
539
+ ip?: string;
540
+ path?: string;
541
+ clientId?: string;
542
+ deviceId?: string;
543
+ sessionId?: string;
544
+ capsuleId?: string;
545
+ metadata: Record<string, unknown>;
546
+ packet?: Record<string, unknown>;
547
+ frameBody?: unknown;
548
+ }
549
+ interface AxisLawEvaluationResult {
550
+ decision: AxisLawDecision;
551
+ reason: string;
552
+ explanation?: string;
553
+ denied?: AxisLawArticleSummary[];
554
+ permitted?: AxisLawArticleSummary[];
555
+ required?: AxisLawArticleSummary[];
556
+ applicable?: AxisLawArticleSummary[];
557
+ metadata?: Record<string, unknown>;
558
+ }
559
+ type AxisLawEvaluator = ((context: AxisLawEvaluationContext) => AxisLawEvaluationResult | Promise<AxisLawEvaluationResult>);
560
+ interface LawEvaluationSensorOptions {
561
+ evaluator?: AxisLawEvaluator;
562
+ conditionalDecision?: "deny" | "flag" | "allow";
563
+ }
564
+ declare function buildAxisLawEvaluationContext(input: SensorInput): AxisLawEvaluationContext;
565
+
566
+ interface RiskSignal {
567
+ type: string;
568
+ severity: 'low' | 'medium' | 'high' | 'critical';
569
+ value: any;
570
+ message: string;
571
+ }
572
+ declare enum RiskDecision {
573
+ ALLOW = "ALLOW",
574
+ THROTTLE = "THROTTLE",
575
+ STEP_UP = "STEP_UP",
576
+ WITNESS = "WITNESS",
577
+ DENY = "DENY"
578
+ }
579
+ interface RiskEvaluation {
580
+ decision: RiskDecision;
581
+ reason?: string;
582
+ retryAfterMs?: number;
583
+ confidence: number;
584
+ signals: RiskSignal[];
585
+ }
586
+
587
+ declare class AccessProfileResolverSensor implements AxisSensor {
588
+ readonly name = "AccessProfileResolverSensor";
589
+ readonly order: number;
590
+ supports(): boolean;
591
+ run(input: SensorInput): Promise<SensorDecision>;
592
+ }
593
+
594
+ declare class BodyBudgetSensor implements AxisSensor {
595
+ readonly name = "BodyBudgetSensor";
596
+ readonly order: number;
597
+ supports(input: SensorInput): boolean;
598
+ run(input: SensorInput): Promise<SensorDecision>;
599
+ }
600
+
601
+ declare class CapabilityEnforcementSensor implements AxisSensor {
602
+ private readonly logger;
603
+ readonly name = "CapabilityEnforcementSensor";
604
+ readonly order: number;
605
+ supports(input: SensorInput): boolean;
606
+ run(input: SensorInput): Promise<SensorDecision>;
607
+ private getRequiredCapabilities;
608
+ }
609
+
610
+ declare class ChunkHashSensor implements AxisSensor {
611
+ readonly name = "ChunkHashSensor";
612
+ readonly order: number;
613
+ supports(input: SensorInput): boolean;
614
+ run(input: SensorInput): Promise<SensorDecision>;
615
+ }
616
+
617
+ declare class EntropySensor implements AxisSensor {
618
+ private readonly logger;
619
+ private readonly MIN_ENTROPY_THRESHOLD;
620
+ readonly name = "EntropySensor";
621
+ readonly order: number;
622
+ private calculateEntropy;
623
+ private hasSequentialPattern;
624
+ private hasRepeatedPattern;
625
+ run(input: SensorInput): Promise<SensorDecision>;
626
+ static generateSecureRandom(length: number): Uint8Array;
627
+ }
628
+
629
+ declare class ExecutionTimeoutSensor implements AxisSensor {
630
+ private readonly logger;
631
+ readonly name = "ExecutionTimeoutSensor";
632
+ readonly order: number;
633
+ supports(input: SensorInput): boolean;
634
+ run(input: SensorInput): Promise<SensorDecision>;
635
+ static isExpired(ctx: {
636
+ deadline?: number;
637
+ }): boolean;
638
+ static getRemainingMs(ctx: {
639
+ deadline?: number;
640
+ }): number;
641
+ }
642
+
643
+ declare class FrameBudgetSensor implements AxisSensor {
644
+ readonly name = "FrameBudgetSensor";
645
+ readonly order: number;
646
+ supports(input: SensorInput): boolean;
647
+ run(input: SensorInput): Promise<SensorDecision>;
648
+ }
649
+
650
+ declare class FrameHeaderSanitySensor implements AxisSensor {
651
+ readonly name = "FrameHeaderSanitySensor";
652
+ readonly order: number;
653
+ supports(input: SensorInput): boolean;
654
+ run(input: SensorInput): Promise<SensorDecision>;
655
+ private bufferEqual;
656
+ }
657
+
658
+ declare class HeaderTLVLimitSensor implements AxisSensor {
659
+ readonly name = "HeaderTLVLimitSensor";
660
+ readonly order: number;
661
+ private readonly MAX_TLVS;
662
+ supports(input: SensorInput): boolean;
663
+ run(input: SensorInput): Promise<SensorDecision>;
664
+ }
665
+
666
+ declare class IntentAllowlistSensor implements AxisSensor {
667
+ readonly name = "IntentAllowlistSensor";
668
+ readonly order: number;
669
+ supports(input: SensorInput): boolean;
670
+ run(input: SensorInput): Promise<SensorDecision>;
671
+ }
672
+
673
+ declare class IntentRegistrySensor implements AxisSensor {
674
+ private readonly router;
675
+ readonly name = "IntentRegistrySensor";
676
+ readonly order: number;
677
+ constructor(router: IntentRouter);
678
+ supports(input: SensorInput): boolean;
679
+ run(input: SensorInput): Promise<SensorDecision>;
680
+ }
681
+
682
+ declare class LawEvaluationSensor implements AxisSensor {
683
+ private readonly options;
684
+ private readonly logger;
685
+ readonly name = "LawEvaluationSensor";
686
+ readonly order: number;
687
+ constructor(options?: LawEvaluationSensorOptions);
688
+ supports(input: SensorInput): boolean;
689
+ run(input: SensorInput): Promise<SensorDecision>;
690
+ }
691
+
692
+ declare class ProofPresenceSensor implements AxisSensor {
693
+ readonly name = "ProofPresenceSensor";
694
+ readonly order: number;
695
+ supports(input: ProofPresenceInput): boolean;
696
+ run(input: ProofPresenceInput): Promise<SensorDecision>;
697
+ }
698
+
699
+ declare class ProtocolStrictSensor implements AxisSensor {
700
+ private readonly logger;
701
+ readonly name = "ProtocolStrictSensor";
702
+ readonly order: number;
703
+ private protocolMagic;
704
+ private protocolVersion;
705
+ static validateMagic(chunk: Uint8Array, expected: Uint8Array): {
706
+ valid: boolean;
707
+ actual?: string;
708
+ };
709
+ static validateVersion(version: number, expected: number): boolean;
710
+ onModuleInit(): void;
711
+ run(input: SensorInput): Promise<SensorDecision>;
712
+ private buffersEqual;
713
+ private isValidContentType;
714
+ private isValidFlags;
715
+ private checkVarintEncoding;
716
+ private checkTLVOrdering;
717
+ private checkForClientVersion;
718
+ }
719
+
720
+ declare class ReceiptPolicySensor implements AxisSensor {
721
+ readonly name = "ReceiptPolicySensor";
722
+ readonly order: number;
723
+ supports(): boolean;
724
+ run(): Promise<SensorDecision>;
725
+ }
726
+
727
+ type RiskSignalCollector = (input: SensorInput) => Promise<RiskSignal[]> | RiskSignal[];
728
+ interface RiskGateSensorOptions {
729
+ collectors: RiskSignalCollector[];
730
+ denyThreshold?: number;
731
+ flagThreshold?: number;
732
+ }
733
+ declare class RiskGateSensor implements AxisSensor {
734
+ readonly name = "RiskGateSensor";
735
+ readonly order: number;
736
+ private readonly collectors;
737
+ private readonly denyThreshold;
738
+ private readonly flagThreshold;
739
+ constructor(options: RiskGateSensorOptions);
740
+ run(input: SensorInput): Promise<SensorDecision>;
741
+ private evaluate;
742
+ }
743
+
744
+ declare class SchemaValidationSensor implements AxisSensor {
745
+ readonly name = "SchemaValidationSensor";
746
+ readonly order: number;
747
+ supports(input: any): boolean;
748
+ run(input: any): Promise<{
749
+ action: 'ALLOW';
750
+ } | {
751
+ action: 'DENY';
752
+ code: string;
753
+ reason: string;
754
+ }>;
755
+ }
756
+
757
+ declare class StreamScopeSensor implements AxisSensor {
758
+ readonly name = "StreamScopeSensor";
759
+ readonly order: number;
760
+ supports(): boolean;
761
+ run(): Promise<SensorDecision>;
762
+ }
763
+
764
+ interface TickAuthCapsuleRef {
765
+ capsule_id: string;
766
+ capsule_type?: string;
767
+ intent?: string;
768
+ mode?: string;
769
+ verification?: {
770
+ status: 'approved' | 'denied' | 'expired' | 'replay_rejected' | 'consumed' | 'revoked';
771
+ reason?: string;
772
+ };
773
+ scope?: string[];
774
+ single_use?: boolean;
775
+ tick_index?: number;
776
+ }
777
+ type TickAuthVerifier = (capsule: TickAuthCapsuleRef, input: SensorInput) => Promise<string | null> | (string | null);
778
+ interface TickAuthSensorOptions {
779
+ verifier?: TickAuthVerifier;
780
+ matchIntent?: boolean;
781
+ acceptTypes?: string[];
782
+ }
783
+ declare class TickAuthSensor implements AxisSensor {
784
+ readonly name = "TickAuthSensor";
785
+ readonly order: number;
786
+ private readonly verifier?;
787
+ private readonly matchIntent;
788
+ private readonly acceptTypes;
789
+ constructor(options?: TickAuthSensorOptions);
790
+ supports(input: SensorInput): boolean;
791
+ run(input: SensorInput): Promise<SensorDecision>;
792
+ }
793
+
794
+ declare class TLVParseSensor implements AxisSensor {
795
+ readonly name = "TLVParseSensor";
796
+ readonly order: number;
797
+ supports(input: SensorInput): boolean;
798
+ run(input: SensorInput): Promise<SensorDecision>;
799
+ private validateCanonicalTLV;
800
+ }
801
+
802
+ interface TpsSensorOptions {
803
+ maxDriftMs?: number;
804
+ resolver?: (tps: string) => number | null;
805
+ }
806
+ declare class TpsSensor implements AxisSensor {
807
+ readonly name = "TpsSensor";
808
+ readonly order: number;
809
+ private readonly maxDriftMs;
810
+ private readonly resolver;
811
+ constructor(options?: TpsSensorOptions);
812
+ supports(input: SensorInput): boolean;
813
+ run(input: SensorInput): Promise<SensorDecision>;
814
+ }
815
+
816
+ declare class VarintHardeningSensor implements AxisSensor {
817
+ readonly name = "VarintHardeningSensor";
818
+ readonly order: number;
819
+ private readonly MAX_VARINT_BYTES;
820
+ supports(input: SensorInput): boolean;
821
+ run(input: SensorInput): Promise<SensorDecision>;
822
+ }
823
+
824
+ export { ChunkHashSensor as $, type AxisIntentSensorRef as A, type AxisLawEvaluationContext as B, type ChainOptions as C, type AxisLawEvaluationResult as D, type AxisLawEvaluator as E, type AxisObserverBinding as F, type AxisObserverBindingOptions as G, type AxisObserverContext as H, type IntentTlvField as I, type AxisObserverDefinition as J, type AxisObserverEvent as K, type AxisObserverRef as L, type AxisObserverRegistration as M, AxisPublic as N, ObserverDispatcherService as O, AxisRateLimit as P, type AxisRateLimitConfig as Q, BodyBudgetSensor as R, SensorRegistry as S, type TlvValidatorFn as T, CAPSULE_POLICY_METADATA_KEY as U, CONTRACT_METADATA_KEY as V, CapabilityEnforcementSensor as W, Capsule as X, CapsulePolicy as Y, type CapsulePolicyOptions as Z, type CapsuleScopeMode as _, IntentRouter as a, Contract as a0, DEFAULT_CONTRACTS as a1, EntropySensor as a2, type ExecutionContract as a3, ExecutionTimeoutSensor as a4, FALLBACK_CONTRACT as a5, FrameBudgetSensor as a6, FrameHeaderSanitySensor as a7, HeaderTLVLimitSensor as a8, INTENT_METADATA_KEY as a9, SENSITIVITY_METADATA_KEY as aA, SchemaValidationSensor as aB, Sensitivity as aC, StreamScopeSensor as aD, TLVParseSensor as aE, TLV_FIELDS_KEY as aF, TLV_VALIDATORS_KEY as aG, type TickAuthCapsuleRef as aH, TickAuthSensor as aI, type TickAuthSensorOptions as aJ, type TickAuthVerifier as aK, TlvEnum as aL, TlvField as aM, type TlvFieldKind as aN, type TlvFieldMeta as aO, type TlvFieldOptions as aP, TlvMinLen as aQ, TlvRange as aR, TlvUtf8Pattern as aS, TlvValidate as aT, type TlvValidatorMeta as aU, TpsSensor as aV, type TpsSensorOptions as aW, VarintHardeningSensor as aX, Witness as aY, buildAxisLawEvaluationContext as aZ, INTENT_ROUTES_KEY as aa, Intent as ab, IntentAllowlistSensor as ac, type IntentKind as ad, type IntentOptions as ae, IntentRegistrySensor as af, type IntentRoute as ag, LawEvaluationSensor as ah, type LawEvaluationSensorOptions as ai, OBSERVER_BINDINGS_KEY as aj, OBSERVER_METADATA_KEY as ak, Observer as al, ObserverRegistry as am, ProofPresenceSensor as an, ProtocolStrictSensor as ao, REQUIRED_PROOF_METADATA_KEY as ap, ReceiptPolicySensor as aq, type RegisteredChainConfig as ar, RequiredProof as as, type RequiredProofKind as at, RiskDecision as au, type RiskEvaluation as av, RiskGateSensor as aw, type RiskGateSensorOptions as ax, type RiskSignal as ay, type RiskSignalCollector as az, type AxisChainEnvelope as b, type AxisChainResult as c, type AxisCapsuleRef as d, type AxisChainStep as e, type AxisContext as f, AXIS_ANONYMOUS_KEY as g, AXIS_META_KEY as h, AXIS_PUBLIC_KEY as i, AXIS_RATE_LIMIT_KEY as j, AccessProfileResolverSensor as k, Axis as l, AxisAnonymous as m, type AxisChainEncryption as n, type AxisChainRequest as o, type AxisChainStatus as p, type AxisChainStepResult as q, type AxisChainStepStatus as r, type AxisEffect as s, type AxisExecutionMode as t, type AxisIntentEnvelope as u, type AxisIntentObserver as v, type AxisIntentSensorOptions as w, type AxisKeyExchangeRef as x, type AxisLawArticleSummary as y, type AxisLawDecision as z };