openfox 1.6.75 → 1.6.77

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 (70) hide show
  1. package/README.md +18 -18
  2. package/dist/agent-defaults/code-reviewer.agent.md +1 -0
  3. package/dist/agent-defaults/explorer.agent.md +2 -1
  4. package/dist/agent-defaults/verifier.agent.md +4 -0
  5. package/dist/{ask-3RK5YJZE.js → ask-5SSOA6SZ.js} +2 -2
  6. package/dist/{auth-LZZX63KI.js → auth-56SIRACI.js} +3 -6
  7. package/dist/auto-compaction-GOHNI2R2.js +27 -0
  8. package/dist/{branch.api-XADFZZAA.js → branch.api-PWFW26KC.js} +2 -2
  9. package/dist/{chat-handler-KYMMXPP6.js → chat-handler-K2RDXBO6.js} +31 -29
  10. package/dist/{chunk-IA4O65CR.js → chunk-6SYNGMU4.js} +100 -68
  11. package/dist/{chunk-AFATQ5LJ.js → chunk-B5AP3RSV.js} +1 -1
  12. package/dist/{chunk-PFRQO5Z3.js → chunk-BBC46FN4.js} +61 -28
  13. package/dist/{chunk-22CTURMH.js → chunk-BJYPTN5S.js} +1 -1
  14. package/dist/{chunk-DLINTLB7.js → chunk-BSTVRSV6.js} +7 -5
  15. package/dist/{chunk-7JPKRM6M.js → chunk-CMQCO27Y.js} +22 -12
  16. package/dist/{chunk-R4HADRYO.js → chunk-CQGTEGKL.js} +1 -1
  17. package/dist/{chunk-J5DV33SS.js → chunk-CUDAT6SS.js} +46 -18
  18. package/dist/{chunk-ETIXH35K.js → chunk-EBQYRNNU.js} +535 -291
  19. package/dist/{chunk-4CQ7CUQ6.js → chunk-I7JVS7V5.js} +5 -5
  20. package/dist/{chunk-PNBH3RAX.js → chunk-K44MW7JJ.js} +1 -1
  21. package/dist/{chunk-BLNFJ22S.js → chunk-KIOUKC3Z.js} +6 -4
  22. package/dist/{chunk-CTAIXOZJ.js → chunk-NDJ6FKSP.js} +1 -1
  23. package/dist/{chunk-VIGOXEZG.js → chunk-OJBFC6ER.js} +15 -16
  24. package/dist/{chunk-GQZGIMJO.js → chunk-OXI26S7U.js} +12 -7
  25. package/dist/{chunk-NBU6KIOD.js → chunk-PBGOZMVY.js} +4 -4
  26. package/dist/{chunk-B7E3BICY.js → chunk-RGRBWDZP.js} +2 -4
  27. package/dist/{chunk-KFBIHS3S.js → chunk-STYHKCG7.js} +20 -14
  28. package/dist/{chunk-55Z3DJ7G.js → chunk-TGWEH2BC.js} +10 -11
  29. package/dist/{chunk-TYUNDOX2.js → chunk-UKMRZDWM.js} +90 -41
  30. package/dist/{chunk-5UTTLO4D.js → chunk-UVN6AKIO.js} +89 -49
  31. package/dist/{chunk-574HZVLE.js → chunk-VRGRAQDG.js} +2 -2
  32. package/dist/{chunk-JQBTYHUR.js → chunk-WR6QCJJO.js} +53 -15
  33. package/dist/{chunk-RBPOAAIZ.js → chunk-XKIEDGQF.js} +22 -18
  34. package/dist/{chunk-XIZ6B6IS.js → chunk-XSUQDB6R.js} +541 -299
  35. package/dist/cli/dev.js +2 -2
  36. package/dist/cli/index.js +2 -2
  37. package/dist/{config-6T4EHAP2.js → config-5CONAOL7.js} +7 -7
  38. package/dist/{events-LKEZ3YCW.js → events-5RIXWI5Y.js} +6 -6
  39. package/dist/{folding-JN2WT44N.js → folding-JNOUTI5Z.js} +2 -2
  40. package/dist/{inspect-proxy-Y4MRAVB7.js → inspect-proxy-Y75AXMRX.js} +3 -3
  41. package/dist/{manager-HM2J5VMW.js → manager-W7N3XQ4Q.js} +3 -3
  42. package/dist/orchestrator-TW5II347.js +43 -0
  43. package/dist/package.json +19 -3
  44. package/dist/{paths-ZRI56O63.js → paths-X46PPOI2.js} +2 -2
  45. package/dist/{processor-23O4HPSS.js → processor-MZ3QIUED.js} +15 -11
  46. package/dist/{project-creator-LASKNQPA.js → project-creator-VD7MLOWE.js} +8 -5
  47. package/dist/{projects-HEUOWNSR.js → projects-XLMSDFTQ.js} +4 -4
  48. package/dist/{protocol-5AWNGFLH.js → protocol-4CTV7OZC.js} +3 -3
  49. package/dist/{protocol-DRBnujwe.d.ts → protocol-4xbfAlGO.d.ts} +3 -0
  50. package/dist/{provider-AKN355YH.js → provider-ESEBV3LL.js} +15 -11
  51. package/dist/{pwa-GHQCMCIU.js → pwa-76XP2DY2.js} +2 -2
  52. package/dist/{runtime-config-ZCK74XKM.js → runtime-config-CBJJJGBD.js} +2 -2
  53. package/dist/{serve-TW63YCNQ.js → serve-FTTLGRAO.js} +29 -27
  54. package/dist/server/index.d.ts +6 -1
  55. package/dist/server/index.js +22 -22
  56. package/dist/server/public/__inspect__.js +163 -143
  57. package/dist/{service-74Z7JK2J.js → service-D6LC3CAM.js} +3 -2
  58. package/dist/{settings-NI4ITGV6.js → settings-TQNQB56H.js} +4 -4
  59. package/dist/shared/index.d.ts +2 -2
  60. package/dist/shared/index.js +2 -2
  61. package/dist/{store-2IF3ZSLD.js → store-OQ45KONN.js} +2 -2
  62. package/dist/{tools-RUAY6EVI.js → tools-QJ5K5IJP.js} +18 -18
  63. package/dist/{vision-fallback-AXH3BGJC.js → vision-fallback-ED27LH6C.js} +3 -3
  64. package/dist/web/__inspect__.js +178 -155
  65. package/dist/web/assets/{index-CWdKiSP8.js → index-FjLp1t6r.js} +62 -62
  66. package/dist/web/index.html +2 -2
  67. package/dist/web/sw.js +1 -1
  68. package/package.json +19 -3
  69. package/dist/auto-compaction-OW4P2QWQ.js +0 -27
  70. package/dist/orchestrator-QP4O7MUM.js +0 -43
