@nextera.one/axis-server-sdk 2.3.2 → 2.3.3
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-Bng8utj8.d.mts → index-D_Av0pG-.d.mts} +27 -0
- package/dist/{index-DJbM2lNM.d.ts → index-wh9piy0E.d.ts} +27 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -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 +105 -0
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +106 -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,22 @@ 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
|
+
getRegisteredHandlers(): string[];
|
|
494
|
+
getSystemIntents(): string[];
|
|
495
|
+
isHandlerPublic(handlerName: string): boolean;
|
|
496
|
+
isHandlerAnonymous(handlerName: string): boolean;
|
|
497
|
+
isHandlerAuthorized(handlerName: string): boolean;
|
|
498
|
+
getHandlerProof(handlerName: string): RequiredProofKind[] | undefined;
|
|
499
|
+
getHandlerContract(handlerName: string): Record<string, any> | undefined;
|
|
500
|
+
getHandlerSensitivity(handlerName: string): SensitivityLevel | undefined;
|
|
501
|
+
getHandlerRateLimit(handlerName: string): AxisRateLimitConfig | undefined;
|
|
502
|
+
getHandlerCapsulePolicy(handlerName: string): CapsulePolicyOptions | undefined;
|
|
503
|
+
getHandlerSummary(handlerName: string): HandlerSummary | null;
|
|
504
|
+
getAllHandlerSummaries(): Map<string, HandlerSummary>;
|
|
479
505
|
private emitIntentObservers;
|
|
480
506
|
private runIntentSensors;
|
|
507
|
+
private trackHandlerIntent;
|
|
481
508
|
private resolveIntentSensor;
|
|
482
509
|
private getEffectiveCapsulePolicy;
|
|
483
510
|
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,22 @@ 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
|
+
getRegisteredHandlers(): string[];
|
|
494
|
+
getSystemIntents(): string[];
|
|
495
|
+
isHandlerPublic(handlerName: string): boolean;
|
|
496
|
+
isHandlerAnonymous(handlerName: string): boolean;
|
|
497
|
+
isHandlerAuthorized(handlerName: string): boolean;
|
|
498
|
+
getHandlerProof(handlerName: string): RequiredProofKind[] | undefined;
|
|
499
|
+
getHandlerContract(handlerName: string): Record<string, any> | undefined;
|
|
500
|
+
getHandlerSensitivity(handlerName: string): SensitivityLevel | undefined;
|
|
501
|
+
getHandlerRateLimit(handlerName: string): AxisRateLimitConfig | undefined;
|
|
502
|
+
getHandlerCapsulePolicy(handlerName: string): CapsulePolicyOptions | undefined;
|
|
503
|
+
getHandlerSummary(handlerName: string): HandlerSummary | null;
|
|
504
|
+
getAllHandlerSummaries(): Map<string, HandlerSummary>;
|
|
479
505
|
private emitIntentObservers;
|
|
480
506
|
private runIntentSensors;
|
|
507
|
+
private trackHandlerIntent;
|
|
481
508
|
private resolveIntentSensor;
|
|
482
509
|
private getEffectiveCapsulePolicy;
|
|
483
510
|
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-D_Av0pG-.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-D_Av0pG-.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-wh9piy0E.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-wh9piy0E.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,99 @@ 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
|
+
/** All registered handler class names. */
|
|
2915
|
+
getRegisteredHandlers() {
|
|
2916
|
+
return Array.from(this.handlerIntents.keys());
|
|
2917
|
+
}
|
|
2918
|
+
/** The system/builtin intents (ping, time, echo, chain, intent.exec). */
|
|
2919
|
+
getSystemIntents() {
|
|
2920
|
+
return [..._IntentRouter.BUILTIN_INTENTS];
|
|
2921
|
+
}
|
|
2922
|
+
/** True if every intent in the handler is public, or any one is public — returns true if ANY intent is @AxisPublic. */
|
|
2923
|
+
isHandlerPublic(handlerName) {
|
|
2924
|
+
return this.getHandlerIntents(handlerName).some((i) => this.isPublic(i));
|
|
2925
|
+
}
|
|
2926
|
+
/** True if any intent in the handler is @AxisAnonymous. */
|
|
2927
|
+
isHandlerAnonymous(handlerName) {
|
|
2928
|
+
return this.getHandlerIntents(handlerName).some((i) => this.isAnonymous(i));
|
|
2929
|
+
}
|
|
2930
|
+
/** True if any intent in the handler is @AxisAuthorized. */
|
|
2931
|
+
isHandlerAuthorized(handlerName) {
|
|
2932
|
+
return this.getHandlerIntents(handlerName).some(
|
|
2933
|
+
(i) => this.isAuthorized(i)
|
|
2934
|
+
);
|
|
2935
|
+
}
|
|
2936
|
+
/** Union of all required proof kinds across the handler's intents (deduplicated). */
|
|
2937
|
+
getHandlerProof(handlerName) {
|
|
2938
|
+
const all = this.getHandlerIntents(handlerName).flatMap(
|
|
2939
|
+
(i) => this.getRequiredProof(i) ?? []
|
|
2940
|
+
);
|
|
2941
|
+
if (all.length === 0) return void 0;
|
|
2942
|
+
return [...new Set(all)];
|
|
2943
|
+
}
|
|
2944
|
+
/** Contract from the first intent that has one (class-level contracts propagate to all intents). */
|
|
2945
|
+
getHandlerContract(handlerName) {
|
|
2946
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2947
|
+
const contract = this.getContract(intent);
|
|
2948
|
+
if (contract) return contract;
|
|
2949
|
+
}
|
|
2950
|
+
return void 0;
|
|
2951
|
+
}
|
|
2952
|
+
/** Sensitivity from the first intent that has one. */
|
|
2953
|
+
getHandlerSensitivity(handlerName) {
|
|
2954
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2955
|
+
const sensitivity = this.getSensitivity(intent);
|
|
2956
|
+
if (sensitivity) return sensitivity;
|
|
2957
|
+
}
|
|
2958
|
+
return void 0;
|
|
2959
|
+
}
|
|
2960
|
+
/** Rate limit from the first intent that has one. */
|
|
2961
|
+
getHandlerRateLimit(handlerName) {
|
|
2962
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2963
|
+
const rateLimit = this.getRateLimit(intent);
|
|
2964
|
+
if (rateLimit) return rateLimit;
|
|
2965
|
+
}
|
|
2966
|
+
return void 0;
|
|
2967
|
+
}
|
|
2968
|
+
/** Capsule policy from the first intent that has one. */
|
|
2969
|
+
getHandlerCapsulePolicy(handlerName) {
|
|
2970
|
+
for (const intent of this.getHandlerIntents(handlerName)) {
|
|
2971
|
+
const policy = this.intentCapsulePolicies.get(intent);
|
|
2972
|
+
if (policy) return policy;
|
|
2973
|
+
}
|
|
2974
|
+
return void 0;
|
|
2975
|
+
}
|
|
2976
|
+
/** Full summary of a handler's registered intents and aggregated policies. Returns null if unknown. */
|
|
2977
|
+
getHandlerSummary(handlerName) {
|
|
2978
|
+
const intents = this.getHandlerIntents(handlerName);
|
|
2979
|
+
if (intents.length === 0) return null;
|
|
2980
|
+
return {
|
|
2981
|
+
handler: handlerName,
|
|
2982
|
+
intents,
|
|
2983
|
+
isPublic: this.isHandlerPublic(handlerName),
|
|
2984
|
+
isAnonymous: this.isHandlerAnonymous(handlerName),
|
|
2985
|
+
isAuthorized: this.isHandlerAuthorized(handlerName),
|
|
2986
|
+
requiredProof: this.getHandlerProof(handlerName),
|
|
2987
|
+
contract: this.getHandlerContract(handlerName),
|
|
2988
|
+
sensitivity: this.getHandlerSensitivity(handlerName),
|
|
2989
|
+
rateLimit: this.getHandlerRateLimit(handlerName),
|
|
2990
|
+
capsulePolicy: this.getHandlerCapsulePolicy(handlerName)
|
|
2991
|
+
};
|
|
2992
|
+
}
|
|
2993
|
+
/** Summary of all registered handlers keyed by handler class name. */
|
|
2994
|
+
getAllHandlerSummaries() {
|
|
2995
|
+
const result = /* @__PURE__ */ new Map();
|
|
2996
|
+
for (const handlerName of this.handlerIntents.keys()) {
|
|
2997
|
+
const summary = this.getHandlerSummary(handlerName);
|
|
2998
|
+
if (summary) result.set(handlerName, summary);
|
|
2999
|
+
}
|
|
3000
|
+
return result;
|
|
3001
|
+
}
|
|
2905
3002
|
async emitIntentObservers(bindings, context) {
|
|
2906
3003
|
if (!this.observerDispatcher) return;
|
|
2907
3004
|
await this.observerDispatcher.dispatch(
|
|
@@ -2948,6 +3045,14 @@ var init_intent_router = __esm({
|
|
|
2948
3045
|
}
|
|
2949
3046
|
}
|
|
2950
3047
|
}
|
|
3048
|
+
trackHandlerIntent(handlerName, intent) {
|
|
3049
|
+
const existing = this.handlerIntents.get(handlerName);
|
|
3050
|
+
if (existing) {
|
|
3051
|
+
if (!existing.includes(intent)) existing.push(intent);
|
|
3052
|
+
} else {
|
|
3053
|
+
this.handlerIntents.set(handlerName, [intent]);
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
2951
3056
|
resolveIntentSensor(ref) {
|
|
2952
3057
|
const registered = this.sensorRegistry?.resolve(ref);
|
|
2953
3058
|
if (registered) {
|