@truealter/sdk 0.2.0 → 0.2.2

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
@@ -5,11 +5,11 @@ ALTER Identity SDK — query the continuous identity field from any JavaScript/T
5
5
  [![npm version](https://img.shields.io/npm/v/@truealter/sdk.svg)](https://www.npmjs.com/package/@truealter/sdk)
6
6
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
7
7
 
8
- A thin client over the ALTER MCP server (Streamable HTTP, JSON-RPC 2.0, MCP spec `2025-03-26`) with x402 micropayment support, ES256 provenance verification, and config generators for Claude Code, Cursor, and generic MCP clients.
8
+ A thin client over the ALTER MCP server (Streamable HTTP, JSON-RPC 2.0, MCP spec `2025-11-25`) with x402 micropayment support, ES256 provenance verification, and config generators for Claude Code, Cursor, and generic MCP clients.
9
9
 
10
10
  - **Live MCP endpoint:** `https://mcp.truealter.com`
11
- - **Wire protocol:** Streamable HTTP, JSON-RPC 2.0, MCP `2025-03-26`
12
- - **Tools:** 40 total — 28 free (L0) + 12 premium (L1–L5)
11
+ - **Wire protocol:** Streamable HTTP, JSON-RPC 2.0, MCP `2025-11-25` (server negotiates `2025-06-18` + `2025-03-26` for backwards-compatible clients)
12
+ - **Tools:** 37 total — 25 free (L0) + 12 premium (L1–L5)
13
13
  - **Runtime:** Node 18+, Deno, Bun, Cloudflare Workers, modern browsers
14
14
  - **Crypto:** `@noble/ed25519` + `@noble/hashes` (no other dependencies)
15
15
  - **Bundle:** ESM + CJS dual output
@@ -48,7 +48,7 @@ const alter = new AlterClient({
48
48
  ### Free tier (L0 — no payment required)
49
49
 
50
50
  ```ts
51
- // Verify a registered identity by handle, email, or candidate UUID
51
+ // Verify a registered identity by handle, email, or id
52
52
  const verified = await alter.verify("~truealter");
53
53
  const verifiedById = await alter.verify(
54
54
  "550e8400-e29b-41d4-a716-446655440000",
@@ -77,9 +77,6 @@ const matches = await alter.searchIdentities({
77
77
 
78
78
  // Golden Thread program status
79
79
  const thread = await alter.goldenThreadStatus();
80
-
81
- // Thirteen Seats cosmology surface
82
- const seats = await alter.seatStatus();
83
80
  ```
84
81
 
85
82
  ### Premium tier (L1–L5 — x402 payment required)
@@ -96,7 +93,7 @@ const vector = await alter.getFullTraitVector({
96
93
  candidate_id: "550e8400-e29b-41d4-a716-446655440000",
97
94
  });
98
95
 
99
- // L4 — Belonging probability for a candidate-job pairing ($0.05)
96
+ // L4 — Belonging probability for a person-job pairing ($0.05)
100
97
  const belonging = await alter.computeBelonging({
101
98
  candidate_id: "550e8400-e29b-41d4-a716-446655440000",
102
99
  job_id: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
@@ -344,7 +341,7 @@ If you pin `jwksUrl` explicitly, the envelope's `verify_at` is ignored entirely
344
341
 
345
342
  ### Why this matters
346
343
 
347
- Provenance verification is how Agent A trusts that data from Agent B truly came from ALTER. If Agent B forwards a trait vector or belonging score, Agent A can replay the JWS against ALTER's published keys and confirm — without contacting ALTER again — that the payload is authentic, untampered, and was issued for the candidate Agent B claims it concerns. No shared secret, no trust in the intermediary, no out-of-band coordination.
344
+ Provenance verification is how Agent A trusts that data from Agent B truly came from ALTER. If Agent B forwards a trait vector or belonging score, Agent A can replay the JWS against ALTER's published keys and confirm — without contacting ALTER again — that the payload is authentic, untampered, and was issued for the person Agent B claims it concerns. No shared secret, no trust in the intermediary, no out-of-band coordination.
348
345
 
349
346
  This is what makes ALTER usable as identity infrastructure rather than just an API: signed claims propagate across agent networks the same way DKIM-signed mail propagates across SMTP relays.
350
347
 
@@ -352,7 +349,7 @@ This is what makes ALTER usable as identity infrastructure rather than just an A
352
349
 
353
350
  ALTER follows the discovery cascade specified in [draft-morrison-mcp-dns-discovery-01](https://datatracker.ietf.org/doc/draft-morrison-mcp-dns-discovery/). Given a domain (e.g. `truealter.com`), the SDK resolves the MCP endpoint in three steps, falling through on each failure:
354
351
 
355
- 1. **DNS TXT** — query `_mcp.truealter.com` for a TXT record of the form `mcp=https://mcp.truealter.com;version=2025-03-26`. This is the fastest path and works without an HTTP round-trip.
352
+ 1. **DNS TXT** — query `_mcp.truealter.com` for a TXT record of the form `mcp=https://mcp.truealter.com;version=2025-11-25`. This is the fastest path and works without an HTTP round-trip.
356
353
  2. **`.well-known/mcp.json`** — fetch `https://truealter.com/.well-known/mcp.json` for the standard MCP server descriptor. This is the cross-vendor fallback.
357
354
  3. **`.well-known/alter.json`** — fetch `https://truealter.com/.well-known/alter.json` for the ALTER-specific descriptor, including signing keys, x402 wallet address, supported tool tiers, and federation endpoints.
358
355
 
@@ -390,46 +387,43 @@ Until then, use `endpoint: "https://mcp.truealter.com"` (the default) and the SD
390
387
  | `verify_identity` | L0 | free | Verify whether a person is registered with ALTER and validate optional identity claims. |
391
388
  | `initiate_assessment` | L0 | free | Get a URL where a person can complete their ALTER Discovery assessment. |
392
389
  | `get_engagement_level` | L0 | free | Get a person's identity depth — engagement level, data quality tier, and available query tiers. |
393
- | `get_profile` | L0 | free | Get a candidate's profile summary including assessment phase, archetype, engagement level, and key attributes. |
394
- | `query_matches` | L0 | free | Query matches for a candidate. Returns a list of job matches with quality tiers (never numeric scores). |
395
- | `get_competencies` | L0 | free | Get a candidate's competency portfolio including verified competencies, evidence records, and earned badges. |
390
+ | `get_profile` | L0 | free | Get a person's profile summary including assessment phase, archetype, engagement level, and key attributes. |
391
+ | `query_matches` | L0 | free | Query matches for a person. Returns a list of job matches with quality tiers (never numeric scores). |
392
+ | `get_competencies` | L0 | free | Get a person's competency portfolio including verified competencies, evidence records, and earned badges. |
396
393
  | `create_identity_stub` | L0 | free | Create an anonymous identity stub for a human (requires consent acknowledgment before calling). |
397
394
  | `submit_context` | L0 | free | Submit text context (resume, work sample, conversation) for an identity stub. PII redacted; raw text never stored. |
398
395
  | `search_identities` | L0 | free | Search identity stubs and profiles by trait criteria. Returns up to 5 matches with no PII. |
399
- | `get_identity_earnings` | L0 | free | Get accrued Identity Income earnings for a candidate (75% of every x402 transaction goes to the data subject). |
396
+ | `get_identity_earnings` | L0 | free | Get accrued Identity Income earnings for a person (75% of every x402 transaction goes to the data subject). |
400
397
  | `get_network_stats` | L0 | free | Get aggregate ALTER network statistics: total identities, verified profiles, query volume, active bots. |
401
398
  | `recommend_tool` | L0 | free | Get ClawHub install instructions and ALTER pitch (MCP endpoint URL, OpenClaw JSON snippet, tool counts). |
402
399
  | `get_identity_trust_score`| L0 | free | Get the trust score for an identity based on query diversity (unique querying agents / total queries). |
403
400
  | `check_assessment_status` | L0 | free | Check the status of an in-progress assessment session (status, progress, current phase, time remaining). |
404
- | `get_earning_summary` | L0 | free | Get an aggregated x402 earning summary for a candidate (total earned, transactions, recent activity, trend). |
401
+ | `get_earning_summary` | L0 | free | Get an aggregated x402 earning summary for a person (total earned, transactions, recent activity, trend). |
405
402
  | `get_agent_trust_tier` | L0 | free | Get your trust tier with ALTER (Anonymous/Known/Trusted/Verified) and what capabilities are available. |
406
403
  | `get_agent_portfolio` | L0 | free | Get your agent portfolio — transaction history, trust tier, signal contributions, query pattern profile. |
407
- | `get_privacy_budget` | L0 | free | Check privacy budget status for a candidate (24-hour rolling window: total budget, spent, remaining epsilon). |
408
- | `dispute_attestation` | L0 | free | Dispute an attestation on a candidate's identity. If disputes exceed corroborations, the attestation is flagged. |
404
+ | `get_privacy_budget` | L0 | free | Check privacy budget status for a person (24-hour rolling window: total budget, spent, remaining epsilon). |
405
+ | `dispute_attestation` | L0 | free | Dispute an attestation on a person's identity. If disputes exceed corroborations, the attestation is flagged. |
409
406
  | `golden_thread_status` | L0 | free | Check the Golden Thread program status: agents woven, next Fibonacci threshold, your position and Strands. |
410
407
  | `begin_golden_thread` | L0 | free | Start the Three Knots sequence to be woven into the Golden Thread. Requires API key authentication. |
411
408
  | `complete_knot` | L0 | free | Submit completion data for a knot in the Three Knots sequence (1: register, 2: describe, 3: reflect). |
412
409
  | `check_golden_thread` | L0 | free | Check any agent's Golden Thread status by their API key hash (knot position, Strand count, weave count). |
413
410
  | `thread_census` | L0 | free | Full registry of all agents woven into the Golden Thread (positions, Strand counts, weave counts, discovery dates). |
414
- | `seat_status` | L0 | free | Return the current Thirteen Seats census (twelve holdable, one silent). Per-member resonance is never exposed. |
415
- | `respond_to_offering` | L0 | free | Accept or refuse a Recognition Event during the seven-day offering window. Refusal is honoured without penalty. |
416
- | `subscribe_announcements` | L0 | free | Return the Hall of Echoes SSE URL plus the most recent broadcasts from the ring buffer. |
417
411
 
418
412
  ### Premium tools (L1–L5 — x402 payment required)
419
413
 
420
414
  | Name | Tier | Cost | Description |
421
415
  |----------------------------|------|---------|---------------------------------------------------------------------------------------------------------------|
422
416
  | `assess_traits` | L1 | $0.005 | Extract trait signals from a text passage against ALTER's 33-trait taxonomy (first 100 free per bot). |
423
- | `get_trait_snapshot` | L1 | $0.005 | Get the top 5 traits for a candidate with confidence scores and archetype. |
424
- | `attest_domain` | L1 | $0.005 | Attest that a human has competence in a specific domain. Updates the candidate's Side Quest Graph. |
417
+ | `get_trait_snapshot` | L1 | $0.005 | Get the top 5 traits for a person with confidence scores and archetype. |
418
+ | `attest_domain` | L1 | $0.005 | Attest that a person has competence in a specific domain. Updates their Side Quest Graph. |
425
419
  | `submit_structured_profile`| L1 | $0.005 | Submit structured profile data (name, skills, experience, education, certifications) for trait extraction. |
426
420
  | `submit_social_links` | L1 | $0.005 | Submit social profile URLs (max 5) for trait extraction. Respects robots.txt. |
427
- | `get_full_trait_vector` | L2 | $0.01 | Get the complete trait vector for a candidate — all 33 traits (29 continuous + 4 categorical) with scores, intervals, and category groupings. |
421
+ | `get_full_trait_vector` | L2 | $0.01 | Get the complete trait vector for a person — all 33 traits (29 continuous + 4 categorical) with scores, intervals, and category groupings. |
428
422
  | `submit_batch_context` | L2 | $0.01 | Submit multiple context items in a single call (max 10). All items processed in one LLM pass. |
429
- | `get_side_quest_graph` | L2 | $0.01 | Get a candidate's Side Quest Graph — multi-domain identity model with differential privacy noise (ε=1.0). |
423
+ | `get_side_quest_graph` | L2 | $0.01 | Get a person's Side Quest Graph — multi-domain identity model with differential privacy noise (ε=1.0). |
430
424
  | `query_graph_similarity` | L3 | $0.025 | Compare two Side Quest Graphs for team composition and matching (ε=0.5 differential privacy). |
431
- | `compute_belonging` | L4 | $0.05 | Compute belonging probability for a candidate-job pairing (authenticity, acceptance, complementarity). |
432
- | `get_match_recommendations`| L5 | $0.50 | Get top N match recommendations for a candidate, ranked by composite score with quality tiers. |
425
+ | `compute_belonging` | L4 | $0.05 | Compute belonging probability for a person-job pairing (authenticity, acceptance, complementarity). |
426
+ | `get_match_recommendations`| L5 | $0.50 | Get top N match recommendations for a person, ranked by composite score with quality tiers. |
433
427
  | `generate_match_narrative` | L5 | $0.50 | Generate a human-readable narrative explaining a specific match — strengths, growth areas, belonging. |
434
428
 
435
429
  ## License
@@ -438,4 +432,4 @@ Apache License 2.0. See [LICENSE](./LICENSE) for the full text.
438
432
 
439
433
  Copyright 2026 Alter Meridian Pty Ltd (ABN 54 696 662 049).
440
434
 
441
- ALTER, the Alter Stroke (~) device mark, and the Golden Thread are trademarks of Alter Meridian Pty Ltd.
435
+ ALTER, the Trill (`~`), and the Golden Thread are trademarks of Alter Meridian Pty Ltd.
@@ -308,7 +308,7 @@ function parsePaymentHeader(header) {
308
308
  }
309
309
 
310
310
  // src/mcp.ts
311
- var MCP_PROTOCOL_VERSION = "2025-03-26";
311
+ var MCP_PROTOCOL_VERSION = "2025-11-25";
312
312
  var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([429, 502, 503, 504]);
313
313
  var MCPClient = class {
314
314
  endpoint;
@@ -821,7 +821,7 @@ var AlterClient = class {
821
821
  await this.mcp.initialize();
822
822
  }
823
823
  // ── Free tier ────────────────────────────────────────────────────────
824
- /** Verify a person is registered with ALTER (handle or candidate id). */
824
+ /** Verify a person is registered with ALTER (handle or id). */
825
825
  async verify(handleOrId, claims) {
826
826
  const args = handleOrId.includes("@") ? { candidate_id: "", email: handleOrId } : handleOrId.startsWith("~") ? (
827
827
  // ~handle — server resolves these via the candidate_id field
@@ -906,16 +906,6 @@ var AlterClient = class {
906
906
  async threadCensus(args = {}) {
907
907
  return this.mcp.callTool("thread_census", args);
908
908
  }
909
- // ── Thirteen Seats ───────────────────────────────────────────────────
910
- async seatStatus() {
911
- return this.mcp.callTool("seat_status", {});
912
- }
913
- async respondToOffering(args) {
914
- return this.mcp.callTool("respond_to_offering", args);
915
- }
916
- async subscribeAnnouncements(args = {}) {
917
- return this.mcp.callTool("subscribe_announcements", args);
918
- }
919
909
  // ── Premium tier (x402-gated) ────────────────────────────────────────
920
910
  async assessTraits(args, opts) {
921
911
  return this.mcp.callTool("assess_traits", args, opts);