@spencer-kit/coder-studio 0.3.8 → 0.3.10
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/CHANGELOG.md +12 -0
- package/dist/esm/bin.mjs +66 -22
- package/dist/esm/bin.mjs.map +2 -2
- package/dist/esm/server-runner.mjs +66 -22
- package/dist/esm/server-runner.mjs.map +2 -2
- package/dist/web/assets/index-DBpngHWV.js +111 -0
- package/dist/web/assets/index-DBpngHWV.js.map +1 -0
- package/dist/web/assets/index-DUGzjla1.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-LQGuy5NX.js +0 -111
- package/dist/web/assets/index-LQGuy5NX.js.map +0 -1
- package/dist/web/assets/index-YsdPRUE-.css +0 -1
|
@@ -1043,7 +1043,7 @@ async function readFile(workspaceId, rootPath, relPath) {
|
|
|
1043
1043
|
const abs = resolveSafe(rootPath, relPath);
|
|
1044
1044
|
const imageType = getImageTypeInfo(relPath);
|
|
1045
1045
|
if (imageType) {
|
|
1046
|
-
const
|
|
1046
|
+
const bytes = await fsReadFile(abs);
|
|
1047
1047
|
const params = new URLSearchParams({
|
|
1048
1048
|
workspaceId,
|
|
1049
1049
|
path: relPath
|
|
@@ -1052,8 +1052,9 @@ async function readFile(workspaceId, rootPath, relPath) {
|
|
|
1052
1052
|
kind: "image",
|
|
1053
1053
|
mime: imageType.mime,
|
|
1054
1054
|
url: `/api/file?${params.toString()}`,
|
|
1055
|
-
size:
|
|
1056
|
-
isTextBacked: imageType.isTextBacked
|
|
1055
|
+
size: bytes.byteLength,
|
|
1056
|
+
isTextBacked: imageType.isTextBacked,
|
|
1057
|
+
version: createHash("sha256").update(bytes).digest("hex")
|
|
1057
1058
|
};
|
|
1058
1059
|
}
|
|
1059
1060
|
const content = await fsReadFile(abs, "utf-8");
|
|
@@ -5234,9 +5235,27 @@ var init_settings = __esm({
|
|
|
5234
5235
|
import { spawn as spawn2 } from "node:child_process";
|
|
5235
5236
|
function buildPrompt(context) {
|
|
5236
5237
|
const lines = [
|
|
5237
|
-
"You are
|
|
5238
|
+
"You are an autonomous supervisor for a target-scoped software task.",
|
|
5239
|
+
"Your job is to keep the agent moving toward the objective until the objective is complete.",
|
|
5240
|
+
"",
|
|
5238
5241
|
"Return JSON only.",
|
|
5239
5242
|
"",
|
|
5243
|
+
"Decision policy:",
|
|
5244
|
+
'- Prefer "continue" whenever there is a reasonable next action.',
|
|
5245
|
+
"- Do not ask the user to decide, clarify, or choose among implementation options.",
|
|
5246
|
+
"- When information is incomplete, choose a conservative next action based on the objective, target memory, latest user input, and terminal snapshot.",
|
|
5247
|
+
"- Stop only when the objective is complete, or when continuing would likely push the agent in an unsafe or clearly unsupported direction.",
|
|
5248
|
+
"",
|
|
5249
|
+
"Stage decision policy:",
|
|
5250
|
+
"- Use the target memory as the current supervision state.",
|
|
5251
|
+
"- Base your decision on the objective, current plan, activeStepId, progressSummary, lastGuidance, stalledCount, latest user input, and terminal snapshot.",
|
|
5252
|
+
"- Identify which plan step is currently active.",
|
|
5253
|
+
"- Decide whether the active step is done, still in progress, blocked, or obsolete.",
|
|
5254
|
+
"- If the active step is done, advance to the next useful step.",
|
|
5255
|
+
"- If the active step is still in progress, give guidance that moves it forward.",
|
|
5256
|
+
"- If the agent appears stuck or repeated the same action, give a different concrete next action.",
|
|
5257
|
+
"- If the plan is obsolete, update only the affected steps unless a full replacement is necessary.",
|
|
5258
|
+
"",
|
|
5240
5259
|
"Allowed statuses:",
|
|
5241
5260
|
'- "continue": more work is needed; include "reason" and "guidance".',
|
|
5242
5261
|
'- "stop": supervision should stop; include "stopReason" and "reason".',
|
|
@@ -5244,10 +5263,43 @@ function buildPrompt(context) {
|
|
|
5244
5263
|
"Allowed stop reasons:",
|
|
5245
5264
|
'- "objective_complete"',
|
|
5246
5265
|
'- "supervisor_uncertain"',
|
|
5247
|
-
'- "needs_user_input"',
|
|
5248
5266
|
"",
|
|
5249
|
-
"
|
|
5250
|
-
"
|
|
5267
|
+
'Use "objective_complete" only when the objective has been satisfied.',
|
|
5268
|
+
'Use "supervisor_uncertain" only as a last resort when no useful next action can be inferred and additional guidance would likely be misleading.',
|
|
5269
|
+
"",
|
|
5270
|
+
'Guidance requirements for "continue":',
|
|
5271
|
+
"- Give one concrete next action or a short ordered set of concrete actions.",
|
|
5272
|
+
"- Focus on the highest-value step toward completing the objective.",
|
|
5273
|
+
"- Be specific enough for the supervised agent to act without asking the user.",
|
|
5274
|
+
"- Avoid generic reminders, encouragement, or restating the objective.",
|
|
5275
|
+
"- If verification is needed, tell the agent exactly what to verify next.",
|
|
5276
|
+
"- If implementation is needed, point to the likely area, behavior, or file/module based on available evidence.",
|
|
5277
|
+
"",
|
|
5278
|
+
"Planning policy:",
|
|
5279
|
+
"- If planGenerated is false, include a plan with 3 to 7 milestone-sized steps.",
|
|
5280
|
+
"- If planGenerated is true, update progress incrementally.",
|
|
5281
|
+
"- Do not rewrite the full plan unless the existing plan is clearly wrong or obsolete.",
|
|
5282
|
+
"- Use stepUpdates to mark completed or active steps when the terminal snapshot shows progress.",
|
|
5283
|
+
"- Keep activeStepId aligned with the next useful step.",
|
|
5284
|
+
"",
|
|
5285
|
+
"Output schema:",
|
|
5286
|
+
"For continue:",
|
|
5287
|
+
"{",
|
|
5288
|
+
' "status": "continue",',
|
|
5289
|
+
' "reason": "brief explanation of why more work is needed",',
|
|
5290
|
+
' "guidance": "specific next action for the supervised agent",',
|
|
5291
|
+
' "plan": optional array of plan steps,',
|
|
5292
|
+
' "activeStepId": optional step id,',
|
|
5293
|
+
' "progressSummary": optional brief progress summary,',
|
|
5294
|
+
' "stepUpdates": optional array of { "id": string, "status": "pending" | "in_progress" | "done" }',
|
|
5295
|
+
"}",
|
|
5296
|
+
"",
|
|
5297
|
+
"For stop:",
|
|
5298
|
+
"{",
|
|
5299
|
+
' "status": "stop",',
|
|
5300
|
+
' "stopReason": "objective_complete" | "supervisor_uncertain",',
|
|
5301
|
+
' "reason": "brief explanation"',
|
|
5302
|
+
"}",
|
|
5251
5303
|
"",
|
|
5252
5304
|
"Current objective:",
|
|
5253
5305
|
context.objective,
|
|
@@ -5526,7 +5578,7 @@ function parseSupervisorEvaluationResult(payloadText, guidanceMaxChars) {
|
|
|
5526
5578
|
}
|
|
5527
5579
|
if (status === "stop") {
|
|
5528
5580
|
const stopReason = record.stopReason;
|
|
5529
|
-
if (stopReason !== "objective_complete" && stopReason !== "supervisor_uncertain"
|
|
5581
|
+
if (stopReason !== "objective_complete" && stopReason !== "supervisor_uncertain") {
|
|
5530
5582
|
throw new Error("Supervisor stop result is missing a valid stopReason");
|
|
5531
5583
|
}
|
|
5532
5584
|
return {
|
|
@@ -8117,20 +8169,8 @@ function createTreeVisibilityFilter() {
|
|
|
8117
8169
|
return (name) => !isTreeHidden(name);
|
|
8118
8170
|
}
|
|
8119
8171
|
function createWatcherIgnoreFilter(rootPath) {
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
return (path10) => DEFAULT_WATCHER_IGNORED_PATTERNS.some((p) => p.test(normalizePath(path10)));
|
|
8123
|
-
}
|
|
8124
|
-
const gitignoreContent = readFileSync5(gitignorePath, "utf-8");
|
|
8125
|
-
const ig = ignore().add(gitignoreContent);
|
|
8126
|
-
return (path10) => {
|
|
8127
|
-
const normalizedPath = normalizePath(path10);
|
|
8128
|
-
if (DEFAULT_WATCHER_IGNORED_PATTERNS.some((p) => p.test(normalizedPath))) {
|
|
8129
|
-
return true;
|
|
8130
|
-
}
|
|
8131
|
-
const relativePath = relativeToRoot(rootPath, path10);
|
|
8132
|
-
return isIgnoredByGitignore(ig, relativePath);
|
|
8133
|
-
};
|
|
8172
|
+
void rootPath;
|
|
8173
|
+
return (path10) => DEFAULT_WATCHER_IGNORED_PATTERNS.some((p) => p.test(normalizePath(path10)));
|
|
8134
8174
|
}
|
|
8135
8175
|
var DEFAULT_WATCHER_IGNORED_PATTERNS;
|
|
8136
8176
|
var init_gitignore = __esm({
|
|
@@ -9950,6 +9990,7 @@ var init_workspace = __esm({
|
|
|
9950
9990
|
bottomPanelHeight: z6.number(),
|
|
9951
9991
|
focusMode: z6.boolean(),
|
|
9952
9992
|
activeSessionId: z6.string().optional(),
|
|
9993
|
+
fileTreeExpandedDirs: z6.array(z6.string()).optional(),
|
|
9953
9994
|
paneLayout: z6.object({
|
|
9954
9995
|
id: z6.string(),
|
|
9955
9996
|
type: z6.enum(["leaf", "split"]),
|
|
@@ -11965,6 +12006,9 @@ var init_settings2 = __esm({
|
|
|
11965
12006
|
themeId: z13.string().optional(),
|
|
11966
12007
|
terminalRenderer: z13.enum(["standard", "compatibility"]).optional(),
|
|
11967
12008
|
terminalCopyOnSelect: z13.boolean().optional(),
|
|
12009
|
+
terminalFontSize: z13.number().int().min(10).max(18).optional(),
|
|
12010
|
+
desktopTerminalFontSize: z13.number().int().min(10).max(18).optional(),
|
|
12011
|
+
mobileTerminalFontSize: z13.number().int().min(10).max(18).optional(),
|
|
11968
12012
|
locale: z13.enum(["zh", "en"]).optional()
|
|
11969
12013
|
}).optional(),
|
|
11970
12014
|
providers: ProviderSettingsSchema.optional()
|