svamp-cli 0.2.256 → 0.2.258

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 (27) hide show
  1. package/bin/skills/artifact/SKILL.md +1 -1
  2. package/dist/{agentCommands-DfTICQUR.mjs → agentCommands-CQ89BZon.mjs} +5 -5
  3. package/dist/{auth-CaFzUB-H.mjs → auth-CaFsKYbx.mjs} +1 -1
  4. package/dist/cli.mjs +61 -61
  5. package/dist/{commands-MopZEqZ7.mjs → commands--X8f4eSr.mjs} +24 -13
  6. package/dist/{commands-Dp4OLJ80.mjs → commands-B6eGMF5H.mjs} +1 -1
  7. package/dist/{commands-Cgi-GKQk.mjs → commands-BgX0W0uK.mjs} +1 -1
  8. package/dist/{commands-BrTyEX8u.mjs → commands-D8l74hsL.mjs} +1 -1
  9. package/dist/{commands-CRvH25K7.mjs → commands-Dd8xEIf0.mjs} +1 -1
  10. package/dist/{commands-C6_ClNDg.mjs → commands-DrfYv705.mjs} +2 -2
  11. package/dist/{commands-DPKRLSJZ.mjs → commands-DutfM3U7.mjs} +31 -15
  12. package/dist/{fleet-DT3LusNA.mjs → fleet-UvQnIWT1.mjs} +1 -1
  13. package/dist/{frpc--8kUn3Em.mjs → frpc-IXxyfgPn.mjs} +1 -1
  14. package/dist/{headlessCli-DJIDtYga.mjs → headlessCli-BK7WSS3D.mjs} +2 -2
  15. package/dist/index.mjs +1 -1
  16. package/dist/{package-CBpvrZJs.mjs → package-BdZX5mDv.mjs} +2 -2
  17. package/dist/{rpc-DPlerDzK.mjs → rpc-CyACkgY1.mjs} +1 -1
  18. package/dist/{rpc-BV_9jVwX.mjs → rpc-D7DB3XCH.mjs} +1 -1
  19. package/dist/{run-BDX-RaEm.mjs → run-C1Unk4Zx.mjs} +108 -84
  20. package/dist/{run-19FUjQ96.mjs → run-C1ufZjIW.mjs} +1 -1
  21. package/dist/{scheduler-CueRBYz_.mjs → scheduler-7wve0Fy3.mjs} +1 -1
  22. package/dist/{serveCommands-DRP03-lg.mjs → serveCommands-iQJJLsMJ.mjs} +5 -5
  23. package/dist/{serveManager-CQGY6nFz.mjs → serveManager-BszV0oIl.mjs} +62 -74
  24. package/dist/{sideband-BQ4pkLIQ.mjs → sideband-DMPZ-ZoR.mjs} +1 -1
  25. package/dist/staticFileServer-FCEOLIYH.mjs +239 -0
  26. package/package.json +2 -2
  27. package/dist/caddy-CuTbE3NY.mjs +0 -322
@@ -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 { T as parseFrontmatter, U as getSkillsServer, V as getSkillsWorkspaceName, W as getSkillsCollectionName, X as fetchWithTimeout, Y as searchSkills, Z as SKILLS_DIR, _ as getSkillInfo, $ as downloadSkillFile, a0 as listSkillFiles } from './run-BDX-RaEm.mjs';
4
+ import { T as parseFrontmatter, U as getSkillsServer, V as getSkillsWorkspaceName, W as getSkillsCollectionName, X as fetchWithTimeout, Y as searchSkills, Z as SKILLS_DIR, _ as getSkillInfo, $ as downloadSkillFile, a0 as listSkillFiles } from './run-C1Unk4Zx.mjs';
5
5
  import 'fs/promises';
6
6
  import 'url';
7
7
  import 'child_process';
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-BrTyEX8u.mjs';
3
+ import { connectAndGetMachine } from './commands-D8l74hsL.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-BDX-RaEm.mjs';
8
+ import './run-C1Unk4Zx.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -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-BrTyEX8u.mjs';
3
+ import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-D8l74hsL.mjs';
4
4
  import { execSync } from 'node:child_process';
5
- import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-BDX-RaEm.mjs';
5
+ import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-C1Unk4Zx.mjs';
6
6
  import 'node:os';
7
7
  import 'os';
