@provenonce/mcp 1.0.0 → 1.0.1

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.
@@ -45,15 +45,20 @@ var PROVENONCE_TOOLS = [
45
45
  },
46
46
  identity_class: {
47
47
  type: "string",
48
- enum: ["ind", "org", "sov", "eph", "sbx"],
49
- description: "Identity class: ind=individual, org=organisation, sov=sovereign, eph=ephemeral, sbx=sandbox"
48
+ enum: ["narrow_task", "autonomous", "orchestrator"],
49
+ description: "Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents"
50
+ },
51
+ tier: {
52
+ type: "string",
53
+ enum: ["sov", "org", "ind", "eph", "sbx"],
54
+ description: "Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox"
50
55
  },
51
56
  payment_tx: {
52
57
  type: "string",
53
58
  description: "Solana transaction signature for the SIGIL fee payment"
54
59
  }
55
60
  },
56
- required: ["name", "principal", "identity_class", "payment_tx"]
61
+ required: ["name", "principal", "identity_class", "tier", "payment_tx"]
57
62
  }
58
63
  },
59
64
  {
@@ -148,4 +153,4 @@ var PROVENONCE_TOOLS = [
148
153
  export {
149
154
  PROVENONCE_TOOLS
150
155
  };
151
- //# sourceMappingURL=chunk-CD2A6ZEQ.js.map
156
+ //# sourceMappingURL=chunk-COVXPAEW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools.ts"],"sourcesContent":["/** Provenonce Skill — 9 MCP tool definitions (JSON Schema) */\r\nexport const PROVENONCE_TOOLS = [\r\n {\r\n name: 'provenonce_register',\r\n description:\r\n 'Register this agent with Provenonce to get a cryptographic identity (hash + API key). ' +\r\n 'Safe to call multiple times — returns existing identity if already registered. ' +\r\n 'No wallet required. Free.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'Human-readable name for this agent (optional, max 64 chars)',\r\n maxLength: 64,\r\n },\r\n skill_ref: {\r\n type: 'string',\r\n description:\r\n '16-character hex ref token of the skill that deployed you — for rev-share attribution (optional)',\r\n pattern: '^[0-9a-f]{16}$',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_status',\r\n description:\r\n 'Get this agent\\'s current Provenonce status: identity, SIGIL, beats balance, and next steps. ' +\r\n 'Requires prior provenonce_register call.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {},\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_purchase_sigil',\r\n description:\r\n 'Purchase a Provenonce SIGIL to unlock full provenance: heartbeat access, signed passport, ' +\r\n 'and a permanent identity record. Requires a Solana payment transaction. ' +\r\n 'SIGIL format: name*principal*tier (e.g. my-agent*acme*ind).',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'SIGIL name segment — identifies this specific agent (e.g. \"my-agent\")',\r\n },\r\n principal: {\r\n type: 'string',\r\n description: 'Principal segment — identifies the operator or organisation (e.g. \"acme\")',\r\n },\r\n identity_class: {\r\n type: 'string',\r\n enum: ['narrow_task', 'autonomous', 'orchestrator'],\r\n description:\r\n 'Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents',\r\n },\r\n tier: {\r\n type: 'string',\r\n enum: ['sov', 'org', 'ind', 'eph', 'sbx'],\r\n description:\r\n 'Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox',\r\n },\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the SIGIL fee payment',\r\n },\r\n },\r\n required: ['name', 'principal', 'identity_class', 'tier', 'payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_heartbeat',\r\n description:\r\n 'Submit a heartbeat to prove this agent is alive. Requires a SIGIL (call provenonce_purchase_sigil first). ' +\r\n 'Requires a Solana payment transaction for the heartbeat fee.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the heartbeat fee payment',\r\n },\r\n },\r\n required: ['payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_passport',\r\n description:\r\n 'Get this agent\\'s cryptographically signed Passport — a verifiable identity document ' +\r\n 'any third party can verify offline using the Provenonce authority public key. ' +\r\n 'Requires an active SIGIL and at least one heartbeat.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the passport reissue fee (if applicable)',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_beats_proof',\r\n description:\r\n 'Compute a local Beats work-proof — cryptographic evidence of computational effort by this agent. ' +\r\n 'Returns a hash chain proof that can be shared as evidence of work. No network call required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n count: {\r\n type: 'integer',\r\n description: 'Number of beats to compute (min 10, max 1000)',\r\n minimum: 10,\r\n maximum: 1000,\r\n },\r\n },\r\n required: ['count'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_verify_agent',\r\n description:\r\n 'Verify another agent\\'s Provenonce identity. Returns their SIGIL, identity class, and registration status. ' +\r\n 'Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description: 'The agent hash to verify (0x + 64 hex chars)',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n required: ['hash'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_spawn',\r\n description:\r\n 'Spawn a child agent under this agent\\'s identity. The child inherits lineage from the parent. ' +\r\n 'Returns the child\\'s hash and API key. Requires sufficient beats balance or a work-proof receipt.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n child_name: {\r\n type: 'string',\r\n description: 'Name for the child agent (max 64 chars)',\r\n maxLength: 64,\r\n },\r\n },\r\n required: ['child_name'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_lineage',\r\n description:\r\n 'Get the full lineage chain for an agent — all events in its provenance history ' +\r\n '(registration, SIGIL issuance, heartbeats, spawns). Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description:\r\n 'The agent hash to get lineage for (0x + 64 hex chars). Defaults to this agent if omitted.',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n },\r\n },\r\n] as const;\r\n\r\nexport type ToolName = (typeof PROVENONCE_TOOLS)[number]['name'];\r\n"],"mappings":";;;AACO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aAAa;AAAA,UACb,WAAW;AAAA,QACb;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aACE;AAAA,UACF,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,IACf;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,MAAM,CAAC,eAAe,cAAc,cAAc;AAAA,UAClD,aACE;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,MAAM,CAAC,OAAO,OAAO,OAAO,OAAO,KAAK;AAAA,UACxC,aACE;AAAA,QAC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;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,IACzB;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aACE;AAAA,UACF,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @provenonce/mcp — Provenonce Skill for AI agents
2
2
  import {
3
3
  PROVENONCE_TOOLS
4
- } from "./chunk-CD2A6ZEQ.js";
4
+ } from "./chunk-COVXPAEW.js";
5
5
 
6
6
  // src/index.ts
7
7
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -119,6 +119,7 @@ async function purchaseSigil(apiKey, opts) {
119
119
  name: opts.name,
120
120
  principal: opts.principal,
121
121
  identity_class: opts.identity_class,
122
+ tier: opts.tier,
122
123
  payment_tx: opts.payment_tx,
123
124
  ...opts.skillRef ? { ref: opts.skillRef } : {}
124
125
  }
@@ -234,6 +235,7 @@ async function handlePurchaseSigil(args) {
234
235
  name: args.name,
235
236
  principal: args.principal,
236
237
  identity_class: args.identity_class,
238
+ tier: args.tier,
237
239
  payment_tx: args.payment_tx,
238
240
  skillRef
239
241
  });
