@codeconductorai/harmony-mcp 1.0.31 → 1.0.32
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/README.md +92 -8
- package/package.json +1 -1
- package/src/agentsGuide.js +38 -0
- package/src/fileWatcher.js +51 -4
- package/src/harmonyClient.js +87 -32
- package/src/index.js +11 -30
- package/src/installer.js +295 -0
- package/src/server.js +71 -34
- package/src/serverInstructions.js +67 -26
- package/src/serverMain.js +32 -0
- package/src/sessionIdentity.js +152 -0
- package/src/toolSchemas.js +167 -80
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Which agent session a Harmony request belongs to (sent as X-Mcp-Session-Id).
|
|
2
|
+
//
|
|
3
|
+
// The backend keeps per-session state under this id: handles (@s1, @g1, ...), security-audit baselines, and the
|
|
4
|
+
// code slices already sent, which it later replaces with short "[In context: ...]" back-references. So the id must
|
|
5
|
+
// change whenever the agent's context is reset, or the agent gets references to code it can no longer see.
|
|
6
|
+
//
|
|
7
|
+
// Resolution order, checked on every request:
|
|
8
|
+
// 1. HARMONY_SESSION_ID env — explicit override for any agent.
|
|
9
|
+
// 2. The latest session recorded by the Claude Code / Codex SessionStart hook (`harmony-mcp --session-hook`).
|
|
10
|
+
// SessionStart fires on startup, resume, /clear (new session id) and compaction (same id), so this tracks
|
|
11
|
+
// /clear, and a compaction count is appended ("<id>#compact-2") so compacted-away code is never referenced.
|
|
12
|
+
// 3. CLAUDE_CODE_SESSION_ID env — Claude Code's session id at the time this MCP process was started.
|
|
13
|
+
// 4. A UUID generated for this MCP process — for agents that expose no session id.
|
|
14
|
+
import fs from "fs";
|
|
15
|
+
import os from "os";
|
|
16
|
+
import path from "path";
|
|
17
|
+
import { execFileSync } from "child_process";
|
|
18
|
+
|
|
19
|
+
import { SESSION_ID as PROCESS_SESSION_ID } from "./log.js";
|
|
20
|
+
|
|
21
|
+
export const SESSION_HOOK_DIR = path.join(os.homedir(), ".harmony-mcp", "claude-sessions");
|
|
22
|
+
|
|
23
|
+
// Agent CLIs whose SessionStart hook can run `harmony-mcp --session-hook` (same stdin payload in both).
|
|
24
|
+
const AGENT_PROCESS_NAMES = new Set(["claude", "codex"]);
|
|
25
|
+
const MAX_ANCESTOR_DEPTH = 6;
|
|
26
|
+
|
|
27
|
+
// { ppid, name } of a process, or null if it can't be read.
|
|
28
|
+
function processInfo(pid) {
|
|
29
|
+
try {
|
|
30
|
+
const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
31
|
+
// Field 2 (comm) is in parens and may contain spaces; field 4 is the parent pid.
|
|
32
|
+
const name = stat.slice(stat.indexOf("(") + 1, stat.lastIndexOf(")"));
|
|
33
|
+
return { ppid: Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]), name };
|
|
34
|
+
} catch {
|
|
35
|
+
try {
|
|
36
|
+
const out = execFileSync("ps", ["-o", "ppid=,comm=", "-p", String(pid)], { encoding: "utf8" }).trim();
|
|
37
|
+
const [, ppid, comm] = out.match(/^(\d+)\s+(.*)$/) || [];
|
|
38
|
+
return ppid ? { ppid: Number(ppid), name: path.basename(comm) } : null;
|
|
39
|
+
} catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Ancestor pids of this process, nearest first.
|
|
46
|
+
function ancestors() {
|
|
47
|
+
const pids = [];
|
|
48
|
+
let pid = process.ppid;
|
|
49
|
+
for (let depth = 0; pid && pid > 1 && depth < MAX_ANCESTOR_DEPTH; depth++) {
|
|
50
|
+
const info = processInfo(pid);
|
|
51
|
+
pids.push({ pid: String(pid), name: info?.name || "" });
|
|
52
|
+
pid = info?.ppid;
|
|
53
|
+
}
|
|
54
|
+
return pids;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// The agent CLI (Claude Code or Codex) this process runs under. The hook process and the MCP server are both
|
|
58
|
+
// spawned by it, but through different wrappers (sh, npx, npm), so their direct parents never match; the nearest
|
|
59
|
+
// agent ancestor does. CLAUDE_PID is exported by Claude Code to both; Codex sets no equivalent.
|
|
60
|
+
function agentPid() {
|
|
61
|
+
if (process.env.CLAUDE_PID) return String(process.env.CLAUDE_PID);
|
|
62
|
+
return ancestors().find((a) => AGENT_PROCESS_NAMES.has(a.name))?.pid || null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Pids a hook record for this MCP process may be filed under: the agent ancestor, then the raw ancestry (records
|
|
66
|
+
// written by an older hook keyed by its direct parent).
|
|
67
|
+
let candidatePids = null;
|
|
68
|
+
function claudeProcessCandidates() {
|
|
69
|
+
if (candidatePids) return candidatePids;
|
|
70
|
+
candidatePids = [...new Set([agentPid(), ...ancestors().map((a) => a.pid)].filter(Boolean))];
|
|
71
|
+
return candidatePids;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function hookRecordedSession() {
|
|
75
|
+
for (const pid of claudeProcessCandidates()) {
|
|
76
|
+
try {
|
|
77
|
+
const record = JSON.parse(fs.readFileSync(path.join(SESSION_HOOK_DIR, `${pid}.json`), "utf8"));
|
|
78
|
+
if (record?.sessionId) {
|
|
79
|
+
return record.compactions > 0 ? `${record.sessionId}#compact-${record.compactions}` : record.sessionId;
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
// no record for this pid
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function currentSessionId() {
|
|
89
|
+
return (
|
|
90
|
+
process.env.HARMONY_SESSION_ID ||
|
|
91
|
+
hookRecordedSession() ||
|
|
92
|
+
process.env.CLAUDE_CODE_SESSION_ID ||
|
|
93
|
+
PROCESS_SESSION_ID
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function sessionIdSource() {
|
|
98
|
+
if (process.env.HARMONY_SESSION_ID) return "env:HARMONY_SESSION_ID";
|
|
99
|
+
if (hookRecordedSession()) return "agent:session-start-hook";
|
|
100
|
+
if (process.env.CLAUDE_CODE_SESSION_ID) return "env:CLAUDE_CODE_SESSION_ID";
|
|
101
|
+
return "generated";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// `harmony-mcp --session-hook`: run as a Claude Code or Codex SessionStart hook. Reads the hook JSON from stdin
|
|
105
|
+
// ({session_id, source: startup|resume|clear|compact} in both) and records the session for the agent process that
|
|
106
|
+
// ran it (CLAUDE_PID, else the nearest claude/codex ancestor, else the hook's parent).
|
|
107
|
+
export async function runSessionHook() {
|
|
108
|
+
let raw = "";
|
|
109
|
+
for await (const chunk of process.stdin) raw += chunk;
|
|
110
|
+
let input = {};
|
|
111
|
+
try {
|
|
112
|
+
input = JSON.parse(raw || "{}");
|
|
113
|
+
} catch {
|
|
114
|
+
process.exit(0);
|
|
115
|
+
}
|
|
116
|
+
const sessionId = input.session_id;
|
|
117
|
+
if (!sessionId) process.exit(0);
|
|
118
|
+
const claudePid = agentPid() || String(process.ppid);
|
|
119
|
+
const file = path.join(SESSION_HOOK_DIR, `${claudePid}.json`);
|
|
120
|
+
let previous = null;
|
|
121
|
+
try {
|
|
122
|
+
previous = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
123
|
+
} catch {
|
|
124
|
+
// first record for this process
|
|
125
|
+
}
|
|
126
|
+
const compactions =
|
|
127
|
+
input.source === "compact" && previous?.sessionId === sessionId ? (previous.compactions || 0) + 1 : 0;
|
|
128
|
+
fs.mkdirSync(SESSION_HOOK_DIR, { recursive: true });
|
|
129
|
+
fs.writeFileSync(
|
|
130
|
+
file,
|
|
131
|
+
JSON.stringify({ sessionId, source: input.source || null, compactions, updatedAt: new Date().toISOString() }),
|
|
132
|
+
);
|
|
133
|
+
pruneStaleRecords();
|
|
134
|
+
process.exit(0);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Drop records of Claude processes that no longer exist, so the directory doesn't grow forever.
|
|
138
|
+
function pruneStaleRecords() {
|
|
139
|
+
try {
|
|
140
|
+
for (const name of fs.readdirSync(SESSION_HOOK_DIR)) {
|
|
141
|
+
const pid = Number(name.replace(/\.json$/, ""));
|
|
142
|
+
if (!pid) continue;
|
|
143
|
+
try {
|
|
144
|
+
process.kill(pid, 0);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
if (e.code === "ESRCH") fs.rmSync(path.join(SESSION_HOOK_DIR, name), { force: true });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
} catch {
|
|
150
|
+
// best effort
|
|
151
|
+
}
|
|
152
|
+
}
|
package/src/toolSchemas.js
CHANGED
|
@@ -7,6 +7,16 @@ const WORKSPACE_ID_PROPERTY = {
|
|
|
7
7
|
"local workspace set up by setup_workspace.",
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
+
// Harmony remembers which code each MCP session already received and sends repeats as short
|
|
11
|
+
// back-references. This flag turns that off for one call.
|
|
12
|
+
const FORCE_REFRESH_PROPERTY = {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
description:
|
|
15
|
+
"Optional, default false. Code this session already received comes back as a short back-reference. " +
|
|
16
|
+
"Set true when that earlier output is no longer in your context (context cleared or compacted, or you " +
|
|
17
|
+
"are a subagent that did not see the parent's results) to get every slice in full.",
|
|
18
|
+
};
|
|
19
|
+
|
|
10
20
|
export const TOOLS = [
|
|
11
21
|
{
|
|
12
22
|
name: "login",
|
|
@@ -117,6 +127,7 @@ export const TOOLS = [
|
|
|
117
127
|
"Optional, default true. Each returned symbol (and each step of a traced flow) includes its source " +
|
|
118
128
|
"excerpt (method or class body, capped at 50 lines). Set false to get file paths and line numbers only.",
|
|
119
129
|
},
|
|
130
|
+
force_refresh: FORCE_REFRESH_PROPERTY,
|
|
120
131
|
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
121
132
|
},
|
|
122
133
|
required: ["prompt"],
|
|
@@ -166,86 +177,6 @@ export const TOOLS = [
|
|
|
166
177
|
required: ["prompt"],
|
|
167
178
|
},
|
|
168
179
|
},
|
|
169
|
-
{
|
|
170
|
-
name: "query_module_dependencies",
|
|
171
|
-
description:
|
|
172
|
-
"Given a file path, returns its directed import/inheritance dependencies: every in-workspace " +
|
|
173
|
-
"file it depends on, and every file that depends on it. Use this INSTEAD of manually grepping " +
|
|
174
|
-
"import statements across files to check coupling or trace architectural boundaries before " +
|
|
175
|
-
"touching a shared file.",
|
|
176
|
-
inputSchema: {
|
|
177
|
-
type: "object",
|
|
178
|
-
properties: {
|
|
179
|
-
file_path: {
|
|
180
|
-
type: "string",
|
|
181
|
-
description: "REQUIRED. The relative file path whose dependencies should be resolved.",
|
|
182
|
-
},
|
|
183
|
-
depth: {
|
|
184
|
-
type: "number",
|
|
185
|
-
description:
|
|
186
|
-
"Traversal depth: 1 (default) for direct dependencies only, 2 for one further transitive hop.",
|
|
187
|
-
},
|
|
188
|
-
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
189
|
-
},
|
|
190
|
-
required: ["file_path"],
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: "outline_file_symbols",
|
|
195
|
-
description:
|
|
196
|
-
"Extracts a file's structural skeleton — every definition's signature line, docstring, and " +
|
|
197
|
-
"line number, with implementation bodies omitted. Use this INSTEAD of reading the whole file " +
|
|
198
|
-
"with Read() when you only need to understand a file's interface and capabilities, not its " +
|
|
199
|
-
"execution logic.",
|
|
200
|
-
inputSchema: {
|
|
201
|
-
type: "object",
|
|
202
|
-
properties: {
|
|
203
|
-
file_path: {
|
|
204
|
-
type: "string",
|
|
205
|
-
description: "REQUIRED. Relative path to the source file (e.g. 'src/main/java/app/OrderService.java').",
|
|
206
|
-
},
|
|
207
|
-
include_private: {
|
|
208
|
-
type: "boolean",
|
|
209
|
-
description:
|
|
210
|
-
"Whether to include symbols that look private/unexported. Default false (exported-only) " +
|
|
211
|
-
"to preserve token economy.",
|
|
212
|
-
},
|
|
213
|
-
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
214
|
-
},
|
|
215
|
-
required: ["file_path"],
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
name: "get_repository_map",
|
|
220
|
-
description:
|
|
221
|
-
"Generates a ranked, token-budgeted architectural map of the repository: the most " +
|
|
222
|
-
"structurally important files (by call-graph centrality and subsystem clustering) and their " +
|
|
223
|
-
"top symbols. Use this tool FIRST when working in an unfamiliar codebase or subsystem, to " +
|
|
224
|
-
"understand project layout and find relevant modules, INSTEAD of manual directory traversals " +
|
|
225
|
-
"or a string of unscoped context_search calls.",
|
|
226
|
-
inputSchema: {
|
|
227
|
-
type: "object",
|
|
228
|
-
properties: {
|
|
229
|
-
focus_files: {
|
|
230
|
-
type: "array",
|
|
231
|
-
items: { type: "string" },
|
|
232
|
-
description:
|
|
233
|
-
"Optional list of relative file paths to prioritize (e.g. files currently open or " +
|
|
234
|
-
"mentioned in the user's prompt) — ranked ahead of everything else.",
|
|
235
|
-
},
|
|
236
|
-
max_tokens: {
|
|
237
|
-
type: "number",
|
|
238
|
-
description: "Maximum token budget for the returned map (default 1024).",
|
|
239
|
-
},
|
|
240
|
-
directory_filter: {
|
|
241
|
-
type: "string",
|
|
242
|
-
description: "Optional relative subdirectory to scope the map to (e.g. 'src/backend').",
|
|
243
|
-
},
|
|
244
|
-
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
245
|
-
},
|
|
246
|
-
required: [],
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
180
|
{
|
|
250
181
|
name: "security_scan",
|
|
251
182
|
description:
|
|
@@ -299,4 +230,160 @@ export const TOOLS = [
|
|
|
299
230
|
required: [],
|
|
300
231
|
},
|
|
301
232
|
},
|
|
233
|
+
{
|
|
234
|
+
name: "investigate",
|
|
235
|
+
description:
|
|
236
|
+
"Answers a code question with a token-budgeted Markdown brief: the best-matching methods/types as " +
|
|
237
|
+
"edit-ready code slices (every line prefixed L<n>:), each given a short handle (@s1, @s2, ...), plus the " +
|
|
238
|
+
"execution traces (@t<N>) they take part in. Ranked by Harmony's search. Code this session already " +
|
|
239
|
+
"received comes back as a one-line [In context: path:Lx-Ly] reference instead of being resent — that code " +
|
|
240
|
+
"is still in your context above; if it isn't (context was cleared or compacted, or you are a subagent), " +
|
|
241
|
+
"call again with force_refresh: true. Use it like context_search when you want the answer as slices " +
|
|
242
|
+
"with handles you can refer back to in later calls.",
|
|
243
|
+
inputSchema: {
|
|
244
|
+
type: "object",
|
|
245
|
+
properties: {
|
|
246
|
+
query: { type: "string", description: "REQUIRED. The question or identifier to investigate." },
|
|
247
|
+
focus_files: {
|
|
248
|
+
type: "array",
|
|
249
|
+
items: { type: "string" },
|
|
250
|
+
description: "Optional relative file paths to rank first (files already known to be relevant).",
|
|
251
|
+
},
|
|
252
|
+
max_slices: { type: "number", description: "Maximum code slices (default 4, max 10)." },
|
|
253
|
+
max_tokens: { type: "number", description: "Token budget for the brief (default 2200)." },
|
|
254
|
+
force_refresh: FORCE_REFRESH_PROPERTY,
|
|
255
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
256
|
+
},
|
|
257
|
+
required: ["query"],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "inspect_trace",
|
|
262
|
+
description:
|
|
263
|
+
"Shows one execution flow end to end — entry route, call chain, security posture (authenticated or " +
|
|
264
|
+
"not, roles) — with the code of each hop as an edit-ready slice. Use it for 'what happens when X is " +
|
|
265
|
+
"called' / 'trace the request for <route>' questions. Pass a route (e.g. 'POST /loans'), an entry " +
|
|
266
|
+
"method, or a trace handle like @t3 from an earlier investigate result.",
|
|
267
|
+
inputSchema: {
|
|
268
|
+
type: "object",
|
|
269
|
+
properties: {
|
|
270
|
+
trace_query: {
|
|
271
|
+
type: "string",
|
|
272
|
+
description: "REQUIRED. A route, entry-point name, keywords, or an @t<N> handle from this session.",
|
|
273
|
+
},
|
|
274
|
+
max_tokens: { type: "number", description: "Token budget (default 2400)." },
|
|
275
|
+
force_refresh: FORCE_REFRESH_PROPERTY,
|
|
276
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
277
|
+
},
|
|
278
|
+
required: ["trace_query"],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "security_audit",
|
|
283
|
+
description:
|
|
284
|
+
"Security posture of the workspace as a compact Markdown report: findings grouped by root cause " +
|
|
285
|
+
"(rule + OWASP/CWE), each group a handle @g<N> and its first findings @f<N>, most severe first. " +
|
|
286
|
+
"Covers the same checks as security_scan plus findings from execution-flow analysis. With " +
|
|
287
|
+
"delta_only: true it reports only what changed since this session's previous audit — use that " +
|
|
288
|
+
"after fixing to confirm. Expand or mute a group with security_finding_action.",
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: {
|
|
292
|
+
severity_filter: {
|
|
293
|
+
type: "string",
|
|
294
|
+
enum: ["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"],
|
|
295
|
+
description: "Optional lowest severity to include.",
|
|
296
|
+
},
|
|
297
|
+
delta_only: {
|
|
298
|
+
type: "boolean",
|
|
299
|
+
description: "Report only findings new or resolved since this session's last audit (default false).",
|
|
300
|
+
},
|
|
301
|
+
max_tokens: { type: "number", description: "Token budget (default 2000)." },
|
|
302
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
303
|
+
},
|
|
304
|
+
required: [],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "security_finding_action",
|
|
309
|
+
description:
|
|
310
|
+
"Acts on a finding handle from security_audit: 'inspect' expands a group (@g<N>) or finding (@f<N>) " +
|
|
311
|
+
"into every member with file:line and remediation; 'mute' suppresses it for later audits (give a " +
|
|
312
|
+
"reason). Only mute what the user agreed is a false positive or accepted risk.",
|
|
313
|
+
inputSchema: {
|
|
314
|
+
type: "object",
|
|
315
|
+
properties: {
|
|
316
|
+
handle: { type: "string", description: "REQUIRED. A handle from security_audit, e.g. @g1 or @f3." },
|
|
317
|
+
action: { type: "string", enum: ["inspect", "mute"], description: "Default inspect." },
|
|
318
|
+
reason: { type: "string", description: "Why the finding is muted (required in practice for mute)." },
|
|
319
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
320
|
+
},
|
|
321
|
+
required: ["handle"],
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "preflight",
|
|
326
|
+
description:
|
|
327
|
+
"Before editing, shows the blast radius of changing given files or symbols: dependent production " +
|
|
328
|
+
"files, impacted tests, entry-point traces that pass through them, and security findings they touch, " +
|
|
329
|
+
"plus slices of the target code. Use it before changing a shared class, a public method signature, or " +
|
|
330
|
+
"anything security-sensitive, instead of grepping for usages.",
|
|
331
|
+
inputSchema: {
|
|
332
|
+
type: "object",
|
|
333
|
+
properties: {
|
|
334
|
+
target_files: {
|
|
335
|
+
type: "array",
|
|
336
|
+
items: { type: "string" },
|
|
337
|
+
description: "Relative paths of the files you intend to change.",
|
|
338
|
+
},
|
|
339
|
+
target_symbols: {
|
|
340
|
+
type: "array",
|
|
341
|
+
items: { type: "string" },
|
|
342
|
+
description: "Optional symbol names you intend to change (class or method names).",
|
|
343
|
+
},
|
|
344
|
+
include_slices: { type: "boolean", description: "Include code slices of the targets (default true)." },
|
|
345
|
+
max_tokens: { type: "number", description: "Token budget (default 1800)." },
|
|
346
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
347
|
+
},
|
|
348
|
+
required: [],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: "compress_build_log",
|
|
353
|
+
description:
|
|
354
|
+
"Turns raw build or test output into a short diagnosis: unique compiler errors, failed tests grouped " +
|
|
355
|
+
"by cause, and deduplicated stack traces (noise, ANSI codes and repeated frames removed). Pass the log " +
|
|
356
|
+
"text instead of reading a long build log into context.",
|
|
357
|
+
inputSchema: {
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {
|
|
360
|
+
raw_log: { type: "string", description: "REQUIRED. The raw stdout/stderr of the build or test run." },
|
|
361
|
+
command: { type: "string", description: "Optional command that produced it, e.g. './gradlew test'." },
|
|
362
|
+
max_tokens: { type: "number", description: "Token budget (default 1200)." },
|
|
363
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
364
|
+
},
|
|
365
|
+
required: ["raw_log"],
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "session_checkpoint",
|
|
370
|
+
description:
|
|
371
|
+
"Returns a compact (about 500 tokens) snapshot of this Harmony session: current goal, recorded " +
|
|
372
|
+
"invariants, files targeted, and the active @s/@t/@g handles. Call it before the conversation is " +
|
|
373
|
+
"cleared or compacted and keep the result, so work can resume with the same handles.",
|
|
374
|
+
inputSchema: {
|
|
375
|
+
type: "object",
|
|
376
|
+
properties: {
|
|
377
|
+
current_goal: { type: "string", description: "One line on what you are working on." },
|
|
378
|
+
notes: {
|
|
379
|
+
type: "array",
|
|
380
|
+
items: { type: "string" },
|
|
381
|
+
description: "Invariants or decisions to carry over (e.g. 'keep LoanApi response shape stable').",
|
|
382
|
+
},
|
|
383
|
+
max_tokens: { type: "number", description: "Token budget (default 500)." },
|
|
384
|
+
workspaceId: WORKSPACE_ID_PROPERTY,
|
|
385
|
+
},
|
|
386
|
+
required: [],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
302
389
|
];
|