@nextera.one/axis-server-sdk 2.3.9 → 2.3.12
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-DfG00R_f.d.mts → index-DZdmfbDZ.d.mts} +20 -1
- package/dist/{index-DPQEO0Qh.d.ts → index-D_6djkZB.d.ts} +20 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +146 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +146 -60
- 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 +146 -60
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +146 -60
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -749,6 +749,25 @@ declare class IntentRegistrySensor implements AxisSensor {
|
|
|
749
749
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
+
type LawArticlePresenceMode = "off" | "audit" | "strict";
|
|
753
|
+
interface LawArticlePresenceSensorOptions {
|
|
754
|
+
mode?: LawArticlePresenceMode | (() => LawArticlePresenceMode);
|
|
755
|
+
exemptIntents?: string[];
|
|
756
|
+
missingCode?: string;
|
|
757
|
+
auditScoreDelta?: number;
|
|
758
|
+
getLawArticleCount: (intent: string, input: SensorInput) => number | Promise<number>;
|
|
759
|
+
}
|
|
760
|
+
declare class LawArticlePresenceSensor implements AxisSensor {
|
|
761
|
+
private readonly options;
|
|
762
|
+
readonly name: string;
|
|
763
|
+
readonly order: number;
|
|
764
|
+
constructor(options: LawArticlePresenceSensorOptions);
|
|
765
|
+
supports(input: SensorInput): boolean;
|
|
766
|
+
run(input: SensorInput): Promise<SensorDecision>;
|
|
767
|
+
private mode;
|
|
768
|
+
private exemptIntents;
|
|
769
|
+
}
|
|
770
|
+
|
|
752
771
|
declare class LawEvaluationSensor implements AxisSensor {
|
|
753
772
|
private readonly options;
|
|
754
773
|
private readonly logger;
|
|
@@ -891,4 +910,4 @@ declare class VarintHardeningSensor implements AxisSensor {
|
|
|
891
910
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
892
911
|
}
|
|
893
912
|
|
|
894
|
-
export { BodyBudgetSensor as $, type AxisIntentSensorOptions as A, type AxisIntentSensorBinding as B, type ChainOptions as C, type AxisIntentSensorBindingOptions as D, type AxisIntentSensorRef as E, type AxisIntentSensorWhen as F, type AxisKeyExchangeRef as G, type AxisLawArticleSummary as H, type IntentTlvField as I, type AxisLawDecision as J, type AxisLawEvaluationContext as K, type AxisLawEvaluationResult as L, type AxisLawEvaluator as M, type AxisObserverBinding as N, ObserverDispatcherService as O, type AxisObserverBindingOptions as P, type AxisObserverContext as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverDefinition as U, type AxisObserverEvent as V, type AxisObserverRef as W, type AxisObserverRegistration as X, AxisPublic as Y, AxisRateLimit as Z, type AxisRateLimitConfig as _, type AxisObserverBindingInput as a,
|
|
913
|
+
export { BodyBudgetSensor as $, type AxisIntentSensorOptions as A, type AxisIntentSensorBinding as B, type ChainOptions as C, type AxisIntentSensorBindingOptions as D, type AxisIntentSensorRef as E, type AxisIntentSensorWhen as F, type AxisKeyExchangeRef as G, type AxisLawArticleSummary as H, type IntentTlvField as I, type AxisLawDecision as J, type AxisLawEvaluationContext as K, type AxisLawEvaluationResult as L, type AxisLawEvaluator as M, type AxisObserverBinding as N, ObserverDispatcherService as O, type AxisObserverBindingOptions as P, type AxisObserverContext as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverDefinition as U, type AxisObserverEvent as V, type AxisObserverRef as W, type AxisObserverRegistration as X, AxisPublic as Y, AxisRateLimit as Z, type AxisRateLimitConfig as _, type AxisObserverBindingInput as a, TlvRange as a$, CAPSULE_POLICY_METADATA_KEY as a0, CONTRACT_METADATA_KEY as a1, CapabilityEnforcementSensor as a2, Capsule as a3, CapsulePolicy as a4, type CapsulePolicyOptions as a5, type CapsuleScopeMode as a6, ChunkHashSensor as a7, Contract as a8, DEFAULT_CONTRACTS as a9, REQUIRED_PROOF_METADATA_KEY as aA, ReceiptPolicySensor as aB, type RegisteredChainConfig as aC, RequiredProof as aD, RiskDecision as aE, type RiskEvaluation as aF, RiskGateSensor as aG, type RiskGateSensorOptions as aH, type RiskSignal as aI, type RiskSignalCollector as aJ, SENSITIVITY_METADATA_KEY as aK, SchemaValidationSensor as aL, Sensitivity as aM, StreamScopeSensor as aN, TLVParseSensor as aO, TLV_FIELDS_KEY as aP, TLV_VALIDATORS_KEY as aQ, type TickAuthCapsuleRef as aR, TickAuthSensor as aS, type TickAuthSensorOptions as aT, type TickAuthVerifier as aU, TlvEnum as aV, TlvField as aW, type TlvFieldKind as aX, type TlvFieldMeta as aY, type TlvFieldOptions as aZ, TlvMinLen as a_, EntropySensor as aa, type ExecutionContract as ab, ExecutionTimeoutSensor as ac, FALLBACK_CONTRACT as ad, FrameBudgetSensor as ae, FrameHeaderSanitySensor as af, HeaderTLVLimitSensor as ag, INTENT_METADATA_KEY as ah, INTENT_ROUTES_KEY as ai, Intent as aj, IntentAllowlistSensor as ak, type IntentKind as al, type IntentOptions as am, IntentRegistrySensor as an, type IntentRoute as ao, type LawArticlePresenceMode as ap, LawArticlePresenceSensor as aq, type LawArticlePresenceSensorOptions as ar, LawEvaluationSensor as as, type LawEvaluationSensorOptions as at, OBSERVER_BINDINGS_KEY as au, OBSERVER_METADATA_KEY as av, Observer as aw, ObserverRegistry as ax, ProofPresenceSensor as ay, ProtocolStrictSensor as az, type AxisIntentSensorBindingInput as b, TlvUtf8Pattern as b0, TlvValidate as b1, type TlvValidatorMeta as b2, TpsSensor as b3, type TpsSensorOptions as b4, VarintHardeningSensor as b5, Witness as b6, buildAxisLawEvaluationContext as b7, toIntentSensorBinding as b8, toObserverBinding as b9, 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, AccessProfileResolverSensor as n, Axis as o, AxisAnonymous as p, AxisAuthorized as q, type AxisChainEncryption as r, type AxisChainRequest as s, type AxisChainStatus as t, type AxisChainStepResult as u, type AxisChainStepStatus as v, type AxisEffect as w, type AxisExecutionMode as x, type AxisIntentEnvelope as y, type AxisIntentObserver as z };
|
|
@@ -749,6 +749,25 @@ declare class IntentRegistrySensor implements AxisSensor {
|
|
|
749
749
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
+
type LawArticlePresenceMode = "off" | "audit" | "strict";
|
|
753
|
+
interface LawArticlePresenceSensorOptions {
|
|
754
|
+
mode?: LawArticlePresenceMode | (() => LawArticlePresenceMode);
|
|
755
|
+
exemptIntents?: string[];
|
|
756
|
+
missingCode?: string;
|
|
757
|
+
auditScoreDelta?: number;
|
|
758
|
+
getLawArticleCount: (intent: string, input: SensorInput) => number | Promise<number>;
|
|
759
|
+
}
|
|
760
|
+
declare class LawArticlePresenceSensor implements AxisSensor {
|
|
761
|
+
private readonly options;
|
|
762
|
+
readonly name: string;
|
|
763
|
+
readonly order: number;
|
|
764
|
+
constructor(options: LawArticlePresenceSensorOptions);
|
|
765
|
+
supports(input: SensorInput): boolean;
|
|
766
|
+
run(input: SensorInput): Promise<SensorDecision>;
|
|
767
|
+
private mode;
|
|
768
|
+
private exemptIntents;
|
|
769
|
+
}
|
|
770
|
+
|
|
752
771
|
declare class LawEvaluationSensor implements AxisSensor {
|
|
753
772
|
private readonly options;
|
|
754
773
|
private readonly logger;
|
|
@@ -891,4 +910,4 @@ declare class VarintHardeningSensor implements AxisSensor {
|
|
|
891
910
|
run(input: SensorInput): Promise<SensorDecision>;
|
|
892
911
|
}
|
|
893
912
|
|
|
894
|
-
export { BodyBudgetSensor as $, type AxisIntentSensorOptions as A, type AxisIntentSensorBinding as B, type ChainOptions as C, type AxisIntentSensorBindingOptions as D, type AxisIntentSensorRef as E, type AxisIntentSensorWhen as F, type AxisKeyExchangeRef as G, type AxisLawArticleSummary as H, type IntentTlvField as I, type AxisLawDecision as J, type AxisLawEvaluationContext as K, type AxisLawEvaluationResult as L, type AxisLawEvaluator as M, type AxisObserverBinding as N, ObserverDispatcherService as O, type AxisObserverBindingOptions as P, type AxisObserverContext as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverDefinition as U, type AxisObserverEvent as V, type AxisObserverRef as W, type AxisObserverRegistration as X, AxisPublic as Y, AxisRateLimit as Z, type AxisRateLimitConfig as _, type AxisObserverBindingInput as a,
|
|
913
|
+
export { BodyBudgetSensor as $, type AxisIntentSensorOptions as A, type AxisIntentSensorBinding as B, type ChainOptions as C, type AxisIntentSensorBindingOptions as D, type AxisIntentSensorRef as E, type AxisIntentSensorWhen as F, type AxisKeyExchangeRef as G, type AxisLawArticleSummary as H, type IntentTlvField as I, type AxisLawDecision as J, type AxisLawEvaluationContext as K, type AxisLawEvaluationResult as L, type AxisLawEvaluator as M, type AxisObserverBinding as N, ObserverDispatcherService as O, type AxisObserverBindingOptions as P, type AxisObserverContext as Q, type RequiredProofKind as R, SensorRegistry as S, type TlvValidatorFn as T, type AxisObserverDefinition as U, type AxisObserverEvent as V, type AxisObserverRef as W, type AxisObserverRegistration as X, AxisPublic as Y, AxisRateLimit as Z, type AxisRateLimitConfig as _, type AxisObserverBindingInput as a, TlvRange as a$, CAPSULE_POLICY_METADATA_KEY as a0, CONTRACT_METADATA_KEY as a1, CapabilityEnforcementSensor as a2, Capsule as a3, CapsulePolicy as a4, type CapsulePolicyOptions as a5, type CapsuleScopeMode as a6, ChunkHashSensor as a7, Contract as a8, DEFAULT_CONTRACTS as a9, REQUIRED_PROOF_METADATA_KEY as aA, ReceiptPolicySensor as aB, type RegisteredChainConfig as aC, RequiredProof as aD, RiskDecision as aE, type RiskEvaluation as aF, RiskGateSensor as aG, type RiskGateSensorOptions as aH, type RiskSignal as aI, type RiskSignalCollector as aJ, SENSITIVITY_METADATA_KEY as aK, SchemaValidationSensor as aL, Sensitivity as aM, StreamScopeSensor as aN, TLVParseSensor as aO, TLV_FIELDS_KEY as aP, TLV_VALIDATORS_KEY as aQ, type TickAuthCapsuleRef as aR, TickAuthSensor as aS, type TickAuthSensorOptions as aT, type TickAuthVerifier as aU, TlvEnum as aV, TlvField as aW, type TlvFieldKind as aX, type TlvFieldMeta as aY, type TlvFieldOptions as aZ, TlvMinLen as a_, EntropySensor as aa, type ExecutionContract as ab, ExecutionTimeoutSensor as ac, FALLBACK_CONTRACT as ad, FrameBudgetSensor as ae, FrameHeaderSanitySensor as af, HeaderTLVLimitSensor as ag, INTENT_METADATA_KEY as ah, INTENT_ROUTES_KEY as ai, Intent as aj, IntentAllowlistSensor as ak, type IntentKind as al, type IntentOptions as am, IntentRegistrySensor as an, type IntentRoute as ao, type LawArticlePresenceMode as ap, LawArticlePresenceSensor as aq, type LawArticlePresenceSensorOptions as ar, LawEvaluationSensor as as, type LawEvaluationSensorOptions as at, OBSERVER_BINDINGS_KEY as au, OBSERVER_METADATA_KEY as av, Observer as aw, ObserverRegistry as ax, ProofPresenceSensor as ay, ProtocolStrictSensor as az, type AxisIntentSensorBindingInput as b, TlvUtf8Pattern as b0, TlvValidate as b1, type TlvValidatorMeta as b2, TpsSensor as b3, type TpsSensorOptions as b4, VarintHardeningSensor as b5, Witness as b6, buildAxisLawEvaluationContext as b7, toIntentSensorBinding as b8, toObserverBinding as b9, 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, AccessProfileResolverSensor as n, Axis as o, AxisAnonymous as p, AxisAuthorized as q, type AxisChainEncryption as r, type AxisChainRequest as s, type AxisChainStatus as t, type AxisChainStepResult as u, type AxisChainStepStatus as v, type AxisEffect as w, type AxisExecutionMode as x, type AxisIntentEnvelope as y, type AxisIntentObserver 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 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
|
|
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-DZdmfbDZ.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 LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 as toObserverBinding } from './index-DZdmfbDZ.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-CXewlhg-.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
|
|
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_6djkZB.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 LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 as toObserverBinding } from './index-D_6djkZB.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-ChuwP1RU.js';
|
package/dist/index.js
CHANGED
|
@@ -122,6 +122,31 @@ var init_capsule_policy_decorator = __esm({
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
// src/decorators/intent-policy.decorator.ts
|
|
125
|
+
function appendRequiredProof(target, propertyKey, proof) {
|
|
126
|
+
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
127
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
128
|
+
target,
|
|
129
|
+
propertyKey
|
|
130
|
+
) ?? [] : Reflect.getMetadata(
|
|
131
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
132
|
+
target
|
|
133
|
+
) ?? [];
|
|
134
|
+
const merged = existing.includes(proof) ? existing : [...existing, proof];
|
|
135
|
+
if (propertyKey !== void 0) {
|
|
136
|
+
Reflect.defineMetadata(
|
|
137
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
138
|
+
merged,
|
|
139
|
+
target,
|
|
140
|
+
propertyKey
|
|
141
|
+
);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
Reflect.defineMetadata(
|
|
145
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
146
|
+
merged,
|
|
147
|
+
target
|
|
148
|
+
);
|
|
149
|
+
}
|
|
125
150
|
function Sensitivity(level) {
|
|
126
151
|
return ((target, propertyKey) => {
|
|
127
152
|
if (propertyKey !== void 0) {
|
|
@@ -170,56 +195,12 @@ function RequiredProof(proofs) {
|
|
|
170
195
|
}
|
|
171
196
|
function Capsule() {
|
|
172
197
|
return ((target, propertyKey) => {
|
|
173
|
-
|
|
174
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
175
|
-
target,
|
|
176
|
-
propertyKey
|
|
177
|
-
) ?? [] : Reflect.getMetadata(
|
|
178
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
179
|
-
target
|
|
180
|
-
) ?? [];
|
|
181
|
-
const merged = existing.includes("CAPSULE") ? existing : [...existing, "CAPSULE"];
|
|
182
|
-
if (propertyKey !== void 0) {
|
|
183
|
-
Reflect.defineMetadata(
|
|
184
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
185
|
-
merged,
|
|
186
|
-
target,
|
|
187
|
-
propertyKey
|
|
188
|
-
);
|
|
189
|
-
} else {
|
|
190
|
-
Reflect.defineMetadata(
|
|
191
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
192
|
-
merged,
|
|
193
|
-
target
|
|
194
|
-
);
|
|
195
|
-
}
|
|
198
|
+
appendRequiredProof(target, propertyKey, "CAPSULE");
|
|
196
199
|
});
|
|
197
200
|
}
|
|
198
201
|
function Witness() {
|
|
199
202
|
return ((target, propertyKey) => {
|
|
200
|
-
|
|
201
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
202
|
-
target,
|
|
203
|
-
propertyKey
|
|
204
|
-
) ?? [] : Reflect.getMetadata(
|
|
205
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
206
|
-
target
|
|
207
|
-
) ?? [];
|
|
208
|
-
const merged = existing.includes("WITNESS") ? existing : [...existing, "WITNESS"];
|
|
209
|
-
if (propertyKey !== void 0) {
|
|
210
|
-
Reflect.defineMetadata(
|
|
211
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
212
|
-
merged,
|
|
213
|
-
target,
|
|
214
|
-
propertyKey
|
|
215
|
-
);
|
|
216
|
-
} else {
|
|
217
|
-
Reflect.defineMetadata(
|
|
218
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
219
|
-
merged,
|
|
220
|
-
target
|
|
221
|
-
);
|
|
222
|
-
}
|
|
203
|
+
appendRequiredProof(target, propertyKey, "WITNESS");
|
|
223
204
|
});
|
|
224
205
|
}
|
|
225
206
|
function Axis() {
|
|
@@ -229,31 +210,37 @@ function Axis() {
|
|
|
229
210
|
}
|
|
230
211
|
function AxisPublic() {
|
|
231
212
|
return (target, propertyKey, descriptor) => {
|
|
232
|
-
if (
|
|
213
|
+
if (propertyKey !== void 0) {
|
|
233
214
|
Reflect.defineMetadata(AXIS_PUBLIC_KEY, true, target, propertyKey);
|
|
215
|
+
appendRequiredProof(target, propertyKey, "NONE");
|
|
234
216
|
return descriptor;
|
|
235
217
|
}
|
|
236
218
|
Reflect.defineMetadata(AXIS_PUBLIC_KEY, true, target);
|
|
219
|
+
appendRequiredProof(target, void 0, "NONE");
|
|
237
220
|
return target;
|
|
238
221
|
};
|
|
239
222
|
}
|
|
240
223
|
function AxisAuthorized() {
|
|
241
224
|
return (target, propertyKey, descriptor) => {
|
|
242
|
-
if (
|
|
225
|
+
if (propertyKey !== void 0) {
|
|
243
226
|
Reflect.defineMetadata(AXIS_AUTHORIZED_KEY, true, target, propertyKey);
|
|
227
|
+
appendRequiredProof(target, propertyKey, "AUTHORIZED");
|
|
244
228
|
return descriptor;
|
|
245
229
|
}
|
|
246
230
|
Reflect.defineMetadata(AXIS_AUTHORIZED_KEY, true, target);
|
|
231
|
+
appendRequiredProof(target, void 0, "AUTHORIZED");
|
|
247
232
|
return target;
|
|
248
233
|
};
|
|
249
234
|
}
|
|
250
235
|
function AxisAnonymous() {
|
|
251
236
|
return (target, propertyKey, descriptor) => {
|
|
252
|
-
if (
|
|
237
|
+
if (propertyKey !== void 0) {
|
|
253
238
|
Reflect.defineMetadata(AXIS_ANONYMOUS_KEY, true, target, propertyKey);
|
|
239
|
+
appendRequiredProof(target, propertyKey, "ANONYMOUS");
|
|
254
240
|
return descriptor;
|
|
255
241
|
}
|
|
256
242
|
Reflect.defineMetadata(AXIS_ANONYMOUS_KEY, true, target);
|
|
243
|
+
appendRequiredProof(target, void 0, "ANONYMOUS");
|
|
257
244
|
return target;
|
|
258
245
|
};
|
|
259
246
|
}
|
|
@@ -2320,6 +2307,22 @@ function sensorRefKey(ref) {
|
|
|
2320
2307
|
function sensorBindingKey(binding) {
|
|
2321
2308
|
return `${binding.when}:${sensorRefKey(binding.ref)}`;
|
|
2322
2309
|
}
|
|
2310
|
+
function mergeProofKinds(...proofGroups) {
|
|
2311
|
+
const merged = /* @__PURE__ */ new Set();
|
|
2312
|
+
for (const proofs of proofGroups) {
|
|
2313
|
+
for (const proof of proofs ?? []) {
|
|
2314
|
+
merged.add(proof);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
return Array.from(merged);
|
|
2318
|
+
}
|
|
2319
|
+
function accessProofKinds(isPublic, isAnonymous, isAuthorized) {
|
|
2320
|
+
const proofs = [];
|
|
2321
|
+
if (isPublic) proofs.push("NONE");
|
|
2322
|
+
if (isAnonymous) proofs.push("ANONYMOUS");
|
|
2323
|
+
if (isAuthorized) proofs.push("AUTHORIZED");
|
|
2324
|
+
return proofs;
|
|
2325
|
+
}
|
|
2323
2326
|
function mergeIntentSensorBindings(...sensorGroups) {
|
|
2324
2327
|
const merged = /* @__PURE__ */ new Map();
|
|
2325
2328
|
for (const group of sensorGroups) {
|
|
@@ -2855,10 +2858,6 @@ var init_intent_router = __esm({
|
|
|
2855
2858
|
REQUIRED_PROOF_METADATA_KEY,
|
|
2856
2859
|
proto.constructor
|
|
2857
2860
|
);
|
|
2858
|
-
const requiredProof = methodProof ?? classProof;
|
|
2859
|
-
if (requiredProof && requiredProof.length > 0) {
|
|
2860
|
-
this.intentRequiredProof.set(intent, requiredProof);
|
|
2861
|
-
}
|
|
2862
2861
|
const isPublicMethod = Reflect.getMetadata(
|
|
2863
2862
|
AXIS_PUBLIC_KEY,
|
|
2864
2863
|
proto,
|
|
@@ -2868,9 +2867,6 @@ var init_intent_router = __esm({
|
|
|
2868
2867
|
AXIS_PUBLIC_KEY,
|
|
2869
2868
|
proto.constructor
|
|
2870
2869
|
);
|
|
2871
|
-
if (isPublicMethod || isPublicClass) {
|
|
2872
|
-
this.publicIntents.add(intent);
|
|
2873
|
-
}
|
|
2874
2870
|
const isAnonMethod = Reflect.getMetadata(
|
|
2875
2871
|
AXIS_ANONYMOUS_KEY,
|
|
2876
2872
|
proto,
|
|
@@ -2880,9 +2876,6 @@ var init_intent_router = __esm({
|
|
|
2880
2876
|
AXIS_ANONYMOUS_KEY,
|
|
2881
2877
|
proto.constructor
|
|
2882
2878
|
);
|
|
2883
|
-
if (isAnonMethod || isAnonClass) {
|
|
2884
|
-
this.anonymousIntents.add(intent);
|
|
2885
|
-
}
|
|
2886
2879
|
const isAuthorizedMethod = Reflect.getMetadata(
|
|
2887
2880
|
AXIS_AUTHORIZED_KEY,
|
|
2888
2881
|
proto,
|
|
@@ -2892,7 +2885,25 @@ var init_intent_router = __esm({
|
|
|
2892
2885
|
AXIS_AUTHORIZED_KEY,
|
|
2893
2886
|
proto.constructor
|
|
2894
2887
|
);
|
|
2895
|
-
|
|
2888
|
+
const methodPolicyProof = mergeProofKinds(
|
|
2889
|
+
methodProof,
|
|
2890
|
+
accessProofKinds(isPublicMethod, isAnonMethod, isAuthorizedMethod)
|
|
2891
|
+
);
|
|
2892
|
+
const classPolicyProof = mergeProofKinds(
|
|
2893
|
+
classProof,
|
|
2894
|
+
accessProofKinds(isPublicClass, isAnonClass, isAuthorizedClass)
|
|
2895
|
+
);
|
|
2896
|
+
const requiredProof = methodPolicyProof.length ? methodPolicyProof : classPolicyProof;
|
|
2897
|
+
if (requiredProof.length > 0) {
|
|
2898
|
+
this.intentRequiredProof.set(intent, requiredProof);
|
|
2899
|
+
}
|
|
2900
|
+
if (requiredProof.includes("NONE")) {
|
|
2901
|
+
this.publicIntents.add(intent);
|
|
2902
|
+
}
|
|
2903
|
+
if (requiredProof.includes("ANONYMOUS")) {
|
|
2904
|
+
this.anonymousIntents.add(intent);
|
|
2905
|
+
}
|
|
2906
|
+
if (requiredProof.includes("AUTHORIZED")) {
|
|
2896
2907
|
this.authorizedIntents.add(intent);
|
|
2897
2908
|
}
|
|
2898
2909
|
const rateLimit = Reflect.getMetadata(
|
|
@@ -11357,6 +11368,80 @@ var require_intent_registry_sensor = __commonJS({
|
|
|
11357
11368
|
}
|
|
11358
11369
|
});
|
|
11359
11370
|
|
|
11371
|
+
// src/sensors/law-article-presence.sensor.ts
|
|
11372
|
+
var require_law_article_presence_sensor = __commonJS({
|
|
11373
|
+
"src/sensors/law-article-presence.sensor.ts"(exports2) {
|
|
11374
|
+
"use strict";
|
|
11375
|
+
var __decorate = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
11376
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11377
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11378
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11379
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11380
|
+
};
|
|
11381
|
+
var __metadata = exports2 && exports2.__metadata || function(k, v) {
|
|
11382
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11383
|
+
};
|
|
11384
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11385
|
+
exports2.LawArticlePresenceSensor = void 0;
|
|
11386
|
+
var sensor_decorator_1 = (init_sensor_decorator(), __toCommonJS(sensor_decorator_exports));
|
|
11387
|
+
var sensor_bands_1 = (init_sensor_bands(), __toCommonJS(sensor_bands_exports));
|
|
11388
|
+
var LawArticlePresenceSensor = class LawArticlePresenceSensor {
|
|
11389
|
+
constructor(options) {
|
|
11390
|
+
this.options = options;
|
|
11391
|
+
this.name = "LawArticlePresenceSensor";
|
|
11392
|
+
this.order = sensor_bands_1.BAND.IDENTITY + 27;
|
|
11393
|
+
}
|
|
11394
|
+
supports(input) {
|
|
11395
|
+
if (this.mode() === "off")
|
|
11396
|
+
return false;
|
|
11397
|
+
if (!input.intent)
|
|
11398
|
+
return false;
|
|
11399
|
+
if (this.exemptIntents().includes(input.intent))
|
|
11400
|
+
return false;
|
|
11401
|
+
return true;
|
|
11402
|
+
}
|
|
11403
|
+
async run(input) {
|
|
11404
|
+
const intent = input.intent;
|
|
11405
|
+
const count = await this.options.getLawArticleCount(intent, input);
|
|
11406
|
+
if (count > 0) {
|
|
11407
|
+
return {
|
|
11408
|
+
action: "ALLOW",
|
|
11409
|
+
meta: { lawArticles: count }
|
|
11410
|
+
};
|
|
11411
|
+
}
|
|
11412
|
+
const reason = `Intent '${intent}' has no law article mapping`;
|
|
11413
|
+
if (this.mode() === "strict") {
|
|
11414
|
+
return {
|
|
11415
|
+
action: "DENY",
|
|
11416
|
+
code: this.options.missingCode ?? "CAPSULE_NOT_LAWFUL",
|
|
11417
|
+
reason
|
|
11418
|
+
};
|
|
11419
|
+
}
|
|
11420
|
+
return {
|
|
11421
|
+
action: "FLAG",
|
|
11422
|
+
scoreDelta: this.options.auditScoreDelta ?? 5,
|
|
11423
|
+
reasons: ["LAW_ARTICLE_MISSING", reason],
|
|
11424
|
+
meta: { lawArticles: 0 }
|
|
11425
|
+
};
|
|
11426
|
+
}
|
|
11427
|
+
mode() {
|
|
11428
|
+
const configured = this.options.mode;
|
|
11429
|
+
if (typeof configured === "function")
|
|
11430
|
+
return configured();
|
|
11431
|
+
return configured ?? "audit";
|
|
11432
|
+
}
|
|
11433
|
+
exemptIntents() {
|
|
11434
|
+
return this.options.exemptIntents ?? ["system.ping"];
|
|
11435
|
+
}
|
|
11436
|
+
};
|
|
11437
|
+
exports2.LawArticlePresenceSensor = LawArticlePresenceSensor;
|
|
11438
|
+
exports2.LawArticlePresenceSensor = LawArticlePresenceSensor = __decorate([
|
|
11439
|
+
(0, sensor_decorator_1.Sensor)({ phase: "POST_DECODE" }),
|
|
11440
|
+
__metadata("design:paramtypes", [Object])
|
|
11441
|
+
], LawArticlePresenceSensor);
|
|
11442
|
+
}
|
|
11443
|
+
});
|
|
11444
|
+
|
|
11360
11445
|
// src/sensors/law-evaluation.sensor.ts
|
|
11361
11446
|
var require_law_evaluation_sensor = __commonJS({
|
|
11362
11447
|
"src/sensors/law-evaluation.sensor.ts"(exports2) {
|
|
@@ -12828,6 +12913,7 @@ var init_sensors = __esm({
|
|
|
12828
12913
|
__reExport(sensors_exports, __toESM(require_header_tlv_limit_sensor()));
|
|
12829
12914
|
__reExport(sensors_exports, __toESM(require_intent_allowlist_sensor()));
|
|
12830
12915
|
__reExport(sensors_exports, __toESM(require_intent_registry_sensor()));
|
|
12916
|
+
__reExport(sensors_exports, __toESM(require_law_article_presence_sensor()));
|
|
12831
12917
|
__reExport(sensors_exports, __toESM(require_law_evaluation_sensor()));
|
|
12832
12918
|
__reExport(sensors_exports, __toESM(require_proof_presence_sensor()));
|
|
12833
12919
|
__reExport(sensors_exports, __toESM(require_protocol_strict_sensor()));
|