@runweave/server-linux-x64 0.1.9 → 0.1.10

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 (89) hide show
  1. package/manifest.json +163 -161
  2. package/native.tar.gz +0 -0
  3. package/package.json +1 -1
  4. package/payload/app-server/build-info.json +4 -4
  5. package/payload/app-server/index.cjs +6 -2
  6. package/payload/app-server/index.cjs.map +1 -1
  7. package/payload/backend/activity-sqlite-worker.cjs +2 -0
  8. package/payload/backend/build-info.json +4 -4
  9. package/payload/backend/dev-resources/control.cjs +5 -1
  10. package/payload/backend/index.cjs +432 -297
  11. package/payload/backend/scheduled-tasks-sqlite-worker.cjs +2 -0
  12. package/payload/frontend/dist/assets/{_baseUniq-qHFga5V8.js → _baseUniq--CWv8e7O.js} +1 -1
  13. package/payload/frontend/dist/assets/{access-DgHvmn15.js → access-BCF23Qto.js} +1 -1
  14. package/payload/frontend/dist/assets/{advanced-C1Fh14vw.js → advanced-D8viCLue.js} +1 -1
  15. package/payload/frontend/dist/assets/{appearance-Bs7cSXqO.js → appearance-wPVMx-tB.js} +1 -1
  16. package/payload/frontend/dist/assets/{arc-E3iYHQG_.js → arc-BXffHD7A.js} +1 -1
  17. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-DgpYpTb9.js → architectureDiagram-Q4EWVU46-BXHN9QCj.js} +1 -1
  18. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-CfFOEKZ7.js → blockDiagram-DXYQGD6D-DoZjab_0.js} +1 -1
  19. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-BxlHBUj3.js → c4Diagram-AHTNJAMY-Ds2E62Z8.js} +1 -1
  20. package/payload/frontend/dist/assets/channel-83CTXkVl.js +1 -0
  21. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-xWocgDo8.js → chunk-4BX2VUAB-Dk1H2-5_.js} +1 -1
  22. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Bl1cNICf.js → chunk-4TB4RGXK-Sg0gzSvg.js} +1 -1
  23. package/payload/frontend/dist/assets/{chunk-55IACEB6-DVtE836u.js → chunk-55IACEB6-Du_EJG4S.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-Dbd3tDCr.js → chunk-EDXVE4YY-BM1Cs5dU.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-MPJaTsyN.js → chunk-FMBD7UC4-BM9thfyY.js} +1 -1
  26. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-D3LuudlW.js → chunk-OYMX7WX6-C9Bvn4fo.js} +1 -1
  27. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-Dn1aF6iQ.js → chunk-QZHKN3VN-CaakbFhJ.js} +1 -1
  28. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-jZYbHnCw.js → chunk-YZCP3GAM-DkVNrd40.js} +1 -1
  29. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-oR8IYJwC.js +1 -0
  30. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-oR8IYJwC.js +1 -0
  31. package/payload/frontend/dist/assets/clone-BIDF-bd9.js +1 -0
  32. package/payload/frontend/dist/assets/{connection-V2iI-6rM.js → connection-DIdF_3aa.js} +1 -1
  33. package/payload/frontend/dist/assets/{connections-G_Q7342g.js → connections-DBYC8SFl.js} +1 -1
  34. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-75FLD3RS.js → cose-bilkent-S5V4N54A-B4-fwllY.js} +1 -1
  35. package/payload/frontend/dist/assets/{dagre-KV5264BT-DEm-DpJL.js → dagre-KV5264BT-Byu4wqLk.js} +1 -1
  36. package/payload/frontend/dist/assets/{desktop-g5JC-CQd.js → desktop-aESkh0HL.js} +1 -1
  37. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-BV6P2UTy.js → diagram-5BDNPKRD-DJW8DuCX.js} +1 -1
  38. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-DuCK-MM2.js → diagram-G4DWMVQ6-DTBvds5J.js} +1 -1
  39. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-D5_GlPgO.js → diagram-MMDJMWI5-D42e4xzm.js} +1 -1
  40. package/payload/frontend/dist/assets/{diagram-TYMM5635-QRbOYR1P.js → diagram-TYMM5635-BjV43-C_.js} +1 -1
  41. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-DefCheAw.js → erDiagram-SMLLAGMA-DE47Ibp_.js} +1 -1
  42. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-DVzyWIso.js → flowDiagram-DWJPFMVM-CjGBlzS4.js} +1 -1
  43. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-BJaClUEF.js → ganttDiagram-T4ZO3ILL-vfj40KZi.js} +1 -1
  44. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-BLfbApNz.js → gitGraphDiagram-UUTBAWPF-DT5xfRNb.js} +1 -1
  45. package/payload/frontend/dist/assets/{graph-C-YqFh68.js → graph-D-AF6yQT.js} +1 -1
  46. package/payload/frontend/dist/assets/{image-CZo_2Awc.js → image-D9gtSsD9.js} +1 -1
  47. package/payload/frontend/dist/assets/{index-6q2aeqkt.js → index-BPVP2P-2.js} +5 -5
  48. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-BakVOutT.js → infoDiagram-42DDH7IO-C7ew_uLJ.js} +1 -1
  49. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-D_1Oa5Dc.js → ishikawaDiagram-UXIWVN3A-B6-YebU9.js} +1 -1
  50. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-Y8TVFv6B.js → journeyDiagram-VCZTEJTY-BOFgJDA5.js} +1 -1
  51. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-DxeNhTIB.js → kanban-definition-6JOO6SKY-jh06wZYz.js} +1 -1
  52. package/payload/frontend/dist/assets/{layout-5cMeOTAp.js → layout-B4p7V5fB.js} +1 -1
  53. package/payload/frontend/dist/assets/{linear-Bnc3ev5g.js → linear-D2JWfvdc.js} +1 -1
  54. package/payload/frontend/dist/assets/{main-3TPtEl66.js → main-CuRgiPQf.js} +4 -4
  55. package/payload/frontend/dist/assets/{min-BRXKkrS8.js → min--jD4Arnm.js} +1 -1
  56. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-RYZO_BEr.js → mindmap-definition-QFDTVHPH-DmzjmSuf.js} +1 -1
  57. package/payload/frontend/dist/assets/{monitoring-Fv7kZ4s6.js → monitoring-Tvvk6TfB.js} +1 -1
  58. package/payload/frontend/dist/assets/{notifications-BzrYqyMH.js → notifications-CqP2AQrW.js} +1 -1
  59. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-Bzw0dhjz.js → pieDiagram-DEJITSTG-B79qIVe5.js} +1 -1
  60. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-CQJY_msa.js → quadrantDiagram-34T5L4WZ-DIOj1DhE.js} +1 -1
  61. package/payload/frontend/dist/assets/{record-content-B7-6olQt.js → record-content-CzGGCbNs.js} +1 -1
  62. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-DuP8hAV8.js → requirementDiagram-MS252O5E-C-n1j3tN.js} +1 -1
  63. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D-fQnCZZ.js → sankeyDiagram-XADWPNL6-BVKqWE6C.js} +1 -1
  64. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-DaZNEccV.js → sequenceDiagram-FGHM5R23-B980Icqs.js} +1 -1
  65. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-CkOLt5R1.js → stateDiagram-FHFEXIEX-C-mJHzhL.js} +1 -1
  66. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-B4L4fK9G.js +1 -0
  67. package/payload/frontend/dist/assets/{status-CIIPajZp.js → status-Bv4Czr9-.js} +1 -1
  68. package/payload/frontend/dist/assets/suiji-DyzQqRTE.js +1 -0
  69. package/payload/frontend/dist/assets/{svg-BUqAWGtg.js → svg-C6Aj62ig.js} +1 -1
  70. package/payload/frontend/dist/assets/{tabs-Cwlp1Meu.js → tabs-BTUOhdAF.js} +1 -1
  71. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-BOKDMwHS.js → timeline-definition-GMOUNBTQ-Dr9yRuVq.js} +1 -1
  72. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-fSZjDS41.js → vennDiagram-DHZGUBPP-B0Xsg1-Z.js} +1 -1
  73. package/payload/frontend/dist/assets/{wardley-RL74JXVD-D1KIsvoD.js → wardley-RL74JXVD-BjIKKaA_.js} +1 -1
  74. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-FMe67dwE.js → wardleyDiagram-NUSXRM2D-DMJ7MEA9.js} +1 -1
  75. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-B9AM9_9w.js → xychartDiagram-5P7HB3ND-2tvgfdab.js} +1 -1
  76. package/payload/frontend/dist/build-info.json +4 -4
  77. package/payload/frontend/dist/companion.html +1 -1
  78. package/payload/frontend/dist/index.html +2 -2
  79. package/payload/plugins/toolkit/.codex-plugin/plugin.json +1 -1
  80. package/payload/plugins/toolkit/skills/publish-runweave-server/SKILL.md +9 -4
  81. package/payload/plugins/toolkit-release.json +1 -1
  82. package/payload/pty-host/index.cjs +99 -31
  83. package/payload/server/index.cjs +5 -1
  84. package/payload/frontend/dist/assets/channel-amxyNKnk.js +0 -1
  85. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-B8cTijjT.js +0 -1
  86. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-B8cTijjT.js +0 -1
  87. package/payload/frontend/dist/assets/clone-xzI2eGRI.js +0 -1
  88. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-atg1K4nB.js +0 -1
  89. package/payload/frontend/dist/assets/suiji-C453W-Sg.js +0 -1
