svamp-cli 0.2.318 → 0.2.320

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.
Files changed (28) hide show
  1. package/dist/{adminCommands-_az3eIOd.mjs → adminCommands-JGAVkD1F.mjs} +1 -1
  2. package/dist/{agentCommands-CI_sYhy6.mjs → agentCommands-CoCcX8K1.mjs} +33 -7
  3. package/dist/{auth-7Og-RZ50.mjs → auth-CFGN1ArQ.mjs} +1 -1
  4. package/dist/{cli-D3_a7yin.mjs → cli-C0tO-Dnx.mjs} +89 -85
  5. package/dist/cli.mjs +2 -2
  6. package/dist/{commands-CDL2fp9I.mjs → commands-6KY9uV6s.mjs} +5 -3
  7. package/dist/{commands-C5bo2-Pk.mjs → commands-BHcPDQCC.mjs} +5 -3
  8. package/dist/{commands-B9niiK4o.mjs → commands-BUZUle6g.mjs} +4 -2
  9. package/dist/{commands-eS7P4neN.mjs → commands-BwkoaGfZ.mjs} +5 -3
  10. package/dist/{commands-CwvpWFl7.mjs → commands-CeFjRNKk.mjs} +34 -9
  11. package/dist/{commands-DRYk0mQr.mjs → commands-CubsoWG-.mjs} +1 -1
  12. package/dist/{commands-DaYsK7Af.mjs → commands-DPi7PGxP.mjs} +3 -3
  13. package/dist/{commands-DxJHm9r0.mjs → commands-XN2UtO-W.mjs} +1 -1
  14. package/dist/{fleet-BXfUlehy.mjs → fleet-BKrbG7G-.mjs} +2 -2
  15. package/dist/{headlessCli-CR9fW45i.mjs → headlessCli-nywi2aop.mjs} +2 -2
  16. package/dist/index.mjs +1 -1
  17. package/dist/{notifyCommands-DUr9QjLt.mjs → notifyCommands-BFr80nfh.mjs} +1 -1
  18. package/dist/package-D4zdkORw.mjs +64 -0
  19. package/dist/{pinnedClaudeCode-CnCpensV.mjs → pinnedClaudeCode-BkZfX5pW.mjs} +1 -1
  20. package/dist/{rpc-CaKQ3aCj.mjs → rpc-DVtlZahE.mjs} +1 -1
  21. package/dist/{rpc-DX7_LzZf.mjs → rpc-rpH-yXR7.mjs} +1 -1
  22. package/dist/{run-BuZDMLWU.mjs → run-C22c9FOe.mjs} +1 -1
  23. package/dist/{run-CC2ckdDX.mjs → run-CvwPIrfo.mjs} +271 -91
  24. package/dist/{scheduler-B11LcOId.mjs → scheduler-CYyGe6kn.mjs} +1 -1
  25. package/dist/{serveCommands-DtPbaNdu.mjs → serveCommands-DRMwdDXS.mjs} +55 -8
  26. package/dist/{sideband-C0CGbTIK.mjs → sideband-D1dsa-t0.mjs} +1 -1
  27. package/package.json +3 -3
  28. package/dist/package-CDjOkJPh.mjs +0 -64
@@ -1,4 +1,4 @@
1
- import { c as connectToHypha, K as computeCollectionConfigUpdate, L as SYSTEM_COLLECTION_CONFIG } from './run-CC2ckdDX.mjs';
1
+ import { c as connectToHypha, K as computeCollectionConfigUpdate, L as SYSTEM_COLLECTION_CONFIG } from './run-CvwPIrfo.mjs';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import os from 'node:os';
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync } from '
2
2
  import { join, dirname } from 'node:path';
3
3
  import os from 'node:os';
4
4
  import { requireNotSandboxed } from './sandboxDetect-DNTcbgWD.mjs';
5
- import { e as shortId } from './run-CC2ckdDX.mjs';
5
+ import { e as shortId } from './run-CvwPIrfo.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -96,7 +96,7 @@ async function sessionSetTitle(title) {
96
96
  }
97
97
  async function sessionSetProjectDescription(description) {
98
98
  const dir = process.cwd();
99
- const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-CC2ckdDX.mjs').then(function (n) { return n.as; });
99
+ const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-CvwPIrfo.mjs').then(function (n) { return n.as; });
100
100
  const desc = sanitizeDescription(description, 240);
101
101
  if (!desc) {
102
102
  console.error("Project description is empty.");
@@ -144,7 +144,7 @@ function readSessionLinks(config) {
144
144
  label: String(l.label || ""),
145
145
  url: String(l.url),
146
146
  ...l.icon ? { icon: String(l.icon) } : {},
147
- ...l.service && typeof l.service.name === "string" && (l.service.kind === "tunnel" || l.service.kind === "process") ? { service: { kind: l.service.kind, name: String(l.service.name) } } : {}
147
+ ...l.service && typeof l.service.name === "string" && (l.service.kind === "tunnel" || l.service.kind === "process" || l.service.kind === "serve") ? { service: { kind: l.service.kind, name: String(l.service.name) } } : {}
148
148
  }));
