openfox 2.0.129 → 2.0.130

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 (101) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -0
  3. package/dist/CHANGELOG.md +32 -0
  4. package/dist/auth-D3WLIBTG.js +19 -0
  5. package/dist/{auto-config-454YE6KC.js → auto-config-5VSNLVNI.js} +6 -5
  6. package/dist/{backend-4YPEC3J2.js → backend-NDBY3DAQ.js} +4 -2
  7. package/dist/{chat-handler-TH6JBO6G.js → chat-handler-4WCKNCQV.js} +32 -32
  8. package/dist/chunk-25DAVVTP.js +395 -0
  9. package/dist/{chunk-ISE55FOR.js → chunk-2AI7VYPN.js} +11 -1
  10. package/dist/{chunk-2COZT3YI.js → chunk-2OMXXCJJ.js} +24 -24
  11. package/dist/{chunk-OHTBWA7L.js → chunk-35GQEIH2.js} +13 -13
  12. package/dist/{chunk-N2Q3KYWM.js → chunk-3DZSHRXE.js} +7 -2
  13. package/dist/chunk-3OBZ55SX.js +7 -0
  14. package/dist/{chunk-ZIL6VKLU.js → chunk-64N4CZFT.js} +2 -2
  15. package/dist/{chunk-66MG44TF.js → chunk-6QZVAOSA.js} +2 -2
  16. package/dist/{chunk-6LX43YRA.js → chunk-7ET46SNE.js} +4 -4
  17. package/dist/{chunk-YJD5A375.js → chunk-AYCB32NI.js} +5 -5
  18. package/dist/{chunk-GIJUWPRQ.js → chunk-CGCEAKG5.js} +2 -2
  19. package/dist/{auth-GTGIGX5X.js → chunk-CQGJ5RWB.js} +4 -4
  20. package/dist/{chunk-JQMQ4DGC.js → chunk-CYQUM42E.js} +76 -32
  21. package/dist/{chunk-P6GTPKE5.js → chunk-DHDIKVRT.js} +278 -16
  22. package/dist/{chunk-ZXWJ6JTL.js → chunk-DI5GTIAU.js} +1154 -196
  23. package/dist/chunk-DQTN4B33.js +235 -0
  24. package/dist/{chunk-RV5G7QQU.js → chunk-DQTXXHD2.js} +3 -3
  25. package/dist/{chunk-MYNNMV75.js → chunk-DYIDDGMN.js} +54 -36
  26. package/dist/{chunk-DABWCAXS.js → chunk-EUOWCVU6.js} +19 -6
  27. package/dist/{chunk-7RIEI2TE.js → chunk-EVVWDRM5.js} +45 -16
  28. package/dist/{chunk-ATWOXI52.js → chunk-HCYSGLY2.js} +1 -1
  29. package/dist/{chunk-KBESUA3W.js → chunk-JHA2SPCU.js} +2 -2
  30. package/dist/{chunk-ZIYETXOW.js → chunk-JKRMMNUR.js} +4 -4
  31. package/dist/{chunk-H6YIVK67.js → chunk-JSONBGSY.js} +24 -4
  32. package/dist/{chunk-HO7A7TMF.js → chunk-KHKRHGA6.js} +15 -5
  33. package/dist/{chunk-K2QKX4ZJ.js → chunk-OA2FURC3.js} +8 -2
  34. package/dist/{chunk-ZFNBATE3.js → chunk-OXMOKQPW.js} +3 -2
  35. package/dist/{chunk-567L5OJ6.js → chunk-P57IBMK4.js} +2 -2
  36. package/dist/{session-status-6Q5B5PEN.js → chunk-T3S5MTMD.js} +2 -3
  37. package/dist/{chunk-7ZMOP5LS.js → chunk-TS5WKTFB.js} +18 -1
  38. package/dist/{chunk-PBFGJFGC.js → chunk-UV6IH6HK.js} +32 -10
  39. package/dist/{chunk-26WS7AH6.js → chunk-VJNA5AOB.js} +39 -7
  40. package/dist/{chunk-IJFKJ5D6.js → chunk-VUIXQ6X4.js} +4 -4
  41. package/dist/{chunk-L24A6GZ7.js → chunk-X24XN2M2.js} +84 -56
  42. package/dist/{chunk-AQBRI7TM.js → chunk-X3FHIDLT.js} +2 -2
  43. package/dist/chunk-YNMP647F.js +24 -0
  44. package/dist/{chunk-7YP4O4XE.js → chunk-ZRCRGPGT.js} +2 -2
  45. package/dist/cli/dev.js +1 -1
  46. package/dist/cli/index.js +1 -1
  47. package/dist/client-26RSMUAX.js +16 -0
  48. package/dist/{client-pure-GU2SV3DD.js → client-pure-FLKP6PTI.js} +2 -2
  49. package/dist/{compactor-WKFNTUXL.js → compactor-HYBSSFKP.js} +14 -14
  50. package/dist/dynamic-context-2VLACYK4.js +50 -0
  51. package/dist/{events-GMHRX4LF.js → events-D33QXGSX.js} +7 -7
  52. package/dist/{folding-7K2GRPF4.js → folding-QOKBKUU6.js} +5 -5
  53. package/dist/{http-client-ROVNSHF6.js → http-client-MGAJTGPR.js} +3 -3
  54. package/dist/launch-KFENN5GS.js +53 -0
  55. package/dist/{manager-NOKJQTTF.js → manager-VRHX7BVI.js} +4 -4
  56. package/dist/mcp-YU7AM3UV.js +120 -0
  57. package/dist/{model-catalog-ZLOWTQA7.js → model-catalog-2PCKTYGW.js} +2 -2
  58. package/dist/{oauth-provider-DGBC2YM6.js → oauth-provider-VHUS2KEG.js} +8 -2
  59. package/dist/{orchestrator-E6GIZGEN.js → orchestrator-PLTAEOMR.js} +30 -30
  60. package/dist/package.json +1 -1
  61. package/dist/{path-security-UDZ7UVWK.js → path-security-4WQJGU3Z.js} +11 -11
  62. package/dist/{platform-EMKWQTZX.js → platform-MWWJ6OKV.js} +3 -3
  63. package/dist/plugins-registry.json +12 -0
  64. package/dist/{processor-7RDR675X.js → processor-K4WHZKE6.js} +31 -31
  65. package/dist/{profiles-HXGJIPF2.js → profiles-EBCVFYG7.js} +2 -2
  66. package/dist/{protocol-DMneA8mx.d.ts → protocol-BMUoqwYH.d.ts} +2 -1
  67. package/dist/{protocol-TS3GVTT3.js → protocol-Y7MRKRUO.js} +3 -3
  68. package/dist/provider/index.d.ts +4 -4
  69. package/dist/{provider-DXEICEIE.js → provider-CVM33XHW.js} +10 -10
  70. package/dist/{provider-manager-PU7RS2TK.js → provider-manager-7NL5EQLG.js} +10 -10
  71. package/dist/{registry-Z4GVYFTV.js → registry-KFFZFIZT.js} +3 -3
  72. package/dist/{serve-Z5ITDPCQ.js → serve-KQAPXO5X.js} +42 -40
  73. package/dist/server/index.d.ts +18 -3
  74. package/dist/server/index.js +39 -37
  75. package/dist/server-RPKVKMDD.js +56 -0
  76. package/dist/{service-INQWTYY2.js → service-7TLOSFAO.js} +12 -12
  77. package/dist/{session-overrides-4WAD3X5Q.js → session-overrides-U573CU2V.js} +5 -5
  78. package/dist/session-status-UFO5IFI7.js +10 -0
  79. package/dist/{sessions-D7VRCHQY.js → sessions-LUVWWRFO.js} +4 -4
  80. package/dist/{settings-VOWWO4VG.js → settings-LMAMF2X7.js} +2 -2
  81. package/dist/shared/index.d.ts +3 -3
  82. package/dist/shared/index.js +1 -1
  83. package/dist/skill-defaults/browser/SKILL.md +20 -1
  84. package/dist/{tasks-SE3DOPVP.js → tasks-FA6Z52H2.js} +12 -12
  85. package/dist/{tools-6XUSIJN2.js → tools-SSPC3UQZ.js} +34 -34
  86. package/dist/{types-PAKlAzp9.d.ts → types-BIkpxjaj.d.ts} +11 -2
  87. package/dist/{types-BWuVnaBw.d.ts → types-CoY8Ka1C.d.ts} +1 -1
  88. package/dist/{update-EJUI6PSV.js → update-QRGK67DB.js} +2 -2
  89. package/dist/web/assets/{index-CGKd7WLQ.js → index-0PVQNOfW.js} +88 -88
  90. package/dist/web/assets/{index-CbX8veVW.css → index-Ds94aclE.css} +1 -1
  91. package/dist/web/index.html +2 -2
  92. package/dist/web/sw.js +1 -1
  93. package/package.json +1 -1
  94. package/plugins-registry.json +12 -0
  95. package/dist/chunk-HIRDDCPD.js +0 -7
  96. package/dist/chunk-PHP7PLFX.js +0 -151
  97. package/dist/chunk-RSB4AR2A.js +0 -108
  98. package/dist/client-RZGGDGUA.js +0 -16
  99. package/dist/dynamic-context-ZVE733UI.js +0 -28
  100. package/dist/launch-5ARSU7EM.js +0 -53
  101. package/dist/server-MUJ7EHEI.js +0 -56
