svamp-cli 0.2.205 → 0.2.207

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 (26) hide show
  1. package/bin/skills/loop/bin/stop-gate.mjs +30 -2
  2. package/bin/skills/loop/test/test-loop-gate.mjs +27 -12
  3. package/dist/{agentCommands-Dn-TyE-y.mjs → agentCommands-BSaoLPO_.mjs} +5 -5
  4. package/dist/{auth-D87LM3EX.mjs → auth-Behk8m8n.mjs} +1 -1
  5. package/dist/cli.mjs +63 -61
  6. package/dist/{commands-BYPH6u5o.mjs → commands-CI9WGg34.mjs} +34 -11
  7. package/dist/{commands-DgMLUDpQ.mjs → commands-CXrlYmu9.mjs} +2 -2
  8. package/dist/{commands-Cqu8T0Rs.mjs → commands-CaT6IgiY.mjs} +2 -2
  9. package/dist/{commands-Cdo_UQYx.mjs → commands-CqHcpDYQ.mjs} +1 -1
  10. package/dist/{commands-fZ3aX4Z3.mjs → commands-DvuFTSEF.mjs} +5 -5
  11. package/dist/{commands-DCGhKy7Z.mjs → commands-VFstSv8U.mjs} +1 -1
  12. package/dist/{commands-DF4tYbiX.mjs → commands-yMEYWNDW.mjs} +1 -1
  13. package/dist/{fleet-DqlgPRl6.mjs → fleet-Evgqqw66.mjs} +1 -1
  14. package/dist/{frpc-3mZl1NSJ.mjs → frpc-_v1in_1L.mjs} +1 -1
  15. package/dist/{headlessCli-DjTqpDTv.mjs → headlessCli-C3tETysU.mjs} +2 -2
  16. package/dist/index.mjs +1 -1
  17. package/dist/{package-C0WXJEui.mjs → package-8HPAx9Ry.mjs} +1 -1
  18. package/dist/{rpc-DCzFvohf.mjs → rpc-BkpMe22P.mjs} +9 -2
  19. package/dist/{rpc-DRCY1RUn.mjs → rpc-Ci-Ge4tu.mjs} +1 -1
  20. package/dist/{run-n9IQLRFi.mjs → run-9H6Of0HT.mjs} +98 -14
  21. package/dist/{run-CtrQ-GRN.mjs → run-DBd-1Pll.mjs} +1 -1
  22. package/dist/{scheduler-DlibcB06.mjs → scheduler-C7_ILALz.mjs} +1 -1
  23. package/dist/{serveCommands-HEc1s3Uh.mjs → serveCommands-CBBsb9Ct.mjs} +5 -5
  24. package/dist/{serveManager-CKkCHofi.mjs → serveManager-DLgPs76r.mjs} +2 -2
  25. package/dist/{sideband-CnLkQa7I.mjs → sideband-_ZCZ7bLW.mjs} +1 -1
  26. package/package.json +1 -1
@@ -256,14 +256,42 @@ const giveUp = overIters || overTime || overTokens;
256
256
  const tokenField = maxTokens ? { tokens_used: tokensUsed } : {};
257
257
 
258
258
  if (giveUp) {
259
- // Bounded out: let it stop so we never block forever. (Single state write.)
260
259
  const why = overTokens ? `token budget (${tokensUsed}/${maxTokens} tokens)`
261
260
  : overTime ? `runtime budget (${cfg.budget.max_runtime_sec}s)`
262
261
  : `max_iterations (${max})`;
262
+ const limitName = overTokens ? 'token budget' : overTime ? 'runtime budget' : 'iteration limit';
263
+ // #0156: reaching the cap here means the exit conditions are NOT met (the `done` path above
264
+ // already handled the met case) — i.e. work is STILL REMAINING. Going silently dormant
265
+ // (active:false) makes a STALL indistinguishable from 'completed' (idle-pike's 11h-dormant bug).
266
+ // So block ONCE to make the agent surface the stall LOUDLY + offer extend/resume <options>;
267
+ // then on the next stop allow it (a stall must never trap the loop forever).
268
+ if (!state.stall_hinted) {
269
+ writeJSONAtomic(STATE, { ...state, iteration: nextIter, stall_hinted: true,
270
+ last_iteration_at: now, last_oracle: oracleDetail, ...tokenField });
271
+ appendHistory({ ts: now, iteration: nextIter, decision: 'stall_hint', reason: why, oracle: oraclePass, detail: oracleDetail });
272
+ const suggested = (overIters && max != null) ? Math.max(max * 2, nextIter + 10) : null;
273
+ const sess = SID || '<session>';
274
+ const resumeCmd = suggested != null
275
+ ? `svamp session loop ${sess} --max ${suggested}`
276
+ : `svamp session loop ${sess} --budget <bigger>`;
277
+ const firstLine = String(oracleDetail || 'oracle still failing').split('\n')[0];
278
+ block(
279
+ `⚠️ LOOP STALLED — hit the ${limitName} (${why}) but the exit conditions are NOT met: ${firstLine}. `
280
+ + `Work is still remaining; do NOT keep grinding, and do NOT just stop silently. In ONE final message:\n`
281
+ + `1) Tell the user the loop hit its ${limitName} with work still pending, and briefly why it didn't finish.\n`
282
+ + `2) Present clickable options so they can extend+resume or stop — exactly like:\n`
283
+ + `<options>\n`
284
+ + ` <option>Extend the limit${suggested != null ? ` to ${suggested}` : ''} and resume the loop</option>\n`
285
+ + ` <option>Stop the loop here</option>\n`
286
+ + `</options>\n`
287
+ + `If the user picks an extend option, run: ${resumeCmd} (this reactivates + extends the loop). Then end your turn.`,
288
+ );
289
+ }
290
+ // Already surfaced the stall once → allow stop so it can never trap the loop.
263
291
  writeJSONAtomic(STATE, { ...state, active: false, phase: 'gave_up', iteration: nextIter,
264
292
  completed_at: now, last_oracle: oracleDetail, gave_up_reason: why, ...tokenField });
265
293
  appendHistory({ ts: now, iteration: nextIter, decision: 'gave_up', reason: why, oracle: oraclePass, detail: oracleDetail });
266
- process.stderr.write(`[loop] reached ${why}; allowing stop.\n`);
294
+ process.stderr.write(`[loop] reached ${why}; allowing stop after stall hint.\n`);
267
295
  allow();
268
296
  }
269
297
 
@@ -113,13 +113,21 @@ try {
113
113
  ok(!r.blocked, 'gate allows when evaluator off and oracle passes');
114
114
  }
115
115
 
116
- // ---- Test 7: max_iterations bound -> eventually allows (never infinite) ----
117
- console.log('Test 7: max_iterations prevents infinite blocking');
116
+ // ---- Test 7: max_iterations bound -> STALL hint once, then allows (never infinite) ----
117
+ console.log('Test 7: max_iterations stall hint once, then allows');
118
118
  { const d = newProject({ evaluator: 'off', max: 1 }); dirs.push(d); // oracle keeps failing (answer.txt=TODO)
119
- const r1 = runGate(d); // iteration -> 1, block
120
- const r2 = runGate(d, true); // iteration -> 2 > max -> give up, allow
119
+ const r1 = runGate(d); // iteration -> 1, block (oracle fails)
120
+ const r2 = runGate(d, true); // iteration -> 2 > max -> #0156 STALL: block ONCE with options
121
+ const r3 = runGate(d, true); // already hinted -> give up, allow
121
122
  ok(r1.blocked, 'first failing attempt blocks');
122
- ok(!r2.blocked, 'after exceeding max_iterations the gate allows stop (no infinite loop)');
123
+ // #0156: exceeding the cap with the oracle still failing is a STALL — surface it loudly ONCE
124
+ // (don't go silently dormant), presenting extend/resume <options>.
125
+ ok(r2.blocked, '#0156: exceeding max_iterations blocks ONCE with a stall hint (not silent)');
126
+ ok(/STALL/i.test(r2.reason) && /<options>/.test(r2.reason), '#0156: stall hint explains + presents <options>');
127
+ ok(/loop .* --max/.test(r2.reason), '#0156: stall hint gives the resume+extend command');
128
+ ok(readState(d).stall_hinted === true, '#0156: state records stall_hinted after the hint');
129
+ ok(!r3.blocked, 'after the stall hint the gate allows stop (no infinite loop)');
130
+ ok(readState(d).phase === 'gave_up' && readState(d).active === false, 'finally marked gave_up/inactive');
123
131
  }
124
132
 
125
133
  // ---- Test 8: inactive loop -> no-op allow ----
