@surething/cockpit 1.0.284 → 1.0.286
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +2 -2
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/cockpit-build.json +1 -1
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/bots/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/bots/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/stop/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/balance/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/fs/dirs/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/blob/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/current-branch/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/glm/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/glm/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/glm/usage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/html-apps/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/instructions/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/kimi/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/kimi/usage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/default-model/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/output-styles/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/restart/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/turn/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/turn/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/user-messages/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/delegate/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/snapshots/blob/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/snapshots/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/snapshots/range-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/snapshots/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/running/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/update/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/update-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/apps/[...path]/route.js.nft.json +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/m/page.js +1 -1
- package/.next-prod/server/app/m/page.js.nft.json +1 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +1 -1
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +2 -2
- package/.next-prod/server/chunks/2493.js +4 -4
- package/.next-prod/server/chunks/7438.js +14 -14
- package/.next-prod/server/chunks/{5591.js → 8647.js} +7 -7
- package/.next-prod/server/chunks/9830.js +1 -1
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/{2550-eb5beeffe90c8632.js → 2550-d42d8fc88c0cec98.js} +21 -21
- package/.next-prod/static/chunks/{3919-aceb512341847e1c.js → 4731-3b3290b5ec84f6bd.js} +11 -11
- package/.next-prod/static/chunks/{5313-da9f9a2ce9c5ba34.js → 5313-d734a6541498a6db.js} +7 -7
- package/.next-prod/static/chunks/app/{layout-64ed9873820de627.js → layout-26d284da8922060a.js} +1 -1
- package/.next-prod/static/chunks/app/m/{page-a60ec971bab91969.js → page-6a86aa4f5ebeebfd.js} +1 -1
- package/.next-prod/static/chunks/app/{page-acbb0b783e63d133.js → page-88b01c311b11942a.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-acbb0b783e63d133.js → page-88b01c311b11942a.js} +1 -1
- package/.next-prod/trace +14 -14
- package/.next-prod/trace-build +1 -1
- package/dist/{chunk-2KRJ7JEJ.mjs → chunk-2UCBL4S6.mjs} +1 -1
- package/dist/{chunk-FP25USWW.mjs → chunk-G6BCSLZX.mjs} +148 -38
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +65 -12
- package/dist/wsServer.mjs +4 -4
- package/package.json +5 -3
- package/public/html-lib/markdown.js +85 -85
- /package/.next-prod/static/{qXlYDVAyeD8v5tCOCGbXD → cwGvPiCgQI4epB2d3stR2}/_buildManifest.js +0 -0
- /package/.next-prod/static/{qXlYDVAyeD8v5tCOCGbXD → cwGvPiCgQI4epB2d3stR2}/_ssgManifest.js +0 -0
package/.next-prod/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":12826826,"timestamp":129624917,"id":14,"parentId":1,"tags":{},"startTime":1792381429183,"traceId":"baab9b936b003462"},{"name":"run-typescript","duration":3541939,"timestamp":142454875,"id":1445,"parentId":1,"tags":{},"startTime":1792381442012,"traceId":"baab9b936b003462"},{"name":"static-check","duration":868165,"timestamp":146027696,"id":1448,"parentId":1,"tags":{},"startTime":1792381445585,"traceId":"baab9b936b003462"},{"name":"static-generation","duration":3802649,"timestamp":146956980,"id":1760,"parentId":1,"tags":{},"startTime":1792381446515,"traceId":"baab9b936b003462"},{"name":"collect-build-traces","duration":15934871,"timestamp":146896484,"id":1757,"parentId":1,"tags":{},"startTime":1792381446454,"traceId":"baab9b936b003462"},{"name":"telemetry-flush","duration":36,"timestamp":162833956,"id":1769,"parentId":1,"tags":{},"startTime":1792381462392,"traceId":"baab9b936b003462"},{"name":"next-build","duration":33609242,"timestamp":129224770,"id":1,"tags":{"buildMode":"default","version":"16.3.0","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1792381428782,"traceId":"baab9b936b003462"}]
|
|
@@ -29067,7 +29067,7 @@ function getUsageUpdateOutputTokens(message) {
|
|
|
29067
29067
|
const outputTokens = message.output_tokens;
|
|
29068
29068
|
return typeof outputTokens === "number" && Number.isFinite(outputTokens) ? Math.max(0, Math.round(outputTokens)) : null;
|
|
29069
29069
|
}
|
|
29070
|
-
function startRun(key, cwd, promptText, runId, engine) {
|
|
29070
|
+
function startRun(key, cwd, promptText, runId, engine, images) {
|
|
29071
29071
|
const prev = registry.get(key);
|
|
29072
29072
|
if (prev?.status === "running" || prev?.writer || edits.has(key)) return false;
|
|
29073
29073
|
const prevSeq = prev?.seq ?? seqByKey.get(key) ?? 0;
|
|
@@ -29094,13 +29094,14 @@ function startRun(key, cwd, promptText, runId, engine) {
|
|
|
29094
29094
|
...engine ? { engine } : {},
|
|
29095
29095
|
updatedAt: startedAt
|
|
29096
29096
|
});
|
|
29097
|
-
if (promptText) {
|
|
29097
|
+
if (promptText || images?.length) {
|
|
29098
29098
|
appendRun(key, {
|
|
29099
29099
|
type: "user",
|
|
29100
29100
|
_human: true,
|
|
29101
29101
|
...runId ? { _turnId: runId } : {},
|
|
29102
29102
|
_ts: startedAt,
|
|
29103
|
-
message: { role: "user", content: promptText }
|
|
29103
|
+
message: { role: "user", content: promptText ?? "" },
|
|
29104
|
+
...images?.length ? { _images: images } : {}
|
|
29104
29105
|
});
|
|
29105
29106
|
}
|
|
29106
29107
|
return true;
|
|
@@ -29193,6 +29194,29 @@ function getRunInfo(key) {
|
|
|
29193
29194
|
if (!r) return null;
|
|
29194
29195
|
return { cwd: r.cwd, sessionId: r.sessionId ?? null, engine: r.engine ?? null };
|
|
29195
29196
|
}
|
|
29197
|
+
function setRunInjector(key, injector) {
|
|
29198
|
+
const r = registry.get(key);
|
|
29199
|
+
if (!r) return;
|
|
29200
|
+
if (injector) r.injector = injector;
|
|
29201
|
+
else delete r.injector;
|
|
29202
|
+
}
|
|
29203
|
+
function injectRun(key, input, runId) {
|
|
29204
|
+
const r = registry.get(key);
|
|
29205
|
+
if (!r || r.status !== "running") return "idle";
|
|
29206
|
+
if (!r.injector) return "unsupported";
|
|
29207
|
+
if (!r.injector(input)) return "closed";
|
|
29208
|
+
appendRun(key, {
|
|
29209
|
+
type: "user",
|
|
29210
|
+
_human: true,
|
|
29211
|
+
_turnId: runId,
|
|
29212
|
+
_ts: Date.now(),
|
|
29213
|
+
message: { role: "user", content: input.text ?? "" },
|
|
29214
|
+
// Side-band rather than content blocks, so every reader that takes `content` as the
|
|
29215
|
+
// prompt text keeps working; the bubble shows them next to the text.
|
|
29216
|
+
...input.images?.length ? { _images: input.images } : {}
|
|
29217
|
+
});
|
|
29218
|
+
return "ok";
|
|
29219
|
+
}
|
|
29196
29220
|
function setRunAbort(key, abort) {
|
|
29197
29221
|
const r = registry.get(key);
|
|
29198
29222
|
if (r) r.abort = abort;
|
|
@@ -32044,6 +32068,18 @@ function isHumanTurnStart(entry) {
|
|
|
32044
32068
|
if (!Array.isArray(content)) return false;
|
|
32045
32069
|
return content.some((block) => block?.type === "text");
|
|
32046
32070
|
}
|
|
32071
|
+
function queuedPromptAsUserEntry(entry) {
|
|
32072
|
+
const a = entry.attachment;
|
|
32073
|
+
if (entry.type !== "attachment" || a?.type !== "queued_command" || a.commandMode !== "prompt") return null;
|
|
32074
|
+
if (!(typeof a.prompt === "string" || Array.isArray(a.prompt)) || a.prompt.length === 0) return null;
|
|
32075
|
+
return {
|
|
32076
|
+
type: "user",
|
|
32077
|
+
uuid: entry.uuid,
|
|
32078
|
+
timestamp: entry.timestamp ?? a.timestamp,
|
|
32079
|
+
sessionId: entry.sessionId,
|
|
32080
|
+
message: { role: "user", content: a.prompt }
|
|
32081
|
+
};
|
|
32082
|
+
}
|
|
32047
32083
|
|
|
32048
32084
|
// packages/feature/agent/src/shared/subagentTask.ts
|
|
32049
32085
|
var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "stopped"]);
|
|
@@ -32743,7 +32779,8 @@ async function parseTranscriptFile(filePath, page = {}) {
|
|
|
32743
32779
|
let lastUsage;
|
|
32744
32780
|
for await (const line of rl) {
|
|
32745
32781
|
try {
|
|
32746
|
-
const
|
|
32782
|
+
const parsed = JSON.parse(line);
|
|
32783
|
+
const obj = queuedPromptAsUserEntry(parsed) ?? parsed;
|
|
32747
32784
|
if (obj.type === "user" || obj.type === "assistant") {
|
|
32748
32785
|
if (obj.type === "user" && rawMessages.length > 0) {
|
|
32749
32786
|
const prev = rawMessages[rawMessages.length - 1];
|
|
@@ -33565,10 +33602,11 @@ var SessionSearchServiceLive = Layer_exports.effect(
|
|
|
33565
33602
|
// packages/feature/agent/src/effect/delegationLive.ts
|
|
33566
33603
|
import { open as open2, stat as stat6 } from "fs/promises";
|
|
33567
33604
|
import { basename as basename4, isAbsolute as isAbsolute3 } from "path";
|
|
33568
|
-
import { randomUUID as
|
|
33605
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
33569
33606
|
|
|
33570
33607
|
// packages/feature/agent/src/server/engines/shared/sdkLoop.ts
|
|
33571
33608
|
import { query as query2 } from "@anthropic-ai/claude-agent-sdk";
|
|
33609
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
33572
33610
|
var CHILD_EXIT_TIMEOUT_MS = 5e3;
|
|
33573
33611
|
async function waitForSdkChildExit(response, timeoutMs = CHILD_EXIT_TIMEOUT_MS) {
|
|
33574
33612
|
const transport = response?.transport;
|
|
@@ -33587,6 +33625,7 @@ async function waitForSdkChildExit(response, timeoutMs = CHILD_EXIT_TIMEOUT_MS)
|
|
|
33587
33625
|
clearTimeout(timer);
|
|
33588
33626
|
}
|
|
33589
33627
|
var MAX_COMPACTION_RETRIES = 1;
|
|
33628
|
+
var MAX_RESULTS_BEFORE_START = 3;
|
|
33590
33629
|
var STDERR_LOG_BUDGET_BYTES = 1e4;
|
|
33591
33630
|
function makeStderrForwarder() {
|
|
33592
33631
|
let spent = 0;
|
|
@@ -33605,23 +33644,28 @@ function follow(ctx) {
|
|
|
33605
33644
|
return ac;
|
|
33606
33645
|
}
|
|
33607
33646
|
async function runSdkLoop(ctx, buildOptions2) {
|
|
33608
|
-
const
|
|
33609
|
-
const content = [];
|
|
33610
|
-
if (ctx.images) {
|
|
33611
|
-
for (const img of ctx.images) {
|
|
33612
|
-
content.push({ type: "image", source: { type: "base64", media_type: img.media_type, data: img.data } });
|
|
33613
|
-
}
|
|
33614
|
-
}
|
|
33615
|
-
if (ctx.prompt) content.push({ type: "text", text: ctx.prompt });
|
|
33616
|
-
const firstContent = hasImages ? content : ctx.prompt ?? "";
|
|
33647
|
+
const firstContent = userContent(ctx.prompt, ctx.images);
|
|
33617
33648
|
const pendingTasks = /* @__PURE__ */ new Set();
|
|
33649
|
+
const awaitingStart = /* @__PURE__ */ new Set();
|
|
33650
|
+
let resultsSinceStart = 0;
|
|
33651
|
+
let turnActive = false;
|
|
33618
33652
|
let closeInput = () => {
|
|
33619
33653
|
};
|
|
33654
|
+
let gateClosed = false;
|
|
33620
33655
|
if (!ctx.signal.aborted) {
|
|
33621
33656
|
ctx.signal.addEventListener("abort", () => closeInput(), { once: true });
|
|
33622
33657
|
}
|
|
33658
|
+
const injected = [];
|
|
33659
|
+
let wakeInput = () => {
|
|
33660
|
+
};
|
|
33661
|
+
ctx.acceptInput((input) => {
|
|
33662
|
+
if (gateClosed || ctx.signal.aborted) return false;
|
|
33663
|
+
injected.push({ content: userContent(input.text, input.images) });
|
|
33664
|
+
wakeInput();
|
|
33665
|
+
return true;
|
|
33666
|
+
});
|
|
33623
33667
|
for (let attempt = 0; attempt <= MAX_COMPACTION_RETRIES; attempt++) {
|
|
33624
|
-
|
|
33668
|
+
gateClosed = false;
|
|
33625
33669
|
const gateOpen = new Promise((resolve3) => {
|
|
33626
33670
|
closeInput = () => {
|
|
33627
33671
|
if (!gateClosed) {
|
|
@@ -33632,8 +33676,13 @@ async function runSdkLoop(ctx, buildOptions2) {
|
|
|
33632
33676
|
});
|
|
33633
33677
|
if (ctx.signal.aborted) closeInput();
|
|
33634
33678
|
const isRetry2 = attempt > 0;
|
|
33679
|
+
const firstUuid = randomUUID3();
|
|
33680
|
+
awaitingStart.clear();
|
|
33681
|
+
resultsSinceStart = 0;
|
|
33682
|
+
awaitingStart.add(firstUuid);
|
|
33635
33683
|
const firstYield = {
|
|
33636
33684
|
type: "user",
|
|
33685
|
+
uuid: firstUuid,
|
|
33637
33686
|
// A compaction retry resumes the same session with 'continue'; the first attempt sends the
|
|
33638
33687
|
// user turn (text ∪ images).
|
|
33639
33688
|
message: { role: "user", content: isRetry2 ? "continue" : firstContent },
|
|
@@ -33642,7 +33691,25 @@ async function runSdkLoop(ctx, buildOptions2) {
|
|
|
33642
33691
|
};
|
|
33643
33692
|
const input = (async function* () {
|
|
33644
33693
|
yield firstYield;
|
|
33645
|
-
|
|
33694
|
+
for (; ; ) {
|
|
33695
|
+
for (let next4 = injected.shift(); next4; next4 = injected.shift()) {
|
|
33696
|
+
const uuid3 = randomUUID3();
|
|
33697
|
+
if (!turnActive) awaitingStart.add(uuid3);
|
|
33698
|
+
yield {
|
|
33699
|
+
type: "user",
|
|
33700
|
+
uuid: uuid3,
|
|
33701
|
+
message: { role: "user", content: next4.content },
|
|
33702
|
+
parent_tool_use_id: null,
|
|
33703
|
+
session_id: ctx.currentKey(),
|
|
33704
|
+
priority: "next"
|
|
33705
|
+
};
|
|
33706
|
+
}
|
|
33707
|
+
if (gateClosed) return;
|
|
33708
|
+
await new Promise((resolve3) => {
|
|
33709
|
+
wakeInput = resolve3;
|
|
33710
|
+
void gateOpen.then(resolve3);
|
|
33711
|
+
});
|
|
33712
|
+
}
|
|
33646
33713
|
})();
|
|
33647
33714
|
const attemptAbort = follow(ctx);
|
|
33648
33715
|
const resume2 = isRetry2 ? ctx.currentKey() : ctx.sessionId;
|
|
@@ -33656,6 +33723,10 @@ async function runSdkLoop(ctx, buildOptions2) {
|
|
|
33656
33723
|
break;
|
|
33657
33724
|
}
|
|
33658
33725
|
const msg = message;
|
|
33726
|
+
if (msg.type === "system" && msg.subtype === "init") turnActive = true;
|
|
33727
|
+
for (const uuid3 of msg.user_message_uuids ?? (msg.user_message_uuid ? [msg.user_message_uuid] : [])) {
|
|
33728
|
+
if (awaitingStart.delete(uuid3)) resultsSinceStart = 0;
|
|
33729
|
+
}
|
|
33659
33730
|
if (msg.type === "system" && msg.subtype === "init" && msg.session_id) {
|
|
33660
33731
|
ctx.rekey(msg.session_id);
|
|
33661
33732
|
}
|
|
@@ -33669,14 +33740,28 @@ async function runSdkLoop(ctx, buildOptions2) {
|
|
|
33669
33740
|
if (msg.type === "system" && msg.subtype === "task_notification" && msg.task_id) {
|
|
33670
33741
|
pendingTasks.delete(msg.task_id);
|
|
33671
33742
|
}
|
|
33672
|
-
if (msg.type === "result")
|
|
33743
|
+
if (msg.type === "result") {
|
|
33744
|
+
receivedResult = true;
|
|
33745
|
+
turnActive = false;
|
|
33746
|
+
if (awaitingStart.size > 0 && ++resultsSinceStart >= MAX_RESULTS_BEFORE_START) awaitingStart.clear();
|
|
33747
|
+
}
|
|
33673
33748
|
ctx.emit(message);
|
|
33674
|
-
if (msg.type === "result" && pendingTasks.size === 0) closeInput();
|
|
33749
|
+
if (msg.type === "result" && pendingTasks.size === 0 && awaitingStart.size === 0) closeInput();
|
|
33675
33750
|
}
|
|
33676
33751
|
closeInput();
|
|
33677
33752
|
await waitForSdkChildExit(response);
|
|
33678
33753
|
if (receivedResult || ctx.signal.aborted) break;
|
|
33679
33754
|
}
|
|
33755
|
+
ctx.acceptInput(null);
|
|
33756
|
+
}
|
|
33757
|
+
function userContent(text, images) {
|
|
33758
|
+
if (!images || images.length === 0) return text ?? "";
|
|
33759
|
+
const content = images.map((img) => ({
|
|
33760
|
+
type: "image",
|
|
33761
|
+
source: { type: "base64", media_type: img.media_type, data: img.data }
|
|
33762
|
+
}));
|
|
33763
|
+
if (text) content.push({ type: "text", text });
|
|
33764
|
+
return content;
|
|
33680
33765
|
}
|
|
33681
33766
|
|
|
33682
33767
|
// packages/feature/agent/src/server/engines/shared/noHistoryTranscript.ts
|
|
@@ -33893,6 +33978,11 @@ function buildClaudeOptions(ctx, independent) {
|
|
|
33893
33978
|
canUseTool: async (toolName, input, opts) => planPermission(toolName, input, opts)
|
|
33894
33979
|
},
|
|
33895
33980
|
includePartialMessages: true,
|
|
33981
|
+
// Predicted next user prompt, shown as the composer's placeholder. The CLI emits one
|
|
33982
|
+
// `prompt_suggestion` after the turn's `result` and still delivers it when the input closes
|
|
33983
|
+
// on that result (sdkLoop), so nothing downstream waits for it. Suppressed by the CLI on a
|
|
33984
|
+
// session's first turn, in plan mode, and when the user disabled it in settings.json.
|
|
33985
|
+
promptSuggestions: true,
|
|
33896
33986
|
abortController: abort,
|
|
33897
33987
|
// env is ALWAYS passed: without it the SDK inherits process.env verbatim,
|
|
33898
33988
|
// handing the agent this server's NODE_ENV=production. See sanitizedSpawnEnv.
|
|
@@ -33943,7 +34033,7 @@ var glmApiKey = createApiKeyStore(GLM_CREDENTIALS_FILE);
|
|
|
33943
34033
|
|
|
33944
34034
|
// packages/feature/agent/src/server/engines/builtinAgent/index.ts
|
|
33945
34035
|
import { streamText as streamText2, stepCountIs } from "ai";
|
|
33946
|
-
import { randomUUID as
|
|
34036
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
33947
34037
|
|
|
33948
34038
|
// packages/feature/agent/src/server/engines/builtinAgent/prompt.ts
|
|
33949
34039
|
function buildSystemPrompt(cwd, outputStyle) {
|
|
@@ -48513,7 +48603,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48513
48603
|
const noHistory = ctx.params.noHistory === true;
|
|
48514
48604
|
const existing = noHistory ? [] : readSessionMessages(sessionsRoot, cwd, sid);
|
|
48515
48605
|
const messages = [...existing, { role: "user", content: prompt }];
|
|
48516
|
-
appendUserText(sessionsRoot, cwd, sid, prompt, { uuid:
|
|
48606
|
+
appendUserText(sessionsRoot, cwd, sid, prompt, { uuid: randomUUID4(), timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
48517
48607
|
emit2(`data: ${JSON.stringify({ type: "system", subtype: "init", session_id: sid })}
|
|
48518
48608
|
|
|
48519
48609
|
`);
|
|
@@ -48543,7 +48633,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48543
48633
|
for (const [toolUseId] of pendingToolCalls) {
|
|
48544
48634
|
try {
|
|
48545
48635
|
appendToolResult(sessionsRoot, cwd, sid, toolUseId, reason, {
|
|
48546
|
-
uuid:
|
|
48636
|
+
uuid: randomUUID4(),
|
|
48547
48637
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
48548
48638
|
is_error: true
|
|
48549
48639
|
});
|
|
@@ -48577,7 +48667,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48577
48667
|
cwd,
|
|
48578
48668
|
sid,
|
|
48579
48669
|
[{ type: "tool_use", id: toolUseId, name: toolName, input }],
|
|
48580
|
-
{ uuid:
|
|
48670
|
+
{ uuid: randomUUID4(), timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
48581
48671
|
);
|
|
48582
48672
|
} catch {
|
|
48583
48673
|
}
|
|
@@ -48586,7 +48676,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48586
48676
|
try {
|
|
48587
48677
|
pendingToolCalls.delete(toolUseId);
|
|
48588
48678
|
appendToolResult(sessionsRoot, cwd, sid, toolUseId, content, {
|
|
48589
|
-
uuid:
|
|
48679
|
+
uuid: randomUUID4(),
|
|
48590
48680
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
48591
48681
|
is_error: Boolean(isError)
|
|
48592
48682
|
});
|
|
@@ -48596,7 +48686,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48596
48686
|
onTextFlush: (flushedText) => {
|
|
48597
48687
|
try {
|
|
48598
48688
|
appendAssistantMessage(sessionsRoot, cwd, sid, [{ type: "text", text: flushedText }], {
|
|
48599
|
-
uuid:
|
|
48689
|
+
uuid: randomUUID4(),
|
|
48600
48690
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
48601
48691
|
});
|
|
48602
48692
|
} catch {
|
|
@@ -48608,7 +48698,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48608
48698
|
emitResultMessage(usage.inputTokens || 0, usage.outputTokens || 0, emit2);
|
|
48609
48699
|
if (!ctx.signal.aborted) {
|
|
48610
48700
|
appendAssistantMessage(sessionsRoot, cwd, sid, text ? [{ type: "text", text }] : [], {
|
|
48611
|
-
uuid:
|
|
48701
|
+
uuid: randomUUID4(),
|
|
48612
48702
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
48613
48703
|
usage: {
|
|
48614
48704
|
input_tokens: usage.inputTokens || 0,
|
|
@@ -48630,7 +48720,7 @@ async function runBuiltinAgent(ctx, config3) {
|
|
|
48630
48720
|
cwd,
|
|
48631
48721
|
sid,
|
|
48632
48722
|
[{ type: "text", text: `\u26A0\uFE0F ${formatProviderError(error48)}` }],
|
|
48633
|
-
{ uuid:
|
|
48723
|
+
{ uuid: randomUUID4(), timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
48634
48724
|
);
|
|
48635
48725
|
} catch {
|
|
48636
48726
|
}
|
|
@@ -49326,7 +49416,7 @@ var CodexEventShim = class {
|
|
|
49326
49416
|
};
|
|
49327
49417
|
|
|
49328
49418
|
// packages/feature/agent/src/server/engines/codex.ts
|
|
49329
|
-
import { randomUUID as
|
|
49419
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
49330
49420
|
import { writeFileSync as writeFileSync6, unlinkSync as unlinkSync4, mkdirSync as mkdirSync5, existsSync as existsSync6, statSync as statSync4, openSync as openSync2, readSync as readSync2, closeSync as closeSync2 } from "fs";
|
|
49331
49421
|
import { StringDecoder as StringDecoder2 } from "string_decoder";
|
|
49332
49422
|
import { join as join14 } from "path";
|
|
@@ -49551,7 +49641,7 @@ function writeImagesToTemp(images) {
|
|
|
49551
49641
|
});
|
|
49552
49642
|
}
|
|
49553
49643
|
function codexToolUseId(item) {
|
|
49554
|
-
return item.call_id || item.id || `tool-${
|
|
49644
|
+
return item.call_id || item.id || `tool-${randomUUID5()}`;
|
|
49555
49645
|
}
|
|
49556
49646
|
function parseCallLines(text, spawns, reports) {
|
|
49557
49647
|
for (const line of text.split("\n")) {
|
|
@@ -49773,7 +49863,7 @@ function createCodexEventAdapter(ctx) {
|
|
|
49773
49863
|
if (event.type !== "thread.started") syncSubAgents();
|
|
49774
49864
|
switch (event.type) {
|
|
49775
49865
|
case "thread.started": {
|
|
49776
|
-
const threadId = event.thread_id || `codex-${
|
|
49866
|
+
const threadId = event.thread_id || `codex-${randomUUID5()}`;
|
|
49777
49867
|
ctx.rekey(threadId);
|
|
49778
49868
|
ctx.emit({ type: "system", subtype: "init", session_id: threadId });
|
|
49779
49869
|
break;
|
|
@@ -50344,7 +50434,7 @@ var DelegationServiceLive = Layer_exports.effect(
|
|
|
50344
50434
|
const spec = getEngineSpec(request2.engine);
|
|
50345
50435
|
if (!spec) return yield* Effect_exports.fail(invalid("engine", `no engine spec for ${request2.engine}`));
|
|
50346
50436
|
const parent = yield* resolveParent(parentRunId);
|
|
50347
|
-
const presetId =
|
|
50437
|
+
const presetId = randomUUID6();
|
|
50348
50438
|
const dispatchParams = {
|
|
50349
50439
|
prompt: buildChildPrompt(request2, parent),
|
|
50350
50440
|
cwd: request2.cwd,
|
|
@@ -50390,7 +50480,7 @@ var DelegationServiceLive = Layer_exports.effect(
|
|
|
50390
50480
|
);
|
|
50391
50481
|
|
|
50392
50482
|
// packages/feature/agent/src/effect/botRegistryLive.ts
|
|
50393
|
-
import { randomUUID as
|
|
50483
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
50394
50484
|
import { readFileSync as readFileSync8, realpathSync as realpathSync3 } from "fs";
|
|
50395
50485
|
import path3 from "path";
|
|
50396
50486
|
|
|
@@ -50735,7 +50825,7 @@ var addBot = (inputPath) => Effect_exports.gen(function* () {
|
|
|
50735
50825
|
if (existing) return { kind: "existing", bot: resolveBot(path3, existing, readManifest) };
|
|
50736
50826
|
const clash = findNameClash(mergeBuiltins(resolveRegisteredBots(registry3)), manifest.name, dir);
|
|
50737
50827
|
if (clash) return { kind: "clash", bot: clash };
|
|
50738
|
-
const record2 = { id: `bot-${
|
|
50828
|
+
const record2 = { id: `bot-${randomUUID7()}`, path: dir, addedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
50739
50829
|
await writeJsonFile(BOTS_FILE, { bots: [...registry3.bots, record2] });
|
|
50740
50830
|
return { kind: "added", record: record2 };
|
|
50741
50831
|
}),
|
|
@@ -51180,7 +51270,7 @@ function substitute(text, baseUrl) {
|
|
|
51180
51270
|
}
|
|
51181
51271
|
|
|
51182
51272
|
// packages/feature/agent/src/server/engines/orchestrator.ts
|
|
51183
|
-
import { randomUUID as
|
|
51273
|
+
import { randomUUID as randomUUID8 } from "crypto";
|
|
51184
51274
|
|
|
51185
51275
|
// packages/feature/agent/src/server/lib/outputStyles.ts
|
|
51186
51276
|
var MAX_OUTPUT_STYLE_LENGTH = 8e3;
|
|
@@ -51231,7 +51321,7 @@ ${content}
|
|
|
51231
51321
|
var WRITER_RELEASE_TIMEOUT_MS = 1e4;
|
|
51232
51322
|
async function dispatchChat2(spec, body, request2) {
|
|
51233
51323
|
const { sessionId, images, cwd, language } = body;
|
|
51234
|
-
if (sessionId && isRunActive(sessionId)) {
|
|
51324
|
+
if (sessionId && isRunActive(sessionId) && !body.inject) {
|
|
51235
51325
|
return { ok: false, status: 409, error: "session is already running" };
|
|
51236
51326
|
}
|
|
51237
51327
|
const rawPrompt = body.prompt;
|
|
@@ -51240,6 +51330,20 @@ async function dispatchChat2(spec, body, request2) {
|
|
|
51240
51330
|
if (!hasContent) {
|
|
51241
51331
|
return { ok: false, status: 400, error: "Missing prompt or images" };
|
|
51242
51332
|
}
|
|
51333
|
+
const runId = typeof body.runId === "string" && body.runId || randomUUID8();
|
|
51334
|
+
let joinsWindingDownRun = false;
|
|
51335
|
+
if (sessionId && body.inject) {
|
|
51336
|
+
const injected = injectRun(
|
|
51337
|
+
sessionId,
|
|
51338
|
+
{ text: typeof prompt === "string" ? prompt : void 0, images },
|
|
51339
|
+
runId
|
|
51340
|
+
);
|
|
51341
|
+
if (injected === "ok") return { ok: true, runKey: sessionId, sessionId, injected: true };
|
|
51342
|
+
if (injected === "unsupported") {
|
|
51343
|
+
return { ok: false, status: 409, error: "session is already running" };
|
|
51344
|
+
}
|
|
51345
|
+
joinsWindingDownRun = injected === "closed";
|
|
51346
|
+
}
|
|
51243
51347
|
if (spec.preflight) {
|
|
51244
51348
|
const pre = await spec.preflight(body);
|
|
51245
51349
|
if (!pre.ok) return pre;
|
|
@@ -51248,17 +51352,20 @@ async function dispatchChat2(spec, body, request2) {
|
|
|
51248
51352
|
const outputStyleText = await resolveOutputStyleText(body.outputStyleId);
|
|
51249
51353
|
const outputStyle = outputStyleText ? formatOutputStyleSection(outputStyleText) : void 0;
|
|
51250
51354
|
const abort = new AbortController();
|
|
51251
|
-
const runId = typeof body.runId === "string" && body.runId || randomUUID7();
|
|
51252
51355
|
let currentKey = sessionId || runId;
|
|
51253
51356
|
let actualSessionId = sessionId;
|
|
51254
51357
|
let isClosed = false;
|
|
51255
|
-
if (isRunActive(currentKey)) {
|
|
51358
|
+
if (!joinsWindingDownRun && isRunActive(currentKey)) {
|
|
51256
51359
|
return { ok: false, status: 409, error: "run already active" };
|
|
51257
51360
|
}
|
|
51258
51361
|
if (!await waitForWriter(currentKey, WRITER_RELEASE_TIMEOUT_MS)) {
|
|
51259
|
-
return {
|
|
51362
|
+
return {
|
|
51363
|
+
ok: false,
|
|
51364
|
+
status: 409,
|
|
51365
|
+
error: joinsWindingDownRun ? "the current run no longer takes messages; send again once it finishes" : "previous run is still stopping"
|
|
51366
|
+
};
|
|
51260
51367
|
}
|
|
51261
|
-
if (!startRun(currentKey, cwd || "", promptText, runId, spec.name)) {
|
|
51368
|
+
if (!startRun(currentKey, cwd || "", promptText, runId, spec.name, images)) {
|
|
51262
51369
|
return { ok: false, status: 409, error: "run already active" };
|
|
51263
51370
|
}
|
|
51264
51371
|
setRunAbort(currentKey, () => {
|
|
@@ -51295,6 +51402,9 @@ async function dispatchChat2(spec, body, request2) {
|
|
|
51295
51402
|
},
|
|
51296
51403
|
currentKey() {
|
|
51297
51404
|
return currentKey;
|
|
51405
|
+
},
|
|
51406
|
+
acceptInput(sink) {
|
|
51407
|
+
setRunInjector(currentKey, sink);
|
|
51298
51408
|
}
|
|
51299
51409
|
};
|
|
51300
51410
|
void (async () => {
|
package/dist/httpApi.mjs
CHANGED
|
@@ -29,11 +29,11 @@ import {
|
|
|
29
29
|
unregisterBrowser,
|
|
30
30
|
unregisterTerminal,
|
|
31
31
|
writeStdinToCommand
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-2UCBL4S6.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getTerminalHistoryPath,
|
|
35
35
|
tightenSecretFiles
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-G6BCSLZX.mjs";
|
|
37
37
|
import "./chunk-7P6ASYW6.mjs";
|
|
38
38
|
|
|
39
39
|
// src/lib/httpApi.ts
|
package/dist/scheduledTasks.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
updateGlobalState,
|
|
23
23
|
withFileLock,
|
|
24
24
|
writeJsonFile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-G6BCSLZX.mjs";
|
|
26
26
|
import "./chunk-7P6ASYW6.mjs";
|
|
27
27
|
|
|
28
28
|
// packages/feature/agent/src/server/scheduledTasks.ts
|
|
@@ -300,8 +300,8 @@ var en_default = {
|
|
|
300
300
|
minutesLater: "in {{count}}m",
|
|
301
301
|
hoursMinutesLater: "in {{h}}h {{m}}m",
|
|
302
302
|
hoursLater: "in {{h}}h",
|
|
303
|
-
onceType: "Once ({{
|
|
304
|
-
|
|
303
|
+
onceType: "Once (in {{duration}})",
|
|
304
|
+
everyDuration: "Every {{duration}}",
|
|
305
305
|
completed: "Completed",
|
|
306
306
|
paused: "Paused",
|
|
307
307
|
activeCount: "{{running}} active",
|
|
@@ -335,11 +335,15 @@ var en_default = {
|
|
|
335
335
|
interval: "Interval",
|
|
336
336
|
quickSelect: "Quick Select",
|
|
337
337
|
customCron: "Custom Cron Expression",
|
|
338
|
-
|
|
338
|
+
customDuration: "Custom duration",
|
|
339
339
|
cronPlaceholder: "e.g. 0 9 * * 1-5 (weekdays at 9am)",
|
|
340
340
|
cronFormat: "Format: min hour day month weekday (e.g. 0 9 * * 1-5)",
|
|
341
|
-
|
|
341
|
+
amountPlaceholder: "Amount",
|
|
342
342
|
limitTimeRange: "Limit execution time range",
|
|
343
|
+
startAt: "Start at (optional)",
|
|
344
|
+
startAtHint: "Empty = start now. When set, runs stay on start + N \xD7 interval and never drift with run time",
|
|
345
|
+
clear: "Clear",
|
|
346
|
+
fromTime: "from {{time}}",
|
|
343
347
|
to: "to",
|
|
344
348
|
saveBtn: "Save ({{modKey}}\u21A9)",
|
|
345
349
|
createBtn: "Create ({{modKey}}\u21A9)",
|
|
@@ -347,14 +351,34 @@ var en_default = {
|
|
|
347
351
|
"15minLater": "In 15 minutes",
|
|
348
352
|
"30minLater": "In 30 minutes",
|
|
349
353
|
"1hourLater": "In 1 hour",
|
|
354
|
+
"3hoursLater": "In 3 hours",
|
|
355
|
+
"6hoursLater": "In 6 hours",
|
|
356
|
+
"1dayLater": "In 1 day",
|
|
357
|
+
"3daysLater": "In 3 days",
|
|
350
358
|
every15min: "Every 15 min",
|
|
351
359
|
every30min: "Every 30 min",
|
|
352
360
|
every1hour: "Every 1 hour",
|
|
353
361
|
every2hours: "Every 2 hours",
|
|
362
|
+
every6hours: "Every 6 hours",
|
|
363
|
+
every12hours: "Every 12 hours",
|
|
364
|
+
everyDay: "Every day",
|
|
354
365
|
daily9am: "Daily 09:00",
|
|
355
366
|
daily6pm: "Daily 18:00",
|
|
356
367
|
weeklyMon9am: "Mon 09:00",
|
|
357
|
-
monthly1st9am: "1st of month 09:00"
|
|
368
|
+
monthly1st9am: "1st of month 09:00",
|
|
369
|
+
unit: {
|
|
370
|
+
minute: "min",
|
|
371
|
+
hour: "hours",
|
|
372
|
+
day: "days"
|
|
373
|
+
},
|
|
374
|
+
duration: {
|
|
375
|
+
minute_one: "{{count}} min",
|
|
376
|
+
minute_other: "{{count}} min",
|
|
377
|
+
hour_one: "{{count}} hour",
|
|
378
|
+
hour_other: "{{count}} hours",
|
|
379
|
+
day_one: "{{count}} day",
|
|
380
|
+
day_other: "{{count}} days"
|
|
381
|
+
}
|
|
358
382
|
},
|
|
359
383
|
runningTerminals: {
|
|
360
384
|
title: "Terminals",
|
|
@@ -624,6 +648,7 @@ var en_default = {
|
|
|
624
648
|
codexResumeFailedNew: "New session",
|
|
625
649
|
placeholder: "Type a message, Enter to send (Shift+Enter for new line, paste images; start a line with / (skill), /@ (skill in a subagent) or @ (bot in a subagent), multiple allowed)",
|
|
626
650
|
placeholderDisabled: "Generating... you can keep typing (ESC to cancel; if stuck, cancel and resend 'continue')",
|
|
651
|
+
placeholderRunning: "Generating... Enter sends now: it joins the current reply at its next step (ESC to stop)",
|
|
627
652
|
imageSizeLimit: "Image size exceeds limit (max 5MB), current: {{size}}MB",
|
|
628
653
|
viewGitChanges: "View Git changes",
|
|
629
654
|
viewAllComments: "View all comments",
|
|
@@ -1617,8 +1642,8 @@ var zh_default = {
|
|
|
1617
1642
|
minutesLater: "{{count}}\u5206\u949F\u540E",
|
|
1618
1643
|
hoursMinutesLater: "{{h}}\u5C0F\u65F6{{m}}\u5206\u540E",
|
|
1619
1644
|
hoursLater: "{{h}}\u5C0F\u65F6\u540E",
|
|
1620
|
-
onceType: "\u4E00\u6B21\u6027
|
|
1621
|
-
|
|
1645
|
+
onceType: "\u4E00\u6B21\u6027\uFF08{{duration}}\u540E\uFF09",
|
|
1646
|
+
everyDuration: "\u6BCF{{duration}}",
|
|
1622
1647
|
completed: "\u5DF2\u5B8C\u6210",
|
|
1623
1648
|
paused: "\u5DF2\u6682\u505C",
|
|
1624
1649
|
activeCount: "{{running}} \u4E2A\u6D3B\u8DC3",
|
|
@@ -1652,11 +1677,15 @@ var zh_default = {
|
|
|
1652
1677
|
interval: "\u5468\u671F",
|
|
1653
1678
|
quickSelect: "\u5FEB\u6377\u9009\u62E9",
|
|
1654
1679
|
customCron: "\u81EA\u5B9A\u4E49 Cron \u8868\u8FBE\u5F0F",
|
|
1655
|
-
|
|
1680
|
+
customDuration: "\u81EA\u5B9A\u4E49\u65F6\u957F",
|
|
1656
1681
|
cronPlaceholder: "\u4F8B: 0 9 * * 1-5 (\u5DE5\u4F5C\u65E59\u70B9)",
|
|
1657
1682
|
cronFormat: "\u683C\u5F0F\uFF1A\u5206 \u65F6 \u65E5 \u6708 \u661F\u671F\uFF08\u5982 0 9 * * 1-5\uFF09",
|
|
1658
|
-
|
|
1683
|
+
amountPlaceholder: "\u6570\u503C",
|
|
1659
1684
|
limitTimeRange: "\u9650\u5236\u6267\u884C\u65F6\u6BB5",
|
|
1685
|
+
startAt: "\u8D77\u59CB\u65F6\u95F4\uFF08\u53EF\u9009\uFF09",
|
|
1686
|
+
startAtHint: "\u7559\u7A7A\u5219\u4ECE\u73B0\u5728\u5F00\u59CB\uFF1B\u8BBE\u7F6E\u540E\u56FA\u5B9A\u5728\u300C\u8D77\u59CB\u65F6\u95F4 + N \xD7 \u95F4\u9694\u300D\u6267\u884C\uFF0C\u4E0D\u968F\u8FD0\u884C\u65F6\u957F\u6F02\u79FB",
|
|
1687
|
+
clear: "\u6E05\u9664",
|
|
1688
|
+
fromTime: "\u81EA {{time}} \u8D77",
|
|
1660
1689
|
to: "\u81F3",
|
|
1661
1690
|
saveBtn: "\u4FDD\u5B58 ({{modKey}}\u21A9)",
|
|
1662
1691
|
createBtn: "\u521B\u5EFA ({{modKey}}\u21A9)",
|
|
@@ -1664,14 +1693,31 @@ var zh_default = {
|
|
|
1664
1693
|
"15minLater": "15 \u5206\u949F\u540E",
|
|
1665
1694
|
"30minLater": "30 \u5206\u949F\u540E",
|
|
1666
1695
|
"1hourLater": "1 \u5C0F\u65F6\u540E",
|
|
1696
|
+
"3hoursLater": "3 \u5C0F\u65F6\u540E",
|
|
1697
|
+
"6hoursLater": "6 \u5C0F\u65F6\u540E",
|
|
1698
|
+
"1dayLater": "1 \u5929\u540E",
|
|
1699
|
+
"3daysLater": "3 \u5929\u540E",
|
|
1667
1700
|
every15min: "\u6BCF 15 \u5206\u949F",
|
|
1668
1701
|
every30min: "\u6BCF 30 \u5206\u949F",
|
|
1669
1702
|
every1hour: "\u6BCF 1 \u5C0F\u65F6",
|
|
1670
1703
|
every2hours: "\u6BCF 2 \u5C0F\u65F6",
|
|
1704
|
+
every6hours: "\u6BCF 6 \u5C0F\u65F6",
|
|
1705
|
+
every12hours: "\u6BCF 12 \u5C0F\u65F6",
|
|
1706
|
+
everyDay: "\u6BCF 1 \u5929",
|
|
1671
1707
|
daily9am: "\u6BCF\u5929 09:00",
|
|
1672
1708
|
daily6pm: "\u6BCF\u5929 18:00",
|
|
1673
1709
|
weeklyMon9am: "\u6BCF\u5468\u4E00 09:00",
|
|
1674
|
-
monthly1st9am: "\u6BCF\u6708 1 \u53F7 09:00"
|
|
1710
|
+
monthly1st9am: "\u6BCF\u6708 1 \u53F7 09:00",
|
|
1711
|
+
unit: {
|
|
1712
|
+
minute: "\u5206\u949F",
|
|
1713
|
+
hour: "\u5C0F\u65F6",
|
|
1714
|
+
day: "\u5929"
|
|
1715
|
+
},
|
|
1716
|
+
duration: {
|
|
1717
|
+
minute: "{{count}}\u5206\u949F",
|
|
1718
|
+
hour: "{{count}}\u5C0F\u65F6",
|
|
1719
|
+
day: "{{count}}\u5929"
|
|
1720
|
+
}
|
|
1675
1721
|
},
|
|
1676
1722
|
runningTerminals: {
|
|
1677
1723
|
title: "\u7EC8\u7AEF",
|
|
@@ -1941,6 +1987,7 @@ var zh_default = {
|
|
|
1941
1987
|
codexResumeFailedNew: "\u65B0\u4F1A\u8BDD",
|
|
1942
1988
|
placeholder: "\u8F93\u5165\u6D88\u606F\uFF0CEnter \u53D1\u9001\uFF08Shift+Enter \u6362\u884C\uFF0C\u53EF\u7C98\u8D34\u56FE\u7247\uFF1B\u884C\u9996 /\uFF08skill\uFF09\u3001/@\uFF08\u5B50\u4EE3\u7406\u6267\u884C skill\uFF09\u6216 @\uFF08\u5B50\u4EE3\u7406\u6267\u884C\u673A\u5668\u4EBA\uFF09\uFF0C\u652F\u6301\u591A\u884C\u591A\u547D\u4EE4\uFF09",
|
|
1943
1989
|
placeholderDisabled: "\u751F\u6210\u4E2D... \u53EF\u7EE7\u7EED\u8F93\u5165 (ESC \u53D6\u6D88;\u5361\u4F4F\u592A\u4E45\u53EF\u53D6\u6D88\u540E\u91CD\u53D1\u300C\u7EE7\u7EED\u300D)",
|
|
1990
|
+
placeholderRunning: "\u751F\u6210\u4E2D... \u56DE\u8F66\u5373\u53D1\u9001\uFF0C\u4F1A\u5728\u5F53\u524D\u56DE\u590D\u7684\u4E0B\u4E00\u6B65\u63D2\u5165\uFF08ESC \u505C\u6B62\uFF09",
|
|
1944
1991
|
imageSizeLimit: "\u56FE\u7247\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF08\u6700\u5927 5MB\uFF09\uFF0C\u5F53\u524D\u5927\u5C0F: {{size}}MB",
|
|
1945
1992
|
viewGitChanges: "\u67E5\u770B Git \u53D8\u66F4",
|
|
1946
1993
|
viewAllComments: "\u67E5\u770B\u6240\u6709\u8BC4\u8BBA",
|
|
@@ -2892,8 +2939,13 @@ function withoutServerOwned(fields) {
|
|
|
2892
2939
|
for (const k of SERVER_OWNED) delete copy[k];
|
|
2893
2940
|
return copy;
|
|
2894
2941
|
}
|
|
2942
|
+
function nextIntervalFire(anchor, intervalMinutes, now) {
|
|
2943
|
+
if (anchor > now) return anchor;
|
|
2944
|
+
const step = intervalMinutes * 6e4;
|
|
2945
|
+
return anchor + (Math.floor((now - anchor) / step) + 1) * step;
|
|
2946
|
+
}
|
|
2895
2947
|
function nextOccurrence(t, now) {
|
|
2896
|
-
if (t.type === "interval" && t.intervalMinutes) return
|
|
2948
|
+
if (t.type === "interval" && t.intervalMinutes) return nextIntervalFire(t.nextFireTime, t.intervalMinutes, now);
|
|
2897
2949
|
if (t.type === "cron" && t.cron) return getNextCronTime(t.cron, new Date(now));
|
|
2898
2950
|
return t.nextFireTime;
|
|
2899
2951
|
}
|
|
@@ -3261,6 +3313,7 @@ export {
|
|
|
3261
3313
|
buildTaskPrompt,
|
|
3262
3314
|
canTransition,
|
|
3263
3315
|
getNextCronTime,
|
|
3316
|
+
nextIntervalFire,
|
|
3264
3317
|
readSessionNoHistory,
|
|
3265
3318
|
readSessionOutputStyleId,
|
|
3266
3319
|
scheduledTaskManager,
|
package/dist/wsServer.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
spawnPtyInHost,
|
|
22
22
|
unregisterBrowser,
|
|
23
23
|
writeStdinToCommand
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2UCBL4S6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
Effect_exports,
|
|
27
27
|
FSError,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
recoverStashedCodexRollouts,
|
|
40
40
|
recoverStashedTranscripts,
|
|
41
41
|
sanitizedSpawnEnv
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-G6BCSLZX.mjs";
|
|
43
43
|
import {
|
|
44
44
|
registerWatcherSubscriber,
|
|
45
45
|
subscribeBuildProgress
|
|
@@ -1265,8 +1265,8 @@ var handleSessionStream = (conn, sessionId) => Effect_exports.gen(function* () {
|
|
|
1265
1265
|
// message timestamp instead of by prompt text (see useLiveStream).
|
|
1266
1266
|
startedAt: snap.startedAt,
|
|
1267
1267
|
// Turn identity: the viewer scopes this turn's tool-call snapshots by it.
|
|
1268
|
-
//
|
|
1269
|
-
//
|
|
1268
|
+
// Sent explicitly rather than read off the seeded `_human` event, which a
|
|
1269
|
+
// turn launched with neither text nor images does not have.
|
|
1270
1270
|
runId: snap.runId,
|
|
1271
1271
|
outputTokens: snap.outputTokens,
|
|
1272
1272
|
events: snap.events
|