openfox 2.0.10 → 2.0.11

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.
@@ -8,8 +8,8 @@ import {
8
8
  } from "./chunk-TIKQWNYK.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-LIOHT26X.js";
12
- import "./chunk-KGZMKMEZ.js";
11
+ } from "./chunk-JUHZVYUI.js";
12
+ import "./chunk-M53OBFMI.js";
13
13
  import "./chunk-DL6ZILAF.js";
14
14
  import "./chunk-PBGOZMVY.js";
15
15
  import "./chunk-VRGRAQDG.js";
@@ -161,4 +161,4 @@ export {
161
161
  startChatSession,
162
162
  stopSessionExecution
163
163
  };
164
- //# sourceMappingURL=chat-handler-C33BNR7G.js.map
164
+ //# sourceMappingURL=chat-handler-VUVDRA2I.js.map
@@ -196,7 +196,7 @@ async function runCli(options) {
196
196
  if (!configExists) {
197
197
  await runNetworkSetup(mode);
198
198
  }
199
- const { runServe } = await import("./serve-VQE7ONYQ.js");
199
+ const { runServe } = await import("./serve-6AKAJZLV.js");
200
200
  const serveOptions = { mode };
201
201
  if (values.port) serveOptions.port = parseInt(values.port);
202
202
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -208,4 +208,4 @@ async function runCli(options) {
208
208
  export {
209
209
  runCli
210
210
  };
211
- //# sourceMappingURL=chunk-GVPBKD3I.js.map
211
+ //# sourceMappingURL=chunk-ABYYJBNO.js.map
@@ -3,7 +3,7 @@ import {
3
3
  injectWorkflowKickoffIfNeeded,
4
4
  runAgentTurn,
5
5
  runChatTurn
6
- } from "./chunk-LIOHT26X.js";
6
+ } from "./chunk-JUHZVYUI.js";
7
7
  import {
8
8
  COMPACTION_PROMPT,
9
9
  TurnMetrics,
@@ -58,7 +58,7 @@ import {
58
58
  skillExists,
59
59
  spawnShellProcess,
60
60
  streamLLMPure
61
- } from "./chunk-KGZMKMEZ.js";
61
+ } from "./chunk-M53OBFMI.js";
62
62
  import {
63
63
  getPathSeparator,
64
64
  getPlatformShell,
@@ -3283,7 +3283,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
3283
3283
  const compactEvents = compactEventStore.getEvents(sessionId);
3284
3284
  const compactMessages = buildMessagesFromStoredEvents(compactEvents);
3285
3285
  const pendingConfirmations = foldPendingConfirmations(compactEvents);
3286
- const { getPendingQuestionsForSession } = await import("./tools-SPZBVI7Y.js");
3286
+ const { getPendingQuestionsForSession } = await import("./tools-UT5WFO7R.js");
3287
3287
  const pendingQuestions = getPendingQuestionsForSession(sessionId);
3288
3288
  sendForSession(
3289
3289
  sessionId,
@@ -5818,7 +5818,7 @@ import { Router as Router6 } from "express";
5818
5818
  import { spawn as spawn5 } from "child_process";
5819
5819
 
5820
5820
  // src/constants.ts
5821
- var VERSION = "2.0.10";
5821
+ var VERSION = "2.0.11";
5822
5822
 
5823
5823
  // src/server/routes/auto-update.ts
5824
5824
  var updateInProgress = false;
@@ -6170,7 +6170,7 @@ async function createServerHandle(config4) {
6170
6170
  app.get("/api/sessions/:id", async (req, res) => {
6171
6171
  const { getEventStore: getEventStore2 } = await import("./events-4K52FKPR.js");
6172
6172
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-QIBNKYA6.js");
6173
- const { getPendingQuestionsForSession } = await import("./tools-SPZBVI7Y.js");
6173
+ const { getPendingQuestionsForSession } = await import("./tools-UT5WFO7R.js");
6174
6174
  const session = sessionManager.getSession(req.params.id);
6175
6175
  if (!session) {
6176
6176
  return res.status(404).json({ error: "Session not found" });
@@ -6301,7 +6301,7 @@ async function createServerHandle(config4) {
6301
6301
  if (!callId || approved === void 0) {
6302
6302
  return res.status(400).json({ error: "callId and approved are required" });
6303
6303
  }
6304
- const { providePathConfirmation } = await import("./tools-SPZBVI7Y.js");
6304
+ const { providePathConfirmation } = await import("./tools-UT5WFO7R.js");
6305
6305
  const result = providePathConfirmation(callId, approved, alwaysAllow);
6306
6306
  if (!result.found) {
6307
6307
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -6309,7 +6309,7 @@ async function createServerHandle(config4) {
6309
6309
  const { getEventStore: getEventStore2 } = await import("./events-4K52FKPR.js");
6310
6310
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-QIBNKYA6.js");
6311
6311
  const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-YYWMFR35.js");
6312
- const { getPendingQuestionsForSession } = await import("./tools-SPZBVI7Y.js");
6312
+ const { getPendingQuestionsForSession } = await import("./tools-UT5WFO7R.js");
6313
6313
  const eventStore = getEventStore2();
6314
6314
  const events = eventStore.getEvents(sessionId);
6315
6315
  const messages = buildMessagesFromStoredEvents2(events);
@@ -6330,7 +6330,7 @@ async function createServerHandle(config4) {
6330
6330
  if (!skip && typeof answer !== "string") {
6331
6331
  return res.status(400).json({ error: "answer is required when not skipping" });
6332
6332
  }
6333
- const { provideAnswer: provideAnswer2 } = await import("./tools-SPZBVI7Y.js");
6333
+ const { provideAnswer: provideAnswer2 } = await import("./tools-UT5WFO7R.js");
6334
6334
  const found = provideAnswer2(callId, answer ?? "", skip ?? false);
6335
6335
  if (!found) {
6336
6336
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -6366,8 +6366,8 @@ async function createServerHandle(config4) {
6366
6366
  if (!session) {
6367
6367
  return res.status(404).json({ error: "Session not found" });
6368
6368
  }
6369
- const { stopSessionExecution } = await import("./chat-handler-C33BNR7G.js");
6370
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-SPZBVI7Y.js");
6369
+ const { stopSessionExecution } = await import("./chat-handler-VUVDRA2I.js");
6370
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-UT5WFO7R.js");
6371
6371
  const queuedMessages = sessionManager.getQueueState(sessionId);
6372
6372
  sessionManager.clearMessageQueue(sessionId);
6373
6373
  stopSessionExecution(sessionId, sessionManager);
@@ -6978,7 +6978,7 @@ async function createServerHandle(config4) {
6978
6978
  providerManager
6979
6979
  );
6980
6980
  const wss = wssExports.wss;
6981
- const { QueueProcessor } = await import("./processor-6J4M2TLA.js");
6981
+ const { QueueProcessor } = await import("./processor-L3W54WNO.js");
6982
6982
  const queueProcessor = new QueueProcessor({
6983
6983
  sessionManager,
6984
6984
  providerManager,
@@ -7052,4 +7052,4 @@ export {
7052
7052
  createServerHandle,
7053
7053
  createServer
7054
7054
  };
7055
- //# sourceMappingURL=chunk-R5YHUBOM.js.map
7055
+ //# sourceMappingURL=chunk-GJLXA4BS.js.map
@@ -17,7 +17,7 @@ import {
17
17
  loadAllAgentsDefault,
18
18
  processEventsForConversation,
19
19
  runTopLevelAgentLoop
20
- } from "./chunk-KGZMKMEZ.js";
20
+ } from "./chunk-M53OBFMI.js";
21
21
  import {
22
22
  getCurrentContextWindowId,
23
23
  getCurrentWindowMessageOptions,
@@ -311,4 +311,4 @@ export {
311
311
  runAgentTurn,
312
312
  injectWorkflowKickoffIfNeeded
313
313
  };
314
- //# sourceMappingURL=chunk-LIOHT26X.js.map
314
+ //# sourceMappingURL=chunk-JUHZVYUI.js.map
@@ -1172,13 +1172,22 @@ function stripTailPipe(command) {
1172
1172
  }
1173
1173
 
1174
1174
  // src/server/tools/shell.ts
1175
+ function hasBackgroundAmpersand(command) {
1176
+ const trimmed = command.replace(/[;\s]+$/, "");
1177
+ if (trimmed.endsWith("&")) {
1178
+ const before = trimmed[trimmed.length - 2];
1179
+ if (before === "&" || before === "|") return false;
1180
+ return true;
1181
+ }
1182
+ return false;
1183
+ }
1175
1184
  var runCommandTool = createTool(
1176
1185
  "run_command",
1177
1186
  {
1178
1187
  type: "function",
1179
1188
  function: {
1180
1189
  name: "run_command",
1181
- description: "Execute a shell command. Returns stdout, stderr, and exit code.",
1190
+ description: 'Execute a shell command. Returns stdout, stderr, and exit code. Does NOT support trailing "&" for backgrounding \u2014 use background_process tool instead.',
1182
1191
  parameters: {
1183
1192
  type: "object",
1184
1193
  properties: {
@@ -1201,6 +1210,11 @@ var runCommandTool = createTool(
1201
1210
  },
1202
1211
  async (args, context, helpers) => {
1203
1212
  const timeout = args.timeout ?? 12e4;
1213
+ if (hasBackgroundAmpersand(args.command)) {
1214
+ return helpers.error(
1215
+ `Use background_process tool (action: "start") for background/long-running commands instead of '&'. See the tool description for details.`
1216
+ );
1217
+ }
1204
1218
  const workingDir = args.cwd ? helpers.resolvePath(args.cwd) : context.workdir;
1205
1219
  const pathsToCheck = [workingDir];
1206
1220
  const commandPaths = extractAbsolutePathsFromCommand(args.command);
@@ -3763,7 +3777,7 @@ var callSubAgentTool = {
3763
3777
  };
3764
3778
  }
3765
3779
  try {
3766
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-SPZBVI7Y.js");
3780
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-UT5WFO7R.js");
3767
3781
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3768
3782
  const turnMetrics = new TurnMetrics();
3769
3783
  const result = await executeSubAgent({
@@ -4583,6 +4597,9 @@ function validateToolAction(toolName, action, permissions) {
4583
4597
  }
4584
4598
  return void 0;
4585
4599
  }
4600
+ function extractSubAgentPrompt(args) {
4601
+ return args["prompt"] || args["query"] || args["task"] || "";
4602
+ }
4586
4603
  function createRegistryFromTools(tools, allowedTools, toolPermissions) {
4587
4604
  const toolMap = /* @__PURE__ */ new Map();
4588
4605
  const allowedToolsSet = new Set(allowedTools || []);
@@ -4595,6 +4612,22 @@ function createRegistryFromTools(tools, allowedTools, toolPermissions) {
4595
4612
  async execute(name, args, context) {
4596
4613
  const tool = toolMap.get(name);
4597
4614
  if (!tool) {
4615
+ if (toolMap.has("call_sub_agent")) {
4616
+ try {
4617
+ const agents = await loadAllAgentsDefault();
4618
+ const agentDef = findAgentById(name, agents);
4619
+ if (agentDef?.metadata.subagent) {
4620
+ const prompt = extractSubAgentPrompt(args);
4621
+ logger.warn("Sub-agent alias redirect", { from: name, to: "call_sub_agent", subAgentType: name });
4622
+ return callSubAgentTool.execute({ subAgentType: name, prompt }, context);
4623
+ }
4624
+ } catch (err) {
4625
+ logger.warn("Sub-agent alias resolution failed", {
4626
+ tool: name,
4627
+ error: err instanceof Error ? err.message : String(err)
4628
+ });
4629
+ }
4630
+ }
4598
4631
  return {
4599
4632
  success: false,
4600
4633
  error: `Unknown tool: ${name}. Available tools: ${tools.map((t) => t.name).join(", ")}`,
@@ -4813,4 +4846,4 @@ export {
4813
4846
  getToolRegistryForAgent,
4814
4847
  createToolRegistry
4815
4848
  };
4816
- //# sourceMappingURL=chunk-KGZMKMEZ.js.map
4849
+ //# sourceMappingURL=chunk-M53OBFMI.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-GVPBKD3I.js";
4
+ } from "../chunk-ABYYJBNO.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-GVPBKD3I.js";
4
+ } from "../chunk-ABYYJBNO.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-LIOHT26X.js";
5
+ } from "./chunk-JUHZVYUI.js";
6
6
  import {
7
7
  TurnMetrics,
8
8
  createChatDoneEvent,
@@ -10,7 +10,7 @@ import {
10
10
  createMessageStartEvent,
11
11
  createToolCallEvent,
12
12
  createToolResultEvent
13
- } from "./chunk-KGZMKMEZ.js";
13
+ } from "./chunk-M53OBFMI.js";
14
14
  import "./chunk-DL6ZILAF.js";
15
15
  import "./chunk-PBGOZMVY.js";
16
16
  import "./chunk-VRGRAQDG.js";
@@ -36,4 +36,4 @@ export {
36
36
  runAgentTurn,
37
37
  runChatTurn
38
38
  };
39
- //# sourceMappingURL=orchestrator-6WHZ53DB.js.map
39
+ //# sourceMappingURL=orchestrator-CKCECRNV.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -6,7 +6,7 @@ import {
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
8
  } from "./chunk-TIKQWNYK.js";
9
- import "./chunk-KGZMKMEZ.js";
9
+ import "./chunk-M53OBFMI.js";
10
10
  import "./chunk-DL6ZILAF.js";
11
11
  import "./chunk-PBGOZMVY.js";
12
12
  import "./chunk-VRGRAQDG.js";
@@ -190,7 +190,7 @@ var QueueProcessor = class {
190
190
  backend: provider?.backend ?? llmClient.getBackend(),
191
191
  model: llmClient.getModel()
192
192
  };
193
- const { runChatTurn } = await import("./orchestrator-6WHZ53DB.js");
193
+ const { runChatTurn } = await import("./orchestrator-CKCECRNV.js");
194
194
  const runChatTurnParams = buildRunChatTurnParams({
195
195
  sessionManager,
196
196
  sessionId,
@@ -238,4 +238,4 @@ var QueueProcessor = class {
238
238
  export {
239
239
  QueueProcessor
240
240
  };
241
- //# sourceMappingURL=processor-6J4M2TLA.js.map
241
+ //# sourceMappingURL=processor-L3W54WNO.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  VERSION,
3
3
  createServer
4
- } from "./chunk-R5YHUBOM.js";
4
+ } from "./chunk-GJLXA4BS.js";
5
5
  import "./chunk-NZCKCJH5.js";
6
- import "./chunk-LIOHT26X.js";
7
- import "./chunk-KGZMKMEZ.js";
6
+ import "./chunk-JUHZVYUI.js";
7
+ import "./chunk-M53OBFMI.js";
8
8
  import "./chunk-DL6ZILAF.js";
9
9
  import "./chunk-PBGOZMVY.js";
10
10
  import "./chunk-VRGRAQDG.js";
@@ -188,4 +188,4 @@ async function runServe(options) {
188
188
  export {
189
189
  runServe
190
190
  };
191
- //# sourceMappingURL=serve-VQE7ONYQ.js.map
191
+ //# sourceMappingURL=serve-6AKAJZLV.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-R5YHUBOM.js";
4
+ } from "../chunk-GJLXA4BS.js";
5
5
  import "../chunk-NZCKCJH5.js";
6
- import "../chunk-LIOHT26X.js";
7
- import "../chunk-KGZMKMEZ.js";
6
+ import "../chunk-JUHZVYUI.js";
7
+ import "../chunk-M53OBFMI.js";
8
8
  import "../chunk-DL6ZILAF.js";
9
9
  import "../chunk-PBGOZMVY.js";
10
10
  import "../chunk-VRGRAQDG.js";
@@ -11,7 +11,7 @@ import {
11
11
  requestPathAccess,
12
12
  stepDoneTool,
13
13
  validateToolAction
14
- } from "./chunk-KGZMKMEZ.js";
14
+ } from "./chunk-M53OBFMI.js";
15
15
  import "./chunk-DL6ZILAF.js";
16
16
  import "./chunk-PBGOZMVY.js";
17
17
  import "./chunk-VRGRAQDG.js";
@@ -49,4 +49,4 @@ export {
49
49
  stepDoneTool,
50
50
  validateToolAction
51
51
  };
52
- //# sourceMappingURL=tools-SPZBVI7Y.js.map
52
+ //# sourceMappingURL=tools-UT5WFO7R.js.map