@@ -152,8 +160,10 @@ try {
152
160
  const cfg = JSON.parse(readFileSync(cfgP, 'utf8')); cfg.budget = { max_runtime_sec: 1 }; writeFileSync(cfgP, JSON.stringify(cfg));
153
161
  const spP = join(d, '.svamp', SID, 'loop', 'loop-state.json');
154
162
  const sp = JSON.parse(readFileSync(spP, 'utf8')); sp.started_at = new Date(Date.now() - 5000).toISOString(); writeFileSync(spP, JSON.stringify(sp));
155
- const r = runGate(d);
156
- ok(!r.blocked, 'gate allows stop once runtime budget is exceeded');
163
+ const r = runGate(d); // #0156: first over-budget hit → stall hint (block once)
164
+ const r2 = runGate(d); // already hinted allow
165
+ ok(r.blocked && /STALL/i.test(r.reason), 'runtime over-budget surfaces a stall hint first (not silent)');
166
+ ok(!r2.blocked, 'gate allows stop once runtime budget is exceeded (after the stall hint)');
157
167
  ok(readState(d).gave_up_reason?.includes('runtime'), 'state records runtime give-up reason');
158
168
  }
159
169
 
@@ -180,8 +190,10 @@ try {
180
190
  JSON.stringify({ message: { usage: { input_tokens: 400, output_tokens: 300 } } }),
181
191
  JSON.stringify({ message: { usage: { input_tokens: 500, output_tokens: 200, cache_read_input_tokens: 50 } } }),
182
192
  ].join('\n')); // total = 1450 > 1000
183
- const r = runGate(d, false, tp);
184
- ok(!r.blocked, 'gate allows stop once token budget is exceeded');
193
+ const r = runGate(d, false, tp); // #0156: first over-budget hit → stall hint
194
+ const r2 = runGate(d, false, tp); // already hinted allow
195
+ ok(r.blocked && /STALL/i.test(r.reason), 'token over-budget surfaces a stall hint first (not silent)');
196
+ ok(!r2.blocked, 'gate allows stop once token budget is exceeded (after the stall hint)');
185
197
  ok(readState(d).gave_up_reason?.includes('token'), 'state records token give-up reason');
186
198
  ok(readState(d).tokens_used === 1450, 'tokens summed from transcript');
187
199
  }
@@ -193,8 +205,10 @@ try {
193
205
  const cfg = JSON.parse(readFileSync(cfgP, 'utf8')); cfg.max_iterations = null; writeFileSync(cfgP, JSON.stringify(cfg));
194
206
  const spP = join(d, '.svamp', SID, 'loop', 'loop-state.json');
195
207
  const sp = JSON.parse(readFileSync(spP, 'utf8')); sp.iteration = 200; writeFileSync(spP, JSON.stringify(sp)); // at the hard ceiling
196
- const r = runGate(d);
197
- ok(!r.blocked, 'gate allows stop at the hard fallback ceiling even with null max_iterations');
208
+ const r = runGate(d); // #0156: stall hint first
209
+ const r2 = runGate(d); // then allow
210
+ ok(r.blocked && /STALL/i.test(r.reason), 'hard-ceiling hit surfaces a stall hint first');
211
+ ok(!r2.blocked, 'gate allows stop at the hard fallback ceiling even with null max_iterations');
198
212
  }
199
213
 
200
214
  // ---- Test 14: non-git project fingerprint is content-sensitive (CRITICAL #1) ----
@@ -225,7 +239,8 @@ try {
225
239
  const cfg = JSON.parse(readFileSync(cfgP, 'utf8')); cfg.max_iterations = 1e9; writeFileSync(cfgP, JSON.stringify(cfg));
226
240
  const spP = join(d, '.svamp', SID, 'loop', 'loop-state.json');
227
241
  const sp = JSON.parse(readFileSync(spP, 'utf8')); sp.iteration = 201; writeFileSync(spP, JSON.stringify(sp));
228
- const r = runGate(d);
242
+ runGate(d); // #0156: stall hint first
243
+ const r = runGate(d); // then allow
229
244
  ok(!r.blocked && /max_iterations \(200\)/.test(readState(d).gave_up_reason || ''), 'max_iterations 1e9 clamped to 200 → gives up');
230
245
  }
231
246
 
@@ -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 { A as shortId } from './run-n9IQLRFi.mjs';
5
+ import { A as shortId } from './run-9H6Of0HT.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-n9IQLRFi.mjs').then(function (n) { return n.a8; });
99
+ const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a8; });
100
100
  const desc = sanitizeDescription(description, 240);
101
101
  if (!desc) {
102
102
  console.error("Project description is empty.");
@@ -180,7 +180,7 @@ async function sessionBroadcast(action, args) {
180
180
  console.log(`Broadcast sent: ${action}`);
181
181
  }
182
182
  async function connectToMachineService() {
183
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
183
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
184
184
  return connectAndGetMachine();
185
185
  }
186
186
  function buildInboxMessage(args) {
@@ -258,7 +258,7 @@ async function inboxSend(targetSessionId, opts) {
258
258
  console.error("Message body is required.");
259
259
  process.exit(1);
260
260
  }
261
- const { connectAndResolveSession } = await import('./commands-BYPH6u5o.mjs');
261
+ const { connectAndResolveSession } = await import('./commands-CI9WGg34.mjs');
262
262
  let server;
263
263
  try {
264
264
  const { targetId, messageId } = await inboxSendCore(
@@ -312,7 +312,7 @@ async function inboxReply(messageId, body) {
312
312
  console.error("SVAMP_SESSION_ID not set. This command must be run inside a Svamp session.");
313
313
  process.exit(1);
314
314
  }
315
- const { connectAndResolveSession } = await import('./commands-BYPH6u5o.mjs');
315
+ const { connectAndResolveSession } = await import('./commands-CI9WGg34.mjs');
316
316
  const { server: localServer, machine: localMachine } = await connectToMachineService();
317
317
  let localDisconnected = false;
318
318
  const disconnectLocal = async () => {
@@ -1,4 +1,4 @@
1
- import { P as resolveModel } from './run-n9IQLRFi.mjs';
1
+ import { P as resolveModel } from './run-9H6Of0HT.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-n9IQLRFi.mjs';
1
+ import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-9H6Of0HT.mjs';
2
2
  import { ensureSupervisorViaServiceManager, LAUNCHD_LABEL } from './serviceManager-hlOVxkhW.mjs';
3
3
  import 'os';
4
4
  import 'fs/promises';
@@ -34,7 +34,7 @@ const subcommand = args[0];
34
34
  let daemonSubcommand = args[1];
35
35
  async function main() {
36
36
  try {
37
- const { getLoadedConfig } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ae; });
37
+ const { getLoadedConfig } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ae; });
38
38
  getLoadedConfig();
39
39
  } catch {
40
40
  }
@@ -51,7 +51,7 @@ async function main() {
51
51
  console.error(`svamp daemon restart: ${err.message || err}`);
52
52
  process.exit(1);
53
53
  }
54
- const { restartDaemon } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ag; });
54
+ const { restartDaemon } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ag; });
55
55
  await restartDaemon();
56
56
  process.exit(0);
57
57
  }
@@ -344,7 +344,7 @@ async function main() {
344
344
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
345
345
  process.exit(1);
346
346
  }
347
- const { handleServiceCommand } = await import('./commands-fZ3aX4Z3.mjs');
347
+ const { handleServiceCommand } = await import('./commands-DvuFTSEF.mjs');
348
348
  await handleServiceCommand();
349
349
  } else if (subcommand === "serve") {
350
350
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -352,7 +352,7 @@ async function main() {
352
352
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
353
353
  process.exit(1);
354
354
  }
355
- const { handleServeCommand } = await import('./serveCommands-HEc1s3Uh.mjs');
355
+ const { handleServeCommand } = await import('./serveCommands-CBBsb9Ct.mjs');
356
356
  await handleServeCommand();
357
357
  process.exit(0);
358
358
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -361,7 +361,7 @@ async function main() {
361
361
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
362
362
  process.exit(1);
363
363
  }
364
- const { processCommand } = await import('./commands-Cqu8T0Rs.mjs');
364
+ const { processCommand } = await import('./commands-CaT6IgiY.mjs');
365
365
  let machineId;
366
366
  const processArgs = args.slice(1);
367
367
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -375,18 +375,18 @@ async function main() {
375
375
  }), machineId);
376
376
  process.exit(0);
