@nextera.one/axis-server-sdk 2.3.19 → 2.3.21
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-BsnV_K_l.d.ts → index-CjHt1HEv.d.ts} +23 -2
- package/dist/{index-BCFbHQxo.d.mts → index-OpaG6R6E.d.mts} +23 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +67 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -22
- package/dist/index.mjs.map +1 -1
- package/dist/sensors/index.d.mts +1 -1
- package/dist/sensors/index.d.ts +1 -1
- package/dist/sensors/index.js +67 -22
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +67 -22
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -371,13 +371,25 @@ interface AxisDependencyResolver {
|
|
|
371
371
|
interface AxisConfigReader {
|
|
372
372
|
get<T = string>(key: string): T | undefined;
|
|
373
373
|
}
|
|
374
|
+
type SensorsSource = "ENV" | "REDIS" | "DB" | "ON_MEMORY";
|
|
375
|
+
interface SensorConfigSnapshot {
|
|
376
|
+
source?: SensorsSource | string;
|
|
377
|
+
enabledSensors?: readonly string[] | null;
|
|
378
|
+
disabledSensors?: readonly string[] | null;
|
|
379
|
+
version?: string | number;
|
|
380
|
+
updatedAt?: number;
|
|
381
|
+
}
|
|
382
|
+
interface AxisSensorConfigProvider {
|
|
383
|
+
getSensorConfig(): SensorConfigSnapshot | undefined;
|
|
384
|
+
}
|
|
374
385
|
declare class SensorRegistry {
|
|
375
386
|
private readonly configService?;
|
|
387
|
+
private readonly sensorConfigProvider?;
|
|
376
388
|
private sensors;
|
|
377
389
|
private sensorsByName;
|
|
378
390
|
private sensorsByType;
|
|
379
391
|
private readonly logger;
|
|
380
|
-
constructor(configService?: AxisConfigReader | undefined);
|
|
392
|
+
constructor(configService?: AxisConfigReader | undefined, sensorConfigProvider?: AxisSensorConfigProvider | undefined);
|
|
381
393
|
register(sensor: AxisSensor): void;
|
|
382
394
|
list(): AxisSensor[];
|
|
383
395
|
resolve(ref: AxisIntentSensorRef): AxisSensor | undefined;
|
|
@@ -389,9 +401,18 @@ declare class SensorRegistry {
|
|
|
389
401
|
postDecodeCount: number;
|
|
390
402
|
};
|
|
391
403
|
clear(): void;
|
|
404
|
+
getSensorConfig(): Required<Pick<SensorConfigSnapshot, "enabledSensors" | "disabledSensors">> & {
|
|
405
|
+
source: SensorsSource | string;
|
|
406
|
+
};
|
|
392
407
|
private isPreDecodeSensor;
|
|
393
408
|
private isPostDecodeSensor;
|
|
394
409
|
private indexSensor;
|
|
410
|
+
private filterEnabledSensors;
|
|
411
|
+
private isSensorEnabled;
|
|
412
|
+
private getSensorNames;
|
|
413
|
+
private getSensorsSource;
|
|
414
|
+
private parseConfigList;
|
|
415
|
+
private normalizeList;
|
|
395
416
|
}
|
|
396
417
|
|
|
397
418
|
interface IntentSchema {
|
|
@@ -908,4 +929,4 @@ declare class VarintHardeningSensor implements AxisSensor {
|
|
|
908
929
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
909
930
|
}
|
|
910
931
|
|
|
911
|
-
export {
|
|
932
|
+
export { AxisRateLimit as $, type AxisIntentSensorOptions as A, type AxisIntentEnvelope as B, type ChainOptions as C, type AxisIntentObserver as D, type AxisIntentSensorBinding as E, type AxisIntentSensorBindingOptions as F, type AxisIntentSensorRef as G, type AxisIntentSensorWhen as H, type IntentTlvField as I, type AxisKeyExchangeRef as J, type AxisLawArticleSummary as K, type AxisLawDecision as L, type AxisLawEvaluationContext as M, type AxisLawEvaluationResult as N, ObserverDispatcherService as O, type AxisLawEvaluator as P, type AxisObserverBinding as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverBindingOptions as U, type AxisObserverContext as V, type AxisObserverDefinition as W, type AxisObserverEvent as X, type AxisObserverRef as Y, type AxisObserverRegistration as Z, AxisPublic as _, type AxisObserverBindingInput as a, type TickAuthVerifier as a$, type AxisRateLimitConfig as a0, type AxisSensorConfigProvider as a1, AxisStream as a2, type AxisStreamOptions as a3, BodyBudgetSensor as a4, CAPSULE_POLICY_METADATA_KEY as a5, CONTRACT_METADATA_KEY as a6, CapabilityEnforcementSensor as a7, Capsule as a8, CapsulePolicy as a9, OBSERVER_METADATA_KEY as aA, Observer as aB, ObserverRegistry as aC, ProofPresenceSensor as aD, ProtocolStrictSensor as aE, REQUIRED_PROOF_METADATA_KEY as aF, ReceiptPolicySensor as aG, type RegisteredChainConfig as aH, RequiredProof as aI, RiskDecision as aJ, type RiskEvaluation as aK, RiskGateSensor as aL, type RiskGateSensorOptions as aM, type RiskSignal as aN, type RiskSignalCollector as aO, SENSITIVITY_METADATA_KEY as aP, SchemaValidationSensor as aQ, Sensitivity as aR, type SensorConfigSnapshot as aS, type SensorsSource as aT, StreamScopeSensor as aU, TLVParseSensor as aV, TLV_FIELDS_KEY as aW, TLV_VALIDATORS_KEY as aX, type TickAuthCapsuleRef as aY, TickAuthSensor as aZ, type TickAuthSensorOptions as a_, type CapsulePolicyOptions as aa, type CapsuleScopeMode as ab, ChunkHashSensor as ac, Contract as ad, DEFAULT_CONTRACTS as ae, EntropySensor as af, type ExecutionContract as ag, ExecutionTimeoutSensor as ah, FALLBACK_CONTRACT as ai, FrameBudgetSensor as aj, FrameHeaderSanitySensor as ak, HeaderTLVLimitSensor as al, INTENT_METADATA_KEY as am, INTENT_ROUTES_KEY as an, Intent as ao, IntentAllowlistSensor as ap, type IntentKind as aq, type IntentOptions as ar, IntentRegistrySensor as as, type IntentRoute as at, type LawArticlePresenceMode as au, LawArticlePresenceSensor as av, type LawArticlePresenceSensorOptions as aw, LawEvaluationSensor as ax, type LawEvaluationSensorOptions as ay, OBSERVER_BINDINGS_KEY as az, type AxisIntentSensorBindingInput as b, TlvEnum as b0, TlvField as b1, type TlvFieldKind as b2, type TlvFieldMeta as b3, type TlvFieldOptions as b4, TlvMinLen as b5, TlvRange as b6, TlvUtf8Pattern as b7, TlvValidate as b8, type TlvValidatorMeta as b9, TpsSensor as ba, type TpsSensorOptions as bb, VarintHardeningSensor as bc, Witness as bd, buildAxisLawEvaluationContext as be, toIntentSensorBinding as bf, toObserverBinding as bg, IntentRouter as c, type AxisChainEnvelope as d, type AxisChainResult as e, type AxisCapsuleRef as f, type AxisChainStep as g, type AxisContext as h, AXIS_ANONYMOUS_KEY as i, AXIS_AUTHORIZED_KEY as j, AXIS_META_KEY as k, AXIS_PUBLIC_KEY as l, AXIS_RATE_LIMIT_KEY as m, AXIS_STREAM_META_KEY as n, AccessProfileResolverSensor as o, Axis as p, AxisAnonymous as q, AxisAuthorized as r, type AxisChainEncryption as s, type AxisChainRequest as t, type AxisChainStatus as u, type AxisChainStepResult as v, type AxisChainStepStatus as w, type AxisConfigReader as x, type AxisEffect as y, type AxisExecutionMode as z };
|
|
@@ -371,13 +371,25 @@ interface AxisDependencyResolver {
|
|
|
371
371
|
interface AxisConfigReader {
|
|
372
372
|
get<T = string>(key: string): T | undefined;
|
|
373
373
|
}
|
|
374
|
+
type SensorsSource = "ENV" | "REDIS" | "DB" | "ON_MEMORY";
|
|
375
|
+
interface SensorConfigSnapshot {
|
|
376
|
+
source?: SensorsSource | string;
|
|
377
|
+
enabledSensors?: readonly string[] | null;
|
|
378
|
+
disabledSensors?: readonly string[] | null;
|
|
379
|
+
version?: string | number;
|
|
380
|
+
updatedAt?: number;
|
|
381
|
+
}
|
|
382
|
+
interface AxisSensorConfigProvider {
|
|
383
|
+
getSensorConfig(): SensorConfigSnapshot | undefined;
|
|
384
|
+
}
|
|
374
385
|
declare class SensorRegistry {
|
|
375
386
|
private readonly configService?;
|
|
387
|
+
private readonly sensorConfigProvider?;
|
|
376
388
|
private sensors;
|
|
377
389
|
private sensorsByName;
|
|
378
390
|
private sensorsByType;
|
|
379
391
|
private readonly logger;
|
|
380
|
-
constructor(configService?: AxisConfigReader | undefined);
|
|
392
|
+
constructor(configService?: AxisConfigReader | undefined, sensorConfigProvider?: AxisSensorConfigProvider | undefined);
|
|
381
393
|
register(sensor: AxisSensor): void;
|
|
382
394
|
list(): AxisSensor[];
|
|
383
395
|
resolve(ref: AxisIntentSensorRef): AxisSensor | undefined;
|
|
@@ -389,9 +401,18 @@ declare class SensorRegistry {
|
|
|
389
401
|
postDecodeCount: number;
|
|
390
402
|
};
|
|
391
403
|
clear(): void;
|
|
404
|
+
getSensorConfig(): Required<Pick<SensorConfigSnapshot, "enabledSensors" | "disabledSensors">> & {
|
|
405
|
+
source: SensorsSource | string;
|
|
406
|
+
};
|
|
392
407
|
private isPreDecodeSensor;
|
|
393
408
|
private isPostDecodeSensor;
|
|
394
409
|
private indexSensor;
|
|
410
|
+
private filterEnabledSensors;
|
|
411
|
+
private isSensorEnabled;
|
|
412
|
+
private getSensorNames;
|
|
413
|
+
private getSensorsSource;
|
|
414
|
+
private parseConfigList;
|
|
415
|
+
private normalizeList;
|
|
395
416
|
}
|
|
396
417
|
|
|
397
418
|
interface IntentSchema {
|
|
@@ -908,4 +929,4 @@ declare class VarintHardeningSensor implements AxisSensor {
|
|
|
908
929
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
909
930
|
}
|
|
910
931
|
|
|
911
|
-
export {
|
|
932
|
+
export { AxisRateLimit as $, type AxisIntentSensorOptions as A, type AxisIntentEnvelope as B, type ChainOptions as C, type AxisIntentObserver as D, type AxisIntentSensorBinding as E, type AxisIntentSensorBindingOptions as F, type AxisIntentSensorRef as G, type AxisIntentSensorWhen as H, type IntentTlvField as I, type AxisKeyExchangeRef as J, type AxisLawArticleSummary as K, type AxisLawDecision as L, type AxisLawEvaluationContext as M, type AxisLawEvaluationResult as N, ObserverDispatcherService as O, type AxisLawEvaluator as P, type AxisObserverBinding as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverBindingOptions as U, type AxisObserverContext as V, type AxisObserverDefinition as W, type AxisObserverEvent as X, type AxisObserverRef as Y, type AxisObserverRegistration as Z, AxisPublic as _, type AxisObserverBindingInput as a, type TickAuthVerifier as a$, type AxisRateLimitConfig as a0, type AxisSensorConfigProvider as a1, AxisStream as a2, type AxisStreamOptions as a3, BodyBudgetSensor as a4, CAPSULE_POLICY_METADATA_KEY as a5, CONTRACT_METADATA_KEY as a6, CapabilityEnforcementSensor as a7, Capsule as a8, CapsulePolicy as a9, OBSERVER_METADATA_KEY as aA, Observer as aB, ObserverRegistry as aC, ProofPresenceSensor as aD, ProtocolStrictSensor as aE, REQUIRED_PROOF_METADATA_KEY as aF, ReceiptPolicySensor as aG, type RegisteredChainConfig as aH, RequiredProof as aI, RiskDecision as aJ, type RiskEvaluation as aK, RiskGateSensor as aL, type RiskGateSensorOptions as aM, type RiskSignal as aN, type RiskSignalCollector as aO, SENSITIVITY_METADATA_KEY as aP, SchemaValidationSensor as aQ, Sensitivity as aR, type SensorConfigSnapshot as aS, type SensorsSource as aT, StreamScopeSensor as aU, TLVParseSensor as aV, TLV_FIELDS_KEY as aW, TLV_VALIDATORS_KEY as aX, type TickAuthCapsuleRef as aY, TickAuthSensor as aZ, type TickAuthSensorOptions as a_, type CapsulePolicyOptions as aa, type CapsuleScopeMode as ab, ChunkHashSensor as ac, Contract as ad, DEFAULT_CONTRACTS as ae, EntropySensor as af, type ExecutionContract as ag, ExecutionTimeoutSensor as ah, FALLBACK_CONTRACT as ai, FrameBudgetSensor as aj, FrameHeaderSanitySensor as ak, HeaderTLVLimitSensor as al, INTENT_METADATA_KEY as am, INTENT_ROUTES_KEY as an, Intent as ao, IntentAllowlistSensor as ap, type IntentKind as aq, type IntentOptions as ar, IntentRegistrySensor as as, type IntentRoute as at, type LawArticlePresenceMode as au, LawArticlePresenceSensor as av, type LawArticlePresenceSensorOptions as aw, LawEvaluationSensor as ax, type LawEvaluationSensorOptions as ay, OBSERVER_BINDINGS_KEY as az, type AxisIntentSensorBindingInput as b, TlvEnum as b0, TlvField as b1, type TlvFieldKind as b2, type TlvFieldMeta as b3, type TlvFieldOptions as b4, TlvMinLen as b5, TlvRange as b6, TlvUtf8Pattern as b7, TlvValidate as b8, type TlvValidatorMeta as b9, TpsSensor as ba, type TpsSensorOptions as bb, VarintHardeningSensor as bc, Witness as bd, buildAxisLawEvaluationContext as be, toIntentSensorBinding as bf, toObserverBinding as bg, IntentRouter as c, type AxisChainEnvelope as d, type AxisChainResult as e, type AxisCapsuleRef as f, type AxisChainStep as g, type AxisContext as h, AXIS_ANONYMOUS_KEY as i, AXIS_AUTHORIZED_KEY as j, AXIS_META_KEY as k, AXIS_PUBLIC_KEY as l, AXIS_RATE_LIMIT_KEY as m, AXIS_STREAM_META_KEY as n, AccessProfileResolverSensor as o, Axis as p, AxisAnonymous as q, AxisAuthorized as r, type AxisChainEncryption as s, type AxisChainRequest as t, type AxisChainStatus as u, type AxisChainStepResult as v, type AxisChainStepStatus as w, type AxisConfigReader as x, type AxisEffect as y, type AxisExecutionMode as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-
|
|
2
|
-
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as
|
|
1
|
+
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-OpaG6R6E.mjs';
|
|
2
|
+
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldKind, b3 as TlvFieldMeta, b4 as TlvFieldOptions, b5 as TlvMinLen, b6 as TlvRange, b7 as TlvUtf8Pattern, b8 as TlvValidate, b9 as TlvValidatorMeta, ba as TpsSensor, bb as TpsSensorOptions, bc as VarintHardeningSensor, bd as Witness, be as buildAxisLawEvaluationContext, bf as toIntentSensorBinding, bg as toObserverBinding } from './index-OpaG6R6E.mjs';
|
|
3
3
|
import { AxisFrame } from '@nextera.one/axis-protocol';
|
|
4
4
|
export { AXIS_MAGIC, AXIS_VERSION, AxisBinaryFrame, AxisFrame, TLV as AxisTlvType, 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_KINDS, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofKind, 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, decodeFrame, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeFrame, encodeTLVs, encodeVarint, getSignTarget, varintLength } from '@nextera.one/axis-protocol';
|
|
5
5
|
import { A as AxisObservation, L as LoomReceipt, T as ThreadState, W as WritValidationResult, G as Grant, a as GrantCapability, P as PresenceDeclaration, b as PresenceChallenge, c as Writ, R as Revocation, d as WritBody, e as WritMeta, f as PresenceReceipt, g as GrantStatus, h as PresenceStatus, i as PresenceProof, j as GrantValidationResult, k as PresenceVerifyResult } from './index-CXewlhg-.mjs';
|
|
@@ -511,7 +511,7 @@ declare const T: {
|
|
|
511
511
|
type AxisPacket = {
|
|
512
512
|
intent: string;
|
|
513
513
|
intentVersion: number;
|
|
514
|
-
actorId
|
|
514
|
+
actorId?: string;
|
|
515
515
|
capsuleId?: Buffer;
|
|
516
516
|
pid: Buffer;
|
|
517
517
|
nonce: Buffer;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-
|
|
2
|
-
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as
|
|
1
|
+
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-CjHt1HEv.js';
|
|
2
|
+
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldKind, b3 as TlvFieldMeta, b4 as TlvFieldOptions, b5 as TlvMinLen, b6 as TlvRange, b7 as TlvUtf8Pattern, b8 as TlvValidate, b9 as TlvValidatorMeta, ba as TpsSensor, bb as TpsSensorOptions, bc as VarintHardeningSensor, bd as Witness, be as buildAxisLawEvaluationContext, bf as toIntentSensorBinding, bg as toObserverBinding } from './index-CjHt1HEv.js';
|
|
3
3
|
import { AxisFrame } from '@nextera.one/axis-protocol';
|
|
4
4
|
export { AXIS_MAGIC, AXIS_VERSION, AxisBinaryFrame, AxisFrame, TLV as AxisTlvType, 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_KINDS, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofKind, 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, decodeFrame, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeFrame, encodeTLVs, encodeVarint, getSignTarget, varintLength } from '@nextera.one/axis-protocol';
|
|
5
5
|
import { A as AxisObservation, L as LoomReceipt, T as ThreadState, W as WritValidationResult, G as Grant, a as GrantCapability, P as PresenceDeclaration, b as PresenceChallenge, c as Writ, R as Revocation, d as WritBody, e as WritMeta, f as PresenceReceipt, g as GrantStatus, h as PresenceStatus, i as PresenceProof, j as GrantValidationResult, k as PresenceVerifyResult } from './index-ChuwP1RU.js';
|
|
@@ -511,7 +511,7 @@ declare const T: {
|
|
|
511
511
|
type AxisPacket = {
|
|
512
512
|
intent: string;
|
|
513
513
|
intentVersion: number;
|
|
514
|
-
actorId
|
|
514
|
+
actorId?: string;
|
|
515
515
|
capsuleId?: Buffer;
|
|
516
516
|
pid: Buffer;
|
|
517
517
|
nonce: Buffer;
|
package/dist/index.js
CHANGED
|
@@ -5476,7 +5476,6 @@ function buildPacket(hdr, body, sig, flags = 0) {
|
|
|
5476
5476
|
const nonce = hm.get(T.NONCE)?.[0];
|
|
5477
5477
|
const tsMs = asBigint64BE(hm.get(T.TS_MS)?.[0]);
|
|
5478
5478
|
if (!intent) throw new Error("PACKET_MISSING_INTENT");
|
|
5479
|
-
if (!actorId) throw new Error("PACKET_MISSING_ACTOR_ID");
|
|
5480
5479
|
if (!nonce || nonce.length < 16 || nonce.length > 32)
|
|
5481
5480
|
throw new Error("PACKET_BAD_NONCE");
|
|
5482
5481
|
if (!pid) throw new Error("PACKET_MISSING_PID");
|
|
@@ -8617,8 +8616,9 @@ var init_sensor_registry = __esm({
|
|
|
8617
8616
|
"src/engine/registry/sensor.registry.ts"() {
|
|
8618
8617
|
init_axis_logger();
|
|
8619
8618
|
SensorRegistry = class _SensorRegistry {
|
|
8620
|
-
constructor(configService) {
|
|
8619
|
+
constructor(configService, sensorConfigProvider) {
|
|
8621
8620
|
this.configService = configService;
|
|
8621
|
+
this.sensorConfigProvider = sensorConfigProvider;
|
|
8622
8622
|
this.sensors = [];
|
|
8623
8623
|
this.sensorsByName = /* @__PURE__ */ new Map();
|
|
8624
8624
|
this.sensorsByType = /* @__PURE__ */ new Map();
|
|
@@ -8628,22 +8628,6 @@ var init_sensor_registry = __esm({
|
|
|
8628
8628
|
if (!sensor.name) {
|
|
8629
8629
|
throw new Error("AxisSensor must have a name");
|
|
8630
8630
|
}
|
|
8631
|
-
const enabledSensorsStr = this.configService?.get("ENABLED_SENSORS");
|
|
8632
|
-
const disabledSensorsStr = this.configService?.get("DISABLED_SENSORS");
|
|
8633
|
-
const enabledSensors = enabledSensorsStr ? enabledSensorsStr.split(",").map((s) => s.trim()) : null;
|
|
8634
|
-
const disabledSensors = disabledSensorsStr ? disabledSensorsStr.split(",").map((s) => s.trim()) : [];
|
|
8635
|
-
if (enabledSensors && !enabledSensors.includes(sensor.name)) {
|
|
8636
|
-
this.logger.log(
|
|
8637
|
-
`Skipping disabled sensor (not in ENABLED_SENSORS): ${sensor.name}`
|
|
8638
|
-
);
|
|
8639
|
-
return;
|
|
8640
|
-
}
|
|
8641
|
-
if (disabledSensors.includes(sensor.name)) {
|
|
8642
|
-
this.logger.log(
|
|
8643
|
-
`Skipping disabled sensor (in DISABLED_SENSORS): ${sensor.name}`
|
|
8644
|
-
);
|
|
8645
|
-
return;
|
|
8646
|
-
}
|
|
8647
8631
|
if (sensor.order === void 0) {
|
|
8648
8632
|
throw new Error(`AxisSensor "${sensor.name}" must have an order field`);
|
|
8649
8633
|
}
|
|
@@ -8667,18 +8651,21 @@ var init_sensor_registry = __esm({
|
|
|
8667
8651
|
);
|
|
8668
8652
|
}
|
|
8669
8653
|
list() {
|
|
8670
|
-
return
|
|
8654
|
+
return this.filterEnabledSensors(this.sensors).sort(
|
|
8671
8655
|
(a, b) => (a.order ?? 999) - (b.order ?? 999)
|
|
8672
8656
|
);
|
|
8673
8657
|
}
|
|
8674
8658
|
resolve(ref) {
|
|
8675
8659
|
if (typeof ref === "string") {
|
|
8676
|
-
|
|
8660
|
+
const sensor2 = this.sensorsByName.get(ref);
|
|
8661
|
+
return sensor2 && this.isSensorEnabled(sensor2) ? sensor2 : void 0;
|
|
8677
8662
|
}
|
|
8678
|
-
|
|
8663
|
+
const sensor = this.sensorsByType.get(ref) ?? this.sensorsByName.get(ref.name);
|
|
8664
|
+
return sensor && this.isSensorEnabled(sensor) ? sensor : void 0;
|
|
8679
8665
|
}
|
|
8680
8666
|
getByName(name) {
|
|
8681
|
-
|
|
8667
|
+
const sensor = this.sensorsByName.get(name);
|
|
8668
|
+
return sensor && this.isSensorEnabled(sensor) ? sensor : void 0;
|
|
8682
8669
|
}
|
|
8683
8670
|
getPreDecodeSensors() {
|
|
8684
8671
|
return this.list().filter(
|
|
@@ -8701,6 +8688,22 @@ var init_sensor_registry = __esm({
|
|
|
8701
8688
|
this.sensorsByName.clear();
|
|
8702
8689
|
this.sensorsByType.clear();
|
|
8703
8690
|
}
|
|
8691
|
+
getSensorConfig() {
|
|
8692
|
+
const providerSnapshot = this.sensorConfigProvider?.getSensorConfig();
|
|
8693
|
+
const source = this.getSensorsSource(providerSnapshot);
|
|
8694
|
+
if (source !== "ENV" && providerSnapshot) {
|
|
8695
|
+
return {
|
|
8696
|
+
source,
|
|
8697
|
+
enabledSensors: this.normalizeList(providerSnapshot.enabledSensors),
|
|
8698
|
+
disabledSensors: this.normalizeList(providerSnapshot.disabledSensors)
|
|
8699
|
+
};
|
|
8700
|
+
}
|
|
8701
|
+
return {
|
|
8702
|
+
source,
|
|
8703
|
+
enabledSensors: this.parseConfigList("ENABLED_SENSORS"),
|
|
8704
|
+
disabledSensors: this.parseConfigList("DISABLED_SENSORS")
|
|
8705
|
+
};
|
|
8706
|
+
}
|
|
8704
8707
|
isPreDecodeSensor(sensor) {
|
|
8705
8708
|
const phase = typeof sensor.phase === "string" ? sensor.phase : sensor.phase?.phase;
|
|
8706
8709
|
if (phase) return phase === "PRE_DECODE";
|
|
@@ -8720,6 +8723,48 @@ var init_sensor_registry = __esm({
|
|
|
8720
8723
|
this.sensorsByName.set(sensorType.name, sensor);
|
|
8721
8724
|
}
|
|
8722
8725
|
}
|
|
8726
|
+
filterEnabledSensors(sensors) {
|
|
8727
|
+
return sensors.filter((sensor) => this.isSensorEnabled(sensor));
|
|
8728
|
+
}
|
|
8729
|
+
isSensorEnabled(sensor) {
|
|
8730
|
+
const config = this.getSensorConfig();
|
|
8731
|
+
const enabled = new Set(config.enabledSensors);
|
|
8732
|
+
const disabled = new Set(config.disabledSensors);
|
|
8733
|
+
const names = this.getSensorNames(sensor);
|
|
8734
|
+
if (names.some((name) => disabled.has(name))) {
|
|
8735
|
+
return false;
|
|
8736
|
+
}
|
|
8737
|
+
if (enabled.size > 0 && !names.some((name) => enabled.has(name))) {
|
|
8738
|
+
return false;
|
|
8739
|
+
}
|
|
8740
|
+
return true;
|
|
8741
|
+
}
|
|
8742
|
+
getSensorNames(sensor) {
|
|
8743
|
+
const names = [sensor.name];
|
|
8744
|
+
const constructorName = sensor.constructor?.name;
|
|
8745
|
+
if (constructorName && !names.includes(constructorName)) {
|
|
8746
|
+
names.push(constructorName);
|
|
8747
|
+
}
|
|
8748
|
+
return names;
|
|
8749
|
+
}
|
|
8750
|
+
getSensorsSource(providerSnapshot) {
|
|
8751
|
+
const raw = this.configService?.get("SENSORS_SOURCE") ?? providerSnapshot?.source ?? "ENV";
|
|
8752
|
+
const normalized = String(raw || "ENV").trim().toUpperCase();
|
|
8753
|
+
return normalized || "ENV";
|
|
8754
|
+
}
|
|
8755
|
+
parseConfigList(key) {
|
|
8756
|
+
return this.normalizeList(this.configService?.get(key));
|
|
8757
|
+
}
|
|
8758
|
+
normalizeList(value) {
|
|
8759
|
+
if (!value) return [];
|
|
8760
|
+
if (Array.isArray(value)) {
|
|
8761
|
+
return value.map((entry) => String(entry).trim()).filter(Boolean);
|
|
8762
|
+
}
|
|
8763
|
+
if (typeof value === "string") {
|
|
8764
|
+
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
8765
|
+
}
|
|
8766
|
+
return [];
|
|
8767
|
+
}
|
|
8723
8768
|
};
|
|
8724
8769
|
}
|
|
8725
8770
|
});
|