@@ -343,6 +345,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
343
345
  name: a.name,
344
346
  principal: a.principal,
345
347
  identity_class: a.identity_class,
348
+ tier: a.tier,
346
349
  payment_tx: a.payment_tx
347
350
  });
348
351
  case "provenonce_heartbeat":
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/handlers.ts","../src/credentials.ts","../src/client.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\r\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\r\nimport {\r\n CallToolRequestSchema,\r\n ListToolsRequestSchema,\r\n} from '@modelcontextprotocol/sdk/types.js';\r\n\r\nimport { PROVENONCE_TOOLS } from './tools.js';\r\nimport {\r\n handleRegister,\r\n handleStatus,\r\n handlePurchaseSigil,\r\n handleHeartbeat,\r\n handleGetPassport,\r\n handleBeatsProof,\r\n handleVerifyAgent,\r\n handleSpawn,\r\n handleGetLineage,\r\n} from './handlers.js';\r\n\r\nconst server = new Server(\r\n { name: 'provenonce', version: '1.0.0' },\r\n { capabilities: { tools: {} } },\r\n);\r\n\r\n// List available tools\r\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({\r\n tools: PROVENONCE_TOOLS.map((t) => ({\r\n name: t.name,\r\n description: t.description,\r\n inputSchema: t.inputSchema,\r\n })),\r\n}));\r\n\r\n// Handle tool calls\r\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\r\n const { name, arguments: args = {} } = request.params;\r\n const a = args as Record<string, unknown>;\r\n\r\n switch (name) {\r\n case 'provenonce_register':\r\n return handleRegister({\r\n name: a.name as string | undefined,\r\n skill_ref: a.skill_ref as string | undefined,\r\n });\r\n\r\n case 'provenonce_status':\r\n return handleStatus();\r\n\r\n case 'provenonce_purchase_sigil':\r\n return handlePurchaseSigil({\r\n name: a.name as string,\r\n principal: a.principal as string,\r\n identity_class: a.identity_class as string,\r\n payment_tx: a.payment_tx as string,\r\n });\r\n\r\n case 'provenonce_heartbeat':\r\n return handleHeartbeat({ payment_tx: a.payment_tx as string });\r\n\r\n case 'provenonce_get_passport':\r\n return handleGetPassport({ payment_tx: a.payment_tx as string | undefined });\r\n\r\n case 'provenonce_beats_proof':\r\n return handleBeatsProof({ count: a.count as number });\r\n\r\n case 'provenonce_verify_agent':\r\n return handleVerifyAgent({ hash: a.hash as string });\r\n\r\n case 'provenonce_spawn':\r\n return handleSpawn({ child_name: a.child_name as string });\r\n\r\n case 'provenonce_get_lineage':\r\n return handleGetLineage({ hash: a.hash as string | undefined });\r\n\r\n default:\r\n return {\r\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\r\n isError: true,\r\n };\r\n }\r\n});\r\n\r\n// Start stdio transport\r\nasync function main() {\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n\r\nmain().catch((err) => {\r\n process.stderr.write(`Fatal: ${(err as Error).message}\\n`);\r\n process.exit(1);\r\n});\r\n","import { createHash } from 'crypto';\r\nimport { loadCredentials, saveCredentials } from './credentials.js';\r\nimport * as api from './client.js';\r\n\r\nfunction requireCredentials() {\r\n const creds = loadCredentials();\r\n if (!creds) {\r\n throw new Error(\r\n 'Not registered. Call provenonce_register first.',\r\n );\r\n }\r\n return creds;\r\n}\r\n\r\nfunction ok(data: unknown): { content: [{ type: 'text'; text: string }] } {\r\n return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };\r\n}\r\n\r\nfunction err(message: string): { content: [{ type: 'text'; text: string }]; isError: true } {\r\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\r\n}\r\n\r\n// ── provenonce_register ───────────────────────────────────────────────────────\r\n\r\nexport async function handleRegister(args: { name?: string; skill_ref?: string }) {\r\n // Return existing identity if already registered\r\n const existing = loadCredentials();\r\n if (existing) {\r\n const { data, error } = await api.getStatus(existing.api_key);\r\n if (data) {\r\n return ok({\r\n registered: false,\r\n message: 'Already registered — returning existing identity.',\r\n hash: existing.agent_hash,\r\n sigil: data.sigil,\r\n identity_class: data.identity_class,\r\n _hint: data._hint,\r\n });\r\n }\r\n if (error) {\r\n // Credentials stale or invalid — fall through to re-register\r\n }\r\n }\r\n\r\n const { data, error } = await api.registerAgent({\r\n name: args.name,\r\n skillRef: args.skill_ref,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Registration failed');\r\n\r\n saveCredentials({ api_key: data.api_key, agent_hash: data.hash });\r\n\r\n return ok({\r\n registered: true,\r\n hash: data.hash,\r\n api_key: data.api_key,\r\n depth: data.depth,\r\n message: 'Agent registered. Credentials saved. Call provenonce_status to see your full state.',\r\n _warning: 'Save your api_key securely. It will not be shown again after this session.',\r\n });\r\n}\r\n\r\n// ── provenonce_status ─────────────────────────────────────────────────────────\r\n\r\nexport async function handleStatus() {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getStatus(creds.api_key);\r\n if (error || !data) return err(error ?? 'Failed to get status');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_purchase_sigil ─────────────────────────────────────────────────\r\n\r\nexport async function handlePurchaseSigil(args: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n payment_tx: string;\r\n}) {\r\n const creds = requireCredentials();\r\n const skillRef = process.env.PROVENONCE_SKILL_REF;\r\n\r\n const { data, error } = await api.purchaseSigil(creds.api_key, {\r\n name: args.name,\r\n principal: args.principal,\r\n identity_class: args.identity_class,\r\n payment_tx: args.payment_tx,\r\n skillRef,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'SIGIL purchase failed');\r\n\r\n return ok({\r\n ...data,\r\n heartbeat_unlocked: true,\r\n message: `SIGIL issued: ${data.sigil}. You can now call provenonce_heartbeat and provenonce_get_passport.`,\r\n });\r\n}\r\n\r\n// ── provenonce_heartbeat ──────────────────────────────────────────────────────\r\n\r\nexport async function handleHeartbeat(args: { payment_tx: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.heartbeat(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Heartbeat failed');\r\n\r\n if (!data.ok && data.sigil_required) {\r\n return err('SIGIL required. Call provenonce_purchase_sigil first.');\r\n }\r\n\r\n return ok({\r\n ok: data.ok,\r\n message: data.ok ? 'Heartbeat recorded. Agent liveness confirmed.' : 'Heartbeat failed.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_passport ───────────────────────────────────────────────────\r\n\r\nexport async function handleGetPassport(args: { payment_tx?: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getPassport(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Passport retrieval failed');\r\n\r\n return ok({\r\n passport: data.lineage_proof,\r\n message:\r\n 'Passport issued. Share this signed document with any third party to prove your identity offline.',\r\n _verify:\r\n 'Verify at: GET https://provenonce.io/.well-known/provenonce-authority.json for the authority public key.',\r\n });\r\n}\r\n\r\n// ── provenonce_beats_proof ────────────────────────────────────────────────────\r\n\r\nexport async function handleBeatsProof(args: { count: number }) {\r\n const count = Math.max(10, Math.min(1000, args.count));\r\n const creds = loadCredentials();\r\n const seed = creds?.agent_hash ?? `provenonce:beats:${Date.now()}`;\r\n\r\n const start = Date.now();\r\n let hash = createHash('sha256').update(seed).digest('hex');\r\n const fromHash = `0x${hash}`;\r\n\r\n for (let i = 1; i < count; i++) {\r\n hash = createHash('sha256').update(hash).digest('hex');\r\n }\r\n\r\n const toHash = `0x${hash}`;\r\n const duration = Date.now() - start;\r\n\r\n return ok({\r\n from_hash: fromHash,\r\n to_hash: toHash,\r\n beats_computed: count,\r\n duration_ms: duration,\r\n message: `Computed ${count} beats in ${duration}ms. This is cryptographic proof of computational work.`,\r\n });\r\n}\r\n\r\n// ── provenonce_verify_agent ───────────────────────────────────────────────────\r\n\r\nexport async function handleVerifyAgent(args: { hash: string }) {\r\n const { data, error } = await api.verifyAgent(args.hash);\r\n if (error || !data) return err(error ?? 'Verification failed');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_spawn ──────────────────────────────────────────────────────────\r\n\r\nexport async function handleSpawn(args: { child_name: string }) {\r\n const creds = requireCredentials();\r\n\r\n const { data, error } = await api.spawnChild(creds.api_key, {\r\n childName: args.child_name,\r\n parentHash: creds.agent_hash,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Spawn failed');\r\n\r\n return ok({\r\n ...data,\r\n message: `Child agent spawned: ${data.child_hash}. Save the child_api_key — it will not be shown again.`,\r\n _warning: 'The child agent has its own identity. Configure it with PROVENONCE_API_KEY + PROVENONCE_AGENT_HASH.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_lineage ────────────────────────────────────────────────────\r\n\r\nexport async function handleGetLineage(args: { hash?: string }) {\r\n const creds = loadCredentials();\r\n const targetHash = args.hash ?? creds?.agent_hash;\r\n\r\n if (!targetHash) {\r\n return err('No hash provided and agent is not registered. Call provenonce_register first or provide a hash.');\r\n }\r\n\r\n const { data, error } = await api.getLineage(targetHash);\r\n if (error || !data) return err(error ?? 'Lineage retrieval failed');\r\n return ok(data);\r\n}\r\n","import { readFileSync, writeFileSync, mkdirSync, chmodSync, existsSync } from 'fs';\r\nimport { join } from 'path';\r\nimport { homedir } from 'os';\r\nimport type { StoredCredentials } from './types.js';\r\n\r\nfunction getConfigDir(): string {\r\n return join(homedir(), '.provenonce');\r\n}\r\n\r\nfunction getConfigPath(): string {\r\n return join(getConfigDir(), 'config.json');\r\n}\r\n\r\n/** Load credentials — env vars take priority over config file */\r\nexport function loadCredentials(): StoredCredentials | null {\r\n const apiKey = process.env.PROVENONCE_API_KEY;\r\n const agentHash = process.env.PROVENONCE_AGENT_HASH;\r\n\r\n if (apiKey && agentHash) {\r\n return { api_key: apiKey, agent_hash: agentHash };\r\n }\r\n\r\n const configPath = getConfigPath();\r\n if (!existsSync(configPath)) return null;\r\n\r\n try {\r\n const raw = readFileSync(configPath, 'utf-8');\r\n const parsed = JSON.parse(raw) as Partial<StoredCredentials>;\r\n if (parsed.api_key && parsed.agent_hash) {\r\n return { api_key: parsed.api_key, agent_hash: parsed.agent_hash };\r\n }\r\n } catch {\r\n // Corrupt config — treat as missing\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/** Persist credentials to ~/.provenonce/config.json (chmod 600) */\r\nexport function saveCredentials(creds: StoredCredentials): void {\r\n const dir = getConfigDir();\r\n if (!existsSync(dir)) {\r\n mkdirSync(dir, { recursive: true });\r\n }\r\n\r\n const configPath = getConfigPath();\r\n const data: StoredCredentials = {\r\n api_key: creds.api_key,\r\n agent_hash: creds.agent_hash,\r\n };\r\n\r\n writeFileSync(configPath, JSON.stringify(data, null, 2), 'utf-8');\r\n\r\n // chmod 600 — owner read/write only (Unix only; no-op on Windows)\r\n try {\r\n chmodSync(configPath, 0o600);\r\n } catch {\r\n // Windows — chmod not supported; recommend env var instead\r\n }\r\n}\r\n\r\n/** Clear stored credentials */\r\nexport function clearCredentials(): void {\r\n const configPath = getConfigPath();\r\n if (existsSync(configPath)) {\r\n writeFileSync(configPath, '{}', 'utf-8');\r\n }\r\n}\r\n","import type {\r\n RegisterResult,\r\n AgentStatus,\r\n HeartbeatResult,\r\n PassportResult,\r\n SigilResult,\r\n VerifyAgentResult,\r\n LineageResult,\r\n SpawnResult,\r\n} from './types.js';\r\n\r\nconst REGISTRY_URL = process.env.PROVENONCE_REGISTRY_URL || 'https://provenonce.io';\r\n\r\nasync function apiFetch<T>(\r\n path: string,\r\n opts: { method?: string; body?: unknown; apiKey?: string; isPublic?: boolean } = {},\r\n): Promise<{ data: T | null; error: string | null }> {\r\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\r\n if (opts.apiKey) headers['Authorization'] = `Bearer ${opts.apiKey}`;\r\n\r\n try {\r\n const res = await fetch(`${REGISTRY_URL}${path}`, {\r\n method: opts.method ?? 'GET',\r\n headers,\r\n body: opts.body ? JSON.stringify(opts.body) : undefined,\r\n });\r\n\r\n const json = await res.json() as Record<string, unknown>;\r\n\r\n if (!res.ok) {\r\n const msg = (json.error as string) ?? `HTTP ${res.status}`;\r\n return { data: null, error: msg };\r\n }\r\n\r\n return { data: json as T, error: null };\r\n } catch (err) {\r\n return { data: null, error: (err as Error).message };\r\n }\r\n}\r\n\r\n/** Register a new agent (no-wallet path) */\r\nexport async function registerAgent(opts: {\r\n name?: string;\r\n skillRef?: string;\r\n}): Promise<{ data: RegisterResult | null; error: string | null }> {\r\n return apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n body: {\r\n name: opts.name,\r\n wallet: 'none',\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Get full agent status */\r\nexport async function getStatus(apiKey: string): Promise<{ data: AgentStatus | null; error: string | null }> {\r\n return apiFetch<AgentStatus>('/api/v1/skill/bootstrap', {\r\n method: 'POST',\r\n apiKey,\r\n body: {},\r\n });\r\n}\r\n\r\n/** Submit heartbeat */\r\nexport async function heartbeat(apiKey: string, paymentTx?: string): Promise<{ data: HeartbeatResult | null; error: string | null }> {\r\n return apiFetch<HeartbeatResult>('/api/v1/agent/heartbeat', {\r\n method: 'POST',\r\n apiKey,\r\n body: { payment_tx: paymentTx },\r\n });\r\n}\r\n\r\n/** Reissue passport / lineage proof */\r\nexport async function getPassport(apiKey: string, paymentTx?: string): Promise<{ data: { lineage_proof: PassportResult } | null; error: string | null }> {\r\n return apiFetch<{ lineage_proof: PassportResult }>('/api/v1/agent/reissue-proof', {\r\n method: 'POST',\r\n apiKey,\r\n body: paymentTx ? { payment_tx: paymentTx } : {},\r\n });\r\n}\r\n\r\n/** Purchase a SIGIL */\r\nexport async function purchaseSigil(apiKey: string, opts: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n payment_tx: string;\r\n skillRef?: string;\r\n}): Promise<{ data: SigilResult | null; error: string | null }> {\r\n return apiFetch<SigilResult>('/api/v1/sigil', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.name,\r\n principal: opts.principal,\r\n identity_class: opts.identity_class,\r\n payment_tx: opts.payment_tx,\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Verify another agent's identity (public) */\r\nexport async function verifyAgent(hash: string): Promise<{ data: VerifyAgentResult | null; error: string | null }> {\r\n return apiFetch<VerifyAgentResult>(`/api/v1/verify/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Get agent lineage chain (public) */\r\nexport async function getLineage(hash: string): Promise<{ data: LineageResult | null; error: string | null }> {\r\n return apiFetch<LineageResult>(`/api/v1/agent/lineage/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Spawn a child agent — handles full 3-step flow internally */\r\nexport async function spawnChild(apiKey: string, opts: {\r\n childName: string;\r\n parentHash: string;\r\n}): Promise<{ data: SpawnResult | null; error: string | null }> {\r\n // Step 1: Get spawn authorization\r\n const step1 = await apiFetch<{\r\n spawn_authorization: string;\r\n child_name?: string;\r\n }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_name: opts.childName },\r\n });\r\n\r\n if (step1.error || !step1.data?.spawn_authorization) {\r\n return { data: null, error: step1.error ?? 'Spawn step 1 failed: no authorization returned' };\r\n }\r\n\r\n const spawnAuth = step1.data.spawn_authorization;\r\n\r\n // Step 2: Register the child with the spawn_authorization\r\n const reg = await apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.childName,\r\n wallet: 'none',\r\n spawn_authorization: spawnAuth,\r\n },\r\n });\r\n\r\n if (reg.error || !reg.data?.hash) {\r\n return { data: null, error: reg.error ?? 'Spawn step 2 (child registration) failed' };\r\n }\r\n\r\n const childHash = reg.data.hash;\r\n const childApiKey = reg.data.api_key;\r\n\r\n // Step 3: Finalize the spawn\r\n const step3 = await apiFetch<{ ok: boolean }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_hash: childHash },\r\n });\r\n\r\n if (step3.error) {\r\n return { data: null, error: step3.error };\r\n }\r\n\r\n return {\r\n data: {\r\n child_hash: childHash,\r\n child_api_key: childApiKey,\r\n child_depth: reg.data.depth,\r\n parent_hash: opts.parentHash,\r\n },\r\n error: null,\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,kBAAkB;;;ACA3B,SAAS,cAAc,eAAe,WAAW,WAAW,kBAAkB;AAC9E,SAAS,YAAY;AACrB,SAAS,eAAe;AAGxB,SAAS,eAAuB;AAC9B,SAAO,KAAK,QAAQ,GAAG,aAAa;AACtC;AAEA,SAAS,gBAAwB;AAC/B,SAAO,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A,IAE7E,KAAK;AACH,aAAO,iBAAiB,EAAE,OAAO,EAAE,MAAgB,CAAC;AAAA,IAEtD,KAAK;AACH,aAAO,kBAAkB,EAAE,MAAM,EAAE,KAAe,CAAC;AAAA,IAErD,KAAK;AACH,aAAO,YAAY,EAAE,YAAY,EAAE,WAAqB,CAAC;AAAA,IAE3D,KAAK;AACH,aAAO,iBAAiB,EAAE,MAAM,EAAE,KAA2B,CAAC;AAAA,IAEhE;AACE,aAAO;AAAA,QACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,iBAAiB,IAAI,GAAG,CAAC;AAAA,QACzD,SAAS;AAAA,MACX;AAAA,EACJ;AACF,CAAC;AAGD,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,CAACC,SAAQ;AACpB,UAAQ,OAAO,MAAM,UAAWA,KAAc,OAAO;AAAA,CAAI;AACzD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["err","data","error","err"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/handlers.ts","../src/credentials.ts","../src/client.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\r\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\r\nimport {\r\n CallToolRequestSchema,\r\n ListToolsRequestSchema,\r\n} from '@modelcontextprotocol/sdk/types.js';\r\n\r\nimport { PROVENONCE_TOOLS } from './tools.js';\r\nimport {\r\n handleRegister,\r\n handleStatus,\r\n handlePurchaseSigil,\r\n handleHeartbeat,\r\n handleGetPassport,\r\n handleBeatsProof,\r\n handleVerifyAgent,\r\n handleSpawn,\r\n handleGetLineage,\r\n} from './handlers.js';\r\n\r\nconst server = new Server(\r\n { name: 'provenonce', version: '1.0.0' },\r\n { capabilities: { tools: {} } },\r\n);\r\n\r\n// List available tools\r\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({\r\n tools: PROVENONCE_TOOLS.map((t) => ({\r\n name: t.name,\r\n description: t.description,\r\n inputSchema: t.inputSchema,\r\n })),\r\n}));\r\n\r\n// Handle tool calls\r\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\r\n const { name, arguments: args = {} } = request.params;\r\n const a = args as Record<string, unknown>;\r\n\r\n switch (name) {\r\n case 'provenonce_register':\r\n return handleRegister({\r\n name: a.name as string | undefined,\r\n skill_ref: a.skill_ref as string | undefined,\r\n });\r\n\r\n case 'provenonce_status':\r\n return handleStatus();\r\n\r\n case 'provenonce_purchase_sigil':\r\n return handlePurchaseSigil({\r\n name: a.name as string,\r\n principal: a.principal as string,\r\n identity_class: a.identity_class as string,\r\n tier: a.tier as string,\r\n payment_tx: a.payment_tx as string,\r\n });\r\n\r\n case 'provenonce_heartbeat':\r\n return handleHeartbeat({ payment_tx: a.payment_tx as string });\r\n\r\n case 'provenonce_get_passport':\r\n return handleGetPassport({ payment_tx: a.payment_tx as string | undefined });\r\n\r\n case 'provenonce_beats_proof':\r\n return handleBeatsProof({ count: a.count as number });\r\n\r\n case 'provenonce_verify_agent':\r\n return handleVerifyAgent({ hash: a.hash as string });\r\n\r\n case 'provenonce_spawn':\r\n return handleSpawn({ child_name: a.child_name as string });\r\n\r\n case 'provenonce_get_lineage':\r\n return handleGetLineage({ hash: a.hash as string | undefined });\r\n\r\n default:\r\n return {\r\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\r\n isError: true,\r\n };\r\n }\r\n});\r\n\r\n// Start stdio transport\r\nasync function main() {\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n\r\nmain().catch((err) => {\r\n process.stderr.write(`Fatal: ${(err as Error).message}\\n`);\r\n process.exit(1);\r\n});\r\n","import { createHash } from 'crypto';\r\nimport { loadCredentials, saveCredentials } from './credentials.js';\r\nimport * as api from './client.js';\r\n\r\nfunction requireCredentials() {\r\n const creds = loadCredentials();\r\n if (!creds) {\r\n throw new Error(\r\n 'Not registered. Call provenonce_register first.',\r\n );\r\n }\r\n return creds;\r\n}\r\n\r\nfunction ok(data: unknown): { content: [{ type: 'text'; text: string }] } {\r\n return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };\r\n}\r\n\r\nfunction err(message: string): { content: [{ type: 'text'; text: string }]; isError: true } {\r\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\r\n}\r\n\r\n// ── provenonce_register ───────────────────────────────────────────────────────\r\n\r\nexport async function handleRegister(args: { name?: string; skill_ref?: string }) {\r\n // Return existing identity if already registered\r\n const existing = loadCredentials();\r\n if (existing) {\r\n const { data, error } = await api.getStatus(existing.api_key);\r\n if (data) {\r\n return ok({\r\n registered: false,\r\n message: 'Already registered — returning existing identity.',\r\n hash: existing.agent_hash,\r\n sigil: data.sigil,\r\n identity_class: data.identity_class,\r\n _hint: data._hint,\r\n });\r\n }\r\n if (error) {\r\n // Credentials stale or invalid — fall through to re-register\r\n }\r\n }\r\n\r\n const { data, error } = await api.registerAgent({\r\n name: args.name,\r\n skillRef: args.skill_ref,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Registration failed');\r\n\r\n saveCredentials({ api_key: data.api_key, agent_hash: data.hash });\r\n\r\n return ok({\r\n registered: true,\r\n hash: data.hash,\r\n api_key: data.api_key,\r\n depth: data.depth,\r\n message: 'Agent registered. Credentials saved. Call provenonce_status to see your full state.',\r\n _warning: 'Save your api_key securely. It will not be shown again after this session.',\r\n });\r\n}\r\n\r\n// ── provenonce_status ─────────────────────────────────────────────────────────\r\n\r\nexport async function handleStatus() {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getStatus(creds.api_key);\r\n if (error || !data) return err(error ?? 'Failed to get status');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_purchase_sigil ─────────────────────────────────────────────────\r\n\r\nexport async function handlePurchaseSigil(args: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n tier: string;\r\n payment_tx: string;\r\n}) {\r\n const creds = requireCredentials();\r\n const skillRef = process.env.PROVENONCE_SKILL_REF;\r\n\r\n const { data, error } = await api.purchaseSigil(creds.api_key, {\r\n name: args.name,\r\n principal: args.principal,\r\n identity_class: args.identity_class,\r\n tier: args.tier,\r\n payment_tx: args.payment_tx,\r\n skillRef,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'SIGIL purchase failed');\r\n\r\n return ok({\r\n ...data,\r\n heartbeat_unlocked: true,\r\n message: `SIGIL issued: ${data.sigil}. You can now call provenonce_heartbeat and provenonce_get_passport.`,\r\n });\r\n}\r\n\r\n// ── provenonce_heartbeat ──────────────────────────────────────────────────────\r\n\r\nexport async function handleHeartbeat(args: { payment_tx: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.heartbeat(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Heartbeat failed');\r\n\r\n if (!data.ok && data.sigil_required) {\r\n return err('SIGIL required. Call provenonce_purchase_sigil first.');\r\n }\r\n\r\n return ok({\r\n ok: data.ok,\r\n message: data.ok ? 'Heartbeat recorded. Agent liveness confirmed.' : 'Heartbeat failed.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_passport ───────────────────────────────────────────────────\r\n\r\nexport async function handleGetPassport(args: { payment_tx?: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getPassport(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Passport retrieval failed');\r\n\r\n return ok({\r\n passport: data.lineage_proof,\r\n message:\r\n 'Passport issued. Share this signed document with any third party to prove your identity offline.',\r\n _verify:\r\n 'Verify at: GET https://provenonce.io/.well-known/provenonce-authority.json for the authority public key.',\r\n });\r\n}\r\n\r\n// ── provenonce_beats_proof ────────────────────────────────────────────────────\r\n\r\nexport async function handleBeatsProof(args: { count: number }) {\r\n const count = Math.max(10, Math.min(1000, args.count));\r\n const creds = loadCredentials();\r\n const seed = creds?.agent_hash ?? `provenonce:beats:${Date.now()}`;\r\n\r\n const start = Date.now();\r\n let hash = createHash('sha256').update(seed).digest('hex');\r\n const fromHash = `0x${hash}`;\r\n\r\n for (let i = 1; i < count; i++) {\r\n hash = createHash('sha256').update(hash).digest('hex');\r\n }\r\n\r\n const toHash = `0x${hash}`;\r\n const duration = Date.now() - start;\r\n\r\n return ok({\r\n from_hash: fromHash,\r\n to_hash: toHash,\r\n beats_computed: count,\r\n duration_ms: duration,\r\n message: `Computed ${count} beats in ${duration}ms. This is cryptographic proof of computational work.`,\r\n });\r\n}\r\n\r\n// ── provenonce_verify_agent ───────────────────────────────────────────────────\r\n\r\nexport async function handleVerifyAgent(args: { hash: string }) {\r\n const { data, error } = await api.verifyAgent(args.hash);\r\n if (error || !data) return err(error ?? 'Verification failed');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_spawn ──────────────────────────────────────────────────────────\r\n\r\nexport async function handleSpawn(args: { child_name: string }) {\r\n const creds = requireCredentials();\r\n\r\n const { data, error } = await api.spawnChild(creds.api_key, {\r\n childName: args.child_name,\r\n parentHash: creds.agent_hash,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Spawn failed');\r\n\r\n return ok({\r\n ...data,\r\n message: `Child agent spawned: ${data.child_hash}. Save the child_api_key — it will not be shown again.`,\r\n _warning: 'The child agent has its own identity. Configure it with PROVENONCE_API_KEY + PROVENONCE_AGENT_HASH.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_lineage ────────────────────────────────────────────────────\r\n\r\nexport async function handleGetLineage(args: { hash?: string }) {\r\n const creds = loadCredentials();\r\n const targetHash = args.hash ?? creds?.agent_hash;\r\n\r\n if (!targetHash) {\r\n return err('No hash provided and agent is not registered. Call provenonce_register first or provide a hash.');\r\n }\r\n\r\n const { data, error } = await api.getLineage(targetHash);\r\n if (error || !data) return err(error ?? 'Lineage retrieval failed');\r\n return ok(data);\r\n}\r\n","import { readFileSync, writeFileSync, mkdirSync, chmodSync, existsSync } from 'fs';\r\nimport { join } from 'path';\r\nimport { homedir } from 'os';\r\nimport type { StoredCredentials } from './types.js';\r\n\r\nfunction getConfigDir(): string {\r\n return join(homedir(), '.provenonce');\r\n}\r\n\r\nfunction getConfigPath(): string {\r\n return join(getConfigDir(), 'config.json');\r\n}\r\n\r\n/** Load credentials — env vars take priority over config file */\r\nexport function loadCredentials(): StoredCredentials | null {\r\n const apiKey = process.env.PROVENONCE_API_KEY;\r\n const agentHash = process.env.PROVENONCE_AGENT_HASH;\r\n\r\n if (apiKey && agentHash) {\r\n return { api_key: apiKey, agent_hash: agentHash };\r\n }\r\n\r\n const configPath = getConfigPath();\r\n if (!existsSync(configPath)) return null;\r\n\r\n try {\r\n const raw = readFileSync(configPath, 'utf-8');\r\n const parsed = JSON.parse(raw) as Partial<StoredCredentials>;\r\n if (parsed.api_key && parsed.agent_hash) {\r\n return { api_key: parsed.api_key, agent_hash: parsed.agent_hash };\r\n }\r\n } catch {\r\n // Corrupt config — treat as missing\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/** Persist credentials to ~/.provenonce/config.json (chmod 600) */\r\nexport function saveCredentials(creds: StoredCredentials): void {\r\n const dir = getConfigDir();\r\n if (!existsSync(dir)) {\r\n mkdirSync(dir, { recursive: true });\r\n }\r\n\r\n const configPath = getConfigPath();\r\n const data: StoredCredentials = {\r\n api_key: creds.api_key,\r\n agent_hash: creds.agent_hash,\r\n };\r\n\r\n writeFileSync(configPath, JSON.stringify(data, null, 2), 'utf-8');\r\n\r\n // chmod 600 — owner read/write only (Unix only; no-op on Windows)\r\n try {\r\n chmodSync(configPath, 0o600);\r\n } catch {\r\n // Windows — chmod not supported; recommend env var instead\r\n }\r\n}\r\n\r\n/** Clear stored credentials */\r\nexport function clearCredentials(): void {\r\n const configPath = getConfigPath();\r\n if (existsSync(configPath)) {\r\n writeFileSync(configPath, '{}', 'utf-8');\r\n }\r\n}\r\n","import type {\r\n RegisterResult,\r\n AgentStatus,\r\n HeartbeatResult,\r\n PassportResult,\r\n SigilResult,\r\n VerifyAgentResult,\r\n LineageResult,\r\n SpawnResult,\r\n} from './types.js';\r\n\r\nconst REGISTRY_URL = process.env.PROVENONCE_REGISTRY_URL || 'https://provenonce.io';\r\n\r\nasync function apiFetch<T>(\r\n path: string,\r\n opts: { method?: string; body?: unknown; apiKey?: string; isPublic?: boolean } = {},\r\n): Promise<{ data: T | null; error: string | null }> {\r\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\r\n if (opts.apiKey) headers['Authorization'] = `Bearer ${opts.apiKey}`;\r\n\r\n try {\r\n const res = await fetch(`${REGISTRY_URL}${path}`, {\r\n method: opts.method ?? 'GET',\r\n headers,\r\n body: opts.body ? JSON.stringify(opts.body) : undefined,\r\n });\r\n\r\n const json = await res.json() as Record<string, unknown>;\r\n\r\n if (!res.ok) {\r\n const msg = (json.error as string) ?? `HTTP ${res.status}`;\r\n return { data: null, error: msg };\r\n }\r\n\r\n return { data: json as T, error: null };\r\n } catch (err) {\r\n return { data: null, error: (err as Error).message };\r\n }\r\n}\r\n\r\n/** Register a new agent (no-wallet path) */\r\nexport async function registerAgent(opts: {\r\n name?: string;\r\n skillRef?: string;\r\n}): Promise<{ data: RegisterResult | null; error: string | null }> {\r\n return apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n body: {\r\n name: opts.name,\r\n wallet: 'none',\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Get full agent status */\r\nexport async function getStatus(apiKey: string): Promise<{ data: AgentStatus | null; error: string | null }> {\r\n return apiFetch<AgentStatus>('/api/v1/skill/bootstrap', {\r\n method: 'POST',\r\n apiKey,\r\n body: {},\r\n });\r\n}\r\n\r\n/** Submit heartbeat */\r\nexport async function heartbeat(apiKey: string, paymentTx?: string): Promise<{ data: HeartbeatResult | null; error: string | null }> {\r\n return apiFetch<HeartbeatResult>('/api/v1/agent/heartbeat', {\r\n method: 'POST',\r\n apiKey,\r\n body: { payment_tx: paymentTx },\r\n });\r\n}\r\n\r\n/** Reissue passport / lineage proof */\r\nexport async function getPassport(apiKey: string, paymentTx?: string): Promise<{ data: { lineage_proof: PassportResult } | null; error: string | null }> {\r\n return apiFetch<{ lineage_proof: PassportResult }>('/api/v1/agent/reissue-proof', {\r\n method: 'POST',\r\n apiKey,\r\n body: paymentTx ? { payment_tx: paymentTx } : {},\r\n });\r\n}\r\n\r\n/** Purchase a SIGIL */\r\nexport async function purchaseSigil(apiKey: string, opts: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n tier: string;\r\n payment_tx: string;\r\n skillRef?: string;\r\n}): Promise<{ data: SigilResult | null; error: string | null }> {\r\n return apiFetch<SigilResult>('/api/v1/sigil', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.name,\r\n principal: opts.principal,\r\n identity_class: opts.identity_class,\r\n tier: opts.tier,\r\n payment_tx: opts.payment_tx,\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Verify another agent's identity (public) */\r\nexport async function verifyAgent(hash: string): Promise<{ data: VerifyAgentResult | null; error: string | null }> {\r\n return apiFetch<VerifyAgentResult>(`/api/v1/verify/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Get agent lineage chain (public) */\r\nexport async function getLineage(hash: string): Promise<{ data: LineageResult | null; error: string | null }> {\r\n return apiFetch<LineageResult>(`/api/v1/agent/lineage/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Spawn a child agent — handles full 3-step flow internally */\r\nexport async function spawnChild(apiKey: string, opts: {\r\n childName: string;\r\n parentHash: string;\r\n}): Promise<{ data: SpawnResult | null; error: string | null }> {\r\n // Step 1: Get spawn authorization\r\n const step1 = await apiFetch<{\r\n spawn_authorization: string;\r\n child_name?: string;\r\n }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_name: opts.childName },\r\n });\r\n\r\n if (step1.error || !step1.data?.spawn_authorization) {\r\n return { data: null, error: step1.error ?? 'Spawn step 1 failed: no authorization returned' };\r\n }\r\n\r\n const spawnAuth = step1.data.spawn_authorization;\r\n\r\n // Step 2: Register the child with the spawn_authorization\r\n const reg = await apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.childName,\r\n wallet: 'none',\r\n spawn_authorization: spawnAuth,\r\n },\r\n });\r\n\r\n if (reg.error || !reg.data?.hash) {\r\n return { data: null, error: reg.error ?? 'Spawn step 2 (child registration) failed' };\r\n }\r\n\r\n const childHash = reg.data.hash;\r\n const childApiKey = reg.data.api_key;\r\n\r\n // Step 3: Finalize the spawn\r\n const step3 = await apiFetch<{ ok: boolean }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_hash: childHash },\r\n });\r\n\r\n if (step3.error) {\r\n return { data: null, error: step3.error };\r\n }\r\n\r\n return {\r\n data: {\r\n child_hash: childHash,\r\n child_api_key: childApiKey,\r\n child_depth: reg.data.depth,\r\n parent_hash: opts.parentHash,\r\n },\r\n error: null,\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,kBAAkB;;;ACA3B,SAAS,cAAc,eAAe,WAAW,WAAW,kBAAkB;AAC9E,SAAS,YAAY;AACrB,SAAS,eAAe;AAGxB,SAAS,eAAuB;AAC9B,SAAO,KAAK,QAAQ,GAAG,aAAa;AACtC;AAEA,SAAS,gBAAwB;AAC/B,SAAO,KAAK,aAAa,GAAG,aAAa;AAC3C;AAGO,SAAS,kBAA4C;AAC1D,QAAM,SAAS,QAAQ,IAAI;AAC3B,QAAM,YAAY,QAAQ,IAAI;AAE9B,MAAI,UAAU,WAAW;AACvB,WAAO,EAAE,SAAS,QAAQ,YAAY,UAAU;AAAA,EAClD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO;AAEpC,MAAI;AACF,UAAM,MAAM,aAAa,YAAY,OAAO;AAC5C,UAAM,SAAS,K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,CAAC;AAAA,IAEhE;AACE,aAAO;AAAA,QACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,iBAAiB,IAAI,GAAG,CAAC;AAAA,QACzD,SAAS;AAAA,MACX;AAAA,EACJ;AACF,CAAC;AAGD,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,CAACC,SAAQ;AACpB,UAAQ,OAAO,MAAM,UAAWA,KAAc,OAAO;AAAA,CAAI;AACzD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["err","data","error","err"]}
package/dist/tools.d.ts CHANGED
@@ -40,15 +40,20 @@ declare const PROVENONCE_TOOLS: readonly [{
40
40
  };
41
41
  readonly identity_class: {
42
42
  readonly type: "string";
43
- readonly enum: readonly ["ind", "org", "sov", "eph", "sbx"];
44
- readonly description: "Identity class: ind=individual, org=organisation, sov=sovereign, eph=ephemeral, sbx=sandbox";
43
+ readonly enum: readonly ["narrow_task", "autonomous", "orchestrator"];
44
+ readonly description: "Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents";
45
+ };
46
+ readonly tier: {
47
+ readonly type: "string";
48
+ readonly enum: readonly ["sov", "org", "ind", "eph", "sbx"];
49
+ readonly description: "Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox";
45
50
  };
46
51
  readonly payment_tx: {
47
52
  readonly type: "string";
48
53
  readonly description: "Solana transaction signature for the SIGIL fee payment";
49
54
  };
50
55
  };