377
377
  } else if (subcommand === "issue" || subcommand === "issues") {
378
- const { issueCommand } = await import('./commands-DF4tYbiX.mjs');
378
+ const { issueCommand } = await import('./commands-yMEYWNDW.mjs');
379
379
  await issueCommand(args.slice(1));
380
380
  process.exit(0);
381
381
  } else if (subcommand === "workflow" || subcommand === "workflows") {
382
- const { workflowCommand } = await import('./commands-Cdo_UQYx.mjs');
382
+ const { workflowCommand } = await import('./commands-CqHcpDYQ.mjs');
383
383
  await workflowCommand(args.slice(1));
384
384
  process.exit(0);
385
385
  } else if (subcommand === "wise-agent" || subcommand === "wise") {
386
386
  await handleWiseAgentCommand(args.slice(1));
387
387
  process.exit(0);
388
388
  } else if (subcommand === "feature" || subcommand === "crew") {
389
- const { crewCommand } = await import('./commands-DgMLUDpQ.mjs');
389
+ const { crewCommand } = await import('./commands-CXrlYmu9.mjs');
390
390
  await crewCommand(args.slice(1));
391
391
  process.exit(0);
392
392
  } else if (subcommand === "--help" || subcommand === "-h") {
@@ -394,7 +394,7 @@ async function main() {
394
394
  } else if (!subcommand || subcommand === "start") {
395
395
  await handleInteractiveCommand();
396
396
  } else if (subcommand === "--version" || subcommand === "-v") {
397
- const pkg = await import('./package-C0WXJEui.mjs').catch(() => ({ default: { version: "unknown" } }));
397
+ const pkg = await import('./package-8HPAx9Ry.mjs').catch(() => ({ default: { version: "unknown" } }));
398
398
  console.log(`svamp version: ${pkg.default.version}`);
399
399
  } else {
400
400
  console.error(`Unknown command: ${subcommand}`);
@@ -403,7 +403,7 @@ async function main() {
403
403
  }
404
404
  }
405
405
  async function handleInteractiveCommand() {
406
- const { runInteractive } = await import('./run-CtrQ-GRN.mjs');
406
+ const { runInteractive } = await import('./run-DBd-1Pll.mjs');
407
407
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
408
408
  let directory = process.cwd();
409
409
  let resumeSessionId;
@@ -448,7 +448,7 @@ async function handleAgentCommand() {
448
448
  return;
449
449
  }
450
450
  if (agentArgs[0] === "list") {
451
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ab; });
451
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ab; });
452
452
  console.log("Known agents:");
453
453
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
454
454
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -460,7 +460,7 @@ async function handleAgentCommand() {
460
460
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
461
461
  return;
462
462
  }
463
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ab; });
463
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ab; });
464
464
  let cwd = process.cwd();
465
465
  const filteredArgs = [];
466
466
  for (let i = 0; i < agentArgs.length; i++) {
@@ -484,12 +484,12 @@ async function handleAgentCommand() {
484
484
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
485
485
  let backend;
486
486
  if (KNOWN_MCP_AGENTS[config.agentName]) {
487
- const { CodexMcpBackend } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ac; });
487
+ const { CodexMcpBackend } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ac; });
488
488
  backend = new CodexMcpBackend({ cwd, log: logFn });