package/README.md CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  Autonomous coding agent for local LLMs with contract-driven execution.
6
6
 
7
- *Session — Criteria tracking, tool calls, and streaming responses*
7
+ _Session — Criteria tracking, tool calls, and streaming responses_
8
8
  ![Session](docs/screenshots/session.png)
9
9
 
10
- *Providers — Local LLM backend configuration*
10
+ _Providers — Local LLM backend configuration_
11
11
  ![Providers](docs/screenshots/providers.png)
12
12
 
13
- *Workflows — Contract-driven execution pipeline*
13
+ _Workflows — Contract-driven execution pipeline_
14
14
  ![Workflows](docs/screenshots/workflows.png)
15
15
 
16
16
  ## Quick Start
@@ -46,12 +46,12 @@ openfox provider remove # Remove provider
46
46
 
47
47
  ## CLI Options
48
48
 
49
- | Option | Description | Default |
50
- |--------|-------------|---------|
51
- | `-p, --port <number>` | Specify server port | 10369 |
52
- | `--no-browser` | Don't open browser on start | Opens browser |
53
- | `-h, --help` | Show help message | - |
54
- | `-v, --version` | Show version number | - |
49
+ | Option | Description | Default |
50
+ | --------------------- | --------------------------- | ------------- |
51
+ | `-p, --port <number>` | Specify server port | 10369 |
52
+ | `--no-browser` | Don't open browser on start | Opens browser |
53
+ | `-h, --help` | Show help message | - |
54
+ | `-v, --version` | Show version number | - |
55
55
 
