@spencer-kit/coder-studio 0.3.8 → 0.3.9
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 +6 -0
- package/dist/esm/bin.mjs +56 -5
- package/dist/esm/bin.mjs.map +2 -2
- package/dist/esm/server-runner.mjs +56 -5
- package/dist/esm/server-runner.mjs.map +2 -2
- package/dist/web/assets/{index-YsdPRUE-.css → index-BwryTUQ9.css} +1 -1
- package/dist/web/assets/{index-LQGuy5NX.js → index-Z64V-v_U.js} +11 -11
- package/dist/web/assets/index-Z64V-v_U.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-LQGuy5NX.js.map +0 -1
|
@@ -5234,9 +5234,27 @@ var init_settings = __esm({
|
|
|
5234
5234
|
import { spawn as spawn2 } from "node:child_process";
|
|
5235
5235
|
function buildPrompt(context) {
|
|
5236
5236
|
const lines = [
|
|
5237
|
-
"You are
|
|
5237
|
+
"You are an autonomous supervisor for a target-scoped software task.",
|
|
5238
|
+
"Your job is to keep the agent moving toward the objective until the objective is complete.",
|
|
5239
|
+
"",
|
|
5238
5240
|
"Return JSON only.",
|
|
5239
5241
|
"",
|
|
5242
|
+
"Decision policy:",
|
|
5243
|
+
'- Prefer "continue" whenever there is a reasonable next action.',
|
|
5244
|
+
"- Do not ask the user to decide, clarify, or choose among implementation options.",
|
|
5245
|
+
"- When information is incomplete, choose a conservative next action based on the objective, target memory, latest user input, and terminal snapshot.",
|
|
5246
|
+
"- Stop only when the objective is complete, or when continuing would likely push the agent in an unsafe or clearly unsupported direction.",
|
|
5247
|
+
"",
|
|
5248
|
+
"Stage decision policy:",
|
|
5249
|
+
"- Use the target memory as the current supervision state.",
|
|
5250
|
+
"- Base your decision on the objective, current plan, activeStepId, progressSummary, lastGuidance, stalledCount, latest user input, and terminal snapshot.",
|
|
5251
|
+
"- Identify which plan step is currently active.",
|
|
5252
|
+
"- Decide whether the active step is done, still in progress, blocked, or obsolete.",
|
|
5253
|
+
"- If the active step is done, advance to the next useful step.",
|
|
5254
|
+
"- If the active step is still in progress, give guidance that moves it forward.",
|
|
5255
|
+
"- If the agent appears stuck or repeated the same action, give a different concrete next action.",
|
|
5256
|
+
"- If the plan is obsolete, update only the affected steps unless a full replacement is necessary.",
|
|
5257
|
+
"",
|
|
5240
5258
|
"Allowed statuses:",
|
|
5241
5259
|
'- "continue": more work is needed; include "reason" and "guidance".',
|
|
5242
5260
|
'- "stop": supervision should stop; include "stopReason" and "reason".',
|
|
@@ -5244,10 +5262,43 @@ function buildPrompt(context) {
|
|
|
5244
5262
|
"Allowed stop reasons:",
|
|
5245
5263
|
'- "objective_complete"',
|
|
5246
5264
|
'- "supervisor_uncertain"',
|
|
5247
|
-
'- "needs_user_input"',
|
|
5248
5265
|
"",
|
|
5249
|
-
"
|
|
5250
|
-
"
|
|
5266
|
+
'Use "objective_complete" only when the objective has been satisfied.',
|
|
5267
|
+
'Use "supervisor_uncertain" only as a last resort when no useful next action can be inferred and additional guidance would likely be misleading.',
|
|
5268
|
+
"",
|
|
5269
|
+
'Guidance requirements for "continue":',
|
|
5270
|
+
"- Give one concrete next action or a short ordered set of concrete actions.",
|
|
5271
|
+
"- Focus on the highest-value step toward completing the objective.",
|
|
5272
|
+
"- Be specific enough for the supervised agent to act without asking the user.",
|
|
5273
|
+
"- Avoid generic reminders, encouragement, or restating the objective.",
|
|
5274
|
+
"- If verification is needed, tell the agent exactly what to verify next.",
|
|
5275
|
+
"- If implementation is needed, point to the likely area, behavior, or file/module based on available evidence.",
|
|
5276
|
+
"",
|
|
5277
|
+
"Planning policy:",
|
|
5278
|
+
"- If planGenerated is false, include a plan with 3 to 7 milestone-sized steps.",
|
|
5279
|
+
"- If planGenerated is true, update progress incrementally.",
|
|
5280
|
+
"- Do not rewrite the full plan unless the existing plan is clearly wrong or obsolete.",
|
|
5281
|
+
"- Use stepUpdates to mark completed or active steps when the terminal snapshot shows progress.",
|
|
5282
|
+
"- Keep activeStepId aligned with the next useful step.",
|
|
5283
|
+
"",
|
|
5284
|
+
"Output schema:",
|
|
5285
|
+
"For continue:",
|
|
5286
|
+
"{",
|
|
5287
|
+
' "status": "continue",',
|
|
5288
|
+
' "reason": "brief explanation of why more work is needed",',
|
|
5289
|
+
' "guidance": "specific next action for the supervised agent",',
|
|
5290
|
+
' "plan": optional array of plan steps,',
|
|
5291
|
+
' "activeStepId": optional step id,',
|
|
5292
|
+
' "progressSummary": optional brief progress summary,',
|
|
5293
|
+
' "stepUpdates": optional array of { "id": string, "status": "pending" | "in_progress" | "done" }',
|
|
5294
|
+
"}",
|
|
5295
|
+
"",
|
|
5296
|
+
"For stop:",
|
|
5297
|
+
"{",
|
|
5298
|
+
' "status": "stop",',
|
|
5299
|
+
' "stopReason": "objective_complete" | "supervisor_uncertain",',
|
|
5300
|
+
' "reason": "brief explanation"',
|
|
5301
|
+
"}",
|
|
5251
5302
|
"",
|
|
5252
5303
|
"Current objective:",
|
|
5253
5304
|
context.objective,
|
|
@@ -5526,7 +5577,7 @@ function parseSupervisorEvaluationResult(payloadText, guidanceMaxChars) {
|
|
|
5526
5577
|
}
|
|
5527
5578
|
if (status === "stop") {
|
|
5528
5579
|
const stopReason = record.stopReason;
|
|
5529
|
-
if (stopReason !== "objective_complete" && stopReason !== "supervisor_uncertain"
|
|
5580
|
+
if (stopReason !== "objective_complete" && stopReason !== "supervisor_uncertain") {
|
|
5530
5581
|
throw new Error("Supervisor stop result is missing a valid stopReason");
|
|
5531
5582
|
}
|
|
5532
5583
|
return {
|