489
489
  } else {
490
- const { AcpBackend } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.aa; });
491
- const { GeminiTransport } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ad; });
492
- const { DefaultTransport } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.a9; });
490
+ const { AcpBackend } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.aa; });
491
+ const { GeminiTransport } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ad; });
492
+ const { DefaultTransport } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a9; });
493
493
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
494
494
  backend = new AcpBackend({
495
495
  agentName: config.agentName,
@@ -616,7 +616,7 @@ async function handleSessionCommand() {
616
616
  process.exit(1);
617
617
  }
618
618
  }
619
- const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-BYPH6u5o.mjs');
619
+ const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-CI9WGg34.mjs');
620
620
  const parseFlagStr = (flag, shortFlag) => {
621
621
  for (let i = 1; i < sessionArgs.length; i++) {
622
622
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -684,7 +684,7 @@ async function handleSessionCommand() {
684
684
  allowDomain.push(sessionArgs[++i]);
685
685
  }
686
686
  }
687
- const { parseShareArg } = await import('./commands-BYPH6u5o.mjs');
687
+ const { parseShareArg } = await import('./commands-CI9WGg34.mjs');
688
688
  const shareEntries = share.map((s) => parseShareArg(s));
689
689
  await sessionSpawn(agent, dir, targetMachineId, {
690
690
  message,
@@ -761,7 +761,9 @@ async function handleSessionCommand() {
761
761
  subject: parseFlagStr("--subject"),
762
762
  urgency: parseFlagStr("--urgency"),
763
763
  model: parseFlagStr("--model"),
764
- plain: hasFlag("--plain")
764
+ plain: hasFlag("--plain"),
765
+ asIssue: hasFlag("--as-issue"),
766
+ issueTitle: parseFlagStr("--issue-title")
765
767
  });
766
768
  } else if (sessionSubcommand === "edit-message" || sessionSubcommand === "edit") {
767
769
  if (!sessionArgs[1] || !sessionArgs[2] || sessionArgs[3] === void 0) {
@@ -769,7 +771,7 @@ async function handleSessionCommand() {
769
771
  console.error(" Rewinds history: rewrites the message + drops everything after it, then restarts Claude.");
770
772
  process.exit(1);
771
773
  }
772
- const { sessionEditMessage } = await import('./commands-BYPH6u5o.mjs');
774
+ const { sessionEditMessage } = await import('./commands-CI9WGg34.mjs');
773
775
  await sessionEditMessage(sessionArgs[1], sessionArgs[2], sessionArgs[3], targetMachineId);
774
776
  } else if (sessionSubcommand === "refine") {
775
777
  if (!sessionArgs[1] || !sessionArgs[2]) {
@@ -777,7 +779,7 @@ async function handleSessionCommand() {
777
779
  console.error(" Asks the agent to revise its latest reply in place (no extra round).");
778
780
  process.exit(1);
779
781
  }
780
- const { sessionRefineLastReply } = await import('./commands-BYPH6u5o.mjs');
782
+ const { sessionRefineLastReply } = await import('./commands-CI9WGg34.mjs');
781
783
  await sessionRefineLastReply(sessionArgs[1], sessionArgs[2], targetMachineId);
782
784
  } else if (sessionSubcommand === "undo-edit" || sessionSubcommand === "undo") {
783
785
  if (!sessionArgs[1]) {
@@ -785,7 +787,7 @@ async function handleSessionCommand() {
785
787
  console.error(" Reverts the most recent edit/refine, restoring the pre-edit history.");
786
788
  process.exit(1);
787
789
  }
788
- const { sessionUndoEdit } = await import('./commands-BYPH6u5o.mjs');
790
+ const { sessionUndoEdit } = await import('./commands-CI9WGg34.mjs');
789
791
  await sessionUndoEdit(sessionArgs[1], targetMachineId);
790
792
  } else if (sessionSubcommand === "query") {
791
793
  const dir = sessionArgs[1];
@@ -795,7 +797,7 @@ async function handleSessionCommand() {
795
797
  console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
796
798
  process.exit(1);
797
799
  }
798
- const { sessionQuery } = await import('./commands-BYPH6u5o.mjs');
800
+ const { sessionQuery } = await import('./commands-CI9WGg34.mjs');
799
801
  await sessionQuery(dir, prompt, targetMachineId, {
800
802
  timeout: parseFlagInt("--timeout"),
801
803
  json: hasFlag("--json"),
@@ -828,7 +830,7 @@ async function handleSessionCommand() {
828
830
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
829
831
  process.exit(1);
830
832
  }
831
- const { sessionApprove } = await import('./commands-BYPH6u5o.mjs');
833
+ const { sessionApprove } = await import('./commands-CI9WGg34.mjs');
832
834
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
833
835
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
834
836
  json: hasFlag("--json")
@@ -838,7 +840,7 @@ async function handleSessionCommand() {
838
840
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
839
841
  process.exit(1);
840
842
  }
841
- const { sessionDeny } = await import('./commands-BYPH6u5o.mjs');
843
+ const { sessionDeny } = await import('./commands-CI9WGg34.mjs');
842
844
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
843
845
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
844
846
  json: hasFlag("--json")
@@ -880,7 +882,7 @@ async function handleSessionCommand() {
880
882
  console.error("Usage: svamp session set-title <title>");
881
883
  process.exit(1);
882
884
  }
883
- const { sessionSetTitle } = await import('./agentCommands-Dn-TyE-y.mjs');
885
+ const { sessionSetTitle } = await import('./agentCommands-BSaoLPO_.mjs');
884
886
  await sessionSetTitle(title);
885
887
  } else if (sessionSubcommand === "set-project-description" || sessionSubcommand === "set-project") {
886
888
  const desc = sessionArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
@@ -888,7 +890,7 @@ async function handleSessionCommand() {
888
890
  console.error("Usage: svamp session set-project-description <text>");
889
891
  process.exit(1);
890
892
  }
891
- const { sessionSetProjectDescription } = await import('./agentCommands-Dn-TyE-y.mjs');
893
+ const { sessionSetProjectDescription } = await import('./agentCommands-BSaoLPO_.mjs');
892
894
  await sessionSetProjectDescription(desc);
893
895
  } else if (sessionSubcommand === "set-link") {
894
896
  const url = sessionArgs[1];
@@ -897,7 +899,7 @@ async function handleSessionCommand() {
897
899
  process.exit(1);
898
900
  }
899
901
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
900
- const { sessionSetLink } = await import('./agentCommands-Dn-TyE-y.mjs');
902
+ const { sessionSetLink } = await import('./agentCommands-BSaoLPO_.mjs');
901
903
  await sessionSetLink(url, label);
902
904
  } else if (sessionSubcommand === "notify") {
903
905
  const message = sessionArgs[1];
@@ -906,7 +908,7 @@ async function handleSessionCommand() {
906
908
  process.exit(1);
907
909
  }
908
910
  const level = parseFlagStr("--level") || "info";
909
- const { sessionNotify } = await import('./agentCommands-Dn-TyE-y.mjs');
911
+ const { sessionNotify } = await import('./agentCommands-BSaoLPO_.mjs');
910
912
  await sessionNotify(message, level);
911
913
  } else if (sessionSubcommand === "broadcast") {
912
914
  const action = sessionArgs[1];
@@ -914,7 +916,7 @@ async function handleSessionCommand() {
914
916
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
915
917
  process.exit(1);
916
918
  }
917
- const { sessionBroadcast } = await import('./agentCommands-Dn-TyE-y.mjs');
919
+ const { sessionBroadcast } = await import('./agentCommands-BSaoLPO_.mjs');
918
920
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
919
921
  } else if (sessionSubcommand === "inbox") {
920
922
  const inboxSubcmd = sessionArgs[1];
@@ -925,7 +927,7 @@ async function handleSessionCommand() {
925
927
  process.exit(1);
926
928
  }
927
929
  if (agentSessionId) {
928
- const { inboxSend } = await import('./agentCommands-Dn-TyE-y.mjs');
930
+ const { inboxSend } = await import('./agentCommands-BSaoLPO_.mjs');
929
931
  await inboxSend(sessionArgs[2], {
930
932
  body: sessionArgs[3],
931
933
  subject: parseFlagStr("--subject"),
@@ -940,7 +942,7 @@ async function handleSessionCommand() {
940
942
  }
941
943
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
942
944
  if (agentSessionId && !sessionArgs[2]) {
943
- const { inboxList } = await import('./agentCommands-Dn-TyE-y.mjs');
945
+ const { inboxList } = await import('./agentCommands-BSaoLPO_.mjs');
944
946
  await inboxList({
945
947
  unread: hasFlag("--unread"),
946
948
  limit: parseFlagInt("--limit"),
@@ -962,7 +964,7 @@ async function handleSessionCommand() {
962
964
  process.exit(1);
963
965
  }
964
966
  if (agentSessionId && !sessionArgs[3]) {
965
- const { inboxList } = await import('./agentCommands-Dn-TyE-y.mjs');
967
+ const { inboxList } = await import('./agentCommands-BSaoLPO_.mjs');
966
968
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
967
969
  } else if (sessionArgs[3]) {
968
970
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -972,7 +974,7 @@ async function handleSessionCommand() {
972
974
  }
973
975
  } else if (inboxSubcmd === "reply") {
974
976
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
975
- const { inboxReply } = await import('./agentCommands-Dn-TyE-y.mjs');
977
+ const { inboxReply } = await import('./agentCommands-BSaoLPO_.mjs');
976
978
  await inboxReply(sessionArgs[2], sessionArgs[3]);
977
979
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
978
980
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -1010,7 +1012,7 @@ async function handleMachineCommand() {
1010
1012
  return;
1011
1013
  }
1012
1014
  if (machineSubcommand === "share") {
1013
- const { machineShare } = await import('./commands-BYPH6u5o.mjs');
1015
+ const { machineShare } = await import('./commands-CI9WGg34.mjs');
1014
1016
  let machineId;
1015
1017
  const shareArgs = [];
1016
1018
  for (let i = 1; i < machineArgs.length; i++) {
@@ -1061,14 +1063,14 @@ async function handleMachineCommand() {
1061
1063
  process.exit(1);
1062
1064
  }
1063
1065
  if (all) {
1064
- const { fleetExec } = await import('./fleet-DqlgPRl6.mjs');
1066
+ const { fleetExec } = await import('./fleet-Evgqqw66.mjs');
1065
1067
  await fleetExec(command, { cwd });
1066
1068
  } else {
1067
- const { machineExec } = await import('./commands-BYPH6u5o.mjs');
1069
+ const { machineExec } = await import('./commands-CI9WGg34.mjs');
1068
1070
  await machineExec(machineId, command, cwd);
1069
1071
  }
1070
1072
  } else if (machineSubcommand === "info") {
1071
- const { machineInfo } = await import('./commands-BYPH6u5o.mjs');
1073
+ const { machineInfo } = await import('./commands-CI9WGg34.mjs');
1072
1074
  let machineId;
1073
1075
  for (let i = 1; i < machineArgs.length; i++) {
1074
1076
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -1088,10 +1090,10 @@ async function handleMachineCommand() {
1088
1090
  level = machineArgs[++i];
1089
1091
  }
1090
1092
  }
1091
- const { machineNotify } = await import('./agentCommands-Dn-TyE-y.mjs');
1093
+ const { machineNotify } = await import('./agentCommands-BSaoLPO_.mjs');
1092
1094
  await machineNotify(message, level);
1093
1095
  } else if (machineSubcommand === "ls") {
1094
- const { machineLs } = await import('./commands-BYPH6u5o.mjs');
1096
+ const { machineLs } = await import('./commands-CI9WGg34.mjs');
1095
1097
  let machineId;
1096
1098
  let showHidden = false;
1097
1099
  let path;
@@ -1147,20 +1149,20 @@ Examples:
1147
1149
  };
1148
1150
  const hasFlag = (name) => fleetArgs.includes(`--${name}`);
1149
1151
  if (sub === "status") {
1150
- const { fleetStatus } = await import('./fleet-DqlgPRl6.mjs');
1152
+ const { fleetStatus } = await import('./fleet-Evgqqw66.mjs');
1151
1153
  await fleetStatus();
1152
1154
  } else if (sub === "upgrade-claude") {
1153
- const { fleetUpgradeClaude } = await import('./fleet-DqlgPRl6.mjs');
1155
+ const { fleetUpgradeClaude } = await import('./fleet-Evgqqw66.mjs');
1154
1156
  await fleetUpgradeClaude({ version: flag("version", "-v") });
1155
1157
  } else if (sub === "upgrade-svamp") {
1156
- const { fleetUpgradeSvamp } = await import('./fleet-DqlgPRl6.mjs');
1158
+ const { fleetUpgradeSvamp } = await import('./fleet-Evgqqw66.mjs');
1157
1159
  await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
1158
1160
  } else if (sub === "daemon-restart") {
1159
- const { fleetDaemonRestart } = await import('./fleet-DqlgPRl6.mjs');
1161
+ const { fleetDaemonRestart } = await import('./fleet-Evgqqw66.mjs');
1160
1162
  await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
1161
1163
  } else if (sub === "push-skill") {
1162
1164
  const name = fleetArgs[1];
1163
- const { fleetPushSkill } = await import('./fleet-DqlgPRl6.mjs');
1165
+ const { fleetPushSkill } = await import('./fleet-Evgqqw66.mjs');
1164
1166
  await fleetPushSkill(name);
1165
1167
  } else {
1166
1168
  console.error(`Unknown fleet subcommand: ${sub}`);
@@ -1176,7 +1178,7 @@ async function handleSkillsCommand() {
1176
1178
  await printSkillsHelp();
1177
1179
  return;
1178
1180
  }
1179
- const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-DCGhKy7Z.mjs');
1181
+ const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-VFstSv8U.mjs');
1180
1182
  if (skillsSubcommand === "find" || skillsSubcommand === "search") {
1181
1183
  const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
1182
1184
  if (!query) {
@@ -1223,7 +1225,7 @@ async function loginToHypha() {
1223
1225
  process.exit(1);
1224
1226
  }
1225
1227
  const anchor = anchorArg.replace(/\/+$/, "");
1226
- const { loadInstanceConfig } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ae; });
1228
+ const { loadInstanceConfig } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ae; });
1227
1229
  let cfg = null;
1228
1230
  try {
1229
1231
  cfg = await loadInstanceConfig({ anchor, force: true });
@@ -1334,7 +1336,7 @@ async function logoutFromHypha() {
1334
1336
  } catch {
1335
1337
  }
1336
1338
  try {
1337
- const { clearInstanceConfigCache } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.ae; });
1339
+ const { clearInstanceConfigCache } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.ae; });
1338
1340
  clearInstanceConfigCache();
1339
1341
  } catch {
1340
1342
  }
@@ -1672,7 +1674,7 @@ async function applyClaudeAuthFlags(argv) {
1672
1674
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
1673
1675
  );
1674
1676
  }
1675
- const mod = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.a7; });
1677
+ const mod = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a7; });
1676
1678
  if (hasHypha) {
1677
1679
  let url;
1678
1680
  const hyphaIdx = argv.indexOf("--use-hypha-proxy");
@@ -1726,7 +1728,7 @@ async function applyDaemonShareFlag(argv) {
1726
1728
  }
1727
1729
  }
1728
1730
  if (collected.length === 0) return;
1729
- const { updateEnvFile } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.a7; });
1731
+ const { updateEnvFile } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a7; });
1730
1732
  const seen = /* @__PURE__ */ new Set();
1731
1733
  const deduped = collected.filter((e) => {
1732
1734
  const k = e.toLowerCase();
@@ -1759,7 +1761,7 @@ async function handleWiseAgentCommand(rest) {
1759
1761
  }
1760
1762
  });
1761
1763
  const message = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
1762
- const { wiseAskCli } = await import('./commands-BYPH6u5o.mjs');
1764
+ const { wiseAskCli } = await import('./commands-CI9WGg34.mjs');
1763
1765
  await wiseAskCli(machineId, message, sessionId, { json });
1764
1766
  return;
1765
1767
  }
@@ -1771,7 +1773,7 @@ async function handleWiseAgentCommand(rest) {
1771
1773
  }
1772
1774
  return void 0;
1773
1775
  };
1774
- const { runWiseVoiceCli } = await import('./headlessCli-DjTqpDTv.mjs');
1776
+ const { runWiseVoiceCli } = await import('./headlessCli-C3tETysU.mjs');
1775
1777
  await runWiseVoiceCli({ voice: valueOf(["--voice"]), wakeKeywordPath: valueOf(["--wake"]), model: valueOf(["--model"]) });
1776
1778
  return;
1777
1779
  }