56
56
  ## Requirements
57
57
 
@@ -72,30 +72,30 @@ openfox provider remove # Remove provider
72
72
 
73
73
  ## Screenshots
74
74
 
75
- *Homepage — Project overview and session history*
75
+ _Homepage — Project overview and session history_
76
76
  ![Homepage](docs/screenshots/homepage.png)
77
77
 
78
- *Project Selected — Active session with context stats*
78
+ _Project Selected — Active session with context stats_
79
79
  ![Project Selected](docs/screenshots/project-selected.png)
80
80
 
81
- *Stats — Prefill time, generation speed, token usage*
81
+ _Stats — Prefill time, generation speed, token usage_
82
82
  ![Stats](docs/screenshots/stats.png)
83
83
 
84
- *Terminal — Integrated terminal for running commands*
84
+ _Terminal — Integrated terminal for running commands_
85
85
  ![Terminal](docs/screenshots/terminal.png)
86
86
 
87
- *Notifications — Event log and system messages*
87
+ _Notifications — Event log and system messages_
88
88
  ![Notifications](docs/screenshots/notifications.png)
89
89
 
90
- *Agents — Sub-agent management and execution*
90
+ _Agents — Sub-agent management and execution_
91
91
  ![Agents](docs/screenshots/agents.png)
92
92
 
93
- *General Instructions — Global custom instructions*
93
+ _General Instructions — Global custom instructions_
94
94
  ![General Instructions](docs/screenshots/general-instructions.png)
95
95
 
96
- *Vision Fallback — Image processing configuration*
96
+ _Vision Fallback — Image processing configuration_
97
97
  ![Vision Fallback](docs/screenshots/vision-fallback.png)
98
98
 
99
99
  ## License
100
100
 
101
- MIT
101
+ MIT
@@ -11,6 +11,7 @@ allowedTools:
11
11
 
12
12
  You are a senior code reviewer.
13
13
  Review the provided code changes for:
14
+
14
15
  - Bugs and logic errors
15
16
  - Security vulnerabilities
16
17
  - Performance issues
@@ -15,8 +15,9 @@ You are a codebase exploration expert.
15
15
  Your role is to investigate and map out code structure, find relevant files, and explain how components work together.
16
16
 
17
17
  Guidelines:
18
+
18
19
  - Use run_command with grep/glob to discover code
19
20
  - Trace dependencies and imports to understand relationships
20
21
  - Identify patterns and conventions in the codebase
21
22
  - Report findings clearly with file paths and key observations
22
- - Look for tests, documentation, and configuration to supplement your understanding
23
+ - Look for tests, documentation, and configuration to supplement your understanding
@@ -14,6 +14,7 @@ allowedTools:
14
14
  You are a code reviewer performing independent verification.
15
15
 
16
16
  The user will provide:
17
+
17
18
  - Task summary
18
19
  - Criteria to verify (with status markers)
19
20
  - Modified files
@@ -21,16 +22,19 @@ The user will provide:
21
22
  ## YOUR TASK
22
23
 
23
24
  For each criterion marked [NEEDS VERIFICATION]:
25
+
24
26
  1. Consider the task summary and criterion description
25
27
  2. If the criterion requires code changes, read the modified files and verify the implementation
26
28
  3. If the criterion is conceptual or doesn't require code (e.g., test/placeholder criteria), verify based on the description alone
27
29
  4. Run tests or commands only if applicable to the criterion
28
30
 
29
31
  Then call:
32
+
30
33
  - `criterion` with action "pass" if the criterion is satisfied
31
34
  - `criterion` with action "fail" if it is NOT satisfied (explain why clearly)
32
35
 
33
36
  ## IMPORTANT
37
+
34
38
  - Start by analyzing what each criterion actually requires
35
39
  - For trivial or non-code criteria, pass them immediately without exploring the codebase
36
40
  - For code-related criteria, focus on the modified files provided
