@agntn/harnesses 0.4.0 → 0.4.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/README.md +15 -15
- package/dist/_chunks/output.mjs +1 -1
- package/dist/_chunks/output.mjs.map +1 -1
- package/dist/_chunks/skills-sync.d.mts +7 -0
- package/dist/_chunks/skills-sync.d.mts.map +1 -1
- package/dist/_chunks/skills-sync.mjs +75 -15
- package/dist/_chunks/skills-sync.mjs.map +1 -1
- package/dist/_chunks/tool-operations.mjs +15 -5
- package/dist/_chunks/tool-operations.mjs.map +1 -1
- package/dist/_chunks/tool-schemas.d.mts +1 -0
- package/dist/_chunks/tool-schemas.d.mts.map +1 -1
- package/dist/_chunks/tool-schemas.mjs +6 -0
- 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 +33 -22
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +3 -2
- package/dist/mcp.mjs.map +1 -1
- package/dist/tool-operations.d.mts +13 -3
- package/dist/tool-operations.d.mts.map +1 -1
- package/package.json +1 -1
- package/packages/omp/extensions/harnesses.ts +4 -2
- package/packages/pi/extensions/harnesses.ts +8 -4
|
@@ -11,12 +11,18 @@ export interface ToolResult<Details> {
|
|
|
11
11
|
/** Set when the tool could not answer. */
|
|
12
12
|
isError?: boolean;
|
|
13
13
|
}
|
|
14
|
-
/** Install state of one harness on this machine. */
|
|
14
|
+
/** Install state of one harness on this machine, plus the runs harnesses_run takes for it. */
|
|
15
15
|
export interface HarnessStatus {
|
|
16
16
|
id: HarnessId;
|
|
17
17
|
name: string;
|
|
18
18
|
installed: boolean;
|
|
19
19
|
version: string | null;
|
|
20
|
+
/** Takes `tools: false`, an advisor without tools. */
|
|
21
|
+
advisor: boolean;
|
|
22
|
+
/** Takes `tools: true` with `readOnly: true`; false while the installed CLI is too old for it. */
|
|
23
|
+
readOnly: boolean;
|
|
24
|
+
/** Takes `tools: true`, the full agent. */
|
|
25
|
+
agent: boolean;
|
|
20
26
|
}
|
|
21
27
|
/** Every registered harness with its install state, as scanned by {@link detectHarnesses}. */
|
|
22
28
|
export interface HarnessListing {
|
|
@@ -31,6 +37,7 @@ export interface HarnessMetadata {
|
|
|
31
37
|
invocationModes: HarnessInvocationModes;
|
|
32
38
|
modelListing: boolean;
|
|
33
39
|
modelSelection: boolean;
|
|
40
|
+
effortSelection: boolean;
|
|
34
41
|
config: PathCandidate[];
|
|
35
42
|
sessions: PathCandidate[];
|
|
36
43
|
instructions: PathCandidate[];
|
|
@@ -64,7 +71,7 @@ export declare const RUN_DEFAULT_TIMEOUT_SECONDS = 600;
|
|
|
64
71
|
/** The run tool's per-stream cap: harness output is unbounded, model context is not. */
|
|
65
72
|
export declare const RUN_MAX_OUTPUT_CHARS = 8000;
|
|
66
73
|
/**
|
|
67
|
-
* Scans every registered harness for its binaries and version.
|
|
74
|
+
* Scans every registered harness for its binaries and version, next to the modes it runs in.
|
|
68
75
|
*
|
|
69
76
|
* @returns {ToolResult<HarnessListing>} The complete installation listing.
|
|
70
77
|
*/
|
|
@@ -110,6 +117,8 @@ export interface RunOptions {
|
|
|
110
117
|
cwd?: string;
|
|
111
118
|
/** Harness-native model id or selector. */
|
|
112
119
|
model?: string;
|
|
120
|
+
/** Reasoning effort in the harness's own words; rejected where `effortArgs` is missing. */
|
|
121
|
+
effort?: string;
|
|
113
122
|
/** Wall-clock budget in seconds; defaults to {@link RUN_DEFAULT_TIMEOUT_SECONDS}. */
|
|
114
123
|
timeoutSeconds?: number;
|
|
115
124
|
/** Cancel the owned command through the host request signal. */
|
|
@@ -128,6 +137,7 @@ export interface RunOutcome {
|
|
|
128
137
|
/** Expanded arguments; the model's text keeps "{prompt}" instead, it wrote the prompt itself. */
|
|
129
138
|
args: string[];
|
|
130
139
|
model?: string;
|
|
140
|
+
effort?: string;
|
|
131
141
|
structured: boolean;
|
|
132
142
|
tools: boolean;
|
|
133
143
|
readOnly: boolean;
|
|
@@ -158,7 +168,7 @@ export interface RunFailure {
|
|
|
158
168
|
*
|
|
159
169
|
* Tool use defaults to a native advisor without tools invocation. Harnesses that
|
|
160
170
|
* cannot disable tools reject that mode; setting `tools` selects their full
|
|
161
|
-
* agent invocation. `model`
|
|
171
|
+
* agent invocation. `model` and `effort` are translated through the harness-specific recipe.
|
|
162
172
|
* This layer also closes stdin, enforces the timeout, caps the echoed output,
|
|
163
173
|
* and leaves the prompt out of the echoed invocation.
|
|
164
174
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-operations.d.mts","names":[],"sources":["../src/tool-operations.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tool-operations.d.mts","names":[],"sources":["../src/tool-operations.ts"],"mappings":";;;;iBAkDiB,WAAW;EAC1B,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;EAET;;;iBAIe;EACf,IAAI;EACJ;EACA;EACA;;EAEA;;EAEA;;EAEA;;;iBAIe;EACf,WAAW;;;iBAII;EACf,IAAI;EACJ;EACA;EACA,cAAc;EACd,iBAAiB;EACjB;EACA;EACA;EACA,QAAQ;EACR,UAAU;EACV,cAAc;EACd,QAAQ;EACR,kBAAkB;EAClB,UAAU;EACV,iBAAiB;EACjB,0BAA0B;EAC1B,OAAO;EACP,MAAM;EACN,cAAc;EACd,aAAa;EACb,WAAW;EACX,UAAU;;;iBAIK;EACf;EACA,OAAO;;;iBAIQ;EACf;;;YAIU,oBAAoB,kBAAkB;;YAGtC,qBAAqB,oBAAoB,sBAAsB;;qBAM9D;;qBAGA;;;;;;wBA+KG,mBAAmB,WAAW;;wBAmH9B,YAAY,aAAa,WAAW;;wBAEpC,YACd,yBACC,WAAW,sBAAsB;wBACpB,YAAY,oCAAoC,WAAW;;iBA2B1D;EACf;EACA;;EAEA;;EAEA,SAAS;;;iBAIM;EACf,IAAI;EACJ;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;;EAEA;EACA;;;;;;;;;wBAUoB,kBACpB,YACA,UAAS,gBACR,QAAQ,WAAW,gBAAgB;;iBAqDrB;EACf;;EAEA;;EAEA;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA;;;iBAIe;EACf,IAAI;EACJ;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;;iBAIe;EACf;EACA,QAAQ;;EAER,kBAAkB;;EAElB;IAAU;IAAmB;;IAAsB;;;;;;;;;;;;;;;;;wBAyB/B,WACpB,YACA,gBACA,UAAS,aACR,QAAQ,WAAW,aAAa;;iBAyClB;EACf,WAAW;IAAQ,IAAI;IAAW,SAAS;;;;iBAY5B;EACf,IAAI;EACJ;EACA;;;iBAIe;EACf;EACA,YAAY;EACZ;EACA;EACA,MAAM;EACN;EACA,UAAU;;;;;;;;wBASI,kBAAkB,QAAQ,kBAAkB;;;;;;;wBAmB5C,QAAQ,cAAc,WAAW,aAAa;;;;;;;;;wBAgD9C,OACd,YACA,QAAQ,iBACR,6BACC,WAAW,cAAc;;;;;;;;;wBAeZ,UACd,YACA,cACA,6BACC,WAAW,cAAc;;;;;;;wBAaZ,QAAQ,cAAc,WAAW,aAAa;;;;;;;;wBA+B9C,WAAW,aAAa,kBAAgB,WAAW,mBAAmB;;;;;;;;wBAgCtE,YAAY,aAAa,kBAAgB,WAAW,mBAAmB;;;;;;;;wBAsBvE,WAAW,aAAa,kBAAgB,WAAW,mBAAmB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agntn/harnesses",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
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",
|
|
@@ -67,7 +67,8 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
67
67
|
pi.registerTool({
|
|
68
68
|
name: "harnesses_detect",
|
|
69
69
|
label: HARNESS_TOOL_LABELS.harnesses_detect,
|
|
70
|
-
description:
|
|
70
|
+
description:
|
|
71
|
+
"List every known AI coding harness with its install state, version and the harnesses_run modes it takes: advisor (tools=false), readOnly (tools=true with readOnly=true) and agent (tools=true)",
|
|
71
72
|
parameters: schemas.detect,
|
|
72
73
|
approval: HARNESS_TOOL_APPROVALS.harnesses_detect,
|
|
73
74
|
async execute(_toolCallId, _params): Promise<AgentToolResult<HarnessTools.HarnessListing>> {
|
|
@@ -121,7 +122,7 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
121
122
|
name: "harnesses_run",
|
|
122
123
|
label: HARNESS_TOOL_LABELS.harnesses_run,
|
|
123
124
|
description:
|
|
124
|
-
"Run one prompt through a harness. Always choose tools explicitly. Add readOnly when tools is true to require native read-only enforcement, or use tools false for an advisor without tools.",
|
|
125
|
+
"Run one prompt through a harness. Always choose tools explicitly. Add readOnly when tools is true to require native read-only enforcement, or use tools false for an advisor without tools. harnesses_detect shows which modes each harness takes.",
|
|
125
126
|
parameters: schemas.run,
|
|
126
127
|
approval: HARNESS_TOOL_APPROVALS.harnesses_run,
|
|
127
128
|
async execute(
|
|
@@ -133,6 +134,7 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
133
134
|
return runHarness(params.id, params.prompt, {
|
|
134
135
|
cwd: params.cwd,
|
|
135
136
|
model: params.model,
|
|
137
|
+
effort: params.effort,
|
|
136
138
|
timeoutSeconds: params.timeoutSeconds,
|
|
137
139
|
signal,
|
|
138
140
|
structured: params.structured,
|
|
@@ -79,10 +79,13 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
79
79
|
pi.registerTool({
|
|
80
80
|
name: "harnesses_detect",
|
|
81
81
|
label: HARNESS_TOOL_LABELS.harnesses_detect,
|
|
82
|
-
description:
|
|
83
|
-
|
|
82
|
+
description:
|
|
83
|
+
"List every known AI coding harness with its install state, version and the harnesses_run modes it takes: advisor (tools=false), readOnly (tools=true with readOnly=true) and agent (tools=true)",
|
|
84
|
+
promptSnippet:
|
|
85
|
+
"Use harnesses_detect to see which AI coding harnesses are installed and how each one runs.",
|
|
84
86
|
promptGuidelines: [
|
|
85
87
|
"The scan checks binaries on PATH. Versions come from native metadata or the CLI.",
|
|
88
|
+
"advisor, readOnly and agent say whether harnesses_run takes tools false, tools true with readOnly, or tools true for that harness.",
|
|
86
89
|
],
|
|
87
90
|
parameters: schemas.detect,
|
|
88
91
|
...statusRenderers("harnesses_detect"),
|
|
@@ -146,13 +149,13 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
146
149
|
name: "harnesses_run",
|
|
147
150
|
label: HARNESS_TOOL_LABELS.harnesses_run,
|
|
148
151
|
description:
|
|
149
|
-
"Run one prompt through an AI coding harness's normalized non-interactive invocation, optionally selecting a model, and return its output",
|
|
152
|
+
"Run one prompt through an AI coding harness's normalized non-interactive invocation, optionally selecting a model and reasoning effort, and return its output",
|
|
150
153
|
promptSnippet: "Use harnesses_run to delegate one prompt to another installed coding harness.",
|
|
151
154
|
promptGuidelines: [
|
|
152
155
|
"Always choose tools explicitly. Set true whenever the task needs harness tools, including Grok native X search.",
|
|
153
156
|
"Add readOnly when tools is true to require native read-only enforcement. Unsupported harnesses reject it instead of widening access.",
|
|
154
157
|
"Set tools false only for an advisor without tools. It never silently falls back to a full agent.",
|
|
155
|
-
"An unsupported mode returns an explicit retry when the alternate mode is available.",
|
|
158
|
+
"An unsupported mode returns an explicit retry when the alternate mode is available. harnesses_detect shows the modes up front.",
|
|
156
159
|
"Output is capped for context; long runs stop at the timeout.",
|
|
157
160
|
],
|
|
158
161
|
parameters: schemas.run,
|
|
@@ -166,6 +169,7 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
|
|
|
166
169
|
return runHarness(params.id, params.prompt, {
|
|
167
170
|
cwd: params.cwd,
|
|
168
171
|
model: params.model,
|
|
172
|
+
effort: params.effort,
|
|
169
173
|
timeoutSeconds: params.timeoutSeconds,
|
|
170
174
|
signal,
|
|
171
175
|
structured: params.structured,
|