@@ -1789,7 +1791,7 @@ async function handleWiseAgentCommand(rest) {
1789
1791
  const mode = valueOf(["--mode"]);
1790
1792
  const mission = valueOf(["--mission"]);
1791
1793
  const url = rest.slice(1).find((a) => /^https?:\/\//.test(a)) || "";
1792
- const { wiseJoinMeetingCli } = await import('./commands-BYPH6u5o.mjs');
1794
+ const { wiseJoinMeetingCli } = await import('./commands-CI9WGg34.mjs');
1793
1795
  await wiseJoinMeetingCli(machineId, url, sessionId, { json, mode, mission });
1794
1796
  return;
1795
1797
  }
@@ -1801,7 +1803,7 @@ async function handleWiseAgentCommand(rest) {
1801
1803
  }
1802
1804
  return void 0;
1803
1805
  };
1804
- const { wiseLeaveMeetingCli } = await import('./commands-BYPH6u5o.mjs');
1806
+ const { wiseLeaveMeetingCli } = await import('./commands-CI9WGg34.mjs');
1805
1807
  await wiseLeaveMeetingCli(valueOf(["--machine", "-m"]), valueOf(["--session", "-s"]), { json: rest.includes("--json") });
1806
1808
  return;
1807
1809
  }
@@ -1825,7 +1827,7 @@ async function handleWiseAgentCommand(rest) {
1825
1827
  }
1826
1828
  });
1827
1829
  const text = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
1828
- const { wiseAnnounceCli } = await import('./commands-BYPH6u5o.mjs');
1830
+ const { wiseAnnounceCli } = await import('./commands-CI9WGg34.mjs');
1829
1831
  await wiseAnnounceCli(machineId, text, sessionId, { json });
1830
1832
  return;
1831
1833
  }
@@ -1837,7 +1839,7 @@ async function handleWiseAgentCommand(rest) {
1837
1839
  }
1838
1840
  return void 0;
1839
1841
  };
1840
- const { wiseMeetingsCli } = await import('./commands-BYPH6u5o.mjs');
1842
+ const { wiseMeetingsCli } = await import('./commands-CI9WGg34.mjs');
1841
1843
  await wiseMeetingsCli(valueOf(["--machine", "-m"]), { json: rest.includes("--json") });
1842
1844
  return;
1843
1845
  }
@@ -1887,7 +1889,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1887
1889
  return;
1888
1890
  }
1889
1891
  const authArgs = rest.slice(1);
1890
- const mod = await import('./auth-D87LM3EX.mjs');
1892
+ const mod = await import('./auth-Behk8m8n.mjs');
1891
1893
  let action;
1892
1894
  try {
1893
1895
  action = mod.parseWiseAgentAuthArgs(authArgs);
@@ -1897,7 +1899,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1897
1899
  return;
1898
1900
  }
1899
1901
  if (action) {
1900
- const { updateEnvFile } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.a7; });
1902
+ const { updateEnvFile } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a7; });
1901
1903
  const updates = mod.buildWiseAgentEnvUpdates(action);
1902
1904
  updateEnvFile(updates);
1903
1905
  for (const [k, v] of Object.entries(updates)) {
@@ -1911,7 +1913,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1911
1913
  }
1912
1914
  async function handleDaemonAuthCommand(argv) {
1913
1915
  const sub = (argv[0] || "status").toLowerCase();
1914
- const mod = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.a7; });
1916
+ const mod = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.a7; });
1915
1917
  if (sub === "--help" || sub === "-h" || sub === "help") {
1916
1918
  console.log(`
1917
1919
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -2224,7 +2226,7 @@ Examples:
2224
2226
  async function printSkillsHelp() {
2225
2227
  let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
2226
2228
  try {
2227
- const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-n9IQLRFi.mjs').then(function (n) { return n.af; });
2229
+ const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-9H6Of0HT.mjs').then(function (n) { return n.af; });
2228
2230
  browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
2229
2231
  } catch {
2230
2232
  }
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { execSync } from 'node:child_process';
3
3
  import { basename, resolve, join, isAbsolute } from 'node:path';
4
4
  import os from 'node:os';
5
- import { Q as formatHandle, T as normalizeAllowedUser, U as loadSecurityContextConfig, V as resolveSecurityContext, W as buildSecurityContextFromFlags, X as mergeSecurityContexts, c as connectToHypha, Y as buildSessionShareUrl, Z as computeOutboundHop, A as shortId, _ as buildMachineShareUrl, $ as parseHandle, a0 as handleMatchesMetadata } from './run-n9IQLRFi.mjs';
5
+ import { Q as formatHandle, T as normalizeAllowedUser, U as loadSecurityContextConfig, V as resolveSecurityContext, W as buildSecurityContextFromFlags, X as mergeSecurityContexts, c as connectToHypha, Y as buildSessionShareUrl, Z as computeOutboundHop, A as shortId, _ as buildMachineShareUrl, $ as parseHandle, a0 as handleMatchesMetadata } from './run-9H6Of0HT.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -1706,6 +1706,24 @@ async function sendCore(machine, fullId, message, opts) {
1706
1706
  response: String(btwResult.answer || "")
1707
1707
  };
1708
1708
  }
1709
+ if (opts?.asIssue) {
1710
+ const issue = await machine.sessionRPC(fullId, "issue", {
1711
+ op: "add",
1712
+ body: message,
1713
+ session: fullId,
1714
+ rekick: true,
1715
+ ...opts.issueTitle ? { title: opts.issueTitle } : {}
1716
+ });
1717
+ return {
1718
+ sessionId: fullId,
1719
+ mode: "send",
1720
+ sent: true,
1721
+ waited: false,
1722
+ status: "sent",
1723
+ messageId: issue?.id,
1724
+ response: `Created issue #${issue?.id}: ${issue?.title || ""}`.trim()
1725
+ };
1726
+ }
1709
1727
  const wantResponse = !!opts?.response;
1710
1728
  const shouldWait = !!opts?.wait || wantResponse;