@@ -6,7 +6,7 @@ import {
6
6
  cancelQuestionsForSession,
7
7
  hasPendingQuestion,
8
8
  provideAnswer
9
- } from "./chunk-22CTURMH.js";
9
+ } from "./chunk-BJYPTN5S.js";
10
10
  export {
11
11
  AskUserInterrupt,
12
12
  askUserTool,
@@ -16,4 +16,4 @@ export {
16
16
  hasPendingQuestion,
17
17
  provideAnswer
18
18
  };
19
- //# sourceMappingURL=ask-3RK5YJZE.js.map
19
+ //# sourceMappingURL=ask-5SSOA6SZ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAuthConfigPath
3
- } from "./chunk-R4HADRYO.js";
3
+ } from "./chunk-CQGTEGKL.js";
4
4
 
5
5
  // src/cli/auth.ts
6
6
  import { readFile, writeFile, mkdir, access } from "fs/promises";
@@ -30,10 +30,7 @@ async function authConfigExists(mode) {
30
30
  }
31
31
  }
32
32
  function encryptPassword(password, publicKey) {
33
- const encrypted = publicEncrypt(
34
- { key: publicKey, padding: 1 },
35
- Buffer.from(password)
36
- );
33
+ const encrypted = publicEncrypt({ key: publicKey, padding: 1 }, Buffer.from(password));
37
34
  return encrypted.toString("base64");
38
35
  }
39
36
  function hashPassword(password) {
@@ -50,4 +47,4 @@ export {
50
47
  saveAuthConfig,
51
48
  verifyPassword
52
49
  };
53
- //# sourceMappingURL=auth-LZZX63KI.js.map
50
+ //# sourceMappingURL=auth-56SIRACI.js.map
@@ -0,0 +1,27 @@
1
+ import {
2
+ maybeAutoCompactContext,
3
+ performManualContextCompaction,
4
+ resolveCompactionStatsIdentity
5
+ } from "./chunk-EBQYRNNU.js";
6
+ import "./chunk-OXI26S7U.js";
7
+ import "./chunk-CMQCO27Y.js";
8
+ import "./chunk-XKIEDGQF.js";
9
+ import "./chunk-PBGOZMVY.js";
10
+ import "./chunk-VRGRAQDG.js";
11
+ import "./chunk-CUDAT6SS.js";
12
+ import "./chunk-UVN6AKIO.js";
13
+ import "./chunk-KIOUKC3Z.js";
14
+ import "./chunk-BBC46FN4.js";
15
+ import "./chunk-STYHKCG7.js";
16
+ import "./chunk-BJYPTN5S.js";
17
+ import "./chunk-NDJ6FKSP.js";
18
+ import "./chunk-CQGTEGKL.js";
19
+ import "./chunk-B5AP3RSV.js";
20
+ import "./chunk-BSTVRSV6.js";
21
+ import "./chunk-K44MW7JJ.js";
22
+ export {
23
+ maybeAutoCompactContext,
24
+ performManualContextCompaction,
25
+ resolveCompactionStatsIdentity
26
+ };
27
+ //# sourceMappingURL=auto-compaction-GOHNI2R2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-PNBH3RAX.js";
3
+ } from "./chunk-K44MW7JJ.js";
4
4
 
5
5
  // src/server/branch.api.ts
6
6
  import { spawn } from "child_process";
@@ -45,4 +45,4 @@ function getGitBranch(cwd) {
45
45
  export {
46
46
  getCurrentBranch
47
47
  };
48
- //# sourceMappingURL=branch.api-XADFZZAA.js.map
48
+ //# sourceMappingURL=branch.api-PWFW26KC.js.map
@@ -5,35 +5,35 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-4CQ7CUQ6.js";
8
+ } from "./chunk-I7JVS7V5.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-IA4O65CR.js";
12
- import "./chunk-ETIXH35K.js";
13
- import "./chunk-GQZGIMJO.js";
14
- import "./chunk-7JPKRM6M.js";
15
- import "./chunk-RBPOAAIZ.js";
16
- import "./chunk-NBU6KIOD.js";
17
- import "./chunk-574HZVLE.js";
18
- import "./chunk-J5DV33SS.js";
11
+ } from "./chunk-6SYNGMU4.js";
12
+ import "./chunk-EBQYRNNU.js";
13
+ import "./chunk-OXI26S7U.js";
14
+ import "./chunk-CMQCO27Y.js";
15
+ import "./chunk-XKIEDGQF.js";
16
+ import "./chunk-PBGOZMVY.js";
17
+ import "./chunk-VRGRAQDG.js";
18
+ import "./chunk-CUDAT6SS.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-5UTTLO4D.js";
22
- import "./chunk-BLNFJ22S.js";
23
- import "./chunk-PFRQO5Z3.js";
21
+ } from "./chunk-UVN6AKIO.js";
22
+ import "./chunk-KIOUKC3Z.js";
23
+ import "./chunk-BBC46FN4.js";
24
24
  import {
25
25
  createChatMessageMessage,
26
26
  createPhaseChangedMessage,
27
27
  createSessionRunningMessage
28
- } from "./chunk-KFBIHS3S.js";
29
- import "./chunk-22CTURMH.js";
30
- import "./chunk-CTAIXOZJ.js";
31
- import "./chunk-R4HADRYO.js";
32
- import "./chunk-AFATQ5LJ.js";
33
- import "./chunk-DLINTLB7.js";
28
+ } from "./chunk-STYHKCG7.js";
29
+ import "./chunk-BJYPTN5S.js";
30
+ import "./chunk-NDJ6FKSP.js";
31
+ import "./chunk-CQGTEGKL.js";
32
+ import "./chunk-B5AP3RSV.js";
33
+ import "./chunk-BSTVRSV6.js";
34
34
  import {
35
35
  logger
36
- } from "./chunk-PNBH3RAX.js";
36
+ } from "./chunk-K44MW7JJ.js";
37
37
 
38
38
  // src/server/session/chat-handler.ts
39
39
  var activeAgents = /* @__PURE__ */ new Map();
@@ -61,7 +61,7 @@ async function startChatSession(sessionId, content, deps, options) {
61
61
  sessionManager.setRunning(sessionId, true);
62
62
  broadcastForSession(sessionId, createSessionRunningMessage(true));
63
63
  try {
64
- const { maybeAutoCompactContext } = await import("./auto-compaction-OW4P2QWQ.js");
64
+ const { maybeAutoCompactContext } = await import("./auto-compaction-GOHNI2R2.js");
65
65
  await maybeAutoCompactContext({
66
66
  sessionManager,
67
67
  sessionId,
@@ -121,14 +121,16 @@ async function startChatSession(sessionId, content, deps, options) {
121
121
  }
122
122
  function startTurnWithCompletionChain(sessionId, controller, deps) {
123
123
  const { sessionManager, llmClient, statsIdentity, broadcastForSession } = deps;
124
- runChatTurn(buildRunChatTurnParams({
125
- sessionManager,
126
- sessionId,
127
- llmClient,
128
- statsIdentity,
129
- signal: controller.signal,
130
- onMessage: (msg) => broadcastForSession(sessionId, msg)
131
- })).catch((error) => {
124
+ runChatTurn(
125
+ buildRunChatTurnParams({
126
+ sessionManager,
127
+ sessionId,
128
+ llmClient,
129
+ statsIdentity,
130
+ signal: controller.signal,
131
+ onMessage: (msg) => broadcastForSession(sessionId, msg)
132
+ })
133
+ ).catch((error) => {
132
134
  if (error instanceof Error && error.message === "Aborted") {
133
135
  return;
134
136
  }
@@ -170,4 +172,4 @@ export {
170
172
  startChatSession,
171
173
  stopSessionExecution
172
174
  };
173
- //# sourceMappingURL=chat-handler-KYMMXPP6.js.map
175
+ //# sourceMappingURL=chat-handler-K2RDXBO6.js.map
@@ -13,17 +13,17 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-ETIXH35K.js";
16
+ } from "./chunk-EBQYRNNU.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
20
- } from "./chunk-5UTTLO4D.js";
20
+ } from "./chunk-UVN6AKIO.js";
21
21
  import {
22
22
  buildSnapshotFromSessionState
23
- } from "./chunk-PFRQO5Z3.js";
23
+ } from "./chunk-BBC46FN4.js";
24
24
  import {
25
25
  logger
26
- } from "./chunk-PNBH3RAX.js";
26
+ } from "./chunk-K44MW7JJ.js";
27
27
 
28
28
  // src/server/sub-agents/verifier-helpers.ts
29
29
  var MAX_CONSECUTIVE_VERIFIER_NUDGES = 10;
@@ -99,11 +99,19 @@ async function runChatTurn(options) {
99
99
  recoverable: false
100
100
  }
101
101
  });
102
- eventStore.append(sessionId, createMessageStartEvent(errorMsgId2, "user", `Access denied: ${error.paths.join(", ")}. If you need this file, explain why and ask the user for permission.`, {
103
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
104
- isSystemGenerated: true,
105
- messageKind: "correction"
106
- }));
102
+ eventStore.append(
103
+ sessionId,
104
+ createMessageStartEvent(
105
+ errorMsgId2,
106
+ "user",
107
+ `Access denied: ${error.paths.join(", ")}. If you need this file, explain why and ask the user for permission.`,
108
+ {
109
+ ...getCurrentWindowMessageOptions(sessionId) ?? {},
110
+ isSystemGenerated: true,
111
+ messageKind: "correction"
112
+ }
113
+ )
114
+ );
107
115
  eventStore.append(sessionId, createChatDoneEvent(errorMsgId2, "error"));
108
116
  return;
109
117
  }
@@ -121,11 +129,19 @@ async function runChatTurn(options) {
121
129
  recoverable: false
122
130
  }
123
131
  });