@@ -14763,6 +14763,8 @@ var CONFIGURATION_FIELDS = [
14763
14763
  { "path": "agents.companion.binary", "type": "string", "domain": "agents.companion", "sensitive": false, "remote": false, "apply": "restart", "description": "\u4F34\u968F\u7A97\u53E3 Agent \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"], "owner": "electron/companion", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u4F7F\u7528\u5DF2\u5B89\u88C5 Codex App \u81EA\u5E26\u6267\u884C\u5165\u53E3\uFF1B\u663E\u5F0F\u503C\u5FC5\u987B\u53EF\u6267\u884C\u3002" }, "migrationSources": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"] },
14764
14764
  { "path": "agents.codex.sessionsDirectory", "type": "string", "domain": "agents.codex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Codex \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_CODEX_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u5916\u90E8\u5DE5\u5177\u62E5\u6709\u7684 CODEX_HOME/sessions \u6216\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .codex/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_CODEX_SESSIONS_DIR"] },
14765
14765
  { "path": "agents.traex.sessionsDirectory", "type": "string", "domain": "agents.traex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Trae \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_TRAE_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .trae/cli/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_TRAE_SESSIONS_DIR"] },
14766
+ { "path": "terminal.defaultShell.command", "type": "string", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u5F53\u524D\u7535\u8111\u65B0\u7EC8\u7AEF\u7684\u9ED8\u8BA4\u53EF\u6267\u884C\u6587\u4EF6\uFF1B\u7F3A\u7701\u4F7F\u7528\u7CFB\u7EDF Shell\uFF0C\u542F\u52A8\u4E0D\u53EF\u7528\u65F6\u56DE\u9000\u7CFB\u7EDF\u9ED8\u8BA4", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u7CFB\u7EDF\u8D26\u6237\u767B\u5F55 Shell\uFF1BWindows \u4F7F\u7528 ComSpec\uFF1B\u4E0D\u53EF\u7528\u65F6\u91C7\u7528\u5E73\u53F0\u515C\u5E95" }, "migrationSources": ["new-field:no-legacy-source"] },
14767
+ { "path": "terminal.defaultShell.args", "type": "array<string>", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u9ED8\u8BA4 Shell \u7684\u542F\u52A8\u53C2\u6570\uFF1B\u7A7A\u6570\u7EC4\u660E\u786E\u4E0D\u52A0\u53C2\u6570\uFF0C\u7F3A\u7701\u4FDD\u7559 bash/zsh \u7684 -l \u884C\u4E3A", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u6839\u636E\u6240\u9009\u7A0B\u5E8F\u89E3\u6790\uFF1Bbash/zsh \u4E3A [-l]\uFF0C\u5176\u4ED6\u4E3A\u7A7A\u6570\u7EC4" }, "migrationSources": ["new-field:no-legacy-source"] },
14766
14768
  { "path": "terminal.tmux.enabled", "type": "boolean", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u6301\u4E45\u7EC8\u7AEF\u5F00\u5173", "environmentKeys": ["TERMINAL_TMUX_ENABLED"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": true }, "migrationSources": ["TERMINAL_TMUX_ENABLED"] },
