@nextera.one/axis-server-sdk 2.3.2 → 2.3.4
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-DJbM2lNM.d.ts → index-CSIGjS-6.d.ts} +28 -0
- package/dist/{index-Bng8utj8.d.mts → index-Cv_XfeQi.d.mts} +28 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -4
- 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 +112 -0
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +113 -4
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -420,6 +420,18 @@ interface AxisEffect {
|
|
|
420
420
|
headers?: Map<number, Uint8Array>;
|
|
421
421
|
metadata?: any;
|
|
422
422
|
}
|
|
423
|
+
interface HandlerSummary {
|
|
424
|
+
handler: string;
|
|
425
|
+
intents: string[];
|
|
426
|
+
isPublic: boolean;
|
|
427
|
+
isAnonymous: boolean;
|
|
428
|
+
isAuthorized: boolean;
|
|
429
|
+
requiredProof?: RequiredProofKind[];
|
|
430
|
+
contract?: Record<string, any>;
|
|
431
|
+
sensitivity?: SensitivityLevel;
|
|
432
|
+
rateLimit?: AxisRateLimitConfig;
|
|
433
|
+
capsulePolicy?: CapsulePolicyOptions;
|
|
434
|
+
}
|
|
423
435
|
declare class IntentRouter {
|
|
424
436
|
private readonly logger;
|
|
425
437
|
private readonly decoder;
|
|
@@ -447,6 +459,7 @@ declare class IntentRouter {
|
|
|
447
459
|
private intentRateLimits;
|
|
448
460
|
private cceHandlers;
|
|
449
461
|
private ccePipelineConfig;
|
|
462
|
+
private handlerIntents;
|
|
450
463
|
constructor(dependencyResolver?: AxisDependencyResolver, observerDispatcher?: ObserverDispatcherService, sensorRegistry?: SensorRegistry);
|
|
451
464
|
getSchema(intent: string): IntentSchema | undefined;
|
|
452
465
|
getValidators(intent: string): Map<number, TlvValidatorFn[]> | undefined;
|
|
@@ -476,8 +489,23 @@ declare class IntentRouter {
|
|
|
476
489
|
isAnonymous(intent: string): boolean;
|
|
477
490
|
isAuthorized(intent: string): boolean;
|
|
478
491
|
getRateLimit(intent: string): AxisRateLimitConfig | undefined;
|
|
492
|
+
getHandlerIntents(handlerName: string): string[];
|
|
493
|
+
getHandlerByIntent(intent: string): string | undefined;
|
|
494
|
+
getRegisteredHandlers(): string[];
|
|
495
|
+
getSystemIntents(): string[];
|
|
496
|
+
isHandlerPublic(handlerName: string): boolean;
|
|
497
|
+
isHandlerAnonymous(handlerName: string): boolean;
|
|
498
|
+
isHandlerAuthorized(handlerName: string): boolean;
|
|
499
|
+
getHandlerProof(handlerName: string): RequiredProofKind[] | undefined;
|
|
500
|
+
getHandlerContract(handlerName: string): Record<string, any> | undefined;
|
|
501
|
+
getHandlerSensitivity(handlerName: string): SensitivityLevel | undefined;
|
|
502
|
+
getHandlerRateLimit(handlerName: string): AxisRateLimitConfig | undefined;
|
|
503
|
+
getHandlerCapsulePolicy(handlerName: string): CapsulePolicyOptions | undefined;
|
|
504
|
+
getHandlerSummary(handlerName: string): HandlerSummary | null;
|
|
505
|
+
getAllHandlerSummaries(): Map<string, HandlerSummary>;
|
|
479
506
|
private emitIntentObservers;
|
|
480
507
|
private runIntentSensors;
|
|
508
|
+
private trackHandlerIntent;
|
|
481
509
|
private resolveIntentSensor;
|
|
482
510
|
private getEffectiveCapsulePolicy;
|
|
483
511
|
private enforceCapsulePolicy;
|
|
@@ -420,6 +420,18 @@ interface AxisEffect {
|
|
|
420
420
|
headers?: Map<number, Uint8Array>;
|
|
421
421
|
metadata?: any;
|
|
422
422
|
}
|
|
423
|
+
interface HandlerSummary {
|
|
424
|
+
handler: string;
|
|
425
|
+
intents: string[];
|
|
426
|
+
isPublic: boolean;
|
|
427
|
+
isAnonymous: boolean;
|
|
428
|
+
isAuthorized: boolean;
|
|
429
|
+
requiredProof?: RequiredProofKind[];
|
|
430
|
+
contract?: Record<string, any>;
|
|
431
|
+
sensitivity?: SensitivityLevel;
|
|
432
|
+
rateLimit?: AxisRateLimitConfig;
|
|
433
|
+
capsulePolicy?: CapsulePolicyOptions;
|
|
434
|
+
}
|
|
423
435
|
declare class IntentRouter {
|
|
424
436
|
private readonly logger;
|
|
425
437
|
private readonly decoder;
|
|
@@ -447,6 +459,7 @@ declare class IntentRouter {
|
|
|
447
459
|
private intentRateLimits;
|
|
448
460
|
private cceHandlers;
|
|
449
461
|
private ccePipelineConfig;
|
|
462
|
+
private handlerIntents;
|
|
450
463
|
constructor(dependencyResolver?: AxisDependencyResolver, observerDispatcher?: ObserverDispatcherService, sensorRegistry?: SensorRegistry);
|
|
451
464
|
getSchema(intent: string): IntentSchema | undefined;
|
|
452
465
|
getValidators(intent: string): Map<number, TlvValidatorFn[]> | undefined;
|
|
@@ -476,8 +489,23 @@ declare class IntentRouter {
|
|
|
476
489
|
isAnonymous(intent: string): boolean;
|
|
477
490
|
isAuthorized(intent: string): boolean;
|
|
478
491
|
getRateLimit(intent: string): AxisRateLimitConfig | undefined;
|
|
492
|
+
getHandlerIntents(handlerName: string): string[];
|
|
493
|
+
getHandlerByIntent(intent: string): string | undefined;
|
|
494
|
+
getRegisteredHandlers(): string[];
|
|
495
|
+
getSystemIntents(): string[];
|
|
496
|
+
isHandlerPublic(handlerName: string): boolean;
|
|
497
|
+
isHandlerAnonymous(handlerName: string): boolean;
|
|
498
|
+
isHandlerAuthorized(handlerName: string): boolean;
|
|
499
|
+
getHandlerProof(handlerName: string): RequiredProofKind[] | undefined;
|
|
500
|
+
getHandlerContract(handlerName: string): Record<string, any> | undefined;
|
|
501
|
+
getHandlerSensitivity(handlerName: string): SensitivityLevel | undefined;
|
|
502
|
+
getHandlerRateLimit(handlerName: string): AxisRateLimitConfig | undefined;
|
|
503
|
+
getHandlerCapsulePolicy(handlerName: string): CapsulePolicyOptions | undefined;
|
|
504
|
+
getHandlerSummary(handlerName: string): HandlerSummary | null;
|
|
505
|
+
getAllHandlerSummaries(): Map<string, HandlerSummary>;
|
|
479
506
|
private emitIntentObservers;
|
|
480
507
|
private runIntentSensors;
|
|
508
|
+
private trackHandlerIntent;
|
|
481
509
|
private resolveIntentSensor;
|
|
482
510
|
private getEffectiveCapsulePolicy;
|
|
483
511
|
private enforceCapsulePolicy;
|
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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawEvaluationSensor, aq as LawEvaluationSensorOptions, ar as OBSERVER_BINDINGS_KEY, as as OBSERVER_METADATA_KEY, at as Observer, au as ObserverRegistry, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ax as REQUIRED_PROOF_METADATA_KEY, ay as ReceiptPolicySensor, az as RegisteredChainConfig, aA as RequiredProof, aB as RiskDecision, aC as RiskEvaluation, aD as RiskGateSensor, aE as RiskGateSensorOptions, aF as RiskSignal, aG as RiskSignalCollector, aH as SENSITIVITY_METADATA_KEY, aI as SchemaValidationSensor, aJ as Sensitivity, aK as StreamScopeSensor, aL as TLVParseSensor, aM as TLV_FIELDS_KEY, aN as TLV_VALIDATORS_KEY, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, aS as TlvEnum, aT as TlvField, aU as TlvFieldKind, aV as TlvFieldMeta, aW as TlvFieldOptions, aX as TlvMinLen, aY as TlvRange, aZ as TlvUtf8Pattern, a_ as TlvValidate, a$ as TlvValidatorMeta, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor, b3 as Witness, b4 as buildAxisLawEvaluationContext, b5 as toIntentSensorBinding, b6 as toObserverBinding } from './index-
|
|
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-Cv_XfeQi.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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawEvaluationSensor, aq as LawEvaluationSensorOptions, ar as OBSERVER_BINDINGS_KEY, as as OBSERVER_METADATA_KEY, at as Observer, au as ObserverRegistry, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ax as REQUIRED_PROOF_METADATA_KEY, ay as ReceiptPolicySensor, az as RegisteredChainConfig, aA as RequiredProof, aB as RiskDecision, aC as RiskEvaluation, aD as RiskGateSensor, aE as RiskGateSensorOptions, aF as RiskSignal, aG as RiskSignalCollector, aH as SENSITIVITY_METADATA_KEY, aI as SchemaValidationSensor, aJ as Sensitivity, aK as StreamScopeSensor, aL as TLVParseSensor, aM as TLV_FIELDS_KEY, aN as TLV_VALIDATORS_KEY, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, aS as TlvEnum, aT as TlvField, aU as TlvFieldKind, aV as TlvFieldMeta, aW as TlvFieldOptions, aX as TlvMinLen, aY as TlvRange, aZ as TlvUtf8Pattern, a_ as TlvValidate, a$ as TlvValidatorMeta, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor, b3 as Witness, b4 as buildAxisLawEvaluationContext, b5 as toIntentSensorBinding, b6 as toObserverBinding } from './index-Cv_XfeQi.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_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, 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-DiuKGnQw.mjs';
|
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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawEvaluationSensor, aq as LawEvaluationSensorOptions, ar as OBSERVER_BINDINGS_KEY, as as OBSERVER_METADATA_KEY, at as Observer, au as ObserverRegistry, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ax as REQUIRED_PROOF_METADATA_KEY, ay as ReceiptPolicySensor, az as RegisteredChainConfig, aA as RequiredProof, aB as RiskDecision, aC as RiskEvaluation, aD as RiskGateSensor, aE as RiskGateSensorOptions, aF as RiskSignal, aG as RiskSignalCollector, aH as SENSITIVITY_METADATA_KEY, aI as SchemaValidationSensor, aJ as Sensitivity, aK as StreamScopeSensor, aL as TLVParseSensor, aM as TLV_FIELDS_KEY, aN as TLV_VALIDATORS_KEY, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, aS as TlvEnum, aT as TlvField, aU as TlvFieldKind, aV as TlvFieldMeta, aW as TlvFieldOptions, aX as TlvMinLen, aY as TlvRange, aZ as TlvUtf8Pattern, a_ as TlvValidate, a$ as TlvValidatorMeta, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor, b3 as Witness, b4 as buildAxisLawEvaluationContext, b5 as toIntentSensorBinding, b6 as toObserverBinding } from './index-
|
|
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-CSIGjS-6.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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawEvaluationSensor, aq as LawEvaluationSensorOptions, ar as OBSERVER_BINDINGS_KEY, as as OBSERVER_METADATA_KEY, at as Observer, au as ObserverRegistry, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ax as REQUIRED_PROOF_METADATA_KEY, ay as ReceiptPolicySensor, az as RegisteredChainConfig, aA as RequiredProof, aB as RiskDecision, aC as RiskEvaluation, aD as RiskGateSensor, aE as RiskGateSensorOptions, aF as RiskSignal, aG as RiskSignalCollector, aH as SENSITIVITY_METADATA_KEY, aI as SchemaValidationSensor, aJ as Sensitivity, aK as StreamScopeSensor, aL as TLVParseSensor, aM as TLV_FIELDS_KEY, aN as TLV_VALIDATORS_KEY, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, aS as TlvEnum, aT as TlvField, aU as TlvFieldKind, aV as TlvFieldMeta, aW as TlvFieldOptions, aX as TlvMinLen, aY as TlvRange, aZ as TlvUtf8Pattern, a_ as TlvValidate, a$ as TlvValidatorMeta, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor, b3 as Witness, b4 as buildAxisLawEvaluationContext, b5 as toIntentSensorBinding, b6 as toObserverBinding } from './index-CSIGjS-6.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_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, 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-DMjzq8YO.js';
|
package/dist/index.js
CHANGED
|
@@ -2439,6 +2439,8 @@ var init_intent_router = __esm({
|
|
|
2439
2439
|
this.cceHandlers = /* @__PURE__ */ new Map();
|
|
2440
2440
|
/** CCE pipeline configuration (set via configureCce) */
|
|
2441
2441
|
this.ccePipelineConfig = null;
|
|
2442
|
+
/** Reverse index: handler class name → list of registered intents */
|
|
2443
|
+
this.handlerIntents = /* @__PURE__ */ new Map();
|
|
2442
2444
|
this.dependencyResolver = dependencyResolver;
|
|
2443
2445
|
this.observerDispatcher = observerDispatcher;
|
|
2444
2446
|
this.sensorRegistry = sensorRegistry;
|
|
@@ -2528,6 +2530,7 @@ var init_intent_router = __esm({
|
|
|
2528
2530
|
intentName,
|
|
2529
2531
|
`${instance.constructor.name}.${String(route.methodName)}`
|
|
2530
2532
|
);
|
|
2533
|
+
this.trackHandlerIntent(instance.constructor.name, intentName);
|
|
2531
2534
|
this.registerIntentMeta(
|
|
2532
2535
|
intentName,
|
|
2533
2536
|
proto,
|
|
@@ -2551,6 +2554,7 @@ var init_intent_router = __esm({
|
|
|
2551
2554
|
handlerSensors,
|
|
2552
2555
|
handlerObservers
|
|
2553
2556
|
);
|
|
2557
|
+
this.trackHandlerIntent(instance.constructor.name, intentName);
|
|
2554
2558
|
}
|
|
2555
2559
|
}
|
|
2556
2560
|
/**
|
|
@@ -2902,6 +2906,106 @@ var init_intent_router = __esm({
|
|
|
2902
2906
|
getRateLimit(intent) {
|
|
2903
2907
|
return this.intentRateLimits.get(intent);
|
|
2904
2908
|
}
|
|
2909
|
+
// ─── Handler-level Getters ─────────────────────────────────────────────────
|
|
2910
|
+
/** All intents registered under the given handler class name. */
|
|
2911
|
+
getHandlerIntents(handlerName) {
|
|
2912
|
+
return this.handlerIntents.get(handlerName) ?? [];
|
|
2913
|
+
}
|
|
2914
|
+
/** Returns the handler class name that owns the given intent, or undefined if not found. */
|
|
2915
|
+
getHandlerByIntent(intent) {
|
|
2916
|
+
for (const [handlerName, intents] of this.handlerIntents) {
|
|
2917
|
+
if (intents.includes(intent)) return handlerName;
|
|
2918
|
+
}
|
|
2919
|
+
return void 0;
|
|
2920
|
+
}
|
|
2921
|
+
/** All registered handler class names. */
|
|
2922
|
+
getRegisteredHandlers() {
|
|
2923
|
+
return Array.from(this.handlerIntents.keys());
|
|
2924
|
+
}
|
|
2925
|
+
/** The system/builtin intents (ping, time, echo, chain, intent.exec). */
|
|
2926
|
+
getSystemIntents() {
|
|
2927
|
+
return [..._IntentRouter.BUILTIN_INTENTS];
|
|
2928
|
+
}
|
|
2929
|
+
/** True if every intent in the handler is public, or any one is public — returns true if ANY intent is @AxisPublic. */
|
|
2930
|
+
isHandlerPublic(handlerName) {
|
|
2931
|
+
return this.getHandlerIntents(handlerName).some((i) => this.isPublic(i));
|
|
2932
|
+
}
|
|
2933
|
+
/** True if any intent in the handler is @AxisAnonymous. */
|
|
2934
|
+
isHandlerAnonymous(handlerName) {
|
|
2935
|
+
return this.getHandlerIntents(handlerName).some((i) => this.isAnonymous(i));
|
|
2936
|
+
}
|
|
2937
|
+
/** True if any intent in the handler is @AxisAuthorized. */
|
|
2938
|
+
isHandlerAuthorized(handlerName) {
|
|
2939
|
+
return this.getHandlerIntents(handlerName).some(
|
|
2940
|
+
(i) => this.isAuthorized(i)
|
|
2941
|
+
);
|
|
2942
|
+
}
|
|
2943
|
+
/** Union of all required proof kinds across the handler's intents (deduplicated). */
|
|
2944
|
+
getHandlerProof(handlerName) {
|
|
2945
|
+
const all = this.getHandlerIntents(handlerName).flatMap(
|
|
2946
|
+
(i) => this.getRequiredProof(i) ?? []
|
|
2947
|
+
);
|
|
2948
|
+
if (all.length === 0) return void 0;
|
|
2949
|
+
return [...new Set(all)];
|
|
2950
|
+
}
|
|
2951
|
+
/** Contract from the first intent that has one (class-level contracts propagate to all intents). */
|
|
2952
|
+
getHandlerContract(handlerName) {
|
|
2953
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2954
|
+
const contract = this.getContract(intent);
|
|
2955
|
+
if (contract) return contract;
|
|
2956
|
+
}
|
|
2957
|
+
return void 0;
|
|
2958
|
+
}
|
|
2959
|
+
/** Sensitivity from the first intent that has one. */
|
|
2960
|
+
getHandlerSensitivity(handlerName) {
|
|
2961
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2962
|
+
const sensitivity = this.getSensitivity(intent);
|
|
2963
|
+
if (sensitivity) return sensitivity;
|
|
2964
|
+
}
|
|
2965
|
+
return void 0;
|
|
2966
|
+
}
|
|
2967
|
+
/** Rate limit from the first intent that has one. */
|
|
2968
|
+
getHandlerRateLimit(handlerName) {
|
|
2969
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2970
|
+
const rateLimit = this.getRateLimit(intent);
|
|
2971
|
+
if (rateLimit) return rateLimit;
|
|
2972
|
+
}
|
|
2973
|
+
return void 0;
|
|
2974
|
+
}
|
|
2975
|
+
/** Capsule policy from the first intent that has one. */
|
|
2976
|
+
getHandlerCapsulePolicy(handlerName) {
|
|
2977
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2978
|
+
const policy = this.intentCapsulePolicies.get(intent);
|
|
2979
|
+
if (policy) return policy;
|
|
2980
|
+
}
|
|
2981
|
+
return void 0;
|
|
2982
|
+
}
|
|
2983
|
+
/** Full summary of a handler's registered intents and aggregated policies. Returns null if unknown. */
|
|
2984
|
+
getHandlerSummary(handlerName) {
|
|
2985
|
+
const intents = this.getHandlerIntents(handlerName);
|
|
2986
|
+
if (intents.length === 0) return null;
|
|
2987
|
+
return {
|
|
2988
|
+
handler: handlerName,
|
|
2989
|
+
intents,
|
|
2990
|
+
isPublic: this.isHandlerPublic(handlerName),
|
|
2991
|
+
isAnonymous: this.isHandlerAnonymous(handlerName),
|
|
2992
|
+
isAuthorized: this.isHandlerAuthorized(handlerName),
|
|
2993
|
+
requiredProof: this.getHandlerProof(handlerName),
|
|
2994
|
+
contract: this.getHandlerContract(handlerName),
|
|
2995
|
+
sensitivity: this.getHandlerSensitivity(handlerName),
|
|
2996
|
+
rateLimit: this.getHandlerRateLimit(handlerName),
|
|
2997
|
+
capsulePolicy: this.getHandlerCapsulePolicy(handlerName)
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
/** Summary of all registered handlers keyed by handler class name. */
|
|
3001
|
+
getAllHandlerSummaries() {
|
|
3002
|
+
const result = /* @__PURE__ */ new Map();
|
|
3003
|
+
for (const handlerName of this.handlerIntents.keys()) {
|
|
3004
|
+
const summary = this.getHandlerSummary(handlerName);
|
|
3005
|
+
if (summary) result.set(handlerName, summary);
|
|
3006
|
+
}
|
|
3007
|
+
return result;
|
|
3008
|
+
}
|
|
2905
3009
|
async emitIntentObservers(bindings, context) {
|
|
2906
3010
|
if (!this.observerDispatcher) return;
|
|
2907
3011
|
await this.observerDispatcher.dispatch(
|
|
@@ -2948,6 +3052,14 @@ var init_intent_router = __esm({
|
|
|
2948
3052
|
}
|
|
2949
3053
|
}
|
|
2950
3054
|
}
|
|
3055
|
+
trackHandlerIntent(handlerName, intent) {
|
|
3056
|
+
const existing = this.handlerIntents.get(handlerName);
|
|
3057
|
+
if (existing) {
|
|
3058
|
+
if (!existing.includes(intent)) existing.push(intent);
|
|
3059
|
+
} else {
|
|
3060
|
+
this.handlerIntents.set(handlerName, [intent]);
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
2951
3063
|
resolveIntentSensor(ref) {
|
|
2952
3064
|
const registered = this.sensorRegistry?.resolve(ref);
|
|
2953
3065
|
if (registered) {
|