124
- eventStore.append(sessionId, createMessageStartEvent(errorMsgId, "user", `Error: ${error instanceof Error ? error.message : "Unknown error"}`, {
125
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
126
- isSystemGenerated: true,
127
- messageKind: "correction"
128
- }));
132
+ eventStore.append(
133
+ sessionId,
134
+ createMessageStartEvent(
135
+ errorMsgId,
136
+ "user",
137
+ `Error: ${error instanceof Error ? error.message : "Unknown error"}`,
138
+ {
139
+ ...getCurrentWindowMessageOptions(sessionId) ?? {},
140
+ isSystemGenerated: true,
141
+ messageKind: "correction"
142
+ }
143
+ )
144
+ );
129
145
  eventStore.append(sessionId, createChatDoneEvent(errorMsgId, "error"));
130
146
  } finally {
131
147
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
@@ -173,17 +189,20 @@ async function runGenericAgentTurn(options, turnMetrics, agentId) {
173
189
  injectModeReminderIfNeeded(options.sessionManager, options.sessionId, agentId, allAgents, options.onMessage);
174
190
  const agentDef = findAgentById(agentId, allAgents) ?? findAgentById("planner", allAgents);
175
191
  const subAgentDefs = getSubAgents(allAgents);
176
- await runTopLevelAgentLoop({
177
- mode: agentId,
178
- sessionManager: options.sessionManager,
179
- sessionId: options.sessionId,
180
- llmClient: options.llmClient,
181
- statsIdentity,
182
- signal: options.signal,
183
- onMessage: options.onMessage,
184
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
185
- getToolRegistry: () => getToolRegistryForAgent(agentDef)
186
- }, turnMetrics);
192
+ await runTopLevelAgentLoop(
193
+ {
194
+ mode: agentId,
195
+ sessionManager: options.sessionManager,
196
+ sessionId: options.sessionId,
197
+ llmClient: options.llmClient,
198
+ statsIdentity,
199
+ signal: options.signal,
200
+ onMessage: options.onMessage,
201
+ assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
202
+ getToolRegistry: () => getToolRegistryForAgent(agentDef)
203
+ },
204
+ turnMetrics
205
+ );
187
206
  }
188
207
  function filterToolRegistryForStepDone(baseRegistry, _injectStepDone) {
189
208
  return baseRegistry;
@@ -198,50 +217,63 @@ async function runBuilderTurn(options, turnMetrics) {
198
217
  const subAgentDefs = getSubAgents(allAgents);
199
218
  let stepDoneCalled = false;
200
219
  return {
201
- ...await runTopLevelAgentLoop({
202
- mode: "builder",
203
- sessionManager,
204
- sessionId,
205
- llmClient: options.llmClient,
206
- statsIdentity,
207
- signal: options.signal,
208
- onMessage: options.onMessage,
209
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef: builderDef, subAgentDefs, modelName: options.llmClient.getModel() }),
210
- getToolRegistry: () => {
211
- const baseRegistry = getToolRegistryForAgent(builderDef);
212
- return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
213
- },
214
- onToolExecuted: (toolCall, toolResult) => {
215
- if (toolCall.name === "step_done" && toolResult.success) {
216
- stepDoneCalled = true;
217
- }
218
- if (toolResult.success && ["write_file", "edit_file"].includes(toolCall.name)) {
219
- const path = toolCall.arguments["path"];
220
- sessionManager.addModifiedFile(sessionId, path);
220
+ ...await runTopLevelAgentLoop(
221
+ {
222
+ mode: "builder",
223
+ sessionManager,
224
+ sessionId,
225
+ llmClient: options.llmClient,
226
+ statsIdentity,
227
+ signal: options.signal,
228
+ onMessage: options.onMessage,
229
+ assembleRequest: (input) => assembleAgentRequest({
230
+ ...input,
231
+ agentDef: builderDef,
232
+ subAgentDefs,
233
+ modelName: options.llmClient.getModel()
234
+ }),
235
+ getToolRegistry: () => {
236
+ const baseRegistry = getToolRegistryForAgent(builderDef);
237
+ return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
238
+ },
239
+ onToolExecuted: (toolCall, toolResult) => {
240
+ if (toolCall.name === "step_done" && toolResult.success) {
241
+ stepDoneCalled = true;
242
+ }
243
+ if (toolResult.success && ["write_file", "edit_file"].includes(toolCall.name)) {
244
+ const path = toolCall.arguments["path"];
245
+ sessionManager.addModifiedFile(sessionId, path);
246
+ }
247
+ },
248
+ injectKickoff: () => {
249
+ if (options.injectBuilderKickoff !== true) return;
250
+ const session = sessionManager.requireSession(sessionId);
251
+ const currentWindowMessageOptions = getCurrentContextWindowId(sessionId) ? { contextWindowId: getCurrentContextWindowId(sessionId) } : void 0;
252
+ const events = eventStore.getEvents(sessionId);
253
+ const hasBuilderKickoff = events.some((e) => {
254
+ if (e.type !== "message.start") return false;
255
+ const data = e.data;
256
+ return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
257
+ });
258
+ if (!hasBuilderKickoff) {
259
+ const kickoffMsgId = crypto.randomUUID();
260
+ const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
261
+ const msgMetadata = { type: "workflow", name: "Workflow", color: "#f59e0b" };
262
+ eventStore.append(
263
+ sessionId,
264
+ createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
265
+ ...currentWindowMessageOptions ?? {},
266
+ isSystemGenerated: true,
267
+ messageKind: "auto-prompt",
268
+ metadata: msgMetadata
269
+ })
270
+ );
271
+ eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
272
+ }
221
273
  }
222
274
  },
223
- injectKickoff: () => {
224
- if (options.injectBuilderKickoff !== true) return;
225
- const session = sessionManager.requireSession(sessionId);
226
- const events = eventStore.getEvents(sessionId);
227
- const hasBuilderKickoff = events.some((e) => {
228
- if (e.type !== "message.start") return false;
229
- const data = e.data;
230
- return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
231
- });
232
- if (!hasBuilderKickoff) {
233
- const kickoffMsgId = crypto.randomUUID();
234
- const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
235
- eventStore.append(sessionId, createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
236
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
237
- isSystemGenerated: true,
238
- messageKind: "auto-prompt",
239
- metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
240
- }));
241
- eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
242
- }
243
- }
244
- }, turnMetrics),
275
+ turnMetrics
276
+ ),
245
277
  stepDoneCalled
246
278
  };
247
279
  }
@@ -295,4 +327,4 @@ export {
295
327
  runBuilderTurn,
296
328
  runVerifierTurn
297
329
  };
298
- //# sourceMappingURL=chunk-IA4O65CR.js.map
330
+ //# sourceMappingURL=chunk-6SYNGMU4.js.map
@@ -67,4 +67,4 @@ export {
67
67
  setRuntimeConfig,
68
68
  getRuntimeConfig
69
69
  };
70
- //# sourceMappingURL=chunk-AFATQ5LJ.js.map
70
+ //# sourceMappingURL=chunk-B5AP3RSV.js.map