openfox 1.6.102 → 2.0.0-beta.0
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.
- package/dist/agent-defaults/builder.agent.md +1 -2
- package/dist/agent-defaults/code-reviewer.agent.md +16 -9
- package/dist/agent-defaults/planner.agent.md +1 -1
- package/dist/agent-defaults/verifier.agent.md +2 -3
- package/dist/{auto-compaction-7LMAY5JV.js → auto-compaction-UIWTO3H5.js} +6 -6
- package/dist/{chat-handler-ZJVIM7U4.js → chat-handler-IVIWOR3D.js} +9 -10
- package/dist/{chunk-RYEZ7LDX.js → chunk-ALH4KM2Y.js} +108 -231
- package/dist/{chunk-RCQOHFAN.js → chunk-CEZNMLOO.js} +10 -2
- package/dist/{chunk-ZPCJLFAG.js → chunk-CTQ2FS4K.js} +501 -263
- package/dist/{chunk-MEYDERUX.js → chunk-FQLK5GL5.js} +1 -1
- package/dist/{chunk-AI3CY7T6.js → chunk-JZQ644DE.js} +7 -5
- package/dist/{chunk-6WZI6F6G.js → chunk-NONI4CRP.js} +19 -1
- package/dist/{chunk-IZC2EZ4D.js → chunk-QFSSKIQ3.js} +4 -4
- package/dist/{chunk-PDPXHSNZ.js → chunk-UFY4I643.js} +4 -4
- package/dist/{chunk-J335KZ6U.js → chunk-XKR3HCAL.js} +14 -3
- package/dist/cli/dev.js +25 -1
- package/dist/cli/index.js +25 -1
- package/dist/cli/update.sh +8 -3
- package/dist/{events-OKTZRT3Y.js → events-OHJWCI3S.js} +5 -3
- package/dist/{folding-Z3OMWNOE.js → folding-U6UHQAS5.js} +4 -2
- package/dist/{orchestrator-5EYWRAZ2.js → orchestrator-7ZXM4J22.js} +7 -7
- package/dist/package.json +1 -1
- package/dist/{processor-XJYCHNV6.js → processor-TKBJLQ2N.js} +7 -7
- package/dist/{protocol-CdVNdXi8.d.ts → protocol-BQ12Aw5J.d.ts} +14 -3
- package/dist/{protocol-TNC6MCJV.js → protocol-K62EPEGS.js} +5 -3
- package/dist/{serve-SGFEQ5N7.js → serve-FGPHMDOC.js} +8 -8
- package/dist/server/index.d.ts +7 -1
- package/dist/server/index.js +7 -7
- package/dist/{service-EUOBAATS.js → service-GB7AIOG5.js} +10 -4
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{tools-WFIYKFBE.js → tools-Z7X4HXZN.js} +6 -6
- package/dist/web/assets/index-BDezz42a.js +299 -0
- package/dist/web/assets/{index-aAebFDVk.css → index-BY8EbT5Z.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/workflow-defaults/default.workflow.json +49 -10
- package/package.json +1 -1
- package/dist/web/assets/index-DcGVOFte.js +0 -299
|
@@ -123,7 +123,8 @@ async function runCli(options) {
|
|
|
123
123
|
port: { type: "string", short: "p" },
|
|
124
124
|
"no-browser": { type: "boolean" },
|
|
125
125
|
help: { type: "boolean", short: "h" },
|
|
126
|
-
version: { type: "boolean", short: "v" }
|
|
126
|
+
version: { type: "boolean", short: "v" },
|
|
127
|
+
service: { type: "boolean" }
|
|
127
128
|
},
|
|
128
129
|
allowPositionals: true,
|
|
129
130
|
strict: true
|
|
@@ -156,7 +157,7 @@ async function runCli(options) {
|
|
|
156
157
|
break;
|
|
157
158
|
}
|
|
158
159
|
case "service": {
|
|
159
|
-
const { runServiceCommand } = await import("./service-
|
|
160
|
+
const { runServiceCommand } = await import("./service-GB7AIOG5.js");
|
|
160
161
|
const [, subcommand] = positionals;
|
|
161
162
|
if (subcommand === "--help" || subcommand === "-h" || values.help) {
|
|
162
163
|
runServiceCommand(mode, void 0);
|
|
@@ -179,7 +180,8 @@ async function runCli(options) {
|
|
|
179
180
|
const __filename = fileURLToPath(import.meta.url);
|
|
180
181
|
const __dirname = dirname(__filename);
|
|
181
182
|
const updateScriptPath = join(__dirname, "cli", "update.sh");
|
|
182
|
-
const
|
|
183
|
+
const updateArgs = values["service"] ? ["--service"] : [];
|
|
184
|
+
const result = spawnSync(updateScriptPath, updateArgs, { shell: true, stdio: "inherit" });
|
|
183
185
|
if (result.status !== 0) {
|
|
184
186
|
process.exit(result.status ?? 1);
|
|
185
187
|
}
|
|
@@ -191,7 +193,7 @@ async function runCli(options) {
|
|
|
191
193
|
if (!configExists) {
|
|
192
194
|
await runNetworkSetup(mode);
|
|
193
195
|
}
|
|
194
|
-
const { runServe } = await import("./serve-
|
|
196
|
+
const { runServe } = await import("./serve-FGPHMDOC.js");
|
|
195
197
|
const serveOptions = { mode };
|
|
196
198
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
197
199
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -203,4 +205,4 @@ async function runCli(options) {
|
|
|
203
205
|
export {
|
|
204
206
|
runCli
|
|
205
207
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
208
|
+
//# sourceMappingURL=chunk-JZQ644DE.js.map
|
|
@@ -503,6 +503,16 @@ function foldTodos(events) {
|
|
|
503
503
|
}
|
|
504
504
|
return todos;
|
|
505
505
|
}
|
|
506
|
+
function foldMetadata(events) {
|
|
507
|
+
const metadata = {};
|
|
508
|
+
for (const event of events) {
|
|
509
|
+
if (event.type === "metadata.set") {
|
|
510
|
+
const data = event.data;
|
|
511
|
+
metadata[data.key] = data.entries;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return metadata;
|
|
515
|
+
}
|
|
506
516
|
function foldContextState(events, initialWindowId) {
|
|
507
517
|
let currentContextWindowId = initialWindowId;
|
|
508
518
|
let compactionCount = 0;
|
|
@@ -624,6 +634,7 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
624
634
|
const messages = initialMessages && initialMessages.length > 0 ? foldTurnEventsToSnapshotMessagesFromInitial(events, initialMessages) : foldTurnEventsToSnapshotMessages(events);
|
|
625
635
|
const criteria = foldCriteria(events);
|
|
626
636
|
const todos = foldTodos(events);
|
|
637
|
+
let metadataEntries = foldMetadata(events);
|
|
627
638
|
const contextResult = foldContextState(events, initialWindowId);
|
|
628
639
|
const pendingConfirmations = foldPendingConfirmations(events);
|
|
629
640
|
const baseContextState = contextResult.latestContextState ?? {
|
|
@@ -665,6 +676,9 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
665
676
|
if (snapshotData.dynamicContextHash && !dynamicContextHash) {
|
|
666
677
|
dynamicContextHash = snapshotData.dynamicContextHash;
|
|
667
678
|
}
|
|
679
|
+
if (snapshotData.metadataEntries && Object.keys(metadataEntries).length === 0) {
|
|
680
|
+
metadataEntries = snapshotData.metadataEntries;
|
|
681
|
+
}
|
|
668
682
|
}
|
|
669
683
|
}
|
|
670
684
|
let lastModeWithReminder;
|
|
@@ -765,6 +779,7 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
765
779
|
messages,
|
|
766
780
|
criteria,
|
|
767
781
|
todos,
|
|
782
|
+
metadataEntries,
|
|
768
783
|
contextState,
|
|
769
784
|
currentContextWindowId: contextResult.currentContextWindowId,
|
|
770
785
|
readFiles: contextResult.readFiles,
|
|
@@ -789,6 +804,7 @@ function buildSnapshot(foldedState, latestSeq, snapshotAt = Date.now()) {
|
|
|
789
804
|
isRunning: foldedState.isRunning,
|
|
790
805
|
messages: foldedState.messages,
|
|
791
806
|
criteria: foldedState.criteria,
|
|
807
|
+
metadataEntries: foldedState.metadataEntries,
|
|
792
808
|
contextState: foldedState.contextState,
|
|
793
809
|
currentContextWindowId: foldedState.currentContextWindowId,
|
|
794
810
|
todos: foldedState.todos,
|
|
@@ -836,6 +852,7 @@ function buildSnapshotFromSessionState(input) {
|
|
|
836
852
|
isRunning: session.isRunning,
|
|
837
853
|
messages,
|
|
838
854
|
criteria: session.criteria,
|
|
855
|
+
metadataEntries: foldedState.metadataEntries,
|
|
839
856
|
contextState: {
|
|
840
857
|
currentTokens: session.executionState?.currentTokenCount ?? foldedState.contextState.currentTokens,
|
|
841
858
|
maxTokens: foldedState.contextState.maxTokens,
|
|
@@ -883,6 +900,7 @@ export {
|
|
|
883
900
|
foldTurnEventsToSnapshotMessagesFromInitial,
|
|
884
901
|
foldCriteria,
|
|
885
902
|
foldTodos,
|
|
903
|
+
foldMetadata,
|
|
886
904
|
foldContextState,
|
|
887
905
|
foldMode,
|
|
888
906
|
foldPhase,
|
|
@@ -894,4 +912,4 @@ export {
|
|
|
894
912
|
getMessagesForWindow,
|
|
895
913
|
buildContextMessagesFromMessages
|
|
896
914
|
};
|
|
897
|
-
//# sourceMappingURL=chunk-
|
|
915
|
+
//# sourceMappingURL=chunk-NONI4CRP.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore,
|
|
3
3
|
updateSessionMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XKR3HCAL.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMessagesFromStoredEvents,
|
|
7
7
|
foldPendingConfirmations
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NONI4CRP.js";
|
|
9
9
|
import {
|
|
10
10
|
createContextStateMessage,
|
|
11
11
|
createSessionStateMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CEZNMLOO.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-QFSSKIQ3.js.map
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ALH4KM2Y.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XKR3HCAL.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NONI4CRP.js";
|
|
24
24
|
import {
|
|
25
25
|
logger
|
|
26
26
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -329,4 +329,4 @@ export {
|
|
|
329
329
|
runBuilderTurn,
|
|
330
330
|
runVerifierTurn
|
|
331
331
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-UFY4I643.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
foldSessionState,
|
|
10
10
|
spreadOptionalMessageFields,
|
|
11
11
|
stripPromptContextMessages
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NONI4CRP.js";
|
|
13
13
|
import {
|
|
14
14
|
getRuntimeConfig
|
|
15
15
|
} from "./chunk-CGZHLM3K.js";
|
|
@@ -367,7 +367,8 @@ var EventStore = class {
|
|
|
367
367
|
'mode.changed',
|
|
368
368
|
'phase.changed',
|
|
369
369
|
'todo.updated',
|
|
370
|
-
'context.state'
|
|
370
|
+
'context.state',
|
|
371
|
+
'metadata.set'
|
|
371
372
|
)
|
|
372
373
|
`
|
|
373
374
|
).run(sessionId, latestSnapshotSeq);
|
|
@@ -632,6 +633,7 @@ function createSession(projectId, workdir, title, providerId, providerModel) {
|
|
|
632
633
|
totalToolCalls: 0,
|
|
633
634
|
iterationCount: 0
|
|
634
635
|
},
|
|
636
|
+
metadataEntries: {},
|
|
635
637
|
dangerLevel
|
|
636
638
|
};
|
|
637
639
|
}
|
|
@@ -657,6 +659,7 @@ function getSession(id) {
|
|
|
657
659
|
totalToolCalls: row.total_tool_calls,
|
|
658
660
|
iterationCount: row.iteration_count
|
|
659
661
|
},
|
|
662
|
+
metadataEntries: {},
|
|
660
663
|
dangerLevel: row.danger_level ?? "normal"
|
|
661
664
|
};
|
|
662
665
|
}
|
|
@@ -1052,6 +1055,13 @@ function emitTodosUpdated(sessionId, todos) {
|
|
|
1052
1055
|
data: { todos }
|
|
1053
1056
|
});
|
|
1054
1057
|
}
|
|
1058
|
+
function emitMetadataSet(sessionId, key, entries) {
|
|
1059
|
+
const eventStore = getEventStore();
|
|
1060
|
+
eventStore.append(sessionId, {
|
|
1061
|
+
type: "metadata.set",
|
|
1062
|
+
data: { key, entries }
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1055
1065
|
function emitFileRead(sessionId, path, tokenCount, contextWindowId) {
|
|
1056
1066
|
const eventStore = getEventStore();
|
|
1057
1067
|
eventStore.append(sessionId, {
|
|
@@ -1257,6 +1267,7 @@ export {
|
|
|
1257
1267
|
emitCriteriaSet,
|
|
1258
1268
|
emitCriterionUpdated,
|
|
1259
1269
|
emitTodosUpdated,
|
|
1270
|
+
emitMetadataSet,
|
|
1260
1271
|
emitFileRead,
|
|
1261
1272
|
emitContextCompacted,
|
|
1262
1273
|
emitContextState,
|
|
@@ -1268,4 +1279,4 @@ export {
|
|
|
1268
1279
|
compactContext,
|
|
1269
1280
|
getRecentUserPromptsForSession
|
|
1270
1281
|
};
|
|
1271
|
-
//# sourceMappingURL=chunk-
|
|
1282
|
+
//# sourceMappingURL=chunk-XKR3HCAL.js.map
|
package/dist/cli/dev.js
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runCli
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-JZQ644DE.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "../chunk-K44MW7JJ.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/dev.ts
|
|
10
10
|
import { readFileSync } from "fs";
|
|
11
|
+
var MIN_HEAP_MB = 6144;
|
|
12
|
+
var DEFAULT_HEAP_MB = 8192;
|
|
13
|
+
function getCurrentHeapMB() {
|
|
14
|
+
const arg = process.execArgv.find((a) => a.startsWith("--max-old-space-size="));
|
|
15
|
+
if (arg) return Number.parseInt(arg.split("=")[1], 10);
|
|
16
|
+
const m = (process.env["NODE_OPTIONS"] ?? "").match(/--max-old-space-size=(\d+)/);
|
|
17
|
+
return m ? Number.parseInt(m[1], 10) : 0;
|
|
18
|
+
}
|
|
19
|
+
var currentHeap = getCurrentHeapMB();
|
|
20
|
+
if (currentHeap < MIN_HEAP_MB && !process.env["OPENFOX_HEAP_INCREASED"]) {
|
|
21
|
+
const { spawnSync } = await import("child_process");
|
|
22
|
+
const { totalmem } = await import("os");
|
|
23
|
+
const heapMB = Math.min(DEFAULT_HEAP_MB, Math.max(4096, Math.floor(totalmem() / (1024 * 1024) * 0.55)));
|
|
24
|
+
const env = { ...process.env, OPENFOX_HEAP_INCREASED: "1" };
|
|
25
|
+
const cleanNodeOptions = (env["NODE_OPTIONS"] ?? "").replace(/--max-old-space-size=\d+/g, "").trim();
|
|
26
|
+
env["NODE_OPTIONS"] = cleanNodeOptions || void 0;
|
|
27
|
+
const scriptPath = process.argv[1];
|
|
28
|
+
const result = spawnSync(
|
|
29
|
+
process.execPath,
|
|
30
|
+
["--max-old-space-size=" + heapMB, ...process.execArgv, scriptPath, ...process.argv.slice(2)],
|
|
31
|
+
{ stdio: "inherit", env }
|
|
32
|
+
);
|
|
33
|
+
process.exit(result.status ?? 0);
|
|
34
|
+
}
|
|
11
35
|
var mode = process.env["OPENFOX_MODE"] ?? "development";
|
|
12
36
|
var pkg = JSON.parse(readFileSync("./package.json", "utf-8"));
|
|
13
37
|
process.env["VERSION"] = pkg.version + "-dev";
|
package/dist/cli/index.js
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runCli
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-JZQ644DE.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "../chunk-K44MW7JJ.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/index.ts
|
|
10
|
+
var MIN_HEAP_MB = 6144;
|
|
11
|
+
var DEFAULT_HEAP_MB = 8192;
|
|
12
|
+
function getCurrentHeapMB() {
|
|
13
|
+
const arg = process.execArgv.find((a) => a.startsWith("--max-old-space-size="));
|
|
14
|
+
if (arg) return Number.parseInt(arg.split("=")[1], 10);
|
|
15
|
+
const m = (process.env["NODE_OPTIONS"] ?? "").match(/--max-old-space-size=(\d+)/);
|
|
16
|
+
return m ? Number.parseInt(m[1], 10) : 0;
|
|
17
|
+
}
|
|
18
|
+
var currentHeap = getCurrentHeapMB();
|
|
19
|
+
if (currentHeap < MIN_HEAP_MB && !process.env["OPENFOX_HEAP_INCREASED"]) {
|
|
20
|
+
const { spawnSync } = await import("child_process");
|
|
21
|
+
const { totalmem } = await import("os");
|
|
22
|
+
const heapMB = Math.min(DEFAULT_HEAP_MB, Math.max(4096, Math.floor(totalmem() / (1024 * 1024) * 0.55)));
|
|
23
|
+
const env = { ...process.env, OPENFOX_HEAP_INCREASED: "1" };
|
|
24
|
+
const cleanNodeOptions = (env["NODE_OPTIONS"] ?? "").replace(/--max-old-space-size=\d+/g, "").trim();
|
|
25
|
+
env["NODE_OPTIONS"] = cleanNodeOptions || void 0;
|
|
26
|
+
const scriptPath = process.argv[1];
|
|
27
|
+
const result = spawnSync(
|
|
28
|
+
process.execPath,
|
|
29
|
+
["--max-old-space-size=" + heapMB, ...process.execArgv, scriptPath, ...process.argv.slice(2)],
|
|
30
|
+
{ stdio: "inherit", env }
|
|
31
|
+
);
|
|
32
|
+
process.exit(result.status ?? 0);
|
|
33
|
+
}
|
|
10
34
|
var mode = process.env["OPENFOX_MODE"] ?? "production";
|
|
11
35
|
runCli({ mode }).catch((error) => {
|
|
12
36
|
logger.error("CLI fatal error", { error: error instanceof Error ? error.message : String(error) });
|
package/dist/cli/update.sh
CHANGED
|
@@ -10,9 +10,14 @@ if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
|
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
12
|
echo "Updating OpenFox: $CURRENT_VERSION -> $LATEST_VERSION"
|
|
13
|
-
openfox service stop
|
|
14
13
|
npm cache clean --force
|
|
15
14
|
npm update -g openfox
|
|
16
15
|
NEW_VERSION=$(openfox --version)
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
|
|
17
|
+
if [ "$1" = "--service" ]; then
|
|
18
|
+
echo "Restarting service..."
|
|
19
|
+
systemd-run --user --scope systemctl --user restart openfox
|
|
20
|
+
else
|
|
21
|
+
echo "Updated: $NEW_VERSION"
|
|
22
|
+
echo "Please restart OpenFox to use the new version."
|
|
23
|
+
fi
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
emitMessageDelta,
|
|
15
15
|
emitMessageDone,
|
|
16
16
|
emitMessageThinking,
|
|
17
|
+
emitMetadataSet,
|
|
17
18
|
emitModeChanged,
|
|
18
19
|
emitPhaseChanged,
|
|
19
20
|
emitRunningChanged,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
isStoredEvent,
|
|
38
39
|
isTurnEvent,
|
|
39
40
|
truncateSessionMessages
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XKR3HCAL.js";
|
|
41
42
|
import "./chunk-FBGWG4N6.js";
|
|
42
43
|
import {
|
|
43
44
|
buildContextMessagesFromEventHistory,
|
|
@@ -55,7 +56,7 @@ import {
|
|
|
55
56
|
foldTodos,
|
|
56
57
|
foldTurnEventsToSnapshotMessages,
|
|
57
58
|
getMessagesForWindow
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-NONI4CRP.js";
|
|
59
60
|
import "./chunk-CGZHLM3K.js";
|
|
60
61
|
import "./chunk-K44MW7JJ.js";
|
|
61
62
|
export {
|
|
@@ -80,6 +81,7 @@ export {
|
|
|
80
81
|
emitMessageDelta,
|
|
81
82
|
emitMessageDone,
|
|
82
83
|
emitMessageThinking,
|
|
84
|
+
emitMetadataSet,
|
|
83
85
|
emitModeChanged,
|
|
84
86
|
emitPhaseChanged,
|
|
85
87
|
emitRunningChanged,
|
|
@@ -113,4 +115,4 @@ export {
|
|
|
113
115
|
isTurnEvent,
|
|
114
116
|
truncateSessionMessages
|
|
115
117
|
};
|
|
116
|
-
//# sourceMappingURL=events-
|
|
118
|
+
//# sourceMappingURL=events-OHJWCI3S.js.map
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
foldContextState,
|
|
9
9
|
foldCriteria,
|
|
10
10
|
foldIsRunning,
|
|
11
|
+
foldMetadata,
|
|
11
12
|
foldMode,
|
|
12
13
|
foldPendingConfirmations,
|
|
13
14
|
foldPhase,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
handleToolResult,
|
|
23
24
|
spreadOptionalMessageFields,
|
|
24
25
|
stripOrphanedToolCalls
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NONI4CRP.js";
|
|
26
27
|
export {
|
|
27
28
|
buildContextMessagesFromEventHistory,
|
|
28
29
|
buildContextMessagesFromMessages,
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
foldContextState,
|
|
34
35
|
foldCriteria,
|
|
35
36
|
foldIsRunning,
|
|
37
|
+
foldMetadata,
|
|
36
38
|
foldMode,
|
|
37
39
|
foldPendingConfirmations,
|
|
38
40
|
foldPhase,
|
|
@@ -48,4 +50,4 @@ export {
|
|
|
48
50
|
spreadOptionalMessageFields,
|
|
49
51
|
stripOrphanedToolCalls
|
|
50
52
|
};
|
|
51
|
-
//# sourceMappingURL=folding-
|
|
53
|
+
//# sourceMappingURL=folding-U6UHQAS5.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn,
|
|
5
5
|
runVerifierTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UFY4I643.js";
|
|
7
7
|
import {
|
|
8
8
|
TurnMetrics,
|
|
9
9
|
createChatDoneEvent,
|
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
createMessageStartEvent,
|
|
12
12
|
createToolCallEvent,
|
|
13
13
|
createToolResultEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ALH4KM2Y.js";
|
|
15
15
|
import "./chunk-PSJIT5LZ.js";
|
|
16
16
|
import "./chunk-XAMAYRDA.js";
|
|
17
17
|
import "./chunk-DL6ZILAF.js";
|
|
18
18
|
import "./chunk-PBGOZMVY.js";
|
|
19
19
|
import "./chunk-VRGRAQDG.js";
|
|
20
20
|
import "./chunk-HGAMIPFO.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-XKR3HCAL.js";
|
|
22
22
|
import "./chunk-FBGWG4N6.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-NONI4CRP.js";
|
|
24
|
+
import "./chunk-CEZNMLOO.js";
|
|
25
25
|
import "./chunk-BJYPTN5S.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-FQLK5GL5.js";
|
|
27
27
|
import "./chunk-CQGTEGKL.js";
|
|
28
28
|
import "./chunk-CGZHLM3K.js";
|
|
29
29
|
import "./chunk-SZKEGZIB.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
runChatTurn,
|
|
41
41
|
runVerifierTurn
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=orchestrator-
|
|
43
|
+
//# sourceMappingURL=orchestrator-7ZXM4J22.js.map
|
package/dist/package.json
CHANGED
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QFSSKIQ3.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XKR3HCAL.js";
|
|
12
12
|
import "./chunk-FBGWG4N6.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-NONI4CRP.js";
|
|
14
14
|
import {
|
|
15
15
|
createChatMessageMessage,
|
|
16
16
|
createSessionRunningMessage
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-CEZNMLOO.js";
|
|
18
|
+
import "./chunk-FQLK5GL5.js";
|
|
19
19
|
import "./chunk-CGZHLM3K.js";
|
|
20
20
|
import {
|
|
21
21
|
logger
|
|
@@ -177,7 +177,7 @@ var QueueProcessor = class {
|
|
|
177
177
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
178
178
|
model: llmClient.getModel()
|
|
179
179
|
};
|
|
180
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
180
|
+
const { runChatTurn } = await import("./orchestrator-7ZXM4J22.js");
|
|
181
181
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
182
182
|
sessionManager,
|
|
183
183
|
sessionId,
|
|
@@ -221,4 +221,4 @@ var QueueProcessor = class {
|
|
|
221
221
|
export {
|
|
222
222
|
QueueProcessor
|
|
223
223
|
};
|
|
224
|
-
//# sourceMappingURL=processor-
|
|
224
|
+
//# sourceMappingURL=processor-TKBJLQ2N.js.map
|
|
@@ -28,6 +28,7 @@ interface Session {
|
|
|
28
28
|
contextWindows: ContextWindow[];
|
|
29
29
|
executionState: ExecutionState | null;
|
|
30
30
|
metadata: SessionMetadata;
|
|
31
|
+
metadataEntries: Record<string, MetadataEntry[]>;
|
|
31
32
|
dangerLevel?: DangerLevel;
|
|
32
33
|
messageCount?: number;
|
|
33
34
|
}
|
|
@@ -326,7 +327,7 @@ interface ToolResult {
|
|
|
326
327
|
};
|
|
327
328
|
metadata?: Record<string, unknown>;
|
|
328
329
|
}
|
|
329
|
-
type ToolName = 'read_file' | 'write_file' | 'edit_file' | 'run_command' | 'glob' | 'grep' | 'ask_user' | '
|
|
330
|
+
type ToolName = 'read_file' | 'write_file' | 'edit_file' | 'run_command' | 'glob' | 'grep' | 'ask_user' | 'session_metadata' | 'web_fetch';
|
|
330
331
|
interface Criterion {
|
|
331
332
|
id: string;
|
|
332
333
|
description: string;
|
|
@@ -360,6 +361,12 @@ interface Todo {
|
|
|
360
361
|
content: string;
|
|
361
362
|
status: 'pending' | 'in_progress' | 'completed';
|
|
362
363
|
}
|
|
364
|
+
interface MetadataEntry {
|
|
365
|
+
id: string;
|
|
366
|
+
description: string;
|
|
367
|
+
status: string;
|
|
368
|
+
[key: string]: unknown;
|
|
369
|
+
}
|
|
363
370
|
interface FileReadEntry {
|
|
364
371
|
hash: string;
|
|
365
372
|
readAt: string;
|
|
@@ -532,7 +539,7 @@ interface QueuedMessage {
|
|
|
532
539
|
queuedAt: string;
|
|
533
540
|
messageKind?: string;
|
|
534
541
|
}
|
|
535
|
-
type ServerMessageType = 'project.state' | 'project.list' | 'project.deleted' | 'session.state' | 'session.list' | 'session.deleted' | 'session.deletedAll' | 'session.running' | 'session.name_generated' | 'chat.delta' | 'chat.thinking' | 'chat.tool_preparing' | 'chat.tool_call' | 'chat.tool_output' | 'chat.tool_result' | 'chat.todo' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.vision_fallback' | 'chat.error' | 'chat.path_confirmation' | 'chat.ask_user' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'devServer.output' | 'devServer.state' | 'backgroundProcess.started' | 'backgroundProcess.output' | 'backgroundProcess.exited' | 'backgroundProcess.removed' | 'git.status' | 'lsp.diagnostics' | 'error' | 'ack';
|
|
542
|
+
type ServerMessageType = 'project.state' | 'project.list' | 'project.deleted' | 'session.state' | 'session.list' | 'session.deleted' | 'session.deletedAll' | 'session.running' | 'session.name_generated' | 'chat.delta' | 'chat.thinking' | 'chat.tool_preparing' | 'chat.tool_call' | 'chat.tool_output' | 'chat.tool_result' | 'chat.todo' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.vision_fallback' | 'chat.error' | 'chat.path_confirmation' | 'chat.ask_user' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'metadata.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'devServer.output' | 'devServer.state' | 'backgroundProcess.started' | 'backgroundProcess.output' | 'backgroundProcess.exited' | 'backgroundProcess.removed' | 'git.status' | 'lsp.diagnostics' | 'error' | 'ack';
|
|
536
543
|
interface ServerMessage<T = unknown> {
|
|
537
544
|
id?: string;
|
|
538
545
|
type: ServerMessageType;
|
|
@@ -695,6 +702,10 @@ interface CriteriaUpdatedPayload {
|
|
|
695
702
|
criteria: Criterion[];
|
|
696
703
|
changedId?: string;
|
|
697
704
|
}
|
|
705
|
+
interface MetadataUpdatedPayload {
|
|
706
|
+
key: string;
|
|
707
|
+
entries: MetadataEntry[];
|
|
708
|
+
}
|
|
698
709
|
interface ContextStatePayload {
|
|
699
710
|
context: ContextState;
|
|
700
711
|
subAgentId?: string;
|
|
@@ -865,4 +876,4 @@ interface QueueCancelledEvent {
|
|
|
865
876
|
}
|
|
866
877
|
type QueueEvent = QueueAddedEvent | QueueDrainedEvent | QueueCancelledEvent;
|
|
867
878
|
|
|
868
|
-
export { type GitStatusPayload as $, type AgentEvent as A, type BackgroundProcess as B, type CallStatsDataPoint as C, type Config as D, type ContextCompactionEvent as E, type ContextState as F, type ContextStatePayload as G, type ContextWindow as H, type CriteriaUpdatedPayload as I, type Criterion as J, type CriterionAttempt as K, type CriterionStatus as L, type Message as M, type CriterionValidation as N, type DangerLevel as O, type DevServerOutputPayload as P, type DevServerStatePayload as Q, type Diagnostic as R, type SessionStats as S, type EditContextEdit as T, type EditContextLine as U, type EditContextRegion as V, type ElementData as W, type ErrorPayload as X, type ExecutionState as Y, type FileReadEntry as Z, type GitDiffFile as _, type AskAnswerPayload as a, type InjectedFile as a0, type LLMCallStats as a1, type LlmBackend as a2, type LogLine as a3, type LspDiagnosticsPayload as a4, type MessageRole as a5, type MessageSegment as a6, type MessageStats as a7, type
|
|
879
|
+
export { type GitStatusPayload as $, type AgentEvent as A, type BackgroundProcess as B, type CallStatsDataPoint as C, type Config as D, type ContextCompactionEvent as E, type ContextState as F, type ContextStatePayload as G, type ContextWindow as H, type CriteriaUpdatedPayload as I, type Criterion as J, type CriterionAttempt as K, type CriterionStatus as L, type Message as M, type CriterionValidation as N, type DangerLevel as O, type DevServerOutputPayload as P, type DevServerStatePayload as Q, type Diagnostic as R, type SessionStats as S, type EditContextEdit as T, type EditContextLine as U, type EditContextRegion as V, type ElementData as W, type ErrorPayload as X, type ExecutionState as Y, type FileReadEntry as Z, type GitDiffFile as _, type AskAnswerPayload as a, type InjectedFile as a0, type LLMCallStats as a1, type LlmBackend as a2, type LogLine as a3, type LspDiagnosticsPayload as a4, type MessageRole as a5, type MessageSegment as a6, type MessageStats as a7, type MetadataEntry as a8, type MetadataUpdatedPayload as a9, type RecentUserPrompt as aA, type ServerMessage as aB, type ServerMessageType as aC, type Session as aD, type SessionListPayload as aE, type SessionLoadPayload as aF, type SessionMetadata as aG, type SessionMode as aH, type SessionNameGeneratedPayload as aI, type SessionPhase as aJ, type SessionRunningPayload as aK, type SessionStatePayload as aL, type SessionSummary as aM, type StatsDataPoint as aN, type StatsIdentity as aO, type TaskCompletedPayload as aP, type Todo as aQ, type ToolCall as aR, type ToolMode as aS, type ToolName as aT, type ToolResult as aU, type ValidationResult as aV, createClientMessage as aW, createServerMessage as aX, isClientMessage as aY, isServerMessage as aZ, type ModeChangedPayload as aa, type ModelConfig as ab, type ModelSessionStats as ac, type PathConfirmPayload as ad, type PathConfirmationReason as ae, type PendingPathConfirmationPayload as af, type PhaseChangedPayload as ag, type PreparingToolCall as ah, type Project as ai, type ProjectDeletedPayload as aj, type ProjectListPayload as ak, type ProjectStatePayload as al, type PromptContext as am, type PromptContextMessage as an, type PromptContextTool as ao, type PromptRequestOptions as ap, type Provider as aq, type ProviderBackend as ar, type ProviderChangedPayload as as, type QueueAddedEvent as at, type QueueCancelledEvent as au, type QueueDrainedEvent as av, type QueueEvent as aw, type QueueEventType as ax, type QueueStatePayload as ay, type QueuedMessage as az, type AskUserEvent as b, type Attachment as c, type BackgroundProcessExitedPayload as d, type BackgroundProcessOutputPayload as e, type BackgroundProcessRemovedPayload as f, type BackgroundProcessStartedPayload as g, type BackgroundProcessStatus as h, type ChatAskUserPayload as i, type ChatDeltaPayload as j, type ChatDonePayload as k, type ChatErrorPayload as l, type ChatFormatRetryPayload as m, type ChatMessagePayload as n, type ChatMessageUpdatedPayload as o, type ChatPathConfirmationPayload as p, type ChatProgressPayload as q, type ChatThinkingPayload as r, type ChatTodoPayload as s, type ChatToolCallPayload as t, type ChatToolOutputPayload as u, type ChatToolPreparingPayload as v, type ChatToolResultPayload as w, type ChatVisionFallbackPayload as x, type ClientMessage as y, type ClientMessageType as z };
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
createCriteriaUpdatedMessage,
|
|
20
20
|
createErrorMessage,
|
|
21
21
|
createGitStatusMessage,
|
|
22
|
+
createMetadataUpdatedMessage,
|
|
22
23
|
createModeChangedMessage,
|
|
23
24
|
createPhaseChangedMessage,
|
|
24
25
|
createProjectListMessage,
|
|
@@ -35,8 +36,8 @@ import {
|
|
|
35
36
|
parseClientMessage,
|
|
36
37
|
serializeServerMessage,
|
|
37
38
|
storedEventToServerMessage
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
39
|
+
} from "./chunk-CEZNMLOO.js";
|
|
40
|
+
import "./chunk-FQLK5GL5.js";
|
|
40
41
|
export {
|
|
41
42
|
createChatAskUserMessage,
|
|
42
43
|
createChatDeltaMessage,
|
|
@@ -58,6 +59,7 @@ export {
|
|
|
58
59
|
createCriteriaUpdatedMessage,
|
|
59
60
|
createErrorMessage,
|
|
60
61
|
createGitStatusMessage,
|
|
62
|
+
createMetadataUpdatedMessage,
|
|
61
63
|
createModeChangedMessage,
|
|
62
64
|
createPhaseChangedMessage,
|
|
63
65
|
createProjectListMessage,
|
|
@@ -75,4 +77,4 @@ export {
|
|
|
75
77
|
serializeServerMessage,
|
|
76
78
|
storedEventToServerMessage
|
|
77
79
|
};
|
|
78
|
-
//# sourceMappingURL=protocol-
|
|
80
|
+
//# sourceMappingURL=protocol-K62EPEGS.js.map
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
createServer
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-CTQ2FS4K.js";
|
|
10
|
+
import "./chunk-UFY4I643.js";
|
|
11
|
+
import "./chunk-ALH4KM2Y.js";
|
|
12
12
|
import "./chunk-PSJIT5LZ.js";
|
|
13
13
|
import "./chunk-XAMAYRDA.js";
|
|
14
14
|
import "./chunk-DL6ZILAF.js";
|
|
@@ -17,13 +17,13 @@ import "./chunk-VRGRAQDG.js";
|
|
|
17
17
|
import "./chunk-RF2JGDSS.js";
|
|
18
18
|
import "./chunk-HHAJ3QF6.js";
|
|
19
19
|
import "./chunk-HGAMIPFO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-XKR3HCAL.js";
|
|
21
21
|
import "./chunk-FBGWG4N6.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-NONI4CRP.js";
|
|
23
|
+
import "./chunk-CEZNMLOO.js";
|
|
24
24
|
import "./chunk-BJYPTN5S.js";
|
|
25
25
|
import "./chunk-VUQCQXXJ.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-FQLK5GL5.js";
|
|
27
27
|
import {
|
|
28
28
|
ensureDataDirExists,
|
|
29
29
|
getDatabasePath,
|
|
@@ -190,4 +190,4 @@ async function runServe(options) {
|
|
|
190
190
|
export {
|
|
191
191
|
runServe
|
|
192
192
|
};
|
|
193
|
-
//# sourceMappingURL=serve-
|
|
193
|
+
//# sourceMappingURL=serve-FGPHMDOC.js.map
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aR as ToolCall, c as Attachment, R as Diagnostic, aq as Provider, ab as ModelConfig, aD as Session, aM as SessionSummary, ai as Project, aH as SessionMode, aJ as SessionPhase, M as Message, J as Criterion, L as CriterionStatus, a8 as MetadataEntry, az as QueuedMessage, F as ContextState, O as DangerLevel$1, aB as ServerMessage, aO as StatsIdentity, aU as ToolResult, D as Config } from '../protocol-BQ12Aw5J.js';
|
|
2
2
|
import { Server } from 'node:http';
|
|
3
3
|
|
|
4
4
|
interface LLMMessage {
|
|
@@ -265,6 +265,11 @@ type SessionEvent = {
|
|
|
265
265
|
type: 'criteria_updated';
|
|
266
266
|
sessionId: string;
|
|
267
267
|
criteria: Criterion[];
|
|
268
|
+
} | {
|
|
269
|
+
type: 'metadata_updated';
|
|
270
|
+
sessionId: string;
|
|
271
|
+
key: string;
|
|
272
|
+
entries: MetadataEntry[];
|
|
268
273
|
} | {
|
|
269
274
|
type: 'message_added';
|
|
270
275
|
sessionId: string;
|
|
@@ -436,6 +441,7 @@ declare class SessionManager {
|
|
|
436
441
|
* Remove a criterion.
|
|
437
442
|
*/
|
|
438
443
|
removeCriterion(sessionId: string, criterionId: string): Criterion[];
|
|
444
|
+
setMetadataEntries(sessionId: string, key: string, entries: MetadataEntry[]): void;
|
|
439
445
|
private messageQueues;
|
|
440
446
|
queueMessage(sessionId: string, mode: 'asap' | 'completion', content: string, attachments?: Attachment[], messageKind?: string): QueuedMessage;
|
|
441
447
|
cancelQueuedMessage(sessionId: string, queueId: string): boolean;
|