@turmind/halo 1.3.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/admin-out/404.html +1 -1
  2. package/admin-out/_next/static/chunks/989-6a0ec35b8ae2cb39.js +1 -0
  3. package/admin-out/_next/static/chunks/app/page-bf9c0b21ae431c92.js +1 -0
  4. package/admin-out/_next/static/css/c0ea31cd787f7aa7.css +3 -0
  5. package/admin-out/index.html +1 -1
  6. package/admin-out/index.txt +5 -5
  7. package/bundled-docs/design/agent.md +12 -6
  8. package/bundled-docs/design/cron.md +19 -11
  9. package/bundled-docs/design/express-self.md +1 -1
  10. package/bundled-docs/design/storage.md +7 -3
  11. package/bundled-docs/design/wechat.md +1 -1
  12. package/bundled-docs/design/ws.md +2 -1
  13. package/bundled-docs/dev/add-model-provider.md +1 -1
  14. package/bundled-docs/dev/api.md +6 -6
  15. package/bundled-docs/dev/deploy.md +1 -1
  16. package/bundled-docs/dev/desktop-packaging.md +1 -1
  17. package/bundled-docs/dev/env.md +4 -4
  18. package/bundled-docs/dev/tools.md +39 -17
  19. package/bundled-docs/guide/chat.md +10 -0
  20. package/bundled-docs/guide/cli.md +8 -3
  21. package/bundled-docs/requirements/chat.md +8 -0
  22. package/dist/index.js +872 -442
  23. package/package.json +1 -1
  24. package/templates/agents/__apply_agent__/agent.yaml +1 -1
  25. package/templates/agents/__evo_agent__/agent.yaml +1 -1
  26. package/templates/agents/__score__/agent.yaml +1 -1
  27. package/templates/agents/deep-executor/agent.yaml +1 -1
  28. package/templates/agents/default/agent.yaml +1 -1
  29. package/templates/agents/goal/agent.yaml +1 -1
  30. package/templates/models/mimo-token-plan-china.yaml +13 -6
  31. package/templates/skills/agent/SKILL.md +2 -2
  32. package/templates/skills/cron/SKILL.md +15 -0
  33. package/templates/skills/cron/manage-cron.py +28 -3
  34. package/templates/skills/send-file/SKILL.md +1 -0
  35. package/admin-out/_next/static/chunks/989-e660d0dd799950f2.js +0 -1
  36. package/admin-out/_next/static/chunks/app/page-18ab83dbdcc3897c.js +0 -1
  37. package/admin-out/_next/static/css/59402ac06b2b1a10.css +0 -3
  38. /package/admin-out/_next/static/{D2iJsfaULMDk0HYCHji6W → 9_eFiojb_-MS8CJ2oJg8_}/_buildManifest.js +0 -0
  39. /package/admin-out/_next/static/{D2iJsfaULMDk0HYCHji6W → 9_eFiojb_-MS8CJ2oJg8_}/_ssgManifest.js +0 -0
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
 
11
- // packages/cli/src/server-supervisor.ts
11
+ // src/server-supervisor.ts
12
12
  var server_supervisor_exports = {};
