@nextera.one/axis-server-sdk 1.6.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';
@@ -1982,6 +1982,144 @@ declare class AxisSensorChainService {
1982
1982
  private evaluateSensors;
1983
1983
  }
1984
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
+ }
2118
+
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
+
1985
2123
  interface CceDerivationInput {
1986
2124
  axisLocalSecret: string;
1987
2125
  capsule: CceCapsuleClaims;
@@ -2356,158 +2494,41 @@ type index$5_HandlerDiscoveryService = HandlerDiscoveryService;
2356
2494
  declare const index$5_HandlerDiscoveryService: typeof HandlerDiscoveryService;
2357
2495
  type index$5_IntentRouter = IntentRouter;
2358
2496
  declare const index$5_IntentRouter: typeof IntentRouter;
2497
+ type index$5_ObservationQueueConfig = ObservationQueueConfig;
2498
+ type index$5_ObservationQueueMessage = ObservationQueueMessage;
2359
2499
  type index$5_ObservationSensor = ObservationSensor;
2360
2500
  type index$5_ObservationStage = ObservationStage;
2501
+ type index$5_ObservationStreamEntry = ObservationStreamEntry;
2502
+ type index$5_ObservationWitnessSummary = ObservationWitnessSummary;
2503
+ type index$5_ObserverVerdict = ObserverVerdict;
2361
2504
  declare const index$5_PRE_DECODE_BOUNDARY: typeof PRE_DECODE_BOUNDARY;
2505
+ type index$5_ResponseContract = ResponseContract;
2506
+ type index$5_ResponseObserverContext = ResponseObserverContext;
2362
2507
  type index$5_SensorBand = SensorBand;
2363
2508
  type index$5_SensorDiscoveryService = SensorDiscoveryService;
2364
2509
  declare const index$5_SensorDiscoveryService: typeof SensorDiscoveryService;
2365
2510
  type index$5_SensorRegistry = SensorRegistry;
2366
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;
2367
2516
  declare const index$5_createObservation: typeof createObservation;
2517
+ declare const index$5_decodeQueueMessage: typeof decodeQueueMessage;
2518
+ declare const index$5_encodeQueueMessage: typeof encodeQueueMessage;
2368
2519
  declare const index$5_endStage: typeof endStage;
2369
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;
2370
2524
  declare const index$5_recordSensor: typeof recordSensor;
2525
+ declare const index$5_stableJsonStringify: typeof stableJsonStringify;
2371
2526
  declare const index$5_startStage: typeof startStage;
2527
+ declare const index$5_verifyResponse: typeof verifyResponse;
2372
2528
  declare namespace index$5 {
2373
- 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 };
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 };
2374
2530
  }
2375
2531
 
