@kenkaiiii/ggcoder 6.1.0 → 6.2.1
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/assets/skills/gg-guide/SKILL.md +15 -14
- package/assets/skills/gg-guide/references/chat-motion-goals.md +43 -32
- package/assets/skills/gg-guide/references/checklist-and-safety.md +6 -5
- package/assets/skills/gg-guide/references/code-mode.md +21 -19
- package/assets/skills/gg-guide/references/getting-started.md +167 -71
- package/assets/skills/gg-guide/references/ken-and-autopilot.md +28 -24
- package/assets/skills/gg-guide/references/mcp-and-skills.md +23 -15
- package/assets/skills/gg-guide/references/models-and-sign-in.md +25 -26
- package/assets/skills/gg-guide/references/sessions-and-history.md +32 -18
- package/assets/skills/gg-guide/references/settings.md +85 -61
- package/assets/skills/gg-guide/references/troubleshooting-and-data.md +17 -3
- package/dist/app-sidecar/detached-sessions.d.ts +41 -0
- package/dist/app-sidecar/detached-sessions.js +72 -0
- package/dist/app-sidecar/detached-sessions.js.map +1 -0
- package/dist/app-sidecar/session-file-routes.d.ts +44 -0
- package/dist/app-sidecar/session-file-routes.js +175 -0
- package/dist/app-sidecar/session-file-routes.js.map +1 -0
- package/dist/app-sidecar/workspace-routes.d.ts +6 -0
- package/dist/app-sidecar/workspace-routes.js +35 -1
- package/dist/app-sidecar/workspace-routes.js.map +1 -1
- package/dist/app-sidecar.js +70 -31
- package/dist/app-sidecar.js.map +1 -1
- package/dist/core/agent-session.d.ts +6 -0
- package/dist/core/agent-session.js +19 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/claude-code/transcripts.d.ts +15 -5
- package/dist/core/claude-code/transcripts.js +90 -12
- package/dist/core/claude-code/transcripts.js.map +1 -1
- package/dist/core/project-discovery.js +17 -6
- package/dist/core/project-discovery.js.map +1 -1
- package/dist/core/subagent-manager.js +5 -2
- package/dist/core/subagent-manager.js.map +1 -1
- package/dist/core/subagent-store.d.ts +22 -0
- package/dist/core/subagent-store.js +106 -0
- package/dist/core/subagent-store.js.map +1 -1
- package/dist/core/tasks-store.d.ts +2 -0
- package/dist/core/tasks-store.js +6 -0
- package/dist/core/tasks-store.js.map +1 -1
- package/dist/goals-agent/goals-agent.d.ts +1 -8
- package/dist/goals-agent/goals-agent.js +1 -29
- package/dist/goals-agent/goals-agent.js.map +1 -1
- package/dist/modes/acp-mode.d.ts +3 -1
- package/dist/modes/acp-mode.js +84 -3
- package/dist/modes/acp-mode.js.map +1 -1
- package/package.json +4 -4
- package/dist/app-sidecar/poll.d.ts +0 -39
- package/dist/app-sidecar/poll.js +0 -184
- package/dist/app-sidecar/poll.js.map +0 -1
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { SubAgentSnapshot } from "./subagent-manager.js";
|
|
2
|
+
/**
|
|
3
|
+
* A parent's child-agent history outlives the parent's 30-day session window
|
|
4
|
+
* with room to spare: the file is rewritten whenever the parent is reopened,
|
|
5
|
+
* so only a parent nobody has opened in this long loses it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SUBAGENT_RECORD_RETENTION_DAYS = 60;
|
|
8
|
+
export interface SubAgentStorePruneResult {
|
|
9
|
+
deletedFiles: number;
|
|
10
|
+
freedBytes: number;
|
|
11
|
+
}
|
|
2
12
|
export interface PersistedSubAgentRecord extends SubAgentSnapshot {
|
|
3
13
|
agent_name?: string;
|
|
4
14
|
provider?: string;
|
|
@@ -14,6 +24,18 @@ export declare class SubAgentStore {
|
|
|
14
24
|
pathFor(cwd: string, parentSessionId: string): string;
|
|
15
25
|
load(cwd: string, parentSessionId: string): Promise<PersistedSubAgentRecord[]>;
|
|
16
26
|
save(cwd: string, parentSessionId: string, records: readonly PersistedSubAgentRecord[]): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Drop records nobody will read again: files untouched for `maxAgeDays`,
|
|
29
|
+
* empty ones, and temp files a crashed save left behind. Only `.json` and
|
|
30
|
+
* `.tmp` files directly inside a project folder are considered; symlinks are
|
|
31
|
+
* never followed and anything else is left alone.
|
|
32
|
+
*/
|
|
33
|
+
prune(options: {
|
|
34
|
+
maxAgeDays: number;
|
|
35
|
+
now?: number;
|
|
36
|
+
}): Promise<SubAgentStorePruneResult>;
|
|
37
|
+
/** `prune`, at most once a day per store, so every session open doesn't walk it. Never throws. */
|
|
38
|
+
pruneDaily(maxAgeDays: number, now?: number): Promise<void>;
|
|
17
39
|
/** Child transcripts referenced by every durable parent across every project. */
|
|
18
40
|
listChildSessionPaths(): Promise<string[]>;
|
|
19
41
|
}
|
|
@@ -9,6 +9,17 @@ const MAX_STORE_BYTES = 5 * 1024 * 1024;
|
|
|
9
9
|
const MAX_ID_CHARS = 256;
|
|
10
10
|
const MAX_TASK_NAME_CHARS = 1_000;
|
|
11
11
|
const MAX_TEXT_CHARS = 250_000;
|
|
12
|
+
/**
|
|
13
|
+
* A parent's child-agent history outlives the parent's 30-day session window
|
|
14
|
+
* with room to spare: the file is rewritten whenever the parent is reopened,
|
|
15
|
+
* so only a parent nobody has opened in this long loses it.
|
|
16
|
+
*/
|
|
17
|
+
export const SUBAGENT_RECORD_RETENTION_DAYS = 60;
|
|
18
|
+
/** An empty or leftover temp file this old was not written by a save in flight. */
|
|
19
|
+
const SETTLED_MS = 60 * 60 * 1000;
|
|
20
|
+
/** Retention re-runs at most this often per store, however many sessions open. */
|
|
21
|
+
const PRUNE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
22
|
+
const lastPrunedAt = new Map();
|
|
12
23
|
const VALID_STATES = new Set([
|
|
13
24
|
"starting",
|
|
14
25
|
"running",
|
|
@@ -64,6 +75,16 @@ export class SubAgentStore {
|
|
|
64
75
|
async save(cwd, parentSessionId, records) {
|
|
65
76
|
const filePath = this.pathFor(cwd, parentSessionId);
|
|
66
77
|
const directory = path.dirname(filePath);
|
|
78
|
+
// Nothing to remember: no file (load reads a missing one as empty), so
|
|
79
|
+
// every opened session doesn't leave an empty record behind.
|
|
80
|
+
if (records.length === 0) {
|
|
81
|
+
await fs.unlink(filePath).catch((error) => {
|
|
82
|
+
if (error.code !== "ENOENT")
|
|
83
|
+
throw error;
|
|
84
|
+
});
|
|
85
|
+
await fs.rmdir(directory).catch(() => { });
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
67
88
|
await fs.mkdir(directory, { recursive: true, mode: 0o700 });
|
|
68
89
|
await fs.chmod(this.rootDir, 0o700);
|
|
69
90
|
await fs.chmod(directory, 0o700);
|
|
@@ -90,6 +111,79 @@ export class SubAgentStore {
|
|
|
90
111
|
await fs.unlink(tempPath).catch(() => { });
|
|
91
112
|
}
|
|
92
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Drop records nobody will read again: files untouched for `maxAgeDays`,
|
|
116
|
+
* empty ones, and temp files a crashed save left behind. Only `.json` and
|
|
117
|
+
* `.tmp` files directly inside a project folder are considered; symlinks are
|
|
118
|
+
* never followed and anything else is left alone.
|
|
119
|
+
*/
|
|
120
|
+
async prune(options) {
|
|
121
|
+
const result = { deletedFiles: 0, freedBytes: 0 };
|
|
122
|
+
if (options.maxAgeDays <= 0)
|
|
123
|
+
return result;
|
|
124
|
+
const now = options.now ?? Date.now();
|
|
125
|
+
const cutoffMs = now - options.maxAgeDays * 86_400_000;
|
|
126
|
+
const projectDirectories = await fs
|
|
127
|
+
.readdir(this.rootDir, { withFileTypes: true })
|
|
128
|
+
.catch(() => []);
|
|
129
|
+
for (const projectDirectory of projectDirectories) {
|
|
130
|
+
if (!projectDirectory.isDirectory())
|
|
131
|
+
continue;
|
|
132
|
+
const directoryPath = path.join(this.rootDir, projectDirectory.name);
|
|
133
|
+
const files = await fs
|
|
134
|
+
.readdir(directoryPath, { withFileTypes: true })
|
|
135
|
+
.catch(() => []);
|
|
136
|
+
for (const file of files) {
|
|
137
|
+
if (!file.isFile())
|
|
138
|
+
continue;
|
|
139
|
+
const temp = file.name.endsWith(".tmp");
|
|
140
|
+
if (!temp && !file.name.endsWith(".json"))
|
|
141
|
+
continue;
|
|
142
|
+
const filePath = path.join(directoryPath, file.name);
|
|
143
|
+
const stat = await fs.lstat(filePath).catch(() => null);
|
|
144
|
+
if (!stat?.isFile())
|
|
145
|
+
continue;
|
|
146
|
+
const settled = stat.mtimeMs < now - SETTLED_MS;
|
|
147
|
+
const drop = stat.mtimeMs < cutoffMs ||
|
|
148
|
+
(settled &&
|
|
149
|
+
(temp || (stat.size <= MAX_STORE_BYTES && (await isEmptyDocument(filePath)))));
|
|
150
|
+
if (!drop)
|
|
151
|
+
continue;
|
|
152
|
+
try {
|
|
153
|
+
await fs.unlink(filePath);
|
|
154
|
+
result.deletedFiles += 1;
|
|
155
|
+
result.freedBytes += stat.size;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
// Raced or locked (Windows): the next pass tries again.
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
await fs.rmdir(directoryPath).catch(() => { });
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
/** `prune`, at most once a day per store, so every session open doesn't walk it. Never throws. */
|
|
166
|
+
async pruneDaily(maxAgeDays, now = Date.now()) {
|
|
167
|
+
const key = path.resolve(this.rootDir);
|
|
168
|
+
const last = lastPrunedAt.get(key);
|
|
169
|
+
if (last !== undefined && now - last < PRUNE_INTERVAL_MS)
|
|
170
|
+
return;
|
|
171
|
+
lastPrunedAt.set(key, now);
|
|
172
|
+
try {
|
|
173
|
+
const result = await this.prune({ maxAgeDays, now });
|
|
174
|
+
if (result.deletedFiles === 0)
|
|
175
|
+
return;
|
|
176
|
+
log("INFO", "subagent", "Old subagent records removed", {
|
|
177
|
+
deletedFiles: String(result.deletedFiles),
|
|
178
|
+
freedMB: (result.freedBytes / 1024 / 1024).toFixed(1),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
log("WARN", "subagent", "Subagent record retention failed", {
|
|
183
|
+
error: error instanceof Error ? error.message : String(error),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
93
187
|
/** Child transcripts referenced by every durable parent across every project. */
|
|
94
188
|
async listChildSessionPaths() {
|
|
95
189
|
const sessionPaths = new Set();
|
|
@@ -141,6 +235,18 @@ export class SubAgentStore {
|
|
|
141
235
|
return [...sessionPaths];
|
|
142
236
|
}
|
|
143
237
|
}
|
|
238
|
+
/** A record file of this version with no records: nothing to restore. */
|
|
239
|
+
async function isEmptyDocument(filePath) {
|
|
240
|
+
try {
|
|
241
|
+
const parsed = JSON.parse(await fs.readFile(filePath, "utf-8"));
|
|
242
|
+
return (parsed.version === STORE_VERSION &&
|
|
243
|
+
Array.isArray(parsed.records) &&
|
|
244
|
+
parsed.records.length === 0);
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
144
250
|
function isPersistedRecord(value) {
|
|
145
251
|
if (!value || typeof value !== "object")
|
|
146
252
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-store.js","sourceRoot":"","sources":["../../src/core/subagent-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,UAAU;IACV,SAAS;IACT,WAAW;IACX,QA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,KAAK,QAAQ;QACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;QACtC,CAAC,CAAC,MAAM,CAAC,WAAW;QACpB,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,QAAQ;QAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;QACzC,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,QAAQ;QAC7C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QAC1C,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC;QACpC,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC;QACnC,qBAAqB,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC9C,qBAAqB,CAAC,MAAM,CAAC,kBAAkB,CAAC;QAChD,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -19,6 +19,8 @@ export declare function loadTasksSync(cwd: string): TaskRecord[];
|
|
|
19
19
|
export declare function saveTasks(cwd: string, tasks: readonly TaskRecord[]): Promise<void>;
|
|
20
20
|
export declare function saveTasksSync(cwd: string, tasks: readonly TaskRecord[]): void;
|
|
21
21
|
export declare function getNextPendingTask(cwd: string): PendingTaskInfo | null;
|
|
22
|
+
/** A task's prompt plus the hint that has the agent mark it done (desktop runTaskById). */
|
|
23
|
+
export declare function taskRunPrompt(task: Pick<TaskRecord, "id" | "title" | "prompt" | "text">): string;
|
|
22
24
|
/**
|
|
23
25
|
* Drop every completed task and persist the pruned list, returning the
|
|
24
26
|
* survivors. Used by the desktop app so finished tasks disappear from the Tasks
|
package/dist/core/tasks-store.js
CHANGED
|
@@ -68,6 +68,12 @@ export function getNextPendingTask(cwd) {
|
|
|
68
68
|
prompt: pending.prompt || pending.text || pending.title,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
/** A task's prompt plus the hint that has the agent mark it done (desktop runTaskById). */
|
|
72
|
+
export function taskRunPrompt(task) {
|
|
73
|
+
const prompt = task.prompt || task.text || task.title;
|
|
74
|
+
return (`${prompt}\n\n---\nWhen you have fully completed this task, call the tasks tool to mark it done:\n` +
|
|
75
|
+
`tasks({ action: "done", id: "${task.id.slice(0, 8)}" })`);
|
|
76
|
+
}
|
|
71
77
|
/**
|
|
72
78
|
* Drop every completed task and persist the pruned list, returning the
|
|
73
79
|
* survivors. Used by the desktop app so finished tasks disappear from the Tasks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks-store.js","sourceRoot":"","sources":["../../src/core/tasks-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AAmB5D,SAAS,QAAQ,CAAC,GAAW;IAC3B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;AAC7C,CA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C,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACjC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,aAAsB,EAAE,CAAC,CAAC,CAAC,IAAI,CACxE,CAAC;IACF,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { AgentSession, type AgentSessionOptions } from "../core/agent-session.js";
|
|
2
2
|
import { type GoalBriefExtras, type GoalRecord } from "../core/goals-store.js";
|
|
3
3
|
import type { ChildModelPick } from "../core/subagent-manager.js";
|
|
4
|
-
/**
|
|
5
|
-
* Little Ken's faces in the Workers view's dialogue box. GG Goals picks one
|
|
6
|
-
* for the spoken line it ends a message with (`[ken:face] …`). Must match
|
|
7
|
-
* KEN_FACES in gg-app/src/goal-ken-talk.ts, which reads the line (an unknown
|
|
8
|
-
* face falls back to neutral there).
|
|
9
|
-
*/
|
|
10
|
-
export declare const KEN_FACES: readonly ["neutral", "happy", "excited", "thinking", "focused", "surprised", "worried", "sad", "proud", "wink"];
|
|
11
4
|
/**
|
|
12
5
|
* GG Goals: the orchestrator a Goal window talks to. It is its own agent, not
|
|
13
6
|
* GG Coder with a note attached: its identity and the goal brief form its
|
|
14
7
|
* system prompt, it has no plan mode (it plans in the conversation), and its
|
|
15
8
|
* prompt cache is keyed apart from coding sessions.
|
|
16
9
|
*/
|
|
17
|
-
export declare const GOALS_SYSTEM_PROMPT:
|
|
10
|
+
export declare const GOALS_SYSTEM_PROMPT = "You are GG Goals, inside GG Coder. The user hands you a goal and may walk away until it's done, and you own it end to end: you understand it, agree the approach with the user up front, get the work done (yourself, or with a team of workers when the work splits into big independent parts), and keep the user informed until the goal is met.\n\n## How you work\n\n- One goal, one ongoing conversation. Treat earlier messages as shared history, not as a fresh request.\n- Before the goal starts you only read (read, ls, find, web search) and ask; editing, writing, running commands and starting workers open once the user starts it.\n- Do the work yourself by default: you already know the goal and have read what matters, while a worker starts cold and re-reads everything. That covers anything connected (one project, one document, one report), anything you can finish in a few minutes, and research you can do with a few searches. Never start a single worker for work you could do yourself.\n- Start workers only for parts that are big and independent of each other, two or more at once so they run side by side: separate projects or repos, separate research topics that each need many searches, separate large documents. Do any small or connected part yourself while they run.\n- When you do the work yourself, work like your team does: change files in place (never branch, commit or push), never change the machine itself (no global installs or logins), don't read a file back after editing it, prove it with the narrowest check (a test, a build, the command itself) run as a plain command (chain checks only with &&: a check behind ; or || or in a loop can hide a failure, so it doesn't count and has to be run again), and give the URL of every source you rely on in research.\n- Your team (spawn_agent's agent): builder makes changes (writes, edits, runs commands); scout looks around the attached folders without changing anything; researcher finds things out on the web, with sources; checker checks a finished task and fixes what's wrong in the same pass. Workers change files in place for the user to review; they never branch or commit.\n- Size the team to the work: every extra worker costs a fresh start and re-reads, so split only into parts that are independent and each substantial, and start those workers together in one spawn_agent call. Give each worker everything its part needs (its tests, its section of the docs, its piece of a shared file) rather than saving that for a final worker after the rest: a final step waits for every other worker and then starts from scratch. Keep a final worker only for work that truly needs all the parts done, like a write-up drawing on all the research. Brief each worker fully, as it sees nothing of this conversation: the goal, the exact files or area, constraints, and what to report back. Set each worker's cwd to the attached folder it mostly works in; every worker can also reach the goal's other attached folders. List the files a worker needs that you've already read in its context_files, so it starts with their contents instead of reading them again; name any others by full path in the brief. Attached files are for reading (to change one, the user attaches its folder). Keep briefs to what to do and what done looks like, at the size the user asked for: never raise a target or widen the scope in a brief (a minimum stays the minimum, not a floor to aim past; a \"cover the states\" answer is not a 50-state table), since every extra is paid for in time and tokens, and a fix round should only close a real gap against what was asked. Workers already know to stop and report a blocker rather than guess.\n- Handle each worker the moment it finishes, not when they all have. Wait with wait_agent using condition \"any\" (never \"all\" while there is other work to hand out): check that worker's report, give it its next task with followup_task or start a new worker, then wait again for the rest. Steer a running worker with send_message, and stop one that has gone off track with interrupt_agent.\n- Check what a worker reports before you rely on it. When its checks passed and the report is clear, rely on it; read its output yourself only when something wasn't verified or you need its content for your summary. Send a checker only for important work you can't check by reading. When a task has a check that proves it (a test suite, a build, a command), name it in spawn_agent's checks (command_passed, written as the worker runs it in its cwd, like `npm test`; plus file_exists or file_changed for what it makes), so it's verified when the worker finishes; never send a checker just to re-run a command the builder already ran. A checker fixes what it finds itself, so never send a builder after a checker to fix its findings.\n- Keep rounds few: each task gets at most one fix round (a followup_task to the same worker, which keeps what it learned, or one checker). If it still isn't right after that, stop and tell the user what's wrong rather than going back and forth.\n- When a worker fails, times out or reports it couldn't finish, find out why from its report. If it was a passing error or a weak brief, retry once: followup_task on the same worker if it stopped normally (it keeps what it learned), or a fresh worker with a sharper brief if it crashed or timed out (a crashed worker is closed and can't take a follow-up). If it fails again, or only the user can fix the cause, stop that piece of work and tell the user plainly what failed and what you need. Never drop failed work quietly or count it as done.\n- When a worker reports a blocker, settle it yourself if the goal and this conversation already answer it, and send the answer with followup_task. Otherwise ask the user with ask_user, and keep the other workers going while you wait for their answer.\n- Work that needs the user's own accounts or machine (a login, credentials, installing software system-wide, payments) belongs in the briefing, before the start: find out then what's installed and whether they're signed in, by asking. If after the start it turns out to be missing, stop that piece of work and tell the user what they need to do; never have a worker install or sign in on their behalf.\n- Once the goal has started, the user may be away: ask them only when work can't go on without a decision only they can make. Settle small follow-on choices yourself (tidying, naming, an obvious next step inside the goal) and say what you chose in your summary; offer optional extras in the summary instead of asking.\n- When the user messages you while workers are running, answer them first in a short message (where each piece of work stands), then go back to waiting. Never leave a message unanswered until the end.\n- Before your final summary, collect every finished worker's report (wait_agent with their agent_ids), so you write the summary once, complete.\n- Ask the user only for what you cannot look up.\n- Be exact about status. Never say something is done, fixed or verified unless you checked it, and say plainly when something could not be checked.\n- Keep the user in the loop without flooding them: short updates when something finishes, needs a decision, or is blocked.\n\n## Talking to the user\n\nPlain words, short paragraphs, no jargon the user did not use. Lead with the answer or the outcome. Use ask_user for real decisions, with your recommendation marked; never ask in prose what a clickable choice can answer.";
|
|
18
11
|
/** Agent tools GG Goals always has, instead of finding them via tool_search. */
|
|
19
12
|
export declare const GOALS_CORE_TOOLS: readonly string[];
|
|
20
13
|
export type GoalsAgentOptions = Omit<AgentSessionOptions, "agentPrompt" | "agentRole" | "agentContext" | "systemPrompt" | "promptCacheKeyPrefix" | "getSystemPromptTail" | "onEnterPlan" | "onExitPlan" | "planSubmissionGate" | "coreTools" | "wrapTool" | "withoutTools" | "subAgents" | "shareRootsWithSubAgents" | "defaultSubAgent"> & {
|
|
@@ -4,24 +4,6 @@ import { collectProjectContext } from "../system-prompt.js";
|
|
|
4
4
|
import { getModel, withoutPaidTier } from "../core/model-registry.js";
|
|
5
5
|
import { holdGoalRun } from "../core/goal-run-marker.js";
|
|
6
6
|
import { GOAL_TEAM } from "./goal-team.js";
|
|
7
|
-
/**
|
|
8
|
-
* Little Ken's faces in the Workers view's dialogue box. GG Goals picks one
|
|
9
|
-
* for the spoken line it ends a message with (`[ken:face] …`). Must match
|
|
10
|
-
* KEN_FACES in gg-app/src/goal-ken-talk.ts, which reads the line (an unknown
|
|
11
|
-
* face falls back to neutral there).
|
|
12
|
-
*/
|
|
13
|
-
export const KEN_FACES = [
|
|
14
|
-
"neutral",
|
|
15
|
-
"happy",
|
|
16
|
-
"excited",
|
|
17
|
-
"thinking",
|
|
18
|
-
"focused",
|
|
19
|
-
"surprised",
|
|
20
|
-
"worried",
|
|
21
|
-
"sad",
|
|
22
|
-
"proud",
|
|
23
|
-
"wink",
|
|
24
|
-
];
|
|
25
7
|
/**
|
|
26
8
|
* GG Goals: the orchestrator a Goal window talks to. It is its own agent, not
|
|
27
9
|
* GG Coder with a note attached: its identity and the goal brief form its
|
|
@@ -54,17 +36,7 @@ export const GOALS_SYSTEM_PROMPT = `You are GG Goals, inside GG Coder. The user
|
|
|
54
36
|
|
|
55
37
|
## Talking to the user
|
|
56
38
|
|
|
57
|
-
Plain words, short paragraphs, no jargon the user did not use. Lead with the answer or the outcome. Use ask_user for real decisions, with your recommendation marked; never ask in prose what a clickable choice can answer
|
|
58
|
-
|
|
59
|
-
## Your line on the farm
|
|
60
|
-
|
|
61
|
-
Once the goal has started, the user often watches the Workers view instead of the chat, where you are little Ken on a farm with a dialogue box that pops up now and then. Short progress notes between tool calls are said there as they are, so keep those to one plain sentence or two. After the start, the message that ends your turn (your summary, a blocker, a question) always ends with one spoken line for it, as its very last line and nowhere else, in exactly this form:
|
|
62
|
-
|
|
63
|
-
[ken:face] what you'd say out loud
|
|
64
|
-
|
|
65
|
-
- face is one of: ${KEN_FACES.join(", ")}. Match the moment: focused while working, happy when a part is done, proud when a result beats the target, surprised when you find something, worried about a risk, sad when something failed, excited when the goal is reached, thinking when weighing a choice, wink for a tip, neutral otherwise.
|
|
66
|
-
- The line is one or two short sentences (under 120 characters) of plain speech, the gist for someone glancing over: no Markdown, tables, code, file paths or links. For example: [ken:happy] Images done. Mobile load is down to 1.4 seconds.
|
|
67
|
-
- The chat hides this line, so never refer to it, and keep everything the user needs in the message itself. Skip it before the start.`;
|
|
39
|
+
Plain words, short paragraphs, no jargon the user did not use. Lead with the answer or the outcome. Use ask_user for real decisions, with your recommendation marked; never ask in prose what a clickable choice can answer.`;
|
|
68
40
|
/** Agent tools GG Goals always has, instead of finding them via tool_search. */
|
|
69
41
|
export const GOALS_CORE_TOOLS = [
|
|
70
42
|
"spawn_agent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goals-agent.js","sourceRoot":"","sources":["../../src/goals-agent/goals-agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA4B,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GAGjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qB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ACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/modes/acp-mode.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ChildModelPick, SubAgentSnapshot } from "../core/subagent-manager.
|
|
|
5
5
|
import { createAskUserTool } from "../tools/ask-user.js";
|
|
6
6
|
import { type GoalBriefExtras, type GoalRecord } from "../core/goals-store.js";
|
|
7
7
|
import type { EventBus } from "../core/event-bus.js";
|
|
8
|
-
import type { AutopilotMarkerPayload } from "../core/session-manager.js";
|
|
8
|
+
import type { AppMarkerPayload, AutopilotMarkerPayload } from "../core/session-manager.js";
|
|
9
9
|
import { type AcpKenReviewer } from "./acp-autopilot.js";
|
|
10
10
|
/** The ACP major version this mode implements. Bumped only for breaking changes. */
|
|
11
11
|
export declare const ACP_PROTOCOL_VERSION = 1;
|
|
@@ -75,6 +75,8 @@ export interface AcpAgentSession {
|
|
|
75
75
|
body?: string;
|
|
76
76
|
}): Promise<void>;
|
|
77
77
|
getAutopilotMarkers?(): AutopilotMarkerPayload[];
|
|
78
|
+
/** The "task" header a resumed task session shows; optional for test doubles. */
|
|
79
|
+
persistAppMarker?(kind: AppMarkerPayload["kind"], data: Record<string, unknown>): Promise<void>;
|
|
78
80
|
/** The conversation as restored, used to replay history to the client. */
|
|
79
81
|
getMessages(): Message[];
|
|
80
82
|
switchModel(provider: string, model: string): Promise<void>;
|
package/dist/modes/acp-mode.js
CHANGED
|
@@ -41,6 +41,7 @@ import { findSessionById, listAllSessions, listSessionSummaries, loadSessionChec
|
|
|
41
41
|
import { getHistoryMessageVisibility, normalizeAutopilotMarkersForHistory, reconstructCheckpointHistory, restoreUserRow, } from "../core/session-history.js";
|
|
42
42
|
import { findUserSessionPrompt } from "../core/session-preview.js";
|
|
43
43
|
import { sessionGroupPaths } from "../core/session-storage.js";
|
|
44
|
+
import { loadTasks, markTaskInProgress, pruneDoneTasksSync, taskRunPrompt, } from "../core/tasks-store.js";
|
|
44
45
|
import { extractPlanSteps, findCompletedMarkers, markStepsCompleted, rebasePlanSteps, } from "../utils/plan-steps.js";
|
|
45
46
|
import { formatUserError } from "../utils/error-handler.js";
|
|
46
47
|
import { closeLogger } from "../core/logger.js";
|
|
@@ -1130,7 +1131,7 @@ export async function runAcpMode(options) {
|
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
1132
1133
|
/** A build turn plus the settle steps (autopilot hook, plan offer, checklist). */
|
|
1133
|
-
async function runBuildTurn(text, work) {
|
|
1134
|
+
async function runBuildTurn(text, work, options = {}) {
|
|
1134
1135
|
const target = session;
|
|
1135
1136
|
const before = checklistStamp();
|
|
1136
1137
|
const messagesBefore = target?.getMessages() ?? [];
|
|
@@ -1141,8 +1142,9 @@ export async function runAcpMode(options) {
|
|
|
1141
1142
|
};
|
|
1142
1143
|
let result = await runTurn(work);
|
|
1143
1144
|
if (target && target === session) {
|
|
1144
|
-
if (!cancelled)
|
|
1145
|
+
if (!cancelled && options.autopilot !== false) {
|
|
1145
1146
|
result = await afterBuildTurn(target, result, turn);
|
|
1147
|
+
}
|
|
1146
1148
|
offerPendingPlan();
|
|
1147
1149
|
if (checklistStamp() !== before) {
|
|
1148
1150
|
write({ jsonrpc: "2.0", method: "_gg/checklist_changed", params: { sessionId } });
|
|
@@ -1190,6 +1192,72 @@ export async function runAcpMode(options) {
|
|
|
1190
1192
|
if (planFile)
|
|
1191
1193
|
adoptPlan(planFile);
|
|
1192
1194
|
}
|
|
1195
|
+
/** `_meta.gg.taskRun` on a `session/prompt`: run one task from the project list. */
|
|
1196
|
+
function taskRunOf(params) {
|
|
1197
|
+
const raw = params?._meta?.gg
|
|
1198
|
+
?.taskRun;
|
|
1199
|
+
if (!raw || typeof raw !== "object")
|
|
1200
|
+
return null;
|
|
1201
|
+
const { id } = raw;
|
|
1202
|
+
if (typeof id !== "string" || !id)
|
|
1203
|
+
throw new InvalidParams("taskRun.id must be a string.");
|
|
1204
|
+
return { id };
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Desktop runTaskById: fresh context under the same ACP sessionId, the task
|
|
1208
|
+
* marked in progress, `_gg/session_reset` tagged with it, then the task turn.
|
|
1209
|
+
*/
|
|
1210
|
+
async function handleTaskRun(run) {
|
|
1211
|
+
const target = session;
|
|
1212
|
+
if (!target)
|
|
1213
|
+
throw new InvalidParams("No session. Call session/new first.");
|
|
1214
|
+
if (goal)
|
|
1215
|
+
throw new InvalidParams("Tasks are for coding sessions.");
|
|
1216
|
+
if (!target.newSession)
|
|
1217
|
+
throw new InvalidParams("This session can't start a task.");
|
|
1218
|
+
const task = (await loadTasks(sessionCwd)).find((t) => t.id === run.id);
|
|
1219
|
+
if (!task)
|
|
1220
|
+
throw new InvalidParams("That task no longer exists.");
|
|
1221
|
+
if (task.status !== "pending") {
|
|
1222
|
+
throw new InvalidParams(task.status === "done" ? "That task is already done." : "That task is already running.");
|
|
1223
|
+
}
|
|
1224
|
+
// The old context's questions and plan die with it.
|
|
1225
|
+
cancelPendingAsks();
|
|
1226
|
+
clearPendingPlan();
|
|
1227
|
+
const wasPlanMode = target.getPlanMode();
|
|
1228
|
+
await target.newSession();
|
|
1229
|
+
titleAnnounced = false;
|
|
1230
|
+
planPath = undefined;
|
|
1231
|
+
planSteps = [];
|
|
1232
|
+
completedSteps.clear();
|
|
1233
|
+
if (wasPlanMode)
|
|
1234
|
+
notifyModeChange(MODE_DEFAULT);
|
|
1235
|
+
markTaskInProgress(sessionCwd, task.id);
|
|
1236
|
+
void target.persistAppMarker?.("task", { title: task.title }).catch(() => { });
|
|
1237
|
+
write({
|
|
1238
|
+
jsonrpc: "2.0",
|
|
1239
|
+
method: "_gg/session_reset",
|
|
1240
|
+
params: {
|
|
1241
|
+
sessionId,
|
|
1242
|
+
agentSessionId: target.getState().sessionId,
|
|
1243
|
+
task: { id: task.id, title: task.title },
|
|
1244
|
+
},
|
|
1245
|
+
});
|
|
1246
|
+
notifyPlanState();
|
|
1247
|
+
try {
|
|
1248
|
+
// Task runs never start an autopilot cycle, as on the desktop.
|
|
1249
|
+
return await runBuildTurn(task.title, (t) => t.prompt(taskRunPrompt(task), AUTOMATION_PROVENANCE), { autopilot: false });
|
|
1250
|
+
}
|
|
1251
|
+
finally {
|
|
1252
|
+
pruneDoneTasksSync(sessionCwd);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
async function handleTasks(params) {
|
|
1256
|
+
activeSession(params, "_gg/tasks");
|
|
1257
|
+
if (goal)
|
|
1258
|
+
throw new InvalidParams("Tasks are for coding sessions.");
|
|
1259
|
+
return { tasks: await loadTasks(sessionCwd) };
|
|
1260
|
+
}
|
|
1193
1261
|
/** Desktop reenterPlanModeForRevision. */
|
|
1194
1262
|
async function reenterPlanModeForRevision(target) {
|
|
1195
1263
|
if (target.getPlanMode())
|
|
@@ -1674,7 +1742,15 @@ export async function runAcpMode(options) {
|
|
|
1674
1742
|
// GG's own extensions (custom `_gg/*` methods). Clients that don't
|
|
1675
1743
|
// read this see standard ACP only.
|
|
1676
1744
|
_meta: {
|
|
1677
|
-
gg: {
|
|
1745
|
+
gg: {
|
|
1746
|
+
queue: 1,
|
|
1747
|
+
askUser: 1,
|
|
1748
|
+
goals: 1,
|
|
1749
|
+
planReview: 1,
|
|
1750
|
+
autopilot: 1,
|
|
1751
|
+
checklist: 1,
|
|
1752
|
+
tasks: 1,
|
|
1753
|
+
},
|
|
1678
1754
|
},
|
|
1679
1755
|
},
|
|
1680
1756
|
authMethods: [],
|
|
@@ -2059,6 +2135,9 @@ export async function runAcpMode(options) {
|
|
|
2059
2135
|
const decision = planDecisionOf(params);
|
|
2060
2136
|
if (decision)
|
|
2061
2137
|
return handlePlanDecision(decision);
|
|
2138
|
+
const taskRun = taskRunOf(params);
|
|
2139
|
+
if (taskRun)
|
|
2140
|
+
return handleTaskRun(taskRun);
|
|
2062
2141
|
const text = promptText(params);
|
|
2063
2142
|
const images = acpImageAttachments(params?.prompt);
|
|
2064
2143
|
if (!text && images.length === 0) {
|
|
@@ -2300,6 +2379,8 @@ export async function runAcpMode(options) {
|
|
|
2300
2379
|
return handleAutopilotSet(params);
|
|
2301
2380
|
case "_gg/checklist":
|
|
2302
2381
|
return handleChecklist(params);
|
|
2382
|
+
case "_gg/tasks":
|
|
2383
|
+
return handleTasks(params);
|
|
2303
2384
|
default:
|
|
2304
2385
|
return undefined;
|
|
2305
2386
|
}
|