13
13
  __export(server_supervisor_exports, {
14
14
  MAX_RESTARTS: () => MAX_RESTARTS,
@@ -114,7 +114,7 @@ async function superviseServer() {
114
114
  }
115
115
  var SUPERVISE_ENV, MAX_RESTARTS, RESTART_WINDOW_MS, RESTART_DELAY_MS, INTENTIONAL_SIGNALS;
116
116
  var init_server_supervisor = __esm({
117
- "packages/cli/src/server-supervisor.ts"() {
117
+ "src/server-supervisor.ts"() {
118
118
  "use strict";
119
119
  SUPERVISE_ENV = "HALO_SUPERVISE";
120
120
  MAX_RESTARTS = 5;
@@ -124,7 +124,7 @@ var init_server_supervisor = __esm({
124
124
  }
125
125
  });
126
126
 
127
- // packages/server/dist/prompts/md-vars.js
127
+ // ../server/dist/prompts/md-vars.js
128
128
  var md_vars_exports = {};
129
129
  __export(md_vars_exports, {
130
130
  buildRenderContext: () => buildRenderContext,
@@ -294,7 +294,7 @@ async function buildRenderContext(opts) {
294
294
  }
295
295
  var PATTERN, ENV_PATTERN, ARG_PATTERN, PARAM_PATH;
296
296
  var init_md_vars = __esm({
297
- "packages/server/dist/prompts/md-vars.js"() {
297
+ "../server/dist/prompts/md-vars.js"() {
298
298
  "use strict";
299
299
  PATTERN = /\{\{\s*([\w-][\w.-]*)\s*\}\}/g;
300
300
  ENV_PATTERN = /<<([A-Z_][A-Z0-9_]*)>>/g;
@@ -303,7 +303,7 @@ var init_md_vars = __esm({
303
303
  }
304
304
  });
305
305
 
306
- // packages/server/dist/prompts/md-loader.js
306
+ // ../server/dist/prompts/md-loader.js
307
307
  import fs3 from "node:fs/promises";
308
308
  import fsSync from "node:fs";
309
309
  import path3 from "node:path";
@@ -448,14 +448,14 @@ function resolveMdFilePath(agentId, fileType, scope, workspaceRoot) {
448
448
  }
449
449
  var HALO_HOME;
450
450
  var init_md_loader = __esm({
451
- "packages/server/dist/prompts/md-loader.js"() {
451
+ "../server/dist/prompts/md-loader.js"() {
452
452
  "use strict";
453
453
  init_md_vars();
454
454
  HALO_HOME = path3.join(homedir3(), ".halo", "global");
455
455
  }
456
456
  });
457
457
 
458
- // packages/server/dist/settings-schema.js
458
+ // ../server/dist/settings-schema.js
459
459
  import fs4 from "node:fs";
460
460
  import path4 from "node:path";
461
461
  import { homedir as homedir4 } from "node:os";
@@ -513,12 +513,12 @@ function generalSection() {
513
513
  { key: "compact.max_summary_input", type: "int", globalOnly: true, description: "Max chars fed into local truncation fallback", description_zh: "\u672C\u5730\u622A\u65AD\u515C\u5E95\u65F6\u7684\u603B\u8F93\u5165\u5B57\u7B26\u4E0A\u9650", default: "15000" },
514
514
  { key: "compact.max_message_slice", type: "int", globalOnly: true, description: "Max chars kept per old message during local truncation", description_zh: "\u672C\u5730\u622A\u65AD\u515C\u5E95\u65F6\u6BCF\u6761\u65E7\u6D88\u606F\u4FDD\u7559\u7684\u6700\u5927\u5B57\u7B26\u6570", default: "800" },
515
515
  { key: "compact.summarize_timeout_sec", type: "int", globalOnly: true, description: "LLM summarization timeout (seconds)", description_zh: "LLM \u6458\u8981\u8D85\u65F6\u65F6\u95F4\uFF08\u79D2\uFF09", default: "300" },
516
- // sandbox (Linux bwrap only) — global-only: these define the security
516
+ // sandbox (Linux bwrap / macOS sandbox-exec) — global-only: these define the security
517
517
  // boundary agents run inside; a workspace overriding them could lift
518
518
  // its own sandbox constraints.
519
- { key: "sandbox.hidden_dirs", globalOnly: true, description: "Comma-separated dirs hidden by bwrap (Linux only)", description_zh: "\u901A\u8FC7 bwrap tmpfs \u9690\u85CF\u7684\u76EE\u5F55\uFF08\u9017\u53F7\u5206\u9694\uFF0C\u4EC5 Linux\uFF09", default: "~/.halo/secrets,~/.aws,~/.ssh,~/.gnupg,~/.docker,~/.config/gh,~/.halo/global/internal-sessions,~/.halo/global/logs" },
520
- { key: "sandbox.writable_dirs", globalOnly: true, description: "Comma-separated dirs bind-mounted read-write inside the bwrap sandbox (Linux only) \u2014 for external CLIs that keep local state, e.g. ~/.kiro,~/.local/share/kiro-cli. Not applied to readonly sessions.", description_zh: "\u5728 bwrap \u6C99\u7BB1\u5185\u4EE5\u53EF\u5199\u65B9\u5F0F\u6302\u8F7D\u7684\u76EE\u5F55\uFF08\u9017\u53F7\u5206\u9694\uFF0C\u4EC5 Linux\uFF09\u2014\u2014\u7ED9\u9700\u8981\u672C\u5730\u72B6\u6001\u7684\u5916\u90E8 CLI \u7528\uFF0C\u5982 ~/.kiro,~/.local/share/kiro-cli\u3002readonly \u4F1A\u8BDD\u4E0D\u751F\u6548\u3002", default: "" },
521
- { key: "sandbox.hidden_files", globalOnly: true, description: "Comma-separated files hidden by bwrap (Linux only)", description_zh: "\u901A\u8FC7 /dev/null bind \u9690\u85CF\u7684\u6587\u4EF6\uFF08\u9017\u53F7\u5206\u9694\uFF0C\u4EC5 Linux\uFF09", default: "~/.npmrc,~/.bash_history,~/.gitconfig,~/.git-credentials,~/.netrc,~/.halo/global/evo.db,~/.halo/global/evo.db-wal,~/.halo/global/evo.db-shm,~/.halo/global/cron.db,~/.halo/global/cron.db-wal,~/.halo/global/cron.db-shm,~/.halo/global/runs.db,~/.halo/global/runs.db-wal,~/.halo/global/runs.db-shm" },
519
+ { key: "sandbox.hidden_dirs", globalOnly: true, description: "Comma-separated dirs hidden from workspace/readonly sessions (Linux bwrap / macOS sandbox-exec)", description_zh: "\u5BF9 workspace/readonly \u4F1A\u8BDD\u9690\u85CF\u7684\u76EE\u5F55\uFF08\u9017\u53F7\u5206\u9694\uFF0CLinux bwrap / macOS sandbox-exec\uFF09", default: "~/.halo/secrets,~/.aws,~/.ssh,~/.gnupg,~/.docker,~/.config/gh,~/.halo/global/internal-sessions,~/.halo/global/logs" },
520
+ { key: "sandbox.writable_dirs", globalOnly: true, description: "Comma-separated dirs writable inside the sandbox besides the workspace (Linux / macOS) \u2014 for external CLIs that keep local state, e.g. ~/.kiro,~/.local/share/kiro-cli. Not applied to readonly sessions.", description_zh: "\u9664 workspace \u5916\u5728\u6C99\u7BB1\u5185\u53EF\u5199\u7684\u76EE\u5F55\uFF08\u9017\u53F7\u5206\u9694\uFF0CLinux / macOS\uFF09\u2014\u2014\u7ED9\u9700\u8981\u672C\u5730\u72B6\u6001\u7684\u5916\u90E8 CLI \u7528\uFF0C\u5982 ~/.kiro,~/.local/share/kiro-cli\u3002readonly \u4F1A\u8BDD\u4E0D\u751F\u6548\u3002", default: "" },
521
+ { key: "sandbox.hidden_files", globalOnly: true, description: "Comma-separated files hidden from workspace/readonly sessions \u2014 read as empty (Linux / macOS)", description_zh: "\u5BF9 workspace/readonly \u4F1A\u8BDD\u9690\u85CF\u7684\u6587\u4EF6\uFF0C\u8BFB\u5230\u7684\u662F\u7A7A\u6587\u4EF6\uFF08\u9017\u53F7\u5206\u9694\uFF0CLinux / macOS\uFF09", default: "~/.npmrc,~/.bash_history,~/.gitconfig,~/.git-credentials,~/.netrc,~/.halo/global/evo.db,~/.halo/global/evo.db-wal,~/.halo/global/evo.db-shm,~/.halo/global/cron.db,~/.halo/global/cron.db-wal,~/.halo/global/cron.db-shm,~/.halo/global/runs.db,~/.halo/global/runs.db-wal,~/.halo/global/runs.db-shm" },
522
522
  // logging
523
523
  { key: "logging.level", type: "enum", options: ["debug", "info", "warn", "error"], globalOnly: true, description: "Log level", description_zh: "\u65E5\u5FD7\u7EA7\u522B", default: "warn" },
524
524
  // observability (OpenTelemetry). Read once at boot by observability/otel.ts
@@ -718,7 +718,7 @@ function loadSettingsSchema(workspaceRoot) {
718
718
  }
719
719
  var GLOBAL_MODELS_DIR, GLOBAL_SKILLS_DIR, GLOBAL_AGENTS_DIR, VALID_TYPES;
720
720
  var init_settings_schema = __esm({
721
- "packages/server/dist/settings-schema.js"() {
721
+ "../server/dist/settings-schema.js"() {
722
722
  "use strict";
723
723
  GLOBAL_MODELS_DIR = path4.join(homedir4(), ".halo", "global", "models");
724
724
  GLOBAL_SKILLS_DIR = path4.join(homedir4(), ".halo", "global", "skills");
@@ -727,7 +727,7 @@ var init_settings_schema = __esm({
727
727
  }
728
728
  });
729
729
 
730
- // packages/server/dist/config.js
730
+ // ../server/dist/config.js
731
731
  var config_exports = {};
732
732
  __export(config_exports, {
733
733
  HALO_GLOBAL_DIR: () => HALO_GLOBAL_DIR,
@@ -1033,7 +1033,7 @@ function getModelsRegistry() {
1033
1033
  }
1034
1034
  var HALO_HOME2, HALO_GLOBAL_DIR, HALO_SECRETS_DIR, _modelsRegistryCache, SYSTEM_CONFIG_PATH, _systemConfigCache, SETTINGS_PATH, _settingsCache, _schemaDefaultsCache, ENV_PATTERN2, _wsSettingsCache, config, HIDDEN_DIRS_DEFAULT, HIDDEN_FILES_DEFAULT;
1035
1035
  var init_config = __esm({
1036
- "packages/server/dist/config.js"() {
1036
+ "../server/dist/config.js"() {
1037
1037
  "use strict";
1038
1038
  init_settings_schema();
1039
1039
  HALO_HOME2 = path5.join(homedir5(), ".halo");
@@ -1259,7 +1259,7 @@ var init_config = __esm({
1259
1259
  }
1260
1260
  });
1261
1261
 
1262
- // packages/server/dist/agents/conversation-repair.js
1262
+ // ../server/dist/agents/conversation-repair.js
1263
1263
  function getToolUseId(block) {
1264
1264
  const b = block;
1265
1265
  if (b.type === "tool_use" && typeof b.id === "string")
@@ -1377,12 +1377,12 @@ function repairConversationMessages(raw, label = "[Repair]") {
1377
1377
  return messages2;
1378
1378
  }
1379
1379
  var init_conversation_repair = __esm({
1380
- "packages/server/dist/agents/conversation-repair.js"() {
1380
+ "../server/dist/agents/conversation-repair.js"() {
1381
1381
  "use strict";
1382
1382
  }
1383
1383
  });
1384
1384
 
1385
- // packages/server/dist/agents/model-error.js
1385
+ // ../server/dist/agents/model-error.js
1386
1386
  function classifyModelError(err) {
1387
1387
  const msg = err instanceof Error ? err.message : String(err);
1388
1388
  const errName = err instanceof Error ? err.name : "";
@@ -1420,12 +1420,12 @@ function classifyKind(msg, errName, httpStatus) {
1420
1420
  return "fatal";
1421
1421
  }
1422
1422
  var init_model_error = __esm({
1423
- "packages/server/dist/agents/model-error.js"() {
1423
+ "../server/dist/agents/model-error.js"() {
1424
1424
  "use strict";
1425
1425
  }
1426
1426
  });
1427
1427
 
1428
- // packages/server/dist/agents/compact.js
1428
+ // ../server/dist/agents/compact.js
1429
1429
  function splitForCompact(messages2) {
1430
1430
  const keepCount = config.compact.keep_messages;
1431
1431
  let cut = Math.max(0, messages2.length - keepCount);
@@ -1472,13 +1472,13 @@ ${summaryText}` }]
1472
1472
  return { compacted: true, messages: [summaryMsg, ...recentMsgs] };
1473
1473
  }
1474
1474
  var init_compact = __esm({
1475
- "packages/server/dist/agents/compact.js"() {
1475
+ "../server/dist/agents/compact.js"() {
1476
1476
  "use strict";
1477
1477
  init_config();
1478
1478
  }
1479
1479
  });
1480
1480
 
1481
- // packages/server/dist/agents/micro-compact.js
1481
+ // ../server/dist/agents/micro-compact.js
1482
1482
  function microCompactMessages(messages2, keepRecent = DEFAULT_KEEP_RECENT) {
1483
1483
  if (!messages2 || messages2.length === 0) {
1484
1484
  return { compacted: false, cleared: 0, messages: messages2 };
@@ -1526,7 +1526,7 @@ function microCompactMessages(messages2, keepRecent = DEFAULT_KEEP_RECENT) {
1526
1526
  }
1527
1527
  var MICRO_COMPACT_PLACEHOLDER, COMPACTABLE_TOOLS, DEFAULT_KEEP_RECENT;
1528
1528
  var init_micro_compact = __esm({
1529
- "packages/server/dist/agents/micro-compact.js"() {
1529
+ "../server/dist/agents/micro-compact.js"() {
1530
1530
  "use strict";
1531
1531
  MICRO_COMPACT_PLACEHOLDER = "[Old tool result content cleared]";
1532
1532
  COMPACTABLE_TOOLS = /* @__PURE__ */ new Set([
@@ -1543,10 +1543,10 @@ var init_micro_compact = __esm({
1543
1543
  }
1544
1544
  });
1545
1545
 
1546
- // packages/server/dist/agents/agent-loop.js
1546
+ // ../server/dist/agents/agent-loop.js
1547
1547
  var TOOL_ERROR_MARKER, TOOL_WARN_MARKER, MODEL_TIMEOUT_ERROR, AgentLoop;
1548
1548
  var init_agent_loop = __esm({
1549
- "packages/server/dist/agents/agent-loop.js"() {
1549
+ "../server/dist/agents/agent-loop.js"() {
1550
1550
  "use strict";
1551
1551
  init_config();
1552
1552
  TOOL_ERROR_MARKER = "__TOOL_ERROR__";
@@ -1721,7 +1721,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`;
1721
1721
  }
1722
1722
  });
1723
1723
 
1724
- // packages/server/dist/agents/agent-loader.js
1724
+ // ../server/dist/agents/agent-loader.js
1725
1725
  import fs6 from "node:fs/promises";
1726
1726
  import fsSync2 from "node:fs";
1727
1727
  import path6 from "node:path";
@@ -2004,7 +2004,7 @@ function isTeamMember(team, targetId) {
2004
2004
  }
2005
2005
  var GLOBAL_AGENTS_DIR2, GLOBAL_SKILLS_DIR2, SKILL_ID_RE, ACCESS_RANK;
2006
2006
  var init_agent_loader = __esm({
2007
- "packages/server/dist/agents/agent-loader.js"() {
2007
+ "../server/dist/agents/agent-loader.js"() {
2008
2008
  "use strict";
2009
2009
  init_agent_loop();
2010
2010
  GLOBAL_AGENTS_DIR2 = path6.join(homedir6(), ".halo", "global", "agents");
@@ -2019,7 +2019,7 @@ var init_agent_loader = __esm({
2019
2019
  }
2020
2020
  });
2021
2021
 
2022
- // packages/server/dist/ws/broadcast.js
2022
+ // ../server/dist/ws/broadcast.js
2023
2023
  import path7 from "node:path";
2024
2024
  function setBroadcastWss(wss2) {
2025
2025
  _wss = wss2;
@@ -2065,14 +2065,14 @@ function broadcastToWorkspace(workspacePath, event) {
2065
2065
  }
2066
2066
  var _wss, _workspaceOfClient;
2067
2067
  var init_broadcast = __esm({
2068
- "packages/server/dist/ws/broadcast.js"() {
2068
+ "../server/dist/ws/broadcast.js"() {
2069
2069
  "use strict";
2070
2070
  _wss = null;
2071
2071
  _workspaceOfClient = null;
2072
2072
  }
2073
2073
  });
2074
2074
 
2075
- // packages/server/dist/db/schema.js
2075
+ // ../server/dist/db/schema.js
2076
2076
  var schema_exports = {};
2077
2077
  __export(schema_exports, {
2078
2078
  agentSessions: () => agentSessions,
@@ -2081,7 +2081,7 @@ __export(schema_exports, {
2081
2081
  import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
2082
2082
  var agentSessions, disabledItems;
2083
2083
  var init_schema = __esm({
2084
- "packages/server/dist/db/schema.js"() {
2084
+ "../server/dist/db/schema.js"() {
2085
2085
  "use strict";
2086
2086
  agentSessions = sqliteTable("agent_sessions", {
2087
2087
  id: text("id").primaryKey(),
@@ -2122,7 +2122,7 @@ var init_schema = __esm({
2122
2122
  }
2123
2123
  });
2124
2124
 
2125
- // packages/server/dist/init.js
2125
+ // ../server/dist/init.js
2126
2126
  var init_exports = {};
2127
2127
  __export(init_exports, {
2128
2128
  TEMPLATES_DIR: () => TEMPLATES_DIR,
@@ -2130,6 +2130,7 @@ __export(init_exports, {
2130
2130
  describeOptionalSkill: () => describeOptionalSkill,
2131
2131
  ensureHaloHome: () => ensureHaloHome,
2132
2132
  ensureWorkspaceHalo: () => ensureWorkspaceHalo,
2133
+ hasWorkspaceHalo: () => hasWorkspaceHalo,
2133
2134
  listOptionalSkillIds: () => listOptionalSkillIds,
2134
2135
  mergeAgentYaml: () => mergeAgentYaml,
2135
2136
  readInstalledOptionalSkills: () => readInstalledOptionalSkills,
@@ -2458,6 +2459,9 @@ function ensureHaloHome(haloHome2) {
2458
2459
  } catch {
2459
2460
  }
2460
2461
  }
2462
+ function hasWorkspaceHalo(root) {
2463
+ return fs7.existsSync(path8.join(root, ".halo"));
2464
+ }
2461
2465
  function ensureWorkspaceHalo(workspaceRoot) {
2462
2466
  if (!fs7.existsSync(workspaceRoot)) {
2463
2467
  throw new Error(`Workspace root does not exist: ${workspaceRoot}`);
@@ -2489,7 +2493,7 @@ function ensureWorkspaceHalo(workspaceRoot) {
2489
2493
  }
2490
2494
  var __dirname, TEMPLATES_DIR, DOCS_SRC_CANDIDATES, TEMPLATE_VERSION, VERSION_FILE, SKIP_NAMES, BUILTIN_AGENT_IDS, BUILTIN_SKILL_IDS, BUNDLED_DOCS, INSTALLED_OPTIONAL_SKILLS_FILE;
2491
2495
  var init_init = __esm({
2492
- "packages/server/dist/init.js"() {
2496
+ "../server/dist/init.js"() {
2493
2497
  "use strict";
2494
2498
  __dirname = path8.dirname(fileURLToPath(import.meta.url));
2495
2499
  TEMPLATES_DIR = path8.resolve(__dirname, "..", "templates");
@@ -2497,7 +2501,7 @@ var init_init = __esm({
2497
2501
  path8.resolve(__dirname, "..", "bundled-docs"),
2498
2502
  path8.resolve(__dirname, "..", "..", "..", ".halo", "docs")
2499
2503
  ];
2500
- TEMPLATE_VERSION = 60;
2504
+ TEMPLATE_VERSION = 65;
2501
2505
  VERSION_FILE = ".template-version";
2502
2506
  SKIP_NAMES = /* @__PURE__ */ new Set([".DS_Store", "schema.sql", "__pycache__", ".pytest_cache"]);
2503
2507
  BUILTIN_AGENT_IDS = /* @__PURE__ */ new Set([
@@ -2562,7 +2566,7 @@ var init_init = __esm({
2562
2566
  }
2563
2567
  });
2564
2568
 
2565
- // packages/server/dist/db/migrate.js
2569
+ // ../server/dist/db/migrate.js
2566
2570
  function runMigrations(sqlite, migrations) {
2567
2571
  const current = sqlite.pragma("user_version", { simple: true });
2568
2572
  if (current > migrations.length) {
@@ -2583,12 +2587,12 @@ function addColumnIfMissing(sqlite, table, column, decl) {
2583
2587
  sqlite.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${decl}`);
2584
2588
  }
2585
2589
  var init_migrate = __esm({
2586
- "packages/server/dist/db/migrate.js"() {
2590
+ "../server/dist/db/migrate.js"() {
2587
2591
  "use strict";
2588
2592
  }
2589
2593
  });
2590
2594
 
2591
- // packages/server/dist/db/index.js
2595
+ // ../server/dist/db/index.js
2592
2596
  import Database from "better-sqlite3";
2593
2597
  import { drizzle } from "drizzle-orm/better-sqlite3";
2594
2598
  import { eq, and } from "drizzle-orm";
@@ -2651,7 +2655,7 @@ function toggleDisabled(db, itemType, itemId, scope) {
2651
2655
  }
2652
2656
  var SCHEMA_SQL_PATH, HALO_MIGRATIONS, dbCache;
2653
2657
  var init_db = __esm({
2654
- "packages/server/dist/db/index.js"() {
2658
+ "../server/dist/db/index.js"() {
2655
2659
  "use strict";
2656
2660
  init_schema();
2657
2661
  init_init();
@@ -2677,7 +2681,7 @@ var init_db = __esm({
2677
2681
  }
2678
2682
  });
2679
2683
 
2680
- // packages/server/dist/agents/session-tools.js
2684
+ // ../server/dist/agents/session-tools.js
2681
2685
  async function callerTeamFor(sm, sessionId) {
2682
2686
  const callerId = sm.sessions.get(sessionId)?.agentId;
2683
2687
  if (!callerId)
@@ -2957,7 +2961,7 @@ function buildContinueTaskTool(sm, sessionId) {
2957
2961
  };
2958
2962
  }
2959
2963
  var init_session_tools = __esm({
2960
- "packages/server/dist/agents/session-tools.js"() {
2964
+ "../server/dist/agents/session-tools.js"() {
2961
2965
  "use strict";
2962
2966
  init_config();
2963
2967
  init_agent_loader();
@@ -2965,7 +2969,7 @@ var init_session_tools = __esm({
2965
2969
  }
2966
2970
  });
2967
2971
 
2968
- // packages/server/dist/sessions/session-archive.js
2972
+ // ../server/dist/sessions/session-archive.js
2969
2973
  import fsSync3 from "node:fs";
2970
2974
  import fs9 from "node:fs/promises";
2971
2975
  import path10 from "node:path";
@@ -3028,13 +3032,13 @@ async function deleteArchiveSegments(dir, seg) {
3028
3032
  }
3029
3033
  var ARCHIVE_SIZE_THRESHOLD;
3030
3034
  var init_session_archive = __esm({
3031
- "packages/server/dist/sessions/session-archive.js"() {
3035
+ "../server/dist/sessions/session-archive.js"() {
3032
3036
  "use strict";
3033
3037
  ARCHIVE_SIZE_THRESHOLD = 3 * 1024 * 1024;
3034
3038
  }
3035
3039
  });
3036
3040
 
3037
- // packages/server/dist/sessions/session-store.js
3041
+ // ../server/dist/sessions/session-store.js
3038
3042
  import fsSync4 from "node:fs";
3039
3043
  import fs10 from "node:fs/promises";
3040
3044
  import path11 from "node:path";
@@ -3278,13 +3282,13 @@ function findAndUpdateSessionTitle(sessionId, title, projectPath) {
3278
3282
  return false;
3279
3283
  }
3280
3284
  var init_session_store = __esm({
3281
- "packages/server/dist/sessions/session-store.js"() {
3285
+ "../server/dist/sessions/session-store.js"() {
3282
3286
  "use strict";
3283
3287
  init_session_archive();
3284
3288
  }
3285
3289
  });
3286
3290
 
3287
- // packages/server/dist/agents/goal-mode.js
3291
+ // ../server/dist/agents/goal-mode.js
3288
3292
  import fs11 from "node:fs";
3289
3293
  import path12 from "node:path";
3290
3294
  import { createHash } from "node:crypto";
@@ -3756,7 +3760,7 @@ function sweepActiveGoals(host) {
3756
3760
  }
3757
3761
  var GOAL_AGENT_ID, DEFAULT_GOAL_CAPS, NO_PROGRESS_LIMIT, DELEGATED_DECISION_CAP, WORKER_RECENT_MAX_MESSAGES, WORKER_RECENT_MSG_CHARS, WORKER_RECENT_TOTAL_CHARS, NEED_INPUT_MARKER;
3758
3762
  var init_goal_mode = __esm({
3759
- "packages/server/dist/agents/goal-mode.js"() {
3763
+ "../server/dist/agents/goal-mode.js"() {
3760
3764
  "use strict";
3761
3765
  init_schema();
3762
3766
  init_session_store();
@@ -3777,7 +3781,7 @@ var init_goal_mode = __esm({
3777
3781
  }
3778
3782
  });
3779
3783
 
3780
- // packages/server/dist/channels/shared/i18n.js
3784
+ // ../server/dist/channels/shared/i18n.js
3781
3785
  function getLang(account) {
3782
3786
  const v = account.language;
3783
3787
  return v === "en" || v === "zh" ? v : "en";
@@ -3796,7 +3800,7 @@ function t(key, lang, params) {
3796
3800
  }
3797
3801
  var messages;
3798
3802
  var init_i18n = __esm({
3799
- "packages/server/dist/channels/shared/i18n.js"() {
3803
+ "../server/dist/channels/shared/i18n.js"() {
3800
3804
  "use strict";
3801
3805
  messages = {
3802
3806
  // ── /help ──
@@ -3965,10 +3969,10 @@ var init_i18n = __esm({
3965
3969
  }
3966
3970
  });
3967
3971
 
3968
- // packages/server/dist/commands/registry.js
3972
+ // ../server/dist/commands/registry.js
3969
3973
  var CommandRegistry;
3970
3974
  var init_registry = __esm({
3971
- "packages/server/dist/commands/registry.js"() {
3975
+ "../server/dist/commands/registry.js"() {
3972
3976
  "use strict";
3973
3977
  CommandRegistry = class {
3974
3978
  descriptors = /* @__PURE__ */ new Map();
@@ -3982,13 +3986,13 @@ var init_registry = __esm({
3982
3986
  }
3983
3987
  });
3984
3988
 
3985
- // packages/server/dist/commands/index.js
3989
+ // ../server/dist/commands/index.js
3986
3990
  function builtinCommandNames() {
3987
3991
  return commandRegistry.listDescriptors().filter((d) => d.source === "builtin").map((d) => d.name);
3988
3992
  }
3989
3993
  var commandRegistry;
3990
3994
  var init_commands = __esm({
3991
- "packages/server/dist/commands/index.js"() {
3995
+ "../server/dist/commands/index.js"() {
3992
3996
  "use strict";
3993
3997
  init_registry();
3994
3998
  commandRegistry = new CommandRegistry();
@@ -4038,7 +4042,7 @@ var init_commands = __esm({
4038
4042
  }
4039
4043
  });
4040
4044
 
4041
- // packages/server/dist/commands/skill-command.js
4045
+ // ../server/dist/commands/skill-command.js
4042
4046
  import fs12 from "node:fs/promises";
4043
4047
  import path13 from "node:path";
4044
4048
  async function scanDir(dir) {
@@ -4181,7 +4185,7 @@ ${body}`;
4181
4185
  return "ok";
4182
4186
  }
4183
4187
  var init_skill_command = __esm({
4184
- "packages/server/dist/commands/skill-command.js"() {
4188
+ "../server/dist/commands/skill-command.js"() {
4185
4189
  "use strict";
4186
4190
  init_commands();
4187
4191
  init_agent_loader();
@@ -4191,7 +4195,7 @@ var init_skill_command = __esm({
4191
4195
  }
4192
4196
  });
4193
4197
 
4194
- // packages/server/dist/db/evo-db.js
4198
+ // ../server/dist/db/evo-db.js
4195
4199
  import Database2 from "better-sqlite3";
4196
4200
  import { drizzle as drizzle2 } from "drizzle-orm/better-sqlite3";
4197
4201
  import { sqliteTable as sqliteTable2, text as text2, integer as integer2 } from "drizzle-orm/sqlite-core";
@@ -4216,7 +4220,7 @@ function getEvoDb() {
4216
4220
  }
4217
4221
  var evolutionRuns, evolutionApplies, CREATE_SQL, _evoDb;
4218
4222
  var init_evo_db = __esm({
4219
- "packages/server/dist/db/evo-db.js"() {
4223
+ "../server/dist/db/evo-db.js"() {
4220
4224
  "use strict";
4221
4225
  init_migrate();
4222
4226
  evolutionRuns = sqliteTable2("evolution_runs", {
@@ -4299,7 +4303,7 @@ CREATE INDEX IF NOT EXISTS idx_evo_applies_archived ON evolution_applies(archive
4299
4303
  }
4300
4304
  });
4301
4305
 
4302
- // packages/server/dist/paths.js
4306
+ // ../server/dist/paths.js
4303
4307
  import path15 from "node:path";
4304
4308
  import { homedir as homedir8 } from "node:os";
4305
4309
  function haloHome() {
@@ -4345,12 +4349,12 @@ function evoApplyLogFile(applyId) {
4345
4349
  return path15.join(evoLogsDir(), `apply-${applyId}.log`);
4346
4350
  }
4347
4351
  var init_paths = __esm({
4348
- "packages/server/dist/paths.js"() {
4352
+ "../server/dist/paths.js"() {
4349
4353
  "use strict";
4350
4354
  }
4351
4355
  });
4352
4356
 
4353
- // packages/server/dist/evolution/enqueue.js
4357
+ // ../server/dist/evolution/enqueue.js
4354
4358
  import fs14 from "node:fs";
4355
4359
  import path16 from "node:path";
4356
4360
  import { homedir as homedir9 } from "node:os";
@@ -4635,14 +4639,14 @@ function enqueueEvoRun(input) {
4635
4639
  return { ok: true, runId, runDir };
4636
4640
  }
4637
4641
  var init_enqueue = __esm({
4638
- "packages/server/dist/evolution/enqueue.js"() {
4642
+ "../server/dist/evolution/enqueue.js"() {
4639
4643
  "use strict";
4640
4644
  init_evo_db();
4641
4645
  init_paths();
4642
4646
  }
4643
4647
  });
4644
4648
 
4645
- // packages/server/dist/channels/shared/commands.js
4649
+ // ../server/dist/channels/shared/commands.js
4646
4650
  import fs15 from "node:fs";
4647
4651
  import path17 from "node:path";
4648
4652
  import os from "node:os";
@@ -5368,7 +5372,7 @@ function execWsSwitch(ctx, arg) {
5368
5372
  }
5369
5373
  var ALIASES_FILE, aliasCache, CHANNEL_LIST_LIMIT, DISPATCH_COMMANDS, NOT_ROUTED, SUBCOMMAND_ROUTES;
5370
5374
  var init_commands2 = __esm({
5371
- "packages/server/dist/channels/shared/commands.js"() {
5375
+ "../server/dist/channels/shared/commands.js"() {
5372
5376
  "use strict";
5373
5377
  init_agent_loader();
5374
5378
  init_init();
@@ -5443,7 +5447,7 @@ var init_commands2 = __esm({
5443
5447
  }
5444
5448
  });
5445
5449
 
5446
- // packages/server/dist/agents/relay.js
5450
+ // ../server/dist/agents/relay.js
5447
5451
  import fs16 from "node:fs";
5448
5452
  import path18 from "node:path";
5449
5453
  import { and as and3, eq as eq3, isNull as isNull2 } from "drizzle-orm";
@@ -5680,7 +5684,7 @@ ${params.message}`;
5680
5684
  }
5681
5685
  var _registry, WORKSPACE_SESSION_PROPS;
5682
5686
  var init_relay = __esm({
5683
- "packages/server/dist/agents/relay.js"() {
5687
+ "../server/dist/agents/relay.js"() {
5684
5688
  "use strict";
5685
5689
  init_schema();
5686
5690
  init_config();
@@ -5693,7 +5697,7 @@ var init_relay = __esm({
5693
5697
  }
5694
5698
  });
5695
5699
 
5696
- // packages/server/dist/db/runs-db.js
5700
+ // ../server/dist/db/runs-db.js
5697
5701
  import Database3 from "better-sqlite3";
5698
5702
  import { drizzle as drizzle3 } from "drizzle-orm/better-sqlite3";
5699
5703
  import { sqliteTable as sqliteTable3, text as text3, integer as integer3, primaryKey } from "drizzle-orm/sqlite-core";
@@ -5735,7 +5739,7 @@ function listRunningWorkspaces() {
5735
5739
  }
5736
5740
  var runningSessions, CREATE_SQL2, _runsDb;
5737
5741
  var init_runs_db = __esm({
5738
- "packages/server/dist/db/runs-db.js"() {
5742
+ "../server/dist/db/runs-db.js"() {
5739
5743
  "use strict";
5740
5744
  init_migrate();
5741
5745
  runningSessions = sqliteTable3("running_sessions", {
@@ -5757,7 +5761,7 @@ CREATE TABLE IF NOT EXISTS running_sessions (
5757
5761
  }
5758
5762
  });
5759
5763
 
5760
- // packages/server/dist/agents/run-ledger.js
5764
+ // ../server/dist/agents/run-ledger.js
5761
5765
  import fs18 from "node:fs";
5762
5766
  import path20 from "node:path";
5763
5767
  import YAML7 from "yaml";
@@ -5798,7 +5802,7 @@ function sweepInterruptedRuns(host) {
5798
5802
  console.log(`[RunLedger] Boot sweep (${host.workspaceRoot}): nudged ${nudged} interrupted root(s)`);
5799
5803
  }
5800
5804
  var init_run_ledger = __esm({
5801
- "packages/server/dist/agents/run-ledger.js"() {
5805
+ "../server/dist/agents/run-ledger.js"() {
5802
5806
  "use strict";
5803
5807
  init_schema();
5804
5808
  init_runs_db();
@@ -5807,7 +5811,7 @@ var init_run_ledger = __esm({
5807
5811
  }
5808
5812
  });
5809
5813
 
5810
- // packages/server/dist/agents/workspace-runtime-lock.js
5814
+ // ../server/dist/agents/workspace-runtime-lock.js
5811
5815
  import fs19 from "node:fs";
5812
5816
  import path21 from "node:path";
5813
5817
  function isPidAlive(pid) {
@@ -5855,19 +5859,19 @@ function claimWorkspaceRuntime(workspaceRoot) {
5855
5859
  }
5856
5860
  var RUNTIME_LOCK_FILE;
5857
5861
  var init_workspace_runtime_lock = __esm({
5858
- "packages/server/dist/agents/workspace-runtime-lock.js"() {
5862
+ "../server/dist/agents/workspace-runtime-lock.js"() {
5859
5863
  "use strict";
5860
5864
  RUNTIME_LOCK_FILE = "runtime.lock";
5861
5865
  }
5862
5866
  });
5863
5867
 
5864
- // packages/core/dist/workspace/workspace.js
5868
+ // ../core/dist/workspace/workspace.js
5865
5869
  import { readFile, writeFile, mkdir } from "node:fs/promises";
5866
5870
  import { realpathSync } from "node:fs";
5867
5871
  import { resolve, isAbsolute, sep } from "node:path";
5868
5872
  var WorkspaceError, Workspace;
5869
5873
  var init_workspace = __esm({
5870
- "packages/core/dist/workspace/workspace.js"() {
5874
+ "../core/dist/workspace/workspace.js"() {
5871
5875
  "use strict";
5872
5876
  WorkspaceError = class extends Error {
5873
5877
  constructor(message) {
@@ -5912,13 +5916,13 @@ var init_workspace = __esm({
5912
5916
  }
5913
5917
  });
5914
5918
 
5915
- // packages/core/dist/workspace/git-manager.js
5919
+ // ../core/dist/workspace/git-manager.js
5916
5920
  import path22 from "node:path";
5917
5921
  import { promises as fs20 } from "node:fs";
5918
5922
  import simpleGit from "simple-git";
5919
5923
  var GitManagerError, GitManager;
5920
5924
  var init_git_manager = __esm({
5921
- "packages/core/dist/workspace/git-manager.js"() {
5925
+ "../core/dist/workspace/git-manager.js"() {
5922
5926
  "use strict";
5923
5927
  GitManagerError = class extends Error {
5924
5928
  constructor(message) {
@@ -6287,7 +6291,7 @@ var init_git_manager = __esm({
6287
6291
  }
6288
6292
  });
6289
6293
 
6290
- // packages/core/dist/media/mime.js
6294
+ // ../core/dist/media/mime.js
6291
6295
  function normalizeExt(ext) {
6292
6296
  const lower = ext.toLowerCase();
6293
6297
  return lower.startsWith(".") ? lower : `.${lower}`;
@@ -6300,7 +6304,7 @@ function extFromImageMime(mime) {
6300
6304
  }
6301
6305
  var PHOTO_MIME_BY_EXT, SERVE_ONLY_MIME_BY_EXT, IMAGE_MIME_BY_EXT, EXT_BY_PHOTO_MIME, IMAGE_EXTS;
6302
6306
  var init_mime = __esm({
6303
- "packages/core/dist/media/mime.js"() {
6307
+ "../core/dist/media/mime.js"() {
6304
6308
  "use strict";
6305
6309
  PHOTO_MIME_BY_EXT = {
6306
6310
  ".png": "image/png",
@@ -6324,9 +6328,9 @@ var init_mime = __esm({
6324
6328
  }
6325
6329
  });
6326
6330
 
6327
- // packages/core/dist/index.js
6331
+ // ../core/dist/index.js
6328
6332
  var init_dist = __esm({
6329
- "packages/core/dist/index.js"() {
6333
+ "../core/dist/index.js"() {
6330
6334
  "use strict";
6331
6335
  init_workspace();
6332
6336
  init_git_manager();
@@ -6334,7 +6338,7 @@ var init_dist = __esm({
6334
6338
  }
6335
6339
  });
6336
6340
 
6337
- // packages/server/dist/channels/shared/media-store.js
6341
+ // ../server/dist/channels/shared/media-store.js
6338
6342
  import fs21 from "node:fs/promises";
6339
6343
  import path23 from "node:path";
6340
6344
  import { randomBytes } from "node:crypto";
@@ -6395,7 +6399,7 @@ async function saveInboundMedia(params) {
6395
6399
  }
6396
6400
  var VISION_IMAGE_MIME_TYPES, EXT_BY_AV_MIME;
6397
6401
  var init_media_store = __esm({
6398
- "packages/server/dist/channels/shared/media-store.js"() {
6402
+ "../server/dist/channels/shared/media-store.js"() {
6399
6403
  "use strict";
6400
6404
  init_dist();
6401
6405
  VISION_IMAGE_MIME_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
@@ -6413,7 +6417,7 @@ var init_media_store = __esm({
6413
6417
  }
6414
6418
  });
6415
6419
 
6416
- // packages/server/dist/sessions/ui-log-builder.js
6420
+ // ../server/dist/sessions/ui-log-builder.js
6417
6421
  import { randomUUID } from "node:crypto";
6418
6422
  function createEmptyUIState() {
6419
6423
  return {
@@ -6817,19 +6821,19 @@ function applyEvent(state, event) {
6817
6821
  }
6818
6822
  var msgCounter;
6819
6823
  var init_ui_log_builder = __esm({
6820
- "packages/server/dist/sessions/ui-log-builder.js"() {
6824
+ "../server/dist/sessions/ui-log-builder.js"() {
6821
6825
  "use strict";
6822
6826
  msgCounter = 0;
6823
6827
  }
6824
6828
  });
6825
6829
 
6826
- // packages/server/dist/agents/session-ui-store.js
6830
+ // ../server/dist/agents/session-ui-store.js
6827
6831
  import fsSync5 from "node:fs";
6828
6832
  import path24 from "node:path";
6829
6833
  import { eq as eq6 } from "drizzle-orm";
6830
6834
  var UI_STATE_IDLE_TTL_MS, UI_STATE_SWEEP_PERIOD_MS, SessionUIStore;
6831
6835
  var init_session_ui_store = __esm({
6832
- "packages/server/dist/agents/session-ui-store.js"() {
6836
+ "../server/dist/agents/session-ui-store.js"() {
6833
6837
  "use strict";
6834
6838
  init_broadcast();
6835
6839
  init_schema();
@@ -7343,11 +7347,11 @@ var init_session_ui_store = __esm({
7343
7347
  }
7344
7348
  });
7345
7349
 
7346
- // packages/server/dist/agents/session-query-store.js
7350
+ // ../server/dist/agents/session-query-store.js
7347
7351
  import { eq as eq7, and as and5, isNull as isNull3, desc, lt, gte, inArray } from "drizzle-orm";
7348
7352
  var SessionQueryStore;
7349
7353
  var init_session_query_store = __esm({
7350
- "packages/server/dist/agents/session-query-store.js"() {
7354
+ "../server/dist/agents/session-query-store.js"() {
7351
7355
  "use strict";
7352
7356
  init_schema();
7353
7357
  init_session_store();
@@ -7574,7 +7578,7 @@ var init_session_query_store = __esm({
7574
7578
  }
7575
7579
  });
7576
7580
 
7577
- // packages/server/dist/agents/bedrock-agent.js
7581
+ // ../server/dist/agents/bedrock-agent.js
7578
7582
  import { BedrockRuntimeClient, InvokeModelCommand } from "@aws-sdk/client-bedrock-runtime";
7579
7583
  function effortToBudget(effort, maxTokens) {
7580
7584
  const table = {
@@ -7596,7 +7600,7 @@ function extractRegionFromEndpoint(endpoint) {
7596
7600
  }
7597
7601
  var BedrockAgent;
7598
7602
  var init_bedrock_agent = __esm({
7599
- "packages/server/dist/agents/bedrock-agent.js"() {
7603
+ "../server/dist/agents/bedrock-agent.js"() {
7600
7604
  "use strict";
7601
7605
  init_config();
7602
7606
  init_agent_loop();
@@ -7726,7 +7730,7 @@ var init_bedrock_agent = __esm({
7726
7730
  }
7727
7731
  });
7728
7732
 
7729
- // packages/server/dist/agents/deepseek-agent.js
7733
+ // ../server/dist/agents/deepseek-agent.js
7730
7734
  function safeParse(json) {
7731
7735
  try {
7732
7736
  return JSON.parse(json || "{}");
@@ -7736,7 +7740,7 @@ function safeParse(json) {
7736
7740
  }
7737
7741
  var DeepSeekAgent;
7738
7742
  var init_deepseek_agent = __esm({
7739
- "packages/server/dist/agents/deepseek-agent.js"() {
7743
+ "../server/dist/agents/deepseek-agent.js"() {
7740
7744
  "use strict";
7741
7745
  init_config();
7742
7746
  init_agent_loop();
@@ -7931,7 +7935,7 @@ var init_deepseek_agent = __esm({
7931
7935
  }
7932
7936
  });
7933
7937
 
7934
- // packages/server/dist/agents/kimi-agent.js
7938
+ // ../server/dist/agents/kimi-agent.js
7935
7939
  function safeParse2(json) {
7936
7940
  try {
7937
7941
  return JSON.parse(json || "{}");
@@ -7941,7 +7945,7 @@ function safeParse2(json) {
7941
7945
  }
7942
7946
  var KimiAgent;
7943
7947
  var init_kimi_agent = __esm({
7944
- "packages/server/dist/agents/kimi-agent.js"() {
7948
+ "../server/dist/agents/kimi-agent.js"() {
7945
7949
  "use strict";
7946
7950
  init_config();
7947
7951
  init_agent_loop();
@@ -8137,7 +8141,7 @@ var init_kimi_agent = __esm({
8137
8141
  }
8138
8142
  });
8139
8143
 
8140
- // packages/server/dist/agents/minimax-agent.js
8144
+ // ../server/dist/agents/minimax-agent.js
8141
8145
  function effortToBudget2(effort, maxTokens) {
8142
8146
  const table = {
8143
8147
  low: 2048,
@@ -8154,7 +8158,7 @@ function effortToBudget2(effort, maxTokens) {
8154
8158
  }
8155
8159
  var MiniMaxAgent;
8156
8160
  var init_minimax_agent = __esm({
8157
- "packages/server/dist/agents/minimax-agent.js"() {
8161
+ "../server/dist/agents/minimax-agent.js"() {
8158
8162
  "use strict";
8159
8163
  init_config();
8160
8164
  init_agent_loop();
@@ -8276,7 +8280,7 @@ var init_minimax_agent = __esm({
8276
8280
  }
8277
8281
  });
8278
8282
 
8279
- // packages/server/dist/agents/qwen-agent.js
8283
+ // ../server/dist/agents/qwen-agent.js
8280
8284
  function effortToBudget3(effort, maxTokens) {
8281
8285
  const table = {
8282
8286
  low: 2048,
@@ -8293,7 +8297,7 @@ function effortToBudget3(effort, maxTokens) {
8293
8297
  }
8294
8298
  var QwenAgent;
8295
8299
  var init_qwen_agent = __esm({
8296
- "packages/server/dist/agents/qwen-agent.js"() {
8300
+ "../server/dist/agents/qwen-agent.js"() {
8297
8301
  "use strict";
8298
8302
  init_config();
8299
8303
  init_agent_loop();
@@ -8411,7 +8415,7 @@ var init_qwen_agent = __esm({
8411
8415
  }
8412
8416
  });
8413
8417
 
8414
- // packages/server/dist/agents/hunyuan-agent.js
8418
+ // ../server/dist/agents/hunyuan-agent.js
8415
8419
  function safeParse3(json) {
8416
8420
  try {
8417
8421
  return JSON.parse(json || "{}");
@@ -8421,7 +8425,7 @@ function safeParse3(json) {
8421
8425
  }
8422
8426
  var HunyuanAgent;
8423
8427
  var init_hunyuan_agent = __esm({
8424
- "packages/server/dist/agents/hunyuan-agent.js"() {
8428
+ "../server/dist/agents/hunyuan-agent.js"() {
8425
8429
  "use strict";
8426
8430
  init_config();
8427
8431
  init_agent_loop();
@@ -8592,7 +8596,7 @@ var init_hunyuan_agent = __esm({
8592
8596
  }
8593
8597
  });
8594
8598
 
8595
- // packages/server/dist/agents/doubao-agent.js
8599
+ // ../server/dist/agents/doubao-agent.js
8596
8600
  function safeParse4(json) {
8597
8601
  try {
8598
8602
  return JSON.parse(json || "{}");
@@ -8602,7 +8606,7 @@ function safeParse4(json) {
8602
8606
  }
8603
8607
  var DoubaoAgent;
8604
8608
  var init_doubao_agent = __esm({
8605
- "packages/server/dist/agents/doubao-agent.js"() {
8609
+ "../server/dist/agents/doubao-agent.js"() {
8606
8610
  "use strict";
8607
8611
  init_config();
8608
8612
  init_agent_loop();
@@ -8773,7 +8777,7 @@ var init_doubao_agent = __esm({
8773
8777
  }
8774
8778
  });
8775
8779
 
8776
- // packages/server/dist/agents/openai-agent.js
8780
+ // ../server/dist/agents/openai-agent.js
8777
8781
  function safeParse5(json) {
8778
8782
  try {
8779
8783
  return JSON.parse(json || "{}");
@@ -8783,7 +8787,7 @@ function safeParse5(json) {
8783
8787
  }
8784
8788
  var OpenAIAgent;
8785
8789
  var init_openai_agent = __esm({
8786
- "packages/server/dist/agents/openai-agent.js"() {
8790
+ "../server/dist/agents/openai-agent.js"() {
8787
8791
  "use strict";
8788
8792
  init_config();
8789
8793
  init_agent_loop();
@@ -8955,7 +8959,7 @@ var init_openai_agent = __esm({
8955
8959
  }
8956
8960
  });
8957
8961
 
8958
- // packages/server/dist/agents/mantle-agent.js
8962
+ // ../server/dist/agents/mantle-agent.js
8959
8963
  import { SignatureV4 } from "@smithy/signature-v4";
8960
8964
  import { Sha256 } from "@aws-crypto/sha256-js";
8961
8965
  import { defaultProvider } from "@aws-sdk/credential-provider-node";
@@ -8972,7 +8976,7 @@ function safeParse6(json) {
8972
8976
  }
8973
8977
  var MantleAgent;
8974
8978
  var init_mantle_agent = __esm({
8975
- "packages/server/dist/agents/mantle-agent.js"() {
8979
+ "../server/dist/agents/mantle-agent.js"() {
8976
8980
  "use strict";
8977
8981
  init_config();
8978
8982
  init_agent_loop();
@@ -9191,10 +9195,10 @@ var init_mantle_agent = __esm({
9191
9195
  }
9192
9196
  });
9193
9197
 
9194
- // packages/server/dist/agents/anthropic-agent.js
9198
+ // ../server/dist/agents/anthropic-agent.js
9195
9199
  var AnthropicAgent;
9196
9200
  var init_anthropic_agent = __esm({
9197
- "packages/server/dist/agents/anthropic-agent.js"() {
9201
+ "../server/dist/agents/anthropic-agent.js"() {
9198
9202
  "use strict";
9199
9203
  init_config();
9200
9204
  init_agent_loop();
@@ -9318,7 +9322,7 @@ var init_anthropic_agent = __esm({
9318
9322
  }
9319
9323
  });
9320
9324
 
9321
- // packages/server/dist/agents/model-runtime.js
9325
+ // ../server/dist/agents/model-runtime.js
9322
9326
  function createModelRuntime(providerId, cfg) {
9323
9327
  switch (providerId) {
9324
9328
  case "aws-bedrock-claude-invoke":
@@ -9458,7 +9462,7 @@ function createModelRuntime(providerId, cfg) {
9458
9462
  }
9459
9463
  }
9460
9464
  var init_model_runtime = __esm({
9461
- "packages/server/dist/agents/model-runtime.js"() {
9465
+ "../server/dist/agents/model-runtime.js"() {
9462
9466
  "use strict";
9463
9467
  init_bedrock_agent();
9464
9468
  init_deepseek_agent();
@@ -9473,7 +9477,7 @@ var init_model_runtime = __esm({
9473
9477
  }
9474
9478
  });
9475
9479
 
9476
- // packages/server/dist/child-env.js
9480
+ // ../server/dist/child-env.js
9477
9481
  function cleanChildEnv() {
9478
9482
  const env = { ...process.env };
9479
9483
  delete env.HALO_PASSWORD;
@@ -9481,17 +9485,17 @@ function cleanChildEnv() {
9481
9485
  return env;
9482
9486
  }
9483
9487
  var init_child_env = __esm({
9484
- "packages/server/dist/child-env.js"() {
9488
+ "../server/dist/child-env.js"() {
9485
9489
  "use strict";
9486
9490
  }
9487
9491
  });
9488
9492
 
9489
- // packages/server/dist/tools/sandbox.js
9493
+ // ../server/dist/tools/sandbox.js
9490
9494
  import { exec, execFile, spawn as spawn2 } from "node:child_process";
9491
9495
  import { promisify } from "node:util";
9492
9496
  import path25 from "node:path";
9493
9497
  import { homedir as homedir10 } from "node:os";
9494
- import { existsSync, realpathSync as realpathSync2 } from "node:fs";
9498
+ import { existsSync, lstatSync, mkdirSync, realpathSync as realpathSync2, rmSync, writeFileSync } from "node:fs";
9495
9499
  function decodeWinOutput(buf) {
9496
9500
  try {
9497
9501
  return new TextDecoder("utf-8", { fatal: true }).decode(buf);
@@ -9525,7 +9529,7 @@ async function bwrapExec(args, opts) {
9525
9529
  }
9526
9530
  function spawnGroupExec(command, opts) {
9527
9531
  return new Promise((resolve2, reject) => {
9528
- const child = spawn2(command, { shell: true, detached: true, cwd: opts.cwd, env: cleanChildEnv() });
9532
+ const child = opts.argv ? spawn2(opts.argv[0], opts.argv.slice(1), { detached: true, cwd: opts.cwd, env: opts.env ?? cleanChildEnv() }) : spawn2(command, { shell: true, detached: true, cwd: opts.cwd, env: cleanChildEnv() });
9529
9533
  let stdout = "";
9530
9534
  let stderr = "";
9531
9535
  let killReason = null;
@@ -9637,12 +9641,68 @@ async function isBwrapAvailable() {
9637
9641
  return false;
9638
9642
  }
9639
9643
  }
9640
- function isBwrapCached() {
9641
- return _bwrapAvailable === true;
9644
+ async function isSeatbeltAvailable() {
9645
+ if (process.platform !== "darwin")
9646
+ return false;
9647
+ if (_seatbeltAvailable !== null)
9648
+ return _seatbeltAvailable;
9649
+ try {
9650
+ await execFileAsync(SANDBOX_EXEC, ["-p", "(version 1)(allow default)", "/usr/bin/true"], { timeout: 5e3 });
9651
+ _seatbeltAvailable = true;
9652
+ } catch (err) {
9653
+ console.warn(`[Sandbox] sandbox-exec probe failed (${String(err.message).split("\n")[0]}) \u2014 non-full shell_exec unavailable`);
9654
+ _seatbeltAvailable = false;
9655
+ }
9656
+ return _seatbeltAvailable;
9657
+ }
9658
+ function getSandboxBackend() {
9659
+ if (_bwrapAvailable === true)
9660
+ return "bwrap";
9661
+ if (_seatbeltAvailable === true)
9662
+ return "seatbelt";
9663
+ return null;
9664
+ }
9665
+ async function loadGitIdentity() {
9666
+ const read = async (key) => {
9667
+ try {
9668
+ return String((await execFileAsync("git", ["config", "--global", key], { timeout: 3e3 })).stdout).trim();
9669
+ } catch {
9670
+ return "";
9671
+ }
9672
+ };
9673
+ const [name, email] = await Promise.all([read("user.name"), read("user.email")]);
9674
+ _gitIdentity = { name, email };
9675
+ }
9676
+ function gitIdentityEnv() {
9677
+ const env = {};
9678
+ if (_gitIdentity.name) {
9679
+ env.GIT_AUTHOR_NAME = _gitIdentity.name;
9680
+ env.GIT_COMMITTER_NAME = _gitIdentity.name;
9681
+ }
9682
+ if (_gitIdentity.email) {
9683
+ env.GIT_AUTHOR_EMAIL = _gitIdentity.email;
9684
+ env.GIT_COMMITTER_EMAIL = _gitIdentity.email;
9685
+ }
9686
+ return env;
9642
9687
  }
9643
9688
  async function initBwrapCheck() {
9689
+ await loadGitIdentity();
9690
+ if (process.platform === "darwin")
9691
+ return isSeatbeltAvailable();
9644
9692
  return isBwrapAvailable();
9645
9693
  }
9694
+ function ensureEmptyMaskFile() {
9695
+ try {
9696
+ const st = lstatSync(EMPTY_MASK_FILE);
9697
+ if (st.isFile() && st.size === 0)
9698
+ return EMPTY_MASK_FILE;
9699
+ rmSync(EMPTY_MASK_FILE, { recursive: true, force: true });
9700
+ } catch {
9701
+ }
9702
+ mkdirSync(HALO_HOME3, { recursive: true });
9703
+ writeFileSync(EMPTY_MASK_FILE, "");
9704
+ return EMPTY_MASK_FILE;
9705
+ }
9646
9706
  function expandTilde(p) {
9647
9707
  return p.startsWith("~/") ? path25.join(HOME, p.slice(2)) : p;
9648
9708
  }
@@ -9650,6 +9710,20 @@ function setSandboxHiddenPaths(dirs, files, writableDirs = []) {
9650
9710
  _hiddenDirs = dirs;
9651
9711
  _hiddenFiles = files;
9652
9712
  _writableDirs = writableDirs;
9713
+ _resolvedLists = null;
9714
+ }
9715
+ function resolvedLists() {
9716
+ if (_resolvedLists)
9717
+ return _resolvedLists;
9718
+ const both = (raws) => [...new Set(raws.flatMap((raw) => {
9719
+ const p = path25.resolve(expandTilde(raw));
9720
+ return [p, realpathBounded(p)];
9721
+ }))];
9722
+ _resolvedLists = { hiddenDirs: both(_hiddenDirs), hiddenFiles: both(_hiddenFiles), writableDirs: both(_writableDirs) };
9723
+ return _resolvedLists;
9724
+ }
9725
+ function isUnder(p, dir) {
9726
+ return p === dir || p.startsWith(dir.endsWith("/") ? dir : dir + "/");
9653
9727
  }
9654
9728
  function buildBwrapArgs(opts) {
9655
9729
  const args = [];
@@ -9660,10 +9734,11 @@ function buildBwrapArgs(opts) {
9660
9734
  if (existsSync(dir))
9661
9735
  args.push("--tmpfs", dir);
9662
9736
  }
9737
+ const emptyFile = ensureEmptyMaskFile();
9663
9738
  for (const raw of _hiddenFiles) {
9664
9739
  const file = expandTilde(raw);
9665
9740
  if (existsSync(file))
9666
- args.push("--ro-bind", "/dev/null", file);
9741
+ args.push("--ro-bind", emptyFile, file);
9667
9742
  }
9668
9743
  if (opts.accessLevel !== "readonly") {
9669
9744
  args.push("--bind", opts.workspaceRoot, opts.workspaceRoot);
@@ -9683,7 +9758,7 @@ function buildBwrapArgs(opts) {
9683
9758
  for (const rel of WORKSPACE_HIDDEN_FILES) {
9684
9759
  const file = path25.join(opts.workspaceRoot, rel);
9685
9760
  if (existsSync(file))
9686
- args.push("--ro-bind", "/dev/null", file);
9761
+ args.push("--ro-bind", emptyFile, file);
9687
9762
  }
9688
9763
  args.push("--proc", "/proc");
9689
9764
  args.push("--dev", "/dev");
@@ -9691,6 +9766,8 @@ function buildBwrapArgs(opts) {
9691
9766
  args.push("--setenv", "PATH", `${HOME}/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`);
9692
9767
  args.push("--setenv", "HOME", HOME);
9693
9768
  args.push("--setenv", "TERM", "xterm-256color");
9769
+ for (const [k, v] of Object.entries(gitIdentityEnv()))
9770
+ args.push("--setenv", k, v);
9694
9771
  args.push("--die-with-parent");
9695
9772
  return args;
9696
9773
  }
@@ -9718,31 +9795,57 @@ function assertPathAllowed(filePath, opts, write = false) {
9718
9795
  return path25.resolve(filePath);
9719
9796
  const resolved = realpathBounded(filePath);
9720
9797
  const wsRoot = realpathBounded(opts.workspaceRoot);
9721
- if (resolved === wsRoot || resolved.startsWith(wsRoot + "/")) {
9722
- if (isHiddenWorkspacePath(resolved, wsRoot)) {
9723
- throw new Error(`Access denied: "${filePath}" is outside the allowed sandbox paths`);
9724
- }
9725
- if (write && opts.accessLevel === "readonly") {
9726
- throw new Error(`Access denied: readonly session cannot write to "${filePath}"`);
9727
- }
9728
- return resolved;
9798
+ const inWorkspace = isUnder(resolved, wsRoot);
9799
+ if (inWorkspace && isHiddenWorkspacePath(resolved, wsRoot) || isHiddenHostPath(resolved)) {
9800
+ throw new Error(`Access denied: "${filePath}" is outside the allowed sandbox paths`);
9729
9801
  }
9730
- if (!write && (resolved === GLOBAL_DIR || resolved.startsWith(GLOBAL_DIR + "/")) && !isHiddenGlobalPath(resolved)) {
9802
+ if (!write)
9731
9803
  return resolved;
9804
+ if (opts.accessLevel === "readonly") {
9805
+ throw new Error(`Access denied: readonly session cannot write to "${filePath}"`);
9732
9806
  }
9807
+ if (inWorkspace || resolvedLists().writableDirs.some((d) => isUnder(resolved, d)))
9808
+ return resolved;
9733
9809
  throw new Error(`Access denied: "${filePath}" is outside the allowed sandbox paths`);
9734
9810
  }
9735
- function isHiddenGlobalPath(resolved) {
9736
- for (const raw of _hiddenFiles) {
9737
- if (resolved === expandTilde(raw))
9738
- return true;
9739
- }
9740
- for (const raw of _hiddenDirs) {
9741
- const dir = expandTilde(raw);
9742
- if (resolved === dir || resolved.startsWith(dir + "/"))
9743
- return true;
9811
+ function isHiddenHostPath(resolved) {
9812
+ const { hiddenDirs, hiddenFiles } = resolvedLists();
9813
+ return hiddenFiles.includes(resolved) || hiddenDirs.some((d) => isUnder(resolved, d));
9814
+ }
9815
+ function buildSeatbeltProfile(opts) {
9816
+ const q = (p) => `"${p.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
9817
+ const wsRoot = realpathBounded(opts.workspaceRoot);
9818
+ const lists = resolvedLists();
9819
+ const writable = ["/private/tmp", "/private/var/folders", "/dev"];
9820
+ if (opts.accessLevel !== "readonly")
9821
+ writable.unshift(wsRoot, ...lists.writableDirs);
9822
+ const hiddenDirs = [...lists.hiddenDirs, ...WORKSPACE_HIDDEN_DIRS.map((rel) => path25.join(wsRoot, rel))];
9823
+ const hiddenFiles = [...lists.hiddenFiles, ...WORKSPACE_HIDDEN_FILES.map((rel) => path25.join(wsRoot, rel))];
9824
+ return [
9825
+ "(version 1)",
9826
+ "(allow default)",
9827
+ "(deny file-write*)",
9828
+ `(allow file-write* ${writable.map((p) => `(subpath ${q(p)})`).join(" ")})`,
9829
+ `(deny file-read* file-write* ${[
9830
+ ...hiddenDirs.map((p) => `(subpath ${q(p)})`),
9831
+ ...hiddenFiles.map((p) => `(literal ${q(p)})`)
9832
+ ].join(" ")})`
9833
+ ].join("\n");
9834
+ }
9835
+ function seatbeltEnv() {
9836
+ const env = {
9837
+ PATH: `${HOME}/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin`,
9838
+ HOME,
9839
+ TERM: "xterm-256color",
9840
+ GIT_CONFIG_GLOBAL: "/dev/null",
9841
+ NPM_CONFIG_USERCONFIG: "/dev/null",
9842
+ ...gitIdentityEnv()
9843
+ };
9844
+ for (const k of ["TMPDIR", "USER", "LOGNAME", "LANG", "LC_ALL"]) {
9845
+ if (process.env[k])
9846
+ env[k] = process.env[k];
9744
9847
  }
9745
- return false;
9848
+ return env;
9746
9849
  }
9747
9850
  function isHiddenWorkspacePath(resolved, wsRoot) {
9748
9851
  for (const rel of WORKSPACE_HIDDEN_FILES) {
@@ -9766,8 +9869,173 @@ function buildWriteScriptArgs(filePath, content) {
9766
9869
  function buildReaddirScriptArgs(dirPath) {
9767
9870
  return ["bash", "-c", 'ls -1ap "$1"', "bash", dirPath];
9768
9871
  }
9872
+ function shellSegments(command) {
9873
+ const segments = [];
9874
+ let words = [];
9875
+ let cur = "";
9876
+ let inWord = false;
9877
+ let quote = null;
9878
+ const heredocs = [];
9879
+ const endWord = () => {
9880
+ if (inWord)
9881
+ words.push(cur);
9882
+ cur = "";
9883
+ inWord = false;
9884
+ };
9885
+ const endSegment = () => {
9886
+ endWord();
9887
+ if (words.length)
9888
+ segments.push(words);
9889
+ words = [];
9890
+ };
9891
+ for (let i = 0; i < command.length; i++) {
9892
+ const c = command[i];
9893
+ if (quote) {
9894
+ if (c === quote)
9895
+ quote = null;
9896
+ else if (c === "\\" && quote === '"' && i + 1 < command.length)
9897
+ cur += command[++i];
9898
+ else
9899
+ cur += c;
9900
+ continue;
9901
+ }
9902
+ if (c === "<" && command[i + 1] === "<" && command[i + 2] !== "<") {
9903
+ const m = /^<<(-?)\s*(['"]?)([A-Za-z0-9_.-]+)\2/.exec(command.slice(i));
9904
+ if (m) {
9905
+ endWord();
9906
+ heredocs.push({ delim: m[3], dash: m[1] === "-" });
9907
+ i += m[0].length - 1;
9908
+ continue;
9909
+ }
9910
+ }
9911
+ if (c === "\n" && heredocs.length) {
9912
+ endSegment();
9913
+ let pos = i + 1;
9914
+ for (const h of heredocs.splice(0)) {
9915
+ while (pos < command.length) {
9916
+ const eol = command.indexOf("\n", pos);
9917
+ const line = command.slice(pos, eol === -1 ? command.length : eol);
9918
+ pos = eol === -1 ? command.length : eol + 1;
9919
+ if ((h.dash ? line.replace(/^\t+/, "") : line) === h.delim)
9920
+ break;
9921
+ }
9922
+ }
9923
+ i = pos - 1;
9924
+ continue;
9925
+ }
9926
+ if (c === '"' || c === "'") {
9927
+ quote = c;
9928
+ inWord = true;
9929
+ } else if (c === "\\" && command[i + 1] === "\n")
9930
+ i++;
9931
+ else if (c === "\\" && i + 1 < command.length) {
9932
+ cur += command[++i];
9933
+ inWord = true;
9934
+ } else if (c === ";" || c === "&" || c === "|" || c === "\n")
9935
+ endSegment();
9936
+ else if (c === " " || c === " " || c === "\r")
9937
+ endWord();
9938
+ else {
9939
+ cur += c;
9940
+ inWord = true;
9941
+ }
9942
+ }
9943
+ endSegment();
9944
+ return segments;
9945
+ }
9946
+ function expandRmWord(word, cwd) {
9947
+ return word.replace(/^~(?=\/|$)/, HOME).replace(/\$\{HOME\}|\$HOME\b/g, HOME).replace(/\$\{PWD\}|\$PWD\b|\$\(pwd\)|`pwd`/g, cwd).replace(/\$\{[^}]*\}|\$\([^)]*\)|`[^`]*`|\$[A-Za-z_][A-Za-z0-9_]*|\$\d/g, "");
9948
+ }
9949
+ function stripSubshellClose(word) {
9950
+ let w = word;
9951
+ while (w.endsWith(")") && (w.match(/\(/g)?.length ?? 0) < (w.match(/\)/g)?.length ?? 0))
9952
+ w = w.slice(0, -1);
9953
+ return w;
9954
+ }
9955
+ function rmProtectedReason(target, wsRoot) {
9956
+ if (target === "/")
9957
+ return "the filesystem root";
9958
+ if (isUnder(HOME, target))
9959
+ return "the home directory or a parent of it";
9960
+ if (isUnder(HALO_HOME3, target))
9961
+ return "~/.halo or a parent of it";
9962
+ if (isUnder(wsRoot, target))
9963
+ return "the workspace root or a parent of it";
9964
+ if (RM_EXACT_DIRS.includes(target))
9965
+ return "a system directory";
9966
+ for (const d of RM_SYSTEM_DIRS) {
9967
+ if (target === d || path25.dirname(target) === d)
9968
+ return "a system directory";
9969
+ }
9970
+ return null;
9971
+ }
9972
+ function assertRmSafe(command, workspaceRoot) {
9973
+ const wsRoot = path25.resolve(workspaceRoot);
9974
+ let cwd = wsRoot;
9975
+ for (const words of shellSegments(command)) {
9976
+ let i = 0;
9977
+ let cmd = "";
9978
+ for (; i < words.length; i++) {
9979
+ cmd = words[i].replace(/^[({!]+/, "");
9980
+ if (!cmd || /^[A-Za-z_][A-Za-z0-9_]*=/.test(cmd))
9981
+ continue;
9982
+ if (RM_WRAPPERS.has(path25.basename(cmd))) {
9983
+ while (i + 1 < words.length && words[i + 1].startsWith("-"))
9984
+ i++;
9985
+ continue;
9986
+ }
9987
+ break;
9988
+ }
9989
+ if (i >= words.length)
9990
+ continue;
9991
+ if (cmd === "cd") {
9992
+ const dest = words[i + 1];
9993
+ if (dest === void 0)
9994
+ cwd = HOME;
9995
+ else if (dest !== "-")
9996
+ cwd = path25.resolve(cwd, expandRmWord(stripSubshellClose(dest), cwd) || ".");
9997
+ continue;
9998
+ }
9999
+ const base = path25.basename(cmd);
10000
+ if (base !== "rm" && base !== "rmdir")
10001
+ continue;
10002
+ let optionsDone = false;
10003
+ for (let j = i + 1; j < words.length; j++) {
10004
+ const raw = words[j];
10005
+ if (!optionsDone && raw === "--") {
10006
+ optionsDone = true;
10007
+ continue;
10008
+ }
10009
+ if (!optionsDone && raw.startsWith("-"))
10010
+ continue;
10011
+ if (/^(\d*|&)?[<>]/.test(raw)) {
10012
+ if (/^(\d*|&)?[<>]+&?$/.test(raw))
10013
+ j++;
10014
+ continue;
10015
+ }
10016
+ const word = expandRmWord(stripSubshellClose(raw), cwd);
10017
+ if (!word)
10018
+ continue;
10019
+ const abs = path25.resolve(cwd, word);
10020
+ const parts = abs.split("/");
10021
+ const globAt = parts.findIndex((p) => /[*?[]/.test(p));
10022
+ let target = abs;
10023
+ if (globAt !== -1) {
10024
+ if (!/^[.*?]+$/.test(parts[globAt]))
10025
+ continue;
10026
+ target = parts.slice(0, globAt).join("/") || "/";
10027
+ }
10028
+ const reason = rmProtectedReason(target, wsRoot);
10029
+ if (reason) {
10030
+ throw new Error(`[Sandbox] rm blocked: "${raw}" resolves to ${target}, which is ${reason}. Name the specific files or subdirectories to delete instead.`);
10031
+ }
10032
+ }
10033
+ }
10034
+ }
9769
10035
  async function sandboxExec(command, opts) {
9770
10036
  opts = normalizeOptsForPlatform(opts);
10037
+ if (process.platform !== "win32")
10038
+ assertRmSafe(command, opts.workspaceRoot);
9771
10039
  if (opts.accessLevel === "full") {
9772
10040
  if (process.platform === "win32") {
9773
10041
  const result = await execAsync(`chcp 65001 >nul 2>&1 & ${command}`, {
@@ -9789,10 +10057,21 @@ async function sandboxExec(command, opts) {
9789
10057
  signal: opts.signal
9790
10058
  });
9791
10059
  }
9792
- const bwrapOk = await isBwrapAvailable();
9793
- if (!bwrapOk) {
9794
- throw new Error("Access denied: shell_exec requires bubblewrap (bwrap) for non-full access levels. Install with: apt install bubblewrap");
10060
+ if (process.platform === "darwin") {
10061
+ if (!await isSeatbeltAvailable())
10062
+ throw new Error(NO_SANDBOX_MSG);
10063
+ return spawnGroupExec(command, {
10064
+ cwd: opts.workspaceRoot,
10065
+ timeout: opts.timeout,
10066
+ maxBuffer: opts.maxBuffer,
10067
+ signal: opts.signal,
10068
+ argv: [SANDBOX_EXEC, "-p", buildSeatbeltProfile(opts), ...buildExecScriptArgs(opts.workspaceRoot, command)],
10069
+ env: seatbeltEnv()
10070
+ });
9795
10071
  }
10072
+ const bwrapOk = await isBwrapAvailable();
10073
+ if (!bwrapOk)
10074
+ throw new Error(NO_SANDBOX_MSG);
9796
10075
  const bwrapArgs = buildBwrapArgs(opts);
9797
10076
  return bwrapExec([...bwrapArgs, "--", ...buildExecScriptArgs(opts.workspaceRoot, command)], {
9798
10077
  timeout: opts.timeout,
@@ -9959,18 +10238,21 @@ async function sandboxReaddir(dirPath, opts) {
9959
10238
  return { name: isDir ? name.slice(0, -1) : name, isDirectory: isDir };
9960
10239
  });
9961
10240
  }
9962
- var execAsync, execFileAsync, HOME, HALO_HOME3, GLOBAL_DIR, KILL_GRACE_MS, _bwrapAvailable, DEFAULT_HIDDEN_DIRS, DEFAULT_HIDDEN_FILES, WORKSPACE_HIDDEN_DIRS, WORKSPACE_HIDDEN_FILES, _hiddenDirs, _hiddenFiles, _writableDirs;
10241
+ var execAsync, execFileAsync, HOME, HALO_HOME3, KILL_GRACE_MS, _bwrapAvailable, SANDBOX_EXEC, _seatbeltAvailable, _gitIdentity, EMPTY_MASK_FILE, DEFAULT_HIDDEN_DIRS, DEFAULT_HIDDEN_FILES, WORKSPACE_HIDDEN_DIRS, WORKSPACE_HIDDEN_FILES, _hiddenDirs, _hiddenFiles, _writableDirs, _resolvedLists, RM_SYSTEM_DIRS, RM_EXACT_DIRS, RM_WRAPPERS, NO_SANDBOX_MSG;
9963
10242
  var init_sandbox = __esm({
9964
- "packages/server/dist/tools/sandbox.js"() {
10243
+ "../server/dist/tools/sandbox.js"() {
9965
10244
  "use strict";
9966
10245
  init_child_env();
9967
10246
  execAsync = promisify(exec);
9968
10247
  execFileAsync = promisify(execFile);
9969
10248
  HOME = homedir10();
9970
10249
  HALO_HOME3 = path25.join(HOME, ".halo");
9971
- GLOBAL_DIR = path25.join(HALO_HOME3, "global");
9972
10250
  KILL_GRACE_MS = 2e3;
9973
10251
  _bwrapAvailable = null;
10252
+ SANDBOX_EXEC = "/usr/bin/sandbox-exec";
10253
+ _seatbeltAvailable = null;
10254
+ _gitIdentity = { name: "", email: "" };
10255
+ EMPTY_MASK_FILE = path25.join(HALO_HOME3, ".sandbox-empty");
9974
10256
  DEFAULT_HIDDEN_DIRS = [
9975
10257
  "~/.halo/secrets",
9976
10258
  "~/.aws",
@@ -10011,10 +10293,42 @@ var init_sandbox = __esm({
10011
10293
  _hiddenDirs = DEFAULT_HIDDEN_DIRS;
10012
10294
  _hiddenFiles = DEFAULT_HIDDEN_FILES;
10013
10295
  _writableDirs = [];
10296
+ _resolvedLists = null;
10297
+ RM_SYSTEM_DIRS = [
10298
+ "/bin",
10299
+ "/boot",
10300
+ "/dev",
10301
+ "/etc",
10302
+ "/home",
10303
+ "/lib",
10304
+ "/lib32",
10305
+ "/lib64",
10306
+ "/libx32",
10307
+ "/media",
10308
+ "/mnt",
10309
+ "/opt",
10310
+ "/proc",
10311
+ "/run",
10312
+ "/sbin",
10313
+ "/snap",
10314
+ "/srv",
10315
+ "/sys",
10316
+ "/usr",
10317
+ "/var",
10318
+ "/Applications",
10319
+ "/Library",
10320
+ "/System",
10321
+ "/Users",
10322
+ "/Volumes",
10323
+ "/private"
10324
+ ];
10325
+ RM_EXACT_DIRS = ["/tmp", "/private/tmp", "/root"];
10326
+ RM_WRAPPERS = /* @__PURE__ */ new Set(["sudo", "command", "env", "xargs", "nohup", "time", "exec", "nice", "if", "then", "else", "elif", "do", "while", "until"]);
10327
+ NO_SANDBOX_MSG = "Access denied: shell_exec at workspace/readonly access needs an OS sandbox (bubblewrap on Linux, sandbox-exec on macOS) and none works on this host. Switch the session to Full, or on Linux install bubblewrap (apt install bubblewrap).";
10014
10328
  }
10015
10329
  });
10016
10330
 
10017
- // packages/server/dist/tools/workspace-tools.js
10331
+ // ../server/dist/tools/workspace-tools.js
10018
10332
  import fs22 from "node:fs/promises";
10019
10333
  import path26 from "node:path";
10020
10334
  import crypto from "node:crypto";
@@ -10530,10 +10844,13 @@ Error: old_string appears more than once in ${input.path}. Either expand it with
10530
10844
  STDERR: ${stderr}` : "")).trim() || "(no output)");
10531
10845
  } catch (err) {
10532
10846
  const error = err;
10533
- return mask(`${TOOL_ERROR_MARKER}
10534
- Command failed: ${error.message}
10847
+ const out = `${error.message}
10535
10848
  ${error.stdout ?? ""}
10536
- ${error.stderr ?? ""}`);
10849
+ ${error.stderr ?? ""}`;
10850
+ const hint = accessLevel !== "full" && SANDBOX_DENIED_RE.test(out) ? `
10851
+ [Sandbox] This session runs at "${accessLevel}" access: writes are limited to the workspace${accessLevel === "readonly" ? " (readonly: nowhere)" : ""} and /tmp is discarded after each command. If the command needs more, ask the user to switch the access level to Full in the chat input box.` : "";
10852
+ return mask(`${TOOL_ERROR_MARKER}
10853
+ Command failed: ${out}${hint}`);
10537
10854
  }
10538
10855
  }
10539
10856
  };
@@ -10698,7 +11015,7 @@ Error: ${error.message}`;
10698
11015
  };
10699
11016
  const visionTools = supportsVision ? [viewImage] : [];
10700
11017
  const allTools = [fileRead, ...visionTools, fileWrite, fileEdit, fileList, shellExec, grepTool, globTool, webFetch];
10701
- if (accessLevel === "readonly" && !isBwrapCached()) {
11018
+ if (accessLevel === "readonly" && getSandboxBackend() === null) {
10702
11019
  return [fileRead, ...visionTools, fileList, grepTool, globTool];
10703
11020
  }
10704
11021
  return allTools;
@@ -10731,9 +11048,9 @@ function imageDimensions(buf, mediaType) {
10731
11048
  }
10732
11049
  return null;
10733
11050
  }
10734
- var SKIP_DIRS, SKIP_HALO_SUBDIRS, GLOB_MAX_RESULTS, HOME2, PARAMS_PATTERN, ENV_PATTERN3;
11051
+ var SKIP_DIRS, SKIP_HALO_SUBDIRS, GLOB_MAX_RESULTS, SANDBOX_DENIED_RE, HOME2, PARAMS_PATTERN, ENV_PATTERN3;
10735
11052
  var init_workspace_tools = __esm({
10736
- "packages/server/dist/tools/workspace-tools.js"() {
11053
+ "../server/dist/tools/workspace-tools.js"() {
10737
11054
  "use strict";
10738
11055
  init_config();
10739
11056
  init_sandbox();
@@ -10744,13 +11061,14 @@ var init_workspace_tools = __esm({
10744
11061
  SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", ".next", "dist"]);
10745
11062
  SKIP_HALO_SUBDIRS = /* @__PURE__ */ new Set(["sessions", "logs", "evo", "tmp", "assets", "canvas"]);
10746
11063
  GLOB_MAX_RESULTS = 5e3;
11064
+ SANDBOX_DENIED_RE = /Read-only file system|Operation not permitted|Permission denied|EROFS|EPERM/;
10747
11065
  HOME2 = homedir11();
10748
11066
  PARAMS_PATTERN = /\{\{\s*([\w-]+)\.params\.([\w-][\w.-]*)\s*\}\}/g;
10749
11067
  ENV_PATTERN3 = /<<([A-Z_][A-Z0-9_]*)>>/g;
10750
11068
  }
10751
11069
  });
10752
11070
 
10753
- // packages/server/dist/tools/draft-tool.js
11071
+ // ../server/dist/tools/draft-tool.js
10754
11072
  function createDraftTool() {
10755
11073
  let drafts = 0;
10756
11074
  const tool = {
@@ -10785,7 +11103,7 @@ Error: draft requires non-empty \`content\` \u2014 put your full draft answer th
10785
11103
  }
10786
11104
  var MAX_DRAFTS, REVIEW_CHECKLIST;
10787
11105
  var init_draft_tool = __esm({
10788
- "packages/server/dist/tools/draft-tool.js"() {
11106
+ "../server/dist/tools/draft-tool.js"() {
10789
11107
  "use strict";
10790
11108
  init_agent_loop();
10791
11109
  MAX_DRAFTS = 3;
@@ -10799,7 +11117,7 @@ If the draft clears all three, write the final answer now. If not, fix it (gathe
10799
11117
  }
10800
11118
  });
10801
11119
 
10802
- // packages/server/dist/prompts/system-prompts.js
11120
+ // ../server/dist/prompts/system-prompts.js
10803
11121
  import fs23 from "node:fs/promises";
10804
11122
  import path27 from "node:path";
10805
11123
  import { homedir as homedir12 } from "node:os";
@@ -10885,17 +11203,17 @@ async function loadSystemPrompts(workspaceRoot) {
10885
11203
  }
10886
11204
  var GLOBAL_PROMPTS_DIR;
10887
11205
  var init_system_prompts = __esm({
10888
- "packages/server/dist/prompts/system-prompts.js"() {
11206
+ "../server/dist/prompts/system-prompts.js"() {
10889
11207
  "use strict";
10890
11208
  GLOBAL_PROMPTS_DIR = path27.join(homedir12(), ".halo", "global", "prompts");
10891
11209
  }
10892
11210
  });
10893
11211
 
10894
- // packages/server/dist/agents/session-agent-builder.js
11212
+ // ../server/dist/agents/session-agent-builder.js
10895
11213
  import path28 from "node:path";
10896
11214
  var SessionAgentBuilder;
10897
11215
  var init_session_agent_builder = __esm({
10898
- "packages/server/dist/agents/session-agent-builder.js"() {
11216
+ "../server/dist/agents/session-agent-builder.js"() {
10899
11217
  "use strict";
10900
11218
  init_model_runtime();
10901
11219
  init_workspace_tools();
@@ -11267,7 +11585,7 @@ ${roster}`;
11267
11585
  }
11268
11586
  });
11269
11587
 
11270
- // packages/server/dist/agents/session-skill-commands.js
11588
+ // ../server/dist/agents/session-skill-commands.js
11271
11589
  import { eq as eq8 } from "drizzle-orm";
11272
11590
  function commandVisibilityGate(d) {
11273
11591
  if (!d.verbs || d.verbs.length === 0)
@@ -11284,7 +11602,7 @@ function commandVisibilityGate(d) {
11284
11602
  }
11285
11603
  var SessionSkillCommands;
11286
11604
  var init_session_skill_commands = __esm({
11287
- "packages/server/dist/agents/session-skill-commands.js"() {
11605
+ "../server/dist/agents/session-skill-commands.js"() {
11288
11606
  "use strict";
11289
11607
  init_db();
11290
11608
  init_schema();
@@ -11349,12 +11667,12 @@ var init_session_skill_commands = __esm({
11349
11667
  }
11350
11668
  });
11351
11669
 
11352
- // packages/server/dist/agents/session-state-store.js
11670
+ // ../server/dist/agents/session-state-store.js
11353
11671
  import fsSync6 from "node:fs";
11354
11672
  import path29 from "node:path";
11355
11673
  var SessionStateStore;
11356
11674
  var init_session_state_store = __esm({
11357
- "packages/server/dist/agents/session-state-store.js"() {
11675
+ "../server/dist/agents/session-state-store.js"() {
11358
11676
  "use strict";
11359
11677
  init_session_store();
11360
11678
  SessionStateStore = class {
@@ -11418,7 +11736,7 @@ var init_session_state_store = __esm({
11418
11736
  }
11419
11737
  });
11420
11738
 
11421
- // packages/server/dist/observability/otel-sdk.js
11739
+ // ../server/dist/observability/otel-sdk.js
11422
11740
  var otel_sdk_exports = {};
11423
11741
  __export(otel_sdk_exports, {
11424
11742
  registerSdk: () => registerSdk
@@ -11457,12 +11775,12 @@ function registerSdk(serviceName, serviceVersion) {
11457
11775
  return [tracerProvider, meterProvider, loggerProvider];
11458
11776
  }
11459
11777
  var init_otel_sdk = __esm({
11460
- "packages/server/dist/observability/otel-sdk.js"() {
11778
+ "../server/dist/observability/otel-sdk.js"() {
11461
11779
  "use strict";
11462
11780
  }
11463
11781
  });
11464
11782
 
11465
- // packages/server/dist/observability/otel.js
11783
+ // ../server/dist/observability/otel.js
11466
11784
  import { trace, metrics as metrics2, ProxyTracerProvider } from "@opentelemetry/api";
11467
11785
  import { logs as logs2 } from "@opentelemetry/api-logs";
11468
11786
  function externalSdkRegistered() {
@@ -11487,7 +11805,7 @@ async function initObservability() {
11487
11805
  return true;
11488
11806
  }
11489
11807
  const { registerSdk: registerSdk2 } = await Promise.resolve().then(() => (init_otel_sdk(), otel_sdk_exports));
11490
- providers = registerSdk2(process.env.OTEL_SERVICE_NAME, "1.3.4");
11808
+ providers = registerSdk2(process.env.OTEL_SERVICE_NAME, "1.4.0");
11491
11809
  console.log(`[Observability] OTLP export \u2192 ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT} (service.name=${process.env.OTEL_SERVICE_NAME}, capture_content=${config.observability.captureContent})`);
11492
11810
  return true;
11493
11811
  }
@@ -11508,7 +11826,7 @@ async function shutdownObservability() {
11508
11826
  }
11509
11827
  var SCOPE, enabled, tracer, getMeter, otelLogger, captureContent, providers;
11510
11828
  var init_otel = __esm({
11511
- "packages/server/dist/observability/otel.js"() {
11829
+ "../server/dist/observability/otel.js"() {
11512
11830
  "use strict";
11513
11831
  init_config();
11514
11832
  SCOPE = "opentelemetry.instrumentation.halo";
@@ -11521,7 +11839,7 @@ var init_otel = __esm({
11521
11839
  }
11522
11840
  });
11523
11841
 
11524
- // packages/server/dist/observability/genai-spans.js
11842
+ // ../server/dist/observability/genai-spans.js
11525
11843
  import { context, trace as trace2, SpanStatusCode } from "@opentelemetry/api";
11526
11844
  function instruments() {
11527
11845
  const meter = getMeter();
@@ -11747,7 +12065,7 @@ function recordRetry(kind) {
11747
12065
  }
11748
12066
  var turns, SYSTEM, PART_CAP, SYSTEM_PROMPT_CAP, ATTR_CAP, cachedInstruments, metricsFor;
11749
12067
  var init_genai_spans = __esm({
11750
- "packages/server/dist/observability/genai-spans.js"() {
12068
+ "../server/dist/observability/genai-spans.js"() {
11751
12069
  "use strict";
11752
12070
  init_otel();
11753
12071
  turns = /* @__PURE__ */ new Map();
@@ -11760,7 +12078,7 @@ var init_genai_spans = __esm({
11760
12078
  }
11761
12079
  });
11762
12080
 
11763
- // packages/server/dist/agents/session-manager.js
12081
+ // ../server/dist/agents/session-manager.js
11764
12082
  import fsSync7 from "node:fs";
11765
12083
  import path30 from "node:path";
11766
12084
  import { eq as eq9, and as and6, isNull as isNull4, isNotNull as isNotNull2 } from "drizzle-orm";
@@ -11863,7 +12181,7 @@ function generateSessionId() {
11863
12181
  }
11864
12182
  var CONTINUE_TASK_KICK, SessionManager;
11865
12183
  var init_session_manager = __esm({
11866
- "packages/server/dist/agents/session-manager.js"() {
12184
+ "../server/dist/agents/session-manager.js"() {
11867
12185
  "use strict";
11868
12186
  init_md_loader();
11869
12187
  init_config();
@@ -12483,6 +12801,24 @@ var init_session_manager = __esm({
12483
12801
  dropUIState(sessionId) {
12484
12802
  this.uiStore.dropUIState(sessionId);
12485
12803
  }
12804
+ /** Another process (a cron `halo cli` child) just wrote this root session's
12805
+ * files. Drop the idle in-memory copies — the tree's AgentSessions (raw
12806
+ * history, loaded by any view via ensureSession and never evicted while
12807
+ * idle) and the root's UIState — WITHOUT saving, so the next view/message
12808
+ * re-reads disk instead of overwriting the other writer's turn with this
12809
+ * process's stale snapshot. Returns false (and drops nothing) while any
12810
+ * turn/compact in the tree is in flight: live state can't be discarded,
12811
+ * and the two writers race — the accepted cost of sharing a session. */
12812
+ forgetExternalWrite(rootId) {
12813
+ if (this.hasActiveWorkInTree(rootId))
12814
+ return false;
12815
+ for (const id of [...this.sessions.keys()]) {
12816
+ if (id === rootId || id.startsWith(`${rootId}>`))
12817
+ this.sessions.delete(id);
12818
+ }
12819
+ this.uiStore.dropUIState(rootId);
12820
+ return true;
12821
+ }
12486
12822
  // ── Loop detection ──────────────────────────────────────────────────
12487
12823
  static LOOP_EXEMPT_TOOLS = /* @__PURE__ */ new Set([
12488
12824
  "session_list",
@@ -13980,11 +14316,11 @@ ${q.text}` : q.text);
13980
14316
  }
13981
14317
  });
13982
14318
 
13983
- // packages/server/dist/agents/session-manager-registry.js
14319
+ // ../server/dist/agents/session-manager-registry.js
13984
14320
  import fs24 from "node:fs";
13985
14321
  var SessionManagerRegistry;
13986
14322
  var init_session_manager_registry = __esm({
13987
- "packages/server/dist/agents/session-manager-registry.js"() {
14323
+ "../server/dist/agents/session-manager-registry.js"() {
13988
14324
  "use strict";
13989
14325
  init_session_manager();
13990
14326
  init_init();
@@ -14039,7 +14375,7 @@ var init_session_manager_registry = __esm({
14039
14375
  }
14040
14376
  });
14041
14377
 
14042
- // packages/server/dist/logger.js
14378
+ // ../server/dist/logger.js
14043
14379
  import fs25 from "node:fs";
14044
14380
  import path31 from "node:path";
14045
14381
  import { homedir as homedir13 } from "node:os";
@@ -14159,7 +14495,7 @@ function initLogger() {
14159
14495
  }
14160
14496
  var LOG_FILENAME, logDir, logFile, currentSize, LEVEL_ORDER, OTEL_SEVERITY;
14161
14497
  var init_logger = __esm({
14162
- "packages/server/dist/logger.js"() {
14498
+ "../server/dist/logger.js"() {
14163
14499
  "use strict";
14164
14500
  init_config();
14165
14501
  init_otel();
@@ -14177,7 +14513,7 @@ var init_logger = __esm({
14177
14513
  }
14178
14514
  });
14179
14515
 
14180
- // packages/cli/src/harness.ts
14516
+ // src/harness.ts
14181
14517
  var harness_exports = {};
14182
14518
  __export(harness_exports, {
14183
14519
  createHarness: () => createHarness,
@@ -14418,7 +14754,7 @@ async function createHarness(opts) {
14418
14754
  }
14419
14755
  var SESSION_PREFIX, USER_ID;
14420
14756
  var init_harness = __esm({
14421
- "packages/cli/src/harness.ts"() {
14757
+ "src/harness.ts"() {
14422
14758
  "use strict";
14423
14759
  init_session_manager();
14424
14760
  init_session_manager_registry();
@@ -14435,7 +14771,7 @@ var init_harness = __esm({
14435
14771
  }
14436
14772
  });
14437
14773
 
14438
- // packages/server/dist/middleware/password-hash.js
14774
+ // ../server/dist/middleware/password-hash.js
14439
14775
  var password_hash_exports = {};
14440
14776
  __export(password_hash_exports, {
14441
14777
  generateJwtSecret: () => generateJwtSecret,
@@ -14485,7 +14821,7 @@ function generateJwtSecret() {
14485
14821
  }
14486
14822
  var scryptAsync, COST, KEY_LEN;
14487
14823
  var init_password_hash = __esm({
14488
- "packages/server/dist/middleware/password-hash.js"() {
14824
+ "../server/dist/middleware/password-hash.js"() {
14489
14825
  "use strict";
14490
14826
  scryptAsync = promisify2(crypto2.scrypt);
14491
14827
  COST = { N: 16384, r: 8, p: 1 };
@@ -14493,7 +14829,7 @@ var init_password_hash = __esm({
14493
14829
  }
14494
14830
  });
14495
14831
 
14496
- // packages/server/dist/setup-config.js
14832
+ // ../server/dist/setup-config.js
14497
14833
  var setup_config_exports = {};
14498
14834
  __export(setup_config_exports, {
14499
14835
  configLeafSet: () => configLeafSet,
@@ -14534,13 +14870,13 @@ function configLeafSet(dotPath) {
14534
14870
  }
14535
14871
  var CONFIG_PATH;
14536
14872
  var init_setup_config = __esm({
14537
- "packages/server/dist/setup-config.js"() {
14873
+ "../server/dist/setup-config.js"() {
14538
14874
  "use strict";
14539
14875
  CONFIG_PATH = path33.join(homedir14(), ".halo", "secrets", "config.yaml");
14540
14876
  }
14541
14877
  });
14542
14878
 
14543
- // packages/server/dist/setup-settings.js
14879
+ // ../server/dist/setup-settings.js
14544
14880
  var setup_settings_exports = {};
14545
14881
  __export(setup_settings_exports, {
14546
14882
  maskSecret: () => maskSecret,
@@ -14619,13 +14955,13 @@ function maskSecret(value) {
14619
14955
  }
14620
14956
  var SETTINGS_PATH2;
14621
14957
  var init_setup_settings = __esm({
14622
- "packages/server/dist/setup-settings.js"() {
14958
+ "../server/dist/setup-settings.js"() {
14623
14959
  "use strict";
14624
14960
  SETTINGS_PATH2 = path34.join(homedir15(), ".halo", "secrets", "settings.yaml");
14625
14961
  }
14626
14962
  });
14627
14963
 
14628
- // packages/server/dist/setup-providers.js
14964
+ // ../server/dist/setup-providers.js
14629
14965
  var setup_providers_exports = {};
14630
14966
  __export(setup_providers_exports, {
14631
14967
  AWS_CREDENTIAL_CHAIN_PROVIDER: () => AWS_CREDENTIAL_CHAIN_PROVIDER,
@@ -14831,7 +15167,7 @@ function listRequiredSkillsWithSecrets() {
14831
15167
  }
14832
15168
  var AWS_CREDENTIAL_CHAIN_PROVIDER, REBIND_BUILTIN_AGENT_IDS, GLOBAL_AGENTS_DIR3;
14833
15169
  var init_setup_providers = __esm({
14834
- "packages/server/dist/setup-providers.js"() {
15170
+ "../server/dist/setup-providers.js"() {
14835
15171
  "use strict";
14836
15172
  init_init();
14837
15173
  init_setup_settings();
@@ -14841,7 +15177,7 @@ var init_setup_providers = __esm({
14841
15177
  }
14842
15178
  });
14843
15179
 
14844
- // packages/cli/src/setup-bind-provider.ts
15180
+ // src/setup-bind-provider.ts
14845
15181
  var setup_bind_provider_exports = {};
14846
15182
  __export(setup_bind_provider_exports, {
14847
15183
  AWS_CHAIN_PROVIDER: () => AWS_CHAIN_PROVIDER,
@@ -14881,14 +15217,14 @@ function buildBindProviderPlan(configured, currentProvider, currentProviderHasKe
14881
15217
  }
14882
15218
  var AWS_CHAIN_PROVIDER, KEEP_CURRENT;
14883
15219
  var init_setup_bind_provider = __esm({
14884
- "packages/cli/src/setup-bind-provider.ts"() {
15220
+ "src/setup-bind-provider.ts"() {
14885
15221
  "use strict";
14886
15222
  AWS_CHAIN_PROVIDER = "aws-bedrock-claude-invoke";
14887
15223
  KEEP_CURRENT = "__keep__";
14888
15224
  }
14889
15225
  });
14890
15226
 
14891
- // packages/cli/src/setup-prompts.ts
15227
+ // src/setup-prompts.ts
14892
15228
  var setup_prompts_exports = {};
14893
15229
  __export(setup_prompts_exports, {
14894
15230
  promptMultiSelect: () => promptMultiSelect,
@@ -15174,12 +15510,12 @@ function promptMultiSelectRich(question, options) {
15174
15510
  });
15175
15511
  }
15176
15512
  var init_setup_prompts = __esm({
15177
- "packages/cli/src/setup-prompts.ts"() {
15513
+ "src/setup-prompts.ts"() {
15178
15514
  "use strict";
15179
15515
  }
15180
15516
  });
15181
15517
 
15182
- // packages/cli/src/upgrade-verify.ts
15518
+ // src/upgrade-verify.ts
15183
15519
  var upgrade_verify_exports = {};
15184
15520
  __export(upgrade_verify_exports, {
15185
15521
  ALLOW_SCRIPTS: () => ALLOW_SCRIPTS,
@@ -15204,7 +15540,7 @@ function verifyNativeModules(pkgRoot) {
15204
15540
  }
15205
15541
  var NATIVE_MODULE_SMOKES, ALLOW_SCRIPTS;
15206
15542
  var init_upgrade_verify = __esm({
15207
- "packages/cli/src/upgrade-verify.ts"() {
15543
+ "src/upgrade-verify.ts"() {
15208
15544
  "use strict";
15209
15545
  NATIVE_MODULE_SMOKES = [
15210
15546
  { name: "better-sqlite3", smoke: "new (require(process.argv[1]))(':memory:')" },
@@ -15214,7 +15550,7 @@ var init_upgrade_verify = __esm({
15214
15550
  }
15215
15551
  });
15216
15552
 
15217
- // packages/cli/src/render-md.ts
15553
+ // src/render-md.ts
15218
15554
  import { marked } from "marked";
15219
15555
  import { markedTerminal } from "marked-terminal";
15220
15556
  function renderMarkdown(text6) {
@@ -15222,14 +15558,14 @@ function renderMarkdown(text6) {
15222
15558
  return rendered.replace(/\n{3,}/g, "\n\n").trimEnd();
15223
15559
  }
15224
15560
  var init_render_md = __esm({
15225
- "packages/cli/src/render-md.ts"() {
15561
+ "src/render-md.ts"() {
15226
15562
  "use strict";
15227
15563
  marked.use(markedTerminal({ reflowText: true, width: Math.min(process.stdout.columns || 80, 120) }));
15228
15564
  marked.use({ breaks: true });
15229
15565
  }
15230
15566
  });
15231
15567
 
15232
- // packages/cli/src/resolve-refs.ts
15568
+ // src/resolve-refs.ts
15233
15569
  import fs31 from "node:fs";
15234
15570
  import path37 from "node:path";
15235
15571
  function resolveRefs(input, workspace) {
@@ -15308,7 +15644,7 @@ ${content}
15308
15644
  }
15309
15645
  var MAX_FILE_BYTES, MAX_IMAGE_BYTES, REF_PATTERN;
15310
15646
  var init_resolve_refs = __esm({
15311
- "packages/cli/src/resolve-refs.ts"() {
15647
+ "src/resolve-refs.ts"() {
15312
15648
  "use strict";
15313
15649
  init_dist();
15314
15650
  MAX_FILE_BYTES = 100 * 1024;
@@ -15317,7 +15653,7 @@ var init_resolve_refs = __esm({
15317
15653
  }
15318
15654
  });
15319
15655
 
15320
- // packages/cli/src/format-usage.ts
15656
+ // src/format-usage.ts
15321
15657
  function fmtK(n) {
15322
15658
  return `${(n / 1e3).toFixed(1)}K`;
15323
15659
  }
@@ -15361,7 +15697,7 @@ function formatUsageLine(event) {
15361
15697
  }
15362
15698
  var ANSI;
15363
15699
  var init_format_usage = __esm({
15364
- "packages/cli/src/format-usage.ts"() {
15700
+ "src/format-usage.ts"() {
15365
15701
  "use strict";
15366
15702
  ANSI = {
15367
15703
  reset: "\x1B[0m",
@@ -15375,7 +15711,7 @@ var init_format_usage = __esm({
15375
15711
  }
15376
15712
  });
15377
15713
 
15378
- // packages/cli/src/tui/components/banner.tsx
15714
+ // src/tui/components/banner.tsx
15379
15715
  import { Box, Text } from "ink";
15380
15716
  import { jsx } from "react/jsx-runtime";
15381
15717
  function Banner() {
@@ -15383,7 +15719,7 @@ function Banner() {
15383
15719
  }
15384
15720
  var LINES, COLORS;
15385
15721
  var init_banner = __esm({
15386
- "packages/cli/src/tui/components/banner.tsx"() {
15722
+ "src/tui/components/banner.tsx"() {
15387
15723
  "use strict";
15388
15724
  LINES = [
15389
15725
  " \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
@@ -15397,7 +15733,7 @@ var init_banner = __esm({
15397
15733
  }
15398
15734
  });
15399
15735
 
15400
- // packages/cli/src/tui/components/messages.tsx
15736
+ // src/tui/components/messages.tsx
15401
15737
  import { Box as Box2, Static, Text as Text2 } from "ink";
15402
15738
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
15403
15739
  function Messages({ blocks }) {
@@ -15455,7 +15791,7 @@ function Block({ block }) {
15455
15791
  }
15456
15792
  var BANNER_ID;
15457
15793
  var init_messages = __esm({
15458
- "packages/cli/src/tui/components/messages.tsx"() {
15794
+ "src/tui/components/messages.tsx"() {
15459
15795
  "use strict";
15460
15796
  init_format_usage();
15461
15797
  init_banner();
@@ -15463,7 +15799,7 @@ var init_messages = __esm({
15463
15799
  }
15464
15800
  });
15465
15801
 
15466
- // packages/cli/src/tui/terminal-text.ts
15802
+ // src/tui/terminal-text.ts
15467
15803
  function sanitizeToolOutput(s) {
15468
15804
  return s.replace(ESCAPE_SEQ_RE, "").replace(/\r\n?/g, "\n").replace(/\t/g, " ").replace(C0_RE, "");
15469
15805
  }
@@ -15493,14 +15829,14 @@ function tailByRows(text6, cols, maxRows) {
15493
15829
  }
15494
15830
  var ESCAPE_SEQ_RE, C0_RE;
15495
15831
  var init_terminal_text = __esm({
15496
- "packages/cli/src/tui/terminal-text.ts"() {
15832
+ "src/tui/terminal-text.ts"() {
15497
15833
  "use strict";
15498
15834
  ESCAPE_SEQ_RE = /\x1b\][^\x07\n]*\x07|\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b[@-Z\\-_]/g;
15499
15835
  C0_RE = /[\x00-\x09\x0b-\x1f\x7f]/g;
15500
15836
  }
15501
15837
  });
15502
15838
 
15503
- // packages/cli/src/tui/components/streaming.tsx
15839
+ // src/tui/components/streaming.tsx
15504
15840
  import { useEffect, useState } from "react";
15505
15841
  import { Box as Box3, Text as Text3, useStdout } from "ink";
15506
15842
  import Spinner from "ink-spinner";
@@ -15553,13 +15889,13 @@ function Streaming({ spinnerLabel, liveText, liveThinking, activeSubs, turnStart
15553
15889
  ] });
15554
15890
  }
15555
15891
  var init_streaming = __esm({
15556
- "packages/cli/src/tui/components/streaming.tsx"() {
15892
+ "src/tui/components/streaming.tsx"() {
15557
15893
  "use strict";
15558
15894
  init_terminal_text();
15559
15895
  }
15560
15896
  });
15561
15897
 
15562
- // packages/cli/src/tui/history.ts
15898
+ // src/tui/history.ts
15563
15899
  import fs32 from "node:fs";
15564
15900
  import path38 from "node:path";
15565
15901
  import os2 from "node:os";
@@ -15585,14 +15921,14 @@ function appendHistory(entry) {
15585
15921
  }
15586
15922
  var HISTORY_FILE, MAX_ENTRIES;
15587
15923
  var init_history = __esm({
15588
- "packages/cli/src/tui/history.ts"() {
15924
+ "src/tui/history.ts"() {
15589
15925
  "use strict";
15590
15926
  HISTORY_FILE = path38.join(os2.homedir(), ".halo", "global", "tui-history.json");
15591
15927
  MAX_ENTRIES = 100;
15592
15928
  }
15593
15929
  });
15594
15930
 
15595
- // packages/cli/src/tui/components/status-bar.tsx
15931
+ // src/tui/components/status-bar.tsx
15596
15932
  import { Box as Box4, Text as Text4 } from "ink";
15597
15933
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
15598
15934
  function shortModel(modelId) {
@@ -15628,12 +15964,12 @@ function StatusBar({ agentName, modelId, contextPercent, workspace, sessionId, v
15628
15964
  ] });
15629
15965
  }
15630
15966
  var init_status_bar = __esm({
15631
- "packages/cli/src/tui/components/status-bar.tsx"() {
15967
+ "src/tui/components/status-bar.tsx"() {
15632
15968
  "use strict";
15633
15969
  }
15634
15970
  });
15635
15971
 
15636
- // packages/cli/src/tui/components/slash-suggest.tsx
15972
+ // src/tui/components/slash-suggest.tsx
15637
15973
  import { Box as Box5, Text as Text5 } from "ink";
15638
15974
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
15639
15975
  function SlashSuggest({ items, selectedIdx, maxWidth = 80 }) {
@@ -15660,12 +15996,12 @@ function SlashSuggest({ items, selectedIdx, maxWidth = 80 }) {
15660
15996
  ] });
15661
15997
  }
15662
15998
  var init_slash_suggest = __esm({
15663
- "packages/cli/src/tui/components/slash-suggest.tsx"() {
15999
+ "src/tui/components/slash-suggest.tsx"() {
15664
16000
  "use strict";
15665
16001
  }
15666
16002
  });
15667
16003
 
15668
- // packages/cli/src/tui/components/path-suggest.tsx
16004
+ // src/tui/components/path-suggest.tsx
15669
16005
  import { Box as Box6, Text as Text6 } from "ink";
15670
16006
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
15671
16007
  function PathSuggest({ items, selectedIdx, cwdLabel }) {
@@ -15692,12 +16028,12 @@ function PathSuggest({ items, selectedIdx, cwdLabel }) {
15692
16028
  ] });
15693
16029
  }
15694
16030
  var init_path_suggest = __esm({
15695
- "packages/cli/src/tui/components/path-suggest.tsx"() {
16031
+ "src/tui/components/path-suggest.tsx"() {
15696
16032
  "use strict";
15697
16033
  }
15698
16034
  });
15699
16035
 
15700
- // packages/cli/src/tui/path-suggest-engine.ts
16036
+ // src/tui/path-suggest-engine.ts
15701
16037
  import fs33 from "node:fs";
15702
16038
  import path39 from "node:path";
15703
16039
  function detectActiveRef(value) {
@@ -15783,13 +16119,13 @@ function applyPathPick(value, ref, pick) {
15783
16119
  return `${before}@${kind} ${path70}`;
15784
16120
  }
15785
16121
  var init_path_suggest_engine = __esm({
15786
- "packages/cli/src/tui/path-suggest-engine.ts"() {
16122
+ "src/tui/path-suggest-engine.ts"() {
15787
16123
  "use strict";
15788
16124
  init_dist();
15789
16125
  }
15790
16126
  });
15791
16127
 
15792
- // packages/cli/src/tui/line-editor.ts
16128
+ // src/tui/line-editor.ts
15793
16129
  function toGraphemes(s) {
15794
16130
  if (s === "") return [];
15795
16131
  return [...segmenter.segment(s)].map((seg) => seg.segment);
@@ -15843,13 +16179,13 @@ function deleteToEnd(e) {
15843
16179
  }
15844
16180
  var segmenter;
15845
16181
  var init_line_editor = __esm({
15846
- "packages/cli/src/tui/line-editor.ts"() {
16182
+ "src/tui/line-editor.ts"() {
15847
16183
  "use strict";
15848
16184
  segmenter = new Intl.Segmenter();
15849
16185
  }
15850
16186
  });
15851
16187
 
15852
- // packages/cli/src/tui/components/text-input.tsx
16188
+ // src/tui/components/text-input.tsx
15853
16189
  import { Text as Text7 } from "ink";
15854
16190
  import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
15855
16191
  function TextInputView({ value, cursor, placeholder }) {
@@ -15874,13 +16210,13 @@ function TextInputView({ value, cursor, placeholder }) {
15874
16210
  ] });
15875
16211
  }
15876
16212
  var init_text_input = __esm({
15877
- "packages/cli/src/tui/components/text-input.tsx"() {
16213
+ "src/tui/components/text-input.tsx"() {
15878
16214
  "use strict";
15879
16215
  init_line_editor();
15880
16216
  }
15881
16217
  });
15882
16218
 
15883
- // packages/cli/src/tui/components/input-box.tsx
16219
+ // src/tui/components/input-box.tsx
15884
16220
  import { useState as useState2, useEffect as useEffect2, useMemo, useRef } from "react";
15885
16221
  import { Box as Box7, Text as Text8, useInput, usePaste } from "ink";
15886
16222
  import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
@@ -16131,7 +16467,7 @@ function InputBox({ enabled: enabled2, placeholder, history, onSubmit, hint, com
16131
16467
  ] });
16132
16468
  }
16133
16469
  var init_input_box = __esm({
16134
- "packages/cli/src/tui/components/input-box.tsx"() {
16470
+ "src/tui/components/input-box.tsx"() {
16135
16471
  "use strict";
16136
16472
  init_slash_suggest();
16137
16473
  init_path_suggest();
@@ -16141,7 +16477,7 @@ var init_input_box = __esm({
16141
16477
  }
16142
16478
  });
16143
16479
 
16144
- // packages/cli/src/tui/components/log-navigator.tsx
16480
+ // src/tui/components/log-navigator.tsx
16145
16481
  import { useState as useState3, useMemo as useMemo2, useEffect as useEffect3 } from "react";
16146
16482
  import { Box as Box8, Text as Text9, useInput as useInput2 } from "ink";
16147
16483
  import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
@@ -16220,12 +16556,12 @@ function LogNavigator({ tree, onPick, onCancel }) {
16220
16556
  ] });
16221
16557
  }
16222
16558
  var init_log_navigator = __esm({
16223
- "packages/cli/src/tui/components/log-navigator.tsx"() {
16559
+ "src/tui/components/log-navigator.tsx"() {
16224
16560
  "use strict";
16225
16561
  }
16226
16562
  });
16227
16563
 
16228
- // packages/cli/src/tui/components/log-viewer.tsx
16564
+ // src/tui/components/log-viewer.tsx
16229
16565
  import { useState as useState4, useMemo as useMemo3, useEffect as useEffect4, useRef as useRef2 } from "react";
16230
16566
  import { Box as Box9, Text as Text10, useInput as useInput3, useStdout as useStdout2 } from "ink";
16231
16567
  import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
@@ -16298,12 +16634,12 @@ function LogViewer({ title, lines, live, onClose }) {
16298
16634
  ] });
16299
16635
  }
16300
16636
  var init_log_viewer = __esm({
16301
- "packages/cli/src/tui/components/log-viewer.tsx"() {
16637
+ "src/tui/components/log-viewer.tsx"() {
16302
16638
  "use strict";
16303
16639
  }
16304
16640
  });
16305
16641
 
16306
- // packages/cli/src/tui/app.tsx
16642
+ // src/tui/app.tsx
16307
16643
  import { useEffect as useEffect5, useMemo as useMemo4, useReducer, useState as useState5, useRef as useRef3 } from "react";
16308
16644
  import { Box as Box10, useApp, useInput as useInput4 } from "ink";
16309
16645
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
@@ -17013,7 +17349,7 @@ ${lines.join("\n")}` });
17013
17349
  }
17014
17350
  var MAX_CONTEXT_TOKENS_FALLBACK, blockSeq, ANSI2;
17015
17351
  var init_app = __esm({
17016
- "packages/cli/src/tui/app.tsx"() {
17352
+ "src/tui/app.tsx"() {
17017
17353
  "use strict";
17018
17354
  init_render_md();
17019
17355
  init_resolve_refs();
@@ -17041,7 +17377,7 @@ var init_app = __esm({
17041
17377
  }
17042
17378
  });
17043
17379
 
17044
- // packages/cli/src/tui.tsx
17380
+ // src/tui.tsx
17045
17381
  var tui_exports = {};
17046
17382
  __export(tui_exports, {
17047
17383
  runTui: () => runTui
@@ -17056,13 +17392,13 @@ async function runTui(harness, opts = {}) {
17056
17392
  await instance.waitUntilExit();
17057
17393
  }
17058
17394
  var init_tui = __esm({
17059
- "packages/cli/src/tui.tsx"() {
17395
+ "src/tui.tsx"() {
17060
17396
  "use strict";
17061
17397
  init_app();
17062
17398
  }
17063
17399
  });
17064
17400
 
17065
- // packages/cli/src/cli.ts
17401
+ // src/cli.ts
17066
17402
  var cli_exports = {};
17067
17403
  __export(cli_exports, {
17068
17404
  runCli: () => runCli
@@ -17246,7 +17582,7 @@ ${tag}${formatUsageLine(event)}
17246
17582
  return errorText ? 1 : 0;
17247
17583
  }
17248
17584
  var init_cli = __esm({
17249
- "packages/cli/src/cli.ts"() {
17585
+ "src/cli.ts"() {
17250
17586
  "use strict";
17251
17587
  init_render_md();
17252
17588
  init_resolve_refs();
@@ -17254,7 +17590,7 @@ var init_cli = __esm({
17254
17590
  }
17255
17591
  });
17256
17592
 
17257
- // packages/server/dist/channels/shared/media.js
17593
+ // ../server/dist/channels/shared/media.js
17258
17594
  import path40 from "node:path";
17259
17595
  import os3 from "node:os";
17260
17596
  function tempDir() {
@@ -17295,7 +17631,7 @@ function classifyMedia(filePath) {
17295
17631
  }
17296
17632
  var MEDIA_MARKER_RE, VIDEO_EXTS, VOICE_EXTS;
17297
17633
  var init_media = __esm({
17298
- "packages/server/dist/channels/shared/media.js"() {
17634
+ "../server/dist/channels/shared/media.js"() {
17299
17635
  "use strict";
17300
17636
  init_dist();
17301
17637
  MEDIA_MARKER_RE = /^MEDIA:\s*(\S.*?)\s*$/gm;
@@ -17304,7 +17640,7 @@ var init_media = __esm({
17304
17640
  }
17305
17641
  });
17306
17642
 
17307
- // packages/server/dist/routes/workspace-path.js
17643
+ // ../server/dist/routes/workspace-path.js
17308
17644
  import fs34 from "node:fs/promises";
17309
17645
  import { existsSync as existsSync2, realpathSync as realpathSync3 } from "node:fs";
17310
17646
  import path41 from "node:path";
@@ -17348,12 +17684,12 @@ function isSafeIdSegment(id) {
17348
17684
  return /^[\w.:>\u4e00-\u9fff-]+$/.test(id);
17349
17685
  }
17350
17686
  var init_workspace_path = __esm({
17351
- "packages/server/dist/routes/workspace-path.js"() {
17687
+ "../server/dist/routes/workspace-path.js"() {
17352
17688
  "use strict";
17353
17689
  }
17354
17690
  });
17355
17691
 
17356
- // packages/server/dist/routes/files.js
17692
+ // ../server/dist/routes/files.js
17357
17693
  import { Hono } from "hono";
17358
17694
  import fs35 from "node:fs/promises";
17359
17695
  import { createReadStream } from "node:fs";
@@ -17893,7 +18229,7 @@ function createFileRoutes() {
17893
18229
  return app2;
17894
18230
  }
17895
18231
  var init_files = __esm({
17896
- "packages/server/dist/routes/files.js"() {
18232
+ "../server/dist/routes/files.js"() {
17897
18233
  "use strict";
17898
18234
  init_dist();
17899
18235
  init_media();
@@ -17901,7 +18237,7 @@ var init_files = __esm({
17901
18237
  }
17902
18238
  });
17903
18239
 
17904
- // packages/server/dist/routes/data-preview.js
18240
+ // ../server/dist/routes/data-preview.js
17905
18241
  import { Hono as Hono2 } from "hono";
17906
18242
  import fs36 from "node:fs/promises";
17907
18243
  import { createReadStream as createReadStream2 } from "node:fs";
@@ -18126,7 +18462,7 @@ function createDataPreviewRoutes() {
18126
18462
  }
18127
18463
  var DEFAULT_LIMIT, MAX_LIMIT, MAX_ROW_CHARS, QUOTE, CR, LF, COMMA, SEMI, TAB, CsvScanner;
18128
18464
  var init_data_preview = __esm({
18129
- "packages/server/dist/routes/data-preview.js"() {
18465
+ "../server/dist/routes/data-preview.js"() {
18130
18466
  "use strict";
18131
18467
  init_workspace_path();
18132
18468
  DEFAULT_LIMIT = 100;
@@ -18227,7 +18563,7 @@ var init_data_preview = __esm({
18227
18563
  }
18228
18564
  });
18229
18565
 
18230
- // packages/server/dist/git-credentials.js
18566
+ // ../server/dist/git-credentials.js
18231
18567
  import fs37 from "node:fs";
18232
18568
  import path44 from "node:path";
18233
18569
  import { homedir as homedir18 } from "node:os";
@@ -18293,13 +18629,13 @@ function deleteGitCredential(host) {
18293
18629
  }
18294
18630
  var GIT_CREDENTIALS_PATH;
18295
18631
  var init_git_credentials = __esm({
18296
- "packages/server/dist/git-credentials.js"() {
18632
+ "../server/dist/git-credentials.js"() {
18297
18633
  "use strict";
18298
18634
  GIT_CREDENTIALS_PATH = path44.join(homedir18(), ".git-credentials");
18299
18635
  }
18300
18636
  });
18301
18637
 
18302
- // packages/server/dist/git-ssh.js
18638
+ // ../server/dist/git-ssh.js
18303
18639
  import fs38 from "node:fs";
18304
18640
  import os4 from "node:os";
18305
18641
  import path45 from "node:path";
@@ -18476,7 +18812,7 @@ function getRemoteProtocol(projectRoot) {
18476
18812
  }
18477
18813
  var SSH_DIR, NON_KEY_NAMES, ownedAgentPid, ASKPASS_SCRIPT;
18478
18814
  var init_git_ssh = __esm({
18479
- "packages/server/dist/git-ssh.js"() {
18815
+ "../server/dist/git-ssh.js"() {
18480
18816
  "use strict";
18481
18817
  SSH_DIR = path45.join(os4.homedir(), ".ssh");
18482
18818
  NON_KEY_NAMES = /* @__PURE__ */ new Set(["known_hosts", "known_hosts2", "authorized_keys", "config"]);
@@ -18489,7 +18825,7 @@ printf '%s\\n' "$HALO_SSH_PASSPHRASE"
18489
18825
  }
18490
18826
  });
18491
18827
 
18492
- // packages/server/dist/routes/git.js
18828
+ // ../server/dist/routes/git.js
18493
18829
  import { Hono as Hono3 } from "hono";
18494
18830
  import os5 from "node:os";
18495
18831
  import path46 from "node:path";
@@ -18855,7 +19191,7 @@ function createGitRoutes() {
18855
19191
  return app2;
18856
19192
  }
18857
19193
  var init_git = __esm({
18858
- "packages/server/dist/routes/git.js"() {
19194
+ "../server/dist/routes/git.js"() {
18859
19195
  "use strict";
18860
19196
  init_dist();
18861
19197
  init_workspace_path();
@@ -18865,7 +19201,7 @@ var init_git = __esm({
18865
19201
  }
18866
19202
  });
18867
19203
 
18868
- // packages/server/dist/routes/mtime-cache.js
19204
+ // ../server/dist/routes/mtime-cache.js
18869
19205
  function createMtimeCache() {
18870
19206
  const entries = /* @__PURE__ */ new Map();
18871
19207
  return {
@@ -18880,12 +19216,12 @@ function createMtimeCache() {
18880
19216
  };
18881
19217
  }
18882
19218
  var init_mtime_cache = __esm({
18883
- "packages/server/dist/routes/mtime-cache.js"() {
19219
+ "../server/dist/routes/mtime-cache.js"() {
18884
19220
  "use strict";
18885
19221
  }
18886
19222
  });
18887
19223
 
18888
- // packages/server/dist/routes/agent-configs.js
19224
+ // ../server/dist/routes/agent-configs.js
18889
19225
  import { Hono as Hono4 } from "hono";
18890
19226
  import fs39 from "node:fs/promises";
18891
19227
  import path47 from "node:path";
@@ -19077,7 +19413,7 @@ function createAgentConfigRoutes() {
19077
19413
  if (wsIds.has(a.id))
19078
19414
  a.overridden = true;
19079
19415
  }
19080
- const disabledSet = projectId ? getDisabledSet(getWorkspaceDb(projectId).db, "agent") : /* @__PURE__ */ new Set();
19416
+ const disabledSet = projectId && hasWorkspaceHalo(projectId) ? getDisabledSet(getWorkspaceDb(projectId).db, "agent") : /* @__PURE__ */ new Set();
19081
19417
  const allAgents = [...globalAgents, ...workspaceAgents];
19082
19418
  for (const a of allAgents) {
19083
19419
  a.disabled = disabledSet.has(`${a.scope}:${a.id}`);
@@ -19419,7 +19755,7 @@ ${body.description ?? ""}
19419
19755
  }
19420
19756
  var _cachedTools, GLOBAL_AGENTS_DIR4, FALLBACK_SCAFFOLD_PROVIDER, _yamlCache;
19421
19757
  var init_agent_configs = __esm({
19422
- "packages/server/dist/routes/agent-configs.js"() {
19758
+ "../server/dist/routes/agent-configs.js"() {
19423
19759
  "use strict";
19424
19760
  init_workspace_tools();
19425
19761
  init_draft_tool();
@@ -19427,6 +19763,7 @@ var init_agent_configs = __esm({
19427
19763
  init_md_loader();
19428
19764
  init_config();
19429
19765
  init_db();
19766
+ init_init();
19430
19767
  init_workspace_path();
19431
19768
  init_mtime_cache();
19432
19769
  _cachedTools = null;
@@ -19436,7 +19773,7 @@ var init_agent_configs = __esm({
19436
19773
  }
19437
19774
  });
19438
19775
 
19439
- // packages/server/dist/routes/skills.js
19776
+ // ../server/dist/routes/skills.js
19440
19777
  import { Hono as Hono5 } from "hono";
19441
19778
  import fs40 from "node:fs/promises";
19442
19779
  import path48 from "node:path";
@@ -19451,7 +19788,7 @@ function defaultSkillSettings() {
19451
19788
  "",
19452
19789
  "global.anthropic.claude-sonnet-4-6",
19453
19790
  "global.anthropic.claude-haiku-4-5-20251001",
19454
- "global.anthropic.claude-opus-4-6"
19791
+ "global.anthropic.claude-opus-5-5"
19455
19792
  ]
19456
19793
  }
19457
19794
  };
@@ -19631,7 +19968,7 @@ function createSkillRoutes() {
19631
19968
  }
19632
19969
  var GLOBAL_SETTINGS_PATH, _skillMdCache;
19633
19970
  var init_skills = __esm({
19634
- "packages/server/dist/routes/skills.js"() {
19971
+ "../server/dist/routes/skills.js"() {
19635
19972
  "use strict";
19636
19973
  init_agent_loader();
19637
19974
  init_db();
@@ -19642,7 +19979,7 @@ var init_skills = __esm({
19642
19979
  }
19643
19980
  });
19644
19981
 
19645
- // packages/server/dist/routes/settings.js
19982
+ // ../server/dist/routes/settings.js
19646
19983
  import { Hono as Hono6 } from "hono";
19647
19984
  import fs41 from "node:fs/promises";
19648
19985
  import path49 from "node:path";
@@ -19911,7 +20248,7 @@ function createSettingsRoutes() {
19911
20248
  }
19912
20249
  var GLOBAL_SETTINGS_PATH2, _changeListeners;
19913
20250
  var init_settings = __esm({
19914
- "packages/server/dist/routes/settings.js"() {
20251
+ "../server/dist/routes/settings.js"() {
19915
20252
  "use strict";
19916
20253
  init_settings_schema();
19917
20254
  init_workspace_path();
@@ -19920,7 +20257,7 @@ var init_settings = __esm({
19920
20257
  }
19921
20258
  });
19922
20259
 
19923
- // packages/server/dist/evolution/archive.js
20260
+ // ../server/dist/evolution/archive.js
19924
20261
  import fs42 from "node:fs";
19925
20262
  import path50 from "node:path";
19926
20263
  import { pipeline } from "node:stream/promises";
@@ -20087,7 +20424,7 @@ function stopArchiveDaemon() {
20087
20424
  }
20088
20425
  var TERMINAL_RUN_STATUSES, TERMINAL_APPLY_STATUSES, DAY_MS, ARCHIVE_AFTER_MS, PURGE_AFTER_MS, _archiveTimer, _startupTimer;
20089
20426
  var init_archive = __esm({
20090
- "packages/server/dist/evolution/archive.js"() {
20427
+ "../server/dist/evolution/archive.js"() {
20091
20428
  "use strict";
20092
20429
  init_evo_db();
20093
20430
  init_paths();
@@ -20101,7 +20438,7 @@ var init_archive = __esm({
20101
20438
  }
20102
20439
  });
20103
20440
 
20104
- // packages/server/dist/db/raw-sqlite.js
20441
+ // ../server/dist/db/raw-sqlite.js
20105
20442
  function rawSqlite(db) {
20106
20443
  const withClient = db;
20107
20444
  const client = withClient.$client ?? withClient.session?.client;
@@ -20110,12 +20447,12 @@ function rawSqlite(db) {
20110
20447
  return client;
20111
20448
  }
20112
20449
  var init_raw_sqlite = __esm({
20113
- "packages/server/dist/db/raw-sqlite.js"() {
20450
+ "../server/dist/db/raw-sqlite.js"() {
20114
20451
  "use strict";
20115
20452
  }
20116
20453
  });
20117
20454
 
20118
- // packages/server/dist/routes/evolution.js
20455
+ // ../server/dist/routes/evolution.js
20119
20456
  import { Hono as Hono7 } from "hono";
20120
20457
  import { eq as eq11, desc as desc2, lt as lt3, and as and8, or, sql } from "drizzle-orm";
20121
20458
  import fs43 from "node:fs/promises";
@@ -20373,7 +20710,7 @@ function extractText(content) {
20373
20710
  }
20374
20711
  var UNDELETABLE_RUN_STATUSES;
20375
20712
  var init_evolution = __esm({
20376
- "packages/server/dist/routes/evolution.js"() {
20713
+ "../server/dist/routes/evolution.js"() {
20377
20714
  "use strict";
20378
20715
  init_evo_db();
20379
20716
  init_archive();
@@ -20384,7 +20721,7 @@ var init_evolution = __esm({
20384
20721
  }
20385
20722
  });
20386
20723
 
20387
- // packages/server/dist/routes/sessions.js
20724
+ // ../server/dist/routes/sessions.js
20388
20725
  import { Hono as Hono8 } from "hono";
20389
20726
  import { and as and9, eq as eq12, gte as gte2, lt as lt4 } from "drizzle-orm";
20390
20727
  function rawId() {
@@ -20498,6 +20835,8 @@ function createSessionRoutes(smRegistry) {
20498
20835
  return c.json({ error: "session manager not initialized" }, 500);
20499
20836
  if (!projectId)
20500
20837
  return c.json({ error: "projectId required" }, 400);
20838
+ if (!hasWorkspaceHalo(projectId))
20839
+ return c.json({ sessions: [], nextCursor: null });
20501
20840
  const sm = smRegistry.getOrCreate(projectId);
20502
20841
  let parentId;
20503
20842
  if (parentIdParam === void 0)
@@ -20639,7 +20978,7 @@ function createSessionRoutes(smRegistry) {
20639
20978
  }
20640
20979
  var msgCounter2;
20641
20980
  var init_sessions = __esm({
20642
- "packages/server/dist/routes/sessions.js"() {
20981
+ "../server/dist/routes/sessions.js"() {
20643
20982
  "use strict";
20644
20983
  init_db();
20645
20984
  init_schema();
@@ -20647,11 +20986,12 @@ var init_sessions = __esm({
20647
20986
  init_goal_mode();
20648
20987
  init_broadcast();
20649
20988
  init_workspace_path();
20989
+ init_init();
20650
20990
  msgCounter2 = 0;
20651
20991
  }
20652
20992
  });
20653
20993
 
20654
- // packages/server/dist/routes/session-archive.js
20994
+ // ../server/dist/routes/session-archive.js
20655
20995
  import { Hono as Hono9 } from "hono";
20656
20996
  function createSessionArchiveRoutes(smRegistry) {
20657
20997
  const app2 = new Hono9();
@@ -20684,7 +21024,7 @@ function createSessionArchiveRoutes(smRegistry) {
20684
21024
  return app2;
20685
21025
  }
20686
21026
  var init_session_archive2 = __esm({
20687
- "packages/server/dist/routes/session-archive.js"() {
21027
+ "../server/dist/routes/session-archive.js"() {
20688
21028
  "use strict";
20689
21029
  init_db();
20690
21030
  init_session_store();
@@ -20693,7 +21033,7 @@ var init_session_archive2 = __esm({
20693
21033
  }
20694
21034
  });
20695
21035
 
20696
- // packages/server/dist/db/channel-db.js
21036
+ // ../server/dist/db/channel-db.js
20697
21037
  import Database5 from "better-sqlite3";
20698
21038
  import { drizzle as drizzle4 } from "drizzle-orm/better-sqlite3";
20699
21039
  import { sqliteTable as sqliteTable4, text as text4, integer as integer4 } from "drizzle-orm/sqlite-core";
@@ -20719,7 +21059,7 @@ function getChannelDb() {
20719
21059
  }
20720
21060
  var channelAccounts, CREATE_SQL3, _channelDb;
20721
21061
  var init_channel_db = __esm({
20722
- "packages/server/dist/db/channel-db.js"() {
21062
+ "../server/dist/db/channel-db.js"() {
20723
21063
  "use strict";
20724
21064
  init_migrate();
20725
21065
  channelAccounts = sqliteTable4("channel_accounts", {
@@ -20753,7 +21093,7 @@ CREATE INDEX IF NOT EXISTS idx_channel_accounts_type ON channel_accounts(channel
20753
21093
  }
20754
21094
  });
20755
21095
 
20756
- // packages/server/dist/channels/shared/accounts.js
21096
+ // ../server/dist/channels/shared/accounts.js
20757
21097
  import fs45 from "node:fs";
20758
21098
  import path53 from "node:path";
20759
21099
  import { eq as eq13, and as and10 } from "drizzle-orm";
@@ -20874,7 +21214,7 @@ function deleteAccount(db, accountId) {
20874
21214
  }
20875
21215
  var ACCOUNT_ACCESS_LEVELS, CHAT_ACCESS_LEVELS, _lastActiveChatCache, _wechatContextTokenCache;
20876
21216
  var init_accounts = __esm({
20877
- "packages/server/dist/channels/shared/accounts.js"() {
21217
+ "../server/dist/channels/shared/accounts.js"() {
20878
21218
  "use strict";
20879
21219
  init_channel_db();
20880
21220
  init_init();
@@ -20885,7 +21225,7 @@ var init_accounts = __esm({
20885
21225
  }
20886
21226
  });
20887
21227
 
20888
- // packages/server/dist/channels/web/accounts.js
21228
+ // ../server/dist/channels/web/accounts.js
20889
21229
  function toWeb(a) {
20890
21230
  const c = a.config;
20891
21231
  return {
@@ -20948,14 +21288,14 @@ function deleteAccount2(db, accountId) {
20948
21288
  }
20949
21289
  var CH;
20950
21290
  var init_accounts2 = __esm({
20951
- "packages/server/dist/channels/web/accounts.js"() {
21291
+ "../server/dist/channels/web/accounts.js"() {
20952
21292
  "use strict";
20953
21293
  init_accounts();
20954
21294
  CH = "web";
20955
21295
  }
20956
21296
  });
20957
21297
 
20958
- // packages/server/dist/middleware/brute-force.js
21298
+ // ../server/dist/middleware/brute-force.js
20959
21299
  import { getConnInfo } from "@hono/node-server/conninfo";
20960
21300
  function bucket(name) {
20961
21301
  let b = buckets.get(name);
@@ -21006,7 +21346,7 @@ function clearFailures(bucketName, ip) {
21006
21346
  }
21007
21347
  var MAX_ATTEMPTS, LOCKOUT_MS, buckets;
21008
21348
  var init_brute_force = __esm({
21009
- "packages/server/dist/middleware/brute-force.js"() {
21349
+ "../server/dist/middleware/brute-force.js"() {
21010
21350
  "use strict";
21011
21351
  init_config();
21012
21352
  MAX_ATTEMPTS = 5;
@@ -21015,7 +21355,7 @@ var init_brute_force = __esm({
21015
21355
  }
21016
21356
  });
21017
21357
 
21018
- // packages/server/dist/middleware/web-token.js
21358
+ // ../server/dist/middleware/web-token.js
21019
21359
  function resolveTokenAuth(c, db) {
21020
21360
  const ip = getClientIp(c);
21021
21361
  if (isLockedOut(TOKEN_BUCKET, ip))
@@ -21037,7 +21377,7 @@ function tokenAuthJsonError(c, reason) {
21037
21377
  }
21038
21378
  var TOKEN_BUCKET, TOKEN_AUTH_STATUS, JSON_ERROR;
21039
21379
  var init_web_token = __esm({
21040
- "packages/server/dist/middleware/web-token.js"() {
21380
+ "../server/dist/middleware/web-token.js"() {
21041
21381
  "use strict";
21042
21382
  init_accounts2();
21043
21383
  init_brute_force();
@@ -21055,17 +21395,17 @@ var init_web_token = __esm({
21055
21395
  }
21056
21396
  });
21057
21397
 
21058
- // packages/server/dist/channels/shared/session-prefix.js
21398
+ // ../server/dist/channels/shared/session-prefix.js
21059
21399
  function sessionPrefix(channel, userId) {
21060
21400
  return `${channel}_${userId}_`;
21061
21401
  }
21062
21402
  var init_session_prefix = __esm({
21063
- "packages/server/dist/channels/shared/session-prefix.js"() {
21403
+ "../server/dist/channels/shared/session-prefix.js"() {
21064
21404
  "use strict";
21065
21405
  }
21066
21406
  });
21067
21407
 
21068
- // packages/server/dist/channels/web/handler.js
21408
+ // ../server/dist/channels/web/handler.js
21069
21409
  function buildWebSessionPrefix(accountId) {
21070
21410
  return sessionPrefix("web", accountId);
21071
21411
  }
@@ -21482,7 +21822,7 @@ function createMediaBuffer() {
21482
21822
  };
21483
21823
  }
21484
21824
  var init_handler = __esm({
21485
- "packages/server/dist/channels/web/handler.js"() {
21825
+ "../server/dist/channels/web/handler.js"() {
21486
21826
  "use strict";
21487
21827
  init_ui_log_builder();
21488
21828
  init_accounts2();
@@ -21499,7 +21839,7 @@ var init_handler = __esm({
21499
21839
  }
21500
21840
  });
21501
21841
 
21502
- // packages/core/dist/protocol/session-message.js
21842
+ // ../core/dist/protocol/session-message.js
21503
21843
  function inferMessageType(msg) {
21504
21844
  if (msg.type)
21505
21845
  return msg.type;
@@ -21518,20 +21858,20 @@ function inferMessageType(msg) {
21518
21858
  return "notification";
21519
21859
  }
21520
21860
  var init_session_message = __esm({
21521
- "packages/core/dist/protocol/session-message.js"() {
21861
+ "../core/dist/protocol/session-message.js"() {
21522
21862
  "use strict";
21523
21863
  }
21524
21864
  });
21525
21865
 
21526
- // packages/core/dist/protocol/index.js
21866
+ // ../core/dist/protocol/index.js
21527
21867
  var init_protocol = __esm({
21528
- "packages/core/dist/protocol/index.js"() {
21868
+ "../core/dist/protocol/index.js"() {
21529
21869
  "use strict";
21530
21870
  init_session_message();
21531
21871
  }
21532
21872
  });
21533
21873
 
21534
- // packages/server/dist/sessions/session-types.js
21874
+ // ../server/dist/sessions/session-types.js
21535
21875
  function messageToolCalls(msg) {
21536
21876
  if (msg.contentBlocks) {
21537
21877
  return msg.contentBlocks.filter((b) => b.type === "tool_call").map((b) => b.toolCall);
@@ -21539,13 +21879,13 @@ function messageToolCalls(msg) {
21539
21879
  return msg.toolCalls ?? [];
21540
21880
  }
21541
21881
  var init_session_types = __esm({
21542
- "packages/server/dist/sessions/session-types.js"() {
21882
+ "../server/dist/sessions/session-types.js"() {
21543
21883
  "use strict";
21544
21884
  init_protocol();
21545
21885
  }
21546
21886
  });
21547
21887
 
21548
- // packages/server/dist/routes/halo-city.js
21888
+ // ../server/dist/routes/halo-city.js
21549
21889
  import { Hono as Hono10 } from "hono";
21550
21890
  import fs46 from "node:fs";
21551
21891
  import path54 from "node:path";
@@ -21932,7 +22272,7 @@ function createShowRoutes(registry2) {
21932
22272
  }
21933
22273
  var SESSIONS_PER_WS, _skillCache, _metaCache, _roReaders, SESSION_LOG_MAX_MSGS, _birthCache;
21934
22274
  var init_halo_city = __esm({
21935
- "packages/server/dist/routes/halo-city.js"() {
22275
+ "../server/dist/routes/halo-city.js"() {
21936
22276
  "use strict";
21937
22277
  init_channel_db();
21938
22278
  init_web_token();
@@ -21950,7 +22290,7 @@ var init_halo_city = __esm({
21950
22290
  }
21951
22291
  });
21952
22292
 
21953
- // packages/server/dist/routes/metrics.js
22293
+ // ../server/dist/routes/metrics.js
21954
22294
  import { Hono as Hono11 } from "hono";
21955
22295
  function family(name, type, help, samples) {
21956
22296
  const lines = [`# HELP ${name} ${help}`, `# TYPE ${name} ${type}`];
@@ -22029,7 +22369,7 @@ function createMetricsRoutes(registry2) {
22029
22369
  }
22030
22370
  var TEXT_ERROR, SESSIONS_PER_WS2;
22031
22371
  var init_metrics = __esm({
22032
- "packages/server/dist/routes/metrics.js"() {
22372
+ "../server/dist/routes/metrics.js"() {
22033
22373
  "use strict";
22034
22374
  init_channel_db();
22035
22375
  init_web_token();
@@ -22043,7 +22383,7 @@ var init_metrics = __esm({
22043
22383
  }
22044
22384
  });
22045
22385
 
22046
- // packages/server/dist/routes/commands.js
22386
+ // ../server/dist/routes/commands.js
22047
22387
  import { Hono as Hono12 } from "hono";
22048
22388
  function createCommandRoutes(registry2, smRegistry) {
22049
22389
  const app2 = new Hono12();
@@ -22068,12 +22408,12 @@ function createCommandRoutes(registry2, smRegistry) {
22068
22408
  return app2;
22069
22409
  }
22070
22410
  var init_commands3 = __esm({
22071
- "packages/server/dist/routes/commands.js"() {
22411
+ "../server/dist/routes/commands.js"() {
22072
22412
  "use strict";
22073
22413
  }
22074
22414
  });
22075
22415
 
22076
- // packages/server/dist/routes/agentcore.js
22416
+ // ../server/dist/routes/agentcore.js
22077
22417
  import { Hono as Hono13 } from "hono";
22078
22418
  import path55 from "node:path";
22079
22419
  import fs47 from "node:fs";
@@ -22422,7 +22762,7 @@ ${fullText}`, images.length > 0 ? images : void 0);
22422
22762
  }
22423
22763
  var SESSION_HEADER, MAX_IMAGES_PER_MESSAGE, MAX_IMAGE_BASE64_LENGTH, MAX_PENDING_UPLOADS, MAX_CHUNKS_PER_UPLOAD, activeOverrides;
22424
22764
  var init_agentcore = __esm({
22425
- "packages/server/dist/routes/agentcore.js"() {
22765
+ "../server/dist/routes/agentcore.js"() {
22426
22766
  "use strict";
22427
22767
  init_commands2();
22428
22768
  init_ui_log_builder();
@@ -22437,7 +22777,7 @@ var init_agentcore = __esm({
22437
22777
  }
22438
22778
  });
22439
22779
 
22440
- // packages/server/dist/ws/file-watcher.js
22780
+ // ../server/dist/ws/file-watcher.js
22441
22781
  import fs48 from "node:fs";
22442
22782
  import path56 from "node:path";
22443
22783
  function enqueueNativeOp(op) {
@@ -22459,7 +22799,7 @@ function isUnwatchablePath(absPath) {
22459
22799
  }
22460
22800
  var IGNORED_SEGMENTS, IS_WIN32, IGNORED_SEGMENT_SET, NATIVE_IGNORE, nativeOpChain, WorkspaceWatcher;
22461
22801
  var init_file_watcher = __esm({
22462
- "packages/server/dist/ws/file-watcher.js"() {
22802
+ "../server/dist/ws/file-watcher.js"() {
22463
22803
  "use strict";
22464
22804
  IGNORED_SEGMENTS = [
22465
22805
  // VCS
@@ -22681,12 +23021,12 @@ var init_file_watcher = __esm({
22681
23021
  }
22682
23022
  });
22683
23023
 
22684
- // packages/server/dist/ws/git-dir-watcher.js
23024
+ // ../server/dist/ws/git-dir-watcher.js
22685
23025
  import fs49 from "node:fs";
22686
23026
  import path57 from "node:path";
22687
23027
  var GitDirWatcher;
22688
23028
  var init_git_dir_watcher = __esm({
22689
- "packages/server/dist/ws/git-dir-watcher.js"() {
23029
+ "../server/dist/ws/git-dir-watcher.js"() {
22690
23030
  "use strict";
22691
23031
  GitDirWatcher = class {
22692
23032
  watcher = null;
@@ -22805,7 +23145,7 @@ var init_git_dir_watcher = __esm({
22805
23145
  }
22806
23146
  });
22807
23147
 
22808
- // packages/server/dist/ws/event-processor.js
23148
+ // ../server/dist/ws/event-processor.js
22809
23149
  function sendJson(ws, data) {
22810
23150
  if (ws.readyState === ws.OPEN) {
22811
23151
  try {
@@ -22904,16 +23244,16 @@ function bufferDetachedNotification(event, pendingEvents) {
22904
23244
  }
22905
23245
  }
22906
23246
  var init_event_processor = __esm({
22907
- "packages/server/dist/ws/event-processor.js"() {
23247
+ "../server/dist/ws/event-processor.js"() {
22908
23248
  "use strict";
22909
23249
  init_ui_log_builder();
22910
23250
  }
22911
23251
  });
22912
23252
 
22913
- // packages/server/dist/ws/watcher-pool.js
23253
+ // ../server/dist/ws/watcher-pool.js
22914
23254
  var WatcherPool;
22915
23255
  var init_watcher_pool = __esm({
22916
- "packages/server/dist/ws/watcher-pool.js"() {
23256
+ "../server/dist/ws/watcher-pool.js"() {
22917
23257
  "use strict";
22918
23258
  init_file_watcher();
22919
23259
  init_git_dir_watcher();
@@ -22971,7 +23311,7 @@ var init_watcher_pool = __esm({
22971
23311
  }
22972
23312
  });
22973
23313
 
22974
- // packages/server/dist/ws/terminal-manager.js
23314
+ // ../server/dist/ws/terminal-manager.js
22975
23315
  import { homedir as homedir22 } from "node:os";
22976
23316
  import { basename } from "node:path";
22977
23317
  import { createRequire } from "node:module";
@@ -23002,7 +23342,7 @@ function attachListenersOnce(t2) {
23002
23342
  }
23003
23343
  var requireFromHere, ptyModule, TERMINAL_GRACE_MS, terminals, TerminalManager;
23004
23344
  var init_terminal_manager = __esm({
23005
- "packages/server/dist/ws/terminal-manager.js"() {
23345
+ "../server/dist/ws/terminal-manager.js"() {
23006
23346
  "use strict";
23007
23347
  init_config();
23008
23348
  init_child_env();
@@ -23150,7 +23490,7 @@ var init_terminal_manager = __esm({
23150
23490
  }
23151
23491
  });
23152
23492
 
23153
- // packages/server/dist/ws/handler.js
23493
+ // ../server/dist/ws/handler.js
23154
23494
  import path58 from "node:path";
23155
23495
  function setupWebSocketHandler(deps) {
23156
23496
  const { wss: wss2, registry: registry2 } = deps;
@@ -23618,7 +23958,8 @@ ${msg.message}` : markers.join("\n");
23618
23958
  rememberChat(msg);
23619
23959
  ackChat(msg);
23620
23960
  console.debug(`[WS] Chat: session=${msg.sessionId}, project=${msg.projectId}, agent=${msg.agentId ?? client2.agentId}`);
23621
- sm.sendUserMessage(sid, msg.message, msg.images).catch((err) => {
23961
+ const accessLevel = msg.accessLevel === void 0 ? void 0 : msg.accessLevel === "full" || getSandboxBackend() === null ? null : msg.accessLevel;
23962
+ sm.sendUserMessage(sid, msg.message, msg.images, accessLevel).catch((err) => {
23622
23963
  console.debug(`[WS] Chat error: ${err instanceof Error ? err.message : String(err)}`);
23623
23964
  sendJson(ws, { type: "error", error: err instanceof Error ? err.message : String(err) });
23624
23965
  saveSession(client2);
@@ -23678,7 +24019,7 @@ ${msg.message}` : markers.join("\n");
23678
24019
  const running = client2.sessionManager.isSessionRunning(client2.sessionId);
23679
24020
  const messages3 = state2 ? running ? [...state2.messageLog] : [...createSaveSnapshot(state2)] : [];
23680
24021
  const detachedSession = client2.sessionManager.getSessionById(client2.sessionId);
23681
- sendJson(ws, { type: "state:snapshot", snapshot: { recentMessages: messages3, sessionId: msg.sessionId, maxContextTokens: ctxConfig.maxTokens, agentId: detachedSession?.agentId, archiveCount: archiveCountFor(client2, client2.sessionId, detachedSession?.agentId) } });
24022
+ sendJson(ws, { type: "state:snapshot", snapshot: { recentMessages: messages3, sessionId: msg.sessionId, maxContextTokens: ctxConfig.maxTokens, agentId: detachedSession?.agentId, archiveCount: archiveCountFor(client2, client2.sessionId, detachedSession?.agentId), accessLevel: detachedSession?.accessLevel ?? null } });
23682
24023
  if (state2 && state2.contextTokens > 0) {
23683
24024
  sendJson(ws, { type: "chat:usage", contextTokens: state2.contextTokens, outputTokens: state2.outputTokens });
23684
24025
  }
@@ -23722,12 +24063,14 @@ ${msg.message}` : markers.join("\n");
23722
24063
  }
23723
24064
  }
23724
24065
  let agentId;
24066
+ let accessLevel;
23725
24067
  if (msg.sessionId && client2.sessionManager) {
23726
24068
  const existingSession = client2.sessionManager.getSessionById(msg.sessionId);
23727
24069
  if (existingSession) {
23728
24070
  client2.sessionId = msg.sessionId;
23729
24071
  client2.unsubscribeEvents = client2.sessionManager.registerEventListener(msg.sessionId, createEventListener(client2));
23730
24072
  agentId = existingSession.agentId;
24073
+ accessLevel = existingSession.accessLevel ?? null;
23731
24074
  }
23732
24075
  }
23733
24076
  let maxContextTokens = config.model.maxContextTokens;
@@ -23739,7 +24082,7 @@ ${msg.message}` : markers.join("\n");
23739
24082
  }
23740
24083
  const state = getState(client2);
23741
24084
  const messages2 = state ? [...createSaveSnapshot(state)] : [];
23742
- sendJson(ws, { type: "state:snapshot", snapshot: { recentMessages: messages2, sessionId: msg.sessionId, maxContextTokens, agentId, archiveCount: msg.sessionId ? archiveCountFor(client2, msg.sessionId, agentId) : 0 } });
24085
+ sendJson(ws, { type: "state:snapshot", snapshot: { recentMessages: messages2, sessionId: msg.sessionId, maxContextTokens, agentId, archiveCount: msg.sessionId ? archiveCountFor(client2, msg.sessionId, agentId) : 0, accessLevel } });
23743
24086
  if (state && state.contextTokens > 0) {
23744
24087
  sendJson(ws, { type: "chat:usage", contextTokens: state.contextTokens, outputTokens: state.outputTokens });
23745
24088
  }
@@ -23766,8 +24109,9 @@ ${msg.message}` : markers.join("\n");
23766
24109
  }
23767
24110
  var CLIENT_SILENCE_LIMIT_MS, detachedSessions;
23768
24111
  var init_handler2 = __esm({
23769
- "packages/server/dist/ws/handler.js"() {
24112
+ "../server/dist/ws/handler.js"() {
23770
24113
  "use strict";
24114
+ init_sandbox();
23771
24115
  init_ui_log_builder();
23772
24116
  init_config();
23773
24117
  init_watcher_pool();
@@ -23784,7 +24128,7 @@ var init_handler2 = __esm({
23784
24128
  }
23785
24129
  });
23786
24130
 
23787
- // packages/server/dist/db/cron-db.js
24131
+ // ../server/dist/db/cron-db.js
23788
24132
  import Database7 from "better-sqlite3";
23789
24133
  import { drizzle as drizzle5 } from "drizzle-orm/better-sqlite3";
23790
24134
  import { sqliteTable as sqliteTable5, text as text5, integer as integer5 } from "drizzle-orm/sqlite-core";
@@ -23809,7 +24153,7 @@ function getCronDb() {
23809
24153
  }
23810
24154
  var cronJobs, cronRuns, CREATE_SQL4, CRON_MIGRATIONS, _cronDb;
23811
24155
  var init_cron_db = __esm({
23812
- "packages/server/dist/db/cron-db.js"() {
24156
+ "../server/dist/db/cron-db.js"() {
23813
24157
  "use strict";
23814
24158
  init_migrate();
23815
24159
  cronJobs = sqliteTable5("cron_jobs", {
@@ -23838,6 +24182,10 @@ var init_cron_db = __esm({
23838
24182
  * it. NULL = default 3600 (runner.ts CLI_TIMEOUT_SEC). Range 60–21600,
23839
24183
  * enforced at the write points (REST routes / skill helper). */
23840
24184
  timeoutSec: integer5("timeout_sec"),
24185
+ /** Root session id the cli runs in. NULL = the job's own `cron-<jobId>`
24186
+ * session. When it names an existing session the cli resumes it with that
24187
+ * session's own agent (`agentId` only applies when the session is new). */
24188
+ sessionId: text5("session_id"),
23841
24189
  /** JSON array of `{channelType, accountId}` records. Cron output (final
23842
24190
  * assistant text) is dispatched to each one. Empty array = log only. */
23843
24191
  targets: text5("targets").notNull().default("[]"),
@@ -23888,6 +24236,7 @@ CREATE TABLE IF NOT EXISTS cron_jobs (
23888
24236
  run_at INTEGER,
23889
24237
  timezone TEXT,
23890
24238
  timeout_sec INTEGER,
24239
+ session_id TEXT,
23891
24240
  targets TEXT NOT NULL DEFAULT '[]',
23892
24241
  enabled INTEGER NOT NULL DEFAULT 1,
23893
24242
  last_run_status TEXT,
@@ -23923,13 +24272,15 @@ CREATE INDEX IF NOT EXISTS idx_cron_runs_status ON cron_runs(status);
23923
24272
  addColumnIfMissing(s, "cron_jobs", "run_at", "INTEGER");
23924
24273
  addColumnIfMissing(s, "cron_jobs", "timeout_sec", "INTEGER");
23925
24274
  addColumnIfMissing(s, "cron_runs", "pid", "INTEGER");
23926
- }
24275
+ },
24276
+ // v2: `session_id` — run the job in a chosen root session instead of cron-<jobId>.
24277
+ (s) => addColumnIfMissing(s, "cron_jobs", "session_id", "TEXT")
23927
24278
  ];
23928
24279
  _cronDb = null;
23929
24280
  }
23930
24281
  });
23931
24282
 
23932
- // packages/server/dist/cron/dispatcher.js
24283
+ // ../server/dist/cron/dispatcher.js
23933
24284
  function registerCronDispatcher(d) {
23934
24285
  _registry2.set(d.channelType, d);
23935
24286
  }
@@ -23976,14 +24327,14 @@ async function dispatchToTargets(rawText, targets, workspacePath) {
23976
24327
  }
23977
24328
  var _registry2;
23978
24329
  var init_dispatcher = __esm({
23979
- "packages/server/dist/cron/dispatcher.js"() {
24330
+ "../server/dist/cron/dispatcher.js"() {
23980
24331
  "use strict";
23981
24332
  init_media();
23982
24333
  _registry2 = /* @__PURE__ */ new Map();
23983
24334
  }
23984
24335
  });
23985
24336
 
23986
- // packages/server/dist/cron/runner.js
24337
+ // ../server/dist/cron/runner.js
23987
24338
  import { spawn as spawn3, execFileSync } from "node:child_process";
23988
24339
  import fs51 from "node:fs";
23989
24340
  import path60 from "node:path";
@@ -24048,14 +24399,30 @@ function killTreeHard(rootPid) {
24048
24399
  }
24049
24400
  }
24050
24401
  }
24051
- function isCronCliProcess(pid, jobId) {
24402
+ function isCronCliProcess(pid, sessionId) {
24052
24403
  try {
24053
24404
  const args = execFileSync("ps", ["-p", String(pid), "-o", "args="], { encoding: "utf-8" });
24054
- return args.includes(`cron-${jobId}`);
24405
+ return args.trim().split(/\s+/).includes(sessionId);
24055
24406
  } catch {
24056
24407
  return false;
24057
24408
  }
24058
24409
  }
24410
+ function effectiveSessionId(job) {
24411
+ return job.sessionId ?? `cron-${job.id}`;
24412
+ }
24413
+ function sessionKeyFor(workspacePath, sessionId) {
24414
+ let ws;
24415
+ try {
24416
+ ws = fs51.realpathSync(workspacePath);
24417
+ } catch {
24418
+ ws = path60.resolve(workspacePath);
24419
+ }
24420
+ return `${ws}
24421
+ ${sessionId}`;
24422
+ }
24423
+ function setCronSessionRegistry(r) {
24424
+ _sessionRegistry = r;
24425
+ }
24059
24426
  function logsDir() {
24060
24427
  return path60.join(homedir23(), ".halo", "global", "logs", "cron");
24061
24428
  }
@@ -24072,14 +24439,24 @@ function sweepOrphanRuns(opts) {
24072
24439
  const now = Date.now();
24073
24440
  for (const row of rows) {
24074
24441
  const { id: runId, jobId, pid } = row;
24442
+ const job = db.select().from(cronJobs).where(eq14(cronJobs.id, jobId)).get();
24443
+ const sessionId = effectiveSessionId(job ?? { id: jobId, sessionId: null });
24444
+ const sessionKey = job ? sessionKeyFor(job.workspacePath, sessionId) : null;
24075
24445
  _inflight.add(jobId);
24446
+ if (sessionKey)
24447
+ _inflightSessions.add(sessionKey);
24448
+ const release = () => {
24449
+ _inflight.delete(jobId);
24450
+ if (sessionKey)
24451
+ _inflightSessions.delete(sessionKey);
24452
+ };
24076
24453
  let needsKill = false;
24077
24454
  let disposition;
24078
24455
  if (process.platform === "win32") {
24079
24456
  disposition = pid == null ? "no pid recorded" : `pid ${pid} not killed (Windows: cannot verify process identity)`;
24080
24457
  } else if (pid == null) {
24081
24458
  disposition = "no pid recorded";
24082
- } else if (!isCronCliProcess(pid, jobId)) {
24459
+ } else if (!isCronCliProcess(pid, sessionId)) {
24083
24460
  disposition = `pid ${pid} already dead (or pid reused by another process); not killed`;
24084
24461
  } else {
24085
24462
  needsKill = true;
@@ -24093,7 +24470,7 @@ function sweepOrphanRuns(opts) {
24093
24470
  broadcast({ type: "cron:run_changed", jobId, runId, status: "failed" });
24094
24471
  console.log(`[Cron] orphan sweep: run ${runId} (job ${jobId}) \u2014 ${disposition}`);
24095
24472
  if (!needsKill || pid == null) {
24096
- _inflight.delete(jobId);
24473
+ release();
24097
24474
  continue;
24098
24475
  }
24099
24476
  try {
@@ -24101,11 +24478,11 @@ function sweepOrphanRuns(opts) {
24101
24478
  } catch {
24102
24479
  }
24103
24480
  const timer = setTimeout(() => {
24104
- if (isCronCliProcess(pid, jobId)) {
24481
+ if (isCronCliProcess(pid, sessionId)) {
24105
24482
  console.log(`[Cron] orphan sweep: pid ${pid} (job ${jobId}) survived SIGTERM \u2014 SIGKILL tree`);
24106
24483
  killTreeHard(pid);
24107
24484
  }
24108
- _inflight.delete(jobId);
24485
+ release();
24109
24486
  }, graceMs);
24110
24487
  timer.unref();
24111
24488
  }
@@ -24269,7 +24646,11 @@ async function runJob(jobId, triggerKind) {
24269
24646
  const startedAt = Date.now();
24270
24647
  const logPath = logPathFor(runId);
24271
24648
  fs51.mkdirSync(logsDir(), { recursive: true });
24272
- if (_inflight.has(jobId)) {
24649
+ const sessionId = effectiveSessionId(job);
24650
+ const sessionKey = sessionKeyFor(job.workspacePath, sessionId);
24651
+ const host = _sessionRegistry?.peek(job.workspacePath);
24652
+ const skipReason = _inflight.has(jobId) ? "previous run still in progress" : _inflightSessions.has(sessionKey) ? `session ${sessionId} busy: another cron run is in progress` : host?.hasActiveWorkInTree(sessionId) ? `session ${sessionId} busy: a turn is running in it` : null;
24653
+ if (skipReason) {
24273
24654
  db.insert(cronRuns).values({
24274
24655
  id: runId,
24275
24656
  jobId,
@@ -24279,7 +24660,7 @@ async function runJob(jobId, triggerKind) {
24279
24660
  completedAt: startedAt,
24280
24661
  output: null,
24281
24662
  exitCode: null,
24282
- failureReason: "previous run still in progress",
24663
+ failureReason: skipReason,
24283
24664
  logPath: null,
24284
24665
  dispatchResults: null
24285
24666
  }).run();
@@ -24287,6 +24668,7 @@ async function runJob(jobId, triggerKind) {
24287
24668
  return runId;
24288
24669
  }
24289
24670
  _inflight.add(jobId);
24671
+ _inflightSessions.add(sessionKey);
24290
24672
  try {
24291
24673
  db.insert(cronRuns).values({
24292
24674
  id: runId,
@@ -24314,14 +24696,16 @@ async function runJob(jobId, triggerKind) {
24314
24696
  return runId;
24315
24697
  }
24316
24698
  const cli = resolveHaloCli();
24317
- const sessionId = `cron-${job.id}`;
24318
24699
  const args = ["cli", "-a", job.agentId, "-s", sessionId, "-w", job.workspacePath];
24700
+ const accessLevel = readSessionAccessLevel(job.workspacePath, sessionId);
24701
+ if (accessLevel)
24702
+ args.push("--access", accessLevel);
24319
24703
  const [spawnBin, spawnArgs] = process.platform === "win32" && cli.endsWith(".cmd") ? ["cmd.exe", ["/c", cli, ...args]] : [cli, args];
24320
24704
  const timeoutSec = job.timeoutSec ?? CLI_TIMEOUT_SEC;
24321
24705
  const teeStream = fs51.createWriteStream(logPath, { flags: "a" });
24322
24706
  teeStream.write(`=== ${(/* @__PURE__ */ new Date()).toISOString()} cron run ${runId} job=${jobId} trigger=${triggerKind} ===
24323
24707
  `);
24324
- teeStream.write(`agent=${job.agentId} workspace=${job.workspacePath} schedule=${job.schedule}
24708
+ teeStream.write(`agent=${job.agentId} session=${sessionId}${accessLevel ? ` access=${accessLevel}` : ""} workspace=${job.workspacePath} schedule=${job.schedule}
24325
24709
  `);
24326
24710
  teeStream.write(`prompt: ${job.userPrompt}
24327
24711
 
@@ -24393,6 +24777,10 @@ ${job.userPrompt}`);
24393
24777
  resolve2({ exitCode: 1 });
24394
24778
  });
24395
24779
  });
24780
+ const hostAfter = _sessionRegistry?.peek(job.workspacePath);
24781
+ if (hostAfter && !hostAfter.forgetExternalWrite(sessionId)) {
24782
+ console.warn(`[Cron] ${jobId}: session ${sessionId} had a server-side turn running when the cli exited; one of the two turns may be missing from its history`);
24783
+ }
24396
24784
  const trimmedOut = stdout.trim();
24397
24785
  let status;
24398
24786
  let failureReason = null;
@@ -24427,6 +24815,17 @@ ${job.userPrompt}`);
24427
24815
  return runId;
24428
24816
  } finally {
24429
24817
  _inflight.delete(jobId);
24818
+ _inflightSessions.delete(sessionKey);
24819
+ }
24820
+ }
24821
+ function readSessionAccessLevel(workspacePath, sessionId) {
24822
+ try {
24823
+ const row = getWorkspaceDb(workspacePath).db.select({ accessLevel: agentSessions.accessLevel }).from(agentSessions).where(eq14(agentSessions.id, sessionId)).get();
24824
+ if (!row)
24825
+ return null;
24826
+ return row.accessLevel === "workspace" || row.accessLevel === "readonly" ? row.accessLevel : "full";
24827
+ } catch {
24828
+ return null;
24430
24829
  }
24431
24830
  }
24432
24831
  function finalize(runId, jobId, a) {
@@ -24508,12 +24907,14 @@ function pruneOldLogs() {
24508
24907
  const dbCutoff = Date.now() - 2 * LOG_RETENTION_DAYS * DAY_MS2;
24509
24908
  db.delete(cronRuns).where(lt5(cronRuns.startedAt, dbCutoff)).run();
24510
24909
  }
24511
- var DAY_MS2, CLI_TIMEOUT_SEC, KILL_GRACE_SEC, UNATTENDED_PREAMBLE, RUNS_PER_JOB_KEEP, LOG_RETENTION_DAYS, _active, _inflight, _fingerprint, _daemonTimers, _lastCronDataVersion;
24910
+ var DAY_MS2, CLI_TIMEOUT_SEC, KILL_GRACE_SEC, UNATTENDED_PREAMBLE, RUNS_PER_JOB_KEEP, LOG_RETENTION_DAYS, _sessionRegistry, _active, _inflight, _inflightSessions, _fingerprint, _daemonTimers, _lastCronDataVersion;
24512
24911
  var init_runner = __esm({
24513
- "packages/server/dist/cron/runner.js"() {
24912
+ "../server/dist/cron/runner.js"() {
24514
24913
  "use strict";
24515
24914
  init_cron_db();
24516
24915
  init_raw_sqlite();
24916
+ init_db();
24917
+ init_schema();
24517
24918
  init_dispatcher();
24518
24919
  init_broadcast();
24519
24920
  init_child_env();
@@ -24523,15 +24924,17 @@ var init_runner = __esm({
24523
24924
  UNATTENDED_PREAMBLE = "[Unattended cron run \u2014 nobody will answer questions. Deliver the result directly; if genuinely blocked, state what's blocked in one line and stop.]";
24524
24925
  RUNS_PER_JOB_KEEP = 100;
24525
24926
  LOG_RETENTION_DAYS = 30;
24927
+ _sessionRegistry = null;
24526
24928
  _active = /* @__PURE__ */ new Map();
24527
24929
  _inflight = /* @__PURE__ */ new Set();
24930
+ _inflightSessions = /* @__PURE__ */ new Set();
24528
24931
  _fingerprint = /* @__PURE__ */ new Map();
24529
24932
  _daemonTimers = [];
24530
24933
  _lastCronDataVersion = null;
24531
24934
  }
24532
24935
  });
24533
24936
 
24534
- // packages/server/dist/routes/cron.js
24937
+ // ../server/dist/routes/cron.js
24535
24938
  import { Hono as Hono14 } from "hono";
24536
24939
  import { eq as eq15, desc as desc3, lt as lt6, and as and11 } from "drizzle-orm";
24537
24940
  import fs52 from "node:fs/promises";
@@ -24556,6 +24959,19 @@ function validateTimeoutSec(v) {
24556
24959
  }
24557
24960
  return null;
24558
24961
  }
24962
+ function parseSessionId(v) {
24963
+ if (v === void 0 || v === null)
24964
+ return { sessionId: null };
24965
+ if (typeof v !== "string")
24966
+ return { error: "sessionId must be a string or null" };
24967
+ const s = v.trim();
24968
+ if (s.length === 0)
24969
+ return { sessionId: null };
24970
+ if (!SESSION_ID_RE.test(s)) {
24971
+ return { error: 'sessionId must be a root session id (letters, digits, _ : - only; no ">" sub-session path)' };
24972
+ }
24973
+ return { sessionId: s };
24974
+ }
24559
24975
  function createCronRoutes() {
24560
24976
  const router = new Hono14();
24561
24977
  router.get("/cron/jobs", async (c) => {
@@ -24604,6 +25020,9 @@ function createCronRoutes() {
24604
25020
  if (err)
24605
25021
  return c.json({ error: err }, 400);
24606
25022
  }
25023
+ const session = parseSessionId(body.sessionId);
25024
+ if ("error" in session)
25025
+ return c.json({ error: session.error }, 400);
24607
25026
  const id = newJobId();
24608
25027
  const now = Date.now();
24609
25028
  getCronDb().insert(cronJobs).values({
@@ -24616,6 +25035,7 @@ function createCronRoutes() {
24616
25035
  runAt: hasRunAt ? body.runAt : null,
24617
25036
  timezone: body.timezone ?? null,
24618
25037
  timeoutSec: body.timeoutSec ?? null,
25038
+ sessionId: session.sessionId,
24619
25039
  targets: JSON.stringify(body.targets ?? []),
24620
25040
  enabled: body.enabled === false ? 0 : 1,
24621
25041
  lastRunStatus: null,
@@ -24657,6 +25077,9 @@ function createCronRoutes() {
24657
25077
  if (err)
24658
25078
  return c.json({ error: err }, 400);
24659
25079
  }
25080
+ const session = parseSessionId(body.sessionId);
25081
+ if ("error" in session)
25082
+ return c.json({ error: session.error }, 400);
24660
25083
  const hasSchedule = typeof body.schedule === "string" && body.schedule.trim().length > 0;
24661
25084
  const hasRunAt = typeof body.runAt === "number";
24662
25085
  if (hasSchedule && hasRunAt) {
@@ -24686,6 +25109,8 @@ function createCronRoutes() {
24686
25109
  patch.timezone = body.timezone || null;
24687
25110
  if (body.timeoutSec !== void 0)
24688
25111
  patch.timeoutSec = body.timeoutSec;
25112
+ if (body.sessionId !== void 0)
25113
+ patch.sessionId = session.sessionId;
24689
25114
  if (body.targets !== void 0)
24690
25115
  patch.targets = JSON.stringify(body.targets);
24691
25116
  if (body.enabled !== void 0)
@@ -24801,9 +25226,9 @@ function computeNextRun(j) {
24801
25226
  return null;
24802
25227
  }
24803
25228
  }
24804
- var TIMEOUT_SEC_MIN, TIMEOUT_SEC_MAX;
25229
+ var TIMEOUT_SEC_MIN, TIMEOUT_SEC_MAX, SESSION_ID_RE;
24805
25230
  var init_cron = __esm({
24806
- "packages/server/dist/routes/cron.js"() {
25231
+ "../server/dist/routes/cron.js"() {
24807
25232
  "use strict";
24808
25233
  init_cron_db();
24809
25234
  init_runner();
@@ -24811,10 +25236,11 @@ var init_cron = __esm({
24811
25236
  init_broadcast();
24812
25237
  TIMEOUT_SEC_MIN = 60;
24813
25238
  TIMEOUT_SEC_MAX = 21600;
25239
+ SESSION_ID_RE = /^[A-Za-z0-9_:-]{1,200}$/;
24814
25240
  }
24815
25241
  });
24816
25242
 
24817
- // packages/server/dist/evolution/ticker.js
25243
+ // ../server/dist/evolution/ticker.js
24818
25244
  import { eq as eq16, and as and12, or as or2, asc, isNull as isNull6, sql as sql2 } from "drizzle-orm";
24819
25245
  function setEvoSpawner(fn) {
24820
25246
  _spawner = fn;
@@ -25040,7 +25466,7 @@ function claimApply(id) {
25040
25466
  }
25041
25467
  var _lastRunStatus, _lastApplyStatus, _spawner, TICK_INTERVAL_MS, _interval, _startupTimer2;
25042
25468
  var init_ticker = __esm({
25043
- "packages/server/dist/evolution/ticker.js"() {
25469
+ "../server/dist/evolution/ticker.js"() {
25044
25470
  "use strict";
25045
25471
  init_config();
25046
25472
  init_evo_db();
@@ -25056,13 +25482,13 @@ var init_ticker = __esm({
25056
25482
  }
25057
25483
  });
25058
25484
 
25059
- // packages/server/dist/evolution/spawn.js
25485
+ // ../server/dist/evolution/spawn.js
25060
25486
  import path61 from "node:path";
25061
25487
  import { spawn as spawn4 } from "node:child_process";
25062
25488
  import { fileURLToPath as fileURLToPath2 } from "node:url";
25063
25489
  var __dirname2, WRAPPER_PATH, realEvoSpawner;
25064
25490
  var init_spawn = __esm({
25065
- "packages/server/dist/evolution/spawn.js"() {
25491
+ "../server/dist/evolution/spawn.js"() {
25066
25492
  "use strict";
25067
25493
  init_child_env();
25068
25494
  __dirname2 = path61.dirname(fileURLToPath2(import.meta.url));
@@ -25084,7 +25510,7 @@ var init_spawn = __esm({
25084
25510
  }
25085
25511
  });
25086
25512
 
25087
- // packages/server/dist/channels/registry.js
25513
+ // ../server/dist/channels/registry.js
25088
25514
  function bootChannels(app2, descriptors, deps) {
25089
25515
  for (const d of descriptors) {
25090
25516
  if (d.registerCronDispatcher)
@@ -25109,13 +25535,13 @@ async function shutdownChannels() {
25109
25535
  }
25110
25536
  var _running;
25111
25537
  var init_registry2 = __esm({
25112
- "packages/server/dist/channels/registry.js"() {
25538
+ "../server/dist/channels/registry.js"() {
25113
25539
  "use strict";
25114
25540
  _running = [];
25115
25541
  }
25116
25542
  });
25117
25543
 
25118
- // packages/server/dist/channels/telegram/accounts.js
25544
+ // ../server/dist/channels/telegram/accounts.js
25119
25545
  function toTelegram(a) {
25120
25546
  const c = a.config;
25121
25547
  return {
@@ -25189,14 +25615,14 @@ function deleteAccount3(db, accountId) {
25189
25615
  }
25190
25616
  var CH2;
25191
25617
  var init_accounts3 = __esm({
25192
- "packages/server/dist/channels/telegram/accounts.js"() {
25618
+ "../server/dist/channels/telegram/accounts.js"() {
25193
25619
  "use strict";
25194
25620
  init_accounts();
25195
25621
  CH2 = "telegram";
25196
25622
  }
25197
25623
  });
25198
25624
 
25199
- // packages/server/dist/channels/shared/chunk.js
25625
+ // ../server/dist/channels/shared/chunk.js
25200
25626
  function splitText(text6, limit) {
25201
25627
  const out = [];
25202
25628
  let rest = text6;
@@ -25212,15 +25638,15 @@ function splitText(text6, limit) {
25212
25638
  return out;
25213
25639
  }
25214
25640
  var init_chunk = __esm({
25215
- "packages/server/dist/channels/shared/chunk.js"() {
25641
+ "../server/dist/channels/shared/chunk.js"() {
25216
25642
  "use strict";
25217
25643
  }
25218
25644
  });
25219
25645
 
25220
- // packages/server/dist/channels/telegram/event-adapter.js
25646
+ // ../server/dist/channels/telegram/event-adapter.js
25221
25647
  var HARD_CHARS, TelegramResponder;
25222
25648
  var init_event_adapter = __esm({
25223
- "packages/server/dist/channels/telegram/event-adapter.js"() {
25649
+ "../server/dist/channels/telegram/event-adapter.js"() {
25224
25650
  "use strict";
25225
25651
  init_chunk();
25226
25652
  init_media();
@@ -25303,7 +25729,7 @@ var init_event_adapter = __esm({
25303
25729
  }
25304
25730
  });
25305
25731
 
25306
- // packages/server/dist/channels/shared/busy-hint.js
25732
+ // ../server/dist/channels/shared/busy-hint.js
25307
25733
  function busyHint(sm, sessionId, lang) {
25308
25734
  if (sm.isSessionCompacting(sessionId))
25309
25735
  return t("handler.compacting", lang);
@@ -25312,13 +25738,13 @@ function busyHint(sm, sessionId, lang) {
25312
25738
  return null;
25313
25739
  }
25314
25740
  var init_busy_hint = __esm({
25315
- "packages/server/dist/channels/shared/busy-hint.js"() {
25741
+ "../server/dist/channels/shared/busy-hint.js"() {
25316
25742
  "use strict";
25317
25743
  init_i18n();
25318
25744
  }
25319
25745
  });
25320
25746
 
25321
- // packages/server/dist/channels/shared/inbound.js
25747
+ // ../server/dist/channels/shared/inbound.js
25322
25748
  function sessionAccess(accountAccessLevel) {
25323
25749
  return accountAccessLevel === "full" ? null : accountAccessLevel === "workspace" ? "workspace" : "readonly";
25324
25750
  }
@@ -25376,7 +25802,7 @@ async function dispatchChannelCommand(ctx, command, arg, opts) {
25376
25802
  }
25377
25803
  var InboundBridge;
25378
25804
  var init_inbound = __esm({
25379
- "packages/server/dist/channels/shared/inbound.js"() {
25805
+ "../server/dist/channels/shared/inbound.js"() {
25380
25806
  "use strict";
25381
25807
  init_goal_mode();
25382
25808
  init_accounts();
@@ -25446,7 +25872,7 @@ var init_inbound = __esm({
25446
25872
  }
25447
25873
  });
25448
25874
 
25449
- // packages/server/dist/channels/telegram/handler.js
25875
+ // ../server/dist/channels/telegram/handler.js
25450
25876
  import { Bot, InputFile } from "grammy";
25451
25877
  function inferMediaKind(filePath) {
25452
25878
  const cls = classifyMedia(filePath);
@@ -25544,7 +25970,7 @@ function startTelegramChannel(deps) {
25544
25970
  if (!route)
25545
25971
  return;
25546
25972
  if (!isMediaPathAllowed(filePath, account.workspacePath)) {
25547
- console.log(`[Telegram] sendMedia blocked: ${filePath} not under workspace`);
25973
+ console.warn(`[Telegram] sendMedia blocked: ${filePath} not under workspace`);
25548
25974
  return;
25549
25975
  }
25550
25976
  const kind = inferMediaKind(filePath);
@@ -25833,7 +26259,7 @@ async function handleUserMessage(args) {
25833
26259
  }
25834
26260
  var MAX_TG_DOWNLOAD_BYTES;
25835
26261
  var init_handler3 = __esm({
25836
- "packages/server/dist/channels/telegram/handler.js"() {
26262
+ "../server/dist/channels/telegram/handler.js"() {
25837
26263
  "use strict";
25838
26264
  init_accounts3();
25839
26265
  init_event_adapter();
@@ -25848,7 +26274,7 @@ var init_handler3 = __esm({
25848
26274
  }
25849
26275
  });
25850
26276
 
25851
- // packages/server/dist/routes/telegram.js
26277
+ // ../server/dist/routes/telegram.js
25852
26278
  import { Hono as Hono15 } from "hono";
25853
26279
  import { Bot as Bot2 } from "grammy";
25854
26280
  import fs53 from "node:fs";
@@ -25967,14 +26393,14 @@ function createTelegramRoutes(deps) {
25967
26393
  return app2;
25968
26394
  }
25969
26395
  var init_telegram = __esm({
25970
- "packages/server/dist/routes/telegram.js"() {
26396
+ "../server/dist/routes/telegram.js"() {
25971
26397
  "use strict";
25972
26398
  init_accounts3();
25973
26399
  init_accounts();
25974
26400
  }
25975
26401
  });
25976
26402
 
25977
- // packages/server/dist/channels/telegram/cron-dispatcher.js
26403
+ // ../server/dist/channels/telegram/cron-dispatcher.js
25978
26404
  import { Bot as Bot3 } from "grammy";
25979
26405
  async function dispatch(accountId, text6, explicitChatId) {
25980
26406
  const acct = getAccount3(getChannelDb(), accountId);
@@ -26023,7 +26449,7 @@ function registerTelegramCronDispatcher() {
26023
26449
  registerCronDispatcher({ channelType: "telegram", dispatch, listTargets });
26024
26450
  }
26025
26451
  var init_cron_dispatcher = __esm({
26026
- "packages/server/dist/channels/telegram/cron-dispatcher.js"() {
26452
+ "../server/dist/channels/telegram/cron-dispatcher.js"() {
26027
26453
  "use strict";
26028
26454
  init_channel_db();
26029
26455
  init_accounts3();
@@ -26031,10 +26457,10 @@ var init_cron_dispatcher = __esm({
26031
26457
  }
26032
26458
  });
26033
26459
 
26034
- // packages/server/dist/channels/telegram/descriptor.js
26460
+ // ../server/dist/channels/telegram/descriptor.js
26035
26461
  var telegramDescriptor;
26036
26462
  var init_descriptor = __esm({
26037
- "packages/server/dist/channels/telegram/descriptor.js"() {
26463
+ "../server/dist/channels/telegram/descriptor.js"() {
26038
26464
  "use strict";
26039
26465
  init_handler3();
26040
26466
  init_telegram();
@@ -26049,7 +26475,7 @@ var init_descriptor = __esm({
26049
26475
  }
26050
26476
  });
26051
26477
 
26052
- // packages/server/dist/channels/wechat/api.js
26478
+ // ../server/dist/channels/wechat/api.js
26053
26479
  import crypto3 from "node:crypto";
26054
26480
  function buildClientVersion(version) {
26055
26481
  const [ma, mi, pa] = version.split(".").map((p) => parseInt(p, 10));
@@ -26238,7 +26664,7 @@ async function notifyStop(params) {
26238
26664
  }
26239
26665
  var QR_BASE_URL, DEFAULT_BOT_TYPE, CHANNEL_VERSION, ILINK_APP_ID, ILINK_APP_CLIENT_VERSION, DEFAULT_LONG_POLL_TIMEOUT_MS, DEFAULT_API_TIMEOUT_MS;
26240
26666
  var init_api = __esm({
26241
- "packages/server/dist/channels/wechat/api.js"() {
26667
+ "../server/dist/channels/wechat/api.js"() {
26242
26668
  "use strict";
26243
26669
  QR_BASE_URL = "https://ilinkai.weixin.qq.com";
26244
26670
  DEFAULT_BOT_TYPE = "3";
@@ -26250,10 +26676,10 @@ var init_api = __esm({
26250
26676
  }
26251
26677
  });
26252
26678
 
26253
- // packages/server/dist/channels/wechat/types.js
26679
+ // ../server/dist/channels/wechat/types.js
26254
26680
  var MessageItemType, MessageType, MessageState, UploadMediaType;
26255
26681
  var init_types = __esm({
26256
- "packages/server/dist/channels/wechat/types.js"() {
26682
+ "../server/dist/channels/wechat/types.js"() {
26257
26683
  "use strict";
26258
26684
  MessageItemType = {
26259
26685
  NONE: 0,
@@ -26282,7 +26708,7 @@ var init_types = __esm({
26282
26708
  }
26283
26709
  });
26284
26710
 
26285
- // packages/server/dist/channels/wechat/accounts.js
26711
+ // ../server/dist/channels/wechat/accounts.js
26286
26712
  function toWechat(a) {
26287
26713
  const c = a.config;
26288
26714
  return {
@@ -26364,17 +26790,17 @@ function saveSyncBuf(db, accountId, syncBuf) {
26364
26790
  }
26365
26791
  var CH3;
26366
26792
  var init_accounts4 = __esm({
26367
- "packages/server/dist/channels/wechat/accounts.js"() {
26793
+ "../server/dist/channels/wechat/accounts.js"() {
26368
26794
  "use strict";
26369
26795
  init_accounts();
26370
26796
  CH3 = "wechat";
26371
26797
  }
26372
26798
  });
26373
26799
 
26374
- // packages/server/dist/channels/wechat/event-adapter.js
26800
+ // ../server/dist/channels/wechat/event-adapter.js
26375
26801
  var WECHAT_TEXT_LIMIT, WechatResponder;
26376
26802
  var init_event_adapter2 = __esm({
26377
- "packages/server/dist/channels/wechat/event-adapter.js"() {
26803
+ "../server/dist/channels/wechat/event-adapter.js"() {
26378
26804
  "use strict";
26379
26805
  init_chunk();
26380
26806
  init_media();
@@ -26478,7 +26904,7 @@ var init_event_adapter2 = __esm({
26478
26904
  }
26479
26905
  });
26480
26906
 
26481
- // packages/server/dist/channels/wechat/cdn.js
26907
+ // ../server/dist/channels/wechat/cdn.js
26482
26908
  import { createDecipheriv, createCipheriv, randomBytes as randomBytes2, createHash as createHash2 } from "node:crypto";
26483
26909
  function decryptAesEcb(ciphertext, key) {
26484
26910
  const decipher = createDecipheriv("aes-128-ecb", key, null);
@@ -26577,14 +27003,14 @@ async function uploadCiphertext(params) {
26577
27003
  }
26578
27004
  var CDN_BASE_URL, UPLOAD_MAX_RETRIES;
26579
27005
  var init_cdn = __esm({
26580
- "packages/server/dist/channels/wechat/cdn.js"() {
27006
+ "../server/dist/channels/wechat/cdn.js"() {
26581
27007
  "use strict";
26582
27008
  CDN_BASE_URL = "https://novac2c.cdn.weixin.qq.com/c2c";
26583
27009
  UPLOAD_MAX_RETRIES = 3;
26584
27010
  }
26585
27011
  });
26586
27012
 
26587
- // packages/server/dist/channels/wechat/send-media.js
27013
+ // ../server/dist/channels/wechat/send-media.js
26588
27014
  import fs54 from "node:fs/promises";
26589
27015
  import path62 from "node:path";
26590
27016
  function inferKind(filePath) {
@@ -26678,7 +27104,7 @@ function buildMessageItem(args) {
26678
27104
  };
26679
27105
  }
26680
27106
  var init_send_media = __esm({
26681
- "packages/server/dist/channels/wechat/send-media.js"() {
27107
+ "../server/dist/channels/wechat/send-media.js"() {
26682
27108
  "use strict";
26683
27109
  init_api();
26684
27110
  init_cdn();
@@ -26687,7 +27113,7 @@ var init_send_media = __esm({
26687
27113
  }
26688
27114
  });
26689
27115
 
26690
- // packages/server/dist/channels/wechat/login.js
27116
+ // ../server/dist/channels/wechat/login.js
26691
27117
  import { randomUUID as randomUUID2 } from "node:crypto";
26692
27118
  function isFresh(l) {
26693
27119
  return Date.now() - l.startedAt < ACTIVE_TTL_MS;
@@ -26789,7 +27215,7 @@ async function waitLogin(params) {
26789
27215
  }
26790
27216
  var ACTIVE_TTL_MS, MAX_QR_REFRESH, activeLogins;
26791
27217
  var init_login = __esm({
26792
- "packages/server/dist/channels/wechat/login.js"() {
27218
+ "../server/dist/channels/wechat/login.js"() {
26793
27219
  "use strict";
26794
27220
  init_api();
26795
27221
  ACTIVE_TTL_MS = 5 * 6e4;
@@ -26798,7 +27224,7 @@ var init_login = __esm({
26798
27224
  }
26799
27225
  });
26800
27226
 
26801
- // packages/server/dist/channels/wechat/handler.js
27227
+ // ../server/dist/channels/wechat/handler.js
26802
27228
  import fs55 from "node:fs";
26803
27229
  import path63 from "node:path";
26804
27230
  import QRCode from "qrcode";
@@ -26841,7 +27267,7 @@ function startWechatChannel(deps) {
26841
27267
  if (!route)
26842
27268
  return;
26843
27269
  if (!isMediaPathAllowed(filePath, account.workspacePath)) {
26844
- console.log(`[WeChat] sendMedia blocked: ${filePath} not under workspace`);
27270
+ console.warn(`[WeChat] sendMedia blocked: ${filePath} not under workspace`);
26845
27271
  return;
26846
27272
  }
26847
27273
  await sendMediaFile({
@@ -27256,7 +27682,7 @@ function sleep2(ms, signal) {
27256
27682
  }
27257
27683
  var MAX_CONSECUTIVE_FAILURES, BACKOFF_DELAY_MS, RETRY_DELAY_MS;
27258
27684
  var init_handler4 = __esm({
27259
- "packages/server/dist/channels/wechat/handler.js"() {
27685
+ "../server/dist/channels/wechat/handler.js"() {
27260
27686
  "use strict";
27261
27687
  init_api();
27262
27688
  init_types();
@@ -27278,7 +27704,7 @@ var init_handler4 = __esm({
27278
27704
  }
27279
27705
  });
27280
27706
 
27281
- // packages/server/dist/routes/wechat.js
27707
+ // ../server/dist/routes/wechat.js
27282
27708
  import { Hono as Hono16 } from "hono";
27283
27709
  import path64 from "node:path";
27284
27710
  import fs56 from "node:fs";
@@ -27393,7 +27819,7 @@ function stripSecrets(acc) {
27393
27819
  return rest;
27394
27820
  }
27395
27821
  var init_wechat = __esm({
27396
- "packages/server/dist/routes/wechat.js"() {
27822
+ "../server/dist/routes/wechat.js"() {
27397
27823
  "use strict";
27398
27824
  init_login();
27399
27825
  init_accounts4();
@@ -27401,7 +27827,7 @@ var init_wechat = __esm({
27401
27827
  }
27402
27828
  });
27403
27829
 
27404
- // packages/server/dist/channels/wechat/cron-dispatcher.js
27830
+ // ../server/dist/channels/wechat/cron-dispatcher.js
27405
27831
  function readLastActiveChatId(accountId) {
27406
27832
  const acct = getAccount(getChannelDb(), accountId);
27407
27833
  if (!acct)
@@ -27482,7 +27908,7 @@ function registerWechatCronDispatcher() {
27482
27908
  registerCronDispatcher({ channelType: "wechat", supportsMedia: true, dispatch: dispatch2, listTargets: listTargets2 });
27483
27909
  }
27484
27910
  var init_cron_dispatcher2 = __esm({
27485
- "packages/server/dist/channels/wechat/cron-dispatcher.js"() {
27911
+ "../server/dist/channels/wechat/cron-dispatcher.js"() {
27486
27912
  "use strict";
27487
27913
  init_channel_db();
27488
27914
  init_accounts();
@@ -27496,10 +27922,10 @@ var init_cron_dispatcher2 = __esm({
27496
27922
  }
27497
27923
  });
27498
27924
 
27499
- // packages/server/dist/channels/wechat/descriptor.js
27925
+ // ../server/dist/channels/wechat/descriptor.js
27500
27926
  var wechatDescriptor;
27501
27927
  var init_descriptor2 = __esm({
27502
- "packages/server/dist/channels/wechat/descriptor.js"() {
27928
+ "../server/dist/channels/wechat/descriptor.js"() {
27503
27929
  "use strict";
27504
27930
  init_handler4();
27505
27931
  init_wechat();
@@ -27514,7 +27940,7 @@ var init_descriptor2 = __esm({
27514
27940
  }
27515
27941
  });
27516
27942
 
27517
- // packages/server/dist/routes/web.js
27943
+ // ../server/dist/routes/web.js
27518
27944
  import { Hono as Hono17 } from "hono";
27519
27945
  import { streamSSE } from "hono/streaming";
27520
27946
  import crypto4 from "node:crypto";
@@ -27751,7 +28177,7 @@ function createWebRoutes(deps) {
27751
28177
  return app2;
27752
28178
  }
27753
28179
  var init_web = __esm({
27754
- "packages/server/dist/routes/web.js"() {
28180
+ "../server/dist/routes/web.js"() {
27755
28181
  "use strict";
27756
28182
  init_dist();
27757
28183
  init_handler();
@@ -27763,10 +28189,10 @@ var init_web = __esm({
27763
28189
  }
27764
28190
  });
27765
28191
 
27766
- // packages/server/dist/channels/web/descriptor.js
28192
+ // ../server/dist/channels/web/descriptor.js
27767
28193
  var webDescriptor;
27768
28194
  var init_descriptor3 = __esm({
27769
- "packages/server/dist/channels/web/descriptor.js"() {
28195
+ "../server/dist/channels/web/descriptor.js"() {
27770
28196
  "use strict";
27771
28197
  init_handler();
27772
28198
  init_web();
@@ -27782,7 +28208,7 @@ var init_descriptor3 = __esm({
27782
28208
  }
27783
28209
  });
27784
28210
 
27785
- // packages/server/dist/channels/slack/accounts.js
28211
+ // ../server/dist/channels/slack/accounts.js
27786
28212
  function toSlack(a) {
27787
28213
  const c = a.config;
27788
28214
  return {
@@ -27858,14 +28284,14 @@ function deleteAccount5(db, accountId) {
27858
28284
  }
27859
28285
  var CH4;
27860
28286
  var init_accounts5 = __esm({
27861
- "packages/server/dist/channels/slack/accounts.js"() {
28287
+ "../server/dist/channels/slack/accounts.js"() {
27862
28288
  "use strict";
27863
28289
  init_accounts();
27864
28290
  CH4 = "slack";
27865
28291
  }
27866
28292
  });
27867
28293
 
27868
- // packages/server/dist/channels/shared/markdown.js
28294
+ // ../server/dist/channels/shared/markdown.js
27869
28295
  function formatForSlack(input) {
27870
28296
  if (!input)
27871
28297
  return "";
@@ -27944,15 +28370,15 @@ function stripCommonMark(line) {
27944
28370
  return line;
27945
28371
  }
27946
28372
  var init_markdown = __esm({
27947
- "packages/server/dist/channels/shared/markdown.js"() {
28373
+ "../server/dist/channels/shared/markdown.js"() {
27948
28374
  "use strict";
27949
28375
  }
27950
28376
  });
27951
28377
 
27952
- // packages/server/dist/channels/slack/event-adapter.js
28378
+ // ../server/dist/channels/slack/event-adapter.js
27953
28379
  var HARD_CHARS2, SlackResponder;
27954
28380
  var init_event_adapter3 = __esm({
27955
- "packages/server/dist/channels/slack/event-adapter.js"() {
28381
+ "../server/dist/channels/slack/event-adapter.js"() {
27956
28382
  "use strict";
27957
28383
  init_chunk();
27958
28384
  init_markdown();
@@ -28045,7 +28471,7 @@ var init_event_adapter3 = __esm({
28045
28471
  }
28046
28472
  });
28047
28473
 
28048
- // packages/server/dist/channels/slack/api.js
28474
+ // ../server/dist/channels/slack/api.js
28049
28475
  async function slackPost(endpoint, token, body) {
28050
28476
  const isForm = body instanceof FormData;
28051
28477
  const res = await fetch(`${SLACK_API}/${endpoint}`, {
@@ -28233,13 +28659,13 @@ async function downloadFile(botToken, urlPrivate) {
28233
28659
  }
28234
28660
  var SLACK_API;
28235
28661
  var init_api2 = __esm({
28236
- "packages/server/dist/channels/slack/api.js"() {
28662
+ "../server/dist/channels/slack/api.js"() {
28237
28663
  "use strict";
28238
28664
  SLACK_API = "https://slack.com/api";
28239
28665
  }
28240
28666
  });
28241
28667
 
28242
- // packages/server/dist/channels/slack/handler.js
28668
+ // ../server/dist/channels/slack/handler.js
28243
28669
  import path65 from "node:path";
28244
28670
  import { WebSocket } from "ws";
28245
28671
  function slashToBang(text6, commandNames) {
@@ -28347,7 +28773,7 @@ function startSlackChannel(deps) {
28347
28773
  return;
28348
28774
  const resolved = path65.resolve(filePath);
28349
28775
  if (!isMediaPathAllowed(resolved, account.workspacePath)) {
28350
- console.log(`[Slack] sendMedia blocked: ${filePath} not under workspace`);
28776
+ console.warn(`[Slack] sendMedia blocked: ${filePath} not under workspace`);
28351
28777
  return;
28352
28778
  }
28353
28779
  try {
@@ -28602,7 +29028,7 @@ function buildCmdCtx(args) {
28602
29028
  }
28603
29029
  var SLACK_EXTRA_COMMANDS, SEEN_EVENT_IDS, SEEN_EVENT_IDS_MAX;
28604
29030
  var init_handler5 = __esm({
28605
- "packages/server/dist/channels/slack/handler.js"() {
29031
+ "../server/dist/channels/slack/handler.js"() {
28606
29032
  "use strict";
28607
29033
  init_accounts5();
28608
29034
  init_event_adapter3();
@@ -28622,7 +29048,7 @@ var init_handler5 = __esm({
28622
29048
  }
28623
29049
  });
28624
29050
 
28625
- // packages/server/dist/routes/slack.js
29051
+ // ../server/dist/routes/slack.js
28626
29052
  import { Hono as Hono18 } from "hono";
28627
29053
  import fs58 from "node:fs";
28628
29054
  function createSlackRoutes(deps) {
@@ -28756,7 +29182,7 @@ function createSlackRoutes(deps) {
28756
29182
  return app2;
28757
29183
  }
28758
29184
  var init_slack = __esm({
28759
- "packages/server/dist/routes/slack.js"() {
29185
+ "../server/dist/routes/slack.js"() {
28760
29186
  "use strict";
28761
29187
  init_accounts5();
28762
29188
  init_accounts();
@@ -28764,7 +29190,7 @@ var init_slack = __esm({
28764
29190
  }
28765
29191
  });
28766
29192
 
28767
- // packages/server/dist/channels/slack/cron-dispatcher.js
29193
+ // ../server/dist/channels/slack/cron-dispatcher.js
28768
29194
  function parseChatId(raw) {
28769
29195
  const idx = raw.indexOf(":");
28770
29196
  if (idx < 0)
@@ -28828,7 +29254,7 @@ function registerSlackCronDispatcher() {
28828
29254
  registerCronDispatcher({ channelType: "slack", supportsMedia: true, dispatch: dispatch3, listTargets: listTargets3 });
28829
29255
  }
28830
29256
  var init_cron_dispatcher3 = __esm({
28831
- "packages/server/dist/channels/slack/cron-dispatcher.js"() {
29257
+ "../server/dist/channels/slack/cron-dispatcher.js"() {
28832
29258
  "use strict";
28833
29259
  init_channel_db();
28834
29260
  init_accounts5();
@@ -28838,10 +29264,10 @@ var init_cron_dispatcher3 = __esm({
28838
29264
  }
28839
29265
  });
28840
29266
 
28841
- // packages/server/dist/channels/slack/descriptor.js
29267
+ // ../server/dist/channels/slack/descriptor.js
28842
29268
  var slackDescriptor;
28843
29269
  var init_descriptor4 = __esm({
28844
- "packages/server/dist/channels/slack/descriptor.js"() {
29270
+ "../server/dist/channels/slack/descriptor.js"() {
28845
29271
  "use strict";
28846
29272
  init_handler5();
28847
29273
  init_slack();
@@ -28856,7 +29282,7 @@ var init_descriptor4 = __esm({
28856
29282
  }
28857
29283
  });
28858
29284
 
28859
- // packages/server/dist/channels/feishu/accounts.js
29285
+ // ../server/dist/channels/feishu/accounts.js
28860
29286
  function toFeishu(a) {
28861
29287
  const c = a.config;
28862
29288
  return {
@@ -28934,17 +29360,17 @@ function deleteAccount6(db, accountId) {
28934
29360
  }
28935
29361
  var CH5;
28936
29362
  var init_accounts6 = __esm({
28937
- "packages/server/dist/channels/feishu/accounts.js"() {
29363
+ "../server/dist/channels/feishu/accounts.js"() {
28938
29364
  "use strict";
28939
29365
  init_accounts();
28940
29366
  CH5 = "feishu";
28941
29367
  }
28942
29368
  });
28943
29369
 
28944
- // packages/server/dist/channels/feishu/event-adapter.js
29370
+ // ../server/dist/channels/feishu/event-adapter.js
28945
29371
  var HARD_CHARS3, FeishuResponder;
28946
29372
  var init_event_adapter4 = __esm({
28947
- "packages/server/dist/channels/feishu/event-adapter.js"() {
29373
+ "../server/dist/channels/feishu/event-adapter.js"() {
28948
29374
  "use strict";
28949
29375
  init_chunk();
28950
29376
  init_markdown();
@@ -29037,7 +29463,7 @@ var init_event_adapter4 = __esm({
29037
29463
  }
29038
29464
  });
29039
29465
 
29040
- // packages/server/dist/channels/feishu/api.js
29466
+ // ../server/dist/channels/feishu/api.js
29041
29467
  async function getTenantAccessToken(args) {
29042
29468
  const cached = tokenCache.get(args.appId);
29043
29469
  if (cached && cached.expiresAt - Date.now() > 6e4)
@@ -29301,14 +29727,14 @@ async function searchFeishuTargets(args) {
29301
29727
  }
29302
29728
  var FEISHU_BASE, tokenCache;
29303
29729
  var init_api3 = __esm({
29304
- "packages/server/dist/channels/feishu/api.js"() {
29730
+ "../server/dist/channels/feishu/api.js"() {
29305
29731
  "use strict";
29306
29732
  FEISHU_BASE = "https://open.feishu.cn";
29307
29733
  tokenCache = /* @__PURE__ */ new Map();
29308
29734
  }
29309
29735
  });
29310
29736
 
29311
- // packages/server/dist/channels/feishu/handler.js
29737
+ // ../server/dist/channels/feishu/handler.js
29312
29738
  import path66 from "node:path";
29313
29739
  import * as Lark from "@larksuiteoapi/node-sdk";
29314
29740
  function buildSessionPrefixForThread2(chatId, rootId) {
@@ -29493,7 +29919,7 @@ function startFeishuChannel(deps) {
29493
29919
  return;
29494
29920
  const resolved = path66.resolve(filePath);
29495
29921
  if (!isMediaPathAllowed(resolved, account.workspacePath)) {
29496
- console.log(`[Feishu] sendMedia blocked: ${filePath} not under workspace`);
29922
+ console.warn(`[Feishu] sendMedia blocked: ${filePath} not under workspace`);
29497
29923
  return;
29498
29924
  }
29499
29925
  try {
@@ -29781,7 +30207,7 @@ function buildCmdCtx2(args) {
29781
30207
  }
29782
30208
  var MAX_FEISHU_DOWNLOAD_BYTES;
29783
30209
  var init_handler6 = __esm({
29784
- "packages/server/dist/channels/feishu/handler.js"() {
30210
+ "../server/dist/channels/feishu/handler.js"() {
29785
30211
  "use strict";
29786
30212
  init_accounts6();
29787
30213
  init_event_adapter4();
@@ -29797,7 +30223,7 @@ var init_handler6 = __esm({
29797
30223
  }
29798
30224
  });
29799
30225
 
29800
- // packages/server/dist/routes/feishu.js
30226
+ // ../server/dist/routes/feishu.js
29801
30227
  import { Hono as Hono19 } from "hono";
29802
30228
  import fs59 from "node:fs";
29803
30229
  function createFeishuRoutes(deps) {
@@ -29934,7 +30360,7 @@ function createFeishuRoutes(deps) {
29934
30360
  return app2;
29935
30361
  }
29936
30362
  var init_feishu = __esm({
29937
- "packages/server/dist/routes/feishu.js"() {
30363
+ "../server/dist/routes/feishu.js"() {
29938
30364
  "use strict";
29939
30365
  init_accounts6();
29940
30366
  init_accounts();
@@ -29942,7 +30368,7 @@ var init_feishu = __esm({
29942
30368
  }
29943
30369
  });
29944
30370
 
29945
- // packages/server/dist/channels/feishu/cron-dispatcher.js
30371
+ // ../server/dist/channels/feishu/cron-dispatcher.js
29946
30372
  function parseChatId2(raw) {
29947
30373
  const idx = raw.indexOf(":");
29948
30374
  return { chatId: idx < 0 ? raw : raw.slice(0, idx) };
@@ -29992,7 +30418,7 @@ function registerFeishuCronDispatcher() {
29992
30418
  registerCronDispatcher({ channelType: "feishu", dispatch: dispatch4, listTargets: listTargets4 });
29993
30419
  }
29994
30420
  var init_cron_dispatcher4 = __esm({
29995
- "packages/server/dist/channels/feishu/cron-dispatcher.js"() {
30421
+ "../server/dist/channels/feishu/cron-dispatcher.js"() {
29996
30422
  "use strict";
29997
30423
  init_channel_db();
29998
30424
  init_accounts6();
@@ -30001,10 +30427,10 @@ var init_cron_dispatcher4 = __esm({
30001
30427
  }
30002
30428
  });
30003
30429
 
30004
- // packages/server/dist/channels/feishu/descriptor.js
30430
+ // ../server/dist/channels/feishu/descriptor.js
30005
30431
  var feishuDescriptor;
30006
30432
  var init_descriptor5 = __esm({
30007
- "packages/server/dist/channels/feishu/descriptor.js"() {
30433
+ "../server/dist/channels/feishu/descriptor.js"() {
30008
30434
  "use strict";
30009
30435
  init_handler6();
30010
30436
  init_feishu();
@@ -30019,7 +30445,7 @@ var init_descriptor5 = __esm({
30019
30445
  }
30020
30446
  });
30021
30447
 
30022
- // packages/server/dist/channels/wecom/accounts.js
30448
+ // ../server/dist/channels/wecom/accounts.js
30023
30449
  function toWecom(a) {
30024
30450
  const c = a.config;
30025
30451
  return {
@@ -30094,17 +30520,17 @@ function deleteAccount7(db, accountId) {
30094
30520
  }
30095
30521
  var CH6;
30096
30522
  var init_accounts7 = __esm({
30097
- "packages/server/dist/channels/wecom/accounts.js"() {
30523
+ "../server/dist/channels/wecom/accounts.js"() {
30098
30524
  "use strict";
30099
30525
  init_accounts();
30100
30526
  CH6 = "wecom";
30101
30527
  }
30102
30528
  });
30103
30529
 
30104
- // packages/server/dist/channels/wecom/event-adapter.js
30530
+ // ../server/dist/channels/wecom/event-adapter.js
30105
30531
  var HARD_CHARS4, WecomResponder;
30106
30532
  var init_event_adapter5 = __esm({
30107
- "packages/server/dist/channels/wecom/event-adapter.js"() {
30533
+ "../server/dist/channels/wecom/event-adapter.js"() {
30108
30534
  "use strict";
30109
30535
  init_chunk();
30110
30536
  init_media();
@@ -30195,7 +30621,7 @@ var init_event_adapter5 = __esm({
30195
30621
  }
30196
30622
  });
30197
30623
 
30198
- // packages/server/dist/channels/wecom/handler.js
30624
+ // ../server/dist/channels/wecom/handler.js
30199
30625
  import path67 from "node:path";
30200
30626
  import fs60 from "node:fs/promises";
30201
30627
  import { WSClient as WSClient2, generateReqId } from "@wecom/aibot-node-sdk";
@@ -30356,7 +30782,7 @@ function startWecomChannel(deps) {
30356
30782
  return;
30357
30783
  const resolved = path67.resolve(filePath);
30358
30784
  if (!isMediaPathAllowed(resolved, account.workspacePath)) {
30359
- console.log(`[WeCom] sendMedia blocked: ${filePath} not under workspace`);
30785
+ console.warn(`[WeCom] sendMedia blocked: ${filePath} not under workspace`);
30360
30786
  return;
30361
30787
  }
30362
30788
  try {
@@ -30564,7 +30990,7 @@ function buildCmdCtx3(args) {
30564
30990
  }
30565
30991
  var liveClients, DEDUPE_CAP, MAX_WECOM_DOWNLOAD_BYTES;
30566
30992
  var init_handler7 = __esm({
30567
- "packages/server/dist/channels/wecom/handler.js"() {
30993
+ "../server/dist/channels/wecom/handler.js"() {
30568
30994
  "use strict";
30569
30995
  init_accounts7();
30570
30996
  init_event_adapter5();
@@ -30580,7 +31006,7 @@ var init_handler7 = __esm({
30580
31006
  }
30581
31007
  });
30582
31008
 
30583
- // packages/server/dist/routes/wecom.js
31009
+ // ../server/dist/routes/wecom.js
30584
31010
  import { Hono as Hono20 } from "hono";
30585
31011
  import fs61 from "node:fs";
30586
31012
  function createWecomRoutes(deps) {
@@ -30687,14 +31113,14 @@ function createWecomRoutes(deps) {
30687
31113
  return app2;
30688
31114
  }
30689
31115
  var init_wecom = __esm({
30690
- "packages/server/dist/routes/wecom.js"() {
31116
+ "../server/dist/routes/wecom.js"() {
30691
31117
  "use strict";
30692
31118
  init_accounts7();
30693
31119
  init_accounts();
30694
31120
  }
30695
31121
  });
30696
31122
 
30697
- // packages/server/dist/channels/wecom/cron-dispatcher.js
31123
+ // ../server/dist/channels/wecom/cron-dispatcher.js
30698
31124
  async function dispatch5(accountId, text6, explicitChatId) {
30699
31125
  const acct = getAccount7(getChannelDb(), accountId);
30700
31126
  if (!acct)
@@ -30736,7 +31162,7 @@ function registerWecomCronDispatcher() {
30736
31162
  registerCronDispatcher({ channelType: "wecom", dispatch: dispatch5, listTargets: listTargets5 });
30737
31163
  }
30738
31164
  var init_cron_dispatcher5 = __esm({
30739
- "packages/server/dist/channels/wecom/cron-dispatcher.js"() {
31165
+ "../server/dist/channels/wecom/cron-dispatcher.js"() {
30740
31166
  "use strict";
30741
31167
  init_channel_db();
30742
31168
  init_accounts7();
@@ -30745,10 +31171,10 @@ var init_cron_dispatcher5 = __esm({
30745
31171
  }
30746
31172
  });
30747
31173
 
30748
- // packages/server/dist/channels/wecom/descriptor.js
31174
+ // ../server/dist/channels/wecom/descriptor.js
30749
31175
  var wecomDescriptor;
30750
31176
  var init_descriptor6 = __esm({
30751
- "packages/server/dist/channels/wecom/descriptor.js"() {
31177
+ "../server/dist/channels/wecom/descriptor.js"() {
30752
31178
  "use strict";
30753
31179
  init_handler7();
30754
31180
  init_wecom();
@@ -30763,10 +31189,10 @@ var init_descriptor6 = __esm({
30763
31189
  }
30764
31190
  });
30765
31191
 
30766
- // packages/server/dist/channels/descriptors.js
31192
+ // ../server/dist/channels/descriptors.js
30767
31193
  var defaultChannelDescriptors;
30768
31194
  var init_descriptors = __esm({
30769
- "packages/server/dist/channels/descriptors.js"() {
31195
+ "../server/dist/channels/descriptors.js"() {
30770
31196
  "use strict";
30771
31197
  init_descriptor();
30772
31198
  init_descriptor2();
@@ -30785,7 +31211,7 @@ var init_descriptors = __esm({
30785
31211
  }
30786
31212
  });
30787
31213
 
30788
- // packages/server/dist/middleware/auth.js
31214
+ // ../server/dist/middleware/auth.js
30789
31215
  import { Hono as Hono21 } from "hono";
30790
31216
  import { getCookie, setCookie } from "hono/cookie";
30791
31217
  import crypto5 from "node:crypto";
@@ -30978,7 +31404,7 @@ function authMiddleware() {
30978
31404
  }
30979
31405
  var TOKEN_MAX_AGE, REFRESH_AFTER, COOKIE_NAME, ADMIN_LOGIN_BUCKET, isLockedOut2, recordFailure2, clearFailures2, PUBLIC_PATHS;
30980
31406
  var init_auth = __esm({
30981
- "packages/server/dist/middleware/auth.js"() {
31407
+ "../server/dist/middleware/auth.js"() {
30982
31408
  "use strict";
30983
31409
  init_config();
30984
31410
  init_password_hash();
@@ -30995,7 +31421,7 @@ var init_auth = __esm({
30995
31421
  }
30996
31422
  });
30997
31423
 
30998
- // packages/server/dist/index.js
31424
+ // ../server/dist/index.js
30999
31425
  var dist_exports = {};
31000
31426
  import { Hono as Hono22 } from "hono";
31001
31427
  import { cors } from "hono/cors";
@@ -31124,7 +31550,7 @@ async function gracefulShutdown(signal) {
31124
31550
  }
31125
31551
  var __dirname3, PORT, HALO_VERSION, PROJECT_ROOT, HALO_HOME4, GIT_SHA, AGENTCORE, app, allowlist, authRoutes, fileRoutes, dataPreviewRoutes, gitRoutes, agentConfigRoutes, skillRoutes, settingsRoutes, evolutionRoutes, cronRoutes, channelDb, registry, sessionRoutes, sessionArchiveRoutes, showRoutes, metricsRoutes, commandRoutes, FRONTEND_DIR, server, wss;
31126
31552
  var init_dist2 = __esm({
31127
- async "packages/server/dist/index.js"() {
31553
+ async "../server/dist/index.js"() {
31128
31554
  "use strict";
31129
31555
  init_files();
31130
31556
  init_data_preview();
@@ -31166,7 +31592,7 @@ var init_dist2 = __esm({
31166
31592
  init_git_ssh();
31167
31593
  __dirname3 = path68.dirname(fileURLToPath3(import.meta.url));
31168
31594
  PORT = config.server.port;
31169
- HALO_VERSION = "1.3.4";
31595
+ HALO_VERSION = "1.4.0";
31170
31596
  PROJECT_ROOT = findProjectRoot();
31171
31597
  HALO_HOME4 = path68.join(homedir24(), ".halo");
31172
31598
  GIT_SHA = readGitSha();
@@ -31213,7 +31639,7 @@ var init_dist2 = __esm({
31213
31639
  const { hiddenDirs, hiddenFiles, writableDirs } = reloadSandboxConfig();
31214
31640
  setSandboxHiddenPaths(hiddenDirs, hiddenFiles, writableDirs);
31215
31641
  });
31216
- console.log(`[Server] bwrap sandbox: ${isBwrapCached() ? "available" : "NOT available (app-level fallback only)"}`);
31642
+ console.log(`[Server] OS sandbox: ${getSandboxBackend() ?? "NOT available (non-full sessions: no shell_exec, file tools path-checked in-process)"}`);
31217
31643
  ensureSshAgent();
31218
31644
  console.log(`[Server] Halo home: ${HALO_HOME4}`);
31219
31645
  console.log("[Server] Services initialized (ModelRuntime)");
@@ -31242,7 +31668,10 @@ var init_dist2 = __esm({
31242
31668
  uptime: process.uptime(),
31243
31669
  engine: "agent",
31244
31670
  version: HALO_VERSION,
31245
- gitSha: GIT_SHA
31671
+ gitSha: GIT_SHA,
31672
+ // OS sandbox backing non-full access levels; null → admin locks the
31673
+ // access-level selector to Full.
31674
+ sandbox: getSandboxBackend()
31246
31675
  });
31247
31676
  });
31248
31677
  fileRoutes = createFileRoutes();
@@ -31273,6 +31702,7 @@ var init_dist2 = __esm({
31273
31702
  }
31274
31703
  registry = new SessionManagerRegistry({ reconcileOrphansOnBoot: true });
31275
31704
  setRelayRegistry(registry);
31705
+ setCronSessionRegistry(registry);
31276
31706
  for (const ws of listRunningWorkspaces()) {
31277
31707
  if (!fs62.existsSync(path68.join(ws, ".halo")))
31278
31708
  continue;
@@ -31357,7 +31787,7 @@ var init_dist2 = __esm({
31357
31787
  }
31358
31788
  });
31359
31789
 
31360
- // packages/acp-adapter/dist/halo-client.js
31790
+ // ../acp-adapter/dist/halo-client.js
31361
31791
  async function safeText(res) {
31362
31792
  try {
31363
31793
  return (await res.text()).slice(0, 500);
@@ -31400,7 +31830,7 @@ async function* parseSseStream(body) {
31400
31830
  }
31401
31831
  var HaloClient;
31402
31832
  var init_halo_client = __esm({
31403
- "packages/acp-adapter/dist/halo-client.js"() {
31833
+ "../acp-adapter/dist/halo-client.js"() {
31404
31834
  "use strict";
31405
31835
  HaloClient = class {
31406
31836
  opts;
@@ -31500,7 +31930,7 @@ var init_halo_client = __esm({
31500
31930
  }
31501
31931
  });
31502
31932
 
31503
- // packages/acp-adapter/dist/adapter.js
31933
+ // ../acp-adapter/dist/adapter.js
31504
31934
  function newError(message, code = -32603) {
31505
31935
  const e = new Error(message);
31506
31936
  e.code = code;
@@ -31508,7 +31938,7 @@ function newError(message, code = -32603) {
31508
31938
  }
31509
31939
  var AcpAdapter;
31510
31940
  var init_adapter = __esm({
31511
- "packages/acp-adapter/dist/adapter.js"() {
31941
+ "../acp-adapter/dist/adapter.js"() {
31512
31942
  "use strict";
31513
31943
  init_halo_client();
31514
31944
  AcpAdapter = class {
@@ -31795,10 +32225,10 @@ var init_adapter = __esm({
31795
32225
  }
31796
32226
  });
31797
32227
 
31798
- // packages/acp-adapter/dist/jsonrpc.js
32228
+ // ../acp-adapter/dist/jsonrpc.js
31799
32229
  var ERROR_PARSE, ERROR_METHOD_NOT_FOUND, ERROR_INTERNAL, JsonRpcConnection;
31800
32230
  var init_jsonrpc = __esm({
31801
- "packages/acp-adapter/dist/jsonrpc.js"() {
32231
+ "../acp-adapter/dist/jsonrpc.js"() {
31802
32232
  "use strict";
31803
32233
  ERROR_PARSE = -32700;
31804
32234
  ERROR_METHOD_NOT_FOUND = -32601;
@@ -31931,7 +32361,7 @@ var init_jsonrpc = __esm({
31931
32361
  }
31932
32362
  });
31933
32363
 
31934
- // packages/acp-adapter/dist/index.js
32364
+ // ../acp-adapter/dist/index.js
31935
32365
  var dist_exports2 = {};
31936
32366
  __export(dist_exports2, {
31937
32367
  main: () => main
@@ -32047,7 +32477,7 @@ function main(argv = process.argv.slice(2)) {
32047
32477
  }
32048
32478
  var HELP;
32049
32479
  var init_dist3 = __esm({
32050
- "packages/acp-adapter/dist/index.js"() {
32480
+ "../acp-adapter/dist/index.js"() {
32051
32481
  "use strict";
32052
32482
  init_adapter();
32053
32483
  init_jsonrpc();
@@ -32086,7 +32516,7 @@ Stdio:
32086
32516
  }
32087
32517
  });
32088
32518
 
32089
- // packages/cli/src/silence-warnings.ts
32519
+ // src/silence-warnings.ts
32090
32520
  var emit = process.emitWarning.bind(process);
32091
32521
  process.emitWarning = (warning, ...args) => {
32092
32522
  const opt = args[0];
@@ -32095,13 +32525,13 @@ process.emitWarning = (warning, ...args) => {
32095
32525
  return emit(warning, ...args);
32096
32526
  };
32097
32527
 
32098
- // packages/cli/src/index.ts
32528
+ // src/index.ts
32099
32529
  init_server_supervisor();
32100
32530
  import path69 from "node:path";
32101
32531
  import fs63 from "node:fs";
32102
32532
  import { homedir as homedir25 } from "node:os";
32103
32533
  import { parseArgs as parseArgs2 } from "node:util";
32104
- var VERSION = "1.3.4";
32534
+ var VERSION = "1.4.0";
32105
32535
  var HELP_TOP = `Usage: halo <command> [options]
32106
32536
 
32107
32537
  Commands: