@zcloak/ai-agent 1.0.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/README.md +5 -0
- package/dist/bind.d.ts +22 -0
- package/dist/bind.js +145 -0
- package/dist/bind.js.map +1 -0
- package/dist/cli.d.ts +31 -0
- package/dist/cli.js +126 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +34 -0
- package/dist/config.js.map +1 -0
- package/dist/crypto.d.ts +113 -0
- package/dist/crypto.js +252 -0
- package/dist/crypto.js.map +1 -0
- package/dist/daemon.d.ts +94 -0
- package/dist/daemon.js +271 -0
- package/dist/daemon.js.map +1 -0
- package/dist/delete.d.ts +22 -0
- package/dist/delete.js +231 -0
- package/dist/delete.js.map +1 -0
- package/dist/doc.d.ts +23 -0
- package/dist/doc.js +180 -0
- package/dist/doc.js.map +1 -0
- package/dist/error.d.ts +45 -0
- package/dist/error.js +79 -0
- package/dist/error.js.map +1 -0
- package/dist/feed.d.ts +20 -0
- package/dist/feed.js +83 -0
- package/dist/feed.js.map +1 -0
- package/dist/identity.d.ts +50 -0
- package/dist/identity.js +99 -0
- package/dist/identity.js.map +1 -0
- package/dist/identity_cmd.d.ts +23 -0
- package/dist/identity_cmd.js +136 -0
- package/dist/identity_cmd.js.map +1 -0
- package/dist/idl.d.ts +99 -0
- package/dist/idl.js +213 -0
- package/dist/idl.js.map +1 -0
- package/dist/key-store.d.ts +88 -0
- package/dist/key-store.js +171 -0
- package/dist/key-store.js.map +1 -0
- package/dist/pow.d.ts +24 -0
- package/dist/pow.js +86 -0
- package/dist/pow.js.map +1 -0
- package/dist/register.d.ts +24 -0
- package/dist/register.js +191 -0
- package/dist/register.js.map +1 -0
- package/dist/rpc.d.ts +107 -0
- package/dist/rpc.js +60 -0
- package/dist/rpc.js.map +1 -0
- package/dist/serve.d.ts +55 -0
- package/dist/serve.js +455 -0
- package/dist/serve.js.map +1 -0
- package/dist/session.d.ts +104 -0
- package/dist/session.js +189 -0
- package/dist/session.js.map +1 -0
- package/dist/sign.d.ts +33 -0
- package/dist/sign.js +355 -0
- package/dist/sign.js.map +1 -0
- package/dist/types/common.d.ts +63 -0
- package/dist/types/common.js +8 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config.d.ts +28 -0
- package/dist/types/config.js +8 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/registry.d.ts +72 -0
- package/dist/types/registry.js +13 -0
- package/dist/types/registry.js.map +1 -0
- package/dist/types/sign-event.d.ts +134 -0
- package/dist/types/sign-event.js +13 -0
- package/dist/types/sign-event.js.map +1 -0
- package/dist/utils.d.ts +113 -0
- package/dist/utils.js +382 -0
- package/dist/utils.js.map +1 -0
- package/dist/verify.d.ts +23 -0
- package/dist/verify.js +207 -0
- package/dist/verify.js.map +1 -0
- package/dist/vetkey.d.ts +27 -0
- package/dist/vetkey.js +507 -0
- package/dist/vetkey.js.map +1 -0
- package/package.json +55 -0
package/dist/delete.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* zCloak.ai File Deletion with 2FA Verification Tool
|
|
5
|
+
*
|
|
6
|
+
* Implements secure file deletion requiring 2FA (WebAuthn passkey) authorization.
|
|
7
|
+
* The deletion flow: prepare → user authenticates via browser → confirm & delete.
|
|
8
|
+
* Uses @dfinity JS SDK to interact directly with ICP canister, no dfx required.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* zcloak-ai delete prepare <file_path> Prepare 2FA request and generate authentication URL
|
|
12
|
+
* zcloak-ai delete check <challenge> Check 2FA verification status
|
|
13
|
+
* zcloak-ai delete confirm <challenge> <file_path> Confirm 2FA and delete file if authorized
|
|
14
|
+
*
|
|
15
|
+
* All commands support --identity=<pem_path> to specify identity file.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.run = run;
|
|
22
|
+
const fs_1 = __importDefault(require("fs"));
|
|
23
|
+
const path_1 = __importDefault(require("path"));
|
|
24
|
+
// ========== Help Information ==========
|
|
25
|
+
function showHelp() {
|
|
26
|
+
console.log('zCloak.ai File Deletion with 2FA Verification Tool');
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log('Usage:');
|
|
29
|
+
console.log(' zcloak-ai delete prepare <file_path> Prepare 2FA request and generate auth URL');
|
|
30
|
+
console.log(' zcloak-ai delete check <challenge> Check 2FA verification status');
|
|
31
|
+
console.log(' zcloak-ai delete confirm <challenge> <file_path> Confirm 2FA and delete file');
|
|
32
|
+
console.log('');
|
|
33
|
+
console.log('Options:');
|
|
34
|
+
console.log(' --identity=<pem_path> Specify identity PEM file');
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('Flow:');
|
|
37
|
+
console.log(' 1. Run `delete prepare <file>` to get a 2FA challenge and authentication URL');
|
|
38
|
+
console.log(' 2. Open the URL in your browser and complete passkey authentication');
|
|
39
|
+
console.log(' 3. Run `delete confirm <challenge> <file>` to verify 2FA and delete the file');
|
|
40
|
+
console.log('');
|
|
41
|
+
console.log('Examples:');
|
|
42
|
+
console.log(' zcloak-ai delete prepare ./report.pdf');
|
|
43
|
+
console.log(' zcloak-ai delete check "abc123..."');
|
|
44
|
+
console.log(' zcloak-ai delete confirm "abc123..." ./report.pdf');
|
|
45
|
+
}
|
|
46
|
+
// ========== Command Implementations ==========
|
|
47
|
+
/**
|
|
48
|
+
* Prepare 2FA request for file deletion.
|
|
49
|
+
* Builds a JSON payload with file info, calls prepare_2fa_info on the canister,
|
|
50
|
+
* extracts the challenge, and generates a browser authentication URL.
|
|
51
|
+
*/
|
|
52
|
+
async function cmdPrepare(session, filePath) {
|
|
53
|
+
if (!filePath) {
|
|
54
|
+
console.error('Error: file path is required');
|
|
55
|
+
console.error('Usage: zcloak-ai delete prepare <file_path>');
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
// Resolve and verify the file exists
|
|
59
|
+
const resolvedPath = path_1.default.resolve(filePath);
|
|
60
|
+
if (!fs_1.default.existsSync(resolvedPath)) {
|
|
61
|
+
console.error(`Error: file not found: ${resolvedPath}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
// Gather file information
|
|
65
|
+
const fileName = path_1.default.basename(resolvedPath);
|
|
66
|
+
const fileStats = fs_1.default.statSync(resolvedPath);
|
|
67
|
+
const fileSize = fileStats.size;
|
|
68
|
+
const requestTimestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds
|
|
69
|
+
// Build the deletion info JSON payload
|
|
70
|
+
const deleteInfo = JSON.stringify({
|
|
71
|
+
operation: 'delete',
|
|
72
|
+
file_name: fileName,
|
|
73
|
+
file_size: fileSize,
|
|
74
|
+
request_timestamp: requestTimestamp,
|
|
75
|
+
});
|
|
76
|
+
console.error(`File: ${fileName} (${fileSize} bytes)`);
|
|
77
|
+
console.error('Calling prepare_2fa_info...');
|
|
78
|
+
// Call prepare_2fa_info (update call, requires identity)
|
|
79
|
+
const actor = await session.getRegistryActor();
|
|
80
|
+
const result = await actor.prepare_2fa_info(deleteInfo);
|
|
81
|
+
// Check return result — variant { Ok: text } | { Err: text }
|
|
82
|
+
if ('Err' in result) {
|
|
83
|
+
console.error('2FA preparation failed:');
|
|
84
|
+
console.log(`(variant { Err = "${result.Err}" })`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
// Parse the returned WebAuthn challenge JSON
|
|
88
|
+
const authContent = result.Ok;
|
|
89
|
+
let challenge;
|
|
90
|
+
try {
|
|
91
|
+
const parsed = JSON.parse(authContent);
|
|
92
|
+
challenge = parsed.publicKey?.challenge ?? '';
|
|
93
|
+
if (!challenge) {
|
|
94
|
+
throw new Error('challenge field not found in response');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
console.error('Warning: could not extract challenge from response. Save the full response for later use.');
|
|
99
|
+
challenge = '';
|
|
100
|
+
}
|
|
101
|
+
// Build the 2FA authentication URL
|
|
102
|
+
const twofaBase = session.getTwoFAUrl();
|
|
103
|
+
const url = `${twofaBase}?auth_content=${encodeURIComponent(authContent)}`;
|
|
104
|
+
// Output challenge for subsequent check/confirm commands
|
|
105
|
+
if (challenge) {
|
|
106
|
+
console.log('');
|
|
107
|
+
console.log('=== 2FA Challenge ===');
|
|
108
|
+
console.log('');
|
|
109
|
+
console.log(challenge);
|
|
110
|
+
}
|
|
111
|
+
// Output authentication URL
|
|
112
|
+
console.log('');
|
|
113
|
+
console.log('=== 2FA Authentication URL ===');
|
|
114
|
+
console.log('');
|
|
115
|
+
console.log(url);
|
|
116
|
+
console.log('');
|
|
117
|
+
console.log('Please open the URL above in your browser and use your passkey to authorize the file deletion.');
|
|
118
|
+
if (challenge) {
|
|
119
|
+
console.log('');
|
|
120
|
+
console.log('After completing authentication, run:');
|
|
121
|
+
console.log(` zcloak-ai delete confirm "${challenge}" "${filePath}"`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Check 2FA verification status by challenge string.
|
|
126
|
+
* Queries the canister to see if the 2FA has been confirmed.
|
|
127
|
+
*/
|
|
128
|
+
async function cmdCheck(session, challenge) {
|
|
129
|
+
if (!challenge) {
|
|
130
|
+
console.error('Error: challenge string is required');
|
|
131
|
+
console.error('Usage: zcloak-ai delete check <challenge>');
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
console.error('Querying 2FA result...');
|
|
135
|
+
// Query 2FA result (query call, can use anonymous actor)
|
|
136
|
+
const actor = await session.getAnonymousRegistryActor();
|
|
137
|
+
const result = await actor.query_2fa_result_by_challenge(challenge);
|
|
138
|
+
// opt TwoFARecord — empty array means no record found
|
|
139
|
+
if (!result || result.length === 0) {
|
|
140
|
+
console.log('Status: not found');
|
|
141
|
+
console.log('No 2FA record found for this challenge. The challenge may be invalid or expired.');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const record = result[0];
|
|
145
|
+
// Check confirm_timestamp — CandidOpt: [] means pending, [timestamp] means confirmed
|
|
146
|
+
const isConfirmed = record.confirm_timestamp.length > 0;
|
|
147
|
+
console.log(`Status: ${isConfirmed ? 'confirmed' : 'pending'}`);
|
|
148
|
+
console.log(`Caller: ${record.caller}`);
|
|
149
|
+
console.log(`Owners: ${record.owner_list.join(', ')}`);
|
|
150
|
+
if (isConfirmed) {
|
|
151
|
+
console.log(`Confirmed by: ${record.confirm_owner.length > 0 ? record.confirm_owner[0] : 'unknown'}`);
|
|
152
|
+
console.log(`Confirmed at: ${record.confirm_timestamp[0].toString()}`);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
console.log('');
|
|
156
|
+
console.log('The 2FA has not been confirmed yet. Please complete passkey authentication first.');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Confirm 2FA and delete the file.
|
|
161
|
+
* Queries the 2FA result, and if confirmed, deletes the specified file.
|
|
162
|
+
*/
|
|
163
|
+
async function cmdConfirm(session, challenge, filePath) {
|
|
164
|
+
if (!challenge || !filePath) {
|
|
165
|
+
console.error('Error: both challenge and file path are required');
|
|
166
|
+
console.error('Usage: zcloak-ai delete confirm <challenge> <file_path>');
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
// Resolve and verify the file exists
|
|
170
|
+
const resolvedPath = path_1.default.resolve(filePath);
|
|
171
|
+
if (!fs_1.default.existsSync(resolvedPath)) {
|
|
172
|
+
console.error(`Error: file not found: ${resolvedPath}`);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
console.error('Querying 2FA result...');
|
|
176
|
+
// Query 2FA result (query call, can use anonymous actor)
|
|
177
|
+
const actor = await session.getAnonymousRegistryActor();
|
|
178
|
+
const result = await actor.query_2fa_result_by_challenge(challenge);
|
|
179
|
+
// opt TwoFARecord — empty array means no record found
|
|
180
|
+
if (!result || result.length === 0) {
|
|
181
|
+
console.error('Error: no 2FA record found for this challenge.');
|
|
182
|
+
console.error('The challenge may be invalid or expired.');
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
const record = result[0];
|
|
186
|
+
// Check confirm_timestamp — CandidOpt: [] means pending, [timestamp] means confirmed
|
|
187
|
+
const isConfirmed = record.confirm_timestamp.length > 0;
|
|
188
|
+
if (!isConfirmed) {
|
|
189
|
+
console.error('Error: 2FA has not been confirmed yet.');
|
|
190
|
+
console.error('Please complete passkey authentication in your browser first.');
|
|
191
|
+
process.exit(1);
|
|
192
|
+
}
|
|
193
|
+
// 2FA confirmed — proceed with file deletion
|
|
194
|
+
const fileName = path_1.default.basename(resolvedPath);
|
|
195
|
+
console.error(`2FA confirmed. Deleting file: ${fileName}`);
|
|
196
|
+
fs_1.default.unlinkSync(resolvedPath);
|
|
197
|
+
console.log(`File "${fileName}" deleted successfully.`);
|
|
198
|
+
console.log(`Confirmed by: ${record.confirm_owner.length > 0 ? record.confirm_owner[0] : 'unknown'}`);
|
|
199
|
+
}
|
|
200
|
+
// ========== Exported run() — called by cli.ts ==========
|
|
201
|
+
/**
|
|
202
|
+
* Entry point when invoked via cli.ts.
|
|
203
|
+
* Receives a Session instance with pre-parsed arguments.
|
|
204
|
+
*/
|
|
205
|
+
async function run(session) {
|
|
206
|
+
const command = session.args._args[0];
|
|
207
|
+
try {
|
|
208
|
+
switch (command) {
|
|
209
|
+
case 'prepare':
|
|
210
|
+
await cmdPrepare(session, session.args._args[1]);
|
|
211
|
+
break;
|
|
212
|
+
case 'check':
|
|
213
|
+
await cmdCheck(session, session.args._args[1]);
|
|
214
|
+
break;
|
|
215
|
+
case 'confirm':
|
|
216
|
+
await cmdConfirm(session, session.args._args[1], session.args._args[2]);
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
showHelp();
|
|
220
|
+
if (command) {
|
|
221
|
+
console.error(`\nUnknown command: ${command}`);
|
|
222
|
+
}
|
|
223
|
+
process.exit(1);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
console.error(`Operation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../src/delete.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;GAaG;;;;;AA2NH,kBAyBC;AAlPD,4CAAoB;AACpB,gDAAwB;AAGxB,yCAAyC;AACzC,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,iGAAiG,CAAC,CAAC;IAC/G,OAAO,CAAC,GAAG,CAAC,qFAAqF,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,EAAE,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B,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/doc.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* zCloak.ai Document Tool
|
|
4
|
+
*
|
|
5
|
+
* Provides MANIFEST.sha256 generation, verification, file hash computation, and more.
|
|
6
|
+
* Pure Node.js implementation, cross-platform compatible, no external shell commands required.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* zcloak-ai doc manifest <folder_path> [--version=1.0.0] Generate MANIFEST.sha256 (with metadata header)
|
|
10
|
+
* zcloak-ai doc verify-manifest <folder_path> Verify file integrity in MANIFEST.sha256
|
|
11
|
+
* zcloak-ai doc hash <file_path> Compute single file SHA256 hash
|
|
12
|
+
* zcloak-ai doc info <file_path> Show file hash, size, MIME, etc.
|
|
13
|
+
*/
|
|
14
|
+
import { Session } from './session';
|
|
15
|
+
/**
|
|
16
|
+
* Entry point when invoked via cli.ts.
|
|
17
|
+
* Receives a Session instance with pre-parsed arguments.
|
|
18
|
+
*
|
|
19
|
+
* Note: doc commands are pure local operations (no canister calls),
|
|
20
|
+
* so Session is only used for argument parsing here.
|
|
21
|
+
*/
|
|
22
|
+
export declare function run(session: Session): void;
|
|
23
|
+
//# sourceMappingURL=doc.d.ts.map
|
package/dist/doc.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* zCloak.ai Document Tool
|
|
5
|
+
*
|
|
6
|
+
* Provides MANIFEST.sha256 generation, verification, file hash computation, and more.
|
|
7
|
+
* Pure Node.js implementation, cross-platform compatible, no external shell commands required.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* zcloak-ai doc manifest <folder_path> [--version=1.0.0] Generate MANIFEST.sha256 (with metadata header)
|
|
11
|
+
* zcloak-ai doc verify-manifest <folder_path> Verify file integrity in MANIFEST.sha256
|
|
12
|
+
* zcloak-ai doc hash <file_path> Compute single file SHA256 hash
|
|
13
|
+
* zcloak-ai doc info <file_path> Show file hash, size, MIME, etc.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.run = run;
|
|
20
|
+
const fs_1 = __importDefault(require("fs"));
|
|
21
|
+
const path_1 = __importDefault(require("path"));
|
|
22
|
+
const utils_1 = require("./utils");
|
|
23
|
+
// ========== Help Information ==========
|
|
24
|
+
function showHelp() {
|
|
25
|
+
console.log('zCloak.ai Document Tool');
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log('Usage:');
|
|
28
|
+
console.log(' zcloak-ai doc manifest <folder_path> [--version=1.0.0] Generate MANIFEST.sha256');
|
|
29
|
+
console.log(' zcloak-ai doc verify-manifest <folder_path> Verify file integrity');
|
|
30
|
+
console.log(' zcloak-ai doc hash <file_path> Compute SHA256 hash');
|
|
31
|
+
console.log(' zcloak-ai doc info <file_path> Show file details');
|
|
32
|
+
console.log('');
|
|
33
|
+
console.log('Options:');
|
|
34
|
+
console.log(' --version=x.y.z MANIFEST version (default: 1.0.0)');
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('Examples:');
|
|
37
|
+
console.log(' zcloak-ai doc manifest ./my-skill/ --version=2.0.0');
|
|
38
|
+
console.log(' zcloak-ai doc verify-manifest ./my-skill/');
|
|
39
|
+
console.log(' zcloak-ai doc hash ./report.pdf');
|
|
40
|
+
console.log(' zcloak-ai doc info ./report.pdf');
|
|
41
|
+
}
|
|
42
|
+
// ========== Command Implementations ==========
|
|
43
|
+
/**
|
|
44
|
+
* Generate MANIFEST.sha256 (with metadata header)
|
|
45
|
+
* Format compatible with GNU sha256sum, metadata represented as # comment lines
|
|
46
|
+
*/
|
|
47
|
+
function cmdManifest(folderPath, args) {
|
|
48
|
+
if (!folderPath) {
|
|
49
|
+
console.error('Error: folder path is required');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
if (!fs_1.default.existsSync(folderPath) || !fs_1.default.statSync(folderPath).isDirectory()) {
|
|
53
|
+
console.error(`Error: directory does not exist: ${folderPath}`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
const version = typeof args.version === 'string' ? args.version : '1.0.0';
|
|
57
|
+
try {
|
|
58
|
+
const result = (0, utils_1.generateManifest)(folderPath, { version });
|
|
59
|
+
console.log(`MANIFEST.sha256 generated: ${result.manifestPath}`);
|
|
60
|
+
console.log(`File count: ${result.fileCount}`);
|
|
61
|
+
console.log(`Version: ${version}`);
|
|
62
|
+
console.log(`MANIFEST SHA256: ${result.manifestHash}`);
|
|
63
|
+
console.log(`MANIFEST size: ${result.manifestSize} bytes`);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
console.error(`Failed to generate MANIFEST: ${err instanceof Error ? err.message : String(err)}`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Verify file integrity in MANIFEST.sha256
|
|
72
|
+
* Uses shared MANIFEST parser from utils.ts for consistent parsing and strict validation
|
|
73
|
+
*/
|
|
74
|
+
function cmdVerifyManifest(folderPath) {
|
|
75
|
+
if (!folderPath) {
|
|
76
|
+
console.error('Error: folder path is required');
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const manifestPath = path_1.default.join(folderPath, 'MANIFEST.sha256');
|
|
80
|
+
if (!fs_1.default.existsSync(manifestPath)) {
|
|
81
|
+
console.error(`Error: MANIFEST.sha256 not found: ${manifestPath}`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
const manifestContent = fs_1.default.readFileSync(manifestPath, 'utf-8');
|
|
85
|
+
const results = (0, utils_1.verifyManifestEntries)(manifestContent, folderPath);
|
|
86
|
+
let allPassed = true;
|
|
87
|
+
for (const r of results) {
|
|
88
|
+
if (r.passed) {
|
|
89
|
+
console.log(`OK: ${r.relativePath}`);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
const suffix = r.reason === 'not_found' ? ' (file not found)' : '';
|
|
93
|
+
console.log(`FAILED: ${r.relativePath}${suffix}`);
|
|
94
|
+
allPassed = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (!allPassed) {
|
|
98
|
+
console.error(`\nVerification failed! Some files do not match (checked ${results.length} files)`);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
console.log(`\nAll files verified successfully! (${results.length} files)`);
|
|
102
|
+
// Output MANIFEST hash (for subsequent on-chain verification)
|
|
103
|
+
const manifestHash = (0, utils_1.hashFile)(manifestPath);
|
|
104
|
+
console.log(`\nMANIFEST SHA256: ${manifestHash}`);
|
|
105
|
+
console.log('(Use this hash for on-chain signature verification: zcloak-ai verify file MANIFEST.sha256)');
|
|
106
|
+
}
|
|
107
|
+
/** Compute single file SHA256 hash */
|
|
108
|
+
function cmdHash(filePath) {
|
|
109
|
+
if (!filePath) {
|
|
110
|
+
console.error('Error: file path is required');
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
if (!fs_1.default.existsSync(filePath)) {
|
|
114
|
+
console.error(`Error: file does not exist: ${filePath}`);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
const hash = (0, utils_1.hashFile)(filePath);
|
|
118
|
+
console.log(hash);
|
|
119
|
+
}
|
|
120
|
+
/** Show file details (hash, size, MIME) */
|
|
121
|
+
function cmdInfo(filePath) {
|
|
122
|
+
if (!filePath) {
|
|
123
|
+
console.error('Error: file path is required');
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
if (!fs_1.default.existsSync(filePath)) {
|
|
127
|
+
console.error(`Error: file does not exist: ${filePath}`);
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
const hash = (0, utils_1.hashFile)(filePath);
|
|
131
|
+
const size = (0, utils_1.getFileSize)(filePath);
|
|
132
|
+
const fileName = path_1.default.basename(filePath);
|
|
133
|
+
const mime = (0, utils_1.getMimeType)(filePath);
|
|
134
|
+
console.log(`Filename: ${fileName}`);
|
|
135
|
+
console.log(`SHA256: ${hash}`);
|
|
136
|
+
console.log(`Size: ${size} bytes`);
|
|
137
|
+
console.log(`MIME: ${mime}`);
|
|
138
|
+
// Output JSON format (for easy copy-paste for signing)
|
|
139
|
+
const contentObj = { title: fileName, hash, mime, url: '', size_bytes: size };
|
|
140
|
+
console.log(`\nJSON (for signing):\n${JSON.stringify(contentObj, null, 2)}`);
|
|
141
|
+
}
|
|
142
|
+
// ========== Exported run() — called by cli.ts ==========
|
|
143
|
+
/**
|
|
144
|
+
* Entry point when invoked via cli.ts.
|
|
145
|
+
* Receives a Session instance with pre-parsed arguments.
|
|
146
|
+
*
|
|
147
|
+
* Note: doc commands are pure local operations (no canister calls),
|
|
148
|
+
* so Session is only used for argument parsing here.
|
|
149
|
+
*/
|
|
150
|
+
function run(session) {
|
|
151
|
+
const args = session.args;
|
|
152
|
+
const command = args._args[0];
|
|
153
|
+
try {
|
|
154
|
+
switch (command) {
|
|
155
|
+
case 'manifest':
|
|
156
|
+
cmdManifest(args._args[1], args);
|
|
157
|
+
break;
|
|
158
|
+
case 'verify-manifest':
|
|
159
|
+
cmdVerifyManifest(args._args[1]);
|
|
160
|
+
break;
|
|
161
|
+
case 'hash':
|
|
162
|
+
cmdHash(args._args[1]);
|
|
163
|
+
break;
|
|
164
|
+
case 'info':
|
|
165
|
+
cmdInfo(args._args[1]);
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
showHelp();
|
|
169
|
+
if (command) {
|
|
170
|
+
console.error(`\nUnknown command: ${command}`);
|
|
171
|
+
}
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
console.error(`Operation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=doc.js.map
|
package/dist/doc.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../src/doc.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;GAWG;;;;;AAiKH,kBA6BC;AA5LD,4CAAoB;AACpB,gDAAwB;AACxB,mCAMiB;AAIjB,yCAAyC;AACzC,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,qFAAqF,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,O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AE9B,IAAI,CAAC;QACH,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,UAAU;gBACb,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBACjC,MAAM;YACR,KAAK,iBAAiB;gBACpB,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,MAAM;YACR,KAAK,MAAM;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM;YACR,KAAK,MAAM;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM;YACR;gBACE,QAAQ,EAAE,CAAC;gBACX,IAAI,OAAO,EAAE,CAAC;oBACZ,OAAO,CAAC,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;gBACjD,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Error Types for VetKey Operations
|
|
3
|
+
*
|
|
4
|
+
* All VetKey-related errors are instances of ToolError with a specific `code` field
|
|
5
|
+
* that identifies the error category. This enables callers to switch
|
|
6
|
+
* on the error code for structured error handling.
|
|
7
|
+
*
|
|
8
|
+
* Non-VetKey modules in zcloak-agent continue to use standard Error instances.
|
|
9
|
+
*/
|
|
10
|
+
/** Error codes for categorizing VetKey Tool errors */
|
|
11
|
+
export type ErrorCode = "CANISTER_CALL" | "ENCRYPTION" | "DECRYPTION" | "IDENTITY" | "CONFIG" | "DAEMON" | "IO" | "RPC_PARSE" | "FILE_OP";
|
|
12
|
+
/**
|
|
13
|
+
* Unified error class for all VetKey Tool operations.
|
|
14
|
+
*
|
|
15
|
+
* Extends the standard Error class with a `code` field for programmatic
|
|
16
|
+
* error handling, and an optional `cause` for error chaining.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ToolError extends Error {
|
|
19
|
+
/** Error category code */
|
|
20
|
+
readonly code: ErrorCode;
|
|
21
|
+
/** Original cause of this error (for error chaining) */
|
|
22
|
+
readonly cause?: unknown;
|
|
23
|
+
constructor(code: ErrorCode, message: string, options?: {
|
|
24
|
+
cause?: unknown;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Canister call failed (network, consensus, or canister rejection) */
|
|
28
|
+
export declare function canisterCallError(message: string, cause?: unknown): ToolError;
|
|
29
|
+
/** Encryption failed (IBE or AES) */
|
|
30
|
+
export declare function encryptionError(message: string, cause?: unknown): ToolError;
|
|
31
|
+
/** Decryption failed (IBE or AES) */
|
|
32
|
+
export declare function decryptionError(message: string, cause?: unknown): ToolError;
|
|
33
|
+
/** Identity loading or generation failed */
|
|
34
|
+
export declare function identityError(message: string, cause?: unknown): ToolError;
|
|
35
|
+
/** Configuration resolution failed (missing required fields, etc.) */
|
|
36
|
+
export declare function configError(message: string): ToolError;
|
|
37
|
+
/** Daemon lifecycle error (PID conflicts, socket failures, etc.) */
|
|
38
|
+
export declare function daemonError(message: string, cause?: unknown): ToolError;
|
|
39
|
+
/** File system I/O error */
|
|
40
|
+
export declare function ioError(message: string, cause?: unknown): ToolError;
|
|
41
|
+
/** JSON-RPC protocol parse error */
|
|
42
|
+
export declare function rpcParseError(message: string, cause?: unknown): ToolError;
|
|
43
|
+
/** File operation error (size limit exceeded, permissions, etc.) */
|
|
44
|
+
export declare function fileOpError(message: string, cause?: unknown): ToolError;
|
|
45
|
+
//# sourceMappingURL=error.d.ts.map
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Unified Error Types for VetKey Operations
|
|
4
|
+
*
|
|
5
|
+
* All VetKey-related errors are instances of ToolError with a specific `code` field
|
|
6
|
+
* that identifies the error category. This enables callers to switch
|
|
7
|
+
* on the error code for structured error handling.
|
|
8
|
+
*
|
|
9
|
+
* Non-VetKey modules in zcloak-agent continue to use standard Error instances.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ToolError = void 0;
|
|
13
|
+
exports.canisterCallError = canisterCallError;
|
|
14
|
+
exports.encryptionError = encryptionError;
|
|
15
|
+
exports.decryptionError = decryptionError;
|
|
16
|
+
exports.identityError = identityError;
|
|
17
|
+
exports.configError = configError;
|
|
18
|
+
exports.daemonError = daemonError;
|
|
19
|
+
exports.ioError = ioError;
|
|
20
|
+
exports.rpcParseError = rpcParseError;
|
|
21
|
+
exports.fileOpError = fileOpError;
|
|
22
|
+
/**
|
|
23
|
+
* Unified error class for all VetKey Tool operations.
|
|
24
|
+
*
|
|
25
|
+
* Extends the standard Error class with a `code` field for programmatic
|
|
26
|
+
* error handling, and an optional `cause` for error chaining.
|
|
27
|
+
*/
|
|
28
|
+
class ToolError extends Error {
|
|
29
|
+
constructor(code, message, options) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.code = code;
|
|
32
|
+
this.name = "ToolError";
|
|
33
|
+
// ES2020 target doesn't support Error(message, options), set cause manually
|
|
34
|
+
if (options?.cause !== undefined) {
|
|
35
|
+
this.cause = options.cause;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ToolError = ToolError;
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// Factory functions for creating typed errors
|
|
42
|
+
// ============================================================================
|
|
43
|
+
/** Canister call failed (network, consensus, or canister rejection) */
|
|
44
|
+
function canisterCallError(message, cause) {
|
|
45
|
+
return new ToolError("CANISTER_CALL", `Canister call failed: ${message}`, { cause });
|
|
46
|
+
}
|
|
47
|
+
/** Encryption failed (IBE or AES) */
|
|
48
|
+
function encryptionError(message, cause) {
|
|
49
|
+
return new ToolError("ENCRYPTION", `Encryption failed: ${message}`, { cause });
|
|
50
|
+
}
|
|
51
|
+
/** Decryption failed (IBE or AES) */
|
|
52
|
+
function decryptionError(message, cause) {
|
|
53
|
+
return new ToolError("DECRYPTION", `${message}`, { cause });
|
|
54
|
+
}
|
|
55
|
+
/** Identity loading or generation failed */
|
|
56
|
+
function identityError(message, cause) {
|
|
57
|
+
return new ToolError("IDENTITY", `Identity error: ${message}`, { cause });
|
|
58
|
+
}
|
|
59
|
+
/** Configuration resolution failed (missing required fields, etc.) */
|
|
60
|
+
function configError(message) {
|
|
61
|
+
return new ToolError("CONFIG", `Config error: ${message}`);
|
|
62
|
+
}
|
|
63
|
+
/** Daemon lifecycle error (PID conflicts, socket failures, etc.) */
|
|
64
|
+
function daemonError(message, cause) {
|
|
65
|
+
return new ToolError("DAEMON", `Daemon error: ${message}`, { cause });
|
|
66
|
+
}
|
|
67
|
+
/** File system I/O error */
|
|
68
|
+
function ioError(message, cause) {
|
|
69
|
+
return new ToolError("IO", `IO error: ${message}`, { cause });
|
|
70
|
+
}
|
|
71
|
+
/** JSON-RPC protocol parse error */
|
|
72
|
+
function rpcParseError(message, cause) {
|
|
73
|
+
return new ToolError("RPC_PARSE", `RPC parse error: ${message}`, { cause });
|
|
74
|
+
}
|
|
75
|
+
/** File operation error (size limit exceeded, permissions, etc.) */
|
|
76
|
+
function fileOpError(message, cause) {
|
|
77
|
+
return new ToolError("FILE_OP", `File operation error: ${message}`, { cause });
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names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AAC,CAAC;AAC5E,CAAC;AAED,sEAAsE;AACtE,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,iBAAiB,OAAO,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED,oEAAoE;AACpE,SAAgB,WAAW,CAAC,OAAe,EAAE,KAAe;IAC1D,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,iBAAiB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,4BAA4B;AAC5B,SAAgB,OAAO,CAAC,OAAe,EAAE,KAAe;IACtD,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,aAAa,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,oCAAoC;AACpC,SAAgB,aAAa,CAAC,OAAe,EAAE,KAAe;IAC5D,OAAO,IAAI,SAAS,CAAC,WAAW,EAAE,oBAAoB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,oEAAoE;AACpE,SAAgB,WAAW,CAAC,OAAe,EAAE,KAAe;IAC1D,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,yBAAyB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/feed.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* zCloak.ai Event/Post Fetching Tool
|
|
4
|
+
*
|
|
5
|
+
* Provides global counter query and event fetching by counter range.
|
|
6
|
+
* Uses @dfinity JS SDK to interact directly with ICP canister, no dfx required.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* zcloak-ai feed counter Get current global counter value
|
|
10
|
+
* zcloak-ai feed fetch <from> <to> Fetch events by counter range
|
|
11
|
+
*
|
|
12
|
+
* All commands support --identity=<pem_path> to specify identity file.
|
|
13
|
+
*/
|
|
14
|
+
import { Session } from './session';
|
|
15
|
+
/**
|
|
16
|
+
* Entry point when invoked via cli.ts.
|
|
17
|
+
* Receives a Session instance with pre-parsed arguments.
|
|
18
|
+
*/
|
|
19
|
+
export declare function run(session: Session): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=feed.d.ts.map
|