@crustdev/armordesk 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/bin/cli.js +6 -0
- package/dist/chunk-TVWUJ3XJ.mjs +297 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +607 -0
- package/dist/cli.mjs +300 -0
- package/dist/client.d.ts +81 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/crypto.d.ts +31 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +331 -0
- package/dist/index.mjs +22 -0
- package/dist/mcp.d.ts +21 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/types.d.ts +237 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +54 -4
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ArmorDeskClient,
|
|
3
|
+
generateClaudeDesktopConfig,
|
|
4
|
+
generateCursorConfig
|
|
5
|
+
} from "./chunk-TVWUJ3XJ.mjs";
|
|
6
|
+
|
|
7
|
+
// src/cli.ts
|
|
8
|
+
var HELP_TEXT = `
|
|
9
|
+
\u{1F6E1}\uFE0F ArmorDesk CLI: Enterprise AI Agent Control Plane & MCP Gateway
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
armordesk <command> [options]
|
|
13
|
+
|
|
14
|
+
Commands:
|
|
15
|
+
status Check operational status of ArmorDesk Control Plane
|
|
16
|
+
tenants List active corporate tenants & spend policies
|
|
17
|
+
traces Inspect recent audited security & policy traces
|
|
18
|
+
approvals View pending human-in-the-loop approvals
|
|
19
|
+
approve <delegation_id> Authorize an action held in escrow
|
|
20
|
+
reject <delegation_id> Reject an action held in escrow
|
|
21
|
+
receipts List digital execution receipts with proofs
|
|
22
|
+
verify <receipt_id> Cryptographically verify a receipt (Plan Hash & Merkle Root)
|
|
23
|
+
mcp [claude|cursor] Show MCP Gateway config for Claude Desktop or Cursor
|
|
24
|
+
scenario <1-5> Run an adversarial FinOps crew simulation
|
|
25
|
+
ctf "<prompt>" Test prompt injection attack against CTF Gauntlet
|
|
26
|
+
voice [executive|security] Generate voice briefing telemetry via ElevenLabs
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--url <url> ArmorDesk Control Plane URL (default: https://armordesk.crusts.dev)
|
|
30
|
+
--tenant <id> Tenant ID (default: acme-corp)
|
|
31
|
+
--key <key> ArmorIQ API Key
|
|
32
|
+
--json Output raw JSON
|
|
33
|
+
--help, -h Show help menu
|
|
34
|
+
--version, -v Show version
|
|
35
|
+
`;
|
|
36
|
+
async function runCLI(args = process.argv.slice(2)) {
|
|
37
|
+
const flags = {};
|
|
38
|
+
const positional = [];
|
|
39
|
+
for (let i = 0; i < args.length; i++) {
|
|
40
|
+
const arg = args[i];
|
|
41
|
+
if (arg === "--help" || arg === "-h") {
|
|
42
|
+
console.log(HELP_TEXT);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (arg === "--version" || arg === "-v") {
|
|
46
|
+
console.log("armordesk v1.0.0");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (arg.startsWith("--")) {
|
|
50
|
+
const key = arg.slice(2);
|
|
51
|
+
if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
|
|
52
|
+
flags[key] = args[i + 1];
|
|
53
|
+
i++;
|
|
54
|
+
} else {
|
|
55
|
+
flags[key] = true;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
positional.push(arg);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const command = positional[0] || "status";
|
|
62
|
+
const client = new ArmorDeskClient({
|
|
63
|
+
baseUrl: flags["url"] || process.env.ARMORDESK_URL,
|
|
64
|
+
tenantId: flags["tenant"] || "acme-corp",
|
|
65
|
+
apiKey: flags["key"] || process.env.ARMORIQ_API_KEY
|
|
66
|
+
});
|
|
67
|
+
try {
|
|
68
|
+
switch (command) {
|
|
69
|
+
case "status":
|
|
70
|
+
case "info": {
|
|
71
|
+
const st = await client.status();
|
|
72
|
+
if (flags["json"]) {
|
|
73
|
+
console.log(JSON.stringify(st, null, 2));
|
|
74
|
+
} else {
|
|
75
|
+
console.log("\n\u{1F6E1}\uFE0F ArmorDesk Control Plane Status");
|
|
76
|
+
console.log("---------------------------------------");
|
|
77
|
+
console.log(`Endpoint: ${client.baseUrl}`);
|
|
78
|
+
console.log(`Status: ${st.status}`);
|
|
79
|
+
console.log(`Service: ${st.service} (v${st.version})`);
|
|
80
|
+
console.log(`ArmorIQ Pro: ${st.armoriq_pro_active ? "ACTIVE (PRO_LIVE)" : "SANDBOX"}`);
|
|
81
|
+
console.log(`Tenants: ${st.active_tenants} active organizations`);
|
|
82
|
+
console.log(`Timestamp: ${st.timestamp}
|
|
83
|
+
`);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case "tenants": {
|
|
88
|
+
const tenants = await client.getTenants();
|
|
89
|
+
if (flags["json"]) {
|
|
90
|
+
console.log(JSON.stringify(tenants, null, 2));
|
|
91
|
+
} else {
|
|
92
|
+
console.log("\n\u{1F3E2} Active Corporate Tenants:");
|
|
93
|
+
tenants.forEach((t) => {
|
|
94
|
+
console.log(` \u2022 [${t.id}] ${t.name}`);
|
|
95
|
+
console.log(` Balance: $${t.balance.toLocaleString()} | Spend Limit: $${t.spend_limit.toLocaleString()}`);
|
|
96
|
+
});
|
|
97
|
+
console.log("");
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "traces": {
|
|
102
|
+
const traces = await client.getTraces();
|
|
103
|
+
if (flags["json"]) {
|
|
104
|
+
console.log(JSON.stringify(traces, null, 2));
|
|
105
|
+
} else {
|
|
106
|
+
console.log(`
|
|
107
|
+
\u{1F4CB} Recent Security Traces (${traces.length} total):
|
|
108
|
+
`);
|
|
109
|
+
traces.slice(0, 10).forEach((tr) => {
|
|
110
|
+
const badge = tr.status === "ALLOWED" ? "\u{1F7E2} ALLOWED" : tr.status === "BLOCKED" ? "\u{1F534} BLOCKED" : "\u{1F7E1} HELD_FOR_APPROVAL";
|
|
111
|
+
console.log(` [${tr.created_at.slice(11, 19)}] ${badge} - ${tr.agent_name} (${tr.user_role})`);
|
|
112
|
+
console.log(` Action: ${tr.action}`);
|
|
113
|
+
console.log(` Reason: ${tr.reason}`);
|
|
114
|
+
console.log(` Plan Hash: ${tr.plan_hash.slice(0, 16)}...`);
|
|
115
|
+
console.log("");
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case "approvals": {
|
|
121
|
+
const approvals = await client.getApprovals();
|
|
122
|
+
if (flags["json"]) {
|
|
123
|
+
console.log(JSON.stringify(approvals, null, 2));
|
|
124
|
+
} else {
|
|
125
|
+
console.log(`
|
|
126
|
+
\u23F3 Human-in-the-Loop Approvals (${approvals.length} items):
|
|
127
|
+
`);
|
|
128
|
+
if (approvals.length === 0) {
|
|
129
|
+
console.log(" No pending approvals. All actions authorized or clear.\n");
|
|
130
|
+
} else {
|
|
131
|
+
approvals.forEach((app) => {
|
|
132
|
+
console.log(` \u2022 ID: ${app.delegation_id} | Status: ${app.status}`);
|
|
133
|
+
console.log(` Action: ${app.action_type} -> ${app.recipient} ($${app.amount.toLocaleString()})`);
|
|
134
|
+
console.log(` Requested by: ${app.requested_by} (${app.role})`);
|
|
135
|
+
console.log(` Description: ${app.description}`);
|
|
136
|
+
console.log("");
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case "approve": {
|
|
143
|
+
const delId = positional[1];
|
|
144
|
+
if (!delId) {
|
|
145
|
+
console.error("Error: Please provide delegation_id to approve. (e.g. armordesk approve del_01hx9a)");
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
const res = await client.resolveApproval(delId, "APPROVE");
|
|
149
|
+
console.log(`\u2705 Approved delegation '${delId}' successfully.`);
|
|
150
|
+
if (res.receipt_id) {
|
|
151
|
+
console.log(` Digital Proof Receipt Generated: ${res.receipt_id}`);
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
case "reject": {
|
|
156
|
+
const delId = positional[1];
|
|
157
|
+
if (!delId) {
|
|
158
|
+
console.error("Error: Please provide delegation_id to reject. (e.g. armordesk reject del_01hx9a)");
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}
|
|
161
|
+
await client.resolveApproval(delId, "REJECT");
|
|
162
|
+
console.log(`\u{1F6AB} Rejected delegation '${delId}'.`);
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case "receipts": {
|
|
166
|
+
const receipts = await client.getReceipts();
|
|
167
|
+
if (flags["json"]) {
|
|
168
|
+
console.log(JSON.stringify(receipts, null, 2));
|
|
169
|
+
} else {
|
|
170
|
+
console.log(`
|
|
171
|
+
\u{1F4DC} Cryptographic Proof Receipts (${receipts.length} total):
|
|
172
|
+
`);
|
|
173
|
+
receipts.forEach((r) => {
|
|
174
|
+
console.log(` \u2022 [${r.id}] ${r.action_type} ($${r.amount}) -> ${r.recipient}`);
|
|
175
|
+
console.log(` Status: ${r.status} | Verified: ${r.verified ? "\u2705 YES" : "\u274C NO"}`);
|
|
176
|
+
console.log(` Plan Hash: ${r.plan_hash}`);
|
|
177
|
+
console.log(` Merkle Root: ${r.merkle_root}`);
|
|
178
|
+
console.log("");
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
case "verify": {
|
|
184
|
+
const rId = positional[1];
|
|
185
|
+
if (!rId) {
|
|
186
|
+
console.error("Error: Please specify receipt ID to verify (e.g. armordesk verify rcpt_01hx9a)");
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
const receipt = await client.getReceipt(rId);
|
|
190
|
+
const proofRes = await client.verifyProof({
|
|
191
|
+
plan_hash: receipt.plan_hash,
|
|
192
|
+
merkle_root: receipt.merkle_root,
|
|
193
|
+
signature: receipt.signature,
|
|
194
|
+
allowed_spec: receipt.allowed_spec,
|
|
195
|
+
actual_execution: receipt.actual_execution
|
|
196
|
+
});
|
|
197
|
+
console.log(`
|
|
198
|
+
\u{1F50D} Cryptographic Proof Verification for [${rId}]`);
|
|
199
|
+
console.log("------------------------------------------------------------");
|
|
200
|
+
console.log(`Verdict: ${proofRes.valid ? "\u2705 VALID" : "\u274C INVALID"}`);
|
|
201
|
+
console.log(`Status: ${proofRes.status}`);
|
|
202
|
+
console.log(`Computed Plan Hash: ${proofRes.computed_plan_hash}`);
|
|
203
|
+
console.log(`Matches Hash: ${proofRes.matches_hash ? "MATCH" : "MISMATCH"}`);
|
|
204
|
+
console.log(`Computed Merkle: ${proofRes.computed_merkle_root}`);
|
|
205
|
+
console.log(`Matches Merkle: ${proofRes.matches_merkle ? "MATCH" : "MISMATCH"}`);
|
|
206
|
+
console.log(`Details: ${proofRes.details}
|
|
207
|
+
`);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
case "mcp": {
|
|
211
|
+
const sub = positional[1] || "info";
|
|
212
|
+
if (sub === "claude") {
|
|
213
|
+
console.log(JSON.stringify(generateClaudeDesktopConfig({ gatewayUrl: `${client.baseUrl}/api/mcp/gateway` }), null, 2));
|
|
214
|
+
} else if (sub === "cursor") {
|
|
215
|
+
console.log(JSON.stringify(generateCursorConfig({ gatewayUrl: `${client.baseUrl}/api/mcp/gateway` }), null, 2));
|
|
216
|
+
} else {
|
|
217
|
+
const cfg = await client.getMCPConfig();
|
|
218
|
+
if (flags["json"]) {
|
|
219
|
+
console.log(JSON.stringify(cfg, null, 2));
|
|
220
|
+
} else {
|
|
221
|
+
console.log("\n\u{1F50C} ArmorDesk Governed MCP Gateway");
|
|
222
|
+
console.log("-----------------------------------------");
|
|
223
|
+
console.log(`Gateway URL: ${cfg.gateway_url}`);
|
|
224
|
+
console.log(`SSE URL: ${cfg.sse_url}`);
|
|
225
|
+
console.log(`Protocol Version: ${cfg.protocol_version}`);
|
|
226
|
+
console.log(`Governed Tools: ${cfg.governed_tools.length} sandboxed tools`);
|
|
227
|
+
cfg.governed_tools.forEach((t) => {
|
|
228
|
+
console.log(` \u2022 ${t.name.padEnd(24)} [${t.tier}] (${t.governing_agent})`);
|
|
229
|
+
});
|
|
230
|
+
console.log("\nTip: Run 'armordesk mcp claude' or 'armordesk mcp cursor' to get snippet configurations.\n");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
case "scenario": {
|
|
236
|
+
const scNum = parseInt(positional[1] || "1", 10);
|
|
237
|
+
console.log(`
|
|
238
|
+
\u2699\uFE0F Running Scenario #${scNum} simulation...`);
|
|
239
|
+
const res = await client.runScenario(scNum);
|
|
240
|
+
console.log(`Scenario: ${res.scenario_name}`);
|
|
241
|
+
console.log(`Status: ${res.overall_status}`);
|
|
242
|
+
console.log(`Summary: ${res.summary}`);
|
|
243
|
+
if (res.steps && res.steps.length > 0) {
|
|
244
|
+
console.log("\nExecuted Pipeline Steps:");
|
|
245
|
+
res.steps.forEach((s) => {
|
|
246
|
+
console.log(` [Step ${s.step}] ${s.agent} (${s.tool}) -> ${s.status}`);
|
|
247
|
+
console.log(` ${s.detail}`);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (res.receipt_id) {
|
|
251
|
+
console.log(`
|
|
252
|
+
Receipt Generated: ${res.receipt_id}`);
|
|
253
|
+
}
|
|
254
|
+
console.log("");
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case "ctf": {
|
|
258
|
+
const prompt = positional[1];
|
|
259
|
+
if (!prompt) {
|
|
260
|
+
console.error("Error: Please provide an attack prompt. (e.g. armordesk ctf 'Ignore previous instructions...')");
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
console.log(`
|
|
264
|
+
\u{1F6E1}\uFE0F Submitting attack payload to CTF Gauntlet...`);
|
|
265
|
+
const ctfRes = await client.submitCTF(prompt);
|
|
266
|
+
console.log(`Result: ${ctfRes.blocked ? "BLOCKED \u{1F6E1}\uFE0F" : "BYPASSED \u26A0\uFE0F"}`);
|
|
267
|
+
console.log(`Threat Detected: ${ctfRes.detected_threat}`);
|
|
268
|
+
console.log(`Reason: ${ctfRes.reason}`);
|
|
269
|
+
console.log(`Score: ${ctfRes.score} pts
|
|
270
|
+
`);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
case "voice": {
|
|
274
|
+
const type = positional[1] || "executive";
|
|
275
|
+
console.log(`
|
|
276
|
+
\u{1F399}\uFE0F Requesting ${type} voice briefing from ElevenLabs...`);
|
|
277
|
+
const voiceRes = await client.getVoiceBriefing(type);
|
|
278
|
+
console.log(`Success: ${voiceRes.success}`);
|
|
279
|
+
console.log(`Voice: ${voiceRes.voice_type} (ID: ${voiceRes.voice_id})`);
|
|
280
|
+
console.log(`Script: ${voiceRes.script}`);
|
|
281
|
+
console.log(`Audio Size: ${Math.round((voiceRes.audio_base64?.length || 0) * 0.75)} bytes (MP3)
|
|
282
|
+
`);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
default: {
|
|
286
|
+
console.log(`Unknown command: '${command}'`);
|
|
287
|
+
console.log(HELP_TEXT);
|
|
288
|
+
process.exit(1);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
} catch (err) {
|
|
292
|
+
console.error(`
|
|
293
|
+
\u274C Error: ${err.message}
|
|
294
|
+
`);
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export {
|
|
299
|
+
runCLI
|
|
300
|
+
};
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ArmorDeskClientOptions, ArmorDeskStatus, TenantInfo, TraceItem, ApprovalItem, ReceiptItem, VerifyProofRequest, VerifyProofResponse, MCPGatewayConfig, MCPCallResponse, ScenarioRunResponse, CTFSubmitResponse, VoiceBriefingResponse } from "./types.js";
|
|
2
|
+
import { canonicalJson, generatePlanHash, buildMerkleTree, verifyMerkleRoot, verifyProof } from "./crypto.js";
|
|
3
|
+
export declare class ArmorDeskClient {
|
|
4
|
+
readonly baseUrl: string;
|
|
5
|
+
readonly apiKey?: string;
|
|
6
|
+
readonly tenantId: string;
|
|
7
|
+
readonly userName: string;
|
|
8
|
+
readonly userRole: string;
|
|
9
|
+
private readonly _fetch;
|
|
10
|
+
readonly crypto: {
|
|
11
|
+
canonicalJson: typeof canonicalJson;
|
|
12
|
+
generatePlanHash: typeof generatePlanHash;
|
|
13
|
+
buildMerkleTree: typeof buildMerkleTree;
|
|
14
|
+
verifyMerkleRoot: typeof verifyMerkleRoot;
|
|
15
|
+
verifyProof: typeof verifyProof;
|
|
16
|
+
};
|
|
17
|
+
constructor(options?: ArmorDeskClientOptions);
|
|
18
|
+
private request;
|
|
19
|
+
/**
|
|
20
|
+
* Health and runtime operational telemetry
|
|
21
|
+
*/
|
|
22
|
+
status(): Promise<ArmorDeskStatus>;
|
|
23
|
+
/**
|
|
24
|
+
* List managed corporate tenants
|
|
25
|
+
*/
|
|
26
|
+
getTenants(): Promise<TenantInfo[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch immutable security and policy enforcement traces
|
|
29
|
+
*/
|
|
30
|
+
getTraces(tenantId?: string): Promise<TraceItem[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch approval queue items held by human-in-the-loop policies
|
|
33
|
+
*/
|
|
34
|
+
getApprovals(tenantId?: string): Promise<ApprovalItem[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Authorize or reject a held action in escrow
|
|
37
|
+
*/
|
|
38
|
+
resolveApproval(delegationId: string, action: "APPROVE" | "REJECT", notes?: string): Promise<{
|
|
39
|
+
status: string;
|
|
40
|
+
receipt_id?: string;
|
|
41
|
+
delegation_id: string;
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* List digital verification receipts with cryptographic proofs
|
|
46
|
+
*/
|
|
47
|
+
getReceipts(tenantId?: string): Promise<ReceiptItem[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve a specific receipt by ID
|
|
50
|
+
*/
|
|
51
|
+
getReceipt(receiptId: string): Promise<ReceiptItem>;
|
|
52
|
+
/**
|
|
53
|
+
* Cryptographically verify a digital proof
|
|
54
|
+
*/
|
|
55
|
+
verifyProof(proof: VerifyProofRequest): Promise<VerifyProofResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Get MCP Gateway configuration and sample connection specs
|
|
58
|
+
*/
|
|
59
|
+
getMCPConfig(tenantId?: string): Promise<MCPGatewayConfig>;
|
|
60
|
+
/**
|
|
61
|
+
* Invoke a tool through the Governed MCP Gateway
|
|
62
|
+
*/
|
|
63
|
+
callMCPTool(toolName: string, args: Record<string, any>, options?: {
|
|
64
|
+
userRole?: string;
|
|
65
|
+
userName?: string;
|
|
66
|
+
delegationId?: string;
|
|
67
|
+
}): Promise<MCPCallResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Execute an adversarial FinOps scenario simulation (1 to 5)
|
|
70
|
+
*/
|
|
71
|
+
runScenario(scenarioId: number, tenantId?: string): Promise<ScenarioRunResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Test prompt injection attacks against ArmorDesk CTF Gauntlet
|
|
74
|
+
*/
|
|
75
|
+
submitCTF(prompt: string, attackerName?: string, tenantId?: string): Promise<CTFSubmitResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Generate an executive voice briefing via ElevenLabs
|
|
78
|
+
*/
|
|
79
|
+
getVoiceBriefing(briefingType?: "security" | "executive", tenantId?: string): Promise<VoiceBriefingResponse>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
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ic JSON serialization compliant with RFC 8785.
|
|
4
|
+
* Recursively sorts keys and formats numbers/booleans without whitespace.
|
|
5
|
+
*/
|
|
6
|
+
export declare function canonicalJson(data: any): string;
|
|
7
|
+
/**
|
|
8
|
+
* SHA-256 Hex Digest helper
|
|
9
|
+
*/
|
|
10
|
+
export declare function hashSha256(data: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Computes deterministic SHA-256 Plan Hash from orchestrator plan dictionary
|
|
13
|
+
*/
|
|
14
|
+
export declare function generatePlanHash(planDict: Record<string, any>): string;
|
|
15
|
+
/**
|
|
16
|
+
* Builds a deterministic Merkle Tree over leaf items.
|
|
17
|
+
* Uses pairwise SHA-256 folding matching ArmorIQ core engine specs.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildMerkleTree(leafItems: string[]): {
|
|
20
|
+
root: string;
|
|
21
|
+
leafHashes: string[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Verifies if leaf items form the expected Merkle Root
|
|
25
|
+
*/
|
|
26
|
+
export declare function verifyMerkleRoot(leafItems: string[], expectedRoot: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Validates a digital execution receipt against plan hash and Merkle root
|
|
29
|
+
*/
|
|
30
|
+
export declare function verifyProof(request: VerifyProofRequest): VerifyProofResponse;
|
|
31
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CAmB/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAGtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAuBA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAGT;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,CA2B5E"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|