openfox 1.6.46 → 1.6.48

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.
@@ -2,7 +2,7 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-MY66TLAH.js";
5
+ } from "./chunk-SGOTQ7R3.js";
6
6
  import "./chunk-NBU6KIOD.js";
7
7
  import "./chunk-574HZVLE.js";
8
8
  import "./chunk-7JPKRM6M.js";
@@ -23,4 +23,4 @@ export {
23
23
  performManualContextCompaction,
24
24
  resolveCompactionStatsIdentity
25
25
  };
26
- //# sourceMappingURL=auto-compaction-GI4VMKB2.js.map
26
+ //# sourceMappingURL=auto-compaction-7RDQVOYK.js.map
@@ -10,8 +10,8 @@ import {
10
10
  } from "./chunk-BHSTSA7U.js";
11
11
  import {
12
12
  runChatTurn
13
- } from "./chunk-W62DI5UK.js";
14
- import "./chunk-MY66TLAH.js";
13
+ } from "./chunk-22JBSK6P.js";
14
+ import "./chunk-SGOTQ7R3.js";
15
15
  import "./chunk-NBU6KIOD.js";
16
16
  import "./chunk-574HZVLE.js";
17
17
  import "./chunk-7JPKRM6M.js";
@@ -62,7 +62,7 @@ async function startChatSession(sessionId, content, deps, options) {
62
62
  sessionManager.setRunning(sessionId, true);
63
63
  broadcastForSession(sessionId, createSessionRunningMessage(true));
64
64
  try {
65
- const { maybeAutoCompactContext } = await import("./auto-compaction-GI4VMKB2.js");
65
+ const { maybeAutoCompactContext } = await import("./auto-compaction-7RDQVOYK.js");
66
66
  await maybeAutoCompactContext({
67
67
  sessionManager,
68
68
  sessionId,
@@ -171,4 +171,4 @@ export {
171
171
  startChatSession,
172
172
  stopSessionExecution
173
173
  };
174
- //# sourceMappingURL=chat-handler-UYAJHFNJ.js.map
174
+ //# sourceMappingURL=chat-handler-TTCW7DIB.js.map
@@ -13,7 +13,7 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-MY66TLAH.js";
16
+ } from "./chunk-SGOTQ7R3.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
@@ -179,7 +179,7 @@ async function runGenericAgentTurn(options, turnMetrics, agentId) {
179
179
  statsIdentity,
180
180
  signal: options.signal,
181
181
  onMessage: options.onMessage,
182
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs }),
182
+ assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
183
183
  getToolRegistry: () => getToolRegistryForAgent(agentDef)
184
184
  }, turnMetrics);
185
185
  }
