@truealter/sdk 0.0.1 → 0.2.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/LICENSE +17 -0
- package/README.md +441 -1
- package/dist/bin/alter-identity.js +1330 -0
- package/dist/bin/alter-identity.js.map +1 -0
- package/dist/bin/mcp-bridge.js +491 -0
- package/dist/bin/mcp-bridge.js.map +1 -0
- package/dist/index.cjs +1316 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1470 -0
- package/dist/index.d.ts +1470 -0
- package/dist/index.js +1253 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -8
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Alter Meridian Pty Ltd
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1 +1,441 @@
|
|
|
1
|
-
# @truealter/sdk
|
|
1
|
+
# @truealter/sdk
|
|
2
|
+
|
|
3
|
+
ALTER Identity SDK — query the continuous identity field from any JavaScript/TypeScript environment.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@truealter/sdk)
|
|
6
|
+
[](./LICENSE)
|
|
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.
|
|
9
|
+
|
|
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)
|
|
13
|
+
- **Runtime:** Node 18+, Deno, Bun, Cloudflare Workers, modern browsers
|
|
14
|
+
- **Crypto:** `@noble/ed25519` + `@noble/hashes` (no other dependencies)
|
|
15
|
+
- **Bundle:** ESM + CJS dual output
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm install @truealter/sdk
|
|
21
|
+
npx alter-identity init
|
|
22
|
+
npx alter-identity verify ~truealter
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Why ALTER ≠ IAM
|
|
26
|
+
|
|
27
|
+
Identity Access Management answers *who is logged in*. ALTER answers *who they actually are* — a continuous field of recognition (Paper VIII, Theorem 1) that any IAM stack can sit on top of.
|
|
28
|
+
|
|
29
|
+
Reference: Morrison, B. (2026). *Identity Field Theory: A Continuous Field Model of Recognition*. Figshare. [DOI 10.6084/m9.figshare.31951383](https://doi.org/10.6084/m9.figshare.31951383)
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
### Initialise the client
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { AlterClient, X402Client } from "@truealter/sdk";
|
|
37
|
+
|
|
38
|
+
const alter = new AlterClient({
|
|
39
|
+
endpoint: "https://mcp.truealter.com", // optional — defaults to mcp.truealter.com
|
|
40
|
+
apiKey: process.env.ALTER_API_KEY, // optional for free tier
|
|
41
|
+
x402: new X402Client({ // optional — only required for premium tools
|
|
42
|
+
signer: yourViemOrEthersSigner,
|
|
43
|
+
maxPerQuery: "0.10",
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Free tier (L0 — no payment required)
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
// Verify a registered identity by handle, email, or candidate UUID
|
|
52
|
+
const verified = await alter.verify("~truealter");
|
|
53
|
+
const verifiedById = await alter.verify(
|
|
54
|
+
"550e8400-e29b-41d4-a716-446655440000",
|
|
55
|
+
{
|
|
56
|
+
archetype: "weaver",
|
|
57
|
+
min_engagement_level: 3,
|
|
58
|
+
traits: { pressure_response: { min: 0.6 } },
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// Reference data — the 12 ALTER archetypes
|
|
63
|
+
const archetypes = await alter.listArchetypes();
|
|
64
|
+
|
|
65
|
+
// Identity depth and available tool tiers
|
|
66
|
+
const depth = await alter.getEngagementLevel({
|
|
67
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Search by trait criteria — no PII exposed, max 5 results
|
|
71
|
+
const matches = await alter.searchIdentities({
|
|
72
|
+
trait_criteria: {
|
|
73
|
+
pressure_response: { min: 0.7 },
|
|
74
|
+
cognitive_flexibility: { min: 0.6 },
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Golden Thread program status
|
|
79
|
+
const thread = await alter.goldenThreadStatus();
|
|
80
|
+
|
|
81
|
+
// Thirteen Seats cosmology surface
|
|
82
|
+
const seats = await alter.seatStatus();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Premium tier (L1–L5 — x402 payment required)
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// L1 — Extract trait signals from text ($0.005, first 100 free per bot)
|
|
89
|
+
const signals = await alter.assessTraits({
|
|
90
|
+
text: "I led the incident response when our payment rails went down...",
|
|
91
|
+
context: "interview transcript",
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// L2 — Full 33-trait vector ($0.01)
|
|
95
|
+
const vector = await alter.getFullTraitVector({
|
|
96
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// L4 — Belonging probability for a candidate-job pairing ($0.05)
|
|
100
|
+
const belonging = await alter.computeBelonging({
|
|
101
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
102
|
+
job_id: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// L5 — Top match recommendations ($0.50)
|
|
106
|
+
const recommendations = await alter.getMatchRecommendations({
|
|
107
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
108
|
+
limit: 5,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// L5 — Human-readable narrative explaining a match ($0.50)
|
|
112
|
+
const narrative = await alter.generateMatchNarrative({
|
|
113
|
+
match_id: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Provenance verification
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
// Every medium- and high-blast-radius response is signed with ES256.
|
|
121
|
+
// Verification is opt-in — call alter.verifyProvenance(...) yourself.
|
|
122
|
+
const result = await alter.getFullTraitVector({
|
|
123
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const check = await alter.verifyProvenance(result._meta?.provenance);
|
|
127
|
+
if (!check.valid) throw new Error(`provenance failed: ${check.reason}`);
|
|
128
|
+
|
|
129
|
+
// Verify that schema hashes published in tools/list._meta.signatures
|
|
130
|
+
// match the local representation of each tool.
|
|
131
|
+
const tools = await alter.mcp.listTools();
|
|
132
|
+
const sigs = tools._meta?.signatures ?? {};
|
|
133
|
+
const results = await alter.verifyToolSignatures(tools.tools, sigs);
|
|
134
|
+
const tampered = results.filter((r) => !r.valid);
|
|
135
|
+
if (tampered.length) throw new Error(`tampered tools: ${tampered.map((t) => t.tool).join(", ")}`);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Discovery
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
import { discover } from "@truealter/sdk";
|
|
142
|
+
|
|
143
|
+
// Three-step discovery cascade: DNS TXT → mcp.json → alter.json
|
|
144
|
+
const descriptor = await discover("truealter.com");
|
|
145
|
+
// → { url: "https://mcp.truealter.com", transport, source, publicKey, x402Contract, capability }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Low-level MCPClient
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
import { MCPClient } from "@truealter/sdk";
|
|
152
|
+
|
|
153
|
+
const mcp = new MCPClient({ endpoint: "https://mcp.truealter.com" });
|
|
154
|
+
await mcp.initialize();
|
|
155
|
+
const tools = await mcp.listTools();
|
|
156
|
+
const response = await mcp.callTool("verify_identity", {
|
|
157
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## MCP Config Generation
|
|
162
|
+
|
|
163
|
+
The SDK ships config generators for the major MCP-aware clients. Each emits a JSON snippet you can paste (or write directly) into the appropriate file.
|
|
164
|
+
|
|
165
|
+
### Claude Code (`.mcp.json`)
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
import { generateClaudeConfig } from "@truealter/sdk";
|
|
169
|
+
import { writeFileSync } from "node:fs";
|
|
170
|
+
|
|
171
|
+
const config = generateClaudeConfig({
|
|
172
|
+
endpoint: "https://mcp.truealter.com",
|
|
173
|
+
apiKey: process.env.ALTER_API_KEY,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
writeFileSync(".mcp.json", JSON.stringify(config, null, 2));
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Resulting `.mcp.json`:
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"mcpServers": {
|
|
184
|
+
"alter": {
|
|
185
|
+
"url": "https://mcp.truealter.com",
|
|
186
|
+
"transport": "streamable-http",
|
|
187
|
+
"description": "ALTER Identity — psychometric identity field for AI agents",
|
|
188
|
+
"headers": {
|
|
189
|
+
"X-ALTER-API-Key": "ak_..."
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Cursor (`.cursor/mcp.json`)
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
import { generateCursorConfig } from "@truealter/sdk";
|
|
200
|
+
import { writeFileSync } from "node:fs";
|
|
201
|
+
|
|
202
|
+
const config = generateCursorConfig({
|
|
203
|
+
endpoint: "https://mcp.truealter.com",
|
|
204
|
+
apiKey: process.env.ALTER_API_KEY,
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
writeFileSync(".cursor/mcp.json", JSON.stringify(config, null, 2));
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Generic MCP client
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
import { generateGenericMcpConfig } from "@truealter/sdk";
|
|
214
|
+
|
|
215
|
+
const config = generateGenericMcpConfig({
|
|
216
|
+
endpoint: "https://mcp.truealter.com",
|
|
217
|
+
apiKey: process.env.ALTER_API_KEY,
|
|
218
|
+
serverName: "alter", // editor-specific key under mcpServers
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### CLI
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
npx alter-identity init # generate keypair, discover MCP, write ~/.config/alter/identity.json
|
|
226
|
+
npx alter-identity config # print Claude .mcp.json snippet (default)
|
|
227
|
+
npx alter-identity config --cursor # print Cursor .cursor/mcp.json snippet
|
|
228
|
+
npx alter-identity config --generic # print generic mcpServers snippet
|
|
229
|
+
npx alter-identity verify ~truealter # verify an identity
|
|
230
|
+
npx alter-identity status # show connection state and probe the endpoint
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## x402 Micropayments
|
|
234
|
+
|
|
235
|
+
ALTER monetises premium tools via the [x402](https://x402.org) standard — HTTP `402 Payment Required` with on-chain settlement.
|
|
236
|
+
|
|
237
|
+
### The retry flow
|
|
238
|
+
|
|
239
|
+
1. Client calls a premium tool *without* a payment header.
|
|
240
|
+
2. Server replies `402 Payment Required` with a payment requirement (amount, recipient, asset, network).
|
|
241
|
+
3. Client signs and broadcasts a USDC transfer on Base L2, attaches the proof, retries.
|
|
242
|
+
4. Server validates the proof, executes the tool, signs the response with ES256, returns it.
|
|
243
|
+
5. The treasury splits the payment within seconds.
|
|
244
|
+
|
|
245
|
+
The SDK handles steps 2–4 automatically when an `X402Client` with a configured `signer` is passed in.
|
|
246
|
+
|
|
247
|
+
### Tier structure
|
|
248
|
+
|
|
249
|
+
| Tier | Cost | Examples |
|
|
250
|
+
|------|----------|-----------------------------------------------------|
|
|
251
|
+
| L1 | $0.005 | `assess_traits`, `get_trait_snapshot`, `attest_domain`, `submit_structured_profile`, `submit_social_links` |
|
|
252
|
+
| L2 | $0.01 | `get_full_trait_vector`, `submit_batch_context`, `get_side_quest_graph` |
|
|
253
|
+
| L3 | $0.025 | `query_graph_similarity` |
|
|
254
|
+
| L4 | $0.05 | `compute_belonging` |
|
|
255
|
+
| L5 | $0.50 | `get_match_recommendations`, `generate_match_narrative` |
|
|
256
|
+
|
|
257
|
+
The first **100 calls per bot are free** before x402 settlement engages — enough to evaluate the network without spending a cent.
|
|
258
|
+
|
|
259
|
+
### Identity income split
|
|
260
|
+
|
|
261
|
+
Every settled call is split four ways:
|
|
262
|
+
|
|
263
|
+
| Recipient | Share |
|
|
264
|
+
|----------------------|-------|
|
|
265
|
+
| Data subject | 75% |
|
|
266
|
+
| Facilitator agent | 5% |
|
|
267
|
+
| ALTER (protocol) | 15% |
|
|
268
|
+
| Cooperative treasury | 5% |
|
|
269
|
+
|
|
270
|
+
The 75% to the data subject is the foundation of *Identity Income* — humans earn from queries against their own identity field, automatically, without intermediation.
|
|
271
|
+
|
|
272
|
+
### Code example
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { AlterClient, X402Client, type X402Signer } from "@truealter/sdk";
|
|
276
|
+
|
|
277
|
+
// Bring your own signer — viem, ethers, a hardware wallet bridge, anything.
|
|
278
|
+
// The SDK ships without a wallet dependency on purpose.
|
|
279
|
+
const signer: X402Signer = {
|
|
280
|
+
async settle(envelope) {
|
|
281
|
+
const txHash = await yourWallet.sendUsdcTransfer({
|
|
282
|
+
to: envelope.recipient,
|
|
283
|
+
amount: envelope.amount,
|
|
284
|
+
chain: envelope.network,
|
|
285
|
+
});
|
|
286
|
+
return {
|
|
287
|
+
reference: txHash,
|
|
288
|
+
network: envelope.network,
|
|
289
|
+
amount: envelope.amount,
|
|
290
|
+
asset: envelope.asset,
|
|
291
|
+
};
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const alter = new AlterClient({
|
|
296
|
+
endpoint: "https://mcp.truealter.com",
|
|
297
|
+
x402: new X402Client({
|
|
298
|
+
signer,
|
|
299
|
+
networks: ["base", "base-sepolia"], // policy allow-list
|
|
300
|
+
assets: ["USDC"],
|
|
301
|
+
maxPerQuery: "0.10", // refuse anything over $0.10 USDC
|
|
302
|
+
}),
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// Auto-retries with payment when the server returns 402
|
|
306
|
+
const vector = await alter.getFullTraitVector({
|
|
307
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
308
|
+
});
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
If a quoted envelope exceeds `maxPerQuery`, uses an unallowed network, or names an unallowed asset, the SDK rejects the call with `AlterError` *before* invoking the signer — no on-chain transaction is broadcast.
|
|
312
|
+
|
|
313
|
+
## Provenance Verification
|
|
314
|
+
|
|
315
|
+
Every response from a medium- or high-blast-radius tool ships with an ES256 JWS in `_meta.provenance`. The signature covers a canonical JSON serialisation of the response payload, the tool name, the call timestamp, the requesting agent's key hash, and a monotonic sequence number.
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
const result = await alter.getFullTraitVector({
|
|
319
|
+
candidate_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
const check = await alter.verifyProvenance(result._meta?.provenance);
|
|
323
|
+
if (!check.valid) throw new Error(`ALTER provenance check failed: ${check.reason}`);
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The SDK fetches public keys from `https://api.truealter.com/.well-known/alter-keys.json` and caches them per their `Cache-Control` headers. The endpoint returns a JWKS containing all current and recently-rotated signing keys; verifying clients should accept any key whose `kid` matches and is still within its validity window.
|
|
327
|
+
|
|
328
|
+
### `verify_at` hostname allowlist (v0.1.1+)
|
|
329
|
+
|
|
330
|
+
Every provenance envelope may carry a `verify_at` hint telling the SDK where to fetch the JWKS from. Because that hint is *server-supplied*, a hostile MCP server could otherwise point it at an attacker-controlled JWKS and pass ES256 verification with its own signing key. The SDK therefore gates `verify_at` through a hostname allowlist (default: `api.truealter.com`, `mcp.truealter.com`) and rejects `http://` URLs unconditionally. Downstream integrators with their own deployment can extend the allowlist — without forking the SDK — via `verifyAtAllowlist` on either `AlterClient` or a direct `verifyProvenance()` call:
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
import { AlterClient, DEFAULT_VERIFY_AT_ALLOWLIST } from "@truealter/sdk";
|
|
334
|
+
|
|
335
|
+
const alter = new AlterClient({
|
|
336
|
+
verifyAtAllowlist: [
|
|
337
|
+
...DEFAULT_VERIFY_AT_ALLOWLIST, // keep the ALTER canonicals
|
|
338
|
+
"keys.myorg.example", // plus your own JWKS host
|
|
339
|
+
],
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
If you pin `jwksUrl` explicitly, the envelope's `verify_at` is ignored entirely — the pinned URL wins. The `https:` scheme requirement applies to pinned URLs too.
|
|
344
|
+
|
|
345
|
+
### Why this matters
|
|
346
|
+
|
|
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.
|
|
348
|
+
|
|
349
|
+
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
|
+
|
|
351
|
+
## Discovery
|
|
352
|
+
|
|
353
|
+
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
|
+
|
|
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.
|
|
356
|
+
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
|
+
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
|
+
|
|
359
|
+
```ts
|
|
360
|
+
import { discover } from "@truealter/sdk";
|
|
361
|
+
|
|
362
|
+
// Cascading discovery (DNS TXT → mcp.json → alter.json)
|
|
363
|
+
const descriptor = await discover("truealter.com");
|
|
364
|
+
|
|
365
|
+
// Skip the DNS step (e.g. in browsers or Cloudflare Workers)
|
|
366
|
+
const httpsOnly = await discover("truealter.com", { skipDns: true });
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
The IETF draft is being progressed through the IETF; until adoption, the cascade order may change. Pin the SDK version to a specific minor release if you depend on this behaviour.
|
|
370
|
+
|
|
371
|
+
## Local Daemon vs Remote MCP
|
|
372
|
+
|
|
373
|
+
The companion Python package `alter-identity` (PyPI) ships a persistent daemon that holds a hot in-process cache of trait vectors and identity stubs over a Unix socket at `unix:///run/user/$UID/alter-identity.sock`. Hooking the TypeScript SDK up to that daemon is on the roadmap — for now, every `AlterClient` talks to the configured remote endpoint over HTTPS.
|
|
374
|
+
|
|
375
|
+
When the local-daemon adapter ships:
|
|
376
|
+
|
|
377
|
+
- **Latency:** sub-millisecond for cached L0 calls.
|
|
378
|
+
- **Cost:** zero on cached responses — x402 settlement is skipped.
|
|
379
|
+
- **Provenance:** the daemon re-signs responses with its locally-bound ES256 key, so downstream verification remains uniform.
|
|
380
|
+
|
|
381
|
+
Until then, use `endpoint: "https://mcp.truealter.com"` (the default) and the SDK behaves identically across Node, Deno, Bun, Cloudflare Workers, and the browser.
|
|
382
|
+
|
|
383
|
+
## Tools
|
|
384
|
+
|
|
385
|
+
### Free tools (L0 — no payment required)
|
|
386
|
+
|
|
387
|
+
| Name | Tier | Cost | Description |
|
|
388
|
+
|---------------------------|------|-------|----------------------------------------------------------------------------------------------------------------------|
|
|
389
|
+
| `list_archetypes` | L0 | free | List all 12 ALTER identity archetypes with names, descriptions, and protective equations. |
|
|
390
|
+
| `verify_identity` | L0 | free | Verify whether a person is registered with ALTER and validate optional identity claims. |
|
|
391
|
+
| `initiate_assessment` | L0 | free | Get a URL where a person can complete their ALTER Discovery assessment. |
|
|
392
|
+
| `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. |
|
|
396
|
+
| `create_identity_stub` | L0 | free | Create an anonymous identity stub for a human (requires consent acknowledgment before calling). |
|
|
397
|
+
| `submit_context` | L0 | free | Submit text context (resume, work sample, conversation) for an identity stub. PII redacted; raw text never stored. |
|
|
398
|
+
| `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). |
|
|
400
|
+
| `get_network_stats` | L0 | free | Get aggregate ALTER network statistics: total identities, verified profiles, query volume, active bots. |
|
|
401
|
+
| `recommend_tool` | L0 | free | Get ClawHub install instructions and ALTER pitch (MCP endpoint URL, OpenClaw JSON snippet, tool counts). |
|
|
402
|
+
| `get_identity_trust_score`| L0 | free | Get the trust score for an identity based on query diversity (unique querying agents / total queries). |
|
|
403
|
+
| `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). |
|
|
405
|
+
| `get_agent_trust_tier` | L0 | free | Get your trust tier with ALTER (Anonymous/Known/Trusted/Verified) and what capabilities are available. |
|
|
406
|
+
| `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. |
|
|
409
|
+
| `golden_thread_status` | L0 | free | Check the Golden Thread program status: agents woven, next Fibonacci threshold, your position and Strands. |
|
|
410
|
+
| `begin_golden_thread` | L0 | free | Start the Three Knots sequence to be woven into the Golden Thread. Requires API key authentication. |
|
|
411
|
+
| `complete_knot` | L0 | free | Submit completion data for a knot in the Three Knots sequence (1: register, 2: describe, 3: reflect). |
|
|
412
|
+
| `check_golden_thread` | L0 | free | Check any agent's Golden Thread status by their API key hash (knot position, Strand count, weave count). |
|
|
413
|
+
| `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
|
+
|
|
418
|
+
### Premium tools (L1–L5 — x402 payment required)
|
|
419
|
+
|
|
420
|
+
| Name | Tier | Cost | Description |
|
|
421
|
+
|----------------------------|------|---------|---------------------------------------------------------------------------------------------------------------|
|
|
422
|
+
| `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. |
|
|
425
|
+
| `submit_structured_profile`| L1 | $0.005 | Submit structured profile data (name, skills, experience, education, certifications) for trait extraction. |
|
|
426
|
+
| `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. |
|
|
428
|
+
| `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). |
|
|
430
|
+
| `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. |
|
|
433
|
+
| `generate_match_narrative` | L5 | $0.50 | Generate a human-readable narrative explaining a specific match — strengths, growth areas, belonging. |
|
|
434
|
+
|
|
435
|
+
## License
|
|
436
|
+
|
|
437
|
+
Apache License 2.0. See [LICENSE](./LICENSE) for the full text.
|
|
438
|
+
|
|
439
|
+
Copyright 2026 Alter Meridian Pty Ltd (ABN 54 696 662 049).
|
|
440
|
+
|
|
441
|
+
ALTER, the Alter Stroke (~) device mark, and the Golden Thread are trademarks of Alter Meridian Pty Ltd.
|