neozip-cli 0.90.0 → 0.95.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/AGENTS.md +93 -0
- package/CHANGELOG.md +70 -1
- package/DOCUMENTATION.md +22 -30
- package/README.md +214 -48
- package/dist/src/account/account-state.js +95 -0
- package/dist/src/account/format-account-status.js +62 -0
- package/dist/src/account/identity-provision.js +79 -0
- package/dist/src/account/identity-wrap.js +106 -0
- package/dist/src/account/profile-crypto.js +85 -0
- package/dist/src/account/profile-store.js +129 -0
- package/dist/src/account/require-account.js +32 -0
- package/dist/src/account/token-service-funding.js +151 -0
- package/dist/src/account/token-service-identity.js +488 -0
- package/dist/src/account/types.js +3 -0
- package/dist/src/account/wallet-evm.js +46 -0
- package/dist/src/account/wallet-setup.js +33 -0
- package/dist/src/archive/crypto-self.js +117 -0
- package/dist/src/archive/identity-key.js +217 -0
- package/dist/src/archive/recipient-lookup.js +61 -0
- package/dist/src/cli/output.js +100 -0
- package/dist/src/cli/params.js +122 -0
- package/dist/src/cli/schema.js +186 -0
- package/dist/src/cli/validate.js +119 -0
- package/dist/src/commands/mintTimestampProof.js +26 -14
- package/dist/src/commands/verifyEmail.js +9 -9
- package/dist/src/config/ConfigSetup.js +82 -423
- package/dist/src/config/ConfigStore.js +0 -33
- package/dist/src/connect/command.js +364 -0
- package/dist/src/connection/bootstrap.js +50 -0
- package/dist/src/connection/cli-guidance.js +101 -0
- package/dist/src/connection/cli-prefs.js +180 -0
- package/dist/src/connection/cli-settings.js +140 -0
- package/dist/src/connection/cli-types.js +14 -0
- package/dist/src/connection/coordinator.js +83 -0
- package/dist/src/connection/credentials.js +33 -0
- package/dist/src/connection/crypto.js +96 -0
- package/dist/src/connection/dump.js +117 -0
- package/dist/src/connection/funding.js +187 -0
- package/dist/src/connection/incomplete-setup.js +89 -0
- package/dist/src/connection/interactive.js +871 -0
- package/dist/src/connection/legacy-profile-reader.js +87 -0
- package/dist/src/connection/magic-link.js +142 -0
- package/dist/src/connection/migrate.js +115 -0
- package/dist/src/connection/onboarding.js +616 -0
- package/dist/src/connection/origin.js +69 -0
- package/dist/src/connection/phase.js +101 -0
- package/dist/src/connection/phone.js +26 -0
- package/dist/src/connection/promote-active.js +56 -0
- package/dist/src/connection/reset.js +56 -0
- package/dist/src/connection/status-report.js +52 -0
- package/dist/src/connection/store.js +406 -0
- package/dist/src/connection/token-auth.js +44 -0
- package/dist/src/connection/types.js +3 -0
- package/dist/src/connection/wallet-json-migration.js +155 -0
- package/dist/src/connection/wallet-login.js +65 -0
- package/dist/src/connection/wallet-setup.js +83 -0
- package/dist/src/constants/wallet-identity.js +14 -0
- package/dist/src/exit-codes.js +54 -10
- package/dist/src/neolist.js +93 -9
- package/dist/src/neounzip.js +217 -59
- package/dist/src/neozip/blockchain.js +18 -18
- package/dist/src/neozip/createZip.js +114 -91
- package/dist/src/neozip/upgradeZip.js +14 -11
- package/dist/src/neozip.js +252 -75
- package/dist/src/skills/command.js +256 -0
- package/dist/src/skills/locate.js +99 -0
- package/dist/src/util/mask.js +34 -0
- package/dist/src/util/token-service-fetch.js +26 -0
- package/env.example +18 -85
- package/package.json +89 -82
- package/skills/neozip-connect/SKILL.md +95 -0
- package/skills/neozip-create/SKILL.md +57 -0
- package/skills/neozip-extract/SKILL.md +58 -0
- package/skills/neozip-legacy/SKILL.md +48 -0
- package/skills/neozip-list/SKILL.md +56 -0
- package/skills/neozip-shared/SKILL.md +60 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.skillsUsage = skillsUsage;
|
|
37
|
+
exports.runSkillsCommand = runSkillsCommand;
|
|
38
|
+
/**
|
|
39
|
+
* neozip skills — install bundled Agent Skills for Claude, Cursor, and Cowork.
|
|
40
|
+
*/
|
|
41
|
+
const child_process_1 = require("child_process");
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const os = __importStar(require("os"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const locate_1 = require("./locate");
|
|
46
|
+
const TARGETS = {
|
|
47
|
+
claude: path.join(os.homedir(), '.claude', 'skills'),
|
|
48
|
+
cursor: path.join(os.homedir(), '.cursor', 'skills'),
|
|
49
|
+
};
|
|
50
|
+
function parseArgs(argv) {
|
|
51
|
+
let command = null;
|
|
52
|
+
let force = false;
|
|
53
|
+
let target = 'all';
|
|
54
|
+
let outputDir;
|
|
55
|
+
let json = false;
|
|
56
|
+
for (let i = 0; i < argv.length; i++) {
|
|
57
|
+
const arg = argv[i];
|
|
58
|
+
if (arg === '--force') {
|
|
59
|
+
force = true;
|
|
60
|
+
}
|
|
61
|
+
else if (arg === '--json') {
|
|
62
|
+
json = true;
|
|
63
|
+
}
|
|
64
|
+
else if (arg === '--target' && argv[i + 1]) {
|
|
65
|
+
const t = argv[++i];
|
|
66
|
+
if (t !== 'claude' && t !== 'cursor' && t !== 'all') {
|
|
67
|
+
throw new Error('--target must be claude, cursor, or all');
|
|
68
|
+
}
|
|
69
|
+
target = t;
|
|
70
|
+
}
|
|
71
|
+
else if (arg === '--output-dir' && argv[i + 1]) {
|
|
72
|
+
outputDir = argv[++i];
|
|
73
|
+
}
|
|
74
|
+
else if (arg === '--help' || arg === '-h') {
|
|
75
|
+
command = 'help';
|
|
76
|
+
}
|
|
77
|
+
else if (arg.startsWith('-')) {
|
|
78
|
+
throw new Error(`Unknown flag: ${arg}`);
|
|
79
|
+
}
|
|
80
|
+
else if (command === null) {
|
|
81
|
+
command = arg;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
throw new Error(`Unexpected argument: ${arg}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return { command: command ?? 'help', force, target, outputDir, json };
|
|
88
|
+
}
|
|
89
|
+
function symlinkSkill(source, dest, force) {
|
|
90
|
+
if (fs.existsSync(dest)) {
|
|
91
|
+
if (!force) {
|
|
92
|
+
const stat = fs.lstatSync(dest);
|
|
93
|
+
if (stat.isSymbolicLink()) {
|
|
94
|
+
const existing = fs.realpathSync(dest);
|
|
95
|
+
if (existing === fs.realpathSync(source))
|
|
96
|
+
return 'skipped';
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Already exists: ${dest} (use --force to replace)`);
|
|
99
|
+
}
|
|
100
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
101
|
+
}
|
|
102
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
103
|
+
const linkType = process.platform === 'win32' ? 'junction' : 'dir';
|
|
104
|
+
fs.symlinkSync(source, dest, linkType);
|
|
105
|
+
return 'linked';
|
|
106
|
+
}
|
|
107
|
+
function installSkills(options) {
|
|
108
|
+
const targets = options.target === 'all'
|
|
109
|
+
? Object.keys(TARGETS)
|
|
110
|
+
: [options.target];
|
|
111
|
+
const results = [];
|
|
112
|
+
for (const targetKey of targets) {
|
|
113
|
+
const destRoot = TARGETS[targetKey];
|
|
114
|
+
for (const name of options.names) {
|
|
115
|
+
const source = path.join(options.skillsDir, name);
|
|
116
|
+
const dest = path.join(destRoot, name);
|
|
117
|
+
const action = symlinkSkill(source, dest, options.force);
|
|
118
|
+
results.push({ skill: name, target: targetKey, dest, action });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return results;
|
|
122
|
+
}
|
|
123
|
+
function packSkills(skillsDir, names, outputDir) {
|
|
124
|
+
if ((0, child_process_1.spawnSync)('zip', ['-h'], { encoding: 'utf8' }).status !== 0) {
|
|
125
|
+
throw new Error('The zip command is not available. Install zip (macOS: built-in) or pack skills manually.');
|
|
126
|
+
}
|
|
127
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
128
|
+
const created = [];
|
|
129
|
+
for (const name of names) {
|
|
130
|
+
const zipPath = path.join(outputDir, `${name}.zip`);
|
|
131
|
+
if (fs.existsSync(zipPath))
|
|
132
|
+
fs.rmSync(zipPath);
|
|
133
|
+
const result = (0, child_process_1.spawnSync)('zip', ['-r', zipPath, name], {
|
|
134
|
+
cwd: skillsDir,
|
|
135
|
+
encoding: 'utf8',
|
|
136
|
+
});
|
|
137
|
+
if (result.status !== 0) {
|
|
138
|
+
throw new Error(`Failed to create ${zipPath}: ${result.stderr?.trim() || result.stdout?.trim() || 'zip failed'}`);
|
|
139
|
+
}
|
|
140
|
+
created.push(zipPath);
|
|
141
|
+
}
|
|
142
|
+
return created;
|
|
143
|
+
}
|
|
144
|
+
function skillsUsage() {
|
|
145
|
+
console.error(`NeoZip Agent Skills
|
|
146
|
+
|
|
147
|
+
Bundled skills teach Claude, Cursor, and other agents how to use neozip, neounzip,
|
|
148
|
+
and neolist with JSON output, schema introspection, and connect setup.
|
|
149
|
+
|
|
150
|
+
Usage:
|
|
151
|
+
neozip skills path Print bundled skills directory
|
|
152
|
+
neozip skills list [--json] List bundled skill names
|
|
153
|
+
neozip skills install [--target TARGET] Symlink skills into agent folders
|
|
154
|
+
neozip skills pack [--output-dir DIR] Create Cowork/claude.ai upload ZIPs
|
|
155
|
+
|
|
156
|
+
Options:
|
|
157
|
+
--target claude|cursor|all Install destination (default: all)
|
|
158
|
+
--force Replace existing symlinks
|
|
159
|
+
--output-dir <dir> Output directory for pack (default: ./neozip-skills-zips)
|
|
160
|
+
--json Machine-readable output (list/install/pack)
|
|
161
|
+
-h, --help Show this help
|
|
162
|
+
|
|
163
|
+
Install targets:
|
|
164
|
+
claude ~/.claude/skills/ Claude Code
|
|
165
|
+
cursor ~/.cursor/skills/ Cursor personal skills
|
|
166
|
+
|
|
167
|
+
Alternative (skills registry):
|
|
168
|
+
npx skills add <repo-url>
|
|
169
|
+
npx skills add <repo-url>/tree/main/skills/neozip-create
|
|
170
|
+
|
|
171
|
+
Cowork / claude.ai:
|
|
172
|
+
Upload ZIPs from 'neozip skills pack' via Customize > Skills > Upload a skill.
|
|
173
|
+
Each ZIP must contain one skill folder at the root (e.g. neozip-create/SKILL.md).
|
|
174
|
+
|
|
175
|
+
See also: AGENTS.md, skills/, README.md#for-ai-agents
|
|
176
|
+
`);
|
|
177
|
+
}
|
|
178
|
+
function runSkillsCommand(argv) {
|
|
179
|
+
try {
|
|
180
|
+
const { command, force, target, outputDir, json } = parseArgs(argv);
|
|
181
|
+
const skillsDir = (0, locate_1.resolveBundledSkillsDir)();
|
|
182
|
+
const names = (0, locate_1.listSkillNames)(skillsDir);
|
|
183
|
+
const repoUrl = (0, locate_1.resolveSkillsAddUrl)();
|
|
184
|
+
switch (command) {
|
|
185
|
+
case 'help':
|
|
186
|
+
skillsUsage();
|
|
187
|
+
return 0;
|
|
188
|
+
case 'path': {
|
|
189
|
+
if (json) {
|
|
190
|
+
console.log(JSON.stringify({ ok: true, skillsDir, repoUrl, skills: names }, null, 2));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
console.log(skillsDir);
|
|
194
|
+
console.error(`\nInstall: neozip skills install`);
|
|
195
|
+
console.error(`Registry: npx skills add ${repoUrl}`);
|
|
196
|
+
}
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
case 'list': {
|
|
200
|
+
if (json) {
|
|
201
|
+
console.log(JSON.stringify({ ok: true, skillsDir, skills: names }, null, 2));
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
console.log(`Bundled skills (${names.length}) in ${skillsDir}:\n`);
|
|
205
|
+
for (const name of names)
|
|
206
|
+
console.log(` ${name}`);
|
|
207
|
+
}
|
|
208
|
+
return 0;
|
|
209
|
+
}
|
|
210
|
+
case 'install': {
|
|
211
|
+
const results = installSkills({ skillsDir, names, target, force });
|
|
212
|
+
if (json) {
|
|
213
|
+
console.log(JSON.stringify({ ok: true, skillsDir, results }, null, 2));
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
console.log(`Installed NeoZip skills from ${skillsDir}\n`);
|
|
217
|
+
for (const row of results) {
|
|
218
|
+
const verb = row.action === 'linked' ? 'Linked' : 'Skipped (already linked)';
|
|
219
|
+
console.log(` ${verb}: ${row.skill} → ${row.dest}`);
|
|
220
|
+
}
|
|
221
|
+
console.log('\nReload your agent session so new skills are discovered.');
|
|
222
|
+
console.log(`Or use: npx skills add ${repoUrl}`);
|
|
223
|
+
}
|
|
224
|
+
return 0;
|
|
225
|
+
}
|
|
226
|
+
case 'pack': {
|
|
227
|
+
const outDir = path.resolve(outputDir ?? 'neozip-skills-zips');
|
|
228
|
+
const zips = packSkills(skillsDir, names, outDir);
|
|
229
|
+
if (json) {
|
|
230
|
+
console.log(JSON.stringify({ ok: true, outputDir: outDir, zips }, null, 2));
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
console.log(`Created ${zips.length} skill ZIP(s) in ${outDir}:\n`);
|
|
234
|
+
for (const zip of zips)
|
|
235
|
+
console.log(` ${zip}`);
|
|
236
|
+
console.log('\nUpload each ZIP in Claude Cowork or claude.ai: Customize > Skills > Upload a skill.');
|
|
237
|
+
}
|
|
238
|
+
return 0;
|
|
239
|
+
}
|
|
240
|
+
default:
|
|
241
|
+
throw new Error(`Unknown subcommand: ${command}. Run: neozip skills --help`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
246
|
+
if (argv.includes('--json')) {
|
|
247
|
+
console.log(JSON.stringify({ ok: false, error: { message } }, null, 2));
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
console.error(`Error: ${message}`);
|
|
251
|
+
console.error('Run: neozip skills --help');
|
|
252
|
+
}
|
|
253
|
+
return 1;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.resolvePackageRoot = resolvePackageRoot;
|
|
37
|
+
exports.resolveBundledSkillsDir = resolveBundledSkillsDir;
|
|
38
|
+
exports.listSkillNames = listSkillNames;
|
|
39
|
+
exports.resolveSkillsAddUrl = resolveSkillsAddUrl;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const PACKAGE_NAME = 'neozip-cli';
|
|
43
|
+
/** Walk upward from startDir to find the installed neozip-cli package root. */
|
|
44
|
+
function resolvePackageRoot(startDir = __dirname) {
|
|
45
|
+
let dir = startDir;
|
|
46
|
+
for (;;) {
|
|
47
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
48
|
+
if (fs.existsSync(pkgPath)) {
|
|
49
|
+
try {
|
|
50
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
51
|
+
if (pkg.name === PACKAGE_NAME)
|
|
52
|
+
return dir;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// keep walking
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const parent = path.dirname(dir);
|
|
59
|
+
if (parent === dir)
|
|
60
|
+
break;
|
|
61
|
+
dir = parent;
|
|
62
|
+
}
|
|
63
|
+
throw new Error(`Could not locate ${PACKAGE_NAME} installation. Reinstall with: npm install -g ${PACKAGE_NAME}`);
|
|
64
|
+
}
|
|
65
|
+
/** Absolute path to the bundled skills/ directory shipped with the package. */
|
|
66
|
+
function resolveBundledSkillsDir() {
|
|
67
|
+
const skillsDir = path.join(resolvePackageRoot(), 'skills');
|
|
68
|
+
if (!fs.existsSync(skillsDir)) {
|
|
69
|
+
throw new Error(`Bundled skills directory not found at ${skillsDir}`);
|
|
70
|
+
}
|
|
71
|
+
return skillsDir;
|
|
72
|
+
}
|
|
73
|
+
/** Skill folder names that contain a SKILL.md entrypoint. */
|
|
74
|
+
function listSkillNames(skillsDir) {
|
|
75
|
+
return fs
|
|
76
|
+
.readdirSync(skillsDir, { withFileTypes: true })
|
|
77
|
+
.filter((entry) => entry.isDirectory())
|
|
78
|
+
.map((entry) => entry.name)
|
|
79
|
+
.filter((name) => fs.existsSync(path.join(skillsDir, name, 'SKILL.md')))
|
|
80
|
+
.sort();
|
|
81
|
+
}
|
|
82
|
+
/** GitHub URL for npx skills add (from package.json repository). */
|
|
83
|
+
function resolveSkillsAddUrl() {
|
|
84
|
+
try {
|
|
85
|
+
const pkgPath = path.join(resolvePackageRoot(), 'package.json');
|
|
86
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
87
|
+
const raw = typeof pkg.repository === 'string'
|
|
88
|
+
? pkg.repository
|
|
89
|
+
: pkg.repository?.url ?? '';
|
|
90
|
+
const normalized = raw.replace(/^git\+/, '').replace(/\.git$/, '');
|
|
91
|
+
if (normalized.startsWith('http'))
|
|
92
|
+
return normalized;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// fall through
|
|
96
|
+
}
|
|
97
|
+
return 'https://github.com/NeoWareInc/neozip-cli';
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=locate.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maskEmail = maskEmail;
|
|
4
|
+
exports.maskPublicKey = maskPublicKey;
|
|
5
|
+
const recipient_lookup_1 = require("../archive/recipient-lookup");
|
|
6
|
+
function maskEmail(email) {
|
|
7
|
+
const normalized = email.trim();
|
|
8
|
+
const at = normalized.indexOf("@");
|
|
9
|
+
if (at <= 0)
|
|
10
|
+
return "***";
|
|
11
|
+
const local = normalized.slice(0, at);
|
|
12
|
+
const domain = normalized.slice(at);
|
|
13
|
+
if (local.length <= 2)
|
|
14
|
+
return `${local[0] ?? ""}***${domain}`;
|
|
15
|
+
return `${local.slice(0, 2)}***${domain}`;
|
|
16
|
+
}
|
|
17
|
+
/** Short fingerprint for X25519 SPKI (base64) or 64-char raw hex. */
|
|
18
|
+
function maskPublicKey(spkiOrHex) {
|
|
19
|
+
const trimmed = spkiOrHex.trim();
|
|
20
|
+
let rawHex;
|
|
21
|
+
try {
|
|
22
|
+
if (/^[0-9a-fA-F]{64}$/.test(trimmed.replace(/^0x/i, ""))) {
|
|
23
|
+
rawHex = trimmed.replace(/^0x/i, "").toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
rawHex = (0, recipient_lookup_1.spkiBase64ToRawHex)(trimmed);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return "invalid";
|
|
31
|
+
}
|
|
32
|
+
return `${rawHex.slice(0, 8)}…`;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=mask.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTokenServiceFetchError = formatTokenServiceFetchError;
|
|
4
|
+
function fetchCauseCode(err) {
|
|
5
|
+
if (err == null || typeof err !== "object")
|
|
6
|
+
return null;
|
|
7
|
+
const cause = err.cause;
|
|
8
|
+
if (cause == null || typeof cause !== "object")
|
|
9
|
+
return null;
|
|
10
|
+
const code = cause.code;
|
|
11
|
+
return typeof code === "string" ? code : null;
|
|
12
|
+
}
|
|
13
|
+
/** User-facing message when Token Service HTTP calls fail (e.g. local server not running). */
|
|
14
|
+
function formatTokenServiceFetchError(baseUrl, err) {
|
|
15
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
16
|
+
const causeCode = fetchCauseCode(err);
|
|
17
|
+
if (message === "fetch failed" ||
|
|
18
|
+
causeCode === "ECONNREFUSED" ||
|
|
19
|
+
causeCode === "ENOTFOUND" ||
|
|
20
|
+
causeCode === "ECONNRESET" ||
|
|
21
|
+
causeCode === "EHOSTUNREACH") {
|
|
22
|
+
return `Token Service unreachable at ${baseUrl}. Is it running?`;
|
|
23
|
+
}
|
|
24
|
+
return `Token Service request failed (${baseUrl}): ${message}`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=token-service-fetch.js.map
|
package/env.example
CHANGED
|
@@ -1,111 +1,44 @@
|
|
|
1
1
|
# NeoZip CLI Environment Configuration
|
|
2
|
-
# ⚠️ DEPRECATED: This method is still supported but wallet.json is now preferred
|
|
3
|
-
#
|
|
4
|
-
# For new setups, use the interactive configuration wizard:
|
|
5
|
-
# $ neozip init
|
|
6
2
|
#
|
|
7
|
-
#
|
|
3
|
+
# Wallet and Token Service identity: use `neozip connect` (~/.neozip/connection/)
|
|
4
|
+
# See dev_doc/CONNECTION_CLI_PREFS.md for on-chain preference fields.
|
|
8
5
|
|
|
9
6
|
# =============================================================================
|
|
10
|
-
#
|
|
7
|
+
# OPTIONAL: Network override (session)
|
|
11
8
|
# =============================================================================
|
|
12
|
-
|
|
13
|
-
# Your wallet private key (64-character hex string starting with 0x)
|
|
14
|
-
# This is required for blockchain operations like token minting and verification
|
|
15
|
-
# Get testnet ETH from: https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet
|
|
16
|
-
#
|
|
17
|
-
# ⚠️ DEPRECATED: Use 'neozip init' or 'neozip config set wallet.privateKey 0x...' instead
|
|
18
|
-
NEOZIP_WALLET_PASSKEY=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
|
|
19
|
-
|
|
20
|
-
# =============================================================================
|
|
21
|
-
# OPTIONAL: Network Configuration
|
|
22
|
-
# =============================================================================
|
|
23
|
-
|
|
24
|
-
# Blockchain network to use (default: base-sepolia)
|
|
25
|
-
#
|
|
26
|
-
# Supported network names:
|
|
27
|
-
# - base-sepolia (Base Sepolia Testnet, Chain ID: 84532) - RECOMMENDED for testing
|
|
28
|
-
# - base-mainnet (Base Mainnet, Chain ID: 8453)
|
|
29
|
-
# - arbitrum-sepolia (Arbitrum Sepolia Testnet, Chain ID: 421614)
|
|
30
|
-
# - arbitrum-one (Arbitrum One Mainnet, Chain ID: 42161)
|
|
31
|
-
# - sepolia-testnet (Ethereum Sepolia Testnet, Chain ID: 11155111) - WARNING: Network instability issues
|
|
32
9
|
#
|
|
33
|
-
#
|
|
10
|
+
# Default network is stored on the active connection (public.json).
|
|
11
|
+
# NEOZIP_NETWORK overrides for this process only.
|
|
12
|
+
#
|
|
34
13
|
# NEOZIP_NETWORK=base-sepolia
|
|
35
14
|
|
|
36
15
|
# =============================================================================
|
|
37
|
-
# OPTIONAL: RPC
|
|
16
|
+
# OPTIONAL: RPC overrides (session)
|
|
38
17
|
# =============================================================================
|
|
39
|
-
|
|
40
|
-
# Custom RPC endpoint for Base Sepolia testnet (optional)
|
|
41
|
-
# Default: https://sepolia.base.org
|
|
42
18
|
# NEOZIP_BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
|
|
43
|
-
|
|
44
|
-
# Custom RPC endpoint for Base Mainnet (optional)
|
|
45
|
-
# Default: https://mainnet.base.org
|
|
46
19
|
# NEOZIP_BASE_MAINNET_RPC_URL=https://mainnet.base.org
|
|
47
20
|
|
|
48
|
-
# Note: RPC configuration for Arbitrum and Ethereum networks should be configured via:
|
|
49
|
-
# - Interactive wizard: neozip init
|
|
50
|
-
# - Config command: neozip config
|
|
51
|
-
# - wallet.json file: ~/.neozip/wallet.json
|
|
52
|
-
#
|
|
53
|
-
# Default RPC endpoints for other networks:
|
|
54
|
-
# - Arbitrum Sepolia: https://sepolia-rollup.arbitrum.io/rpc
|
|
55
|
-
# - Arbitrum One: https://arb1.arbitrum.io/rpc
|
|
56
|
-
# - Ethereum Sepolia: https://rpc.sepolia.ethpandaops.io
|
|
57
|
-
|
|
58
21
|
# =============================================================================
|
|
59
|
-
#
|
|
22
|
+
# Connection store
|
|
60
23
|
# =============================================================================
|
|
61
|
-
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
# NEOZIP_TIMESTAMP_EMAIL=your@email.com
|
|
24
|
+
#
|
|
25
|
+
# neozip connect — account, wallet, Token Service credentials
|
|
26
|
+
# Store: ~/.neozip/connection/
|
|
27
|
+
# NEOZIP_CONNECTION_DIR=/custom/path/to/connection
|
|
28
|
+
# NEOZIP_UNLOCK_PASSPHRASE=your-passphrase
|
|
67
29
|
|
|
68
30
|
# =============================================================================
|
|
69
|
-
# OPTIONAL: Debug
|
|
31
|
+
# OPTIONAL: Debug / gas (session overrides)
|
|
70
32
|
# =============================================================================
|
|
71
|
-
|
|
72
|
-
# Enable verbose logging (true/false)
|
|
73
33
|
# NEOZIP_VERBOSE=false
|
|
74
|
-
|
|
75
|
-
# Enable debug mode for blockchain operations (true/false)
|
|
76
34
|
# NEOZIP_DEBUG=false
|
|
77
|
-
|
|
78
|
-
# =============================================================================
|
|
79
|
-
# OPTIONAL: Gas Configuration
|
|
80
|
-
# =============================================================================
|
|
81
|
-
|
|
82
|
-
# Gas price multiplier (default: 1.0)
|
|
83
35
|
# NEOZIP_GAS_MULTIPLIER=1.0
|
|
84
|
-
|
|
85
|
-
# Maximum gas price in gwei (default: 100)
|
|
86
36
|
# NEOZIP_MAX_GAS_PRICE=100
|
|
87
37
|
|
|
88
38
|
# =============================================================================
|
|
89
|
-
# USAGE
|
|
39
|
+
# USAGE
|
|
90
40
|
# =============================================================================
|
|
91
41
|
#
|
|
92
|
-
# 1.
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
# 2. Set your wallet private key:
|
|
96
|
-
# export NEOZIP_WALLET_PASSKEY="0x..."
|
|
97
|
-
#
|
|
98
|
-
# 3. For testnet, get free ETH from:
|
|
99
|
-
# https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet
|
|
100
|
-
#
|
|
101
|
-
# 4. Install dependencies and build:
|
|
102
|
-
# npm install
|
|
103
|
-
# npm run build
|
|
104
|
-
#
|
|
105
|
-
# 5. Run neozip commands:
|
|
106
|
-
# neozip zip output/test.nzip file1.txt file2.txt
|
|
107
|
-
# neozip list output/test.nzip
|
|
108
|
-
# neozip unzip output/test.nzip
|
|
109
|
-
# neozip config
|
|
110
|
-
#
|
|
111
|
-
# =============================================================================
|
|
42
|
+
# 1. neozip connect
|
|
43
|
+
# 2. neozip connect settings # default network, RPC, gas
|
|
44
|
+
# 3. neozip -b archive.nzip files/
|