14767
14769
  { "path": "terminal.tmux.binary", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["TMUX_BINARY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": "tmux" }, "migrationSources": ["TMUX_BINARY"] },
14768
14770
  { "path": "terminal.tmux.shutdownPolicy", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "\u9000\u51FA\u65F6 tmux \u4FDD\u7559\u7B56\u7565", "environmentKeys": ["TERMINAL_TMUX_SHUTDOWN_POLICY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "Stable \u4E3A preserve\uFF0CDev \u4E3A cleanup\u3002" }, "migrationSources": ["TERMINAL_TMUX_SHUTDOWN_POLICY"] },
@@ -19237,12 +19239,28 @@ var import_node_crypto6 = require("node:crypto");
19237
19239
  var import_node_module = require("node:module");
19238
19240
  var import_node_url = require("node:url");
19239
19241
 
19242
+ // packages/shared/src/terminal/shell.ts
19243
+ function terminalShellName(command) {
19244
+ return (command.split(/[\\/]/).at(-1) ?? command).toLowerCase().replace(/\.exe$/, "");
19245
+ }
19246
+ function isInteractiveShellLaunch(launch2) {
19247
+ const name = terminalShellName(launch2.command);
19248
+ if (!["sh", "bash", "zsh", "dash", "ksh", "fish", "powershell", "pwsh", "cmd"].includes(name)) return false;
19249
+ return !(launch2.args ?? []).some((arg) => {
19250
+ const value = arg.toLowerCase();
19251
+ if (name === "cmd") return !/^\/(?:d|q|a|u|e:(?:on|off)|f:(?:on|off)|v:(?:on|off))$/.test(value);
19252
+ if (name === "powershell" || name === "pwsh") return !["-nologo", "-noprofile", "-noexit", "-login", "-l"].includes(value);
19253
+ return ["--help", "--version"].includes(value) || !value.startsWith("-") || value === "--" || /^-[^-]*[cs]/.test(value) || /^--(?:command|init-command)(?:=|$)/.test(value);
19254
+ });
19255
+ }
19256
+
19240
19257
  // packages/pty-host/src/input-operations.ts
19241
19258
  var import_node_crypto4 = require("node:crypto");
19242
19259
  var InputOperations = class {
19243
- constructor(write, isRunning) {
19260
+ constructor(write, isRunning, generation = () => 0) {
19244
19261
  this.write = write;
19245
19262
  this.isRunning = isRunning;
19263
+ this.generation = generation;
19246
19264
  }
19247
19265
  operations = /* @__PURE__ */ new Map();
19248
19266
  sequences = /* @__PURE__ */ new Map();
@@ -19297,13 +19315,16 @@ var InputOperations = class {
19297
19315
  };
19298
19316
  this.operations.set(input.operationId, operation);
19299
19317
  this.sequences.set(input.sequence, input.operationId);
19318
+ const acceptedGeneration = this.generation();
19300
19319
  operation.done = this.tail.then(async () => {
19301
19320
  try {
19302
19321
  for (const step of input.steps) {
19322
+ if (acceptedGeneration !== this.generation()) throw new Error("HOST_PROCESS_CHANGED");
19303
19323
  if (!this.isRunning()) throw new Error("HOST_SESSION_GONE");
19304
19324
  if (step.type === "text") this.write(step.data);
19305
19325
  else await new Promise((resolve) => setTimeout(resolve, step.ms));
19306
19326
  }
19327
+ if (acceptedGeneration !== this.generation()) throw new Error("HOST_PROCESS_CHANGED");
19307
19328
  operation.result.state = "written";
19308
19329
  } catch (error) {
19309
19330
  operation.result.state = "failed";
@@ -19744,17 +19765,9 @@ var TerminalOutputScreen = class _TerminalOutputScreen {
19744
19765
  // packages/pty-host/src/sessions.ts
19745
19766
  var requireNative = (0, import_node_module.createRequire)((0, import_node_url.fileURLToPath)(__IMPORT_META_URL__));
19746
19767
  var HostSession = class {
19747
- info;
19748
- buffer = new TerminalOutputRecoveryBuffer();
19749
- screen;
19750
- inputs;
19751
- createDigest;
19752
- outputListeners = /* @__PURE__ */ new Set();
19753
- exitListeners = /* @__PURE__ */ new Set();
19754
- resizeListeners = /* @__PURE__ */ new Set();
19755
- degraded = false;
19756
- terminal;
19757
19768
  constructor(hostInstanceId, options, prepareEnv) {
19769
+ this.options = options;
19770
+ this.prepareEnv = prepareEnv;
19758
19771
  this.createDigest = (0, import_node_crypto6.createHash)("sha256").update(JSON.stringify(options)).digest("hex");
19759
19772
  this.info = {
19760
19773
  hostInstanceId,
@@ -19772,28 +19785,75 @@ var HostSession = class {
19772
19785
  this.degraded = true;
19773
19786
  });
19774
19787
  this.screen.resize(options.cols, options.rows);
19775
- const pty = requireNative("node-pty");
19788
+ this.inputs = new InputOperations((data) => this.terminal.write(data), () => this.info.status === "running", () => this.processGeneration);
19776
19789
  try {
19777
- this.terminal = pty.spawn(options.command, options.args, {
19778
- name: "xterm-256color",
19779
- cols: options.cols,
19780
- rows: options.rows,
19781
- cwd: options.cwd,
19782
- env: { ...options.env, ...prepareEnv(this.info.gatewayToken, this.info.terminalSessionId) }
19783
- });
19790
+ this.spawn(options);
19784
19791
  } catch (error) {
19785
- this.screen.dispose();
19786
- throw error;
19787
- }
19788
- this.inputs = new InputOperations((data) => this.terminal.write(data), () => this.info.status === "running");
19789
- this.terminal.onData((data) => {
19790
- this.info.pid = this.terminal.pid;
19791
- for (const frame of this.buffer.append(data)) {
19792
- if (!this.degraded) this.screen.append(frame);
19793
- for (const listener of this.outputListeners) listener(frame);
19792
+ try {
19793
+ if (!this.activateFallback(String(error))) throw error;
19794
+ } catch (fallbackError) {
19795
+ this.screen.dispose();
19796
+ throw fallbackError;
19794
19797
  }
19798
+ }
19799
+ }
19800
+ info;
19801
+ buffer = new TerminalOutputRecoveryBuffer();
19802
+ screen;
19803
+ inputs;
19804
+ createDigest;
19805
+ outputListeners = /* @__PURE__ */ new Set();
19806
+ exitListeners = /* @__PURE__ */ new Set();
19807
+ resizeListeners = /* @__PURE__ */ new Set();
19808
+ launchListeners = /* @__PURE__ */ new Set();
19809
+ degraded = false;
19810
+ terminal;
19811
+ fallbackActivated = false;
19812
+ closing = false;
19813
+ processGeneration = 0;
19814
+ startupDeadline = 0;
19815
+ emitOutput(data) {
19816
+ for (const frame of this.buffer.append(data)) {
19817
+ if (!this.degraded) this.screen.append(frame);
19818
+ for (const listener of this.outputListeners) listener(frame);
19819
+ }
19820
+ }
19821
+ activateFallback(reason) {
19822
+ if (!this.options.fallback || this.fallbackActivated || this.closing || !isInteractiveShellLaunch(this.options)) return false;
19823
+ this.fallbackActivated = true;
19824
+ this.emitOutput("[Runweave: shell failed to start; using system default: " + this.options.fallback.command + "]\r\n");
19825
+ this.spawn(this.options.fallback, reason);
19826
+ return true;
19827
+ }
19828
+ spawn(launch2, fallbackReason) {
19829
+ const pty = requireNative("node-pty");
19830
+ const started = Date.now();
19831
+ const terminal = pty.spawn(launch2.command, launch2.args, {
19832
+ name: "xterm-256color",
19833
+ cols: this.info.cols,
19834
+ rows: this.info.rows,
19835
+ cwd: this.options.cwd,
19836
+ env: { ...launch2.env, ...this.prepareEnv(this.info.gatewayToken, this.info.terminalSessionId) }
19795
19837
  });
19796
- this.terminal.onExit((event) => {
19838
+ this.startupDeadline = this.options.fallback && isInteractiveShellLaunch(this.options) ? Date.now() + 1e3 : 0;
19839
+ this.processGeneration++;
19840
+ this.terminal = terminal;
19841
+ this.info.pid = terminal.pid;
19842
+ this.info.launch = { command: launch2.command, args: [...launch2.args], ...fallbackReason ? { fallbackReason } : {} };
19843
+ for (const listener of this.launchListeners) listener(this.info.launch);
19844
+ terminal.onData((data) => {
19845
+ if (this.terminal === terminal) this.emitOutput(data);
19846
+ });
19847
+ terminal.onExit((event) => {
19848
+ if (this.terminal !== terminal) return;
19849
+ if (event.exitCode > 0 && Date.now() - started < 1e3) {
19850
+ try {
19851
+ if (this.activateFallback(`Shell exited with code ${event.exitCode}`)) return;
19852
+ } catch (error) {
19853
+ this.emitOutput(`[Runweave: system shell failed to start: ${String(error)}]\r
19854
+ `);
19855
+ }
19856
+ }
19797
19857
  this.info.status = "exited";
19798
19858
  this.info.exitCode = event.exitCode;
19799
19859
  for (const listener of this.exitListeners) listener(event.exitCode);
@@ -19801,7 +19861,7 @@ var HostSession = class {
19801
19861
  }
19802
19862
  async ready() {
19803
19863
  const deadline = Date.now() + 1e4;
19804
- while (this.terminal.pid < 1 && this.info.status === "running" && Date.now() < deadline)
19864
+ while ((this.terminal.pid < 1 || Date.now() < this.startupDeadline) && this.info.status === "running" && Date.now() < deadline)
19805
19865
  await new Promise((resolve) => setTimeout(resolve, 20));
19806
19866
  this.info.pid = this.terminal.pid;
19807
19867
  if (this.info.pid < 1) {
@@ -19828,6 +19888,7 @@ var HostSession = class {
19828
19888
  }
19829
19889
  signal(signal) {
19830
19890
  if (!["SIGINT", "SIGTERM", "SIGKILL"].includes(signal)) throw new Error("HOST_SIGNAL_INVALID");
19891
+ this.closing = true;
19831
19892
  if (process.platform === "win32") {
19832
19893
  if (signal === "SIGINT") this.terminal.write("");
19833
19894
  else this.close();
@@ -19835,6 +19896,7 @@ var HostSession = class {
19835
19896
  }
19836
19897
  close() {
19837
19898
  if (this.info.status !== "running") return;
19899
+ this.closing = true;
19838
19900
  this.terminal.kill();
19839
19901
  }
19840
19902
  snapshot() {
@@ -19891,7 +19953,8 @@ var createSchema = external_exports.object({
19891
19953
  cwd: external_exports.string().min(1),
19892
19954
  cols: external_exports.number().int().min(2).max(500),
19893
19955
  rows: external_exports.number().int().min(1).max(200),
19894
- env: external_exports.record(external_exports.string().optional())
19956
+ env: external_exports.record(external_exports.string().optional()),
19957
+ fallback: external_exports.object({ command: external_exports.string().min(1).max(32768), args: external_exports.array(external_exports.string()).max(256), env: external_exports.record(external_exports.string().optional()) }).optional()
19895
19958
  });
19896
19959
  var wireSchema = external_exports.object({ requestId: external_exports.string().uuid(), token: external_exports.string(), hostInstanceId: external_exports.string().uuid(), action: external_exports.string(), body: external_exports.unknown() });
19897
19960
  async function startHost(scope, release) {
@@ -20061,10 +20124,15 @@ async function startHost(scope, release) {
20061
20124
  const resized = (cols, rows) => {
20062
20125
  if (ready) sendJson(socket, { type: "resize", terminalSessionId: session.info.terminalSessionId, cols, rows, cursor: session.buffer.cursor });
20063
20126
  };
20127
+ const launched = (launch2) => {
20128
+ if (ready) sendJson(socket, { type: "launch", terminalSessionId: session.info.terminalSessionId, launch: launch2 });
20129
+ };
20130
+ session.launchListeners.add(launched);
20064
20131
  session.outputListeners.add(output);
20065
20132
  session.exitListeners.add(exited);
20066
20133
  session.resizeListeners.add(resized);
20067
20134
  subscriptions.set(session.info.terminalSessionId, () => {
20135
+ session.launchListeners.delete(launched);
20068
20136
  session.outputListeners.delete(output);
20069
20137
  session.exitListeners.delete(exited);
20070
20138
  session.resizeListeners.delete(resized);
@@ -7636,6 +7636,8 @@ var CONFIGURATION_FIELDS = [
7636
7636
  { "path": "agents.companion.binary", "type": "string", "domain": "agents.companion", "sensitive": false, "remote": false, "apply": "restart", "description": "\u4F34\u968F\u7A97\u53E3 Agent \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"], "owner": "electron/companion", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u4F7F\u7528\u5DF2\u5B89\u88C5 Codex App \u81EA\u5E26\u6267\u884C\u5165\u53E3\uFF1B\u663E\u5F0F\u503C\u5FC5\u987B\u53EF\u6267\u884C\u3002" }, "migrationSources": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"] },
7637
7637
  { "path": "agents.codex.sessionsDirectory", "type": "string", "domain": "agents.codex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Codex \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_CODEX_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u5916\u90E8\u5DE5\u5177\u62E5\u6709\u7684 CODEX_HOME/sessions \u6216\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .codex/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_CODEX_SESSIONS_DIR"] },
7638
7638
  { "path": "agents.traex.sessionsDirectory", "type": "string", "domain": "agents.traex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Trae \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_TRAE_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .trae/cli/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_TRAE_SESSIONS_DIR"] },
7639
+ { "path": "terminal.defaultShell.command", "type": "string", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u5F53\u524D\u7535\u8111\u65B0\u7EC8\u7AEF\u7684\u9ED8\u8BA4\u53EF\u6267\u884C\u6587\u4EF6\uFF1B\u7F3A\u7701\u4F7F\u7528\u7CFB\u7EDF Shell\uFF0C\u542F\u52A8\u4E0D\u53EF\u7528\u65F6\u56DE\u9000\u7CFB\u7EDF\u9ED8\u8BA4", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u7CFB\u7EDF\u8D26\u6237\u767B\u5F55 Shell\uFF1BWindows \u4F7F\u7528 ComSpec\uFF1B\u4E0D\u53EF\u7528\u65F6\u91C7\u7528\u5E73\u53F0\u515C\u5E95" }, "migrationSources": ["new-field:no-legacy-source"] },
7640
+ { "path": "terminal.defaultShell.args", "type": "array<string>", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u9ED8\u8BA4 Shell \u7684\u542F\u52A8\u53C2\u6570\uFF1B\u7A7A\u6570\u7EC4\u660E\u786E\u4E0D\u52A0\u53C2\u6570\uFF0C\u7F3A\u7701\u4FDD\u7559 bash/zsh \u7684 -l \u884C\u4E3A", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u6839\u636E\u6240\u9009\u7A0B\u5E8F\u89E3\u6790\uFF1Bbash/zsh \u4E3A [-l]\uFF0C\u5176\u4ED6\u4E3A\u7A7A\u6570\u7EC4" }, "migrationSources": ["new-field:no-legacy-source"] },
7639
7641
  { "path": "terminal.tmux.enabled", "type": "boolean", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u6301\u4E45\u7EC8\u7AEF\u5F00\u5173", "environmentKeys": ["TERMINAL_TMUX_ENABLED"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": true }, "migrationSources": ["TERMINAL_TMUX_ENABLED"] },
7640
7642
  { "path": "terminal.tmux.binary", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["TMUX_BINARY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": "tmux" }, "migrationSources": ["TMUX_BINARY"] },
7641
7643
  { "path": "terminal.tmux.shutdownPolicy", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "\u9000\u51FA\u65F6 tmux \u4FDD\u7559\u7B56\u7565", "environmentKeys": ["TERMINAL_TMUX_SHUTDOWN_POLICY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "Stable \u4E3A preserve\uFF0CDev \u4E3A cleanup\u3002" }, "migrationSources": ["TERMINAL_TMUX_SHUTDOWN_POLICY"] },
@@ -7958,7 +7960,9 @@ function validateDomains(value, context) {
7958
7960
  issue(key, "CONFIG_FIELD_TYPE_INVALID");
7959
7961
  continue;
7960
7962
  }
7961
- if (key === "backend.taskSupervision.model" && typeof entry === "string" && !entry.trim()) issue(key, "CONFIG_FIELD_VALUE_INVALID");
7963
+ if (["backend.taskSupervision.model", "terminal.defaultShell.command"].includes(key) && typeof entry === "string" && !entry.trim()) issue(key, "CONFIG_FIELD_VALUE_INVALID");
7964
+ if (key === "terminal.defaultShell.command" && typeof entry === "string" && /[\\/]/.test(entry) && !import_node_path3.default.isAbsolute(entry.trim())) issue(key, "CONFIG_FIELD_VALUE_INVALID");
7965
+ if (key.startsWith("terminal.defaultShell.") && (typeof entry === "string" ? entry.includes("\0") : Array.isArray(entry) && entry.some((item) => typeof item === "string" && item.includes("\0")))) issue(key, "CONFIG_FIELD_VALUE_INVALID");
7962
7966
  if (CONFIGURATION_ENUMS[key] && !CONFIGURATION_ENUMS[key].includes(String(entry))) issue(key, "CONFIG_FIELD_ENUM_INVALID");
7963
7967
  if (configurationServiceOrigin(key) && typeof entry === "string") {
7964
7968
  try {
@@ -1 +0,0 @@
1
- import{U as a,M as n}from"./index-6q2aeqkt.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-Bl1cNICf.js";import{_ as i}from"./index-6q2aeqkt.js";import"./chunk-FMBD7UC4-MPJaTsyN.js";import"./chunk-YZCP3GAM-jZYbHnCw.js";import"./chunk-55IACEB6-DVtE836u.js";import"./chunk-EDXVE4YY-Dbd3tDCr.js";import"./main-3TPtEl66.js";import"./index-D9-cSGu-.js";import"./record-content-B7-6olQt.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-Bl1cNICf.js";import{_ as i}from"./index-6q2aeqkt.js";import"./chunk-FMBD7UC4-MPJaTsyN.js";import"./chunk-YZCP3GAM-jZYbHnCw.js";import"./chunk-55IACEB6-DVtE836u.js";import"./chunk-EDXVE4YY-Dbd3tDCr.js";import"./main-3TPtEl66.js";import"./index-D9-cSGu-.js";import"./record-content-B7-6olQt.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./graph-C-YqFh68.js";var e=4;function a(o){return r(o,e)}export{a as c};
@@ -1 +0,0 @@
1
- import{s as r,b as e,a,S as s}from"./chunk-OYMX7WX6-D3LuudlW.js";import{_ as i}from"./index-6q2aeqkt.js";import"./chunk-55IACEB6-DVtE836u.js";import"./chunk-EDXVE4YY-Dbd3tDCr.js";import"./index-D9-cSGu-.js";import"./main-3TPtEl66.js";import"./record-content-B7-6olQt.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-D9-cSGu-.js";import o from"./connection-V2iI-6rM.js";import"./main-3TPtEl66.js";import"./record-content-B7-6olQt.js";function n(){return t.jsx(o,{accountOnly:!0})}export{n as default};