@@ -1,6 +1,3 @@
1
- import {
2
- parseDefaultModelSelection
3
- } from "./chunk-JQMQ4DGC.js";
4
1
  import {
5
2
  deleteItemFromDir,
6
3
  getDefaultIds,
@@ -9,6 +6,9 @@ import {
9
6
  pathExists,
10
7
  saveItemToDir
11
8
  } from "./chunk-OSXPQSLW.js";
9
+ import {
10
+ parseDefaultModelSelection
11
+ } from "./chunk-CYQUM42E.js";
12
12
  import {
13
13
  getProject
14
14
  } from "./chunk-3B232XG4.js";
@@ -212,6 +212,25 @@ async function loadAllWorkflows(configDir, projectDir) {
212
212
  }
213
213
  return Array.from(workflowMap.values());
214
214
  }
215
+ async function listAvailableWorkflows(configDir, projectDir) {
216
+ const [defaultWorkflows, userWorkflows, projectWorkflows] = await Promise.all([
217
+ loadDefaultWorkflows(),
218
+ loadUserWorkflows(configDir),
219
+ projectDir ? loadProjectWorkflows(projectDir) : Promise.resolve([])
220
+ ]);
221
+ const projectIds = new Set(projectWorkflows.map((w) => w.metadata.id));
222
+ const userIds = new Set(userWorkflows.map((w) => w.metadata.id));
223
+ const effective = [...defaultWorkflows, ...userWorkflows, ...projectWorkflows];
224
+ const byId = new Map(effective.map((w) => [w.metadata.id, w]));
225
+ return Array.from(byId.values()).map((workflow) => ({
226
+ id: workflow.metadata.id,
227
+ name: workflow.metadata.name,
228
+ description: workflow.metadata.description,
229
+ ...workflow.metadata.color ? { color: workflow.metadata.color } : {},
230
+ scope: projectIds.has(workflow.metadata.id) ? "project" : userIds.has(workflow.metadata.id) ? "user" : "builtin",
231
+ ...workflow.metadata.parameters ? { parameters: workflow.metadata.parameters } : {}
232
+ }));
233
+ }
215
234
  async function saveWorkflowToProject(projectDir, workflow) {
216
235
  await saveItemToDir(getProjectWorkflowsDir(projectDir), workflow, WORKFLOW_EXTENSION, jsonSerializer);
217
236
  }
