claudemesh-cli 1.22.1 → 1.23.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/dist/entrypoints/cli.js
CHANGED
|
@@ -88,7 +88,7 @@ __export(exports_urls, {
|
|
|
88
88
|
VERSION: () => VERSION,
|
|
89
89
|
URLS: () => URLS
|
|
90
90
|
});
|
|
91
|
-
var URLS, VERSION = "1.
|
|
91
|
+
var URLS, VERSION = "1.23.0", env;
|
|
92
92
|
var init_urls = __esm(() => {
|
|
93
93
|
URLS = {
|
|
94
94
|
BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
|
|
@@ -962,6 +962,13 @@ var ready = false;
|
|
|
962
962
|
var init_keypair = () => {};
|
|
963
963
|
|
|
964
964
|
// src/services/crypto/file-crypto.ts
|
|
965
|
+
var exports_file_crypto = {};
|
|
966
|
+
__export(exports_file_crypto, {
|
|
967
|
+
sealKeyForPeer: () => sealKeyForPeer,
|
|
968
|
+
openSealedKey: () => openSealedKey,
|
|
969
|
+
encryptFile: () => encryptFile,
|
|
970
|
+
decryptFile: () => decryptFile
|
|
971
|
+
});
|
|
965
972
|
async function encryptFile(plaintext) {
|
|
966
973
|
const s = await ensureSodium();
|
|
967
974
|
const key = s.randombytes_buf(s.crypto_secretbox_KEYBYTES);
|
|
@@ -12737,11 +12744,14 @@ var exports_platform_actions = {};
|
|
|
12737
12744
|
__export(exports_platform_actions, {
|
|
12738
12745
|
runWebhookList: () => runWebhookList,
|
|
12739
12746
|
runWebhookDelete: () => runWebhookDelete,
|
|
12747
|
+
runWebhookCreate: () => runWebhookCreate,
|
|
12740
12748
|
runWatchList: () => runWatchList,
|
|
12749
|
+
runWatchAdd: () => runWatchAdd,
|
|
12741
12750
|
runVectorStore: () => runVectorStore,
|
|
12742
12751
|
runVectorSearch: () => runVectorSearch,
|
|
12743
12752
|
runVectorDelete: () => runVectorDelete,
|
|
12744
12753
|
runVectorCollections: () => runVectorCollections,
|
|
12754
|
+
runVaultSet: () => runVaultSet,
|
|
12745
12755
|
runVaultList: () => runVaultList,
|
|
12746
12756
|
runVaultDelete: () => runVaultDelete,
|
|
12747
12757
|
runUnwatch: () => runUnwatch,
|
|
@@ -13188,6 +13198,40 @@ async function runVaultDelete(key, opts) {
|
|
|
13188
13198
|
return ok ? EXIT.SUCCESS : EXIT.NOT_FOUND;
|
|
13189
13199
|
});
|
|
13190
13200
|
}
|
|
13201
|
+
async function runVaultSet(key, value, opts) {
|
|
13202
|
+
if (!key || value == null) {
|
|
13203
|
+
render.err("Usage: claudemesh vault set <key> <value> [--type env|file] [--mount /path] [--description ...]");
|
|
13204
|
+
return EXIT.INVALID_ARGS;
|
|
13205
|
+
}
|
|
13206
|
+
const { encryptFile: encryptFile2, sealKeyForPeer: sealKeyForPeer2 } = await Promise.resolve().then(() => (init_file_crypto(), exports_file_crypto));
|
|
13207
|
+
const { getMeshConfig: getMeshConfig2 } = await Promise.resolve().then(() => (init_facade(), exports_facade));
|
|
13208
|
+
const { readConfig: readConfig2 } = await Promise.resolve().then(() => (init_facade(), exports_facade));
|
|
13209
|
+
const config = readConfig2();
|
|
13210
|
+
const slug = opts.mesh ?? (config.meshes.length === 1 ? config.meshes[0].slug : null);
|
|
13211
|
+
if (!slug) {
|
|
13212
|
+
render.err("multiple meshes joined; pass --mesh <slug>");
|
|
13213
|
+
return EXIT.INVALID_ARGS;
|
|
13214
|
+
}
|
|
13215
|
+
const mesh = getMeshConfig2(slug);
|
|
13216
|
+
if (!mesh) {
|
|
13217
|
+
render.err(`not joined to mesh "${slug}"`);
|
|
13218
|
+
return EXIT.NOT_FOUND;
|
|
13219
|
+
}
|
|
13220
|
+
const plaintext = new TextEncoder().encode(value);
|
|
13221
|
+
const enc = await encryptFile2(plaintext);
|
|
13222
|
+
const ciphertextB64 = Buffer.from(enc.ciphertext).toString("base64");
|
|
13223
|
+
const sealed = await sealKeyForPeer2(enc.key, mesh.pubkey);
|
|
13224
|
+
return await withMesh({ meshSlug: slug }, async (client) => {
|
|
13225
|
+
const ok = await client.vaultSet(key, ciphertextB64, enc.nonce, sealed, opts.entryType ?? "env", opts.mountPath, opts.description);
|
|
13226
|
+
if (opts.json)
|
|
13227
|
+
emitJson({ key, stored: ok });
|
|
13228
|
+
else if (ok)
|
|
13229
|
+
render.ok(`vault[${bold(key)}] stored`, dim(`(${ciphertextB64.length}b)`));
|
|
13230
|
+
else
|
|
13231
|
+
render.err(`vault set failed for "${key}"`);
|
|
13232
|
+
return ok ? EXIT.SUCCESS : EXIT.IO_ERROR;
|
|
13233
|
+
});
|
|
13234
|
+
}
|
|
13191
13235
|
async function runWatchList(opts) {
|
|
13192
13236
|
return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
|
|
13193
13237
|
const watches = await client.watchList();
|
|
@@ -13210,6 +13254,34 @@ async function runWatchList(opts) {
|
|
|
13210
13254
|
return EXIT.SUCCESS;
|
|
13211
13255
|
});
|
|
13212
13256
|
}
|
|
13257
|
+
async function runWatchAdd(url, opts) {
|
|
13258
|
+
if (!url) {
|
|
13259
|
+
render.err("Usage: claudemesh watch add <url> [--label ...] [--interval <sec>] [--extract <css>] [--notify-on changed|always]");
|
|
13260
|
+
return EXIT.INVALID_ARGS;
|
|
13261
|
+
}
|
|
13262
|
+
return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
|
|
13263
|
+
const result = await client.watch(url, {
|
|
13264
|
+
label: opts.label,
|
|
13265
|
+
interval: opts.interval,
|
|
13266
|
+
mode: opts.mode,
|
|
13267
|
+
extract: opts.extract,
|
|
13268
|
+
notify_on: opts.notifyOn
|
|
13269
|
+
});
|
|
13270
|
+
if (result?.error) {
|
|
13271
|
+
if (opts.json)
|
|
13272
|
+
emitJson({ ok: false, error: result.error });
|
|
13273
|
+
else
|
|
13274
|
+
render.err(`watch add failed: ${result.error}`);
|
|
13275
|
+
return EXIT.IO_ERROR;
|
|
13276
|
+
}
|
|
13277
|
+
const id = String(result?.id ?? result?.watch_id ?? "?");
|
|
13278
|
+
if (opts.json)
|
|
13279
|
+
emitJson({ ok: true, id, url, ...opts.label ? { label: opts.label } : {} });
|
|
13280
|
+
else
|
|
13281
|
+
render.ok(`watching ${clay(url)}`, dim(id.slice(0, 8)));
|
|
13282
|
+
return EXIT.SUCCESS;
|
|
13283
|
+
});
|
|
13284
|
+
}
|
|
13213
13285
|
async function runUnwatch(id, opts) {
|
|
13214
13286
|
if (!id) {
|
|
13215
13287
|
render.err("Usage: claudemesh watch remove <id>");
|
|
@@ -13246,6 +13318,32 @@ async function runWebhookList(opts) {
|
|
|
13246
13318
|
return EXIT.SUCCESS;
|
|
13247
13319
|
});
|
|
13248
13320
|
}
|
|
13321
|
+
async function runWebhookCreate(name, opts) {
|
|
13322
|
+
if (!name) {
|
|
13323
|
+
render.err("Usage: claudemesh webhook create <name>");
|
|
13324
|
+
return EXIT.INVALID_ARGS;
|
|
13325
|
+
}
|
|
13326
|
+
return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
|
|
13327
|
+
const created = await client.createWebhook(name);
|
|
13328
|
+
if (!created) {
|
|
13329
|
+
if (opts.json)
|
|
13330
|
+
emitJson({ ok: false, error: "create failed (timeout or duplicate)" });
|
|
13331
|
+
else
|
|
13332
|
+
render.err(`webhook create "${name}" failed`);
|
|
13333
|
+
return EXIT.IO_ERROR;
|
|
13334
|
+
}
|
|
13335
|
+
if (opts.json)
|
|
13336
|
+
emitJson({ ok: true, ...created });
|
|
13337
|
+
else {
|
|
13338
|
+
render.ok(`created webhook ${bold(created.name)}`);
|
|
13339
|
+
process.stdout.write(` url: ${clay(created.url)}
|
|
13340
|
+
`);
|
|
13341
|
+
process.stdout.write(` secret: ${dim(created.secret)} ${dim("(shown once)")}
|
|
13342
|
+
`);
|
|
13343
|
+
}
|
|
13344
|
+
return EXIT.SUCCESS;
|
|
13345
|
+
});
|
|
13346
|
+
}
|
|
13249
13347
|
async function runWebhookDelete(name, opts) {
|
|
13250
13348
|
if (!name) {
|
|
13251
13349
|
render.err("Usage: claudemesh webhook delete <name>");
|
|
@@ -17484,9 +17582,9 @@ Platform
|
|
|
17484
17582
|
claudemesh stream create|publish|list pub/sub event bus
|
|
17485
17583
|
claudemesh sql query|execute|schema per-mesh SQL
|
|
17486
17584
|
claudemesh skill list|get|remove mesh-published skills
|
|
17487
|
-
claudemesh vault list|delete
|
|
17488
|
-
claudemesh watch list|remove
|
|
17489
|
-
claudemesh webhook list|delete
|
|
17585
|
+
claudemesh vault set|list|delete encrypted secrets (set: --type env|file --mount /p)
|
|
17586
|
+
claudemesh watch add|list|remove URL change watchers (add: --label --interval --extract)
|
|
17587
|
+
claudemesh webhook create|list|delete outbound HTTP triggers
|
|
17490
17588
|
claudemesh file share <path> [--to peer] upload (or local-host fast path if --to matches)
|
|
17491
17589
|
claudemesh file get <id> [--out path] download by id
|
|
17492
17590
|
claudemesh file list|status|delete shared mesh files
|
|
@@ -18150,8 +18248,16 @@ async function main() {
|
|
|
18150
18248
|
} else if (sub === "delete") {
|
|
18151
18249
|
const { runVaultDelete: runVaultDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18152
18250
|
process.exit(await runVaultDelete2(positionals[1] ?? "", f));
|
|
18251
|
+
} else if (sub === "set") {
|
|
18252
|
+
const { runVaultSet: runVaultSet2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18253
|
+
process.exit(await runVaultSet2(positionals[1] ?? "", positionals[2] ?? "", {
|
|
18254
|
+
...f,
|
|
18255
|
+
entryType: flags.type,
|
|
18256
|
+
mountPath: flags.mount,
|
|
18257
|
+
description: flags.description
|
|
18258
|
+
}));
|
|
18153
18259
|
} else {
|
|
18154
|
-
console.error("Usage: claudemesh vault <list|delete>
|
|
18260
|
+
console.error("Usage: claudemesh vault <list|set|delete>");
|
|
18155
18261
|
process.exit(EXIT.INVALID_ARGS);
|
|
18156
18262
|
}
|
|
18157
18263
|
break;
|
|
@@ -18165,8 +18271,18 @@ async function main() {
|
|
|
18165
18271
|
} else if (sub === "remove") {
|
|
18166
18272
|
const { runUnwatch: runUnwatch2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18167
18273
|
process.exit(await runUnwatch2(positionals[1] ?? "", f));
|
|
18274
|
+
} else if (sub === "add") {
|
|
18275
|
+
const { runWatchAdd: runWatchAdd2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18276
|
+
process.exit(await runWatchAdd2(positionals[1] ?? "", {
|
|
18277
|
+
...f,
|
|
18278
|
+
label: flags.label,
|
|
18279
|
+
interval: flags.interval ? Number(flags.interval) : undefined,
|
|
18280
|
+
mode: flags.mode,
|
|
18281
|
+
extract: flags.extract,
|
|
18282
|
+
notifyOn: flags["notify-on"]
|
|
18283
|
+
}));
|
|
18168
18284
|
} else {
|
|
18169
|
-
console.error("Usage: claudemesh watch <list|remove>");
|
|
18285
|
+
console.error("Usage: claudemesh watch <list|add|remove>");
|
|
18170
18286
|
process.exit(EXIT.INVALID_ARGS);
|
|
18171
18287
|
}
|
|
18172
18288
|
break;
|
|
@@ -18180,8 +18296,11 @@ async function main() {
|
|
|
18180
18296
|
} else if (sub === "delete") {
|
|
18181
18297
|
const { runWebhookDelete: runWebhookDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18182
18298
|
process.exit(await runWebhookDelete2(positionals[1] ?? "", f));
|
|
18299
|
+
} else if (sub === "create") {
|
|
18300
|
+
const { runWebhookCreate: runWebhookCreate2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
|
|
18301
|
+
process.exit(await runWebhookCreate2(positionals[1] ?? "", f));
|
|
18183
18302
|
} else {
|
|
18184
|
-
console.error("Usage: claudemesh webhook <list|delete>");
|
|
18303
|
+
console.error("Usage: claudemesh webhook <list|create|delete>");
|
|
18185
18304
|
process.exit(EXIT.INVALID_ARGS);
|
|
18186
18305
|
}
|
|
18187
18306
|
break;
|
|
@@ -18493,4 +18612,4 @@ main().catch((err) => {
|
|
|
18493
18612
|
process.exit(EXIT.INTERNAL_ERROR);
|
|
18494
18613
|
});
|
|
18495
18614
|
|
|
18496
|
-
//# debugId=
|
|
18615
|
+
//# debugId=DF34DB4C8E61E91564756E2164756E21
|