@kenkaiiii/gg-boss 4.11.1 → 4.11.2
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.
|
@@ -72278,7 +72278,7 @@ var SubAgentParams = external_exports.object({
|
|
|
72278
72278
|
task: external_exports.string().describe("The task to delegate to the sub-agent"),
|
|
72279
72279
|
agent: external_exports.string().optional().describe("Named agent definition to use (from ~/.gg/agents/ or .gg/agents/)")
|
|
72280
72280
|
});
|
|
72281
|
-
function createSubAgentTool(cwd2, agents,
|
|
72281
|
+
function createSubAgentTool(cwd2, agents, getParentProvider, getParentModel, getParentCacheKey, planModeRef) {
|
|
72282
72282
|
const agentList = agents.map((a) => `- ${a.name}: ${a.description}`).join("\n");
|
|
72283
72283
|
const agentDesc = agentList ? `
|
|
72284
72284
|
|
|
@@ -72308,13 +72308,14 @@ ${agentList}` : "\n\nNo named agents configured.";
|
|
|
72308
72308
|
};
|
|
72309
72309
|
}
|
|
72310
72310
|
}
|
|
72311
|
-
const useProvider =
|
|
72311
|
+
const useProvider = getParentProvider();
|
|
72312
|
+
const useModel = getParentModel();
|
|
72312
72313
|
const cliArgs = [
|
|
72313
72314
|
"--json",
|
|
72314
72315
|
"--provider",
|
|
72315
72316
|
useProvider,
|
|
72316
72317
|
"--model",
|
|
72317
|
-
|
|
72318
|
+
useModel,
|
|
72318
72319
|
"--max-turns",
|
|
72319
72320
|
String(SUB_AGENT_MAX_TURNS)
|
|
72320
72321
|
];
|
|
@@ -72341,7 +72342,7 @@ ${agentList}` : "\n\nNo named agents configured.";
|
|
|
72341
72342
|
log("INFO", "subagent", "Sub-agent spawn", {
|
|
72342
72343
|
cacheKey: subCacheKey,
|
|
72343
72344
|
provider: useProvider,
|
|
72344
|
-
model:
|
|
72345
|
+
model: useModel,
|
|
72345
72346
|
agent: agentDef?.name ?? "(default)"
|
|
72346
72347
|
});
|
|
72347
72348
|
let childExited = false;
|
|
@@ -74271,7 +74272,7 @@ function createTools(cwd2, opts) {
|
|
|
74271
74272
|
tools.push(createWebSearchTool());
|
|
74272
74273
|
}
|
|
74273
74274
|
if (opts?.agents && opts.agents.length > 0 && opts.provider && opts.model) {
|
|
74274
|
-
tools.push(createSubAgentTool(cwd2, opts.agents, opts.provider, opts.model, opts.getCacheKey, planModeRef));
|
|
74275
|
+
tools.push(createSubAgentTool(cwd2, opts.agents, () => opts.getProvider?.() ?? opts.provider, () => opts.getModel?.() ?? opts.model, opts.getCacheKey, planModeRef));
|
|
74275
74276
|
}
|
|
74276
74277
|
if (opts?.skills && opts.skills.length > 0) {
|
|
74277
74278
|
tools.push(createSkillTool(opts.skills));
|
|
@@ -83716,6 +83717,10 @@ var AgentSession = class {
|
|
|
83716
83717
|
customSystemPrompt;
|
|
83717
83718
|
/** Shared with the tool layer so plan-mode restrictions read live state. */
|
|
83718
83719
|
planModeRef = { current: false };
|
|
83720
|
+
/** Path of the approved plan currently being implemented, or undefined. When
|
|
83721
|
+
* set, the system prompt carries the `[DONE:n]` progress contract so the
|
|
83722
|
+
* model emits step-completion markers the UI's plan-progress widget reads. */
|
|
83723
|
+
approvedPlanPath;
|
|
83719
83724
|
sessionId = "";
|
|
83720
83725
|
sessionPath = "";
|
|
83721
83726
|
lastPersistedIndex = 0;
|
|
@@ -83758,8 +83763,10 @@ var AgentSession = class {
|
|
|
83758
83763
|
provider: this.provider,
|
|
83759
83764
|
model: this.model,
|
|
83760
83765
|
lspDiagnostics: this.settingsManager.get("lspDiagnostics"),
|
|
83761
|
-
// Lazy — sessionId
|
|
83762
|
-
//
|
|
83766
|
+
// Lazy — sessionId/model/provider can change after createTools() runs, so
|
|
83767
|
+
// sub-agent spawns read the current parent state at execution time.
|
|
83768
|
+
getProvider: () => this.provider,
|
|
83769
|
+
getModel: () => this.model,
|
|
83763
83770
|
getCacheKey: () => this.getPromptCacheKey(),
|
|
83764
83771
|
// Plan mode: only wired when the host supplies callbacks. The ref is
|
|
83765
83772
|
// shared so bash/edit/write enforce read-only restrictions live.
|
|
@@ -84203,6 +84210,8 @@ ${fileNotes.join("\n")}`);
|
|
|
84203
84210
|
});
|
|
84204
84211
|
}
|
|
84205
84212
|
async newSession() {
|
|
84213
|
+
this.planModeRef.current = false;
|
|
84214
|
+
this.approvedPlanPath = void 0;
|
|
84206
84215
|
const basePrompt = this.customSystemPrompt ?? await buildSystemPrompt(this.cwd, this.skills, false, void 0, this.tools.map((tool) => tool.name), void 0, this.provider);
|
|
84207
84216
|
this.messages = [{ role: "system", content: basePrompt }];
|
|
84208
84217
|
await this.createNewSession();
|
|
@@ -84296,9 +84305,25 @@ ${fileNotes.join("\n")}`);
|
|
|
84296
84305
|
*/
|
|
84297
84306
|
async setPlanMode(active) {
|
|
84298
84307
|
this.planModeRef.current = active;
|
|
84308
|
+
if (active)
|
|
84309
|
+
this.approvedPlanPath = void 0;
|
|
84310
|
+
await this.rebuildSystemPromptInPlace();
|
|
84311
|
+
}
|
|
84312
|
+
/**
|
|
84313
|
+
* Bake an approved plan into the system prompt so the model is told to emit
|
|
84314
|
+
* `[DONE:n]` markers as it completes each step (the contract the UI's
|
|
84315
|
+
* plan-progress widget reads). Pass `undefined` to clear it. No-op when a
|
|
84316
|
+
* custom system prompt is in force (the host owns the prompt then).
|
|
84317
|
+
*/
|
|
84318
|
+
async setApprovedPlan(approvedPlanPath) {
|
|
84319
|
+
this.approvedPlanPath = approvedPlanPath;
|
|
84320
|
+
await this.rebuildSystemPromptInPlace();
|
|
84321
|
+
}
|
|
84322
|
+
/** Rebuild messages[0] from current plan-mode + approved-plan state. */
|
|
84323
|
+
async rebuildSystemPromptInPlace() {
|
|
84299
84324
|
if (this.customSystemPrompt)
|
|
84300
84325
|
return;
|
|
84301
|
-
const rebuilt = await buildSystemPrompt(this.cwd, this.skills,
|
|
84326
|
+
const rebuilt = await buildSystemPrompt(this.cwd, this.skills, this.planModeRef.current, this.approvedPlanPath, this.tools.map((tool) => tool.name), void 0, this.provider);
|
|
84302
84327
|
if (this.messages[0]?.role === "system") {
|
|
84303
84328
|
this.messages[0] = { role: "system", content: rebuilt };
|
|
84304
84329
|
} else {
|
|
@@ -116472,4 +116497,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
116472
116497
|
* LICENSE file in the root directory of this source tree.
|
|
116473
116498
|
*)
|
|
116474
116499
|
*/
|
|
116475
|
-
//# sourceMappingURL=chunk-
|
|
116500
|
+
//# sourceMappingURL=chunk-CR6V6KR3.js.map
|