svamp-cli 0.2.329 → 0.2.330

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/dist/{adminCommands-C-p7ayqB.mjs → adminCommands-CeAsjKoA.mjs} +1 -1
  2. package/dist/{agentCommands-B4sCl_5R.mjs → agentCommands-CDj6yTgX.mjs} +5 -5
  3. package/dist/{auth-X_CjxN_J.mjs → auth-CtiKOzhL.mjs} +1 -1
  4. package/dist/{cli-BY4DQnRs.mjs → cli-CZ4D7AII.mjs} +77 -77
  5. package/dist/cli.mjs +2 -2
  6. package/dist/{commands-BR5FB3lB.mjs → commands-71PkPL_M.mjs} +2 -2
  7. package/dist/{commands-BInj_IDQ.mjs → commands-BFkBvM5j.mjs} +3 -3
  8. package/dist/{commands-rKfH5E8g.mjs → commands-BOBRaVaF.mjs} +1 -1
  9. package/dist/{commands-BQjZb1eL.mjs → commands-BRTTViag.mjs} +3 -3
  10. package/dist/{commands-rmxjAHLz.mjs → commands-BXjej1wP.mjs} +3 -3
  11. package/dist/{commands-6uHR7YHf.mjs → commands-DiBOzYv7.mjs} +11 -11
  12. package/dist/{commands-CEURyD-l.mjs → commands-DkIbjVr6.mjs} +1 -1
  13. package/dist/{commands-C8uGnx2z.mjs → commands-WJbeIMNx.mjs} +2 -2
  14. package/dist/{fleet-CxxkWc3z.mjs → fleet-DmTm6tsY.mjs} +1 -1
  15. package/dist/{headlessCli-NkXGxjrT.mjs → headlessCli-DqlYDREf.mjs} +2 -2
  16. package/dist/index.mjs +1 -1
  17. package/dist/{notifyCommands-CEvdTCIS.mjs → notifyCommands-WZDIxM_h.mjs} +1 -1
  18. package/dist/{package-BNriEfp8.mjs → package-CT65p79F.mjs} +2 -2
  19. package/dist/{rpc-q5KTMSRl.mjs → rpc-CFb-c-Nu.mjs} +1 -1
  20. package/dist/{rpc-fZm83jEI.mjs → rpc-tO-T8OWN.mjs} +1 -1
  21. package/dist/{run-C7JwLKGe.mjs → run-CA3J4pGr.mjs} +1 -1
  22. package/dist/{run-1CHjd0_g.mjs → run-ON_xcuFF.mjs} +121 -11
  23. package/dist/{scheduler-DTRcVW02.mjs → scheduler-DtzofW-S.mjs} +1 -1
  24. package/dist/{serveCommands-CXlZ6Bdy.mjs → serveCommands-DBz696oe.mjs} +10 -10
  25. package/dist/{sideband-C4QaSCEM.mjs → sideband-CDQJ24BM.mjs} +1 -1
  26. package/package.json +3 -3
@@ -1,12 +1,12 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-rKfH5E8g.mjs';
4
- import { w as wantsHelp } from './cli-BY4DQnRs.mjs';
3
+ import { connectAndGetMachine } from './commands-BOBRaVaF.mjs';
4
+ import { w as wantsHelp } from './cli-CZ4D7AII.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:child_process';
7
7
  import 'node:path';
8
8
  import 'node:os';
9
- import './run-1CHjd0_g.mjs';
9
+ import './run-ON_xcuFF.mjs';
10
10
  import 'os';
11
11
  import 'fs/promises';
12
12
  import 'url';
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { execSync, execFileSync } from 'node:child_process';
3
3
  import { basename, resolve, join, isAbsolute } from 'node:path';
4
4
  import os from 'node:os';
5
- import { a2 as formatHandle, a3 as normalizeAllowedUser, a4 as loadSecurityContextConfig, a5 as resolveSecurityContext, a6 as buildSecurityContextFromFlags, a7 as mergeSecurityContexts, c as connectToHypha, a8 as buildSessionShareUrl, a9 as computeOutboundHop, e as shortId, aa as registerAwaitingReply, ab as buildMachineShareUrl, ac as parseHandle, ad as handleMatchesMetadata } from './run-1CHjd0_g.mjs';
5
+ import { a2 as formatHandle, a3 as normalizeAllowedUser, a4 as loadSecurityContextConfig, a5 as resolveSecurityContext, a6 as buildSecurityContextFromFlags, a7 as mergeSecurityContexts, c as connectToHypha, a8 as buildSessionShareUrl, a9 as computeOutboundHop, e as shortId, aa as registerAwaitingReply, ab as buildMachineShareUrl, ac as parseHandle, ad as handleMatchesMetadata } from './run-ON_xcuFF.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -1,10 +1,10 @@
1
- import { connectAndResolveSession } from './commands-rKfH5E8g.mjs';
2
- import { w as wantsHelp } from './cli-BY4DQnRs.mjs';
1
+ import { connectAndResolveSession } from './commands-BOBRaVaF.mjs';
2
+ import { w as wantsHelp } from './cli-CZ4D7AII.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:child_process';
5
5
  import 'node:path';
6
6
  import 'node:os';
7
- import './run-1CHjd0_g.mjs';
7
+ import './run-ON_xcuFF.mjs';
8
8
  import 'os';
9
9
  import 'fs/promises';
10
10
  import 'fs';
