@agntn/harnesses 0.2.0 → 0.3.0
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 +47 -15
- package/dist/_chunks/agents.mjs +2 -30
- package/dist/_chunks/agents.mjs.map +1 -1
- package/dist/_chunks/libs/typebox.mjs +12 -9
- package/dist/_chunks/libs/typebox.mjs.map +1 -1
- package/dist/_chunks/mcp-servers.mjs +5 -34
- package/dist/_chunks/mcp-servers.mjs.map +1 -1
- package/dist/_chunks/mcp.mjs +13 -163
- package/dist/_chunks/mcp.mjs.map +1 -1
- package/dist/_chunks/output.mjs +28 -0
- package/dist/_chunks/output.mjs.map +1 -0
- package/dist/_chunks/{agents-sync.d.mts → prompt-sync.d.mts} +122 -10
- package/dist/_chunks/prompt-sync.d.mts.map +1 -0
- package/dist/_chunks/{agents-sync.mjs → prompt-sync.mjs} +863 -50
- package/dist/_chunks/prompt-sync.mjs.map +1 -0
- package/dist/_chunks/prompts.mjs +28 -0
- package/dist/_chunks/prompts.mjs.map +1 -0
- package/dist/_chunks/tool-operations.mjs +57 -19
- package/dist/_chunks/tool-operations.mjs.map +1 -1
- package/dist/_chunks/tool-schemas.d.mts +6 -0
- package/dist/_chunks/tool-schemas.d.mts.map +1 -1
- package/dist/_chunks/tool-schemas.mjs +14 -9
- package/dist/_chunks/tool-schemas.mjs.map +1 -1
- package/dist/_chunks/types.mjs +1 -1
- package/dist/_chunks/types.mjs.map +1 -1
- package/dist/cli.mjs +26 -8
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +16 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +179 -1
- package/dist/mcp.mjs.map +1 -0
- package/dist/tool-operations.d.mts +19 -3
- package/dist/tool-operations.d.mts.map +1 -1
- package/dist/tool-operations.mjs +2 -2
- package/dist/tool-schemas.d.mts +2 -2
- package/package.json +16 -14
- package/packages/omp/extensions/harnesses.ts +19 -1
- package/packages/pi/extensions/harnesses.ts +23 -1
- package/packages/shared/tui.ts +22 -1
- package/dist/_chunks/agents-sync.d.mts.map +0 -1
- package/dist/_chunks/agents-sync.mjs.map +0 -1
- package/dist/_chunks/mcp2.mjs +0 -17
- package/dist/_chunks/mcp2.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agntn/harnesses",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Metadata registry for AI coding harnesses: binaries, configs, sessions, and capabilities.",
|
|
5
5
|
"homepage": "https://harnesses.agntn.dev",
|
|
6
6
|
"bugs": "https://github.com/agntn/harnesses/issues",
|
|
@@ -38,14 +38,15 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
41
|
-
"@toon-format/toon": "
|
|
42
|
-
"citty": "
|
|
43
|
-
"consola": "
|
|
44
|
-
"smol-toml": "
|
|
45
|
-
"typebox": "
|
|
41
|
+
"@toon-format/toon": "4.1.1",
|
|
42
|
+
"citty": "0.2.2",
|
|
43
|
+
"consola": "3.4.2",
|
|
44
|
+
"smol-toml": "1.8.0",
|
|
45
|
+
"typebox": "1.3.34",
|
|
46
|
+
"yaml": "2.9.1"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@agntn/ox": "
|
|
49
|
+
"@agntn/ox": "0.1.0",
|
|
49
50
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
50
51
|
"@earendil-works/pi-tui": "0.85.1",
|
|
51
52
|
"@oh-my-pi/omptype": "18.2.5",
|
|
@@ -53,13 +54,13 @@
|
|
|
53
54
|
"@oh-my-pi/pi-coding-agent": "18.2.5",
|
|
54
55
|
"@types/node": "latest",
|
|
55
56
|
"@typescript/native-preview": "latest",
|
|
56
|
-
"changelogen": "
|
|
57
|
-
"obuild": "
|
|
58
|
-
"oxfmt": "
|
|
59
|
-
"oxlint": "
|
|
60
|
-
"oxlint-tsgolint": "
|
|
57
|
+
"changelogen": "0.6.2",
|
|
58
|
+
"obuild": "0.4.40",
|
|
59
|
+
"oxfmt": "0.68.0",
|
|
60
|
+
"oxlint": "1.83.0",
|
|
61
|
+
"oxlint-tsgolint": "7.0.2002",
|
|
61
62
|
"typescript": "6.0.3",
|
|
62
|
-
"vitest": "
|
|
63
|
+
"vitest": "5.0.1"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"@earendil-works/pi-coding-agent": ">=0.84.2 <1",
|
|
@@ -88,7 +89,8 @@
|
|
|
88
89
|
"pi": {
|
|
89
90
|
"extensions": [
|
|
90
91
|
"./packages/pi/extensions/harnesses.ts"
|
|
91
|
-
]
|
|
92
|
+
],
|
|
93
|
+
"image": "https://harnesses.agntn.dev/image.png"
|
|
92
94
|
},
|
|
93
95
|
"scripts": {
|
|
94
96
|
"build": "obuild",
|
|
@@ -82,7 +82,7 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
82
82
|
name: "harnesses_info",
|
|
83
83
|
label: HARNESS_TOOL_LABELS.harnesses_info,
|
|
84
84
|
description:
|
|
85
|
-
"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, hooks, and resolved paths",
|
|
85
|
+
"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, prompt templates, hooks, temp directories, the env variables that move them, and resolved paths",
|
|
86
86
|
parameters: schemas.info,
|
|
87
87
|
approval: HARNESS_TOOL_APPROVALS.harnesses_info,
|
|
88
88
|
async execute(
|
|
@@ -239,6 +239,24 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
239
239
|
...statusRenderers("harnesses_agents_sync"),
|
|
240
240
|
});
|
|
241
241
|
|
|
242
|
+
pi.registerTool({
|
|
243
|
+
name: "harnesses_prompts_sync",
|
|
244
|
+
label: HARNESS_TOOL_LABELS.harnesses_prompts_sync,
|
|
245
|
+
description:
|
|
246
|
+
"Sync canonical Markdown prompt templates from the agntn XDG data directory into supported harnesses; Gemini receives generated TOML. Diverged files are backed up. Pass check to only report",
|
|
247
|
+
parameters: schemas.promptsSync,
|
|
248
|
+
approval: HARNESS_TOOL_APPROVALS.harnesses_prompts_sync,
|
|
249
|
+
async execute(
|
|
250
|
+
_toolCallId,
|
|
251
|
+
params: Readonly<HarnessSchemas.PromptsSyncParams>,
|
|
252
|
+
): Promise<AgentToolResult<HarnessTools.PromptSyncReport | HarnessTools.RunFailure>> {
|
|
253
|
+
const { promptsSync } = await loadToolOperations();
|
|
254
|
+
const { content, details, isError } = promptsSync(params.id, params.check === true);
|
|
255
|
+
return { content, details, isError };
|
|
256
|
+
},
|
|
257
|
+
...statusRenderers("harnesses_prompts_sync"),
|
|
258
|
+
});
|
|
259
|
+
|
|
242
260
|
pi.registerTool({
|
|
243
261
|
name: "harnesses_mcp_remove",
|
|
244
262
|
label: HARNESS_TOOL_LABELS.harnesses_mcp_remove,
|
|
@@ -97,7 +97,7 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
97
97
|
name: "harnesses_info",
|
|
98
98
|
label: HARNESS_TOOL_LABELS.harnesses_info,
|
|
99
99
|
description:
|
|
100
|
-
"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, hooks, and resolved paths",
|
|
100
|
+
"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, prompt templates, hooks, temp directories, the env variables that move them, and resolved paths",
|
|
101
101
|
promptSnippet: "Use harnesses_info to look up where coding harnesses store their data.",
|
|
102
102
|
promptGuidelines: [
|
|
103
103
|
"Pass one harness id from harnesses_detect, or batch several ids in one call.",
|
|
@@ -270,6 +270,28 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
270
270
|
},
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
+
pi.registerTool({
|
|
274
|
+
name: "harnesses_prompts_sync",
|
|
275
|
+
label: HARNESS_TOOL_LABELS.harnesses_prompts_sync,
|
|
276
|
+
description:
|
|
277
|
+
"Sync canonical Markdown prompt templates from the agntn XDG data directory into supported harnesses; Gemini receives generated TOML. Diverged files are backed up. Pass check to only report",
|
|
278
|
+
parameters: schemas.promptsSync,
|
|
279
|
+
...statusRenderers("harnesses_prompts_sync"),
|
|
280
|
+
async execute(
|
|
281
|
+
_toolCallId,
|
|
282
|
+
params: Readonly<HarnessSchemas.PromptsSyncParams>,
|
|
283
|
+
): Promise<AgentToolResult<HarnessTools.PromptSyncReport | HarnessTools.RunFailure>> {
|
|
284
|
+
const { promptsSync } = await loadToolOperations();
|
|
285
|
+
const { content, details, isError } = promptsSync(params.id, params.check === true);
|
|
286
|
+
if (isError) {
|
|
287
|
+
throw new Error(
|
|
288
|
+
"error" in details ? details.error : (content[0]?.text ?? "Prompt sync failed"),
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
return { content, details };
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
|
|
273
295
|
pi.registerTool({
|
|
274
296
|
name: "harnesses_mcp_remove",
|
|
275
297
|
label: HARNESS_TOOL_LABELS.harnesses_mcp_remove,
|
package/packages/shared/tui.ts
CHANGED
|
@@ -9,6 +9,7 @@ export const HARNESS_TOOL_LABELS = {
|
|
|
9
9
|
harnesses_mcp_add: "Harnesses MCP Add",
|
|
10
10
|
harnesses_mcp_sync: "Harnesses MCP Sync",
|
|
11
11
|
harnesses_agents_sync: "Harnesses Agents Sync",
|
|
12
|
+
harnesses_prompts_sync: "Harnesses Prompts Sync",
|
|
12
13
|
harnesses_mcp_remove: "Harnesses MCP Remove",
|
|
13
14
|
} as const;
|
|
14
15
|
|
|
@@ -23,6 +24,7 @@ export const HARNESS_TOOL_APPROVALS: Record<HarnessToolName, "read" | "exec" | "
|
|
|
23
24
|
harnesses_mcp_add: "write",
|
|
24
25
|
harnesses_mcp_sync: "write",
|
|
25
26
|
harnesses_agents_sync: "write",
|
|
27
|
+
harnesses_prompts_sync: "write",
|
|
26
28
|
harnesses_mcp_remove: "write",
|
|
27
29
|
};
|
|
28
30
|
|
|
@@ -93,8 +95,16 @@ function listLength(record: Readonly<Record<string, unknown>>, key: string): num
|
|
|
93
95
|
|
|
94
96
|
function resultText(result: RenderedToolResult): string {
|
|
95
97
|
const parts: string[] = [];
|
|
98
|
+
let length = 0;
|
|
96
99
|
for (const part of result.content ?? []) {
|
|
97
|
-
if (isRecord(part)
|
|
100
|
+
if (!isRecord(part) || typeof part.text !== "string") continue;
|
|
101
|
+
const separator = parts.length === 0 ? 0 : 1;
|
|
102
|
+
const remaining = RESULT_BODY_LIMIT + 1 - length - separator;
|
|
103
|
+
if (remaining < 0) break;
|
|
104
|
+
const text = part.text.slice(0, remaining);
|
|
105
|
+
parts.push(text);
|
|
106
|
+
length += separator + text.length;
|
|
107
|
+
if (length > RESULT_BODY_LIMIT) break;
|
|
98
108
|
}
|
|
99
109
|
return parts.join("\n");
|
|
100
110
|
}
|
|
@@ -150,6 +160,7 @@ const CALL_DESCRIPTIONS: Record<HarnessToolName, CallDescriptionRenderer> = {
|
|
|
150
160
|
harnesses_mcp_add: mutationDescription,
|
|
151
161
|
harnesses_mcp_sync: idDescription,
|
|
152
162
|
harnesses_agents_sync: agentsDescription,
|
|
163
|
+
harnesses_prompts_sync: agentsDescription,
|
|
153
164
|
harnesses_mcp_remove: mutationDescription,
|
|
154
165
|
};
|
|
155
166
|
|
|
@@ -267,6 +278,15 @@ function agentsSyncMeta(details: ResultDetails): string[] {
|
|
|
267
278
|
return [`${changed} targets`];
|
|
268
279
|
}
|
|
269
280
|
|
|
281
|
+
function promptsSyncMeta(details: ResultDetails): string[] {
|
|
282
|
+
const templates = listLength(details, "templates");
|
|
283
|
+
const targets = listLength(details, "targets");
|
|
284
|
+
return compactStrings([
|
|
285
|
+
templates === undefined ? undefined : `${templates} templates`,
|
|
286
|
+
targets === undefined ? undefined : `${targets} harnesses`,
|
|
287
|
+
]);
|
|
288
|
+
}
|
|
289
|
+
|
|
270
290
|
const RESULT_META: Record<HarnessToolName, ResultMetaRenderer> = {
|
|
271
291
|
harnesses_detect: detectMeta,
|
|
272
292
|
harnesses_info: infoMeta,
|
|
@@ -276,6 +296,7 @@ const RESULT_META: Record<HarnessToolName, ResultMetaRenderer> = {
|
|
|
276
296
|
harnesses_mcp_add: mutationMeta,
|
|
277
297
|
harnesses_mcp_sync: mcpSyncMeta,
|
|
278
298
|
harnesses_agents_sync: agentsSyncMeta,
|
|
299
|
+
harnesses_prompts_sync: promptsSyncMeta,
|
|
279
300
|
harnesses_mcp_remove: mutationMeta,
|
|
280
301
|
};
|
|
281
302
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents-sync.d.mts","names":[],"sources":["../../src/types.ts","../../src/harness.ts","../../src/mcp-servers.ts","../../src/agents-sync.ts"],"mappings":"AAEA,qBAAa;YAED;YAcA;YACA;iBAEK;EACf;EACA;EACA,OAAO;EACP,YAAY;EACZ;;iBAGe;EACf;EACA,OAAO;EACP;;iBAGe;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;iBAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,OAAO;EACP;;;iBAIe;EACf;EACA;EACA;EACA;EACA;EACA;;;iBAIe;;EAEf;;EAEA;EACA,OAAO;EACP;;;iBAIe;EACf;EACA;EACA;EACA;EACA;EACA;;;iBAIe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA,SAAS;;iBAGM;EACf;EACA,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;EAEA,SAAS;;EAET;;iBAGe;EACf;EACA;EACA;EACA;;EAEA;EACA;;EAEA;;;iBAIe,yBAAyB;;EAExC,QAAQ;;;iBAIO;EACf;EACA;EACA;EACA;;;;;;EAMA,MAAM;E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