8
8
  import 'fs/promises';
@@ -169,6 +169,9 @@ function removeWorktree(worktreePath) {
169
169
  }
170
170
  }
171
171
  }
172
+ function resolveNotifyLead(leadId, childParentSessionId, childId) {
173
+ return leadId || childParentSessionId || childId;
174
+ }
172
175
 
173
176
  function isStandaloneChild(crew) {
174
177
  return !!crew && crew.standalone === true;
@@ -554,25 +557,24 @@ async function featureMerge(childPartial, opts = {}) {
554
557
  console.error("Could not determine the lead project root (base worktree).");
555
558
  process.exit(1);
556
559
  }
557
- if (leadId) {
558
- try {
559
- await inbox(
560
- machine,
561
- leadId,
562
- childId,
563
- `<crew-freeze>Your lead is merging branch ${branch} into ${base}. Stop editing files now; do not commit until told.</crew-freeze>`,
564
- "crew: freeze for merge"
565
- );
566
- } catch {
567
- }
560
+ const notifyLead = resolveNotifyLead(leadId, meta?.parentSessionId, childId);
561
+ try {
562
+ await inbox(
563
+ machine,
564
+ notifyLead,
565
+ childId,
566
+ `<crew-freeze>Your lead is merging branch ${branch} into ${base}. Stop editing files now; do not commit until told.</crew-freeze>`,
567
+ "crew: freeze for merge"
568
+ );
569
+ } catch {
568
570
  }
569
571
  const r = mergeBack({ projectRoot, branch, worktreePath, baseBranch: base, deleteBranch: opts.deleteBranch });
570
572
  if (!r.ok) {
571
- if (r.rework && leadId) {
573
+ if (r.rework) {
572
574
  try {
573
575
  await inbox(
574
576
  machine,
575
- leadId,
577
+ notifyLead,
576
578
  childId,
577
579
  `<crew-rework branch="${branch}">
578
580
  Merge was not applied: ${r.detail}
@@ -585,7 +587,21 @@ Resolve and run \`svamp feature done\` again.
585
587
  console.error(`Merge deferred (rework) at ${r.stage}: ${r.detail}`);
586
588
  console.error(`Child ${childId.slice(0, 8)} re-woken with guidance; left running.`);
587
589
  } else {
590
+ try {
591
+ await inbox(
592
+ machine,
593
+ notifyLead,
594
+ childId,
595
+ `<crew-blocked branch="${branch}">
596
+ Merge could not be applied (${r.stage}): ${r.detail}
597
+ Stop editing and hold \u2014 do not keep working. Once the blocker is resolved, the lead can retry \`svamp feature merge\`.
598
+ </crew-blocked>`,
599
+ "crew: merge blocked"
600
+ );
601
+ } catch {
602
+ }
588
603
  console.error(`Merge failed at ${r.stage}: ${r.detail}`);
604
+ console.error(`Child ${childId.slice(0, 8)} notified + left running (un-merged work preserved). Resolve the blocker, then retry \`svamp feature merge ${childId.slice(0, 8)}\`.`);
589
605
  }
590
606
  process.exit(1);
591
607
  }
@@ -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-BDX-RaEm.mjs';
4
+ import { c as connectToHypha } from './run-C1Unk4Zx.mjs';
5
5
  import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-DuLXaoGP.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-BDX-RaEm.mjs';
7
+ import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-C1Unk4Zx.mjs';
8
8
  import 'fs/promises';
9
9
  import 'url';
10
10
  import 'node:crypto';
@@ -1,5 +1,5 @@
1
- import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-BDX-RaEm.mjs';
2
- import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-BQ4pkLIQ.mjs';
1
+ import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-C1Unk4Zx.mjs';
2
+ import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-DMPZ-ZoR.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-BDX-RaEm.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-C1Unk4Zx.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.256";
2
+ var version = "0.2.258";
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";
@@ -19,7 +19,7 @@ var exports$1 = {
19
19
  var scripts = {
20
20
  build: "rm -rf dist bin/skills bin/commands && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && cp -r ../../skills/crew bin/skills/crew && cp -r ../../commands bin/commands && tsc --noEmit && pkgroll",
21
21
  typecheck: "tsc --noEmit",
22
- test: "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.mjs && npx tsx test/test-instance-config.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-sharing-notify-sync.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && node test/test-supervisor-restart.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs && npx tsx test/test-session-file.mjs && npx tsx test/test-channel-rpc.mjs && npx tsx test/test-wise-agent.mjs && npx tsx test/test-channel-agent.mjs && npx tsx test/test-channels-service.mjs && npx tsx test/test-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-graceful-restart.mjs",
22
+ test: "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.mjs && npx tsx test/test-instance-config.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-sharing-notify-sync.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && node test/test-supervisor-restart.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-static-file-server.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs && npx tsx test/test-session-file.mjs && npx tsx test/test-channel-rpc.mjs && npx tsx test/test-wise-agent.mjs && npx tsx test/test-channel-agent.mjs && npx tsx test/test-channels-service.mjs && npx tsx test/test-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-graceful-restart.mjs",
23
23
  "test:hypha": "node --no-warnings test/test-hypha-service.mjs",
24
24
  dev: "tsx src/cli.ts",
25
25
  "dev:daemon": "tsx src/cli.ts daemon start-sync",
@@ -1,4 +1,4 @@
1
- import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-BDX-RaEm.mjs';
1
+ import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-C1Unk4Zx.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,4 +1,4 @@
1
- import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-BDX-RaEm.mjs';
1
+ import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-C1Unk4Zx.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -2985,7 +2985,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
2985
2985
  const tunnels = handlers.tunnels;
2986
2986
  if (!tunnels) throw new Error("Tunnel management not available");
2987
2987
  if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
2988
- const { FrpcTunnel } = await import('./frpc--8kUn3Em.mjs');
2988
+ const { FrpcTunnel } = await import('./frpc-IXxyfgPn.mjs');
2989
2989
  const tunnel = new FrpcTunnel({
2990
2990
  name: params.name,
2991
2991
  ports: params.ports,
@@ -3452,7 +3452,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
3452
3452
  }
3453
3453
  const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
3454
3454
  const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
3455
- const { toolsForRole } = await import('./sideband-BQ4pkLIQ.mjs');
3455
+ const { toolsForRole } = await import('./sideband-DMPZ-ZoR.mjs');
3456
3456
  const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
3457
3457
  return fmt(r2);
3458
3458
  }
@@ -3551,7 +3551,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
3551
3551
  if (r.error || !r.sender) return { error: r.error || "unauthorized" };
3552
3552
  const callId = "call_" + Math.random().toString(16).slice(2, 12);
3553
3553
  const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
3554
- const { queryCore } = await import('./commands-BrTyEX8u.mjs');
3554
+ const { queryCore } = await import('./commands-D8l74hsL.mjs');
3555
3555
  const timeout = c.reply?.timeout_sec || 120;
3556
3556
  let result;
3557
3557
  try {
@@ -10239,21 +10239,37 @@ class ProcessSupervisor {
10239
10239
  * a desired-stopped intent so a daemon restart does not resurrect it. `stopAll` (a daemon
10240
10240
  * shutdown, not a user action) passes false so keepAlive processes auto-restore (#nightly).
10241
10241
  */
10242
+ /**
10243
+ * #0347: run `fn` in the entry's lifecycle critical section. Each call awaits the previous
10244
+ * lifecycle op's SETTLEMENT before running, so stop/restart/apply/update/remove are strictly
10245
+ * serialized per entry and can never interleave across an `await killChild` (which is what let
10246
+ * two ops double-spawn an orphan, or resurrect a just-stopped process). The chain tail never
10247
+ * rejects (a failed op must not wedge the queue); the caller still gets the real result/error.
10248
+ */
10249
+ runExclusive(entry, fn) {
10250
+ const prev = entry.opLock ?? Promise.resolve();
10251
+ const result = prev.then(fn, fn);
10252
+ entry.opLock = result.then(() => void 0, () => void 0);
10253
+ return result;
10254
+ }
10242
10255
  async stop(idOrName, opts) {
10243
10256
  const entry = this.require(idOrName);
10244
10257
  entry.stopping = true;
10245
10258
  this.clearTimers(entry);
10246
- if (entry.child) {
10247
- await this.killChild(entry.child);
10248
- entry.child = void 0;
10249
- }
10250
- entry.state.status = "stopped";
10251
- entry.state.stoppedAt = Date.now();
10252
- entry.state.pid = void 0;
10253
- if (opts?.markDesiredStopped !== false && !entry.deleted && !entry.spec.desiredStopped) {
10254
- entry.spec.desiredStopped = true;
10255
- await this.persistSpec(entry.spec);
10256
- }
10259
+ return this.runExclusive(entry, async () => {
10260
+ entry.stopping = true;
10261
+ if (entry.child) {
10262
+ await this.killChild(entry.child);
10263
+ entry.child = void 0;
10264
+ }
10265
+ entry.state.status = "stopped";
10266
+ entry.state.stoppedAt = Date.now();
10267
+ entry.state.pid = void 0;
10268
+ if (opts?.markDesiredStopped !== false && !entry.deleted && !entry.spec.desiredStopped) {
10269
+ entry.spec.desiredStopped = true;
10270
+ await this.persistSpec(entry.spec);
10271
+ }
10272
+ });
10257
10273
  }
10258
10274
  /** Restart a process (stop if running, then start again). */
10259
10275
  async restart(idOrName) {
@@ -10261,25 +10277,27 @@ class ProcessSupervisor {
10261
10277
  if (entry.deleted) throw new Error(`Process '${idOrName}' has been removed`);
10262
10278
  if (entry.restarting) return;
10263
10279
  entry.restarting = true;
10264
- try {
10265
- if (entry.child) {
10266
- entry.stopping = true;
10267
- this.clearTimers(entry);
10268
- await this.killChild(entry.child);
10269
- entry.child = void 0;
10270
- }
10271
- if (entry.deleted) return;
10272
- entry.stopping = false;
10273
- this.resetFailureTracking(entry);
10274
- if (entry.spec.desiredStopped) {
10275
- entry.spec.desiredStopped = false;
10276
- await this.persistSpec(entry.spec);
10280
+ return this.runExclusive(entry, async () => {
10281
+ try {
10282
+ if (entry.child) {
10283
+ entry.stopping = true;
10284
+ this.clearTimers(entry);
10285
+ await this.killChild(entry.child);
10286
+ entry.child = void 0;
10287
+ }
10288
+ if (entry.deleted) return;
10289
+ entry.stopping = false;
10290
+ this.resetFailureTracking(entry);
10291
+ if (entry.spec.desiredStopped) {
10292
+ entry.spec.desiredStopped = false;
10293
+ await this.persistSpec(entry.spec);
10294
+ }
10295
+ entry.state.restartCount++;
10296
+ await this.startEntry(entry, false);
10297
+ } finally {
10298
+ entry.restarting = false;
10277
10299
  }
10278
- entry.state.restartCount++;
10279
- await this.startEntry(entry, false);
10280
- } finally {
10281
- entry.restarting = false;
10282
- }
10300
+ });
10283
10301
  }
10284
10302
  /** Stop the process and remove it from supervision (deletes persisted spec). */
10285
10303
  async remove(idOrName) {
@@ -10288,15 +10306,17 @@ class ProcessSupervisor {
10288
10306
  entry.deleted = true;
10289
10307
  entry.stopping = true;
10290
10308
  this.clearTimers(entry);
10291
- if (entry.child) {
10292
- await this.killChild(entry.child);
10293
- entry.child = void 0;
10294
- }
10295
- entry.state.status = "stopped";
10296
- entry.state.stoppedAt = Date.now();
10297
- entry.state.pid = void 0;
10298
- this.entries.delete(id);
10299
- await this.deleteSpec(id);
10309
+ return this.runExclusive(entry, async () => {
10310
+ if (entry.child) {
10311
+ await this.killChild(entry.child);
10312
+ entry.child = void 0;
10313
+ }
10314
+ entry.state.status = "stopped";
10315
+ entry.state.stoppedAt = Date.now();
10316
+ entry.state.pid = void 0;
10317
+ this.entries.delete(id);
10318
+ await this.deleteSpec(id);
10319
+ });
10300
10320
  }
10301
10321
  /** List all supervised processes. */
10302
10322
  list() {
@@ -10330,26 +10350,28 @@ class ProcessSupervisor {
10330
10350
  if (this.specsEqual(existing.spec, spec)) {
10331
10351
  return { action: "no-change", info: this.toInfo(existing) };
10332
10352
  }
10333
- const updatedSpec = {
10334
- ...spec,
10335
- id: existing.spec.id,
10336
- createdAt: existing.spec.createdAt
10337
- // preserve original creation time
10338
- };
10339
- existing.spec = updatedSpec;
10340
- await this.persistSpec(updatedSpec);
10341
- existing.stopping = true;
10342
- this.clearTimers(existing);
10343
- if (existing.child) {
10344
- await this.killChild(existing.child);
10345
- existing.child = void 0;
10346
- }
10347
- if (existing.deleted) return { action: "updated", info: this.toInfo(existing) };
10348
- existing.stopping = false;
10349
- this.resetFailureTracking(existing);
10350
- existing.state.status = "starting";
10351
- this.spawnProcess(existing);
10352
- return { action: "updated", info: this.toInfo(existing) };
10353
+ return this.runExclusive(existing, async () => {
10354
+ const updatedSpec = {
10355
+ ...spec,
10356
+ id: existing.spec.id,
10357
+ createdAt: existing.spec.createdAt
10358
+ // preserve original creation time
10359
+ };
10360
+ existing.spec = updatedSpec;
10361
+ await this.persistSpec(updatedSpec);
10362
+ existing.stopping = true;
10363
+ this.clearTimers(existing);
10364
+ if (existing.child) {
10365
+ await this.killChild(existing.child);
10366
+ existing.child = void 0;
10367
+ }
10368
+ if (existing.deleted) return { action: "updated", info: this.toInfo(existing) };
10369
+ existing.stopping = false;
10370
+ this.resetFailureTracking(existing);
10371
+ existing.state.status = "starting";
10372
+ this.spawnProcess(existing);
10373
+ return { action: "updated", info: this.toInfo(existing) };
10374
+ });
10353
10375
  }
10354
10376
  /**
10355
10377
  * Update a running process's spec and restart it.
@@ -10358,21 +10380,23 @@ class ProcessSupervisor {
10358
10380
  async update(idOrName, partialSpec) {
10359
10381
  const entry = this.require(idOrName);
10360
10382
  if (entry.deleted) throw new Error(`Process '${idOrName}' has been removed`);
10361
- const updatedSpec = { ...entry.spec, ...partialSpec };
10362
- entry.spec = updatedSpec;
10363
- await this.persistSpec(updatedSpec);
10364
- entry.stopping = true;
10365
- this.clearTimers(entry);
10366
- if (entry.child) {
10367
- await this.killChild(entry.child);
10368
- entry.child = void 0;
10369
- }
10370
- if (entry.deleted) return this.toInfo(entry);
10371
- entry.stopping = false;
10372
- this.resetFailureTracking(entry);
10373
- entry.state.status = "starting";
10374
- this.spawnProcess(entry);
10375
- return this.toInfo(entry);
10383
+ return this.runExclusive(entry, async () => {
10384
+ const updatedSpec = { ...entry.spec, ...partialSpec };
10385
+ entry.spec = updatedSpec;
10386
+ await this.persistSpec(updatedSpec);
10387
+ entry.stopping = true;
10388
+ this.clearTimers(entry);
10389
+ if (entry.child) {
10390
+ await this.killChild(entry.child);
10391
+ entry.child = void 0;
10392
+ }
10393
+ if (entry.deleted) return this.toInfo(entry);
10394
+ entry.stopping = false;
10395
+ this.resetFailureTracking(entry);
10396
+ entry.state.status = "starting";
10397
+ this.spawnProcess(entry);
10398
+ return this.toInfo(entry);
10399
+ });
10376
10400
  }
10377
10401
  // ── Spec equality ─────────────────────────────────────────────────────────
10378
10402
  /** Compare two specs for equality (ignoring id, createdAt, and runtime state). */
@@ -13534,7 +13558,7 @@ async function startDaemon(options) {
13534
13558
  try {
13535
13559
  const dir = loadSessionIndex()[sessionId]?.directory;
13536
13560
  if (!dir) return;
13537
- const { reconcileServiceLinks } = await import('./agentCommands-DfTICQUR.mjs');
13561
+ const { reconcileServiceLinks } = await import('./agentCommands-CQ89BZon.mjs');
13538
13562
  const configPath = getSvampConfigPath(dir, sessionId);
13539
13563
  const config = readSvampConfig(configPath);
13540
13564
  const entries = Array.from(urls.entries());
@@ -13552,7 +13576,7 @@ async function startDaemon(options) {
13552
13576
  }
13553
13577
  }
13554
13578
  async function createExposedTunnel(spec) {
13555
- const { FrpcTunnel } = await import('./frpc--8kUn3Em.mjs');
13579
+ const { FrpcTunnel } = await import('./frpc-IXxyfgPn.mjs');
13556
13580
  const tunnel = new FrpcTunnel({
13557
13581
  name: spec.name,
13558
13582
  ports: spec.ports,
@@ -13573,7 +13597,7 @@ async function startDaemon(options) {
13573
13597
  }
13574
13598
  const tunnelRecreateState = /* @__PURE__ */ new Map();
13575
13599
  const tunnelRecreateInFlight = /* @__PURE__ */ new Set();
13576
- const { ServeManager } = await import('./serveManager-CQGY6nFz.mjs');
13600
+ const { ServeManager } = await import('./serveManager-BszV0oIl.mjs');
13577
13601
  const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
13578
13602
  ensureAutoInstalledSkills(logger).catch(() => {
13579
13603
  });
@@ -15689,11 +15713,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
15689
15713
  });
15690
15714
  },
15691
15715
  onIssue: async (params) => {
15692
- const { issueRpc } = await import('./rpc-BV_9jVwX.mjs');
15716
+ const { issueRpc } = await import('./rpc-D7DB3XCH.mjs');
15693
15717
  return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
15694
15718
  },
15695
15719
  onWorkflow: async (params) => {
15696
- const { workflowRpc } = await import('./rpc-DPlerDzK.mjs');
15720
+ const { workflowRpc } = await import('./rpc-CyACkgY1.mjs');
15697
15721
  return workflowRpc(params?.cwd || directory, params || {});
15698
15722
  },
15699
15723
  onRipgrep: async (args, cwd) => {
@@ -16242,11 +16266,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
16242
16266
  });
16243
16267
  },
16244
16268
  onIssue: async (params) => {
16245
- const { issueRpc } = await import('./rpc-BV_9jVwX.mjs');
16269
+ const { issueRpc } = await import('./rpc-D7DB3XCH.mjs');
16246
16270
  return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
16247
16271
  },
16248
16272
  onWorkflow: async (params) => {
16249
- const { workflowRpc } = await import('./rpc-DPlerDzK.mjs');
16273
+ const { workflowRpc } = await import('./rpc-CyACkgY1.mjs');
16250
16274
  return workflowRpc(params?.cwd || directory, params || {});
16251
16275
  },
16252
16276
  onRipgrep: async (args, cwd) => {
@@ -17211,7 +17235,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
17211
17235
  const PING_TIMEOUT_MS = 15e3;
17212
17236
  const POST_RECONNECT_GRACE_MS = 2e4;
17213
17237
  const RECONNECT_JITTER_MS = 2500;
17214
- const { WorkflowScheduler } = await import('./scheduler-CueRBYz_.mjs');
17238
+ const { WorkflowScheduler } = await import('./scheduler-7wve0Fy3.mjs');
17215
17239
  const workflowScheduler = new WorkflowScheduler({
17216
17240
  projectRoots: () => {
17217
17241
  const dirs = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
- import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-BDX-RaEm.mjs';
1
+ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-C1Unk4Zx.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 { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-BDX-RaEm.mjs';
1
+ import { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-C1Unk4Zx.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -54,7 +54,7 @@ async function handleServeCommand() {
54
54
  }
55
55
  }
56
56
  async function serveAdd(args, machineId) {
57
- const { connectAndGetMachine } = await import('./commands-BrTyEX8u.mjs');
57
+ const { connectAndGetMachine } = await import('./commands-D8l74hsL.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-BrTyEX8u.mjs');
96
+ const { connectAndGetMachine } = await import('./commands-D8l74hsL.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-BrTyEX8u.mjs');
185
+ const { connectAndGetMachine } = await import('./commands-D8l74hsL.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-BrTyEX8u.mjs');
205
+ const { connectAndGetMachine } = await import('./commands-D8l74hsL.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-BrTyEX8u.mjs');
238
+ const { connectAndGetMachine } = await import('./commands-D8l74hsL.mjs');
239
239
  const { machine, server } = await connectAndGetMachine(machineId);
240
240
  try {
241
241
  const info = await machine.serveInfo();