@@ -1085,6 +1104,7 @@ export {
1085
1104
  loadUserWorkflows,
1086
1105
  loadProjectWorkflows,
1087
1106
  loadAllWorkflows,
1107
+ listAvailableWorkflows,
1088
1108
  saveWorkflowToProject,
1089
1109
  deleteProjectWorkflow,
1090
1110
  getDefaultWorkflowIds,
@@ -1099,4 +1119,4 @@ export {
1099
1119
  isTaskGateError,
1100
1120
  createTasksService
1101
1121
  };
1102
- //# sourceMappingURL=chunk-H6YIVK67.js.map
1122
+ //# sourceMappingURL=chunk-JSONBGSY.js.map
@@ -25,6 +25,7 @@ Commands:
25
25
  provider remove Remove a provider
26
26
  service Manage the systemd service (install, start, stop, status, logs, uninstall)
27
27
  pwa Manage the PWA installation (install, uninstall, launch, update, status)
28
+ mcp Print a paste-ready MCP client config for this server (asks for the password if set)
28
29
  install Install a persistent OpenFox launcher (use --check to inspect)
29
30
  update Update OpenFox to the latest version
30
31
 
@@ -36,7 +37,7 @@ Options:
36
37
  `);
37
38
  }
38
39
  async function runNetworkSetup(mode) {
39
- const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-GTGIGX5X.js");
40
+ const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-D3WLIBTG.js");
40
41
  const { saveGlobalConfig } = await import("./config-LOK3LXFH.js");
41
42
  const { getAuthKeyPath } = await import("./paths-BHR7CZ7I.js");
42
43
  const existingAuth = await loadAuthConfig(mode);
@@ -131,6 +132,7 @@ async function runCli(options) {
131
132
  const { values, positionals } = parseArgs({
132
133
  options: {
133
134
  port: { type: "string", short: "p" },
135
+ password: { type: "string" },
134
136
  "no-browser": { type: "boolean" },
135
137
  help: { type: "boolean", short: "h" },
136
138
  version: { type: "boolean", short: "v" },
@@ -163,7 +165,7 @@ async function runCli(options) {
163
165
  break;
164
166
  }
165
167
  case "provider": {
166
- const { runProviderCommand } = await import("./provider-DXEICEIE.js");
168
+ const { runProviderCommand } = await import("./provider-CVM33XHW.js");
167
169
  const [, subcommand] = positionals;
168
170
  await runProviderCommand(mode, subcommand);
169
171
  break;
@@ -191,6 +193,14 @@ async function runCli(options) {
191
193
  }
192
194
  break;
193
195
  }
196
+ case "mcp": {
197
+ const { runMcpCommand } = await import("./mcp-YU7AM3UV.js");
198
+ const mcpOptions = {};
199
+ if (values.password) mcpOptions.password = values.password;
200
+ if (values.port) mcpOptions.port = parseInt(values.port);
201
+ await runMcpCommand(mode, mcpOptions);
202
+ break;
203
+ }
194
204
  case "install": {
195
205
  const { runInstall } = await import("./install-VA2F6X6Z.js");
196
206
  const code = await runInstall({ check: values.check === true });
@@ -200,7 +210,7 @@ async function runCli(options) {
200
210
  break;
201
211
  }
202
212
  case "update": {
203
- const { runUpdate } = await import("./update-EJUI6PSV.js");
213
+ const { runUpdate } = await import("./update-QRGK67DB.js");
204
214
  const code = await runUpdate();
205
215
  if (code !== 0) {
206
216
  process.exit(code);
@@ -213,7 +223,7 @@ async function runCli(options) {
213
223
  if (!configExists) {
214
224
  await runNetworkSetup(mode);
215
225
  }
216
- const { runServe } = await import("./serve-Z5ITDPCQ.js");
226
+ const { runServe } = await import("./serve-KQAPXO5X.js");
217
227
  const serveOptions = { mode };
218
228
  if (values.port) serveOptions.port = parseInt(values.port);
219
229
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -225,4 +235,4 @@ async function runCli(options) {
225
235
  export {
226
236
  runCli
227
237
  };
228
- //# sourceMappingURL=chunk-HO7A7TMF.js.map
238
+ //# sourceMappingURL=chunk-KHKRHGA6.js.map
@@ -24,8 +24,14 @@ function findLmStudioModel(raw, modelId) {
24
24
  return parseLmStudioModels(raw).find((model) => model.id === modelId);
25
25
  }
26
26
 
27
+ // src/server/providers/vision.ts
28
+ function hasVisionEvidence(modelInfo) {
29
+ return !!modelInfo["vision_start_token_id"] || Object.keys(modelInfo).some((k) => k.includes(".vision") || k.includes("vision_"));
30
+ }
31
+
27
32
  export {
28
33
  parseLmStudioModels,
29
- findLmStudioModel
34
+ findLmStudioModel,
35
+ hasVisionEvidence
30
36
  };
31
- //# sourceMappingURL=chunk-K2QKX4ZJ.js.map
37
+ //# sourceMappingURL=chunk-OA2FURC3.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-N2Q3KYWM.js";
4
+ } from "./chunk-3DZSHRXE.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-K44MW7JJ.js";
@@ -190,7 +190,8 @@ export {
190
190
  SessionNotFoundError,
191
191
  LLMError,
192
192
  WorkspaceInUseError,
193
+ DONE,
193
194
  ChatHttpClient,
194
195
  OpenAIHttpClient
195
196
  };
196
- //# sourceMappingURL=chunk-ZFNBATE3.js.map
197
+ //# sourceMappingURL=chunk-OXMOKQPW.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createServerMessage,
6
6
  isClientMessage
7
- } from "./chunk-ATWOXI52.js";
7
+ } from "./chunk-HCYSGLY2.js";
8
8
 
9
9
  // src/server/session/client-session.ts
10
10
  function toClientSession(session) {
@@ -378,4 +378,4 @@ export {
378
378
  createQueueStateMessage,
379
379
  storedEventToServerMessage
380
380
  };
381
- //# sourceMappingURL=chunk-567L5OJ6.js.map
381
+ //# sourceMappingURL=chunk-P57IBMK4.js.map
@@ -1,5 +1,3 @@
1
- import "./chunk-YLJ4XMA6.js";
2
-
3
1
  // src/server/routes/session-status.ts
4
2
  var SESSION_STATUS_SCHEMA_VERSION = 1;
5
3
  function projectSessionStatus(inputs) {
@@ -28,8 +26,9 @@ function projectSessionStatus(inputs) {
28
26
  }
29
27
  };
30
28
  }
29
+
31
30
  export {
32
31
  SESSION_STATUS_SCHEMA_VERSION,
33
32
  projectSessionStatus
34
33
  };
35
- //# sourceMappingURL=session-status-6Q5B5PEN.js.map
34
+ //# sourceMappingURL=chunk-T3S5MTMD.js.map
@@ -157,6 +157,23 @@ var MODEL_PROFILES = [
157
157
  supportsVision: false
158
158
  }
159
159
  },
160
+ {
161
+ pattern: "gpt-5",
162
+ profile: {
163
+ name: "GPT-5",
164
+ // OpenAI's gpt-5 family only accepts temperature = 1 (and top_p = 1);
165
+ // any other value is rejected with a 400.
166
+ temperature: 1,
167
+ topP: 1,
168
+ defaultMaxTokens: 16384,
169
+ supportsVision: true,
170
+ // gpt-5 is a Responses-API family: /v1/chat/completions rejects tools
171
+ // with any reasoning_effort other than "none", while /v1/responses
172
+ // supports tools + effort together. Route it there on the openai
173
+ // backend; on chat completions the request builder clamps the effort.
174
+ apiProtocol: "responses"
175
+ }
176
+ },
160
177
  {
161
178
  pattern: "gemma-4",
162
179
  profile: {
@@ -188,4 +205,4 @@ export {
188
205
  getModelProfile,
189
206
  modelSupportsVision
190
207
  };
191
- //# sourceMappingURL=chunk-7ZMOP5LS.js.map
208
+ //# sourceMappingURL=chunk-TS5WKTFB.js.map
@@ -4,60 +4,81 @@ var BACKEND_CAPABILITIES = {
4
4
  supportsChatTemplateKwargs: true,
5
5
  supportsTopK: true,
6
6
  supportsNumCtx: false,
7
- routesEffortViaChatTemplateKwargs: false
7
+ routesEffortViaChatTemplateKwargs: false,
8
+ usesMaxCompletionTokens: false
8
9
  },
9
10
  sglang: {
10
11
  supportsChatTemplateKwargs: true,
11
12
  supportsTopK: true,
12
13
  supportsNumCtx: false,
13
- routesEffortViaChatTemplateKwargs: false
14
+ routesEffortViaChatTemplateKwargs: false,
15
+ usesMaxCompletionTokens: false
14
16
  },
15
17
  openai: {
16
18
  supportsChatTemplateKwargs: false,
17
19
  supportsTopK: false,
18
20
  supportsNumCtx: false,
19
- routesEffortViaChatTemplateKwargs: false
21
+ routesEffortViaChatTemplateKwargs: false,
22
+ usesMaxCompletionTokens: true
20
23
  },
21
24
  anthropic: {
22
25
  supportsChatTemplateKwargs: false,
23
26
  supportsTopK: false,
24
27
  supportsNumCtx: false,
25
- routesEffortViaChatTemplateKwargs: false
28
+ routesEffortViaChatTemplateKwargs: false,
29
+ usesMaxCompletionTokens: false
26
30
  },
27
31
  ollama: {
28
32
  supportsChatTemplateKwargs: false,
29
33
  supportsTopK: false,
30
34
  supportsNumCtx: true,
31
- routesEffortViaChatTemplateKwargs: false
35
+ routesEffortViaChatTemplateKwargs: false,
36
+ usesMaxCompletionTokens: false
32
37
  },
33
38
  llamacpp: {
34
39
  supportsChatTemplateKwargs: false,
35
40
  supportsTopK: true,
36
41
  supportsNumCtx: false,
37
- routesEffortViaChatTemplateKwargs: true
42
+ routesEffortViaChatTemplateKwargs: true,
43
+ usesMaxCompletionTokens: false
38
44
  },
39
45
  lmstudio: {
40
46
  supportsChatTemplateKwargs: false,
41
47
  supportsTopK: true,
42
48
  supportsNumCtx: false,
43
- routesEffortViaChatTemplateKwargs: false
49
+ routesEffortViaChatTemplateKwargs: false,
50
+ usesMaxCompletionTokens: false
44
51
  },
45
52
  "opencode-go": {
46
53
  supportsChatTemplateKwargs: false,
47
54
  supportsTopK: true,
48
55
  supportsNumCtx: false,
49
- routesEffortViaChatTemplateKwargs: false
56
+ routesEffortViaChatTemplateKwargs: false,
57
+ usesMaxCompletionTokens: false
50
58
  },
51
59
  unknown: {
52
60
  supportsChatTemplateKwargs: true,
53
61
  supportsTopK: true,
54
62
  supportsNumCtx: false,
55
- routesEffortViaChatTemplateKwargs: false
63
+ routesEffortViaChatTemplateKwargs: false,
64
+ usesMaxCompletionTokens: false
56
65
  }
57
66
  };
58
67
  function getBackendCapabilities(backend) {
59
68
  return BACKEND_CAPABILITIES[backend];
60
69
  }
70
+ var HOST_BACKEND_MAP = {
71
+ "api.openai.com": "openai",
72
+ "api.anthropic.com": "anthropic"
73
+ };
74
+ function detectBackendFromUrl(url) {
75
+ try {
76
+ const host = new URL(url).hostname.toLowerCase();
77
+ return HOST_BACKEND_MAP[host];
78
+ } catch {
79
+ return void 0;
80
+ }
81
+ }
61
82
  function getBackendDisplayName(backend) {
62
83
  switch (backend) {
63
84
  case "vllm":
@@ -83,6 +104,7 @@ function getBackendDisplayName(backend) {
83
104
 
84
105
  export {
85
106
  getBackendCapabilities,
107
+ detectBackendFromUrl,
86
108
  getBackendDisplayName
87
109
  };
88
- //# sourceMappingURL=chunk-PBFGJFGC.js.map
110
+ //# sourceMappingURL=chunk-UV6IH6HK.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getEventStore
3
- } from "./chunk-YJD5A375.js";
3
+ } from "./chunk-AYCB32NI.js";
4
4
  import {
5
5
  createChatPathConfirmationMessage
6
- } from "./chunk-567L5OJ6.js";
6
+ } from "./chunk-P57IBMK4.js";
7
7
  import {
8
8
  getPlatformShell
9
- } from "./chunk-66MG44TF.js";
9
+ } from "./chunk-6QZVAOSA.js";
10
10
 
11
11
  // src/server/tools/path-security.ts
12
12
  import { realpath } from "fs/promises";
@@ -351,8 +351,39 @@ function resolveRelativeTraversals(command, workdir) {
351
351
  flush();
352
352
  return [...new Set(out)];
353
353
  }
354
+ function maskHeredocs(command) {
355
+ if (!command.includes("<<")) return command;
356
+ const lines = command.split("\n");
357
+ const starts = [];
358
+ for (let i = 0; i < lines.length; i++) {
359
+ const m = lines[i].match(/<<\s*(-?)(['"]?)([A-Za-z_][A-Za-z0-9_]*)\2/);
360
+ if (m) {
361
+ starts.push({ line: i, delimiter: m[3], stripTabs: m[1] === "-" });
362
+ }
363
+ }
364
+ const maskSpans = [];
365
+ let searchFrom = 0;
366
+ for (const start of starts) {
367
+ if (start.line < searchFrom) continue;
368
+ let end = -1;
369
+ for (let j = start.line + 1; j < lines.length; j++) {
370
+ const candidate = start.stripTabs ? lines[j].replace(/^\t+/, "") : lines[j];
371
+ if (candidate === start.delimiter) {
372
+ end = j;
373
+ break;
374
+ }
375
+ }
376
+ if (end !== -1) {
377
+ maskSpans.push([start.line + 1, end]);
378
+ searchFrom = end + 1;
379
+ }
380
+ }
381
+ if (maskSpans.length === 0) return command;
382
+ return lines.map((line, idx) => maskSpans.some(([s, e]) => idx >= s && idx < e) ? " ".repeat(line.length) : line).join("\n");
383
+ }
354
384
  function maskCommandForPathScan(command) {
355
- let sanitized = command.replace(/https?:\/\/[^\s'"]+/g, " __URL__ ").replace(/ftp:\/\/[^\s'"]+/g, " __URL__ ");
385
+ let sanitized = maskHeredocs(command);
386
+ sanitized = sanitized.replace(/https?:\/\/[^\s'"]+/g, " __URL__ ").replace(/ftp:\/\/[^\s'"]+/g, " __URL__ ");
356
387
  sanitized = sanitized.replace(/(?<!\w)s\/[^/]*\/[^/]*\/[gip]*/g, " __SED__ ");
357
388
  sanitized = sanitized.replace(/(?<!\w)s\|[^|]*\|[^|]*\|[gip]*/g, " __SED__ ");
358
389
  sanitized = sanitized.replace(/(?<!\w)s:[^:]*:[^:]*:[gip]*/g, " __SED__ ");
@@ -446,15 +477,16 @@ function extractSensitivePathsFromCommand(command) {
446
477
  return [];
447
478
  }
448
479
  const paths = [];
480
+ const scanCommand = maskHeredocs(command);
449
481
  const quotedPattern = /["']([^"']+)["']/g;
450
482
  let match;
451
- while ((match = quotedPattern.exec(command)) !== null) {
483
+ while ((match = quotedPattern.exec(scanCommand)) !== null) {
452
484
  const content = match[1];
453
485
  if (isSensitivePath(content)) {
454
486
  paths.push(content);
455
487
  }
456
488
  }
457
- const unquoted = command.replace(/["'][^"']*["']/g, " ").replace(/[|&;><]/g, " ");
489
+ const unquoted = scanCommand.replace(/["'][^"']*["']/g, " ").replace(/[|&;><]/g, " ");
458
490
  const tokens = unquoted.split(/\s+/).filter(Boolean);
459
491
  for (const token of tokens) {
460
492
  if (token.startsWith("-")) continue;
@@ -750,4 +782,4 @@ export {
750
782
  getConfirmationSessionId,
751
783
  getPendingConfirmationsBySession
752
784
  };
753
- //# sourceMappingURL=chunk-26WS7AH6.js.map
785
+ //# sourceMappingURL=chunk-VJNA5AOB.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createMessageStartEvent
3
- } from "./chunk-6LX43YRA.js";
3
+ } from "./chunk-7ET46SNE.js";
4
4
  import {
5
5
  COMPACTION_PROMPT
6
- } from "./chunk-GIJUWPRQ.js";
6
+ } from "./chunk-CGCEAKG5.js";
7
7
  import {
8
8
  getCurrentWindowMessageOptions
9
- } from "./chunk-YJD5A375.js";
9
+ } from "./chunk-AYCB32NI.js";
10
10
 
11
11
  // src/server/context/compactor.ts
12
12
  function appendCompactionPrompt(sessionId, append) {
@@ -36,4 +36,4 @@ export {
36
36
  COMPACTION_MAX_RATIO,
37
37
  shouldCompact
38
38
  };
39
- //# sourceMappingURL=chunk-IJFKJ5D6.js.map
39
+ //# sourceMappingURL=chunk-VUIXQ6X4.js.map