149
149
  }
150
150
  if (config.session_link && typeof config.session_link.url === "string") {
@@ -212,6 +212,24 @@ function autoAddSessionLink(url, label, icon, service) {
212
212
  return false;
213
213
  }
214
214
  }
215
+ function removeServiceLinks(links, kind, name) {
216
+ return links.filter((l) => !(l.service && l.service.kind === kind && l.service.name === name));
217
+ }
218
+ function removeSessionLinkByService(kind, name, sessionId) {
219
+ const sid = sessionId || process.env.SVAMP_SESSION_ID;
220
+ if (!sid || !name) return false;
221
+ try {
222
+ const configPath = getConfigPath(sid);
223
+ const config = readConfig(configPath);
224
+ const before = readSessionLinks(config);
225
+ const next = removeServiceLinks(before, kind, name);
226
+ if (next.length === before.length) return false;
227
+ writeSessionLinks(configPath, config, next);
228
+ return true;
229
+ } catch {
230
+ return false;
231
+ }
232
+ }
215
233
  function reconcileServiceLinks(config, incoming) {
216
234
  const before = readSessionLinks(config);
217
235
  let links = before;
@@ -225,6 +243,14 @@ function reconcileServiceLinks(config, incoming) {
225
243
  config.session_link = links[0] ? { url: links[0].url, label: links[0].label } : void 0;
226
244
  return true;
227
245
  }
246
+ function dropServiceLinks(config, kind, name) {
247
+ const before = readSessionLinks(config);
248
+ const next = removeServiceLinks(before, kind, name);
249
+ if (next.length === before.length) return false;
250
+ config.session_links = next;
251
+ config.session_link = next[0] ? { url: next[0].url, label: next[0].label } : void 0;
252
+ return true;
253
+ }
228
254
  function requireSessionId() {
229
255
  const sessionId = process.env.SVAMP_SESSION_ID;
230
256
  if (!sessionId) {
@@ -343,7 +369,7 @@ async function sessionBroadcast(action, args) {
343
369
  console.log(`Broadcast sent: ${action}`);
344
370
  }
345
371
  async function connectToMachineService() {
346
- const { connectAndGetMachine } = await import('./commands-DRYk0mQr.mjs');
372
+ const { connectAndGetMachine } = await import('./commands-CubsoWG-.mjs');
347
373
  return connectAndGetMachine();
348
374
  }
349
375
  function buildInboxMessage(args) {
@@ -426,7 +452,7 @@ async function inboxSend(targetSessionId, opts) {
426
452
  console.error("Message body is required.");
427
453
  process.exit(1);
428
454
  }
429
- const { connectAndResolveSession } = await import('./commands-DRYk0mQr.mjs');
455
+ const { connectAndResolveSession } = await import('./commands-CubsoWG-.mjs');
430
456
  let server;
431
457
  try {
432
458
  const { targetId, messageId } = await inboxSendCore(
@@ -481,7 +507,7 @@ async function inboxReply(messageId, body, opts) {
481
507
  console.error("SVAMP_SESSION_ID not set. This command must be run inside a Svamp session.");
482
508
  process.exit(1);
483
509
  }
484
- const { connectAndResolveSession } = await import('./commands-DRYk0mQr.mjs');
510
+ const { connectAndResolveSession } = await import('./commands-CubsoWG-.mjs');
485
511
  const { server: localServer, machine: localMachine } = await connectToMachineService();
486
512
  let localDisconnected = false;
487
513
  const disconnectLocal = async () => {
@@ -546,4 +572,4 @@ async function machineNotify(message, level = "info") {
546
572
  console.log(`Machine notification sent [${level}]: ${message}`);
547
573
  }
548
574
 
549
- export { autoAddSessionLink, buildInboxMessage, inboxList, inboxReply, inboxReplyCore, inboxSend, inboxSendCore, linkDedupKey, machineNotify, reconcileServiceLinks, sessionBroadcast, sessionLinkAdd, sessionLinkList, sessionLinkRemove, sessionLinkUpdate, sessionNotify, sessionSetLink, sessionSetProjectDescription, sessionSetTitle, upsertSessionLink };
575
+ export { autoAddSessionLink, buildInboxMessage, dropServiceLinks, inboxList, inboxReply, inboxReplyCore, inboxSend, inboxSendCore, linkDedupKey, machineNotify, reconcileServiceLinks, removeServiceLinks, removeSessionLinkByService, sessionBroadcast, sessionLinkAdd, sessionLinkList, sessionLinkRemove, sessionLinkUpdate, sessionNotify, sessionSetLink, sessionSetProjectDescription, sessionSetTitle, upsertSessionLink };
@@ -1,4 +1,4 @@
1
- import { a0 as resolveModel } from './run-CC2ckdDX.mjs';
1
+ import { a0 as resolveModel } from './run-CvwPIrfo.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';