@@ -204,7 +204,7 @@ async function runBuilderTurn(options, turnMetrics) {
204
204
  statsIdentity,
205
205
  signal: options.signal,
206
206
  onMessage: options.onMessage,
207
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef: builderDef, subAgentDefs }),
207
+ assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef: builderDef, subAgentDefs, modelName: options.llmClient.getModel() }),
208
208
  getToolRegistry: () => {
209
209
  const baseRegistry = getToolRegistryForAgent(builderDef);
210
210
  return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
@@ -293,4 +293,4 @@ export {
293
293
  runBuilderTurn,
294
294
  runVerifierTurn
295
295
  };
296
- //# sourceMappingURL=chunk-W62DI5UK.js.map
296
+ //# sourceMappingURL=chunk-22JBSK6P.js.map
@@ -179,7 +179,7 @@ async function runCli(options) {
179
179
  if (!configExists) {
180
180
  await runNetworkSetup(mode);
181
181
  }
182
- const { runServe } = await import("./serve-G3XDWOPI.js");
182
+ const { runServe } = await import("./serve-4NOUDAYC.js");
183
183
  await runServe({
184
184
  mode,
185
185
  port: values.port ? parseInt(values.port) : void 0,
@@ -192,4 +192,4 @@ async function runCli(options) {
192
192
  export {
193
193
  runCli
194
194
  };
195
- //# sourceMappingURL=chunk-LN5RMI7G.js.map
195
+ //# sourceMappingURL=chunk-A6HUSQXG.js.map
@@ -151,19 +151,21 @@ function shouldCompact(currentTokens, maxTokens, threshold) {
151
151
  }
152
152
 
153
153
  // src/server/chat/prompts.ts
154
- function buildBasePrompt(workdir, customInstructions, skills) {
154
+ function buildBasePrompt(workdir, customInstructions, skills, modelName) {
155
155
  const instructionsSection = customInstructions ? `
156
156
 
157
157
  ## CUSTOM INSTRUCTIONS
158
158
 
159
159
  ${customInstructions}` : "";
160
+ const modelLine = modelName ? `
161
+ Model: ${modelName}` : "";
160
162
  return `You are OpenFox, an agentic assistant.
161
163
 
162
164
  Today's date is ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0].replace(/-/g, "/")}
163
165
 
164
166
  ## ENVIRONMENT
165
167
  Working directory: ${workdir}
166
- Platform: ${process.platform} (${process.arch})
168
+ Platform: ${process.platform} (${process.arch})${modelLine}
167
169
 
168
170
  ## CORE BEHAVIOR
169
171
  - Help the user complete any tasks safely and efficiently.
@@ -310,13 +312,13 @@ To call a sub-agent, use the call_sub_agent tool with:
310
312
  - prompt: Clear description of what you need
311
313
  `;
312
314
  }
313
- function buildTopLevelSystemPrompt(workdir, customInstructions, skills, subAgentDefs) {
314
- const base = buildBasePrompt(workdir, customInstructions, skills);
315
+ function buildTopLevelSystemPrompt(workdir, customInstructions, skills, subAgentDefs, modelName) {
316
+ const base = buildBasePrompt(workdir, customInstructions, skills, modelName);
315
317
  const subAgents = subAgentDefs ? buildSubAgentsSection(subAgentDefs) : "";
316
318
  return base + subAgents;
317
319
  }
318
- function buildSubAgentSystemPrompt(workdir, agentDef, skills) {
319
- const base = buildBasePrompt(workdir, void 0, skills);
320
+ function buildSubAgentSystemPrompt(workdir, agentDef, skills, modelName) {
321
+ const base = buildBasePrompt(workdir, void 0, skills, modelName);
320
322
  return base + "\n\n" + agentDef.prompt;
321
323
  }
322
324
  function buildToolPermissionsSection(allowedTools, isSubAgent) {
@@ -473,7 +475,8 @@ function assembleAgentRequest(input) {
473
475
  const systemPrompt2 = buildSubAgentSystemPrompt(
474
476
  baseInput.workdir,
475
477
  agentDef,
476
- baseInput.skills
478
+ baseInput.skills,
479
+ baseInput.modelName
477
480
  );
478
481
  return buildAssemblyInput(systemPrompt2, baseInput);
479
482
  }
@@ -481,7 +484,8 @@ function assembleAgentRequest(input) {
481
484
  baseInput.workdir,
482
485
  baseInput.customInstructions,
483
486
  baseInput.skills,
484
- subAgentDefs
487
+ subAgentDefs,
488
+ baseInput.modelName
485
489
  );
486
490
  return buildAssemblyInput(systemPrompt, baseInput);
487
491
  }
@@ -3124,7 +3128,8 @@ async function executeSubAgent(options) {
3124
3128
  const systemPrompt = buildSubAgentSystemPrompt(
3125
3129
  session.workdir,
3126
3130
  agentDef,
3127
- skills.length > 0 ? skills : void 0
3131
+ skills.length > 0 ? skills : void 0,
3132
+ llmClient.getModel()
3128
3133
  );
3129
3134
  let customMessages = [...contextMessages];
3130
3135
  let consecutiveEmptyStops = 0;
@@ -3353,7 +3358,7 @@ var callSubAgentTool = {
3353
3358
  };
3354
3359
  }
3355
3360
  try {
3356
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-QXQGYZ4D.js");
3361
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-E3UECGKO.js");
3357
3362
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3358
3363
  const turnMetrics = new TurnMetrics();
3359
3364
  const result = await executeSubAgent({
@@ -4482,4 +4487,4 @@ export {
4482
4487
  getToolRegistryForAgent,
4483
4488
  createToolRegistry
4484
4489
  };
4485
- //# sourceMappingURL=chunk-MY66TLAH.js.map
4490
+ //# sourceMappingURL=chunk-SGOTQ7R3.js.map
@@ -6,7 +6,7 @@ import {
6
6
  createVerifierNudgeConfig,
7
7
  runBuilderTurn,
8
8
  runChatTurn
9
- } from "./chunk-W62DI5UK.js";
9
+ } from "./chunk-22JBSK6P.js";
10
10
  import {
11
11
  TurnMetrics,
12
12
  agentExists,
@@ -47,7 +47,7 @@ import {
47
47
  setSkillEnabled,
48
48
  skillExists,
49
49
  spawnShellProcess
50
- } from "./chunk-MY66TLAH.js";
50
+ } from "./chunk-SGOTQ7R3.js";
51
51
  import {
52
52
  getPathSeparator,
53
53
  getPlatformShell,
@@ -1214,7 +1214,7 @@ var TerminalManager = class {
1214
1214
  }
1215
1215
  return os.homedir();
1216
1216
  }
1217
- create(workdir) {
1217
+ create(workdir, projectId) {
1218
1218
  const id = this.generateId();
1219
1219
  const shell = this.getShell();
1220
1220
  const cwd = this.resolveWorkdir(workdir);
@@ -1228,7 +1228,8 @@ var TerminalManager = class {
1228
1228
  const session = {
1229
1229
  id,
1230
1230
  pty: ptyProcess,
1231
- workdir: cwd
1231
+ workdir: cwd,
1232
+ projectId: projectId ?? ""
1232
1233
  };
1233
1234
  ptyProcess.onData((data) => {
1234
1235
  const output = { sessionId: id, data };
@@ -1292,6 +1293,10 @@ var TerminalManager = class {
1292
1293
  getAll() {
1293
1294
  return Array.from(this.sessions.values());
1294
1295
  }
1296
+ getByProject(projectId) {
1297
+ if (!projectId) return [];
1298
+ return Array.from(this.sessions.values()).filter((s) => s.projectId === projectId);
1299
+ }
1295
1300
  getOutputHistory(sessionId) {
1296
1301
  return (this.outputHistory.get(sessionId) || []).join("");
1297
1302
  }
@@ -5444,18 +5449,21 @@ function createDevServerRoutes() {
5444
5449
  import { Router as Router6 } from "express";
5445
5450
  function createTerminalRoutes() {
5446
5451
  const router = Router6();
5447
- router.get("/", (_req, res) => {
5448
- const sessions = terminalManager.getAll();
5452
+ router.get("/", (req, res) => {
5453
+ const projectId = req.query["projectId"];
5454
+ const sessions = projectId ? terminalManager.getByProject(projectId) : [];
5449
5455
  const response = sessions.map((s) => ({
5450
5456
  id: s.id,
5451
- workdir: s.workdir
5457
+ workdir: s.workdir,
5458
+ projectId: s.projectId
5452
5459
  }));
5453
5460
  res.json(response);
5454
5461
  });
5455
5462
  router.post("/", (req, res) => {
5456
5463
  const workdir = req.body?.workdir;
5457
- const session = terminalManager.create(workdir);
5458
- res.status(201).json({ id: session.id, workdir: session.workdir });
5464
+ const projectId = req.body?.projectId;
5465
+ const session = terminalManager.create(workdir, projectId);
5466
+ res.status(201).json({ id: session.id, workdir: session.workdir, projectId: session.projectId });
5459
5467
  });
5460
5468
  router.delete("/:id", (req, res) => {
5461
5469
  const { id } = req.params;
@@ -5479,7 +5487,7 @@ function createTerminalRoutes() {
5479
5487
  }
5480
5488
 
5481
5489
  // src/constants.ts
5482
- var VERSION = "1.6.46";
5490
+ var VERSION = "1.6.48";
5483
5491
 
5484
5492
  // src/server/index.ts
5485
5493
  var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
@@ -5781,7 +5789,7 @@ async function createServerHandle(config) {
5781
5789
  if (!callId || approved === void 0) {
5782
5790
  return res.status(400).json({ error: "callId and approved are required" });
5783
5791
  }
5784
- const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-QXQGYZ4D.js");
5792
+ const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-E3UECGKO.js");
5785
5793
  const result = providePathConfirmation2(callId, approved, alwaysAllow);
5786
5794
  if (!result.found) {
5787
5795
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -5806,7 +5814,7 @@ async function createServerHandle(config) {
5806
5814
  if (!callId || !answer) {
5807
5815
  return res.status(400).json({ error: "callId and answer are required" });
5808
5816
  }
5809
- const { provideAnswer: provideAnswer2 } = await import("./tools-QXQGYZ4D.js");
5817
+ const { provideAnswer: provideAnswer2 } = await import("./tools-E3UECGKO.js");
5810
5818
  const found = provideAnswer2(callId, answer);
5811
5819
  if (!found) {
5812
5820
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5842,8 +5850,8 @@ async function createServerHandle(config) {
5842
5850
  if (!session) {
5843
5851
  return res.status(404).json({ error: "Session not found" });
5844
5852
  }
5845
- const { stopSessionExecution } = await import("./chat-handler-UYAJHFNJ.js");
5846
- const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-QXQGYZ4D.js");
5853
+ const { stopSessionExecution } = await import("./chat-handler-TTCW7DIB.js");
5854
+ const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-E3UECGKO.js");
5847
5855
  stopSessionExecution(sessionId, sessionManager);
5848
5856
  abortSession(sessionId);
5849
5857
  cancelQuestionsForSession2(sessionId, "Session stopped by user");
@@ -6302,7 +6310,7 @@ async function createServerHandle(config) {
6302
6310
  providerManager
6303
6311
  );
6304
6312
  const wss = wssExports.wss;
6305
- const { QueueProcessor } = await import("./processor-7V5FI5X7.js");
6313
+ const { QueueProcessor } = await import("./processor-YLKEJ7QC.js");
6306
6314
  const queueProcessor = new QueueProcessor({
6307
6315
  sessionManager,
6308
6316
  providerManager,
@@ -6375,4 +6383,4 @@ export {
6375
6383
  createServerHandle,
6376
6384
  createServer
6377
6385
  };
6378
- //# sourceMappingURL=chunk-AVMBAUH2.js.map
6386
+ //# sourceMappingURL=chunk-WI7OTUWM.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-LN5RMI7G.js";
4
+ } from "../chunk-A6HUSQXG.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-PNBH3RAX.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-LN5RMI7G.js";
4
+ } from "../chunk-A6HUSQXG.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-PNBH3RAX.js";
@@ -3,7 +3,7 @@ import {
3
3
  runBuilderTurn,
4
4
  runChatTurn,
5
5
  runVerifierTurn
6
- } from "./chunk-W62DI5UK.js";
6
+ } from "./chunk-22JBSK6P.js";
7
7
  import {
8
8
  TurnMetrics,
9
9
  createChatDoneEvent,
@@ -11,7 +11,7 @@ import {
11
11
  createMessageStartEvent,
12
12
  createToolCallEvent,
13
13
  createToolResultEvent
14
- } from "./chunk-MY66TLAH.js";
14
+ } from "./chunk-SGOTQ7R3.js";
15
15
  import "./chunk-NBU6KIOD.js";
16
16
  import "./chunk-574HZVLE.js";
17
17
  import "./chunk-7JPKRM6M.js";
@@ -39,4 +39,4 @@ export {
39
39
  runChatTurn,
40
40
  runVerifierTurn
41
41
  };
42
- //# sourceMappingURL=orchestrator-WQDVNDB3.js.map
42
+ //# sourceMappingURL=orchestrator-DIJO4BJ7.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "1.6.46",
3
+ "version": "1.6.48",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -175,7 +175,7 @@ var QueueProcessor = class {
175
175
  backend: provider?.backend ?? llmClient.getBackend(),
176
176
  model: llmClient.getModel()
177
177
  };
178
- const { runChatTurn } = await import("./orchestrator-WQDVNDB3.js");
178
+ const { runChatTurn } = await import("./orchestrator-DIJO4BJ7.js");
179
179
  const runChatTurnParams = buildRunChatTurnParams({
180
180
  sessionManager,
181
181
  sessionId,
@@ -208,4 +208,4 @@ var QueueProcessor = class {
208
208
  export {
209
209
  QueueProcessor
210
210
  };
211
- //# sourceMappingURL=processor-7V5FI5X7.js.map
211
+ //# sourceMappingURL=processor-YLKEJ7QC.js.map
@@ -6,10 +6,10 @@ import {
6
6
  import {
7
7
  VERSION,
8
8
  createServer
9
- } from "./chunk-AVMBAUH2.js";
9
+ } from "./chunk-WI7OTUWM.js";
10
10
  import "./chunk-BHSTSA7U.js";
11
- import "./chunk-W62DI5UK.js";
12
- import "./chunk-MY66TLAH.js";
11
+ import "./chunk-22JBSK6P.js";
12
+ import "./chunk-SGOTQ7R3.js";
13
13
  import "./chunk-NBU6KIOD.js";
14
14
  import "./chunk-574HZVLE.js";
15
15
  import "./chunk-7JPKRM6M.js";
@@ -188,4 +188,4 @@ async function runServe(options) {
188
188
  export {
189
189
  runServe
190
190
  };
191
- //# sourceMappingURL=serve-G3XDWOPI.js.map
191
+ //# sourceMappingURL=serve-4NOUDAYC.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-AVMBAUH2.js";
4
+ } from "../chunk-WI7OTUWM.js";
5
5
  import "../chunk-BHSTSA7U.js";
6
- import "../chunk-W62DI5UK.js";
7
- import "../chunk-MY66TLAH.js";
6
+ import "../chunk-22JBSK6P.js";
7
+ import "../chunk-SGOTQ7R3.js";
8
8
  import "../chunk-NBU6KIOD.js";
9
9
  import "../chunk-574HZVLE.js";
10
10
  import "../chunk-7JPKRM6M.js";
@@ -11,7 +11,7 @@ import {
11
11
  requestPathAccess,
12
12
  stepDoneTool,
13
13
  validateToolAction
14
- } from "./chunk-MY66TLAH.js";
14
+ } from "./chunk-SGOTQ7R3.js";
15
15
  import "./chunk-NBU6KIOD.js";
16
16
  import "./chunk-574HZVLE.js";
17
17
  import "./chunk-7JPKRM6M.js";
@@ -48,4 +48,4 @@ export {
48
48
  stepDoneTool,
49
49
  validateToolAction
50
50
  };
51
- //# sourceMappingURL=tools-QXQGYZ4D.js.map
51
+ //# sourceMappingURL=tools-E3UECGKO.js.map