claudemesh-cli 1.2.1 → 1.3.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.
@@ -88,7 +88,7 @@ __export(exports_urls, {
88
88
  VERSION: () => VERSION,
89
89
  URLS: () => URLS
90
90
  });
91
- var URLS, VERSION = "1.2.1", env;
91
+ var URLS, VERSION = "1.3.0", env;
92
92
  var init_urls = __esm(() => {
93
93
  URLS = {
94
94
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -9638,6 +9638,766 @@ var init_grants = __esm(() => {
9638
9638
  GRANT_FILE = join11(homedir10(), ".claudemesh", "grants.json");
9639
9639
  });
9640
9640
 
9641
+ // src/commands/platform-actions.ts
9642
+ var exports_platform_actions = {};
9643
+ __export(exports_platform_actions, {
9644
+ runWebhookList: () => runWebhookList,
9645
+ runWebhookDelete: () => runWebhookDelete,
9646
+ runWatchList: () => runWatchList,
9647
+ runVectorStore: () => runVectorStore,
9648
+ runVectorSearch: () => runVectorSearch,
9649
+ runVectorDelete: () => runVectorDelete,
9650
+ runVectorCollections: () => runVectorCollections,
9651
+ runVaultList: () => runVaultList,
9652
+ runVaultDelete: () => runVaultDelete,
9653
+ runUnwatch: () => runUnwatch,
9654
+ runTaskList: () => runTaskList,
9655
+ runTaskCreate: () => runTaskCreate,
9656
+ runStreamPublish: () => runStreamPublish,
9657
+ runStreamList: () => runStreamList,
9658
+ runStreamCreate: () => runStreamCreate,
9659
+ runSqlSchema: () => runSqlSchema,
9660
+ runSqlQuery: () => runSqlQuery,
9661
+ runSqlExecute: () => runSqlExecute,
9662
+ runSkillRemove: () => runSkillRemove,
9663
+ runSkillList: () => runSkillList,
9664
+ runSkillGet: () => runSkillGet,
9665
+ runMeshMcpList: () => runMeshMcpList,
9666
+ runMeshMcpCatalog: () => runMeshMcpCatalog,
9667
+ runMeshMcpCall: () => runMeshMcpCall,
9668
+ runGraphQuery: () => runGraphQuery,
9669
+ runGraphExecute: () => runGraphExecute,
9670
+ runFileStatus: () => runFileStatus,
9671
+ runFileList: () => runFileList,
9672
+ runFileDelete: () => runFileDelete,
9673
+ runContextShare: () => runContextShare,
9674
+ runContextList: () => runContextList,
9675
+ runContextGet: () => runContextGet,
9676
+ runClockSet: () => runClockSet,
9677
+ runClockResume: () => runClockResume,
9678
+ runClockPause: () => runClockPause
9679
+ });
9680
+ function emitJson(data) {
9681
+ console.log(JSON.stringify(data, null, 2));
9682
+ }
9683
+ async function runVectorStore(collection, text, opts) {
9684
+ if (!collection || !text) {
9685
+ render.err("Usage: claudemesh vector store <collection> <text> [--metadata <json>]");
9686
+ return EXIT.INVALID_ARGS;
9687
+ }
9688
+ let metadata;
9689
+ if (opts.metadata) {
9690
+ try {
9691
+ metadata = JSON.parse(opts.metadata);
9692
+ } catch {
9693
+ render.err("--metadata must be JSON");
9694
+ return EXIT.INVALID_ARGS;
9695
+ }
9696
+ }
9697
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9698
+ const id = await client.vectorStore(collection, text, metadata);
9699
+ if (!id) {
9700
+ render.err("store failed");
9701
+ return EXIT.INTERNAL_ERROR;
9702
+ }
9703
+ if (opts.json)
9704
+ emitJson({ id, collection });
9705
+ else
9706
+ render.ok(`stored in ${clay(collection)}`, dim(id));
9707
+ return EXIT.SUCCESS;
9708
+ });
9709
+ }
9710
+ async function runVectorSearch(collection, query, opts) {
9711
+ if (!collection || !query) {
9712
+ render.err("Usage: claudemesh vector search <collection> <query> [--limit N]");
9713
+ return EXIT.INVALID_ARGS;
9714
+ }
9715
+ const limit = opts.limit ? parseInt(opts.limit, 10) : undefined;
9716
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9717
+ const hits = await client.vectorSearch(collection, query, limit);
9718
+ if (opts.json) {
9719
+ emitJson(hits);
9720
+ return EXIT.SUCCESS;
9721
+ }
9722
+ if (hits.length === 0) {
9723
+ render.info(dim("(no matches)"));
9724
+ return EXIT.SUCCESS;
9725
+ }
9726
+ render.section(`${hits.length} match${hits.length === 1 ? "" : "es"} in ${clay(collection)}`);
9727
+ for (const h of hits) {
9728
+ process.stdout.write(` ${bold(h.score.toFixed(3))} ${dim(h.id.slice(0, 8))} ${h.text}
9729
+ `);
9730
+ }
9731
+ return EXIT.SUCCESS;
9732
+ });
9733
+ }
9734
+ async function runVectorDelete(collection, id, opts) {
9735
+ if (!collection || !id) {
9736
+ render.err("Usage: claudemesh vector delete <collection> <id>");
9737
+ return EXIT.INVALID_ARGS;
9738
+ }
9739
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9740
+ await client.vectorDelete(collection, id);
9741
+ if (opts.json)
9742
+ emitJson({ id, deleted: true });
9743
+ else
9744
+ render.ok(`deleted ${dim(id.slice(0, 8))}`);
9745
+ return EXIT.SUCCESS;
9746
+ });
9747
+ }
9748
+ async function runVectorCollections(opts) {
9749
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9750
+ const cols = await client.listCollections();
9751
+ if (opts.json) {
9752
+ emitJson(cols);
9753
+ return EXIT.SUCCESS;
9754
+ }
9755
+ if (cols.length === 0) {
9756
+ render.info(dim("(no collections)"));
9757
+ return EXIT.SUCCESS;
9758
+ }
9759
+ render.section(`vector collections (${cols.length})`);
9760
+ for (const c of cols)
9761
+ process.stdout.write(` ${clay(c)}
9762
+ `);
9763
+ return EXIT.SUCCESS;
9764
+ });
9765
+ }
9766
+ async function runGraphQuery(cypher, opts) {
9767
+ if (!cypher) {
9768
+ render.err('Usage: claudemesh graph query "<cypher>"');
9769
+ return EXIT.INVALID_ARGS;
9770
+ }
9771
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9772
+ const rows = await client.graphQuery(cypher);
9773
+ if (opts.json) {
9774
+ emitJson(rows);
9775
+ return EXIT.SUCCESS;
9776
+ }
9777
+ if (rows.length === 0) {
9778
+ render.info(dim("(no rows)"));
9779
+ return EXIT.SUCCESS;
9780
+ }
9781
+ render.section(`${rows.length} row${rows.length === 1 ? "" : "s"}`);
9782
+ for (const r of rows)
9783
+ process.stdout.write(` ${JSON.stringify(r)}
9784
+ `);
9785
+ return EXIT.SUCCESS;
9786
+ });
9787
+ }
9788
+ async function runGraphExecute(cypher, opts) {
9789
+ if (!cypher) {
9790
+ render.err('Usage: claudemesh graph execute "<cypher>"');
9791
+ return EXIT.INVALID_ARGS;
9792
+ }
9793
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9794
+ const rows = await client.graphExecute(cypher);
9795
+ if (opts.json) {
9796
+ emitJson(rows);
9797
+ return EXIT.SUCCESS;
9798
+ }
9799
+ render.ok("executed", `${rows.length} row${rows.length === 1 ? "" : "s"} affected`);
9800
+ return EXIT.SUCCESS;
9801
+ });
9802
+ }
9803
+ async function runContextShare(summary, opts) {
9804
+ if (!summary) {
9805
+ render.err('Usage: claudemesh context share "<summary>" [--files a,b] [--findings x,y] [--tags t1,t2]');
9806
+ return EXIT.INVALID_ARGS;
9807
+ }
9808
+ const files = opts.files?.split(",").map((s) => s.trim()).filter(Boolean);
9809
+ const findings = opts.findings?.split(",").map((s) => s.trim()).filter(Boolean);
9810
+ const tags = opts.tags?.split(",").map((s) => s.trim()).filter(Boolean);
9811
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9812
+ await client.shareContext(summary, files, findings, tags);
9813
+ if (opts.json)
9814
+ emitJson({ shared: true, summary });
9815
+ else
9816
+ render.ok("context shared");
9817
+ return EXIT.SUCCESS;
9818
+ });
9819
+ }
9820
+ async function runContextGet(query, opts) {
9821
+ if (!query) {
9822
+ render.err('Usage: claudemesh context get "<query>"');
9823
+ return EXIT.INVALID_ARGS;
9824
+ }
9825
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9826
+ const ctxs = await client.getContext(query);
9827
+ if (opts.json) {
9828
+ emitJson(ctxs);
9829
+ return EXIT.SUCCESS;
9830
+ }
9831
+ if (ctxs.length === 0) {
9832
+ render.info(dim("(no matches)"));
9833
+ return EXIT.SUCCESS;
9834
+ }
9835
+ render.section(`${ctxs.length} context${ctxs.length === 1 ? "" : "s"}`);
9836
+ for (const c of ctxs) {
9837
+ process.stdout.write(` ${bold(c.peerName)} ${dim("·")} ${c.updatedAt}
9838
+ `);
9839
+ process.stdout.write(` ${c.summary}
9840
+ `);
9841
+ if (c.tags.length)
9842
+ process.stdout.write(` ${dim("tags: " + c.tags.join(", "))}
9843
+ `);
9844
+ }
9845
+ return EXIT.SUCCESS;
9846
+ });
9847
+ }
9848
+ async function runContextList(opts) {
9849
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9850
+ const ctxs = await client.listContexts();
9851
+ if (opts.json) {
9852
+ emitJson(ctxs);
9853
+ return EXIT.SUCCESS;
9854
+ }
9855
+ if (ctxs.length === 0) {
9856
+ render.info(dim("(no contexts)"));
9857
+ return EXIT.SUCCESS;
9858
+ }
9859
+ render.section(`shared contexts (${ctxs.length})`);
9860
+ for (const c of ctxs) {
9861
+ process.stdout.write(` ${bold(c.peerName)} ${dim("·")} ${c.updatedAt}
9862
+ `);
9863
+ process.stdout.write(` ${c.summary}
9864
+ `);
9865
+ }
9866
+ return EXIT.SUCCESS;
9867
+ });
9868
+ }
9869
+ async function runStreamCreate(name, opts) {
9870
+ if (!name) {
9871
+ render.err("Usage: claudemesh stream create <name>");
9872
+ return EXIT.INVALID_ARGS;
9873
+ }
9874
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9875
+ const id = await client.createStream(name);
9876
+ if (!id) {
9877
+ render.err("create failed");
9878
+ return EXIT.INTERNAL_ERROR;
9879
+ }
9880
+ if (opts.json)
9881
+ emitJson({ id, name });
9882
+ else
9883
+ render.ok(`created ${clay(name)}`, dim(id));
9884
+ return EXIT.SUCCESS;
9885
+ });
9886
+ }
9887
+ async function runStreamPublish(name, dataRaw, opts) {
9888
+ if (!name || dataRaw === undefined) {
9889
+ render.err("Usage: claudemesh stream publish <name> <json-or-text>");
9890
+ return EXIT.INVALID_ARGS;
9891
+ }
9892
+ let data;
9893
+ try {
9894
+ data = JSON.parse(dataRaw);
9895
+ } catch {
9896
+ data = dataRaw;
9897
+ }
9898
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9899
+ await client.publish(name, data);
9900
+ if (opts.json)
9901
+ emitJson({ published: true, name });
9902
+ else
9903
+ render.ok(`published to ${clay(name)}`);
9904
+ return EXIT.SUCCESS;
9905
+ });
9906
+ }
9907
+ async function runStreamList(opts) {
9908
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9909
+ const streams = await client.listStreams();
9910
+ if (opts.json) {
9911
+ emitJson(streams);
9912
+ return EXIT.SUCCESS;
9913
+ }
9914
+ if (streams.length === 0) {
9915
+ render.info(dim("(no streams)"));
9916
+ return EXIT.SUCCESS;
9917
+ }
9918
+ render.section(`streams (${streams.length})`);
9919
+ for (const s of streams) {
9920
+ process.stdout.write(` ${clay(s.name)} ${dim(`· ${s.subscriberCount} subscriber${s.subscriberCount === 1 ? "" : "s"} · by ${s.createdBy}`)}
9921
+ `);
9922
+ }
9923
+ return EXIT.SUCCESS;
9924
+ });
9925
+ }
9926
+ async function runSqlQuery(sql, opts) {
9927
+ if (!sql) {
9928
+ render.err('Usage: claudemesh sql query "<select>"');
9929
+ return EXIT.INVALID_ARGS;
9930
+ }
9931
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9932
+ const result = await client.meshQuery(sql);
9933
+ if (!result) {
9934
+ render.err("query timed out");
9935
+ return EXIT.INTERNAL_ERROR;
9936
+ }
9937
+ if (opts.json) {
9938
+ emitJson(result);
9939
+ return EXIT.SUCCESS;
9940
+ }
9941
+ render.section(`${result.rowCount} row${result.rowCount === 1 ? "" : "s"}`);
9942
+ if (result.columns.length > 0) {
9943
+ process.stdout.write(` ${dim(result.columns.join(" "))}
9944
+ `);
9945
+ for (const row of result.rows) {
9946
+ process.stdout.write(` ${result.columns.map((c) => String(row[c] ?? "")).join(" ")}
9947
+ `);
9948
+ }
9949
+ }
9950
+ return EXIT.SUCCESS;
9951
+ });
9952
+ }
9953
+ async function runSqlExecute(sql, opts) {
9954
+ if (!sql) {
9955
+ render.err('Usage: claudemesh sql execute "<statement>"');
9956
+ return EXIT.INVALID_ARGS;
9957
+ }
9958
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9959
+ await client.meshExecute(sql);
9960
+ if (opts.json)
9961
+ emitJson({ executed: true });
9962
+ else
9963
+ render.ok("executed");
9964
+ return EXIT.SUCCESS;
9965
+ });
9966
+ }
9967
+ async function runSqlSchema(opts) {
9968
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9969
+ const tables = await client.meshSchema();
9970
+ if (opts.json) {
9971
+ emitJson(tables);
9972
+ return EXIT.SUCCESS;
9973
+ }
9974
+ if (tables.length === 0) {
9975
+ render.info(dim("(no tables)"));
9976
+ return EXIT.SUCCESS;
9977
+ }
9978
+ render.section(`mesh tables (${tables.length})`);
9979
+ for (const t of tables) {
9980
+ process.stdout.write(` ${bold(t.name)}
9981
+ `);
9982
+ for (const c of t.columns) {
9983
+ const nullable = c.nullable ? "" : " not null";
9984
+ process.stdout.write(` ${c.name} ${dim(c.type + nullable)}
9985
+ `);
9986
+ }
9987
+ }
9988
+ return EXIT.SUCCESS;
9989
+ });
9990
+ }
9991
+ async function runSkillList(opts) {
9992
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
9993
+ const skills = await client.listSkills(opts.query);
9994
+ if (opts.json) {
9995
+ emitJson(skills);
9996
+ return EXIT.SUCCESS;
9997
+ }
9998
+ if (skills.length === 0) {
9999
+ render.info(dim("(no skills)"));
10000
+ return EXIT.SUCCESS;
10001
+ }
10002
+ render.section(`mesh skills (${skills.length})`);
10003
+ for (const s of skills) {
10004
+ process.stdout.write(` ${bold(s.name)} ${dim("· by " + s.author)}
10005
+ `);
10006
+ process.stdout.write(` ${s.description}
10007
+ `);
10008
+ if (s.tags.length)
10009
+ process.stdout.write(` ${dim("tags: " + s.tags.join(", "))}
10010
+ `);
10011
+ }
10012
+ return EXIT.SUCCESS;
10013
+ });
10014
+ }
10015
+ async function runSkillGet(name, opts) {
10016
+ if (!name) {
10017
+ render.err("Usage: claudemesh skill get <name>");
10018
+ return EXIT.INVALID_ARGS;
10019
+ }
10020
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10021
+ const skill = await client.getSkill(name);
10022
+ if (!skill) {
10023
+ render.err(`skill "${name}" not found`);
10024
+ return EXIT.NOT_FOUND;
10025
+ }
10026
+ if (opts.json) {
10027
+ emitJson(skill);
10028
+ return EXIT.SUCCESS;
10029
+ }
10030
+ render.section(skill.name);
10031
+ render.kv([
10032
+ ["author", skill.author],
10033
+ ["created", skill.createdAt],
10034
+ ["tags", skill.tags.join(", ") || dim("(none)")]
10035
+ ]);
10036
+ render.blank();
10037
+ render.info(skill.description);
10038
+ render.blank();
10039
+ process.stdout.write(skill.instructions + `
10040
+ `);
10041
+ return EXIT.SUCCESS;
10042
+ });
10043
+ }
10044
+ async function runSkillRemove(name, opts) {
10045
+ if (!name) {
10046
+ render.err("Usage: claudemesh skill remove <name>");
10047
+ return EXIT.INVALID_ARGS;
10048
+ }
10049
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10050
+ const removed = await client.removeSkill(name);
10051
+ if (opts.json)
10052
+ emitJson({ name, removed });
10053
+ else if (removed)
10054
+ render.ok(`removed ${bold(name)}`);
10055
+ else
10056
+ render.err(`skill "${name}" not found`);
10057
+ return removed ? EXIT.SUCCESS : EXIT.NOT_FOUND;
10058
+ });
10059
+ }
10060
+ async function runVaultList(opts) {
10061
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10062
+ const entries = await client.vaultList();
10063
+ if (opts.json) {
10064
+ emitJson(entries);
10065
+ return EXIT.SUCCESS;
10066
+ }
10067
+ if (!entries || entries.length === 0) {
10068
+ render.info(dim("(vault empty)"));
10069
+ return EXIT.SUCCESS;
10070
+ }
10071
+ render.section(`vault (${entries.length})`);
10072
+ for (const e of entries) {
10073
+ const k = String(e?.key ?? "?");
10074
+ const t = String(e?.entry_type ?? "");
10075
+ process.stdout.write(` ${bold(k)} ${dim(t)}
10076
+ `);
10077
+ }
10078
+ return EXIT.SUCCESS;
10079
+ });
10080
+ }
10081
+ async function runVaultDelete(key, opts) {
10082
+ if (!key) {
10083
+ render.err("Usage: claudemesh vault delete <key>");
10084
+ return EXIT.INVALID_ARGS;
10085
+ }
10086
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10087
+ const ok = await client.vaultDelete(key);
10088
+ if (opts.json)
10089
+ emitJson({ key, deleted: ok });
10090
+ else if (ok)
10091
+ render.ok(`deleted ${bold(key)}`);
10092
+ else
10093
+ render.err(`vault key "${key}" not found`);
10094
+ return ok ? EXIT.SUCCESS : EXIT.NOT_FOUND;
10095
+ });
10096
+ }
10097
+ async function runWatchList(opts) {
10098
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10099
+ const watches = await client.watchList();
10100
+ if (opts.json) {
10101
+ emitJson(watches);
10102
+ return EXIT.SUCCESS;
10103
+ }
10104
+ if (!watches || watches.length === 0) {
10105
+ render.info(dim("(no watches)"));
10106
+ return EXIT.SUCCESS;
10107
+ }
10108
+ render.section(`url watches (${watches.length})`);
10109
+ for (const w of watches) {
10110
+ const id = String(w.id ?? "?");
10111
+ const url = String(w.url ?? "");
10112
+ const label = w.label ? ` ${dim("(" + w.label + ")")}` : "";
10113
+ process.stdout.write(` ${dim(id.slice(0, 8))} ${clay(url)}${label}
10114
+ `);
10115
+ }
10116
+ return EXIT.SUCCESS;
10117
+ });
10118
+ }
10119
+ async function runUnwatch(id, opts) {
10120
+ if (!id) {
10121
+ render.err("Usage: claudemesh watch remove <id>");
10122
+ return EXIT.INVALID_ARGS;
10123
+ }
10124
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10125
+ const ok = await client.unwatch(id);
10126
+ if (opts.json)
10127
+ emitJson({ id, removed: ok });
10128
+ else if (ok)
10129
+ render.ok(`unwatched ${dim(id.slice(0, 8))}`);
10130
+ else
10131
+ render.err(`watch "${id}" not found`);
10132
+ return ok ? EXIT.SUCCESS : EXIT.NOT_FOUND;
10133
+ });
10134
+ }
10135
+ async function runWebhookList(opts) {
10136
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10137
+ const hooks = await client.listWebhooks();
10138
+ if (opts.json) {
10139
+ emitJson(hooks);
10140
+ return EXIT.SUCCESS;
10141
+ }
10142
+ if (hooks.length === 0) {
10143
+ render.info(dim("(no webhooks)"));
10144
+ return EXIT.SUCCESS;
10145
+ }
10146
+ render.section(`webhooks (${hooks.length})`);
10147
+ for (const h of hooks) {
10148
+ const dot = h.active ? "●" : dim("○");
10149
+ process.stdout.write(` ${dot} ${bold(h.name)} ${dim("· " + h.url)}
10150
+ `);
10151
+ }
10152
+ return EXIT.SUCCESS;
10153
+ });
10154
+ }
10155
+ async function runWebhookDelete(name, opts) {
10156
+ if (!name) {
10157
+ render.err("Usage: claudemesh webhook delete <name>");
10158
+ return EXIT.INVALID_ARGS;
10159
+ }
10160
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10161
+ const ok = await client.deleteWebhook(name);
10162
+ if (opts.json)
10163
+ emitJson({ name, deleted: ok });
10164
+ else if (ok)
10165
+ render.ok(`deleted ${bold(name)}`);
10166
+ else
10167
+ render.err(`webhook "${name}" not found`);
10168
+ return ok ? EXIT.SUCCESS : EXIT.NOT_FOUND;
10169
+ });
10170
+ }
10171
+ async function runTaskList(opts) {
10172
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10173
+ const tasks = await client.listTasks(opts.status, opts.assignee);
10174
+ if (opts.json) {
10175
+ emitJson(tasks);
10176
+ return EXIT.SUCCESS;
10177
+ }
10178
+ if (tasks.length === 0) {
10179
+ render.info(dim("(no tasks)"));
10180
+ return EXIT.SUCCESS;
10181
+ }
10182
+ render.section(`tasks (${tasks.length})`);
10183
+ for (const t of tasks) {
10184
+ const dot = t.status === "done" ? "●" : t.status === "claimed" ? clay("●") : dim("○");
10185
+ const assignee = t.assignee ? dim(` → ${t.assignee}`) : "";
10186
+ process.stdout.write(` ${dot} ${dim(t.id.slice(0, 8))} ${bold(t.title)}${assignee}
10187
+ `);
10188
+ }
10189
+ return EXIT.SUCCESS;
10190
+ });
10191
+ }
10192
+ async function runTaskCreate(title, opts) {
10193
+ if (!title) {
10194
+ render.err("Usage: claudemesh task create <title> [--assignee X] [--priority P]");
10195
+ return EXIT.INVALID_ARGS;
10196
+ }
10197
+ const tags = opts.tags?.split(",").map((s) => s.trim()).filter(Boolean);
10198
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10199
+ const id = await client.createTask(title, opts.assignee, opts.priority, tags);
10200
+ if (!id) {
10201
+ render.err("create failed");
10202
+ return EXIT.INTERNAL_ERROR;
10203
+ }
10204
+ if (opts.json)
10205
+ emitJson({ id, title });
10206
+ else
10207
+ render.ok(`created ${dim(id.slice(0, 8))}`, title);
10208
+ return EXIT.SUCCESS;
10209
+ });
10210
+ }
10211
+ async function runClockSet(speed, opts) {
10212
+ const s = parseFloat(speed);
10213
+ if (!Number.isFinite(s) || s < 0) {
10214
+ render.err("Usage: claudemesh clock set <speed>", "speed is a non-negative number, e.g. 1.0 = realtime, 0 = paused, 60 = 60× faster");
10215
+ return EXIT.INVALID_ARGS;
10216
+ }
10217
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10218
+ const r = await client.setClock(s);
10219
+ if (!r) {
10220
+ render.err("clock set failed");
10221
+ return EXIT.INTERNAL_ERROR;
10222
+ }
10223
+ if (opts.json)
10224
+ emitJson(r);
10225
+ else
10226
+ render.ok(`clock set to ${bold("x" + r.speed)}`);
10227
+ return EXIT.SUCCESS;
10228
+ });
10229
+ }
10230
+ async function runClockPause(opts) {
10231
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10232
+ const r = await client.pauseClock();
10233
+ if (!r) {
10234
+ render.err("pause failed");
10235
+ return EXIT.INTERNAL_ERROR;
10236
+ }
10237
+ if (opts.json)
10238
+ emitJson(r);
10239
+ else
10240
+ render.ok("clock paused");
10241
+ return EXIT.SUCCESS;
10242
+ });
10243
+ }
10244
+ async function runClockResume(opts) {
10245
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10246
+ const r = await client.resumeClock();
10247
+ if (!r) {
10248
+ render.err("resume failed");
10249
+ return EXIT.INTERNAL_ERROR;
10250
+ }
10251
+ if (opts.json)
10252
+ emitJson(r);
10253
+ else
10254
+ render.ok("clock resumed");
10255
+ return EXIT.SUCCESS;
10256
+ });
10257
+ }
10258
+ async function runMeshMcpList(opts) {
10259
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10260
+ const servers = await client.mcpList();
10261
+ if (opts.json) {
10262
+ emitJson(servers);
10263
+ return EXIT.SUCCESS;
10264
+ }
10265
+ if (servers.length === 0) {
10266
+ render.info(dim("(no mesh-MCP servers)"));
10267
+ return EXIT.SUCCESS;
10268
+ }
10269
+ render.section(`mesh-MCP servers (${servers.length})`);
10270
+ for (const s of servers) {
10271
+ process.stdout.write(` ${bold(s.name)} ${dim("· hosted by " + s.hostedBy)}
10272
+ `);
10273
+ process.stdout.write(` ${s.description}
10274
+ `);
10275
+ if (s.tools.length)
10276
+ process.stdout.write(` ${dim("tools: " + s.tools.map((t) => t.name).join(", "))}
10277
+ `);
10278
+ }
10279
+ return EXIT.SUCCESS;
10280
+ });
10281
+ }
10282
+ async function runMeshMcpCall(serverName, toolName, argsRaw, opts) {
10283
+ if (!serverName || !toolName) {
10284
+ render.err("Usage: claudemesh mesh-mcp call <server> <tool> [json-args]");
10285
+ return EXIT.INVALID_ARGS;
10286
+ }
10287
+ let args = {};
10288
+ if (argsRaw) {
10289
+ try {
10290
+ args = JSON.parse(argsRaw);
10291
+ } catch {
10292
+ render.err("args must be JSON");
10293
+ return EXIT.INVALID_ARGS;
10294
+ }
10295
+ }
10296
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10297
+ const r = await client.mcpCall(serverName, toolName, args);
10298
+ if (r.error) {
10299
+ if (opts.json)
10300
+ emitJson({ ok: false, error: r.error });
10301
+ else
10302
+ render.err(r.error);
10303
+ return EXIT.INTERNAL_ERROR;
10304
+ }
10305
+ if (opts.json)
10306
+ emitJson({ ok: true, result: r.result });
10307
+ else
10308
+ process.stdout.write(JSON.stringify(r.result, null, 2) + `
10309
+ `);
10310
+ return EXIT.SUCCESS;
10311
+ });
10312
+ }
10313
+ async function runMeshMcpCatalog(opts) {
10314
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10315
+ const cat = await client.mcpCatalog();
10316
+ if (opts.json) {
10317
+ emitJson(cat);
10318
+ return EXIT.SUCCESS;
10319
+ }
10320
+ if (!cat || cat.length === 0) {
10321
+ render.info(dim("(catalog empty)"));
10322
+ return EXIT.SUCCESS;
10323
+ }
10324
+ render.section(`mesh-MCP catalog (${cat.length})`);
10325
+ for (const c of cat) {
10326
+ process.stdout.write(` ${bold(String(c.name ?? "?"))} ${dim(String(c.status ?? ""))}
10327
+ `);
10328
+ if (c.description)
10329
+ process.stdout.write(` ${String(c.description)}
10330
+ `);
10331
+ }
10332
+ return EXIT.SUCCESS;
10333
+ });
10334
+ }
10335
+ async function runFileList(opts) {
10336
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10337
+ const files = await client.listFiles(opts.query);
10338
+ if (opts.json) {
10339
+ emitJson(files);
10340
+ return EXIT.SUCCESS;
10341
+ }
10342
+ if (files.length === 0) {
10343
+ render.info(dim("(no files)"));
10344
+ return EXIT.SUCCESS;
10345
+ }
10346
+ render.section(`mesh files (${files.length})`);
10347
+ for (const f of files) {
10348
+ const sizeKb = (f.size / 1024).toFixed(1);
10349
+ process.stdout.write(` ${bold(f.name)} ${dim(`· ${sizeKb} KB · by ${f.uploadedBy}`)}
10350
+ `);
10351
+ if (f.tags.length)
10352
+ process.stdout.write(` ${dim("tags: " + f.tags.join(", "))}
10353
+ `);
10354
+ }
10355
+ return EXIT.SUCCESS;
10356
+ });
10357
+ }
10358
+ async function runFileStatus(id, opts) {
10359
+ if (!id) {
10360
+ render.err("Usage: claudemesh file status <file-id>");
10361
+ return EXIT.INVALID_ARGS;
10362
+ }
10363
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10364
+ const accessors = await client.fileStatus(id);
10365
+ if (opts.json) {
10366
+ emitJson(accessors);
10367
+ return EXIT.SUCCESS;
10368
+ }
10369
+ if (accessors.length === 0) {
10370
+ render.info(dim("(no accesses recorded)"));
10371
+ return EXIT.SUCCESS;
10372
+ }
10373
+ render.section(`accesses for ${id.slice(0, 8)}`);
10374
+ for (const a of accessors)
10375
+ process.stdout.write(` ${bold(a.peerName)} ${dim("· " + a.accessedAt)}
10376
+ `);
10377
+ return EXIT.SUCCESS;
10378
+ });
10379
+ }
10380
+ async function runFileDelete(id, opts) {
10381
+ if (!id) {
10382
+ render.err("Usage: claudemesh file delete <file-id>");
10383
+ return EXIT.INVALID_ARGS;
10384
+ }
10385
+ return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
10386
+ await client.deleteFile(id);
10387
+ if (opts.json)
10388
+ emitJson({ id, deleted: true });
10389
+ else
10390
+ render.ok(`deleted ${dim(id.slice(0, 8))}`);
10391
+ return EXIT.SUCCESS;
10392
+ });
10393
+ }
10394
+ var init_platform_actions = __esm(() => {
10395
+ init_connect();
10396
+ init_render();
10397
+ init_styles();
10398
+ init_exit_codes();
10399
+ });
10400
+
9641
10401
  // src/mcp/tools/definitions.ts