2376
- interface PresenceDeclaration {
2377
- softid: string;
2378
- device_meta?: {
2379
- fingerprint?: string;
2380
- platform?: string;
2381
- user_agent?: string;
2382
- };
2383
- }
2384
- interface PresenceChallenge {
2385
- challenge_id: string;
2386
- nonce: string;
2387
- temporal_anchor: number;
2388
- ttl_ms: number;
2389
- expires_at: number;
2390
- }
2391
- interface PresenceProof {
2392
- challenge_id: string;
2393
- signature: string;
2394
- public_key: string;
2395
- kid?: string;
2396
- }
2397
- interface PresenceReceipt {
2398
- presence_id: string;
2399
- softid: string;
2400
- anchor_reflection: string;
2401
- scope: {
2402
- ip?: string;
2403
- device_fingerprint?: string;
2404
- };
2405
- issued_at: number;
2406
- expires_at: number;
2407
- renewed_at?: number;
2408
- }
2409
- type PresenceStatus = 'active' | 'expired' | 'revoked';
2410
- interface WritHead {
2411
- tid: string;
2412
- seq: number;
2413
- }
2414
- interface WritBody {
2415
- who: string;
2416
- act: string;
2417
- res: string;
2418
- law: string;
2419
- }
2420
- interface WritMeta {
2421
- iat: number;
2422
- exp: number;
2423
- prev: string;
2424
- }
2425
- interface WritSignature {
2426
- alg: 'ed25519';
2427
- value: string;
2428
- kid?: string;
2429
- }
2430
- interface Writ {
2431
- head: WritHead;
2432
- body: WritBody;
2433
- meta: WritMeta;
2434
- sig: WritSignature;
2435
- }
2436
- type GrantType = 'sovereign' | 'delegated' | 'system';
2437
- interface GrantCapability {
2438
- oec: string;
2439
- scope: string;
2440
- limit?: {
2441
- rate?: string;
2442
- amount?: number;
2443
- depth?: string;
2444
- };
2445
- }
2446
- interface GrantMeta {
2447
- iat: number;
2448
- exp: number;
2449
- revocable: boolean;
2450
- version: number;
2451
- contract_ref?: string;
2452
- }
2453
- interface Grant {
2454
- grant_id: string;
2455
- issuer: string;
2456
- subject: string;
2457
- grant_type: GrantType;
2458
- caps: GrantCapability[];
2459
- meta: GrantMeta;
2460
- sig: WritSignature;
2461
- }
2462
- type GrantStatus = 'active' | 'revoked' | 'expired';
2463
- interface LoomReceipt {
2464
- receipt_id: string;
2465
- writ_hash: string;
2466
- thread_id: string;
2467
- sequence: number;
2468
- effect: string;
2469
- hash: string;
2470
- prev_hash: string | null;
2471
- executed_at: number;
2472
- metadata?: Record<string, unknown>;
2473
- }
2474
- interface ThreadState {
2475
- thread_id: string;
2476
- softid: string;
2477
- last_receipt_hash: string;
2478
- sequence: number;
2479
- updated_at: number;
2480
- }
2481
- type RevocationTargetType = 'grant' | 'presence' | 'softid';
2482
- interface Revocation {
2483
- revocation_id: string;
2484
- target_type: RevocationTargetType;
2485
- target_id: string;
2486
- issuer_softid: string;
2487
- reason?: string;
2488
- effective_at: number;
2489
- sig_value: string;
2490
- }
2491
- interface LoomValidationResult {
2492
- valid: boolean;
2493
- error?: string;
2494
- code?: string;
2495
- }
2496
- interface PresenceVerifyResult extends LoomValidationResult {
2497
- presence?: PresenceReceipt;
2498
- }
2499
- interface WritValidationResult extends LoomValidationResult {
2500
- writ?: Writ;
2501
- gate_failed?: 'temporal' | 'causal' | 'legal' | 'authentic';
2502
- }
2503
- interface GrantValidationResult extends LoomValidationResult {
2504
- grant?: Grant;
2505
- }
2506
-
2507
- declare function deriveAnchorReflection(softid: string, context?: string, scope?: string): string;
2508
- declare function canonicalizeWrit(writ: Omit<Writ, 'sig'>): string;
2509
- declare function canonicalizeGrant(grant: Omit<Grant, 'sig'>): string;
2510
-
2511
2532
  type index$4_Grant = Grant;
2512
2533
  type index$4_GrantCapability = GrantCapability;
2513
2534
  type index$4_GrantMeta = GrantMeta;
@@ -2876,12 +2897,9 @@ declare namespace index$1 {
2876
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 };
2877
2898
  }
2878
2899
 
2879
- type AxisTlvDtoCtor<T = object> = new (...args: never[]) => T;
2880
- declare function encodeAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>): Uint8Array;
2881
-
2882
2900
  declare const index_encodeAxisTlvDto: typeof encodeAxisTlvDto;
2883
2901
  declare namespace index {
2884
2902
  export { index_encodeAxisTlvDto as encodeAxisTlvDto };
2885
2903
  }
2886
2904
 
