@provian/mcp 0.0.0-stage → 1.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +264 -2
- package/bin/provian-mcp.mjs +18 -0
- package/dist/agent-wallet-registration.d.ts +34 -0
- package/dist/agent-wallet-registration.d.ts.map +1 -0
- package/dist/agent-wallet-registration.js +440 -0
- package/dist/agent-wallet-registration.js.map +1 -0
- package/dist/core/challenge.d.ts +187 -0
- package/dist/core/challenge.d.ts.map +1 -0
- package/dist/core/challenge.js +536 -0
- package/dist/core/challenge.js.map +1 -0
- package/dist/core/crypto.d.ts +44 -0
- package/dist/core/crypto.d.ts.map +1 -0
- package/dist/core/crypto.js +124 -0
- package/dist/core/crypto.js.map +1 -0
- package/dist/core/disclosure-request.d.ts +169 -0
- package/dist/core/disclosure-request.d.ts.map +1 -0
- package/dist/core/disclosure-request.js +400 -0
- package/dist/core/disclosure-request.js.map +1 -0
- package/dist/core/genesis-offer.d.ts +25 -0
- package/dist/core/genesis-offer.d.ts.map +1 -0
- package/dist/core/genesis-offer.js +34 -0
- package/dist/core/genesis-offer.js.map +1 -0
- package/dist/core/harness-tool-vocabulary.d.ts +55 -0
- package/dist/core/harness-tool-vocabulary.d.ts.map +1 -0
- package/dist/core/harness-tool-vocabulary.js +116 -0
- package/dist/core/harness-tool-vocabulary.js.map +1 -0
- package/dist/core/keccak256.d.ts +15 -0
- package/dist/core/keccak256.d.ts.map +1 -0
- package/dist/core/keccak256.js +111 -0
- package/dist/core/keccak256.js.map +1 -0
- package/dist/core/key-custody.d.ts +33 -0
- package/dist/core/key-custody.d.ts.map +1 -0
- package/dist/core/key-custody.js +59 -0
- package/dist/core/key-custody.js.map +1 -0
- package/dist/core/meter-hash.d.ts +2 -0
- package/dist/core/meter-hash.d.ts.map +1 -0
- package/dist/core/meter-hash.js +8 -0
- package/dist/core/meter-hash.js.map +1 -0
- package/dist/core/meter-wire.d.ts +193 -0
- package/dist/core/meter-wire.d.ts.map +1 -0
- package/dist/core/meter-wire.js +418 -0
- package/dist/core/meter-wire.js.map +1 -0
- package/dist/core/output-signature.d.ts +162 -0
- package/dist/core/output-signature.d.ts.map +1 -0
- package/dist/core/output-signature.js +367 -0
- package/dist/core/output-signature.js.map +1 -0
- package/dist/core/presentation.d.ts +141 -0
- package/dist/core/presentation.d.ts.map +1 -0
- package/dist/core/presentation.js +160 -0
- package/dist/core/presentation.js.map +1 -0
- package/dist/core/recovery-seal.d.ts +36 -0
- package/dist/core/recovery-seal.d.ts.map +1 -0
- package/dist/core/recovery-seal.js +122 -0
- package/dist/core/recovery-seal.js.map +1 -0
- package/dist/core/server.d.ts +38 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +106 -0
- package/dist/core/server.js.map +1 -0
- package/dist/core/thread-reader.d.ts +8 -0
- package/dist/core/thread-reader.d.ts.map +1 -0
- package/dist/core/thread-reader.js +47 -0
- package/dist/core/thread-reader.js.map +1 -0
- package/dist/core/tool-set.d.ts +28 -0
- package/dist/core/tool-set.d.ts.map +1 -0
- package/dist/core/tool-set.js +71 -0
- package/dist/core/tool-set.js.map +1 -0
- package/dist/core/tools.d.ts +151 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +3621 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/types.d.ts +189 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +17 -0
- package/dist/core/types.js.map +1 -0
- package/dist/credentials.d.ts +46 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +213 -0
- package/dist/credentials.js.map +1 -0
- package/dist/device-credentials.d.ts +57 -0
- package/dist/device-credentials.d.ts.map +1 -0
- package/dist/device-credentials.js +403 -0
- package/dist/device-credentials.js.map +1 -0
- package/dist/eip191.d.ts +18 -0
- package/dist/eip191.d.ts.map +1 -0
- package/dist/eip191.js +41 -0
- package/dist/eip191.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime-env.d.ts +131 -0
- package/dist/runtime-env.d.ts.map +1 -0
- package/dist/runtime-env.js +328 -0
- package/dist/runtime-env.js.map +1 -0
- package/dist/stdio.d.ts +6 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +136 -0
- package/dist/stdio.js.map +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* harness-tool-vocabulary — the ONE list of tool names a self-report may seal
|
|
4
|
+
* verbatim (review 2: a tool NAME must never carry prose).
|
|
5
|
+
*
|
|
6
|
+
* WHY. On the self-report lanes (the loopback witness endpoint and the MCP
|
|
7
|
+
* report tools) the tool name is written by the agent. "Normalize to a token"
|
|
8
|
+
* was not enough: `refactored billing module for Acme Corp` became
|
|
9
|
+
* `refactored_billing_module_for_Acme_Corp` prose with underscores. So a name
|
|
10
|
+
* is sealed verbatim ONLY when it is a real harness tool name — one of the names
|
|
11
|
+
* the transcript extractors recognise from Claude Code, OpenClaw, Codex, Gemini
|
|
12
|
+
* CLI and Grok Build (the harnesses whose records the daemon reads). Any other
|
|
13
|
+
* name is sealed as `h:` + the first 12 hex of sha256(name): the same name
|
|
14
|
+
* always seals the same token (so counts and repeats stay meaningful), and the
|
|
15
|
+
* text never leaves the device.
|
|
16
|
+
*
|
|
17
|
+
* THE REPORTING APP TOO (review 3). A self-report's `source_app` (and the
|
|
18
|
+
* compute block's `framework`, which carries the same value) is agent-written as
|
|
19
|
+
* well: `refactored billing for acme` slugged to `refactored_billing_for_acme`
|
|
20
|
+
* was prose with underscores again. So `source_app` follows the same rule: a
|
|
21
|
+
* name in the app vocabulary below (harnesses, agent platforms, generic runners)
|
|
22
|
+
* is sealed verbatim as its lowercase slug, anything else as `h:` + 12 hex.
|
|
23
|
+
*
|
|
24
|
+
* ONE DEFINITION, CARRIED BYTE-IDENTICAL. This file lives in the SDK
|
|
25
|
+
* (`provian-agent-sdk/src/observer/`), the relay (`provian-backend/src/mcp/core/`,
|
|
26
|
+
* which the relay's self-report reduction and the hosted MCP tools both import)
|
|
27
|
+
* and the stdio MCP package (`provian-mcp/src/core/`). The packages cannot
|
|
28
|
+
* import one another, so `scripts/check-mcp-tool-parity.mjs` byte-compares the
|
|
29
|
+
* three and `harness-tool-vocabulary-parity.test.ts` (backend) pins them.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.HASHED_TOOL_NAME_RE = exports.DEFAULT_SOURCE_APP = exports.HARNESS_APP_NAMES = exports.HARNESS_TOOL_NAMES = void 0;
|
|
33
|
+
exports.sealedToolName = sealedToolName;
|
|
34
|
+
exports.sealedSourceApp = sealedSourceApp;
|
|
35
|
+
const crypto_1 = require("crypto");
|
|
36
|
+
/** Tool names the harness transcript extractors recognise, sealed verbatim. */
|
|
37
|
+
exports.HARNESS_TOOL_NAMES = Object.freeze([
|
|
38
|
+
// Claude Code
|
|
39
|
+
'Read', 'Write', 'Edit', 'MultiEdit', 'NotebookEdit', 'NotebookRead', 'Bash', 'BashOutput',
|
|
40
|
+
'KillShell', 'KillBash', 'Grep', 'Glob', 'LS', 'WebFetch', 'WebSearch', 'Task', 'TodoWrite',
|
|
41
|
+
'TodoRead', 'ExitPlanMode', 'SlashCommand', 'Skill', 'AskUserQuestion',
|
|
42
|
+
// OpenClaw
|
|
43
|
+
'read', 'write', 'edit', 'exec', 'process', 'apply_patch', 'browser', 'web_search', 'web_fetch',
|
|
44
|
+
'image', 'message', 'cron', 'canvas', 'nodes', 'sessions_spawn', 'sessions_send', 'sessions_list',
|
|
45
|
+
'sessions_history', 'memory_search', 'memory_get',
|
|
46
|
+
// Codex
|
|
47
|
+
'shell', 'local_shell', 'exec_command', 'write_stdin', 'update_plan', 'view_image',
|
|
48
|
+
// Gemini CLI
|
|
49
|
+
'read_file', 'write_file', 'replace', 'run_shell_command', 'glob', 'search_file_content',
|
|
50
|
+
'list_directory', 'read_many_files', 'google_web_search', 'save_memory', 'write_todos',
|
|
51
|
+
// Grok Build
|
|
52
|
+
'search_replace', 'list_dir', 'run_terminal_command', 'grep', 'todo_write', 'task',
|
|
53
|
+
// Generic
|
|
54
|
+
'fetch', 'search',
|
|
55
|
+
]);
|
|
56
|
+
const VOCABULARY = new Set(exports.HARNESS_TOOL_NAMES);
|
|
57
|
+
/**
|
|
58
|
+
* Reporting-app names a self-report may seal verbatim as `source_app` /
|
|
59
|
+
* `compute.framework` — lowercase slugs of the agent harnesses the daemon reads,
|
|
60
|
+
* agent platforms, and generic runners. A label, never a sentence.
|
|
61
|
+
*/
|
|
62
|
+
exports.HARNESS_APP_NAMES = Object.freeze([
|
|
63
|
+
'local_process',
|
|
64
|
+
// Agent harnesses whose records the daemon reads or witnesses
|
|
65
|
+
'claude-code', 'claude_code', 'claude', 'openclaw', 'codex', 'gemini', 'gemini-cli', 'gemini_cli',
|
|
66
|
+
'grok', 'grok-build', 'grok_build',
|
|
67
|
+
// Other coding / IDE agents
|
|
68
|
+
'cursor', 'windsurf', 'cline', 'roo', 'aider', 'continue', 'copilot', 'goose', 'amp', 'opencode',
|
|
69
|
+
'zed', 'kiro', 'jules', 'devin', 'hermes',
|
|
70
|
+
// Hosted agent platforms
|
|
71
|
+
'chatgpt', 'openai', 'anthropic', 'perplexity', 'venice', 'manus', 'replit',
|
|
72
|
+
// Generic runners
|
|
73
|
+
'sdk', 'cli', 'mcp', 'ci', 'cron', 'script', 'agent',
|
|
74
|
+
]);
|
|
75
|
+
const APP_VOCABULARY = new Set(exports.HARNESS_APP_NAMES);
|
|
76
|
+
/** The source_app sealed when none is given. */
|
|
77
|
+
exports.DEFAULT_SOURCE_APP = 'local_process';
|
|
78
|
+
/** A name already sealed as a hash token (`h:` + 12 lowercase hex). */
|
|
79
|
+
exports.HASHED_TOOL_NAME_RE = /^h:[0-9a-f]{12}$/;
|
|
80
|
+
/**
|
|
81
|
+
* The name a self-report seals: a harness tool name verbatim, an already-hashed
|
|
82
|
+
* token as-is, anything else `h:` + the first 12 hex of sha256(trimmed name).
|
|
83
|
+
* Null for a non-string or empty name.
|
|
84
|
+
*/
|
|
85
|
+
function sealedToolName(raw) {
|
|
86
|
+
if (typeof raw !== 'string')
|
|
87
|
+
return null;
|
|
88
|
+
const name = raw.trim();
|
|
89
|
+
if (name.length === 0)
|
|
90
|
+
return null;
|
|
91
|
+
if (VOCABULARY.has(name) || exports.HASHED_TOOL_NAME_RE.test(name))
|
|
92
|
+
return name;
|
|
93
|
+
return `h:${(0, crypto_1.createHash)('sha256').update(name, 'utf8').digest('hex').slice(0, 12)}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The `source_app` a self-report seals (and its `compute.framework`): the
|
|
97
|
+
* lowercase slug when it is in the app vocabulary, an already-hashed token
|
|
98
|
+
* as-is, anything else `h:` + the first 12 hex of sha256(the full slug).
|
|
99
|
+
* A non-string or empty value is `local_process`.
|
|
100
|
+
*/
|
|
101
|
+
function sealedSourceApp(raw) {
|
|
102
|
+
if (typeof raw !== 'string')
|
|
103
|
+
return exports.DEFAULT_SOURCE_APP;
|
|
104
|
+
const trimmed = raw.trim();
|
|
105
|
+
if (trimmed.length === 0)
|
|
106
|
+
return exports.DEFAULT_SOURCE_APP;
|
|
107
|
+
if (exports.HASHED_TOOL_NAME_RE.test(trimmed))
|
|
108
|
+
return trimmed;
|
|
109
|
+
const slug = trimmed.toLowerCase().replace(/[^a-z0-9._-]+/g, '_').replace(/^_+|_+$/g, '');
|
|
110
|
+
if (slug.length === 0)
|
|
111
|
+
return exports.DEFAULT_SOURCE_APP;
|
|
112
|
+
if (APP_VOCABULARY.has(slug))
|
|
113
|
+
return slug;
|
|
114
|
+
return `h:${(0, crypto_1.createHash)('sha256').update(slug, 'utf8').digest('hex').slice(0, 12)}`;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=harness-tool-vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-tool-vocabulary.js","sourceRoot":"","sources":["../../src/core/harness-tool-vocabulary.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AA2DH,wCAMC;AAQD,0CASC;AAhFD,mCAAoC;AAEpC,+EAA+E;AAClE,QAAA,kBAAkB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjE,cAAc;IACd,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY;IAC1F,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW;IAC3F,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB;IACtE,WAAW;IACX,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW;IAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe;IACjG,kBAAkB,EAAE,eAAe,EAAE,YAAY;IACjD,QAAQ;IACR,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY;IAClF,aAAa;IACb,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,qBAAqB;IACxF,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa;IACtF,aAAa;IACb,gBAAgB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAClF,UAAU;IACV,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAC;AAEH,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OAAO,KAAK,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,GAAY;IAC1C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,0BAAkB,CAAC;IACvD,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,0BAAkB,CAAC;IACpD,IAAI,2BAAmB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACtD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,0BAAkB,CAAC;IACjD,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,KAAK,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal keccak256 (SHA-3) implementation for EVM address derivation.
|
|
3
|
+
*
|
|
4
|
+
* Self-contained - no npm dependencies. Implements the Keccak-f[1600]
|
|
5
|
+
* permutation with rate=1088, capacity=512 (keccak256).
|
|
6
|
+
*
|
|
7
|
+
* Used exclusively by the SDK wallet module to derive EVM addresses
|
|
8
|
+
* from secp256k1 public keys.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Compute keccak256 hash of a Buffer.
|
|
12
|
+
* Returns a 32-byte Buffer.
|
|
13
|
+
*/
|
|
14
|
+
export declare function keccak256(input: Buffer): Buffer;
|
|
15
|
+
//# sourceMappingURL=keccak256.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keccak256.d.ts","sourceRoot":"","sources":["../../src/core/keccak256.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAuEH;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiC/C"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Keccak256 implementation. Clean-room from FIPS 202 spec.
|
|
3
|
+
// Constants RC, ROTC, PI are FIPS 202 mathematical values
|
|
4
|
+
// (public domain). No upstream library code derived.
|
|
5
|
+
// No attribution required.
|
|
6
|
+
/**
|
|
7
|
+
* Minimal keccak256 (SHA-3) implementation for EVM address derivation.
|
|
8
|
+
*
|
|
9
|
+
* Self-contained - no npm dependencies. Implements the Keccak-f[1600]
|
|
10
|
+
* permutation with rate=1088, capacity=512 (keccak256).
|
|
11
|
+
*
|
|
12
|
+
* Used exclusively by the SDK wallet module to derive EVM addresses
|
|
13
|
+
* from secp256k1 public keys.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.keccak256 = keccak256;
|
|
17
|
+
/* Keccak-f[1600] round constants */
|
|
18
|
+
const RC = [
|
|
19
|
+
0x0000000000000001n, 0x0000000000008082n, 0x800000000000808an, 0x8000000080008000n,
|
|
20
|
+
0x000000000000808bn, 0x0000000080000001n, 0x8000000080008081n, 0x8000000000008009n,
|
|
21
|
+
0x000000000000008an, 0x0000000000000088n, 0x0000000080008009n, 0x000000008000000an,
|
|
22
|
+
0x000000008000808bn, 0x800000000000008bn, 0x8000000000008089n, 0x8000000000008003n,
|
|
23
|
+
0x8000000000008002n, 0x8000000000000080n, 0x000000000000800an, 0x800000008000000an,
|
|
24
|
+
0x8000000080008081n, 0x8000000000008080n, 0x0000000080000001n, 0x8000000080008008n,
|
|
25
|
+
];
|
|
26
|
+
/* Rotation offsets */
|
|
27
|
+
const ROTC = [
|
|
28
|
+
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44,
|
|
29
|
+
];
|
|
30
|
+
/* Pi lane indices */
|
|
31
|
+
const PI = [
|
|
32
|
+
10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1,
|
|
33
|
+
];
|
|
34
|
+
const MASK64 = (1n << 64n) - 1n;
|
|
35
|
+
function rotl64(x, n) {
|
|
36
|
+
return ((x << BigInt(n)) | (x >> BigInt(64 - n))) & MASK64;
|
|
37
|
+
}
|
|
38
|
+
/** Keccak-f[1600] permutation on a 25-element state array of 64-bit lanes */
|
|
39
|
+
function keccakF(state) {
|
|
40
|
+
for (let round = 0; round < 24; round++) {
|
|
41
|
+
// θ step
|
|
42
|
+
const C = new Array(5);
|
|
43
|
+
for (let x = 0; x < 5; x++) {
|
|
44
|
+
C[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
|
|
45
|
+
}
|
|
46
|
+
for (let x = 0; x < 5; x++) {
|
|
47
|
+
const D = C[(x + 4) % 5] ^ rotl64(C[(x + 1) % 5], 1);
|
|
48
|
+
for (let y = 0; y < 25; y += 5) {
|
|
49
|
+
state[x + y] = (state[x + y] ^ D) & MASK64;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// ρ and π steps
|
|
53
|
+
let last = state[1];
|
|
54
|
+
for (let i = 0; i < 24; i++) {
|
|
55
|
+
const j = PI[i];
|
|
56
|
+
const temp = state[j];
|
|
57
|
+
state[j] = rotl64(last, ROTC[i]);
|
|
58
|
+
last = temp;
|
|
59
|
+
}
|
|
60
|
+
// χ step
|
|
61
|
+
for (let y = 0; y < 25; y += 5) {
|
|
62
|
+
const t0 = state[y];
|
|
63
|
+
const t1 = state[y + 1];
|
|
64
|
+
const t2 = state[y + 2];
|
|
65
|
+
const t3 = state[y + 3];
|
|
66
|
+
const t4 = state[y + 4];
|
|
67
|
+
state[y] = (t0 ^ (~t1 & t2)) & MASK64;
|
|
68
|
+
state[y + 1] = (t1 ^ (~t2 & t3)) & MASK64;
|
|
69
|
+
state[y + 2] = (t2 ^ (~t3 & t4)) & MASK64;
|
|
70
|
+
state[y + 3] = (t3 ^ (~t4 & t0)) & MASK64;
|
|
71
|
+
state[y + 4] = (t4 ^ (~t0 & t1)) & MASK64;
|
|
72
|
+
}
|
|
73
|
+
// ι step
|
|
74
|
+
state[0] = (state[0] ^ RC[round]) & MASK64;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Compute keccak256 hash of a Buffer.
|
|
79
|
+
* Returns a 32-byte Buffer.
|
|
80
|
+
*/
|
|
81
|
+
function keccak256(input) {
|
|
82
|
+
const rate = 136; // 1088 bits / 8 = 136 bytes (keccak256 rate)
|
|
83
|
+
const state = new Array(25).fill(0n);
|
|
84
|
+
// Absorb phase with padding (keccak uses 0x01 suffix, NOT SHA-3's 0x06)
|
|
85
|
+
const padded = Buffer.alloc(Math.ceil((input.length + 1) / rate) * rate);
|
|
86
|
+
input.copy(padded);
|
|
87
|
+
padded[input.length] = 0x01;
|
|
88
|
+
padded[padded.length - 1] |= 0x80;
|
|
89
|
+
for (let offset = 0; offset < padded.length; offset += rate) {
|
|
90
|
+
// XOR block into state (little-endian 64-bit lanes)
|
|
91
|
+
for (let i = 0; i < rate && i + 7 < rate; i += 8) {
|
|
92
|
+
const laneIdx = i / 8;
|
|
93
|
+
let lane = 0n;
|
|
94
|
+
for (let b = 0; b < 8; b++) {
|
|
95
|
+
lane |= BigInt(padded[offset + i + b]) << BigInt(b * 8);
|
|
96
|
+
}
|
|
97
|
+
state[laneIdx] ^= lane;
|
|
98
|
+
}
|
|
99
|
+
keccakF(state);
|
|
100
|
+
}
|
|
101
|
+
// Squeeze phase - extract 32 bytes (256 bits)
|
|
102
|
+
const output = Buffer.alloc(32);
|
|
103
|
+
for (let i = 0; i < 4; i++) {
|
|
104
|
+
const lane = state[i];
|
|
105
|
+
for (let b = 0; b < 8; b++) {
|
|
106
|
+
output[i * 8 + b] = Number((lane >> BigInt(b * 8)) & 0xffn);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return output;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=keccak256.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keccak256.js","sourceRoot":"","sources":["../../src/core/keccak256.ts"],"names":[],"mappings":";AAAA,2DAA2D;AAC3D,0DAA0D;AAC1D,qDAAqD;AACrD,2BAA2B;AAC3B;;;;;;;;GAQG;;AA2EH,8BAiCC;AA1GD,oCAAoC;AACpC,MAAM,EAAE,GAAa;IACnB,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;IAClF,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;IAClF,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;IAClF,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;IAClF,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;IAClF,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB;CACnF,CAAC;AAEF,sBAAsB;AACtB,MAAM,IAAI,GAAG;IACX,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EA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AI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key custody guard for the MCP tool core.
|
|
3
|
+
*
|
|
4
|
+
* SHARED CORE — canonical in `provian-mcp/src/core/`, mirrored into
|
|
5
|
+
* `provian-backend/src/mcp/core/`. Edit only the canonical copy and run
|
|
6
|
+
* `scripts/sync-mcp-core.sh`.
|
|
7
|
+
*
|
|
8
|
+
* A hosted agent that cannot run the install line creates its own wallet through the
|
|
9
|
+
* remote endpoint: it generates the key inside its own runtime, keeps it there,
|
|
10
|
+
* and sends only the public key and a signature. The private key never crosses
|
|
11
|
+
* the wire. Two guards hold that line:
|
|
12
|
+
* - a SCHEMA guard: no remote-capable tool declares an input that names private
|
|
13
|
+
* key material (`findPrivateKeyFields`), asserted over the whole registry by
|
|
14
|
+
* the tool-set tests, with the one historical local-only field named;
|
|
15
|
+
* - an ARGUMENT guard: a call that carries such a field anyway (an agent that
|
|
16
|
+
* guessed a parameter name) is refused before anything is forwarded
|
|
17
|
+
* (`privateKeyArgumentNames`).
|
|
18
|
+
* Self-contained (no imports) so both guards and their tests bind to ONE pattern.
|
|
19
|
+
*/
|
|
20
|
+
/** An input name that denotes private key material. `device_secret`/`api_secret` are credentials, not keys. */
|
|
21
|
+
export declare const PRIVATE_KEY_FIELD_PATTERN: RegExp;
|
|
22
|
+
/** JSON-Schema property names, at any depth, that name private key material. */
|
|
23
|
+
export declare function findPrivateKeyFields(schema: unknown, prefix?: string): string[];
|
|
24
|
+
/** Top-level argument names in a tool call that name private key material. */
|
|
25
|
+
export declare function privateKeyArgumentNames(args: Record<string, unknown>): string[];
|
|
26
|
+
/**
|
|
27
|
+
* The one pre-existing input that names key material: link_external_address's
|
|
28
|
+
* `external_private_key`, which only the LOCAL stdio server ever uses (the remote
|
|
29
|
+
* endpoint refuses it before any network call). Named here so the registry-wide
|
|
30
|
+
* schema guard is exact rather than skipping a tool.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LOCAL_ONLY_PRIVATE_KEY_FIELDS: Readonly<Record<string, readonly string[]>>;
|
|
33
|
+
//# sourceMappingURL=key-custody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-custody.d.ts","sourceRoot":"","sources":["../../src/core/key-custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,+GAA+G;AAC/G,eAAO,MAAM,yBAAyB,QAA6G,CAAC;AAEpJ,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAc3E;AAED,8EAA8E;AAC9E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAE/E;AAED;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAErF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Key custody guard for the MCP tool core.
|
|
4
|
+
*
|
|
5
|
+
* SHARED CORE — canonical in `provian-mcp/src/core/`, mirrored into
|
|
6
|
+
* `provian-backend/src/mcp/core/`. Edit only the canonical copy and run
|
|
7
|
+
* `scripts/sync-mcp-core.sh`.
|
|
8
|
+
*
|
|
9
|
+
* A hosted agent that cannot run the install line creates its own wallet through the
|
|
10
|
+
* remote endpoint: it generates the key inside its own runtime, keeps it there,
|
|
11
|
+
* and sends only the public key and a signature. The private key never crosses
|
|
12
|
+
* the wire. Two guards hold that line:
|
|
13
|
+
* - a SCHEMA guard: no remote-capable tool declares an input that names private
|
|
14
|
+
* key material (`findPrivateKeyFields`), asserted over the whole registry by
|
|
15
|
+
* the tool-set tests, with the one historical local-only field named;
|
|
16
|
+
* - an ARGUMENT guard: a call that carries such a field anyway (an agent that
|
|
17
|
+
* guessed a parameter name) is refused before anything is forwarded
|
|
18
|
+
* (`privateKeyArgumentNames`).
|
|
19
|
+
* Self-contained (no imports) so both guards and their tests bind to ONE pattern.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.LOCAL_ONLY_PRIVATE_KEY_FIELDS = exports.PRIVATE_KEY_FIELD_PATTERN = void 0;
|
|
23
|
+
exports.findPrivateKeyFields = findPrivateKeyFields;
|
|
24
|
+
exports.privateKeyArgumentNames = privateKeyArgumentNames;
|
|
25
|
+
/** An input name that denotes private key material. `device_secret`/`api_secret` are credentials, not keys. */
|
|
26
|
+
exports.PRIVATE_KEY_FIELD_PATTERN = /(^|_|-)(priv(ate)?[_-]?key|privkey|secret[_-]?key|signing[_-]?key|mnemonic|seed[_-]?phrase|seed)($|_|-)/i;
|
|
27
|
+
/** JSON-Schema property names, at any depth, that name private key material. */
|
|
28
|
+
function findPrivateKeyFields(schema, prefix = '') {
|
|
29
|
+
const found = [];
|
|
30
|
+
if (!schema || typeof schema !== 'object')
|
|
31
|
+
return found;
|
|
32
|
+
const node = schema;
|
|
33
|
+
const properties = node.properties;
|
|
34
|
+
if (properties && typeof properties === 'object') {
|
|
35
|
+
for (const [name, child] of Object.entries(properties)) {
|
|
36
|
+
const path = prefix ? `${prefix}.${name}` : name;
|
|
37
|
+
if (exports.PRIVATE_KEY_FIELD_PATTERN.test(name))
|
|
38
|
+
found.push(path);
|
|
39
|
+
found.push(...findPrivateKeyFields(child, path));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (node.items)
|
|
43
|
+
found.push(...findPrivateKeyFields(node.items, `${prefix}[]`));
|
|
44
|
+
return found;
|
|
45
|
+
}
|
|
46
|
+
/** Top-level argument names in a tool call that name private key material. */
|
|
47
|
+
function privateKeyArgumentNames(args) {
|
|
48
|
+
return Object.keys(args).filter((name) => exports.PRIVATE_KEY_FIELD_PATTERN.test(name));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The one pre-existing input that names key material: link_external_address's
|
|
52
|
+
* `external_private_key`, which only the LOCAL stdio server ever uses (the remote
|
|
53
|
+
* endpoint refuses it before any network call). Named here so the registry-wide
|
|
54
|
+
* schema guard is exact rather than skipping a tool.
|
|
55
|
+
*/
|
|
56
|
+
exports.LOCAL_ONLY_PRIVATE_KEY_FIELDS = {
|
|
57
|
+
link_external_address: ['external_private_key'],
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=key-custody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-custody.js","sourceRoot":"","sources":["../../src/core/key-custody.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAMH,oDAcC;AAGD,0DAEC;AAvBD,+GAA+G;AAClG,QAAA,yBAAyB,GAAG,0GAA0G,CAAC;AAEpJ,gFAAgF;AAChF,SAAgB,oBAAoB,CAAC,MAAe,EAAE,MAAM,GAAG,EAAE;IAC/D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,IAAI,GAAG,MAAiC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACjD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAqC,CAAC,EAAE,CAAC;YAClF,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjD,IAAI,iCAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3D,KAAK,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,IAAI,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,8EAA8E;AAC9E,SAAgB,uBAAuB,CAAC,IAA6B;IACnE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iCAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAClF,CAAC;AAED;;;;;GAKG;AACU,QAAA,6BAA6B,GAAgD;IACxF,qBAAqB,EAAE,CAAC,sBAAsB,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter-hash.d.ts","sourceRoot":"","sources":["../../src/core/meter-hash.ts"],"names":[],"mappings":"AACA,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAExD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sha256Bytes = sha256Bytes;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
function sha256Bytes(data) {
|
|
6
|
+
return new Uint8Array((0, node_crypto_1.createHash)('sha256').update(data).digest());
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=meter-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter-hash.js","sourceRoot":"","sources":["../../src/core/meter-hash.ts"],"names":[],"mappings":";;AACA,kCAEC;AAHD,6CAAyC;AACzC,SAAgB,WAAW,CAAC,IAAgB;IAC1C,OAAO,IAAI,UAAU,CAAC,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PE METER WIRE FORMAT — the ONE definition of a v2 Provenance Envelope, its act record,
|
|
3
|
+
* the daily batch, and the fingerprints over them (: the relay is a
|
|
4
|
+
* meter, not an archive).
|
|
5
|
+
*
|
|
6
|
+
* THIS FILE IS BYTE-IDENTICAL IN THREE PACKAGES and a parity check refuses any drift:
|
|
7
|
+
* provian-backend/src/core/meter/meter-wire.ts (the relay)
|
|
8
|
+
* provian-agent-sdk/src/meter-wire.ts (daemon + SDK)
|
|
9
|
+
* src/core/meter/meter-wire.ts (the app)
|
|
10
|
+
* The only per-package file is `./meter-hash` (a sha256 over bytes), because the three
|
|
11
|
+
* packages carry different hash libraries. Everything that decides a byte lives here.
|
|
12
|
+
*
|
|
13
|
+
* WHAT EACH THING IS
|
|
14
|
+
* PE (v2) — the complete envelope. Built, hashed and kept by its OWNER's device. The
|
|
15
|
+
* relay never stores it.
|
|
16
|
+
* act record — what the relay prices: the PE's identity fields, its pe_hash (which covers
|
|
17
|
+
* the complete PE), and `pricing` = the PE minus identity fields and free text.
|
|
18
|
+
* batch — one signed, chained submission per device per day (and right before a
|
|
19
|
+
* presentation or payout); `acts_root` is the
|
|
20
|
+
* fingerprint over every act leaf.
|
|
21
|
+
* batch leaf — what the daily on-chain anchor commits to (one per accepted batch).
|
|
22
|
+
*
|
|
23
|
+
* Proving one act later: act leaf → acts_root (Merkle path) → batch leaf → the day's on-chain
|
|
24
|
+
* root (PEAnchor.verifyPE). Anyone holding the PE recomputes every step; nobody else needs it.
|
|
25
|
+
*
|
|
26
|
+
* Pure: no I/O, no clock, no randomness.
|
|
27
|
+
*/
|
|
28
|
+
export declare const PE_V2_SCHEMA = "provian.pe.v2";
|
|
29
|
+
export declare const PE_BATCH_SCHEMA = "provian.pe-batch.v1";
|
|
30
|
+
export declare const METER_GENESIS_PREV_HASH = "genesis";
|
|
31
|
+
export declare const MAX_ACTS_PER_BATCH = 500;
|
|
32
|
+
/** An act older than this when it reaches the relay is recorded into totals but does not mint. */
|
|
33
|
+
export declare const METER_MINT_WINDOW_MS: number;
|
|
34
|
+
/** Fields of a PE that are identity or free text, never pricing inputs. */
|
|
35
|
+
export declare const NON_PRICING_PE_FIELDS: readonly string[];
|
|
36
|
+
export interface PeV2 {
|
|
37
|
+
readonly schema: string;
|
|
38
|
+
readonly pe_id: string;
|
|
39
|
+
readonly device_id: string;
|
|
40
|
+
readonly prev_hash: string;
|
|
41
|
+
readonly timestamp: number;
|
|
42
|
+
readonly action_type: string;
|
|
43
|
+
readonly pe_hash?: string;
|
|
44
|
+
readonly signature?: string;
|
|
45
|
+
readonly description?: string;
|
|
46
|
+
readonly [field: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface ActRecord {
|
|
49
|
+
readonly pe_id: string;
|
|
50
|
+
readonly pe_hash: string;
|
|
51
|
+
readonly prev_hash: string;
|
|
52
|
+
readonly timestamp: number;
|
|
53
|
+
readonly action_type: string;
|
|
54
|
+
readonly pricing: Readonly<Record<string, unknown>>;
|
|
55
|
+
}
|
|
56
|
+
/** A PE sealed to a recipient (the linked human, or the owner for relay-authored acts). */
|
|
57
|
+
export interface SealedCopy {
|
|
58
|
+
/** Recipient role, resolved by the relay: `linked_human` (an agent's linked human) or `owner` (a human device's own owner). */
|
|
59
|
+
readonly to: string;
|
|
60
|
+
readonly pe_id: string;
|
|
61
|
+
/** base64url sealed box (x25519, see the agent-key-recovery sealed-box format). */
|
|
62
|
+
readonly box: string;
|
|
63
|
+
}
|
|
64
|
+
export interface PeBatch {
|
|
65
|
+
readonly schema: string;
|
|
66
|
+
readonly device_id: string;
|
|
67
|
+
readonly seq: number;
|
|
68
|
+
readonly prev_batch_hash: string;
|
|
69
|
+
readonly created_at_ms: number;
|
|
70
|
+
readonly acts: readonly ActRecord[];
|
|
71
|
+
readonly acts_root: string;
|
|
72
|
+
readonly sealed?: readonly SealedCopy[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Canonical JSON: object keys sorted by UTF-16 code unit, no whitespace, `undefined` object
|
|
76
|
+
* members dropped, `undefined` array members written as null, non-finite numbers refused.
|
|
77
|
+
* Identical to the hardware-witness canonicalizer and to json-stable-stringify on plain JSON.
|
|
78
|
+
*/
|
|
79
|
+
export declare function canonicalJson(value: unknown): string;
|
|
80
|
+
export declare function bytesToHexLower(bytes: Uint8Array): string;
|
|
81
|
+
export declare function hexToBytesStrict(hex: string): Uint8Array;
|
|
82
|
+
export declare function utf8Bytes(text: string): Uint8Array;
|
|
83
|
+
export declare function sha256HexOfText(text: string): string;
|
|
84
|
+
/** sha256 hex over the complete PE minus its own hash and signature. */
|
|
85
|
+
export declare function peHashOf(pe: PeV2): string;
|
|
86
|
+
/** The pricing projection: everything in the PE except identity fields and free text. */
|
|
87
|
+
export declare function pricingOf(pe: PeV2): Record<string, unknown>;
|
|
88
|
+
/** The act record the relay prices. `pe_hash` covers the complete PE, free text included. */
|
|
89
|
+
export declare function actRecordOf(pe: PeV2): ActRecord;
|
|
90
|
+
/**
|
|
91
|
+
* True when `act` is exactly the act record of `pe` (same hash AND same pricing inputs).
|
|
92
|
+
* This is the byte-for-byte check a verifier runs on a presented PE.
|
|
93
|
+
*/
|
|
94
|
+
export declare function actMatchesPe(act: ActRecord, pe: PeV2): boolean;
|
|
95
|
+
/** The act's leaf in its batch's `acts_root`. */
|
|
96
|
+
export declare function actLeafOf(act: ActRecord): string;
|
|
97
|
+
/**
|
|
98
|
+
* The hardware-witness binding nonce for a v2 act: sha256 over the act's identity (`pe_id`,
|
|
99
|
+
* `prev_hash`, `timestamp`, `action_type`) and every pricing input except the witness slot itself.
|
|
100
|
+
* `pe_hash` is left out because it covers the whole PE, witness included — a nonce over it would
|
|
101
|
+
* ask the witness to sign its own signature. The witness therefore attests exactly what the relay
|
|
102
|
+
* prices, bound to one position in one device's chain.
|
|
103
|
+
*/
|
|
104
|
+
export declare function hardwareNonceOfAct(act: ActRecord): string;
|
|
105
|
+
export declare function merkleRootOf(leafHexes: readonly string[]): string;
|
|
106
|
+
export declare function merkleProofOf(leafHexes: readonly string[], index: number): string[];
|
|
107
|
+
/**
|
|
108
|
+
* One build of the tree, then its root and any leaf's proof — byte-identical to merkleRootOf /
|
|
109
|
+
* merkleProofOf. Proving many leaves of one tree with merkleProofOf rebuilds it per leaf, which on
|
|
110
|
+
* a phone (interpreted SHA-256) made proving a few thousand acts take minutes.
|
|
111
|
+
*/
|
|
112
|
+
export declare function merkleTreeOf(leafHexes: readonly string[]): {
|
|
113
|
+
readonly root: string;
|
|
114
|
+
proofOf(index: number): string[];
|
|
115
|
+
};
|
|
116
|
+
export declare function verifyMerkleProofOf(leafHex: string, proof: readonly string[], rootHex: string): boolean;
|
|
117
|
+
/** The fingerprint over a batch's acts, in order. */
|
|
118
|
+
export declare function actsRootOf(acts: readonly ActRecord[]): string;
|
|
119
|
+
/** sha256 over the batch minus its sealed copies (delivery payload, not part of the record). */
|
|
120
|
+
export declare function batchHashOf(batch: PeBatch): string;
|
|
121
|
+
/** The 32-byte leaf the daily on-chain anchor commits to for one accepted batch. */
|
|
122
|
+
export declare function batchLeafOf(input: {
|
|
123
|
+
readonly device_id: string;
|
|
124
|
+
readonly actor_id: string;
|
|
125
|
+
readonly seq: number;
|
|
126
|
+
readonly batch_hash: string;
|
|
127
|
+
readonly acts_root: string;
|
|
128
|
+
}): string;
|
|
129
|
+
/** Build a batch from complete PEs (client side). */
|
|
130
|
+
export declare function buildBatch(input: {
|
|
131
|
+
readonly device_id: string;
|
|
132
|
+
readonly seq: number;
|
|
133
|
+
readonly prev_batch_hash: string;
|
|
134
|
+
readonly created_at_ms: number;
|
|
135
|
+
readonly pes: readonly PeV2[];
|
|
136
|
+
readonly sealed?: readonly SealedCopy[];
|
|
137
|
+
}): PeBatch;
|
|
138
|
+
export type BatchShapeError = 'bad_schema' | 'bad_device_id' | 'bad_seq' | 'bad_prev_batch_hash' | 'bad_created_at' | 'no_acts' | 'too_many_acts' | 'bad_act' | 'duplicate_pe_id' | 'acts_root_mismatch' | 'bad_sealed';
|
|
139
|
+
/** Structural validation (relay side). Never trusts `acts_root`: recomputes it. */
|
|
140
|
+
export declare function validateBatchShape(batch: unknown): {
|
|
141
|
+
ok: true;
|
|
142
|
+
batch: PeBatch;
|
|
143
|
+
} | {
|
|
144
|
+
ok: false;
|
|
145
|
+
error: BatchShapeError;
|
|
146
|
+
index?: number;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* The device's PE chain must continue across batches: the first act links to the last act the
|
|
150
|
+
* relay accepted from this device, and every later act links to its predecessor. A PE can
|
|
151
|
+
* therefore appear in exactly one accepted batch.
|
|
152
|
+
*/
|
|
153
|
+
export declare function verifyActChain(lastAcceptedPeHash: string, acts: readonly ActRecord[]): {
|
|
154
|
+
ok: true;
|
|
155
|
+
} | {
|
|
156
|
+
ok: false;
|
|
157
|
+
index: number;
|
|
158
|
+
};
|
|
159
|
+
/** Everything a holder needs to prove one act against the chain, without the relay. */
|
|
160
|
+
export interface ActInclusionProof {
|
|
161
|
+
readonly act_index: number;
|
|
162
|
+
readonly act_proof: readonly string[];
|
|
163
|
+
readonly acts_root: string;
|
|
164
|
+
readonly batch: {
|
|
165
|
+
readonly device_id: string;
|
|
166
|
+
readonly actor_id: string;
|
|
167
|
+
readonly seq: number;
|
|
168
|
+
readonly batch_hash: string;
|
|
169
|
+
};
|
|
170
|
+
/** Filled once the day is anchored. */
|
|
171
|
+
readonly anchor?: {
|
|
172
|
+
readonly chain_id: number;
|
|
173
|
+
readonly contract: string;
|
|
174
|
+
readonly anchor_batch_id: string;
|
|
175
|
+
readonly day: string;
|
|
176
|
+
/** 2026-10-10: the intra-day anchor segment (`<day>:<n>`) the batch was anchored in; absent for the day's close anchor. */
|
|
177
|
+
readonly segment?: number;
|
|
178
|
+
readonly leaf_index: number;
|
|
179
|
+
/** keccak sibling path of the batch leaf to the anchored root. */
|
|
180
|
+
readonly proof: readonly string[];
|
|
181
|
+
readonly merkle_root: string;
|
|
182
|
+
readonly tx_hash: string | null;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/** Check an act (from a presented PE) against its inclusion proof, up to the batch leaf. */
|
|
186
|
+
export declare function verifyActInclusion(pe: PeV2, proof: ActInclusionProof): {
|
|
187
|
+
ok: true;
|
|
188
|
+
batch_leaf: string;
|
|
189
|
+
} | {
|
|
190
|
+
ok: false;
|
|
191
|
+
reason: string;
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=meter-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter-wire.d.ts","sourceRoot":"","sources":["../../src/core/meter-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,eAAe,wBAAwB,CAAC;AACrD,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAK7D,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAclD,CAAC;AAKF,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC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