1711
1729
  if (opts?.plain) {
@@ -2488,7 +2506,8 @@ async function sessionLoopStart(sessionIdPartial, task, machineId, opts) {
2488
2506
  try {
2489
2507
  const svc = getSessionProxy(machine, fullId);
2490
2508
  const until = opts?.until || opts?.criteria;
2491
- const maxIterations = opts?.maxIterations ?? 20;
2509
+ const isStart = !!(task || until);
2510
+ const maxIterations = opts?.maxIterations ?? (isStart ? 20 : void 0);
2492
2511
  const evaluator = opts?.agent ? true : opts?.evaluator !== false;
2493
2512
  await svc.updateConfig({
2494
2513
  loop: {
@@ -2496,18 +2515,22 @@ async function sessionLoopStart(sessionIdPartial, task, machineId, opts) {
2496
2515
  ...until ? { until } : {},
2497
2516
  ...opts?.oracle ? { oracle: opts.oracle } : {},
2498
2517
  ...opts?.parent ? { parent: opts.parent } : {},
2499
- max_iterations: maxIterations,
2518
+ ...maxIterations != null ? { max_iterations: maxIterations } : {},
2500
2519
  evaluator
2501
2520
  }
2502
2521
  });
2503
- console.log(`\u{1F501} Loop ${task ? "started" : "attached"} on session ${fullId.slice(0, 8)}`);
2504
- if (task) console.log(` Task: ${task.slice(0, 100)}${task.length > 100 ? "..." : ""}`);
2505
- if (until) console.log(` Until: ${until.slice(0, 100)}${until.length > 100 ? "..." : ""}`);
2506
- console.log(` Oracle: ${opts?.oracle || "(none)"}`);
2507
- console.log(` Evaluator: ${evaluator ? "on" : "off"}`);
2508
- if (opts?.parent) console.log(` Parent review: ${opts.parent.slice(0, 8)}`);
2509
- console.log(` Max iterations: ${maxIterations}`);
2510
- if (!task) console.log(` (hot-plug \u2014 gating the session's current work)`);
2522
+ if (!isStart) {
2523
+ console.log(`\u{1F501} Loop limit updated on session ${fullId.slice(0, 8)}${maxIterations != null ? ` \u2192 max ${maxIterations} iterations` : ""} (resumes the loop if it had stopped).`);
2524
+ } else {
2525
+ console.log(`\u{1F501} Loop ${task ? "started" : "attached"} on session ${fullId.slice(0, 8)}`);
2526
+ if (task) console.log(` Task: ${task.slice(0, 100)}${task.length > 100 ? "..." : ""}`);
2527
+ if (until) console.log(` Until: ${until.slice(0, 100)}${until.length > 100 ? "..." : ""}`);
2528
+ console.log(` Oracle: ${opts?.oracle || "(none)"}`);
2529
+ console.log(` Evaluator: ${evaluator ? "on" : "off"}`);
2530
+ if (opts?.parent) console.log(` Parent review: ${opts.parent.slice(0, 8)}`);
2531
+ if (maxIterations != null) console.log(` Max iterations: ${maxIterations}`);
2532
+ if (!task) console.log(` (hot-plug \u2014 gating the session's current work)`);
2533
+ }
2511
2534
  } finally {
2512
2535
  await server.disconnect();
2513
2536
  }
@@ -1,8 +1,8 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { resolve } from 'node:path';
3
- import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-BYPH6u5o.mjs';
3
+ import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-CI9WGg34.mjs';
4
4
  import { execSync } from 'node:child_process';
5
- import { u as updateIssue, q as addComment, t as addIssue, A as shortId } from './run-n9IQLRFi.mjs';
5
+ import { u as updateIssue, q as addComment, t as addIssue, A as shortId } from './run-9H6Of0HT.mjs';
6
6
  import 'node:os';
7
7
  import 'os';
8
8
  import 'fs/promises';
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-BYPH6u5o.mjs';
3
+ import { connectAndGetMachine } from './commands-CI9WGg34.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:child_process';
6
6
  import 'node:path';
7
7
  import 'node:os';
8
- import './run-n9IQLRFi.mjs';
8
+ import './run-9H6Of0HT.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -1,5 +1,5 @@
1
1
  import { spawnSync } from 'node:child_process';
2
- import { m as resolveProjectRoot } from './run-n9IQLRFi.mjs';
2
+ import { m as resolveProjectRoot } from './run-9H6Of0HT.mjs';
3
3
  import { c as workflowSteps, s as setWorkflowEnabled, i as isWorkflowEnabled, r as removeWorkflow, g as getWorkflow, l as listWorkflows, a as saveWorkflow, b as rawWorkflow } from './store-BTs0H_y0.mjs';
4
4
  import 'os';
5
5
  import 'fs/promises';
@@ -58,7 +58,7 @@ async function serviceExpose(args) {
58
58
  process.exit(1);
59
59
  }
60
60
  if (foreground) {
61
- const { runFrpcTunnel } = await import('./frpc-3mZl1NSJ.mjs');
61
+ const { runFrpcTunnel } = await import('./frpc-_v1in_1L.mjs');
62
62
  await runFrpcTunnel(name, ports, void 0, {
63
63
  group,
64
64
  groupKey,
@@ -68,7 +68,7 @@ async function serviceExpose(args) {
68
68
  });
69
69
  return;
70
70
  }
71
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
71
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
72
72
  const { server, machine } = await connectAndGetMachine();
73
73
  try {
74
74
  const status = await machine.tunnelStart({
@@ -123,7 +123,7 @@ async function serviceServe(args) {
123
123
  };
124
124
  process.on("SIGINT", cleanup);
125
125
  process.on("SIGTERM", cleanup);
126
- const { runFrpcTunnel } = await import('./frpc-3mZl1NSJ.mjs');
126
+ const { runFrpcTunnel } = await import('./frpc-_v1in_1L.mjs');
127
127
  await runFrpcTunnel(name, [caddyPort]);
128
128
  } catch (err) {
129
129
  console.error(`Error serving directory: ${err.message}`);
@@ -132,7 +132,7 @@ async function serviceServe(args) {
132
132
  }
133
133
  async function serviceList(_args) {
134
134
  try {
135
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
135
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
136
136
  const { server, machine } = await connectAndGetMachine();
137
137
  try {
138
138
  const tunnels = await machine.tunnelList({});
@@ -172,7 +172,7 @@ async function serviceDelete(args) {
172
172
  process.exit(1);
173
173
  }
174
174
  try {
175
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
175
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
176
176
  const { server, machine } = await connectAndGetMachine();
177
177
  try {
178
178
  await machine.tunnelStop({ name });
@@ -1,7 +1,7 @@
1
1
  import os from 'os';
2
2
  import fs__default from 'fs';
3
3
  import { resolve, join, relative } from 'path';
4
- import { F as parseFrontmatter, G as getSkillsServer, H as getSkillsWorkspaceName, I as getSkillsCollectionName, J as fetchWithTimeout, K as searchSkills, L as SKILLS_DIR, M as getSkillInfo, N as downloadSkillFile, O as listSkillFiles } from './run-n9IQLRFi.mjs';
4
+ import { F as parseFrontmatter, G as getSkillsServer, H as getSkillsWorkspaceName, I as getSkillsCollectionName, J as fetchWithTimeout, K as searchSkills, L as SKILLS_DIR, M as getSkillInfo, N as downloadSkillFile, O as listSkillFiles } from './run-9H6Of0HT.mjs';
5
5
  import 'fs/promises';
6
6
  import 'url';
7
7
  import 'child_process';
@@ -1,5 +1,5 @@
1
1
  import { execSync } from 'node:child_process';
2
- import { m as resolveProjectRoot, w as searchIssues, v as listIssues, o as resumeIssue, p as pauseIssue, q as addComment, u as updateIssue, n as getIssue, x as isVisibleTo, z as summarize, t as addIssue } from './run-n9IQLRFi.mjs';
2
+ import { m as resolveProjectRoot, w as searchIssues, v as listIssues, o as resumeIssue, p as pauseIssue, q as addComment, u as updateIssue, n as getIssue, x as isVisibleTo, z as summarize, t as addIssue } from './run-9H6Of0HT.mjs';
3
3
  import 'os';
4
4
  import 'fs/promises';
5
5
  import 'fs';
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import os from 'node:os';
4
- import { c as connectToHypha } from './run-n9IQLRFi.mjs';
4
+ import { c as connectToHypha } from './run-9H6Of0HT.mjs';
5
5
  import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
@@ -4,7 +4,7 @@ import { mkdirSync, writeFileSync, unlinkSync, existsSync, chmodSync, readFileSy
4
4
  import { join } from 'path';
5
5
  import { homedir, platform, arch } from 'os';
6
6
  import { randomUUID, createHash } from 'crypto';
7
- import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-n9IQLRFi.mjs';
7
+ import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-9H6Of0HT.mjs';
8
8
  import 'fs/promises';
9
9
  import 'url';
10
10
  import 'node:crypto';
@@ -1,5 +1,5 @@
1
- import { P as resolveModel, a1 as describeMisconfiguration, a2 as buildMachineDeps } from './run-n9IQLRFi.mjs';
2
- import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-CnLkQa7I.mjs';
1
+ import { P as resolveModel, a1 as describeMisconfiguration, a2 as buildMachineDeps } from './run-9H6Of0HT.mjs';
2
+ import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-_ZCZ7bLW.mjs';
3
3
  import { WebSocket } from 'ws';
4
4
  import { execSync, spawn } from 'child_process';
5
5
  import 'os';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-n9IQLRFi.mjs';
1
+ export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-9H6Of0HT.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,5 +1,5 @@
1
1
  var name = "svamp-cli";
2
- var version = "0.2.205";
2
+ var version = "0.2.207";
3
3
  var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
4
4
  var author = "Amun AI AB";
5
5
  var license = "SEE LICENSE IN LICENSE";
@@ -1,4 +1,4 @@
1
- import { m as resolveProjectRoot, u as updateIssue, n as getIssue, o as resumeIssue, p as pauseIssue, q as addComment, t as addIssue, v as listIssues, w as searchIssues, x as isVisibleTo } from './run-n9IQLRFi.mjs';
1
+ import { m as resolveProjectRoot, u as updateIssue, n as getIssue, o as resumeIssue, p as pauseIssue, q as addComment, t as addIssue, v as listIssues, w as searchIssues, x as isVisibleTo } from './run-9H6Of0HT.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -94,7 +94,7 @@ function issueRpc(cwd, params, deps = {}) {
94
94
  original = src;
95
95
  body = void 0;
96
96
  }
97
- return addIssue(root, {
97
+ const created = addIssue(root, {
98
98
  title,
99
99
  status: "ready",
100
100
  scope,
@@ -108,6 +108,11 @@ function issueRpc(cwd, params, deps = {}) {
108
108
  original,
109
109
  body
110
110
  });
111
+ if (params.rekick) {
112
+ const loopOwner = created.session || created.owner;
113
+ if (loopOwner) deps.rekickLoopOwner?.(String(loopOwner), { skipStalled: true });
114
+ }
115
+ return created;
111
116
  }
112
117
  case "comment": {
113
118
  const text = String(params.text || "");
@@ -125,6 +130,8 @@ function issueRpc(cwd, params, deps = {}) {
125
130
  case "resume": {
126
131
  const updated = resumeIssue(root, String(params.id), params.answer ? String(params.answer) : void 0);
127
132
  if (!updated) throw new Error(`Issue not found: ${params.id}`);
133
+ const loopOwner = updated.session || updated.owner;
134
+ if (loopOwner) deps.rekickLoopOwner?.(String(loopOwner));
128
135
  return updated;
129
136
  }
130
137
  case "status": {
@@ -1,4 +1,4 @@
1
- import { m as resolveProjectRoot } from './run-n9IQLRFi.mjs';
1
+ import { m as resolveProjectRoot } from './run-9H6Of0HT.mjs';
2
2
  import { g as getWorkflow, s as setWorkflowEnabled, r as removeWorkflow, a as saveWorkflow, b as rawWorkflow, l as listWorkflows } from './store-BTs0H_y0.mjs';
3
3
  import { g as getRun, l as listRuns, r as runWorkflow } from './runStore-CtptN7US.mjs';
4
4
  import 'os';
@@ -2912,7 +2912,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
2912
2912
  const tunnels = handlers.tunnels;
2913
2913
  if (!tunnels) throw new Error("Tunnel management not available");
2914
2914
  if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
2915
- const { FrpcTunnel } = await import('./frpc-3mZl1NSJ.mjs');
2915
+ const { FrpcTunnel } = await import('./frpc-_v1in_1L.mjs');
2916
2916
  const tunnel = new FrpcTunnel({
2917
2917
  name: params.name,
2918
2918
  ports: params.ports,
@@ -3359,7 +3359,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
3359
3359
  }
3360
3360
  const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
3361
3361
  const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
3362
- const { toolsForRole } = await import('./sideband-CnLkQa7I.mjs');
3362
+ const { toolsForRole } = await import('./sideband-_ZCZ7bLW.mjs');
3363
3363
  const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
3364
3364
  return fmt(r2);
3365
3365
  }
@@ -3458,7 +3458,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
3458
3458
  if (r.error || !r.sender) return { error: r.error || "unauthorized" };
3459
3459
  const callId = "call_" + Math.random().toString(16).slice(2, 12);
3460
3460
  const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
3461
- const { queryCore } = await import('./commands-BYPH6u5o.mjs');
3461
+ const { queryCore } = await import('./commands-CI9WGg34.mjs');
3462
3462
  const timeout = c.reply?.timeout_sec || 120;
3463
3463
  let result;
3464
3464
  try {
@@ -11605,7 +11605,10 @@ function createSvampConfigChecker(directory, sessionId, getMetadata, setMetadata
11605
11605
  announcedLoopStart = key;
11606
11606
  const iter = typeof s.iteration === "number" ? s.iteration : 0;
11607
11607
  const plural = iter === 1 ? "" : "s";
11608
- const msg = s.phase === "done" ? `\u{1F501} Loop complete \u2705 \u2014 finished after ${iter} iteration${plural}.` : `\u{1F501} Loop stopped \u{1F6D1} \u2014 gave up after ${iter} iteration${plural}${s.gave_up_reason ? ` (${s.gave_up_reason})` : ""}.`;
11608
+ const gaveUpCfg = readLoopJson(directory, sessionId, "loop.config.json") || {};
11609
+ const curMax = typeof gaveUpCfg.max_iterations === "number" ? gaveUpCfg.max_iterations : iter;
11610
+ const nextMax = Math.max(curMax * 2, iter + 10);
11611
+ const msg = s.phase === "done" ? `\u{1F501} Loop complete \u2705 \u2014 finished after ${iter} iteration${plural}.` : `\u{1F501} Loop paused \u{1F6D1} \u2014 hit its iteration limit (${iter}/${curMax}) and did NOT finish${s.gave_up_reason ? ` (${s.gave_up_reason})` : ""}. Resume & extend with: svamp session loop-resume ${sessionId} --max ${nextMax}`;
11609
11612
  sessionService.pushMessage(
11610
11613
  s.phase === "gave_up" ? { type: "message", message: msg, level: "warning" } : { type: "message", message: msg },
11611
11614
  "event"
@@ -11658,7 +11661,46 @@ function createSvampConfigChecker(directory, sessionId, getMetadata, setMetadata
11658
11661
  }
11659
11662
  const task = cfg && typeof cfg.task === "string" && cfg.task.trim() ? cfg.task.trim() : void 0;
11660
11663
  const until = cfg && typeof cfg.until === "string" && cfg.until.trim() ? cfg.until.trim() : cfg && typeof cfg.criteria === "string" && cfg.criteria.trim() ? cfg.criteria.trim() : void 0;
11661
- if (cfg && typeof cfg === "object" && (task || until)) {
11664
+ const onlyLimit = cfg && typeof cfg === "object" && !task && !until && (typeof cfg.max_iterations === "number" || typeof cfg.max_rounds === "number" || cfg.budget);
11665
+ if (onlyLimit) {
11666
+ const existing = readLoopState(directory, sessionId);
11667
+ if (!existing) {
11668
+ sessionService.pushMessage({ type: "message", message: 'No loop to modify \u2014 start one with: svamp session loop <id> "<task>" --until "<criteria>" --max N', level: "warning" }, "event");
11669
+ } else {
11670
+ const newMax = typeof cfg.max_iterations === "number" ? cfg.max_iterations : typeof cfg.max_rounds === "number" ? cfg.max_rounds : void 0;
11671
+ try {
11672
+ const lcPath = join$1(getLoopDir(directory, sessionId), "loop.config.json");
11673
+ const lc = readLoopJson(directory, sessionId, "loop.config.json") || {};
11674
+ if (newMax != null) lc.max_iterations = newMax;
11675
+ const b = parseLoopBudget(cfg.budget);
11676
+ if (b) lc.budget = { ...lc.budget || {}, ...b };
11677
+ writeFileSync$1(lcPath, JSON.stringify(lc, null, 2));
11678
+ } catch {
11679
+ }
11680
+ const wasStopped = existing.active === false || existing.phase === "done" || existing.phase === "gave_up";
11681
+ if (wasStopped && existing.phase !== "cancelled") {
11682
+ try {
11683
+ const sp = join$1(getLoopDir(directory, sessionId), "loop-state.json");
11684
+ writeFileSync$1(sp, JSON.stringify({
11685
+ ...existing,
11686
+ active: true,
11687
+ phase: "continue",
11688
+ iteration: 0,
11689
+ completed_at: void 0,
11690
+ gave_up_reason: void 0,
11691
+ stall_hinted: false,
11692
+ resumed_at: Date.now()
11693
+ }, null, 2));
11694
+ } catch {
11695
+ }
11696
+ const eq = getMetadata().messageQueue || [];
11697
+ setMetadata((m) => ({ ...m, messageQueue: [...eq, { id: randomUUID$1(), text: "Continue the loop. Read LOOP.md and keep working toward the exit conditions until the Stop gate confirms completion.", displayText: "\u{1F501} Resuming loop", createdAt: Date.now() }] }));
11698
+ }
11699
+ onLoopActivated?.();
11700
+ sessionService.pushMessage({ type: "message", message: `\u{1F501} Loop limit updated${newMax != null ? ` \u2192 max ${newMax} iterations` : ""}${wasStopped ? " \u2014 resuming" : ""}.` }, "event");
11701
+ logger.log(`[svampConfig] Loop limit modified (max=${newMax}, resumed=${wasStopped})`);
11702
+ }
11703
+ } else if (cfg && typeof cfg === "object" && (task || until)) {
11662
11704
  const oracle = typeof cfg.oracle === "string" && cfg.oracle.trim() ? cfg.oracle.trim() : void 0;
11663
11705
  const evaluator = cfg.evaluator !== false;
11664
11706
  const maxIterations = typeof cfg.max_iterations === "number" ? cfg.max_iterations : typeof cfg.max_rounds === "number" ? cfg.max_rounds : 20;
@@ -12139,7 +12181,7 @@ async function startDaemon(options) {
12139
12181
  saveExposedTunnels(list);
12140
12182
  }
12141
12183
  async function createExposedTunnel(spec) {
12142
- const { FrpcTunnel } = await import('./frpc-3mZl1NSJ.mjs');
12184
+ const { FrpcTunnel } = await import('./frpc-_v1in_1L.mjs');
12143
12185
  const tunnel = new FrpcTunnel({
12144
12186
  name: spec.name,
12145
12187
  ports: spec.ports,
@@ -12159,7 +12201,7 @@ async function startDaemon(options) {
12159
12201
  return tunnel;
12160
12202
  }
12161
12203
  const tunnelRecreateState = /* @__PURE__ */ new Map();
12162
- const { ServeManager } = await import('./serveManager-CKkCHofi.mjs');
12204
+ const { ServeManager } = await import('./serveManager-DLgPs76r.mjs');
12163
12205
  const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
12164
12206
  ensureAutoInstalledSkills(logger).catch(() => {
12165
12207
  });
@@ -12262,6 +12304,17 @@ ${v.guidance ? v.guidance + "\n" : ""}Criteria: ${v.criteria || "(none)"}
12262
12304
  } catch {
12263
12305
  }
12264
12306
  };
12307
+ const rekickLoopOwner = (sessionId, opts) => {
12308
+ try {
12309
+ const target = Array.from(pidToTrackedSession.values()).find((t) => t.svampSessionId === sessionId && !t.stopped);
12310
+ if (!target?.rekickLoop) {
12311
+ logger.log(`[issue] resume re-kick skipped \u2014 owner session ${sessionId.slice(0, 8)} not live on this machine`);
12312
+ return;
12313
+ }
12314
+ target.rekickLoop(opts);
12315
+ } catch {
12316
+ }
12317
+ };
12265
12318
  server.on("services_registered", () => {
12266
12319
  if (consecutiveHeartbeatFailures > 0) {
12267
12320
  logger.log(`Hypha reconnection successful \u2014 services re-registered (resetting ${consecutiveHeartbeatFailures} failures)`);
@@ -14040,11 +14093,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
14040
14093
  });
14041
14094
  },
14042
14095
  onIssue: async (params) => {
14043
- const { issueRpc } = await import('./rpc-DCzFvohf.mjs');
14044
- return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner });
14096
+ const { issueRpc } = await import('./rpc-BkpMe22P.mjs');
14097
+ return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
14045
14098
  },
14046
14099
  onWorkflow: async (params) => {
14047
- const { workflowRpc } = await import('./rpc-DRCY1RUn.mjs');
14100
+ const { workflowRpc } = await import('./rpc-Ci-Ge4tu.mjs');
14048
14101
  return workflowRpc(params?.cwd || directory, params || {});
14049
14102
  },
14050
14103
  onRipgrep: async (args, cwd) => {
@@ -14218,6 +14271,37 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
14218
14271
  return claudeProcess || void 0;
14219
14272
  }
14220
14273
  };
14274
+ trackedSession.rekickLoop = () => {
14275
+ if (trackedSession.stopped) return;
14276
+ const s = readLoopState(directory, sessionId);
14277
+ if (!s) return;
14278
+ if (s.phase === "cancelled") return;
14279
+ if (typeof s.session_id === "string" && s.session_id !== sessionId) return;
14280
+ if (s.phase === "gave_up") {
14281
+ logger.log(`[Session ${sessionId}] re-kick skipped \u2014 loop is resource-limit-stalled; human must run \`loop --max N\``);
14282
+ return;
14283
+ }
14284
+ if (s.active === false || s.phase === "done") {
14285
+ try {
14286
+ const lp = join$1(getLoopDir(directory, sessionId), "loop-state.json");
14287
+ writeFileSync$1(lp, JSON.stringify({
14288
+ ...s,
14289
+ active: true,
14290
+ phase: "continue",
14291
+ iteration: 0,
14292
+ completed_at: void 0,
14293
+ gave_up_reason: void 0,
14294
+ stall_hinted: false,
14295
+ resumed_at: Date.now()
14296
+ // #0156: re-arm the stall hint
14297
+ }, null, 2));
14298
+ } catch {
14299
+ }
14300
+ }
14301
+ logger.log(`[Session ${sessionId}] issue change \u2192 re-kicking loop (budget remaining)`);
14302
+ enqueueLoopContinue();
14303
+ processMessageQueueRef?.();
14304
+ };
14221
14305
  pidToTrackedSession.set(randomUUID$1(), trackedSession);
14222
14306
  sessionMetadata = { ...sessionMetadata, lifecycleState: "idle" };
14223
14307
  sessionService.updateMetadata(sessionMetadata);
@@ -14554,11 +14638,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
14554
14638
  });
14555
14639
  },
14556
14640
  onIssue: async (params) => {
14557
- const { issueRpc } = await import('./rpc-DCzFvohf.mjs');
14558
- return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner });
14641
+ const { issueRpc } = await import('./rpc-BkpMe22P.mjs');
14642
+ return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
14559
14643
  },
14560
14644
  onWorkflow: async (params) => {
14561
- const { workflowRpc } = await import('./rpc-DRCY1RUn.mjs');
14645
+ const { workflowRpc } = await import('./rpc-Ci-Ge4tu.mjs');
14562
14646
  return workflowRpc(params?.cwd || directory, params || {});
14563
14647
  },
14564
14648
  onRipgrep: async (args, cwd) => {
@@ -15332,7 +15416,7 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
15332
15416
  const PING_TIMEOUT_MS = 15e3;
15333
15417
  const POST_RECONNECT_GRACE_MS = 2e4;
15334
15418
  const RECONNECT_JITTER_MS = 2500;
15335
- const { WorkflowScheduler } = await import('./scheduler-DlibcB06.mjs');
15419
+ const { WorkflowScheduler } = await import('./scheduler-C7_ILALz.mjs');
15336
15420
  const workflowScheduler = new WorkflowScheduler({
15337
15421
  projectRoots: () => {
15338
15422
  const dirs = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
- import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { a3 as applyClaudeProxyEnv, a4 as composeSessionId, a5 as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, a6 as generateHookSettings } from './run-n9IQLRFi.mjs';
1
+ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { a3 as applyClaudeProxyEnv, a4 as composeSessionId, a5 as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, a6 as generateHookSettings } from './run-9H6Of0HT.mjs';
2
2
  import os from 'node:os';
3
3
  import { resolve, join } from 'node:path';
4
4
  import { existsSync, readFileSync, watch } from 'node:fs';
@@ -1,4 +1,4 @@
1
- import { m as resolveProjectRoot, y as cronMatches } from './run-n9IQLRFi.mjs';
1
+ import { m as resolveProjectRoot, y as cronMatches } from './run-9H6Of0HT.mjs';
2
2
  import { l as listWorkflows, i as isWorkflowEnabled, w as workflowCrons } from './store-BTs0H_y0.mjs';
3
3
  import { r as runWorkflow } from './runStore-CtptN7US.mjs';
4
4
  import 'os';
@@ -54,7 +54,7 @@ async function handleServeCommand() {
54
54
  }
55
55
  }
56
56
  async function serveAdd(args, machineId) {
57
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
57
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
58
58
  const pos = positionalArgs(args);
59
59
  const name = pos[0];
60
60
  if (!name) {
@@ -93,7 +93,7 @@ async function serveAdd(args, machineId) {
93
93
  }
94
94
  }
95
95
  async function serveApply(args, machineId) {
96
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
96
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
97
97
  const fs = await import('fs');
98
98
  const yaml = await import('yaml');
99
99
  const file = positionalArgs(args)[0];
@@ -182,7 +182,7 @@ async function serveApply(args, machineId) {
182
182
  }
183
183
  }
184
184
  async function serveRemove(args, machineId) {
185
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
185
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
186
186
  const pos = positionalArgs(args);
187
187
  const name = pos[0];
188
188
  if (!name) {
@@ -202,7 +202,7 @@ async function serveRemove(args, machineId) {
202
202
  }
203
203
  }
204
204
  async function serveList(args, machineId) {
205
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
205
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
206
206
  const all = hasFlag(args, "--all", "-a");
207
207
  const json = hasFlag(args, "--json");
208
208
  const sessionId = getFlag(args, "--session");
@@ -235,7 +235,7 @@ async function serveList(args, machineId) {
235
235
  }
236
236
  }
237
237
  async function serveInfo(machineId) {
238
- const { connectAndGetMachine } = await import('./commands-BYPH6u5o.mjs');
238
+ const { connectAndGetMachine } = await import('./commands-CI9WGg34.mjs');
239
239
  const { machine, server } = await connectAndGetMachine(machineId);
240
240
  try {
241
241
  const info = await machine.serveInfo();
@@ -4,7 +4,7 @@ import * as fs from 'fs';
4
4
  import * as http from 'http';
5
5
  import * as net from 'net';
6
6
  import * as path from 'path';
7
- import { k as getHyphaServerUrl, S as ServeAuth, l as hasCookieToken } from './run-n9IQLRFi.mjs';
7
+ import { k as getHyphaServerUrl, S as ServeAuth, l as hasCookieToken } from './run-9H6Of0HT.mjs';
8
8
  import 'os';
9
9
  import 'fs/promises';
10
10
  import 'url';
@@ -733,7 +733,7 @@ class ServeManager {
733
733
  const mount = this.mounts.get(mountName);
734
734
  const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, buildLinkSubdomain(subdomainSafe, mount.linkToken)]]) : void 0;
735
735
  try {
736
- const { FrpcTunnel } = await import('./frpc-3mZl1NSJ.mjs');
736
+ const { FrpcTunnel } = await import('./frpc-_v1in_1L.mjs');
737
737
  let tunnel;
738
738
  tunnel = new FrpcTunnel({
739
739
  name: tunnelName,
@@ -1,4 +1,4 @@
1
- import { R as READ_ONLY_TOOLS, B as loadMachineContext, C as buildMachineInstructions, D as machineToolsForRole, E as buildMachineTools } from './run-n9IQLRFi.mjs';
1
+ import { R as READ_ONLY_TOOLS, B as loadMachineContext, C as buildMachineInstructions, D as machineToolsForRole, E as buildMachineTools } from './run-9H6Of0HT.mjs';
2
2
  import 'node:child_process';
3
3
  import 'os';
4
4
  import 'fs/promises';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.2.205",
3
+ "version": "0.2.207",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",