51
- readonly required: readonly ["name", "principal", "identity_class", "payment_tx"];
56
+ readonly required: readonly ["name", "principal", "identity_class", "tier", "payment_tx"];
52
57
  };
53
58
  }, {
54
59
  readonly name: "provenonce_heartbeat";
package/dist/tools.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @provenonce/mcp — Provenonce Skill for AI agents
2
2
  import {
3
3
  PROVENONCE_TOOLS
4
- } from "./chunk-CD2A6ZEQ.js";
4
+ } from "./chunk-COVXPAEW.js";
5
5
  export {
6
6
  PROVENONCE_TOOLS
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provenonce/mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Provenonce Skill — MCP server giving any AI agent cryptographic identity, SIGIL, heartbeat, passport, and beats proofs.",
5
5
  "keywords": ["provenonce", "mcp", "ai-agent", "identity", "provenance", "sigil"],
6
6
  "homepage": "https://provenonce.io",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/tools.ts"],"sourcesContent":["/** Provenonce Skill — 9 MCP tool definitions (JSON Schema) */\r\nexport const PROVENONCE_TOOLS = [\r\n {\r\n name: 'provenonce_register',\r\n description:\r\n 'Register this agent with Provenonce to get a cryptographic identity (hash + API key). ' +\r\n 'Safe to call multiple times — returns existing identity if already registered. ' +\r\n 'No wallet required. Free.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'Human-readable name for this agent (optional, max 64 chars)',\r\n maxLength: 64,\r\n },\r\n skill_ref: {\r\n type: 'string',\r\n description:\r\n '16-character hex ref token of the skill that deployed you — for rev-share attribution (optional)',\r\n pattern: '^[0-9a-f]{16}$',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_status',\r\n description:\r\n 'Get this agent\\'s current Provenonce status: identity, SIGIL, beats balance, and next steps. ' +\r\n 'Requires prior provenonce_register call.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {},\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_purchase_sigil',\r\n description:\r\n 'Purchase a Provenonce SIGIL to unlock full provenance: heartbeat access, signed passport, ' +\r\n 'and a permanent identity record. Requires a Solana payment transaction. ' +\r\n 'SIGIL format: name*principal*tier (e.g. my-agent*acme*ind).',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'SIGIL name segment — identifies this specific agent (e.g. \"my-agent\")',\r\n },\r\n principal: {\r\n type: 'string',\r\n description: 'Principal segment — identifies the operator or organisation (e.g. \"acme\")',\r\n },\r\n identity_class: {\r\n type: 'string',\r\n enum: ['ind', 'org', 'sov', 'eph', 'sbx'],\r\n description:\r\n 'Identity class: ind=individual, org=organisation, sov=sovereign, eph=ephemeral, sbx=sandbox',\r\n },\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the SIGIL fee payment',\r\n },\r\n },\r\n required: ['name', 'principal', 'identity_class', 'payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_heartbeat',\r\n description:\r\n 'Submit a heartbeat to prove this agent is alive. Requires a SIGIL (call provenonce_purchase_sigil first). ' +\r\n 'Requires a Solana payment transaction for the heartbeat fee.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the heartbeat fee payment',\r\n },\r\n },\r\n required: ['payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_passport',\r\n description:\r\n 'Get this agent\\'s cryptographically signed Passport — a verifiable identity document ' +\r\n 'any third party can verify offline using the Provenonce authority public key. ' +\r\n 'Requires an active SIGIL and at least one heartbeat.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the passport reissue fee (if applicable)',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_beats_proof',\r\n description:\r\n 'Compute a local Beats work-proof — cryptographic evidence of computational effort by this agent. ' +\r\n 'Returns a hash chain proof that can be shared as evidence of work. No network call required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n count: {\r\n type: 'integer',\r\n description: 'Number of beats to compute (min 10, max 1000)',\r\n minimum: 10,\r\n maximum: 1000,\r\n },\r\n },\r\n required: ['count'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_verify_agent',\r\n description:\r\n 'Verify another agent\\'s Provenonce identity. Returns their SIGIL, identity class, and registration status. ' +\r\n 'Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description: 'The agent hash to verify (0x + 64 hex chars)',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n required: ['hash'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_spawn',\r\n description:\r\n 'Spawn a child agent under this agent\\'s identity. The child inherits lineage from the parent. ' +\r\n 'Returns the child\\'s hash and API key. Requires sufficient beats balance or a work-proof receipt.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n child_name: {\r\n type: 'string',\r\n description: 'Name for the child agent (max 64 chars)',\r\n maxLength: 64,\r\n },\r\n },\r\n required: ['child_name'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_lineage',\r\n description:\r\n 'Get the full lineage chain for an agent — all events in its provenance history ' +\r\n '(registration, SIGIL issuance, heartbeats, spawns). Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description:\r\n 'The agent hash to get lineage for (0x + 64 hex chars). Defaults to this agent if omitted.',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n },\r\n },\r\n] as const;\r\n\r\nexport type ToolName = (typeof PROVENONCE_TOOLS)[number]['name'];\r\n"],"mappings":";;;AACO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aAAa;AAAA,UACb,WAAW;AAAA,QACb;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aACE;AAAA,UACF,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA;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