9642
10402
  var TOOLS;
9643
10403
  var init_definitions = __esm(() => {
@@ -13331,9 +14091,25 @@ Identity / presence
13331
14091
  claudemesh group leave @<name> leave a group
13332
14092
 
13333
14093
  Tasks
14094
+ claudemesh task create <title> create a new task [--assignee --priority --tags]
14095
+ claudemesh task list list tasks [--status --assignee]
13334
14096
  claudemesh task claim <id> claim an unclaimed task
13335
14097
  claudemesh task complete <id> mark task done [result]
13336
14098
 
14099
+ Platform
14100
+ claudemesh vector store|search|delete|collections embedding store
14101
+ claudemesh graph query|execute "<cypher>" graph operations
14102
+ claudemesh context share|get|list work-context summaries
14103
+ claudemesh stream create|publish|list pub/sub event bus
14104
+ claudemesh sql query|execute|schema per-mesh SQL
14105
+ claudemesh skill list|get|remove mesh-published skills
14106
+ claudemesh vault list|delete encrypted secrets
14107
+ claudemesh watch list|remove URL change watchers
14108
+ claudemesh webhook list|delete outbound HTTP triggers
14109
+ claudemesh file list|status|delete shared mesh files
14110
+ claudemesh mesh-mcp list|call|catalog deployed mesh-MCP servers
14111
+ claudemesh clock set|pause|resume mesh logical clock
14112
+
13337
14113
  Auth
13338
14114
  claudemesh login sign in (browser or paste token)
13339
14115
  claudemesh register create account + sign in
@@ -13573,11 +14349,6 @@ async function main() {
13573
14349
  process.exit(await runMsgStatus2(positionals[0], { mesh: flags.mesh, json: !!flags.json }));
13574
14350
  break;
13575
14351
  }
13576
- case "clock": {
13577
- const { runClock: runClock2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
13578
- process.exit(await runClock2({ mesh: flags.mesh, json: !!flags.json }));
13579
- break;
13580
- }
13581
14352
  case "stats": {
13582
14353
  const { runStats: runStats2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
13583
14354
  process.exit(await runStats2({ mesh: flags.mesh, json: !!flags.json }));
@@ -13588,20 +14359,6 @@ async function main() {
13588
14359
  process.exit(await runPing2({ mesh: flags.mesh, json: !!flags.json }));
13589
14360
  break;
13590
14361
  }
13591
- case "task": {
13592
- const sub = positionals[0];
13593
- if (sub === "claim") {
13594
- const { runTaskClaim: runTaskClaim2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
13595
- process.exit(await runTaskClaim2(positionals[1], { mesh: flags.mesh, json: !!flags.json }));
13596
- } else if (sub === "complete") {
13597
- const { runTaskComplete: runTaskComplete2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
13598
- process.exit(await runTaskComplete2(positionals[1], positionals.slice(2).join(" ") || undefined, { mesh: flags.mesh, json: !!flags.json }));
13599
- } else {
13600
- console.error("Usage: claudemesh task <claim|complete> <id> [result]");
13601
- process.exit(EXIT.INVALID_ARGS);
13602
- }
13603
- break;
13604
- }
13605
14362
  case "login": {
13606
14363
  const { login: login2 } = await Promise.resolve().then(() => (init_login(), exports_login));
13607
14364
  process.exit(await login2());
@@ -13713,6 +14470,234 @@ async function main() {
13713
14470
  process.exit(await runGrants2({ mesh: flags.mesh, json: !!flags.json }));
13714
14471
  break;
13715
14472
  }
14473
+ case "vector": {
14474
+ const sub = positionals[0];
14475
+ const f = { mesh: flags.mesh, json: !!flags.json };
14476
+ if (sub === "store") {
14477
+ const { runVectorStore: runVectorStore2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14478
+ process.exit(await runVectorStore2(positionals[1] ?? "", positionals.slice(2).join(" "), { ...f, metadata: flags.metadata }));
14479
+ } else if (sub === "search") {
14480
+ const { runVectorSearch: runVectorSearch2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14481
+ process.exit(await runVectorSearch2(positionals[1] ?? "", positionals.slice(2).join(" "), { ...f, limit: flags.limit }));
14482
+ } else if (sub === "delete") {
14483
+ const { runVectorDelete: runVectorDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14484
+ process.exit(await runVectorDelete2(positionals[1] ?? "", positionals[2] ?? "", f));
14485
+ } else if (sub === "collections") {
14486
+ const { runVectorCollections: runVectorCollections2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14487
+ process.exit(await runVectorCollections2(f));
14488
+ } else {
14489
+ console.error("Usage: claudemesh vector <store|search|delete|collections>");
14490
+ process.exit(EXIT.INVALID_ARGS);
14491
+ }
14492
+ break;
14493
+ }
14494
+ case "graph": {
14495
+ const sub = positionals[0];
14496
+ const f = { mesh: flags.mesh, json: !!flags.json };
14497
+ if (sub === "query") {
14498
+ const { runGraphQuery: runGraphQuery2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14499
+ process.exit(await runGraphQuery2(positionals.slice(1).join(" "), f));
14500
+ } else if (sub === "execute") {
14501
+ const { runGraphExecute: runGraphExecute2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14502
+ process.exit(await runGraphExecute2(positionals.slice(1).join(" "), f));
14503
+ } else {
14504
+ console.error('Usage: claudemesh graph <query|execute> "<cypher>"');
14505
+ process.exit(EXIT.INVALID_ARGS);
14506
+ }
14507
+ break;
14508
+ }
14509
+ case "context": {
14510
+ const sub = positionals[0];
14511
+ const f = { mesh: flags.mesh, json: !!flags.json };
14512
+ if (sub === "share") {
14513
+ const { runContextShare: runContextShare2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14514
+ process.exit(await runContextShare2(positionals.slice(1).join(" "), { ...f, files: flags.files, findings: flags.findings, tags: flags.tags }));
14515
+ } else if (sub === "get") {
14516
+ const { runContextGet: runContextGet2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14517
+ process.exit(await runContextGet2(positionals.slice(1).join(" "), f));
14518
+ } else if (sub === "list") {
14519
+ const { runContextList: runContextList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14520
+ process.exit(await runContextList2(f));
14521
+ } else {
14522
+ console.error("Usage: claudemesh context <share|get|list>");
14523
+ process.exit(EXIT.INVALID_ARGS);
14524
+ }
14525
+ break;
14526
+ }
14527
+ case "stream": {
14528
+ const sub = positionals[0];
14529
+ const f = { mesh: flags.mesh, json: !!flags.json };
14530
+ if (sub === "create") {
14531
+ const { runStreamCreate: runStreamCreate2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14532
+ process.exit(await runStreamCreate2(positionals[1] ?? "", f));
14533
+ } else if (sub === "publish") {
14534
+ const { runStreamPublish: runStreamPublish2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14535
+ process.exit(await runStreamPublish2(positionals[1] ?? "", positionals.slice(2).join(" "), f));
14536
+ } else if (sub === "list") {
14537
+ const { runStreamList: runStreamList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14538
+ process.exit(await runStreamList2(f));
14539
+ } else {
14540
+ console.error("Usage: claudemesh stream <create|publish|list>");
14541
+ process.exit(EXIT.INVALID_ARGS);
14542
+ }
14543
+ break;
14544
+ }
14545
+ case "sql": {
14546
+ const sub = positionals[0];
14547
+ const f = { mesh: flags.mesh, json: !!flags.json };
14548
+ if (sub === "query") {
14549
+ const { runSqlQuery: runSqlQuery2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14550
+ process.exit(await runSqlQuery2(positionals.slice(1).join(" "), f));
14551
+ } else if (sub === "execute") {
14552
+ const { runSqlExecute: runSqlExecute2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14553
+ process.exit(await runSqlExecute2(positionals.slice(1).join(" "), f));
14554
+ } else if (sub === "schema") {
14555
+ const { runSqlSchema: runSqlSchema2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14556
+ process.exit(await runSqlSchema2(f));
14557
+ } else {
14558
+ console.error("Usage: claudemesh sql <query|execute|schema>");
14559
+ process.exit(EXIT.INVALID_ARGS);
14560
+ }
14561
+ break;
14562
+ }
14563
+ case "skill": {
14564
+ const sub = positionals[0];
14565
+ const f = { mesh: flags.mesh, json: !!flags.json };
14566
+ if (sub === "list") {
14567
+ const { runSkillList: runSkillList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14568
+ process.exit(await runSkillList2({ ...f, query: positionals[1] }));
14569
+ } else if (sub === "get") {
14570
+ const { runSkillGet: runSkillGet2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14571
+ process.exit(await runSkillGet2(positionals[1] ?? "", f));
14572
+ } else if (sub === "remove") {
14573
+ const { runSkillRemove: runSkillRemove2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14574
+ process.exit(await runSkillRemove2(positionals[1] ?? "", f));
14575
+ } else {
14576
+ console.error("Usage: claudemesh skill <list|get|remove>");
14577
+ process.exit(EXIT.INVALID_ARGS);
14578
+ }
14579
+ break;
14580
+ }
14581
+ case "vault": {
14582
+ const sub = positionals[0];
14583
+ const f = { mesh: flags.mesh, json: !!flags.json };
14584
+ if (sub === "list") {
14585
+ const { runVaultList: runVaultList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14586
+ process.exit(await runVaultList2(f));
14587
+ } else if (sub === "delete") {
14588
+ const { runVaultDelete: runVaultDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14589
+ process.exit(await runVaultDelete2(positionals[1] ?? "", f));
14590
+ } else {
14591
+ console.error("Usage: claudemesh vault <list|delete> (set/get currently via MCP — needs crypto)");
14592
+ process.exit(EXIT.INVALID_ARGS);
14593
+ }
14594
+ break;
14595
+ }
14596
+ case "watch": {
14597
+ const sub = positionals[0];
14598
+ const f = { mesh: flags.mesh, json: !!flags.json };
14599
+ if (sub === "list") {
14600
+ const { runWatchList: runWatchList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14601
+ process.exit(await runWatchList2(f));
14602
+ } else if (sub === "remove") {
14603
+ const { runUnwatch: runUnwatch2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14604
+ process.exit(await runUnwatch2(positionals[1] ?? "", f));
14605
+ } else {
14606
+ console.error("Usage: claudemesh watch <list|remove>");
14607
+ process.exit(EXIT.INVALID_ARGS);
14608
+ }
14609
+ break;
14610
+ }
14611
+ case "webhook": {
14612
+ const sub = positionals[0];
14613
+ const f = { mesh: flags.mesh, json: !!flags.json };
14614
+ if (sub === "list") {
14615
+ const { runWebhookList: runWebhookList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14616
+ process.exit(await runWebhookList2(f));
14617
+ } else if (sub === "delete") {
14618
+ const { runWebhookDelete: runWebhookDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14619
+ process.exit(await runWebhookDelete2(positionals[1] ?? "", f));
14620
+ } else {
14621
+ console.error("Usage: claudemesh webhook <list|delete>");
14622
+ process.exit(EXIT.INVALID_ARGS);
14623
+ }
14624
+ break;
14625
+ }
14626
+ case "file": {
14627
+ const sub = positionals[0];
14628
+ const f = { mesh: flags.mesh, json: !!flags.json };
14629
+ if (sub === "list") {
14630
+ const { runFileList: runFileList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14631
+ process.exit(await runFileList2({ ...f, query: positionals[1] }));
14632
+ } else if (sub === "status") {
14633
+ const { runFileStatus: runFileStatus2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14634
+ process.exit(await runFileStatus2(positionals[1] ?? "", f));
14635
+ } else if (sub === "delete") {
14636
+ const { runFileDelete: runFileDelete2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14637
+ process.exit(await runFileDelete2(positionals[1] ?? "", f));
14638
+ } else {
14639
+ console.error("Usage: claudemesh file <list|status|delete>");
14640
+ process.exit(EXIT.INVALID_ARGS);
14641
+ }
14642
+ break;
14643
+ }
14644
+ case "mesh-mcp": {
14645
+ const sub = positionals[0];
14646
+ const f = { mesh: flags.mesh, json: !!flags.json };
14647
+ if (sub === "list") {
14648
+ const { runMeshMcpList: runMeshMcpList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14649
+ process.exit(await runMeshMcpList2(f));
14650
+ } else if (sub === "call") {
14651
+ const { runMeshMcpCall: runMeshMcpCall2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14652
+ process.exit(await runMeshMcpCall2(positionals[1] ?? "", positionals[2] ?? "", positionals.slice(3).join(" "), f));
14653
+ } else if (sub === "catalog") {
14654
+ const { runMeshMcpCatalog: runMeshMcpCatalog2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14655
+ process.exit(await runMeshMcpCatalog2(f));
14656
+ } else {
14657
+ console.error("Usage: claudemesh mesh-mcp <list|call|catalog>");
14658
+ process.exit(EXIT.INVALID_ARGS);
14659
+ }
14660
+ break;
14661
+ }
14662
+ case "clock": {
14663
+ const sub = positionals[0];
14664
+ const f = { mesh: flags.mesh, json: !!flags.json };
14665
+ if (sub === "set") {
14666
+ const { runClockSet: runClockSet2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14667
+ process.exit(await runClockSet2(positionals[1] ?? "", f));
14668
+ } else if (sub === "pause") {
14669
+ const { runClockPause: runClockPause2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14670
+ process.exit(await runClockPause2(f));
14671
+ } else if (sub === "resume") {
14672
+ const { runClockResume: runClockResume2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14673
+ process.exit(await runClockResume2(f));
14674
+ } else {
14675
+ const { runClock: runClock2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
14676
+ process.exit(await runClock2(f));
14677
+ }
14678
+ break;
14679
+ }
14680
+ case "task": {
14681
+ const sub = positionals[0];
14682
+ const f = { mesh: flags.mesh, json: !!flags.json };
14683
+ if (sub === "claim") {
14684
+ const { runTaskClaim: runTaskClaim2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
14685
+ process.exit(await runTaskClaim2(positionals[1], f));
14686
+ } else if (sub === "complete") {
14687
+ const { runTaskComplete: runTaskComplete2 } = await Promise.resolve().then(() => (init_broker_actions(), exports_broker_actions));
14688
+ process.exit(await runTaskComplete2(positionals[1], positionals.slice(2).join(" ") || undefined, f));
14689
+ } else if (sub === "list") {
14690
+ const { runTaskList: runTaskList2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14691
+ process.exit(await runTaskList2({ ...f, status: flags.status, assignee: flags.assignee }));
14692
+ } else if (sub === "create") {
14693
+ const { runTaskCreate: runTaskCreate2 } = await Promise.resolve().then(() => (init_platform_actions(), exports_platform_actions));
14694
+ process.exit(await runTaskCreate2(positionals.slice(1).join(" "), { ...f, assignee: flags.assignee, priority: flags.priority, tags: flags.tags }));
14695
+ } else {
14696
+ console.error("Usage: claudemesh task <create|list|claim|complete>");
14697
+ process.exit(EXIT.INVALID_ARGS);
14698
+ }
14699
+ break;
14700
+ }
13716
14701
  case "mcp": {
13717
14702
  const { runMcp: runMcp2 } = await Promise.resolve().then(() => (init_mcp(), exports_mcp));
13718
14703
  await runMcp2();
@@ -13740,4 +14725,4 @@ main().catch((err) => {
13740
14725
  process.exit(EXIT.INTERNAL_ERROR);
13741
14726
  });
13742
14727
 
13743
- //# debugId=E126BD4968D2FCDF64756E2164756E21
14728
+ //# debugId=B4AA59318D3B1FB264756E2164756E21