@@ -1,9 +1,9 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { join, resolve } from 'node:path';
3
- import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-rKfH5E8g.mjs';
3
+ import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-BOBRaVaF.mjs';
4
4
  import { execFileSync } from 'node:child_process';
5
- import { ah as withFileLock, u as updateIssue, j as addComment, k as addIssue, e as shortId } from './run-1CHjd0_g.mjs';
6
- import { w as wantsHelp } from './cli-BY4DQnRs.mjs';
5
+ import { ah as withFileLock, u as updateIssue, j as addComment, k as addIssue, e as shortId } from './run-ON_xcuFF.mjs';
6
+ import { w as wantsHelp } from './cli-CZ4D7AII.mjs';
7
7
  import 'node:os';
8
8
  import 'os';
9
9
  import 'fs/promises';
@@ -1,6 +1,6 @@
1
1
  import * as path from 'path';
2
- import { w as wantsHelp } from './cli-BY4DQnRs.mjs';
3
- import './run-1CHjd0_g.mjs';
2
+ import { w as wantsHelp } from './cli-CZ4D7AII.mjs';
3
+ import './run-ON_xcuFF.mjs';
4
4
  import 'os';
5
5
  import 'fs/promises';
6
6
  import 'fs';
@@ -83,7 +83,7 @@ async function serviceExpose(args) {
83
83
  process.exit(1);
84
84
  }
