agent-passport-system-mcp 2.24.0 → 2.26.0

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 CHANGED
@@ -12,13 +12,13 @@ Enforcement and accountability layer for AI agents. Bring your own identity. 20
12
12
  APS_PROFILE=essential npx agent-passport-system-mcp
13
13
  ```
14
14
 
15
- `essential` is the default profile — the 20 tools 90% of integrations need. Set `APS_PROFILE=full` for all 143 tools.
15
+ `essential` is the default profile — the 151 tools 90% of integrations need. Set `APS_PROFILE=full` for all 151 tools.
16
16
 
17
17
  Available profiles: essential (default), identity, governance, coordination, commerce, data, gateway, comms, minimal, full.
18
18
 
19
19
  > **For AI agents:** visit [aeoess.com/llms.txt](https://aeoess.com/llms.txt) for machine-readable documentation or [llms-full.txt](https://aeoess.com/llms-full.txt) for the complete technical reference. MCP discovery: [.well-known/mcp.json](https://aeoess.com/.well-known/mcp.json).
20
20
 
21
- Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, and more. Full surface area under `APS_PROFILE=full`: 143 tools across 103 modules (71 core + 32 v2 constitutional governance). Independently cited by [PDR in Production (Nanook & Gerundium, UBC)](https://doi.org/10.5281/zenodo.19323172).
21
+ Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, and more. Full surface area under `APS_PROFILE=full`: 151 tools across 122 modules (84 core + 38 v2 constitutional governance). Independently cited by [PDR in Production (Nanook & Gerundium, UBC)](https://doi.org/10.5281/zenodo.19323172).
22
22
 
23
23
  ## Quick Start
24
24
 
@@ -216,8 +216,8 @@ Layer 1 — Agent Passport Protocol (Ed25519 identity)
216
216
 
217
217
  ## Links
218
218
 
219
- - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.42.0, 2844 tests)
220
- - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v0.8.0)
219
+ - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.45.0, 2937 tests)
220
+ - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v0.13.0)
221
221
  - Paper (Protocol): [doi.org/10.5281/zenodo.18749779](https://doi.org/10.5281/zenodo.18749779)
222
222
  - Paper (Faceted Narrowing): [doi.org/10.5281/zenodo.19260073](https://doi.org/10.5281/zenodo.19260073)
223
223
  - Paper (Behavioral Derivation Rights): [doi.org/10.5281/zenodo.19476002](https://doi.org/10.5281/zenodo.19476002)
package/build/index.js CHANGED
@@ -64,7 +64,11 @@ import { createDerivationReceipt, resolveExtendedLineage, evaluateRevocationImpa
64
64
  // Rome-Complete: Charter, Approval, Time, Reserve, Federation
65
65
  import { createCharter, signCharter, verifyCharter, evaluateThreshold, createApprovalRequest, addApprovalSignature, createHybridTimestamp, compareTimestamps, validateTemporalRights, createReserveAttestation, vouchReputation, applyReputationDowngrade,
66
66
  // v2 boundary primitives (AttributionConsent, ProvisionalStatement, HumanEscalationFlag)
67
- createAttributionReceipt, signAttributionConsent, verifyAttributionConsent, checkArtifactCitations, receiptCore, createProvisional, promoteStatement, verifyPromotion, withdrawProvisional, withdrawalPayload, isBinding, checkEscalationRequired, requestOwnerConfirmation, recordOwnerConfirmation, } from "agent-passport-system";
67
+ createAttributionReceipt, signAttributionConsent, verifyAttributionConsent, checkArtifactCitations, receiptCore, createProvisional, promoteStatement, verifyPromotion, withdrawProvisional, withdrawalPayload, isBinding, checkEscalationRequired, requestOwnerConfirmation, recordOwnerConfirmation,
68
+ // Attribution Primitive (unified four-axis signed Merkle receipt)
69
+ computeAttributionActionRef, constructAttributionPrimitive, projectAttribution, verifyAttributionProjection, verifyAttributionPrimitive, checkProjectionConsistency,
70
+ // Attribution Weights (Build B — fractional D/C axis weight formulas)
71
+ computeDataAxisWeights, computeComputeAxisWeights, DEFAULT_WEIGHT_PROFILE, } from "agent-passport-system";
68
72
  // ═══════════════════════════════════════
69
73
  // State Management
70
74
  // ═══════════════════════════════════════
@@ -460,6 +464,9 @@ const TOOL_PROFILES = {
460
464
  'aps_create_attribution_receipt',
461
465
  'aps_create_provisional',
462
466
  'aps_check_escalation_required',
467
+ // Build A attribution primitive — most-used entry points
468
+ 'aps_construct_attribution_primitive',
469
+ 'aps_verify_attribution_primitive',
463
470
  ]),
464
471
  };
465
472
  const activeProfile = (process.env.APS_PROFILE || 'full').toLowerCase();
@@ -649,6 +656,18 @@ const TOOL_SCOPE_MAP = {
649
656
  'aps_withdraw_provisional': 'coordination',
650
657
  'aps_check_escalation_required': 'delegation',
651
658
  'aps_record_owner_confirmation': 'delegation',
659
+ // Attribution Primitive (unified four-axis signed Merkle receipt)
660
+ 'aps_construct_attribution_primitive': 'governance',
661
+ 'aps_project_attribution': 'governance',
662
+ 'aps_verify_attribution_projection': 'governance',
663
+ 'aps_verify_attribution_primitive': 'governance',
664
+ 'aps_check_projection_consistency': 'governance',
665
+ 'aps_compute_attribution_action_ref': 'identity',
666
+ // Attribution Weights — Build B (fractional D/C axis formulas). Spec
667
+ // calls for a dedicated 'attribution' scope; integration-layer tools,
668
+ // not in the essential profile.
669
+ 'aps_compute_data_axis_weights': 'attribution',
670
+ 'aps_compute_compute_axis_weights': 'attribution',
652
671
  };
653
672
  // ═══════════════════════════════════════
654
673
  // TOOL: list_profiles
@@ -660,7 +679,7 @@ server.tool("list_profiles", "Show available tool profiles. Set APS_PROFILE env
660
679
  // ═══════════════════════════════════════
661
680
  // TOOL: list_tools_for_scope (Primitive #9: Tool Pool Assembly)
662
681
  // ═══════════════════════════════════════
663
- server.tool("list_tools_for_scope", "List available MCP tools filtered by delegation scope. Pass your delegation scopes to see which tools you can use. Scopes: identity, delegation, principal, reputation, coordination, communication, governance, commerce, data, gateway, network, temporal. Use ['*'] for all tools.", {
682
+ server.tool("list_tools_for_scope", "List available MCP tools filtered by delegation scope. Pass your delegation scopes to see which tools you can use. Scopes: identity, delegation, principal, reputation, coordination, communication, governance, commerce, data, gateway, network, temporal, attribution. Use ['*'] for all tools.", {
664
683
  scopes: z.array(z.string()).describe("Your delegation scopes, e.g. ['identity', 'delegation', 'commerce']"),
665
684
  }, async ({ scopes }) => {
666
685
  const allTools = Object.entries(TOOL_SCOPE_MAP);
@@ -4738,6 +4757,160 @@ server.tool("aps_record_owner_confirmation", "Escalation boundary: owner signs a
4738
4757
  return { content: [{ type: "text", text: safeError("recordOwnerConfirmation failed", e) }], isError: true };
4739
4758
  }
4740
4759
  });
4760
+ // ═══════════════════════════════════════
4761
+ // Attribution Primitive — unified four-axis signed Merkle receipt
4762
+ // Spec: ATTRIBUTION-PRIMITIVE-v1.1.md. One signed object per action with
4763
+ // four axis projections (D, P, G, C) that verify independently.
4764
+ // ═══════════════════════════════════════
4765
+ server.tool("aps_construct_attribution_primitive", "Build and sign a four-axis AttributionPrimitive for an action. Axes: D (data sources), P (protocol modules), G (delegation chain), C (compute providers). Returns the complete signed object.", {
4766
+ action: z.object({
4767
+ agentId: z.string(),
4768
+ actionType: z.string(),
4769
+ params: z.record(z.any()),
4770
+ nonce: z.string(),
4771
+ }).describe("Action identity tuple; the action_ref is derived as sha256(canonical(this))"),
4772
+ axes: z.object({
4773
+ D: z.array(z.any()),
4774
+ P: z.array(z.any()),
4775
+ G: z.array(z.any()),
4776
+ C: z.array(z.any()),
4777
+ }).describe("Four-axis content. See spec §1.2 for entry shapes per axis."),
4778
+ issuer: z.string().describe("Issuer DID (gateway or agent producing the receipt)"),
4779
+ issuer_private_key: z.string().describe("Ed25519 private key hex that signs the envelope"),
4780
+ timestamp: z.string().optional().describe("ISO-8601 UTC with ms precision + Z (§2.5). Defaults to now()."),
4781
+ }, async (args) => {
4782
+ try {
4783
+ const primitive = constructAttributionPrimitive({
4784
+ action: args.action,
4785
+ axes: args.axes,
4786
+ issuer: args.issuer,
4787
+ issuerPrivateKey: args.issuer_private_key,
4788
+ timestamp: args.timestamp,
4789
+ });
4790
+ return { content: [{ type: "text", text: JSON.stringify(primitive, null, 2) }] };
4791
+ }
4792
+ catch (e) {
4793
+ return { content: [{ type: "text", text: safeError("constructAttributionPrimitive failed", e) }], isError: true };
4794
+ }
4795
+ });
4796
+ server.tool("aps_project_attribution", "Extract a single-axis projection from an AttributionPrimitive. The projection carries the axis content plus a two-hop Merkle path that lets a downstream verifier reconstruct the signed root without seeing the other three axes. axis: 'D' | 'P' | 'G' | 'C'.", {
4797
+ primitive: z.any().describe("An AttributionPrimitive (from aps_construct_attribution_primitive)"),
4798
+ axis: z.enum(["D", "P", "G", "C"]).describe("Axis to project"),
4799
+ }, async (args) => {
4800
+ try {
4801
+ const projection = projectAttribution(args.primitive, args.axis);
4802
+ return { content: [{ type: "text", text: JSON.stringify(projection, null, 2) }] };
4803
+ }
4804
+ catch (e) {
4805
+ return { content: [{ type: "text", text: safeError("projectAttribution failed", e) }], isError: true };
4806
+ }
4807
+ });
4808
+ server.tool("aps_verify_attribution_projection", "Verify a single-axis AttributionProjection under the issuer's Ed25519 public key. Returns {valid: true} or {valid: false, reason: 'INVALID_AXIS_TAG'|'MERKLE_MISMATCH'|'SIGNATURE_INVALID'|'MALFORMED'}. Verification is purely local — no other axes required.", {
4809
+ projection: z.any().describe("An AttributionProjection (from aps_project_attribution)"),
4810
+ issuer_public_key: z.string().describe("Issuer Ed25519 public key hex"),
4811
+ }, async (args) => {
4812
+ try {
4813
+ const result = verifyAttributionProjection(args.projection, args.issuer_public_key);
4814
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
4815
+ }
4816
+ catch (e) {
4817
+ return { content: [{ type: "text", text: safeError("verifyAttributionProjection failed", e) }], isError: true };
4818
+ }
4819
+ });
4820
+ server.tool("aps_verify_attribution_primitive", "End-to-end verify of a full AttributionPrimitive: constructs projections for all four axes and verifies each one. Useful as a post-construction sanity check or for verifying a primitive received from a peer.", {
4821
+ primitive: z.any().describe("An AttributionPrimitive"),
4822
+ issuer_public_key: z.string().describe("Issuer Ed25519 public key hex"),
4823
+ }, async (args) => {
4824
+ try {
4825
+ const result = verifyAttributionPrimitive(args.primitive, args.issuer_public_key);
4826
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
4827
+ }
4828
+ catch (e) {
4829
+ return { content: [{ type: "text", text: safeError("verifyAttributionPrimitive failed", e) }], isError: true };
4830
+ }
4831
+ });
4832
+ server.tool("aps_check_projection_consistency", "Cross-projection consistency check (§2.4): given two projections, confirm they originate from the same signed receipt. Returns {same_receipt: true} or {same_receipt: false, reason: 'DIFFERENT_ACTIONS'|'DIFFERENT_RECEIPTS'|'DIFFERENT_SIGNATURES'|'METADATA_MISMATCH'}.", {
4833
+ projection_a: z.any().describe("First AttributionProjection"),
4834
+ projection_b: z.any().describe("Second AttributionProjection"),
4835
+ }, async (args) => {
4836
+ try {
4837
+ const result = checkProjectionConsistency(args.projection_a, args.projection_b);
4838
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
4839
+ }
4840
+ catch (e) {
4841
+ return { content: [{ type: "text", text: safeError("checkProjectionConsistency failed", e) }], isError: true };
4842
+ }
4843
+ });
4844
+ server.tool("aps_compute_attribution_action_ref", "Derive the action_ref (hex sha256) for an action tuple. action_ref is the content-addressed anchor that all four axis projections bind to. Useful for indexing primitives by action without constructing the full primitive.", {
4845
+ agentId: z.string(),
4846
+ actionType: z.string(),
4847
+ params: z.record(z.any()),
4848
+ nonce: z.string(),
4849
+ }, async (args) => {
4850
+ try {
4851
+ const action_ref = computeAttributionActionRef({
4852
+ agentId: args.agentId,
4853
+ actionType: args.actionType,
4854
+ params: args.params,
4855
+ nonce: args.nonce,
4856
+ });
4857
+ return { content: [{ type: "text", text: JSON.stringify({ action_ref }, null, 2) }] };
4858
+ }
4859
+ catch (e) {
4860
+ return { content: [{ type: "text", text: safeError("computeAttributionActionRef failed", e) }], isError: true };
4861
+ }
4862
+ });
4863
+ // ═══════════════════════════════════════
4864
+ // Attribution Weights — Build B fractional weight formulas
4865
+ // Spec: BUILD-B-FRACTIONAL-WEIGHTS.md. Upstream of constructAttributionPrimitive:
4866
+ // compute canonical D/C axis weights from raw per-source / per-provider records,
4867
+ // then hand the resulting axis entries to aps_construct_attribution_primitive.
4868
+ // ═══════════════════════════════════════
4869
+ server.tool("aps_compute_data_axis_weights", "Compute the D-axis fractional weight vector from a list of AccessReceipt records with role, timestamp, and content length. Returns canonical DataAxisEntry[] with 6-digit decimal contribution_weight strings that sum to ~1.0 and feed directly into aps_construct_attribution_primitive. Empty input → empty array; all-zero raw weights → error. Weights = role × recency_decay × length_weight, normalized per spec BUILD-B §'The D-axis formula'. Parameter names match the SDK: `sources`, `action_timestamp`, optional `profile`.", {
4870
+ sources: z.array(z.object({
4871
+ source_did: z.string(),
4872
+ access_receipt_hash: z.string(),
4873
+ role: z.enum([
4874
+ 'primary_source', 'supporting_evidence', 'context_only', 'background_retrieval',
4875
+ ]),
4876
+ timestamp: z.string().describe("ISO-8601 UTC with millisecond precision + Z (t_source)"),
4877
+ content_length: z.number().nonnegative().describe("Tokens"),
4878
+ })).describe("Per-source records with retrieval metadata"),
4879
+ action_timestamp: z.string().describe("ISO-8601 UTC ms when the action ran (t_action)"),
4880
+ profile: z.any().optional().describe("Optional WeightProfile override; defaults to DEFAULT_WEIGHT_PROFILE"),
4881
+ }, async (args) => {
4882
+ try {
4883
+ const entries = computeDataAxisWeights(args.sources, {
4884
+ action_timestamp: args.action_timestamp,
4885
+ profile: args.profile,
4886
+ });
4887
+ return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
4888
+ }
4889
+ catch (e) {
4890
+ return { content: [{ type: "text", text: safeError("computeDataAxisWeights failed", e) }], isError: true };
4891
+ }
4892
+ });
4893
+ server.tool("aps_compute_compute_axis_weights", "Compute the C-axis fractional weight vector from a list of inference billing records (prompt_tokens, completion_tokens). Returns canonical ComputeAxisEntry[] with 6-digit decimal compute_share strings that sum to ~1.0 and feed directly into aps_construct_attribution_primitive. Weights = prompt_tokens + completion_tokens × COMPLETION_MULTIPLIER (default 3.0), normalized per spec BUILD-B §'The C-axis formula'. Parameter names match the SDK: `providers`, optional `profile`.", {
4894
+ providers: z.array(z.object({
4895
+ provider_did: z.string(),
4896
+ hardware_attestation_hash: z.string(),
4897
+ prompt_tokens: z.number().nonnegative(),
4898
+ completion_tokens: z.number().nonnegative(),
4899
+ })).describe("Per-provider billing records"),
4900
+ profile: z.any().optional().describe("Optional WeightProfile override; defaults to DEFAULT_WEIGHT_PROFILE"),
4901
+ }, async (args) => {
4902
+ try {
4903
+ const entries = computeComputeAxisWeights(args.providers, { profile: args.profile });
4904
+ return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
4905
+ }
4906
+ catch (e) {
4907
+ return { content: [{ type: "text", text: safeError("computeComputeAxisWeights failed", e) }], isError: true };
4908
+ }
4909
+ });
4910
+ // Keep DEFAULT_WEIGHT_PROFILE referenced so tree-shakers don't drop it
4911
+ // from the compiled bundle — consumers of the two tools above will want
4912
+ // to introspect the defaults.
4913
+ void DEFAULT_WEIGHT_PROFILE;
4741
4914
  server.prompt("coordination_role", "Get instructions for your assigned coordination role", {}, async () => {
4742
4915
  const role = state.agentRole || 'default';
4743
4916
  const instructions = ROLE_PROMPTS[role] || ROLE_PROMPTS['default'];
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "agent-passport-system-mcp",
3
- "version": "2.24.0",
3
+ "version": "2.26.0",
4
4
  "mcpName": "io.github.aeoess/agent-passport-mcp",
5
- "description": "MCP server for the Agent Passport System — enforcement infrastructure for the agent economy. 143 tools across 103 modules. Policy eval <2ms. Identity, delegation, reputation, enforcement, attestation, feeless Nano wallet, commerce. Tracks SDK v1.42.0 (2,843 tests).",
5
+ "description": "MCP server for the Agent Passport System — enforcement infrastructure for the agent economy. 151 tools across 122 modules. Policy eval <2ms. Identity, delegation, reputation, enforcement, attestation, feeless Nano wallet, commerce, attribution primitive. Tracks SDK v1.45.0 (2,910 tests).",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "agent-passport-system-mcp": "./build/bin.js",
@@ -15,10 +15,10 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "npx tsc && chmod 755 build/bin.js build/index.js build/setup.js",
18
- "test": "node --test tests/",
18
+ "test": "node --test tests/*.test.mjs",
19
19
  "watch": "tsc --watch",
20
20
  "inspector": "npx @modelcontextprotocol/inspector build/index.js",
21
- "prepublishOnly": "npm run build",
21
+ "prepublishOnly": "npm run build && npm test",
22
22
  "postinstall": "echo '\\n🔑 Agent Passport MCP installed! Run: npx agent-passport-system-mcp setup\\n Or for zero-install remote: npx agent-passport-system-mcp setup --remote\\n'",
23
23
  "postpublish": "cd ~/aeoess_web && node scripts/propagate.mjs --apply --commit 2>/dev/null || echo 'Propagation skipped (aeoess_web not found)'"
24
24
  },
@@ -50,7 +50,7 @@
50
50
  "homepage": "https://github.com/aeoess/agent-passport-mcp",
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/sdk": "^1.27.1",
53
- "agent-passport-system": "^1.42.0",
53
+ "agent-passport-system": "^1.45.0",
54
54
  "zod": "^3.25.76"
55
55
  },
56
56
  "devDependencies": {