@agenticprimitives/tool-policy 0.1.0-alpha.3 → 1.0.0-alpha.11
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/README.md +22 -3
- package/dist/classification.d.ts +1 -1
- package/dist/classification.d.ts.map +1 -1
- package/dist/decision.d.ts +1 -1
- package/dist/decision.d.ts.map +1 -1
- package/dist/exact-call.d.ts +1 -1
- package/dist/exact-call.d.ts.map +1 -1
- package/dist/exact-call.js +1 -1
- package/dist/exact-call.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/risk-tier.d.ts +1 -1
- package/dist/risk-tier.d.ts.map +1 -1
- package/dist/risk-tier.js +1 -1
- package/dist/risk-tier.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# @agenticprimitives/tool-policy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**One delegation model, everywhere — and this is the layer that decides.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Agents are getting tool access faster than anyone is deciding what those tools should be allowed to do. The usual answer is an OAuth scope string or an API key with a prayer attached — coarse, transport-bound, and silent about risk. This package is the missing decision layer: a classification taxonomy (`@sa-tool`, `@sa-auth`, `@sa-validation`, `@sa-risk-tier` and friends), risk tiers with TTL clamps and required-caveat lookups, an exact-call DSL for byte-precise on-chain calls, and a deterministic decision engine — `evaluatePolicy(ctx)` returns `allow`, `deny`, or `requires-consent`, the same answer for the same input, every time. Unknown classification fields fail closed.
|
|
6
|
+
|
|
7
|
+
It is **deliberately transport-free**: no MCP SDK, no LangChain, no Vercel AI imports ([ADR-0003](../../docs/architecture/decisions/0003-tool-policy-protocol-agnostic.md)). A LangGraph user can `pnpm add` it without buying into MCP middleware, and `@agenticprimitives/mcp-runtime` consumes it without being the only consumer. This package decides; your runtime enforces.
|
|
8
|
+
|
|
9
|
+
> Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
6
10
|
|
|
7
11
|
See [`spec.md`](./spec.md) → [`specs/204-tool-policy.md`](../../specs/204-tool-policy.md).
|
|
8
12
|
|
|
@@ -34,6 +38,8 @@ if (decision.decision === 'requires-consent') /* prompt user */;
|
|
|
34
38
|
|
|
35
39
|
## Exact-call policy
|
|
36
40
|
|
|
41
|
+
When "roughly this kind of call" is not good enough, pin the exact one:
|
|
42
|
+
|
|
37
43
|
```ts
|
|
38
44
|
import { exactCall, matchesExactCall } from '@agenticprimitives/tool-policy';
|
|
39
45
|
|
|
@@ -45,6 +51,19 @@ const policy = exactCall(safeAddress, '0xa9059cbb', {
|
|
|
45
51
|
const ok = matchesExactCall({ to, data, value }, policy);
|
|
46
52
|
```
|
|
47
53
|
|
|
54
|
+
When `calldataHash` is set, matching is byte-identical — no partial-match shortcuts.
|
|
55
|
+
|
|
56
|
+
## How it's different
|
|
57
|
+
|
|
58
|
+
OAuth scopes and general-purpose policy engines (OPA-style) are the incumbents here, and both have a gap this package targets. Scopes are static strings granted at consent time; they know nothing about risk tiers, value limits, or the delegation a caller actually holds. Policy engines are powerful but generic — you bring your own identity model, your own risk taxonomy, and your own integration glue per transport. This package ships the agent-tooling-specific layer pre-built: a risk taxonomy designed for tool calls, decisions that compose with `Delegation` objects from `@agenticprimitives/delegation` (consumed type-only — no runtime coupling), and a deterministic, side-effect-free engine you can golden-test. The decision an MCP server enforces is the same decision a LangGraph or A2A runtime would get, because the policy layer never learned what transport it lives in.
|
|
59
|
+
|
|
60
|
+
## Validate
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm --filter @agenticprimitives/tool-policy typecheck
|
|
64
|
+
pnpm --filter @agenticprimitives/tool-policy test
|
|
65
|
+
```
|
|
66
|
+
|
|
48
67
|
## Status
|
|
49
68
|
|
|
50
|
-
|
|
69
|
+
**Alpha track — testnet-only.** Spec + API stable; do not deploy to production until the gates listed in the root [`README.md` Status section](../../README.md#status) are cleared — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
package/dist/classification.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classification.d.ts","sourceRoot":"","sources":["../src/classification.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"classification.d.ts","sourceRoot":"","sources":["../src/classification.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,CAAC,EACN,cAAc,EAAE,kBAAkB,GACjC,CAAC,GAAG;IAAE,eAAe,EAAE,kBAAkB,CAAA;CAAE,CAI7C"}
|
package/dist/decision.d.ts
CHANGED
package/dist/decision.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../src/decision.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAsB,MAAM,
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../src/decision.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAsB,MAAM,YAAY,CAAC;AAsDpF,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA4CjE"}
|
package/dist/exact-call.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address, Hex } from '@agenticprimitives/types';
|
|
2
|
-
import type { ExactCallPolicy } from './types';
|
|
2
|
+
import type { ExactCallPolicy } from './types.js';
|
|
3
3
|
export declare function exactCall(target: Address, selector: Hex, opts?: {
|
|
4
4
|
calldataHash?: Hex;
|
|
5
5
|
valueLimit?: bigint;
|
package/dist/exact-call.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exact-call.d.ts","sourceRoot":"","sources":["../src/exact-call.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"exact-call.d.ts","sourceRoot":"","sources":["../src/exact-call.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAYlD,wBAAgB,SAAS,CACvB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,GAAG,EACb,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,GAAG,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,eAAe,CAajB;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC/C,MAAM,EAAE,eAAe,GACtB,OAAO,CAeT"}
|
package/dist/exact-call.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Used for critical-tier operations where the user should authorize the
|
|
5
5
|
// exact intent and nothing else.
|
|
6
|
-
import { keccak_256 } from '@noble/hashes/sha3';
|
|
6
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
7
7
|
function keccak256OfHex(hex) {
|
|
8
8
|
const cleaned = hex.startsWith('0x') ? hex.slice(2) : hex;
|
|
9
9
|
const bytes = new Uint8Array(cleaned.length / 2);
|
package/dist/exact-call.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exact-call.js","sourceRoot":"","sources":["../src/exact-call.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,qEAAqE;AACrE,EAAE;AACF,wEAAwE;AACxE,iCAAiC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"exact-call.js","sourceRoot":"","sources":["../src/exact-call.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,qEAAqE;AACrE,EAAE;AACF,wEAAwE;AACxE,iCAAiC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,SAAS,cAAc,CAAC,GAAQ;IAC9B,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChG,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG,IAAI,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,GAAG;QAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1D,OAAO,CAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,MAAe,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MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAEpF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { declareTool } from './classification';
|
|
2
|
-
export { exactCall, matchesExactCall } from './exact-call';
|
|
3
|
-
export { evaluatePolicy } from './decision';
|
|
4
|
-
export { clampTtlForRiskTier, requiredCaveatsForRiskTier, evaluateThresholdPolicy, RISK_TIER_REQUIREMENTS, } from './risk-tier';
|
|
5
|
-
export { lintClassification } from './lint';
|
|
6
|
-
export { ThresholdTier } from './types';
|
|
7
|
-
export type { Address, Hex, RiskTier, ToolClassification, ExactCallPolicy, CaveatLike, DelegationLike, CaveatContext, PolicyContext, PolicyDecision, ThresholdPolicyDecision, LintResult, } from './types';
|
|
1
|
+
export { declareTool } from './classification.js';
|
|
2
|
+
export { exactCall, matchesExactCall } from './exact-call.js';
|
|
3
|
+
export { evaluatePolicy } from './decision.js';
|
|
4
|
+
export { clampTtlForRiskTier, requiredCaveatsForRiskTier, evaluateThresholdPolicy, RISK_TIER_REQUIREMENTS, } from './risk-tier.js';
|
|
5
|
+
export { lintClassification } from './lint.js';
|
|
6
|
+
export { ThresholdTier } from './types.js';
|
|
7
|
+
export type { Address, Hex, RiskTier, ToolClassification, ExactCallPolicy, CaveatLike, DelegationLike, CaveatContext, PolicyContext, PolicyDecision, ThresholdPolicyDecision, LintResult, } from './types.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,YAAY,EACV,OAAO,EACP,GAAG,EACH,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,UAAU,GACX,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
// transport SDK (see capability.manifest.json:forbiddenImports for the full
|
|
7
7
|
// list and docs/architecture/decisions/0003-tool-policy-protocol-agnostic.md
|
|
8
8
|
// for why).
|
|
9
|
-
export { declareTool } from './classification';
|
|
10
|
-
export { exactCall, matchesExactCall } from './exact-call';
|
|
11
|
-
export { evaluatePolicy } from './decision';
|
|
12
|
-
export { clampTtlForRiskTier, requiredCaveatsForRiskTier, evaluateThresholdPolicy, RISK_TIER_REQUIREMENTS, } from './risk-tier';
|
|
13
|
-
export { lintClassification } from './lint';
|
|
9
|
+
export { declareTool } from './classification.js';
|
|
10
|
+
export { exactCall, matchesExactCall } from './exact-call.js';
|
|
11
|
+
export { evaluatePolicy } from './decision.js';
|
|
12
|
+
export { clampTtlForRiskTier, requiredCaveatsForRiskTier, evaluateThresholdPolicy, RISK_TIER_REQUIREMENTS, } from './risk-tier.js';
|
|
13
|
+
export { lintClassification } from './lint.js';
|
|
14
14
|
// ThresholdTier is an enum (value export, not type-only).
|
|
15
|
-
export { ThresholdTier } from './types';
|
|
15
|
+
export { ThresholdTier } from './types.js';
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,4DAA4D;AAC5D,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,YAAY;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,4DAA4D;AAC5D,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,YAAY;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,0DAA0D;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/lint.d.ts
CHANGED
package/dist/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK7C,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAgBD,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CA4B5E"}
|
package/dist/risk-tier.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RiskTier, ToolClassification, ThresholdPolicyDecision } from './types';
|
|
1
|
+
import type { RiskTier, ToolClassification, ThresholdPolicyDecision } from './types.js';
|
|
2
2
|
export declare function clampTtlForRiskTier(requestedTtlSec: number, risk: RiskTier): number;
|
|
3
3
|
export declare function requiredCaveatsForRiskTier(risk: RiskTier): string[];
|
|
4
4
|
export declare const RISK_TIER_REQUIREMENTS: Record<RiskTier, ThresholdPolicyDecision>;
|
package/dist/risk-tier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"risk-tier.d.ts","sourceRoot":"","sources":["../src/risk-tier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"risk-tier.d.ts","sourceRoot":"","sources":["../src/risk-tier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAiBpB,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAMnF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAEnE;AAqBD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,QAAQ,EAAE,uBAAuB,CAyB5E,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,kBAAkB,GACjC,uBAAuB,CAGzB"}
|
package/dist/risk-tier.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Risk-tier helpers. The taxonomy is the binding contract — these helpers
|
|
2
2
|
// surface "what should issuance demand for this tier."
|
|
3
|
-
import { ThresholdTier } from './types';
|
|
3
|
+
import { ThresholdTier } from './types.js';
|
|
4
4
|
const TTL_CLAMP_SECONDS = {
|
|
5
5
|
low: 7 * 24 * 60 * 60, // 7 days
|
|
6
6
|
medium: 7 * 24 * 60 * 60, // 7 days
|
package/dist/risk-tier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"risk-tier.js","sourceRoot":"","sources":["../src/risk-tier.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uDAAuD;AAOvD,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"risk-tier.js","sourceRoot":"","sources":["../src/risk-tier.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uDAAuD;AAOvD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,iBAAiB,GAA6B;IAClD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAS,SAAS;IACvC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAM,SAAS;IACvC,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAY,QAAQ;IACtC,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAa,SAAS;CACxC,CAAC;AAEF,MAAM,gBAAgB,GAA+B;IACnD,GAAG,EAAE,CAAC,WAAW,CAAC;IAClB,MAAM,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,IAAI,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,CAAC;IAC5D,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;CAC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,IAAI;QACpB,UAAU,EAAE,IAAI;QAChB,uBAAuB,EAAE,IAAI;KAC9B;CACF,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,cAAkC;IAElC,MAAM,IAAI,GAAG,cAAc,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC;IACtD,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/tool-policy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"description": "Protocol-agnostic classification, risk tiers, and exact-call policy. Consumable by MCP, A2A, LangGraph, and Vercel AI tool runtimes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@noble/hashes": "^
|
|
38
|
+
"@noble/hashes": "^2.2.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@agenticprimitives/types": "
|
|
41
|
+
"@agenticprimitives/types": "1.0.0-alpha.11"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.7.0",
|
|
45
|
-
"vitest": "^
|
|
45
|
+
"vitest": "^4.1.8"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"policy",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"build": "tsc -p tsconfig.build.json",
|
|
57
57
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
58
58
|
"test": "vitest run",
|
|
59
|
-
"test:unit": "vitest run test/unit",
|
|
59
|
+
"test:unit": "vitest run test/unit --passWithNoTests",
|
|
60
60
|
"test:integration": "vitest run test/integration --passWithNoTests",
|
|
61
61
|
"test:watch": "vitest",
|
|
62
62
|
"clean": "rm -rf dist"
|