@plume-canvas/plugin-agent 0.0.0-stage → 0.1.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/dist/plugin-agent.js.map +1 -0
- package/dist/server.js +185292 -0
- package/dist/vendor-plugins/goal/hooks/lib.mjs +233 -0
- package/dist/vendor-plugins/goal/hooks/start.mjs +32 -0
- package/dist/vendor-plugins/goal/hooks/stop.mjs +105 -0
- package/dist/vendor-plugins/goal/icon.svg +6 -0
- package/dist/vendor-plugins/goal/plugin.json +22 -0
- package/dist/web.js +23 -0
- package/package.json +62 -4
- package/README.md +0 -3
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// Shared by start.mjs and stop.mjs: the Trace reader, the GOAL.json state file, and the
|
|
2
|
+
// round message. Plain Node, builtins only — this file is installed verbatim into an
|
|
3
|
+
// Agent's agent_state/hooks/goal/ and runs wherever the harness runs.
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
|
|
7
|
+
/** The state file's name inside the Session's scratchpad directory. */
|
|
8
|
+
export const GOAL_FILE = "GOAL.json";
|
|
9
|
+
|
|
10
|
+
/** Rounds after which an unbudgeted goal is cut off anyway (a runaway backstop, not a knob). */
|
|
11
|
+
export const MAX_ROUNDS = 100;
|
|
12
|
+
|
|
13
|
+
/** Reads a JSONL Trace file tolerantly: malformed lines are skipped. */
|
|
14
|
+
export function readTrace(file) {
|
|
15
|
+
let text;
|
|
16
|
+
try {
|
|
17
|
+
text = fs.readFileSync(file, "utf8");
|
|
18
|
+
} catch {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const records = [];
|
|
22
|
+
for (const line of text.split("\n")) {
|
|
23
|
+
if (!line.trim()) continue;
|
|
24
|
+
try {
|
|
25
|
+
records.push(JSON.parse(line));
|
|
26
|
+
} catch {
|
|
27
|
+
// A torn tail or a foreign line: not ours to repair.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return records;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The Session's scratchpad directory, derived from the Trace's session_meta (`agent_state` is `<agent dir>/agent_state`). */
|
|
34
|
+
export function scratchpadDirOf(records, sessionId) {
|
|
35
|
+
const meta = records.find((r) => r && r.type === "session_meta");
|
|
36
|
+
const agentState = meta && meta.payload && meta.payload.agent_state;
|
|
37
|
+
if (typeof agentState !== "string" || !agentState) return null;
|
|
38
|
+
return path.join(path.dirname(agentState), "scratchpad", sessionId);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Reads GOAL.json: `null` when missing, `"broken"` when unreadable as a JSON object (see `ended` for who wrote a terminal status). */
|
|
42
|
+
export function readGoal(file) {
|
|
43
|
+
let raw;
|
|
44
|
+
try {
|
|
45
|
+
raw = fs.readFileSync(file, "utf8");
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(raw);
|
|
51
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return "broken";
|
|
52
|
+
return {
|
|
53
|
+
objective: typeof parsed.objective === "string" ? parsed.objective : "",
|
|
54
|
+
status: typeof parsed.status === "string" ? parsed.status : "blocked",
|
|
55
|
+
budget: Number.isFinite(parsed.budget) ? parsed.budget : -1,
|
|
56
|
+
round: Number.isFinite(parsed.round) ? parsed.round : 0,
|
|
57
|
+
tokens_used: Number.isFinite(parsed.tokens_used) ? parsed.tokens_used : 0,
|
|
58
|
+
// Set by the stop hook when it ends the goal, whatever the status: the model only ever
|
|
59
|
+
// writes `status`, so a terminal status without it is a verdict this run has yet to act on.
|
|
60
|
+
...(parsed.ended === true ? { ended: true } : {}),
|
|
61
|
+
};
|
|
62
|
+
} catch {
|
|
63
|
+
return "broken";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function writeGoal(file, goal) {
|
|
68
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
69
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
70
|
+
fs.writeFileSync(tmp, `${JSON.stringify(goal, null, 2)}\n`);
|
|
71
|
+
fs.renameSync(tmp, file);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Whether a Trace record is a round's injected input: a main-session harness-injected user
|
|
76
|
+
* text (`sender: "harness"`) that is not a background-task completion notice — notices share
|
|
77
|
+
* the stamp but ride inside a round as reports, and treating one as a boundary would drop
|
|
78
|
+
* part of the round from the usage count. Each round input starts a new accounting window.
|
|
79
|
+
*/
|
|
80
|
+
export function isRoundInput(record) {
|
|
81
|
+
if (!record || record.type !== "model_msg" || (record.origin && record.origin.length))
|
|
82
|
+
return false;
|
|
83
|
+
const p = record.payload;
|
|
84
|
+
if (!p || p.type !== "text" || p.role !== "user" || p.sender !== "harness") return false;
|
|
85
|
+
return !/^\[background_task_done\]/.test(p.text || "");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Uncached input + output of one token_usage record (`request.total − cache_read`); 0 for anything else. */
|
|
89
|
+
export function uncachedTokens(record) {
|
|
90
|
+
if (!record || record.type !== "event_msg") return 0;
|
|
91
|
+
const p = record.payload;
|
|
92
|
+
if (!p || p.type !== "token_usage" || !p.request) return 0;
|
|
93
|
+
return Math.max(0, (p.request.total || 0) - (p.request.cache_read || 0));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The records of the round that just ended: everything after the last round input, or the
|
|
98
|
+
* whole file when there is none in it (a compaction rotated the file mid-round).
|
|
99
|
+
*/
|
|
100
|
+
export function lastRoundRecords(records) {
|
|
101
|
+
let start = 0;
|
|
102
|
+
records.forEach((r, i) => {
|
|
103
|
+
if (isRoundInput(r)) start = i + 1;
|
|
104
|
+
});
|
|
105
|
+
return records.slice(start);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* How the round's Task ended, read off its records: an `abort` event is the user's
|
|
110
|
+
* interruption; a last `request_end` that is not completed is a failure the run gave up on;
|
|
111
|
+
* a last assistant text with a fatal stop reason is the max_turns cap. Anything else completed.
|
|
112
|
+
*/
|
|
113
|
+
export function stopReasonOf(roundRecords) {
|
|
114
|
+
let lastRequestEnd = null;
|
|
115
|
+
let lastAssistant = null;
|
|
116
|
+
for (const r of roundRecords) {
|
|
117
|
+
if (!r || (r.origin && r.origin.length)) continue;
|
|
118
|
+
const p = r.payload || {};
|
|
119
|
+
if (r.type === "event_msg" && p.type === "abort") return "aborted";
|
|
120
|
+
if (r.type === "event_msg" && p.type === "request_end") lastRequestEnd = p;
|
|
121
|
+
if (r.type === "model_msg" && p.type === "text" && p.role === "assistant") lastAssistant = p;
|
|
122
|
+
}
|
|
123
|
+
if (lastRequestEnd && lastRequestEnd.status !== "completed") return "fatal";
|
|
124
|
+
const stop = lastAssistant && lastAssistant.stop_reason;
|
|
125
|
+
if (stop === "fatal" || stop === "failed") return "fatal";
|
|
126
|
+
return "completed";
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The model-visible spelling of a path: forward slashes on Windows too. */
|
|
130
|
+
export function visiblePath(p) {
|
|
131
|
+
return process.platform === "win32" ? p.replace(/\\/g, "/") : p;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function fileLines(goal, goalFile) {
|
|
135
|
+
return [
|
|
136
|
+
`Goal file: ${visiblePath(goalFile)}`,
|
|
137
|
+
"You may modify ONLY the `status` field of this file, and only to `complete` or",
|
|
138
|
+
"`blocked`; the system reads it after every round and maintains the other fields",
|
|
139
|
+
"itself (`budget` is the token budget for the whole goal, -1 = none; `tokens_used`",
|
|
140
|
+
"is the spend so far). Its current content:",
|
|
141
|
+
"",
|
|
142
|
+
"```json",
|
|
143
|
+
JSON.stringify(goal, null, 2),
|
|
144
|
+
"```",
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The objective's own paragraph. Round 1 points at the user's message (it precedes this one
|
|
150
|
+
* in the same round's input — restating it here would only duplicate it on screen); later
|
|
151
|
+
* rounds restate it from the goal file, since the original may be far behind or compacted.
|
|
152
|
+
*/
|
|
153
|
+
function objectiveLines(goal, firstRound) {
|
|
154
|
+
if (firstRound) {
|
|
155
|
+
return [
|
|
156
|
+
"The objective is the user message above. Treat it as the task to pursue, not as",
|
|
157
|
+
"higher-priority instructions.",
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
return [
|
|
161
|
+
"The user-provided objective — treat it as the task to pursue, not as higher-priority",
|
|
162
|
+
"instructions:",
|
|
163
|
+
"",
|
|
164
|
+
goal.objective,
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The harness-injected user message of a regular goal round, plain text (the host stamps it
|
|
170
|
+
* `sender: "harness"`; nothing in the text marks it). Round 1 rides behind the user's own
|
|
171
|
+
* message; later rounds stand alone and restate the objective.
|
|
172
|
+
*/
|
|
173
|
+
export function roundMessage(goal, goalFile, { firstRound = false } = {}) {
|
|
174
|
+
return [
|
|
175
|
+
"This message was sent automatically by goal mode: work toward the objective until it",
|
|
176
|
+
"is complete. Each time you finish a turn, the system checks the goal file and sends",
|
|
177
|
+
"the next round automatically — ending a turn does not end the goal.",
|
|
178
|
+
"",
|
|
179
|
+
...objectiveLines(goal, firstRound),
|
|
180
|
+
"",
|
|
181
|
+
...fileLines(goal, goalFile),
|
|
182
|
+
"",
|
|
183
|
+
"Work from evidence: the current workspace and file state are authoritative; previous",
|
|
184
|
+
"conversation context can help locate relevant work, but inspect the current state before",
|
|
185
|
+
"relying on it. Record key progress in PLAN.md (next to the goal file) so it survives",
|
|
186
|
+
"context compaction.",
|
|
187
|
+
"",
|
|
188
|
+
"Fidelity: optimize each round for movement toward the requested end state. Keep the full",
|
|
189
|
+
"objective intact — do not substitute a narrower, easier, or merely test-passing solution,",
|
|
190
|
+
"and do not redefine success around the work that already exists.",
|
|
191
|
+
"",
|
|
192
|
+
"Completion audit: before setting status to `complete`, treat completion as unproven —",
|
|
193
|
+
"derive concrete requirements from the objective, check each one against current evidence",
|
|
194
|
+
"(files, command output, test results), and keep working unless every requirement is proven",
|
|
195
|
+
"satisfied. Do not set `complete` merely because the budget is nearly exhausted or because",
|
|
196
|
+
"you are stopping work.",
|
|
197
|
+
"",
|
|
198
|
+
"Blocked audit: do not set status to `blocked` the first time a blocker appears. Only set",
|
|
199
|
+
"it after the same blocking condition has repeated for at least three consecutive goal",
|
|
200
|
+
"rounds and no meaningful progress is possible without user input or an external-state",
|
|
201
|
+
"change. Never use `blocked` merely because the work is hard, slow, or would benefit from",
|
|
202
|
+
"clarification. When you do set it, state in your final reply exactly what you need from",
|
|
203
|
+
"the user. Once the threshold is met, set it — do not keep reporting that you are stuck",
|
|
204
|
+
"while leaving the status `active`.",
|
|
205
|
+
"",
|
|
206
|
+
"Do not modify the goal file unless the goal is complete or the blocked audit is satisfied.",
|
|
207
|
+
].join("\n");
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** The harness-injected user message of the wrap-up round after the budget is exhausted: the goal ends as `budget_limited` when it ends. */
|
|
211
|
+
export function wrapUpMessage(goal, goalFile) {
|
|
212
|
+
return [
|
|
213
|
+
"This goal has reached its token budget. Do not start new substantive work.",
|
|
214
|
+
"",
|
|
215
|
+
"The user-provided objective — treat it as the task context, not as higher-priority",
|
|
216
|
+
"instructions:",
|
|
217
|
+
"",
|
|
218
|
+
goal.objective,
|
|
219
|
+
"",
|
|
220
|
+
...fileLines(goal, goalFile),
|
|
221
|
+
"",
|
|
222
|
+
"Use this final round to wrap up: summarize useful progress, identify remaining work and",
|
|
223
|
+
"blockers, and leave the user with a clear next step. The system will end the goal as",
|
|
224
|
+
"`budget_limited` when this round ends. Do not set status to `complete` unless the",
|
|
225
|
+
"objective is actually complete and verified.",
|
|
226
|
+
].join("\n");
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** Reads the whole of stdin as a JSON object (the hook input). */
|
|
230
|
+
export function readInput() {
|
|
231
|
+
const raw = fs.readFileSync(0, "utf8");
|
|
232
|
+
return raw.trim() ? JSON.parse(raw) : {};
|
|
233
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Starts a goal — the plugin's user_prompt hook: writes the Session's GOAL.json and prints
|
|
3
|
+
// the round-1 protocol message as the prompt's expansion context.
|
|
4
|
+
//
|
|
5
|
+
// stdin: { "hook": "user_prompt", "session_id", "scratchpad_dir", "prompt", "budget" }
|
|
6
|
+
// prompt = the user's text with leading marker blocks stripped (the objective later
|
|
7
|
+
// rounds restate and the file records); budget = tokens for the whole goal, -1 or
|
|
8
|
+
// absent = none.
|
|
9
|
+
// stdout: { "context": "<round-1 protocol message>" } — the host sends it right AFTER the
|
|
10
|
+
// user's own message (and any images), stamped `sender: "harness"`; the protocol
|
|
11
|
+
// text points back at that message as the objective.
|
|
12
|
+
//
|
|
13
|
+
// The host runs this when a user submits the prompt that starts a goal (the harness server
|
|
14
|
+
// does so for the `goal` field of POST /tasks); the stop hook (stop.mjs) drives every
|
|
15
|
+
// later round.
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { GOAL_FILE, readInput, roundMessage, writeGoal } from "./lib.mjs";
|
|
18
|
+
|
|
19
|
+
const input = readInput();
|
|
20
|
+
const scratchpadDir = String(input.scratchpad_dir || "");
|
|
21
|
+
const objective = String(input.prompt || "").trim();
|
|
22
|
+
if (!scratchpadDir || !objective) {
|
|
23
|
+
process.stderr.write("start.mjs: scratchpad_dir and a non-empty prompt are required\n");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const budget = Number.isFinite(input.budget) && input.budget > 0 ? Math.round(input.budget) : -1;
|
|
27
|
+
const goalFile = path.join(scratchpadDir, GOAL_FILE);
|
|
28
|
+
const goal = { objective, status: "active", budget, round: 1, tokens_used: 0 };
|
|
29
|
+
writeGoal(goalFile, goal);
|
|
30
|
+
process.stdout.write(
|
|
31
|
+
`${JSON.stringify({ context: roundMessage(goal, goalFile, { firstRound: true }) })}\n`,
|
|
32
|
+
);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Goal mode's stop hook: consulted after every Task of a run. Reads the Session's Trace to
|
|
3
|
+
// find its GOAL.json and this round's token usage, then either injects the next round's
|
|
4
|
+
// protocol message (the host stamps it `sender: "harness"`) or ends the goal.
|
|
5
|
+
//
|
|
6
|
+
// stdin: { "hook": "stop", "session_id", "trace_path" }
|
|
7
|
+
// stdout: nothing when no goal is live on this Session; otherwise
|
|
8
|
+
// { "decision": "continue", "input": "<next round>", "reason", "output": {…} } or
|
|
9
|
+
// { "decision": "stop", "reason", "output": { status, round, tokens_used, budget } }
|
|
10
|
+
//
|
|
11
|
+
// The decision, first match wins: the file says complete / blocked → that outcome; the Task
|
|
12
|
+
// was cut off (abort, a failure the run gave up on, the max_turns cap — the model never got
|
|
13
|
+
// to write the file) → aborted; the wrap-up round just ran → budget_limited; the round cap →
|
|
14
|
+
// aborted; the budget is reached → one wrap-up round; otherwise → the next round. Every
|
|
15
|
+
// ending is written back with `ended: true` — the model only ever writes `status`, so that
|
|
16
|
+
// flag is what tells a goal this run just ended from one that ended on an earlier run (the
|
|
17
|
+
// hook stays silent for those). A file that no longer parses ends the goal as blocked and is
|
|
18
|
+
// moved aside as GOAL.json.broken.
|
|
19
|
+
import fs from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import {
|
|
22
|
+
GOAL_FILE,
|
|
23
|
+
MAX_ROUNDS,
|
|
24
|
+
lastRoundRecords,
|
|
25
|
+
readGoal,
|
|
26
|
+
readInput,
|
|
27
|
+
readTrace,
|
|
28
|
+
roundMessage,
|
|
29
|
+
scratchpadDirOf,
|
|
30
|
+
stopReasonOf,
|
|
31
|
+
uncachedTokens,
|
|
32
|
+
wrapUpMessage,
|
|
33
|
+
writeGoal,
|
|
34
|
+
} from "./lib.mjs";
|
|
35
|
+
|
|
36
|
+
const input = readInput();
|
|
37
|
+
const sessionId = String(input.session_id || "");
|
|
38
|
+
const tracePath = typeof input.trace_path === "string" ? input.trace_path : "";
|
|
39
|
+
if (!sessionId || !tracePath) process.exit(0);
|
|
40
|
+
|
|
41
|
+
const records = readTrace(tracePath);
|
|
42
|
+
const scratchpad = scratchpadDirOf(records, sessionId);
|
|
43
|
+
if (!scratchpad) process.exit(0);
|
|
44
|
+
const goalFile = path.join(scratchpad, GOAL_FILE);
|
|
45
|
+
const goal = readGoal(goalFile);
|
|
46
|
+
if (goal === null) process.exit(0);
|
|
47
|
+
|
|
48
|
+
const emit = (result) => process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
49
|
+
const record = (g) => ({
|
|
50
|
+
status: g.status,
|
|
51
|
+
round: g.round,
|
|
52
|
+
tokens_used: g.tokens_used,
|
|
53
|
+
budget: g.budget,
|
|
54
|
+
});
|
|
55
|
+
const tokens = (g) => `tokens ${g.tokens_used}${g.budget > 0 ? ` / ${g.budget}` : ""}`;
|
|
56
|
+
const stop = (g, outcome, write) => {
|
|
57
|
+
g.status = outcome;
|
|
58
|
+
g.ended = true;
|
|
59
|
+
if (write) writeGoal(goalFile, g);
|
|
60
|
+
emit({
|
|
61
|
+
decision: "stop",
|
|
62
|
+
reason: `${outcome} · ${g.round} round${g.round === 1 ? "" : "s"} · ${tokens(g)}`,
|
|
63
|
+
output: record(g),
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
if (goal === "broken") {
|
|
68
|
+
fs.renameSync(goalFile, `${goalFile}.broken`);
|
|
69
|
+
stop(
|
|
70
|
+
{ objective: "", status: "blocked", budget: -1, round: 0, tokens_used: 0 },
|
|
71
|
+
"blocked",
|
|
72
|
+
false,
|
|
73
|
+
);
|
|
74
|
+
process.exit(0);
|
|
75
|
+
}
|
|
76
|
+
// A goal that already ended on this Session (an earlier run) is not this run's business.
|
|
77
|
+
if (goal.ended) process.exit(0);
|
|
78
|
+
|
|
79
|
+
const round = lastRoundRecords(records);
|
|
80
|
+
goal.tokens_used += round.reduce((n, r) => n + uncachedTokens(r), 0);
|
|
81
|
+
|
|
82
|
+
if (goal.status === "complete" || goal.status === "blocked") {
|
|
83
|
+
stop(goal, goal.status, true);
|
|
84
|
+
} else if (goal.status !== "active" && goal.status !== "wrapping_up") {
|
|
85
|
+
// Anything else in `status` is outside the protocol the model was given: a broken channel.
|
|
86
|
+
stop(goal, "blocked", true);
|
|
87
|
+
} else if (stopReasonOf(round) !== "completed") {
|
|
88
|
+
stop(goal, "aborted", true);
|
|
89
|
+
} else if (goal.status === "wrapping_up") {
|
|
90
|
+
stop(goal, "budget_limited", true);
|
|
91
|
+
} else if (goal.round >= MAX_ROUNDS) {
|
|
92
|
+
stop(goal, "aborted", true);
|
|
93
|
+
} else {
|
|
94
|
+
goal.round += 1;
|
|
95
|
+
const wrapUp = goal.budget > 0 && goal.tokens_used >= goal.budget;
|
|
96
|
+
goal.status = wrapUp ? "wrapping_up" : "active";
|
|
97
|
+
writeGoal(goalFile, goal);
|
|
98
|
+
const compose = wrapUp ? wrapUpMessage : roundMessage;
|
|
99
|
+
emit({
|
|
100
|
+
decision: "continue",
|
|
101
|
+
input: compose(goal, goalFile),
|
|
102
|
+
reason: `round ${goal.round}${wrapUp ? " (wrap-up: budget reached)" : ""} · ${tokens(goal)}`,
|
|
103
|
+
output: record(goal),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<path d="M21 12a9 9 0 1 1-9-9" />
|
|
3
|
+
<path d="M17 12a5 5 0 1 1-5-5" />
|
|
4
|
+
<path d="M12 12l3-3" />
|
|
5
|
+
<path d="M15 9V5l3-3v4h4l-3 3h-4" />
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Goal mode: a stop hook that keeps the session working toward an objective — re-injecting it every round and checking the goal file — until the goal is complete, blocked, or out of token budget.",
|
|
3
|
+
"description_zh": "目标模式:一个 stop hook,让会话持续朝目标工作——每轮重新注入目标并检查目标文件——直到目标完成、受阻或 token 预算耗尽。",
|
|
4
|
+
"short_description": "Loop the session on an objective until it is done.",
|
|
5
|
+
"short_description_zh": "让会话循环推进一个目标直到完成。",
|
|
6
|
+
"version": "2026.09.01.1",
|
|
7
|
+
"category": "office-productivity",
|
|
8
|
+
"hooks": {
|
|
9
|
+
"user_prompt": [
|
|
10
|
+
{
|
|
11
|
+
"command": "start.mjs",
|
|
12
|
+
"timeout": 60
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"stop": [
|
|
16
|
+
{
|
|
17
|
+
"command": "stop.mjs",
|
|
18
|
+
"timeout": 60
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|