2887
- 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, 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, index$9 as cce, classifyIntent, createObservation, index$8 as crypto, decodeAxis1Frame, decodeQueueMessage, index$7 as decorators, encVarint, encodeAxis1Frame, 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 };
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 };
package/dist/index.js CHANGED
@@ -126,6 +126,7 @@ __export(index_exports, {
126
126
  RESPONSE_TAG_ID: () => RESPONSE_TAG_ID,
127
127
  RESPONSE_TAG_UPDATED_AT: () => RESPONSE_TAG_UPDATED_AT,
128
128
  RESPONSE_TAG_UPDATED_BY: () => RESPONSE_TAG_UPDATED_BY,
129
+ ResponseObserver: () => verifyResponse,
129
130
  RiskDecision: () => RiskDecision,
130
131
  SENSOR_METADATA_KEY: () => SENSOR_METADATA_KEY,
131
132
  Schema2002_PasskeyLoginOptionsRes: () => Schema2002_PasskeyLoginOptionsRes,
@@ -159,6 +160,7 @@ __export(index_exports, {
159
160
  TLV_OFFSET: () => import_axis_protocol2.TLV_OFFSET,
160
161
  TLV_OK: () => import_axis_protocol2.TLV_OK,
161
162
  TLV_PID: () => import_axis_protocol2.TLV_PID,
163
+ TLV_PRESENCE_ID: () => import_axis_protocol2.TLV_LOOM_PRESENCE_ID,
162
164
  TLV_PREV_HASH: () => import_axis_protocol2.TLV_PREV_HASH,
163
165
  TLV_PROOF_REF: () => import_axis_protocol2.TLV_PROOF_REF,
164
166
  TLV_PROOF_TYPE: () => import_axis_protocol2.TLV_PROOF_TYPE,
@@ -166,10 +168,12 @@ __export(index_exports, {
166
168
  TLV_RECEIPT_HASH: () => import_axis_protocol2.TLV_RECEIPT_HASH,
167
169
  TLV_RID: () => import_axis_protocol2.TLV_RID,
168
170
  TLV_SHA256_CHUNK: () => import_axis_protocol2.TLV_SHA256_CHUNK,
171
+ TLV_THREAD_HASH: () => import_axis_protocol2.TLV_LOOM_THREAD_HASH,
169
172
  TLV_TRACE_ID: () => import_axis_protocol2.TLV_TRACE_ID,
170
173
  TLV_TS: () => import_axis_protocol2.TLV_TS,
171
174
  TLV_UPLOAD_ID: () => import_axis_protocol2.TLV_UPLOAD_ID,
172
175
  TLV_VALIDATORS_KEY: () => TLV_VALIDATORS_KEY,
176
+ TLV_WRIT: () => import_axis_protocol2.TLV_LOOM_WRIT,
173
177
  TlvEnum: () => TlvEnum,
174
178
  TlvField: () => TlvField,
175
179
  TlvMinLen: () => TlvMinLen,
@@ -192,7 +196,9 @@ __export(index_exports, {
192
196
  canAccessResource: () => canAccessResource,
193
197
  canonicalJson: () => canonicalJson,
194
198
  canonicalJsonExcluding: () => canonicalJsonExcluding,
199
+ canonicalizeGrant: () => canonicalizeGrant,
195
200
  canonicalizeObservation: () => canonicalizeObservation,
201
+ canonicalizeWrit: () => canonicalizeWrit,
196
202
  cce: () => cce_exports,
197
203
  classifyIntent: () => classifyIntent,
198
204
  computeReceiptHash: () => computeReceiptHash,
@@ -209,8 +215,10 @@ __export(index_exports, {
209
215
  decodeTLVsList: () => import_axis_protocol.decodeTLVsList,
210
216
  decodeVarint: () => import_axis_protocol3.decodeVarint,
211
217
  decorators: () => decorators_exports,
218
+ deriveAnchorReflection: () => deriveAnchorReflection,
212
219
  encVarint: () => encVarint,
213
220
  encodeAxis1Frame: () => encodeAxis1Frame,
221
+ encodeAxisTlvDto: () => encodeAxisTlvDto,
214
222
  encodeFrame: () => encodeFrame,
215
223
  encodeQueueMessage: () => encodeQueueMessage,
216
224
  encodeTLVs: () => import_axis_protocol.encodeTLVs,
@@ -4236,6 +4244,88 @@ AxisSensorChainService = __decorateClass([
4236
4244
  (0, import_common9.Injectable)()
4237
4245
  ], AxisSensorChainService);
4238
4246
 
4247
+ // src/utils/axis-tlv-codec.ts
4248
+ function encodeAxisTlvDto(dtoClass, data) {
4249
+ const schema = extractDtoSchema(dtoClass);
4250
+ const items = schema.fields.flatMap((field) => {
4251
+ const value = data[field.name];
4252
+ if (value === void 0 || value === null) {
4253
+ if (field.required) {
4254
+ throw new Error(`Missing required TLV response field: ${field.name}`);
4255
+ }
4256
+ return [];
4257
+ }
4258
+ return [{ type: field.tag, value: encodeField(field, value) }];
4259
+ });
4260
+ return buildTLVs(items);
4261
+ }
4262
+ function encodeField(field, value) {
4263
+ switch (field.kind) {
4264
+ case "utf8":
4265
+ return Buffer.from(String(value), "utf8");
4266
+ case "u64":
4267
+ return encodeU64(value);
4268
+ case "bytes":
4269
+ case "bytes16":
4270
+ return toBuffer(value);
4271
+ case "bool":
4272
+ return Buffer.from([value ? 1 : 0]);
4273
+ case "obj":
4274
+ case "arr":
4275
+ return Buffer.from(JSON.stringify(value), "utf8");
4276
+ default:
4277
+ return toBuffer(value);
4278
+ }
4279
+ }
4280
+ function encodeU64(value) {
4281
+ const encoded = Buffer.alloc(8);
4282
+ encoded.writeBigUInt64BE(
4283
+ typeof value === "bigint" ? value : BigInt(value)
4284
+ );
4285
+ return encoded;
4286
+ }
4287
+ function toBuffer(value) {
4288
+ if (Buffer.isBuffer(value)) {
4289
+ return value;
4290
+ }
4291
+ if (value instanceof Uint8Array) {
4292
+ return Buffer.from(value);
4293
+ }
4294
+ if (typeof value === "string") {
4295
+ return Buffer.from(value, "utf8");
4296
+ }
4297
+ throw new Error(`Unsupported TLV bytes value: ${typeof value}`);
4298
+ }
4299
+
4300
+ // src/loom/loom.types.ts
4301
+ function deriveAnchorReflection(softid, context = "openlogs", scope = "loom") {
4302
+ return `ar:${context}:${scope}:${softid}`;
4303
+ }
4304
+ function canonicalizeWrit(writ) {
4305
+ const ordered = {
4306
+ head: { tid: writ.head.tid, seq: writ.head.seq },
4307
+ body: {
4308
+ who: writ.body.who,
4309
+ act: writ.body.act,
4310
+ res: writ.body.res,
4311
+ law: writ.body.law
4312
+ },
4313
+ meta: { iat: writ.meta.iat, exp: writ.meta.exp, prev: writ.meta.prev }
4314
+ };
4315
+ return JSON.stringify(ordered);
4316
+ }
4317
+ function canonicalizeGrant(grant) {
4318
+ const ordered = {
4319
+ grant_id: grant.grant_id,
4320
+ issuer: grant.issuer,
4321
+ subject: grant.subject,
4322
+ grant_type: grant.grant_type,
4323
+ caps: grant.caps,
4324
+ meta: grant.meta
4325
+ };
4326
+ return JSON.stringify(ordered);
4327
+ }
4328
+
4239
4329
  // src/cce/index.ts
4240
4330
  var cce_exports = {};
4241
4331
  __export(cce_exports, {
@@ -5283,12 +5373,22 @@ __export(engine_exports, {
5283
5373
  PRE_DECODE_BOUNDARY: () => PRE_DECODE_BOUNDARY,
5284
5374
  SensorDiscoveryService: () => SensorDiscoveryService,
5285
5375
  SensorRegistry: () => SensorRegistry,
5376
+ buildQueueMessage: () => buildQueueMessage,
5377
+ buildUnsignedWitness: () => buildUnsignedWitness,
5378
+ canonicalizeObservation: () => canonicalizeObservation,
5286
5379
  createObservation: () => createObservation,
5380
+ decodeQueueMessage: () => decodeQueueMessage,
5381
+ encodeQueueMessage: () => encodeQueueMessage,
5287
5382
  endStage: () => endStage,
5288
5383
  finalizeObservation: () => finalizeObservation,
5384
+ hashObservation: () => hashObservation,
5289
5385
  observation: () => observation_exports,
5386
+ parseAutoClaimEntries: () => parseAutoClaimEntries,
5387
+ parseStreamEntries: () => parseStreamEntries,
5290
5388
  recordSensor: () => recordSensor,
5291
- startStage: () => startStage
5389
+ stableJsonStringify: () => stableJsonStringify,
5390
+ startStage: () => startStage,
5391
+ verifyResponse: () => verifyResponse
5292
5392
  });
5293
5393
 
5294
5394
  // src/engine/observation/index.ts
@@ -5318,35 +5418,6 @@ __export(loom_exports, {
5318
5418
  deriveAnchorReflection: () => deriveAnchorReflection
5319
5419
  });
5320
5420
 
5321
- // src/loom/loom.types.ts
5322
- function deriveAnchorReflection(softid, context = "openlogs", scope = "loom") {
5323
- return `ar:${context}:${scope}:${softid}`;
5324
- }
5325
- function canonicalizeWrit(writ) {
5326
- const ordered = {
5327
- head: { tid: writ.head.tid, seq: writ.head.seq },
5328
- body: {
5329
- who: writ.body.who,
5330
- act: writ.body.act,
5331
- res: writ.body.res,
5332
- law: writ.body.law
5333
- },
5334
- meta: { iat: writ.meta.iat, exp: writ.meta.exp, prev: writ.meta.prev }
5335
- };
5336
- return JSON.stringify(ordered);
5337
- }
5338
- function canonicalizeGrant(grant) {
5339
- const ordered = {
5340
- grant_id: grant.grant_id,
5341
- issuer: grant.issuer,
5342
- subject: grant.subject,
5343
- grant_type: grant.grant_type,
5344
- caps: grant.caps,
5345
- meta: grant.meta
5346
- };
5347
- return JSON.stringify(ordered);
5348
- }
5349
-
5350
5421
  // src/schemas/index.ts
5351
5422
  var schemas_exports = {};
5352
5423
  __export(schemas_exports, {
@@ -7357,59 +7428,6 @@ var utils_exports = {};
7357
7428
  __export(utils_exports, {
7358
7429
  encodeAxisTlvDto: () => encodeAxisTlvDto
7359
7430
  });
7360
-
7361
- // src/utils/axis-tlv-codec.ts
7362
- function encodeAxisTlvDto(dtoClass, data) {
7363
- const schema = extractDtoSchema(dtoClass);
7364
- const items = schema.fields.flatMap((field) => {
7365
- const value = data[field.name];
7366
- if (value === void 0 || value === null) {
7367
- if (field.required) {
7368
- throw new Error(`Missing required TLV response field: ${field.name}`);
7369
- }
7370
- return [];
7371
- }
7372
- return [{ type: field.tag, value: encodeField(field, value) }];
7373
- });
7374
- return buildTLVs(items);
7375
- }
7376
- function encodeField(field, value) {
7377
- switch (field.kind) {
7378
- case "utf8":
7379
- return Buffer.from(String(value), "utf8");
7380
- case "u64":
7381
- return encodeU64(value);
7382
- case "bytes":
7383
- case "bytes16":
7384
- return toBuffer(value);
7385
- case "bool":
7386
- return Buffer.from([value ? 1 : 0]);
7387
- case "obj":
7388
- case "arr":
7389
- return Buffer.from(JSON.stringify(value), "utf8");
7390
- default:
7391
- return toBuffer(value);
7392
- }
7393
- }
7394
- function encodeU64(value) {
7395
- const encoded = Buffer.alloc(8);
7396
- encoded.writeBigUInt64BE(
7397
- typeof value === "bigint" ? value : BigInt(value)
7398
- );
7399
- return encoded;
7400
- }
7401
- function toBuffer(value) {
7402
- if (Buffer.isBuffer(value)) {
7403
- return value;
7404
- }
7405
- if (value instanceof Uint8Array) {
7406
- return Buffer.from(value);
7407
- }
7408
- if (typeof value === "string") {
7409
- return Buffer.from(value, "utf8");
7410
- }
7411
- throw new Error(`Unsupported TLV bytes value: ${typeof value}`);
7412
- }
7413
7431
  // Annotate the CommonJS export names for ESM import in node:
7414
7432
  0 && (module.exports = {
7415
7433
  ATS1_HDR,
@@ -7500,6 +7518,7 @@ function toBuffer(value) {
7500
7518
  RESPONSE_TAG_ID,
7501
7519
  RESPONSE_TAG_UPDATED_AT,
7502
7520
  RESPONSE_TAG_UPDATED_BY,
7521
+ ResponseObserver,
7503
7522
  RiskDecision,
7504
7523
  SENSOR_METADATA_KEY,
7505
7524
  Schema2002_PasskeyLoginOptionsRes,
@@ -7533,6 +7552,7 @@ function toBuffer(value) {
7533
7552
  TLV_OFFSET,
7534
7553
  TLV_OK,
7535
7554
  TLV_PID,
7555
+ TLV_PRESENCE_ID,
7536
7556
  TLV_PREV_HASH,
7537
7557
  TLV_PROOF_REF,
7538
7558
  TLV_PROOF_TYPE,
@@ -7540,10 +7560,12 @@ function toBuffer(value) {
7540
7560
  TLV_RECEIPT_HASH,
7541
7561
  TLV_RID,
7542
7562
  TLV_SHA256_CHUNK,
7563
+ TLV_THREAD_HASH,
7543
7564
  TLV_TRACE_ID,
7544
7565
  TLV_TS,
7545
7566
  TLV_UPLOAD_ID,
7546
7567
  TLV_VALIDATORS_KEY,
7568
+ TLV_WRIT,
7547
7569
  TlvEnum,
7548
7570
  TlvField,
7549
7571
  TlvMinLen,
@@ -7566,7 +7588,9 @@ function toBuffer(value) {
7566
7588
  canAccessResource,
7567
7589
  canonicalJson,
7568
7590
  canonicalJsonExcluding,
7591
+ canonicalizeGrant,
7569
7592
  canonicalizeObservation,
7593
+ canonicalizeWrit,
7570
7594
  cce,
7571
7595
  classifyIntent,
7572
7596
  computeReceiptHash,
@@ -7583,8 +7607,10 @@ function toBuffer(value) {
7583
7607
  decodeTLVsList,
7584
7608
  decodeVarint,
7585
7609
  decorators,
7610
+ deriveAnchorReflection,
7586
7611
  encVarint,
7587
7612
  encodeAxis1Frame,
7613
+ encodeAxisTlvDto,
7588
7614
  encodeFrame,
7589
7615
  encodeQueueMessage,
7590
7616
  encodeTLVs,