85
85
  if (foreground) {
86
- const { runFrpcTunnel } = await import('./run-1CHjd0_g.mjs').then(function (n) { return n.ap; });
86
+ const { runFrpcTunnel } = await import('./run-ON_xcuFF.mjs').then(function (n) { return n.ap; });
87
87
  await runFrpcTunnel(name, ports, void 0, {
88
88
  group,
89
89
  groupKey,
@@ -93,7 +93,7 @@ async function serviceExpose(args) {
93
93
  });
94
94
  return;
95
95
  }
96
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
96
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
97
97
  const { server, machine } = await connectAndGetMachine();
98
98
  try {
99
99
  const status = await machine.tunnelStart({
@@ -115,7 +115,7 @@ async function serviceExpose(args) {
115
115
  console.log(` port ${port}: ${url}`);
116
116
  }
117
117
  if (process.env.SVAMP_SESSION_ID) {
118
- const { autoAddSessionLink } = await import('./agentCommands-B4sCl_5R.mjs');
118
+ const { autoAddSessionLink } = await import('./agentCommands-CDj6yTgX.mjs');
119
119
  let added = 0;
120
120
  for (const [port, url] of urlEntries) {
121
121
  const label = urlEntries.length > 1 ? `${name}:${port}` : name;
@@ -151,8 +151,8 @@ async function serviceServe(args) {
151
151
  const resolvedDir = path.resolve(directory);
152
152
  console.log(`Serving ${resolvedDir}`);
153
153
  const http = await import('http');
154
- const { serveStaticMount } = await import('./run-1CHjd0_g.mjs').then(function (n) { return n.aq; });
155
- const { getFreePort } = await import('./run-1CHjd0_g.mjs').then(function (n) { return n.ap; });
154
+ const { serveStaticMount } = await import('./run-ON_xcuFF.mjs').then(function (n) { return n.aq; });
155
+ const { getFreePort } = await import('./run-ON_xcuFF.mjs').then(function (n) { return n.ap; });
156
156
  const server = http.createServer((req, res) => {
157
157
  const u = new URL(req.url || "/", "http://127.0.0.1");
158
158
  let rel = u.pathname;
@@ -175,7 +175,7 @@ async function serviceServe(args) {
175
175
  resolve(18080);
176
176
  });
177
177
  });
178
- const { runFrpcTunnel } = await import('./run-1CHjd0_g.mjs').then(function (n) { return n.ap; });
178
+ const { runFrpcTunnel } = await import('./run-ON_xcuFF.mjs').then(function (n) { return n.ap; });
179
179
  void server;
180
180
  await runFrpcTunnel(name, [servePort]);
181
181
  } catch (err) {
@@ -185,7 +185,7 @@ async function serviceServe(args) {
185
185
  }
186
186
  async function serviceList(_args) {
187
187
  try {
188
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
188
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
189
189
  const { server, machine } = await connectAndGetMachine();
190
190
  try {
191
191
  const tunnels = await machine.tunnelList({});
@@ -225,11 +225,11 @@ async function serviceDelete(args) {
225
225
  process.exit(1);
226
226
  }
227
227
  try {
228
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
228
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
229
229
  const { server, machine } = await connectAndGetMachine();
230
230
  try {
231
231
  await machine.tunnelStop({ name });
232
- const { removeSessionLinkByService } = await import('./agentCommands-B4sCl_5R.mjs');
232
+ const { removeSessionLinkByService } = await import('./agentCommands-CDj6yTgX.mjs');
233
233
  removeSessionLinkByService("tunnel", name);
234
234
  console.log(`Stopped tunnel '${name}'.`);
235
235
  } catch (err) {
@@ -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-1CHjd0_g.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-ON_xcuFF.mjs';
5
5
  import 'fs/promises';
6
6
  import 'url';
7
7
  import 'child_process';
@@ -1,8 +1,8 @@
1
1
  import { execSync } from 'node:child_process';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
- import { f as flushAndExit } from './cli-BY4DQnRs.mjs';
5
- import { f as resolveProjectRoot, n as searchIssues, l as listIssues, m as isPendingIssue, i as resumeIssue, p as pauseIssue, j as addComment, u as updateIssue, h as getIssue, o as isVisibleTo, I as summarize, k as addIssue } from './run-1CHjd0_g.mjs';
4
+ import { f as flushAndExit } from './cli-CZ4D7AII.mjs';
5
+ import { f as resolveProjectRoot, n as searchIssues, l as listIssues, m as isPendingIssue, i as resumeIssue, p as pauseIssue, j as addComment, u as updateIssue, h as getIssue, o as isVisibleTo, I as summarize, k as addIssue } from './run-ON_xcuFF.mjs';
6
6
  import './serviceManager-hlOVxkhW.mjs';
7
7
  import 'os';
8
8
  import 'fs/promises';
@@ -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 { ae as PINNED_CODEX_VERSION, c as connectToHypha } from './run-1CHjd0_g.mjs';
4
+ import { ae as PINNED_CODEX_VERSION, c as connectToHypha } from './run-ON_xcuFF.mjs';
5
5
  import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-BO0Qs_kE.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
@@ -1,5 +1,5 @@
1
- import { a1 as resolveModel, ai as describeMisconfiguration, aj as buildMachineDeps } from './run-1CHjd0_g.mjs';
2
- import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-C4QaSCEM.mjs';
1
+ import { a1 as resolveModel, ai as describeMisconfiguration, aj as buildMachineDeps } from './run-ON_xcuFF.mjs';
2
+ import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-CDQJ24BM.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-1CHjd0_g.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-ON_xcuFF.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,4 +1,4 @@
1
- import { c as connectToHypha, S as SharingNotificationSync, K as parseJwtEmail } from './run-1CHjd0_g.mjs';
1
+ import { c as connectToHypha, S as SharingNotificationSync, K as parseJwtEmail } from './run-ON_xcuFF.mjs';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { existsSync, readFileSync } from 'node:fs';
4
4
  import { join } from 'node:path';
@@ -1,5 +1,5 @@
1
1
  var name = "svamp-cli";
2
- var version = "0.2.329";
2
+ var version = "0.2.330";
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: "node test/with-timeout.mjs 420 npx tsx test/test-context-window.mjs && node test/with-timeout.mjs 420 npx tsx test/test-ratelimit-retry.mjs && node test/with-timeout.mjs 420 npx tsx test/test-completed-requests.mjs && node test/with-timeout.mjs 420 npx tsx test/test-reconnect-health.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-fleet-version-parse.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-instance-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-authorize.mjs && node test/with-timeout.mjs 420 npx tsx test/test-normalize-allowed-user.mjs && node test/with-timeout.mjs 420 npx tsx test/test-share-url.mjs && node test/with-timeout.mjs 420 npx tsx test/test-update-sharing-normalization.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-sync.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-resolve.mjs && node test/with-timeout.mjs 420 npx tsx test/test-staged-homes-sweep.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cli-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-security-context.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stdin-delivery.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wrap-command.mjs && node test/with-timeout.mjs 420 npx tsx test/test-credential-staging.mjs && node test/with-timeout.mjs 420 npx tsx test/test-claude-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-accounts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-force-model.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-oauth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-btw-proxy-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-output-formatters.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-user-events.mjs && node test/with-timeout.mjs 420 npx tsx test/test-migrate-children.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-install.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-setup.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-pairing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-coordinator.mjs && node test/with-timeout.mjs 420 npx tsx test/e2e-outpost-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-auto-topic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-project-info.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-types.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-update-handlers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-scanner.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hypha-client.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-settings.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-daemon-persistence.mjs && node test/with-timeout.mjs 420 npx tsx test/test-detect-isolation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-disable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-session-visibility.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-access-fallback.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-role-map.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-pinned-codex.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-request-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-app-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-kimi-provider.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-backend.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-bridge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-listener-backoff.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-identity-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-console.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-messages.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-send-query.mjs && node test/with-timeout.mjs 420 npx tsx test/test-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-grouping.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-list-directory.mjs && node test/with-timeout.mjs 420 npx tsx test/test-service-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor-lock.mjs && node test/with-timeout.mjs 420 node test/test-supervisor-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-clear-detection.mjs && node test/with-timeout.mjs 420 npx tsx test/test-compact-detect.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-consolidation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-cross-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-close-gate.mjs && node test/with-timeout.mjs 420 npx tsx test/test-loop-verify.mjs && node test/with-timeout.mjs 420 npx tsx test/test-restore-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-pause.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-scheduler.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cron.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-idle.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-link-subdomain.mjs && node test/with-timeout.mjs 420 npx tsx test/test-short-id.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transcript-edit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-edit-history.mjs && node test/with-timeout.mjs 420 npx tsx test/test-friendly-name.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-dispatch.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sandbox-cli.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-manager.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-files-gateway.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-ws-upgrade.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-static-file-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-stability.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-e2e.mjs --unit-only && node test/with-timeout.mjs 420 npx tsx test/test-frpc-status.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-orphan-reap.mjs && node test/with-timeout.mjs 420 node test/pinnedClaudeCode.test.mjs && node test/with-timeout.mjs 420 node test/fleet.test.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-file.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channels-service.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hotreload-seam.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload-live.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-core.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-async-reply.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outbox-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-binding.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stateless-dispatch-limiter.mjs && node test/with-timeout.mjs 420 npx tsx test/test-shared-session-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-http.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-upload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-file-access.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-voice.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-headless.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-merge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-verdict-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-standalone.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-links.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-loop-pause-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-sync-pagination.mjs && node test/with-timeout.mjs 420 npx tsx test/test-graceful-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-flush-exit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0807-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0814-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-log-prune.mjs && node test/with-timeout.mjs 420 node test/test-message-count-cache.mjs && node test/with-timeout.mjs 420 node test/test-serve-link-gate.mjs && node test/with-timeout.mjs 420 node test/test-security-context-unenforceable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-id-resolution.mjs && node test/with-timeout.mjs 420 npx tsx test/test-help-flag-never-acts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-with-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-queue-cap.mjs",
22
+ test: "node test/with-timeout.mjs 420 npx tsx test/test-context-window.mjs && node test/with-timeout.mjs 420 npx tsx test/test-ratelimit-retry.mjs && node test/with-timeout.mjs 420 npx tsx test/test-completed-requests.mjs && node test/with-timeout.mjs 420 npx tsx test/test-reconnect-health.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-fleet-version-parse.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-instance-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-authorize.mjs && node test/with-timeout.mjs 420 npx tsx test/test-normalize-allowed-user.mjs && node test/with-timeout.mjs 420 npx tsx test/test-share-url.mjs && node test/with-timeout.mjs 420 npx tsx test/test-update-sharing-normalization.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-sync.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-resolve.mjs && node test/with-timeout.mjs 420 npx tsx test/test-staged-homes-sweep.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cli-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-security-context.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stdin-delivery.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wrap-command.mjs && node test/with-timeout.mjs 420 npx tsx test/test-credential-staging.mjs && node test/with-timeout.mjs 420 npx tsx test/test-claude-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-accounts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-force-model.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-oauth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-btw-proxy-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-output-formatters.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-user-events.mjs && node test/with-timeout.mjs 420 npx tsx test/test-migrate-children.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-install.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-setup.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-pairing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-coordinator.mjs && node test/with-timeout.mjs 420 npx tsx test/e2e-outpost-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-auto-topic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-project-info.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-types.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-update-handlers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-scanner.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hypha-client.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-settings.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-daemon-persistence.mjs && node test/with-timeout.mjs 420 npx tsx test/test-detect-isolation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-disable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-session-visibility.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-access-fallback.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-role-map.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-pinned-codex.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-request-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-app-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-kimi-provider.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-backend.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-bridge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-listener-backoff.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-identity-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-console.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-messages.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-send-query.mjs && node test/with-timeout.mjs 420 npx tsx test/test-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-grouping.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-list-directory.mjs && node test/with-timeout.mjs 420 npx tsx test/test-service-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor-lock.mjs && node test/with-timeout.mjs 420 node test/test-supervisor-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-clear-detection.mjs && node test/with-timeout.mjs 420 npx tsx test/test-compact-detect.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-consolidation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-cross-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-close-gate.mjs && node test/with-timeout.mjs 420 npx tsx test/test-loop-verify.mjs && node test/with-timeout.mjs 420 npx tsx test/test-restore-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-pause.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-scheduler.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cron.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-idle.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-link-subdomain.mjs && node test/with-timeout.mjs 420 npx tsx test/test-short-id.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transcript-edit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-edit-history.mjs && node test/with-timeout.mjs 420 npx tsx test/test-friendly-name.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-dispatch.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sandbox-cli.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-manager.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-files-gateway.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-ws-upgrade.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-static-file-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-stability.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-e2e.mjs --unit-only && node test/with-timeout.mjs 420 npx tsx test/test-frpc-status.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-orphan-reap.mjs && node test/with-timeout.mjs 420 node test/pinnedClaudeCode.test.mjs && node test/with-timeout.mjs 420 node test/fleet.test.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-file.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channels-service.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hotreload-seam.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload-live.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-core.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-async-reply.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outbox-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-binding.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stateless-dispatch-limiter.mjs && node test/with-timeout.mjs 420 npx tsx test/test-shared-session-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-http.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-upload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-file-access.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-voice.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-headless.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-merge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-verdict-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-standalone.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-links.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-loop-pause-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-sync-pagination.mjs && node test/with-timeout.mjs 420 npx tsx test/test-graceful-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-flush-exit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0807-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0814-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-log-prune.mjs && node test/with-timeout.mjs 420 node test/test-message-count-cache.mjs && node test/with-timeout.mjs 420 node test/test-serve-link-gate.mjs && node test/with-timeout.mjs 420 node test/test-security-context-unenforceable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-id-resolution.mjs && node test/with-timeout.mjs 420 npx tsx test/test-help-flag-never-acts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-with-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-queue-cap.mjs && node test/with-timeout.mjs 420 npx tsx test/test-compaction-backstop.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 { f as resolveProjectRoot, u as updateIssue, h as getIssue, i as resumeIssue, p as pauseIssue, j as addComment, k as addIssue, l as listIssues, m as isPendingIssue, n as searchIssues, o as isVisibleTo } from './run-1CHjd0_g.mjs';
1
+ import { f as resolveProjectRoot, u as updateIssue, h as getIssue, i as resumeIssue, p as pauseIssue, j as addComment, k as addIssue, l as listIssues, m as isPendingIssue, n as searchIssues, o as isVisibleTo } from './run-ON_xcuFF.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,4 +1,4 @@
1
- import { f as resolveProjectRoot, q as getRun, t as listRuns, v as getWorkflow, w as runWorkflow, x as setWorkflowEnabled, y as removeWorkflow, z as validateCronExpr, A as validateWorkflowName, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-1CHjd0_g.mjs';
1
+ import { f as resolveProjectRoot, q as getRun, t as listRuns, v as getWorkflow, w as runWorkflow, x as setWorkflowEnabled, y as removeWorkflow, z as validateCronExpr, A as validateWorkflowName, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-ON_xcuFF.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,4 +1,4 @@
1
- import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ak as applyClaudeProxyEnv, al as composeSessionId, am as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, an as generateHookSettings } from './run-1CHjd0_g.mjs';
1
+ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ak as applyClaudeProxyEnv, al as composeSessionId, am as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, an as generateHookSettings } from './run-ON_xcuFF.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';
@@ -8332,7 +8332,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
8332
8332
  }
8333
8333
  const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
8334
8334
  const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
8335
- const { toolsForRole } = await import('./sideband-C4QaSCEM.mjs');
8335
+ const { toolsForRole } = await import('./sideband-CDQJ24BM.mjs');
8336
8336
  const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
8337
8337
  return fmt(r2);
8338
8338
  }
@@ -8437,7 +8437,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
8437
8437
  return { ok: false, call_id: callId, status: "busy", error: "channel is busy (too many concurrent requests) \u2014 retry shortly" };
8438
8438
  }
8439
8439
  const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
8440
- const { queryCore } = await import('./commands-rKfH5E8g.mjs');
8440
+ const { queryCore } = await import('./commands-BOBRaVaF.mjs');
8441
8441
  const timeout = c.reply?.timeout_sec || 120;
8442
8442
  let result;
8443
8443
  let thrownSessionId;
@@ -18220,6 +18220,49 @@ function resolveContextWindow(opts) {
18220
18220
  return candidate;
18221
18221
  }
18222
18222
 
18223
+ const DEFAULT_AUTO_COMPACT_RATIO = 0.85;
18224
+ const MIN_WINDOW_FOR_BACKSTOP = 5e4;
18225
+ const MIN_RATIO = 0.5;
18226
+ const MAX_RATIO = 0.97;
18227
+ function resolveAutoCompactEnabled(env = process.env) {
18228
+ const v = (env.SVAMP_AUTO_COMPACT ?? "").trim().toLowerCase();
18229
+ if (v === "0" || v === "false" || v === "off" || v === "no") return false;
18230
+ return true;
18231
+ }
18232
+ function resolveAutoCompactRatio(env = process.env) {
18233
+ const raw = (env.SVAMP_AUTO_COMPACT_RATIO ?? "").trim();
18234
+ if (!raw) return DEFAULT_AUTO_COMPACT_RATIO;
18235
+ const n = Number(raw);
18236
+ if (!Number.isFinite(n)) return DEFAULT_AUTO_COMPACT_RATIO;
18237
+ if (n < MIN_RATIO) return MIN_RATIO;
18238
+ if (n > MAX_RATIO) return MAX_RATIO;
18239
+ return n;
18240
+ }
18241
+ function decideProactiveCompaction(opts) {
18242
+ const { observed, window, ratio, enabled } = opts;
18243
+ const pct = window > 0 ? observed / window : 0;
18244
+ if (!enabled) return { shouldCompact: false, window, pct, reason: "disabled" };
18245
+ if (!(window >= MIN_WINDOW_FOR_BACKSTOP)) return { shouldCompact: false, window, pct, reason: "window-too-small" };
18246
+ if (!(observed > 0)) return { shouldCompact: false, window, pct, reason: "no-observed" };
18247
+ if (pct >= ratio) return { shouldCompact: true, window, pct, reason: "threshold" };
18248
+ return { shouldCompact: false, window, pct, reason: "below-threshold" };
18249
+ }
18250
+ function fmtK(n) {
18251
+ return `${Math.round((n || 0) / 1e3)}K`;
18252
+ }
18253
+ function describeAutoCompact(observed, window, pct) {
18254
+ return `Context at ${Math.round(pct * 100)}% of the ${fmtK(window)} window (${fmtK(observed)} tokens) \u2014 compacting automatically to stay under the model's limit.`;
18255
+ }
18256
+ function isContextTooLongError(text) {
18257
+ if (!text) return false;
18258
+ const t = text.toLowerCase();
18259
+ if (t.includes("prompt is too long")) return true;
18260
+ if (/tokens\s*>\s*[\d,]+\s*maximum/.test(t)) return true;
18261
+ if (t.includes("input length and") && t.includes("max_tokens") && t.includes("context")) return true;
18262
+ if (t.includes("context") && t.includes("exceed") && t.includes("limit") && !t.includes("subscription")) return true;
18263
+ return false;
18264
+ }
18265
+
18223
18266
  function fmtTokens(n) {
18224
18267
  return Math.max(0, Math.round(n)).toLocaleString("en-US");
18225
18268
  }
@@ -18739,6 +18782,9 @@ function dedupeLines(lines) {
18739
18782
  function buildClaudeErrorHint(text, apiErrorStatus) {
18740
18783
  const lower = (text || "").toLowerCase();
18741
18784
  const isOverload = apiErrorStatus === 529 || lower.includes("529") || lower.includes("overload");
18785
+ if (isContextTooLongError(text)) {
18786
+ return "\n\nThe conversation exceeded the model's context window (the prompt is too long). The daemon is compacting the history automatically to recover \u2014 resend your message. If it keeps overflowing, start a fresh session, or raise the auto-compaction headroom with a lower `SVAMP_AUTO_COMPACT_RATIO` (e.g. 0.75) on the machine running the daemon.";
18787
+ }
18742
18788
  const isResumeIssue = lower.includes("tool_use.name") || lower.includes("invalid_request") || lower.includes("messages.");
18743
18789
  const isBillingIssue = lower.includes("credit") || lower.includes("balance") || lower.includes("billing") || lower.includes("quota") || lower.includes("subscription") || lower.includes("payment") || lower.includes("1m-context") || lower.includes("1m context");
18744
18790
  const isLoginIssue = lower.includes("login") || lower.includes("logged in") || lower.includes("auth") || lower.includes("api key") || lower.includes("unauthorized");
@@ -20329,7 +20375,7 @@ async function startDaemon(options) {
20329
20375
  try {
20330
20376
  const dir = loadSessionIndex()[sessionId]?.directory;
20331
20377
  if (!dir) return;
20332
- const { reconcileServiceLinks } = await import('./agentCommands-B4sCl_5R.mjs');
20378
+ const { reconcileServiceLinks } = await import('./agentCommands-CDj6yTgX.mjs');
20333
20379
  const configPath = getSvampConfigPath(dir, sessionId);
20334
20380
  const config = readSvampConfig(configPath);
20335
20381
  const entries = Array.from(urls.entries());
@@ -20351,7 +20397,7 @@ async function startDaemon(options) {
20351
20397
  try {
20352
20398
  const dir = loadSessionIndex()[sessionId]?.directory;
20353
20399
  if (!dir) return;
20354
- const { reconcileServiceLinks } = await import('./agentCommands-B4sCl_5R.mjs');
20400
+ const { reconcileServiceLinks } = await import('./agentCommands-CDj6yTgX.mjs');
20355
20401
  const configPath = getSvampConfigPath(dir, sessionId);
20356
20402
  const config = readSvampConfig(configPath);
20357
20403
  const incoming = [{
@@ -20372,7 +20418,7 @@ async function startDaemon(options) {
20372
20418
  try {
20373
20419
  const dir = loadSessionIndex()[sessionId]?.directory;
20374
20420
  if (!dir) return;
20375
- const { dropServiceLinks } = await import('./agentCommands-B4sCl_5R.mjs');
20421
+ const { dropServiceLinks } = await import('./agentCommands-CDj6yTgX.mjs');
20376
20422
  const configPath = getSvampConfigPath(dir, sessionId);
20377
20423
  const config = readSvampConfig(configPath);
20378
20424
  if (dropServiceLinks(config, "serve", mountName)) {
@@ -21343,6 +21389,11 @@ ${parts.join("\n")}`);
21343
21389
  let consecutiveOverloadRetries = 0;
21344
21390
  let overloadBailedThisTurn = false;
21345
21391
  let pendingCompactTurn = false;
21392
+ const autoCompactEnabled = resolveAutoCompactEnabled();
21393
+ const autoCompactRatio = resolveAutoCompactRatio();
21394
+ let autoCompactWasAutoInjected = false;
21395
+ let autoCompactDisabled = false;
21396
+ let autoCompactRecoveryTried = false;
21346
21397
  let noIsolationWarned = false;
21347
21398
  const RATELIMIT_CFG = getRateLimitRetryConfig();
21348
21399
  let currentTurnMessage;
@@ -21706,6 +21757,23 @@ ${parts.join("\n")}`);
21706
21757
  } else if (isRetryableRateLimit(resultText, msg.api_error_status) && scheduleRateLimitRetry2()) {
21707
21758
  rateLimitRetryScheduled = true;
21708
21759
  lastErrorMessagePushed = true;
21760
+ } else if (isContextTooLongError(resultText) && autoCompactEnabled && !autoCompactDisabled && !autoCompactRecoveryTried) {
21761
+ autoCompactRecoveryTried = true;
21762
+ logger.log(`[Session ${sessionId}] Context-overflow 400 \u2014 injecting one automatic /compact recovery`);
21763
+ sessionService.pushMessage(
21764
+ { type: "message", message: "The conversation exceeded the model's context window. Compacting automatically to recover \u2014 resend your message once it finishes. If this repeats, start a fresh session.", level: "warning" },
21765
+ "event"
21766
+ );
21767
+ const existingQueue = sessionMetadata.messageQueue || [];
21768
+ sessionMetadata = {
21769
+ ...sessionMetadata,
21770
+ messageQueue: [
21771
+ { id: randomUUID(), text: "/compact", displayText: "\u{1F5DC}\uFE0F Auto-compacting to recover from context overflow", createdAt: Date.now(), alreadyStored: true, autoCompact: true },
21772
+ ...existingQueue
21773
+ ]
21774
+ };
21775
+ sessionService.updateMetadata(sessionMetadata);
21776
+ lastErrorMessagePushed = true;
21709
21777
  } else {
21710
21778
  const lower = resultText.toLowerCase();
21711
21779
  const isLoginIssue = lower.includes("login") || lower.includes("logged in") || lower.includes("auth") || lower.includes("api key") || lower.includes("unauthorized");
@@ -21769,13 +21837,22 @@ ${parts.join("\n")}`);
21769
21837
  }
21770
21838
  if (pendingCompactTurn) {
21771
21839
  pendingCompactTurn = false;
21840
+ const wasAuto = autoCompactWasAutoInjected;
21841
+ autoCompactWasAutoInjected = false;
21842
+ if (wasAuto) {
21843
+ autoCompactDisabled = true;
21844
+ logger.log(`[Session ${sessionId}] Auto /compact unsupported by this Claude Code \u2014 disabling the auto-compaction backstop for this session`);
21845
+ }
21772
21846
  logger.log(`[Session ${sessionId}] /compact produced no compaction boundary \u2014 Claude Code likely too old to handle it in stream-json mode`);
21773
21847
  sessionService.pushMessage(
21774
21848
  { type: "message", message: compactUnsupportedWarning(), level: "warning" },
21775
21849
  "event"
21776
21850
  );
21777
21851
  }
21778
- if (!msg.is_error) resetRateLimitStreak();
21852
+ if (!msg.is_error) {
21853
+ resetRateLimitStreak();
21854
+ autoCompactRecoveryTried = false;
21855
+ }
21779
21856
  if (msg.session_id) {
21780
21857
  claudeResumeId = msg.session_id;
21781
21858
  if (sessionMetadata.claudeSessionId !== msg.session_id) {
@@ -21861,6 +21938,35 @@ ${parts.join("\n")}`);
21861
21938
  logger.log(`[Session ${sessionId}] ${taskInfo}`);
21862
21939
  sessionService.pushMessage({ type: "session_event", message: taskInfo }, "session");
21863
21940
  }
21941
+ if (!msg.is_error && !pendingCompactTurn && !autoCompactDisabled && autoCompactEnabled) {
21942
+ try {
21943
+ const observed = computeObservedContext(msg.usage);
21944
+ const decision = decideProactiveCompaction({
21945
+ observed,
21946
+ window: resolvedWindow > 0 ? resolvedWindow : sessionMetadata.contextWindow || 0,
21947
+ ratio: autoCompactRatio,
21948
+ enabled: autoCompactEnabled
21949
+ });
21950
+ if (decision.shouldCompact) {
21951
+ logger.log(`[Session ${sessionId}] Auto-compaction backstop firing at ${Math.round(decision.pct * 100)}% of ${decision.window} window (${observed} tokens) \u2014 injecting /compact`);
21952
+ sessionService.pushMessage(
21953
+ { type: "message", message: describeAutoCompact(observed, decision.window, decision.pct), level: "warning" },
21954
+ "event"
21955
+ );
21956
+ const existingQueue = sessionMetadata.messageQueue || [];
21957
+ sessionMetadata = {
21958
+ ...sessionMetadata,
21959
+ messageQueue: [
21960
+ { id: randomUUID(), text: "/compact", displayText: "\u{1F5DC}\uFE0F Auto-compacting context", createdAt: Date.now(), alreadyStored: true, autoCompact: true },
21961
+ ...existingQueue
21962
+ ]
21963
+ };
21964
+ sessionService.updateMetadata(sessionMetadata);
21965
+ }
21966
+ } catch (e) {
21967
+ logger.log(`[Session ${sessionId}] Auto-compaction backstop check failed: ${e?.message}`);
21968
+ }
21969
+ }
21864
21970
  const queueLen = sessionMetadata.messageQueue?.length ?? 0;
21865
21971
  if (queueLen > 0 && claudeResumeId && !trackedSession.stopped) {
21866
21972
  setTimeout(() => processMessageQueueRef?.(), 200);
@@ -21947,6 +22053,8 @@ ${parts.join("\n")}`);
21947
22053
  sessionService.pushMessage(msg, "session");
21948
22054
  } else if (msg.type === "system" && msg.subtype === "compact_boundary") {
21949
22055
  pendingCompactTurn = false;
22056
+ autoCompactWasAutoInjected = false;
22057
+ autoCompactRecoveryTried = false;
21950
22058
  const compactLine = describeCompaction(msg.compact_metadata);
21951
22059
  logger.log(`[Session ${sessionId}] ${compactLine}`);
21952
22060
  sessionService.pushMessage(
@@ -22759,11 +22867,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
22759
22867
  });
22760
22868
  },
22761
22869
  onIssue: async (params) => {
22762
- const { issueRpc } = await import('./rpc-q5KTMSRl.mjs');
22870
+ const { issueRpc } = await import('./rpc-CFb-c-Nu.mjs');
22763
22871
  return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
22764
22872
  },
22765
22873
  onWorkflow: async (params) => {
22766
- const { workflowRpc } = await import('./rpc-fZm83jEI.mjs');
22874
+ const { workflowRpc } = await import('./rpc-tO-T8OWN.mjs');
22767
22875
  return workflowRpc(params?.cwd || directory, params || {});
22768
22876
  },
22769
22877
  onRipgrep: async (args, cwd) => {
@@ -22902,6 +23010,8 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
22902
23010
  userMessagePending = true;
22903
23011
  turnInitiatedByUser = true;
22904
23012
  currentTurnMessage = next.text;
23013
+ pendingCompactTurn = isCompactCommand(next.text);
23014
+ autoCompactWasAutoInjected = pendingCompactTurn && !!next.autoCompact;
22905
23015
  resetRateLimitStreak();
22906
23016
  if (rateLimitRetryTimer) {
22907
23017
  clearTimeout(rateLimitRetryTimer);
@@ -23469,11 +23579,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
23469
23579
  });
23470
23580
  },
23471
23581
  onIssue: async (params) => {
23472
- const { issueRpc } = await import('./rpc-q5KTMSRl.mjs');
23582
+ const { issueRpc } = await import('./rpc-CFb-c-Nu.mjs');
23473
23583
  return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
23474
23584
  },
23475
23585
  onWorkflow: async (params) => {
23476
- const { workflowRpc } = await import('./rpc-fZm83jEI.mjs');
23586
+ const { workflowRpc } = await import('./rpc-tO-T8OWN.mjs');
23477
23587
  return workflowRpc(params?.cwd || directory, params || {});
23478
23588
  },
23479
23589
  onRipgrep: async (args, cwd) => {
@@ -24826,7 +24936,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
24826
24936
  const PING_TIMEOUT_MS = 15e3;
24827
24937
  const POST_RECONNECT_GRACE_MS = 2e4;
24828
24938
  const RECONNECT_JITTER_MS = 2500;
24829
- const { WorkflowScheduler } = await import('./scheduler-DTRcVW02.mjs');
24939
+ const { WorkflowScheduler } = await import('./scheduler-DtzofW-S.mjs');
24830
24940
  const workflowProjectRoots = () => {
24831
24941
  const dirs = /* @__PURE__ */ new Set();
24832
24942
  for (const s of pidToTrackedSession.values()) {
@@ -1,4 +1,4 @@
1
- import { f as resolveProjectRoot, D as listWorkflows, E as isWorkflowEnabled, F as workflowSchedules, G as inZone, w as runWorkflow, H as cronMatches } from './run-1CHjd0_g.mjs';
1
+ import { f as resolveProjectRoot, D as listWorkflows, E as isWorkflowEnabled, F as workflowSchedules, G as inZone, w as runWorkflow, H as cronMatches } from './run-ON_xcuFF.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -1,6 +1,6 @@
1
1
  import * as path from 'path';
2
- import { w as wantsHelp } from './cli-BY4DQnRs.mjs';
3
- import './run-1CHjd0_g.mjs';
2
+ import { w as wantsHelp } from './cli-CZ4D7AII.mjs';
3
+ import './run-ON_xcuFF.mjs';
4
4
  import 'os';
5
5
  import 'fs/promises';
6
6
  import 'fs';
@@ -77,7 +77,7 @@ async function handleServeCommand() {
77
77
  }
78
78
  }
79
79
  async function serveAdd(args, machineId) {
80
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
80
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
81
81
  const pos = positionalArgs(args);
82
82
  const name = pos[0];
83
83
  if (!name) {
@@ -110,7 +110,7 @@ async function serveAdd(args, machineId) {
110
110
  }
111
111
  if (sessionId && result?.url) {
112
112
  try {
113
- const { autoAddSessionLink } = await import('./agentCommands-B4sCl_5R.mjs');
113
+ const { autoAddSessionLink } = await import('./agentCommands-CDj6yTgX.mjs');
114
114
  autoAddSessionLink(String(result.url), name, void 0, { kind: "serve", name });
115
115
  } catch {
116
116
  }
@@ -124,7 +124,7 @@ async function serveAdd(args, machineId) {
124
124
  }
125
125
  }
126
126
  async function serveApply(args, machineId) {
127
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
127
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
128
128
  const fs = await import('fs');
129
129
  const yaml = await import('yaml');
130
130
  const file = positionalArgs(args)[0];
@@ -209,7 +209,7 @@ async function serveApply(args, machineId) {
209
209
  console.log(`URL: ${result.url}`);
210
210
  if (params.sessionId && result?.url) {
211
211
  try {
212
- const { autoAddSessionLink } = await import('./agentCommands-B4sCl_5R.mjs');
212
+ const { autoAddSessionLink } = await import('./agentCommands-CDj6yTgX.mjs');
213
213
  const prevSession = process.env.SVAMP_SESSION_ID;
214
214
  process.env.SVAMP_SESSION_ID = String(params.sessionId);
215
215
  try {
@@ -230,7 +230,7 @@ async function serveApply(args, machineId) {
230
230
  }
231
231
  }
232
232
  async function serveRemove(args, machineId) {
233
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
233
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
234
234
  const pos = positionalArgs(args);
235
235
  const name = pos[0];
236
236
  if (!name) {
@@ -240,7 +240,7 @@ async function serveRemove(args, machineId) {
240
240
  const { machine, server } = await connectAndGetMachine(machineId);
241
241
  try {
242
242
  await machine.serveRemove({ name });
243
- const { removeSessionLinkByService } = await import('./agentCommands-B4sCl_5R.mjs');
243
+ const { removeSessionLinkByService } = await import('./agentCommands-CDj6yTgX.mjs');
244
244
  removeSessionLinkByService("serve", name);
245
245
  console.log(`Mount '${name}' removed.`);
246
246
  } catch (err) {
@@ -252,7 +252,7 @@ async function serveRemove(args, machineId) {
252
252
  }
253
253
  }
254
254
  async function serveList(args, machineId) {
255
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
255
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
256
256
  const all = hasFlag(args, "--all", "-a");
257
257
  const json = hasFlag(args, "--json");
258
258
  const sessionId = getFlag(args, "--session");
@@ -286,7 +286,7 @@ async function serveList(args, machineId) {
286
286
  }
287
287
  }
288
288
  async function serveInfo(machineId) {
289
- const { connectAndGetMachine } = await import('./commands-rKfH5E8g.mjs');
289
+ const { connectAndGetMachine } = await import('./commands-BOBRaVaF.mjs');
290
290
  const { machine, server } = await connectAndGetMachine(machineId);
291
291
  try {
292
292
  const info = await machine.serveInfo();