@agntn/harnesses 0.2.1 → 0.3.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 +48 -9
- package/dist/_chunks/agents.mjs +5 -3
- package/dist/_chunks/agents.mjs.map +1 -1
- package/dist/_chunks/mcp-servers.mjs +5 -3
- package/dist/_chunks/mcp-servers.mjs.map +1 -1
- package/dist/_chunks/mcp.mjs +10 -1
- package/dist/_chunks/mcp.mjs.map +1 -1
- package/dist/_chunks/output.mjs +7 -1
- package/dist/_chunks/output.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +4 -2
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/{prompt-sync.d.mts → skills-sync.d.mts} +174 -57
- package/dist/_chunks/skills-sync.d.mts.map +1 -0
- package/dist/_chunks/{prompt-sync.mjs → skills-sync.mjs} +665 -148
- package/dist/_chunks/skills-sync.mjs.map +1 -0
- package/dist/_chunks/skills.mjs +30 -0
- package/dist/_chunks/skills.mjs.map +1 -0
- package/dist/_chunks/tool-operations.mjs +38 -13
- package/dist/_chunks/tool-operations.mjs.map +1 -1
- package/dist/_chunks/tool-schemas.d.mts +22 -13
- package/dist/_chunks/tool-schemas.d.mts.map +1 -1
- package/dist/_chunks/tool-schemas.mjs +18 -11
- package/dist/_chunks/tool-schemas.mjs.map +1 -1
- package/dist/_chunks/types.mjs +5 -2
- package/dist/_chunks/types.mjs.map +1 -1
- package/dist/cli.mjs +29 -9
- 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 +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.d.mts +2 -0
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +6261 -5
- package/dist/mcp.mjs.map +1 -1
- package/dist/tool-operations.d.mts +21 -4
- package/dist/tool-operations.d.mts.map +1 -1
- package/dist/tool-operations.mjs +3 -3
- package/dist/tool-schemas.d.mts +2 -2
- package/dist/tool-schemas.mjs +1 -1
- package/dist/typebox.LICENSE +23 -0
- package/package.json +18 -18
- package/packages/omp/extensions/harnesses.ts +19 -1
- package/packages/pi/extensions/harnesses.ts +27 -46
- package/packages/shared/tui.ts +13 -0
- package/dist/THIRD-PARTY-LICENSES.md +0 -36
- package/dist/_chunks/libs/typebox.mjs +0 -5439
- package/dist/_chunks/libs/typebox.mjs.map +0 -1
- package/dist/_chunks/prompt-sync.d.mts.map +0 -1
- package/dist/_chunks/prompt-sync.mjs.map +0 -1
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
declare const version: string;
|
|
3
|
+
type HarnessId = "antigravity" | "codex" | "gemini" | "grok" | "claude" | "opencode" | "cursor" | "freebuff" | "github-copilot" | "mastracode" | "omp" | "pi" | "prime-agent";
|
|
4
|
+
type EvidenceLevel = "official" | "community" | "inferred";
|
|
5
|
+
type Platform = "linux" | "darwin" | "win32";
|
|
6
|
+
interface PathCandidate {
|
|
6
7
|
path: string;
|
|
7
8
|
scope: "user" | "project" | "system" | "data";
|
|
8
9
|
level: EvidenceLevel;
|
|
9
10
|
platforms?: Platform[];
|
|
10
11
|
note?: string;
|
|
11
12
|
}
|
|
13
|
+
/** The path lists of a harness descriptor, as named in {@link ResolvedPaths}. */
|
|
14
|
+
type PathCategory = "config" | "sessions" | "instructions" | "skills" | "commands" | "promptTemplates" | "hooks" | "temp";
|
|
15
|
+
/**
|
|
16
|
+
* An environment variable the harness reads to move one of its roots. `path`
|
|
17
|
+
* is the default root, used while the variable is unset or empty.
|
|
18
|
+
*/
|
|
19
|
+
interface EnvOverride extends PathCandidate {
|
|
20
|
+
variable: string;
|
|
21
|
+
/** Categories with entries under this root, which move with it. */
|
|
22
|
+
relocates: PathCategory[];
|
|
23
|
+
}
|
|
24
|
+
/** The user-scope skills directory that skill synchronization links to the source. */
|
|
25
|
+
interface SkillsSyncTarget extends PathCandidate {
|
|
26
|
+
scope: "user";
|
|
27
|
+
}
|
|
12
28
|
/** One stable user-scope destination used by prompt template synchronization. */
|
|
13
|
-
|
|
29
|
+
interface PromptTemplateSyncTarget extends PathCandidate {
|
|
14
30
|
scope: "user";
|
|
15
31
|
format: "markdown" | "gemini-toml";
|
|
16
32
|
}
|
|
17
|
-
|
|
33
|
+
interface StorageDescriptor {
|
|
18
34
|
format: string;
|
|
19
35
|
level: EvidenceLevel;
|
|
20
36
|
note?: string;
|
|
21
37
|
}
|
|
22
|
-
|
|
38
|
+
interface HarnessCapabilities {
|
|
23
39
|
mcp: boolean;
|
|
24
40
|
vision: boolean;
|
|
25
41
|
/** Audio reaches the model without conversion or MCP. */
|
|
@@ -30,7 +46,7 @@ export interface HarnessCapabilities {
|
|
|
30
46
|
streaming: boolean;
|
|
31
47
|
}
|
|
32
48
|
/** How to run one prompt through the harness non-interactively. */
|
|
33
|
-
|
|
49
|
+
interface HarnessInvocation {
|
|
34
50
|
/** Binary to spawn; defaults to the harness's first `binaries` entry. */
|
|
35
51
|
binary?: string;
|
|
36
52
|
/** Full agent argument template; every "{prompt}" is replaced with the prompt text. */
|
|
@@ -49,11 +65,17 @@ export interface HarnessInvocation {
|
|
|
49
65
|
readOnlyMinVersion?: string;
|
|
50
66
|
/** Arguments appended when a model is selected; every "{model}" is replaced. */
|
|
51
67
|
modelArgs?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Arguments appended to a plain text run so a CLI that holds its answer until
|
|
70
|
+
* the end reports it as events instead; `invoke` folds them back into that text,
|
|
71
|
+
* so a stopped run keeps what the model had already written.
|
|
72
|
+
*/
|
|
73
|
+
streamArgs?: string[];
|
|
52
74
|
level: EvidenceLevel;
|
|
53
75
|
note?: string;
|
|
54
76
|
}
|
|
55
77
|
/** Invocation modes a harness supports without fallback or prompt-only restrictions. */
|
|
56
|
-
|
|
78
|
+
interface HarnessInvocationModes {
|
|
57
79
|
advisor: boolean;
|
|
58
80
|
advisorStructured: boolean;
|
|
59
81
|
readOnly: boolean;
|
|
@@ -62,25 +84,31 @@ export interface HarnessInvocationModes {
|
|
|
62
84
|
agentStructured: boolean;
|
|
63
85
|
}
|
|
64
86
|
/** How to ask one harness CLI for the models currently available to it. */
|
|
65
|
-
|
|
87
|
+
interface HarnessModelListing {
|
|
66
88
|
/** Arguments used when no search filter is supplied. */
|
|
67
89
|
args: string[];
|
|
68
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Optional argument template for a native search filter; every "{search}" is replaced.
|
|
92
|
+
* Without it, a search runs `args` and keeps the ids containing the filter, ignoring case.
|
|
93
|
+
*/
|
|
69
94
|
searchArgs?: string[];
|
|
70
95
|
level: EvidenceLevel;
|
|
71
96
|
note?: string;
|
|
72
97
|
}
|
|
73
98
|
/** One model normalized from a harness's native model-listing output. */
|
|
74
|
-
|
|
99
|
+
interface AvailableModel {
|
|
75
100
|
provider: string;
|
|
76
101
|
id: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
/** Absent when the native listing prints only ids, like Grok's. */
|
|
103
|
+
contextWindow?: number;
|
|
104
|
+
maxOutputTokens?: number;
|
|
105
|
+
thinking?: boolean;
|
|
106
|
+
images?: boolean;
|
|
107
|
+
/** Set on the model the harness picks when no model is given, when the listing marks one. */
|
|
108
|
+
default?: boolean;
|
|
81
109
|
}
|
|
82
110
|
/** Options for querying the models available to one harness. */
|
|
83
|
-
|
|
111
|
+
interface ListModelsOptions {
|
|
84
112
|
search?: string;
|
|
85
113
|
cwd?: string;
|
|
86
114
|
env?: Record<string, string>;
|
|
@@ -89,14 +117,14 @@ export interface ListModelsOptions {
|
|
|
89
117
|
/** Cancel with the same process cleanup as a timeout. */
|
|
90
118
|
signal?: AbortSignal;
|
|
91
119
|
}
|
|
92
|
-
|
|
120
|
+
interface InvokeOptions {
|
|
93
121
|
cwd?: string;
|
|
94
122
|
env?: Record<string, string>;
|
|
95
123
|
/** Harness-native model id or selector. */
|
|
96
124
|
model?: string;
|
|
97
125
|
/** Enable the spawned harness's tools; defaults to advisor without tools mode. */
|
|
98
126
|
tools?: boolean;
|
|
99
|
-
/** Require native enforcement of read-only tool access. Implies `tools: true
|
|
127
|
+
/** Require native enforcement of read-only tool access. Implies `tools: true` when `tools` is omitted; `tools: false` rejects the run. */
|
|
100
128
|
readOnly?: boolean;
|
|
101
129
|
/** Milliseconds before cleanup starts. Unset or 0 disables the deadline. */
|
|
102
130
|
timeoutMs?: number;
|
|
@@ -105,7 +133,7 @@ export interface InvokeOptions {
|
|
|
105
133
|
/** Use the harness's structured (JSON) output mode instead of plain text. */
|
|
106
134
|
structured?: boolean;
|
|
107
135
|
}
|
|
108
|
-
|
|
136
|
+
interface InvokeResult {
|
|
109
137
|
command: string;
|
|
110
138
|
args: string[];
|
|
111
139
|
stdout: string;
|
|
@@ -115,14 +143,16 @@ export interface InvokeResult {
|
|
|
115
143
|
timedOut: boolean;
|
|
116
144
|
/** True when caller cancellation wins over the deadline or completion. */
|
|
117
145
|
aborted: boolean;
|
|
146
|
+
/** Milliseconds without output on either stream before a deadline or cancellation stopped the process. */
|
|
147
|
+
idleMs?: number;
|
|
118
148
|
}
|
|
119
149
|
/** Result of one native model-listing command. */
|
|
120
|
-
|
|
150
|
+
interface ListModelsResult extends InvokeResult {
|
|
121
151
|
/** Empty on a successful no-match response or when the command itself failed. */
|
|
122
152
|
models: AvailableModel[];
|
|
123
153
|
}
|
|
124
154
|
/** Normalized MCP server entry, shared across every harness dialect. */
|
|
125
|
-
|
|
155
|
+
interface McpServerConfig {
|
|
126
156
|
name: string;
|
|
127
157
|
transport: "stdio" | "http" | "sse";
|
|
128
158
|
command?: string;
|
|
@@ -139,7 +169,7 @@ export interface McpServerConfig {
|
|
|
139
169
|
enabled?: boolean;
|
|
140
170
|
}
|
|
141
171
|
/** How one harness config file stores its MCP servers. */
|
|
142
|
-
|
|
172
|
+
interface McpConfigFile extends PathCandidate {
|
|
143
173
|
format: "json" | "toml";
|
|
144
174
|
/** Object path to the server map inside the file, e.g. ["mcpServers"]. */
|
|
145
175
|
key: string[];
|
|
@@ -150,34 +180,41 @@ export interface McpConfigFile extends PathCandidate {
|
|
|
150
180
|
*/
|
|
151
181
|
dialect: "standard" | "antigravity" | "mastracode" | "opencode" | "prime" | "vscode";
|
|
152
182
|
}
|
|
153
|
-
|
|
183
|
+
interface HarnessDetection {
|
|
154
184
|
/** Environment variables that indicate running inside this agent. */
|
|
155
185
|
envVars: string[];
|
|
156
186
|
/** Project-level files or directories whose presence indicates this agent. */
|
|
157
187
|
projectMarkers: string[];
|
|
158
188
|
}
|
|
159
|
-
|
|
189
|
+
interface ResolveOptions {
|
|
160
190
|
homeDir?: string;
|
|
161
191
|
projectRoot?: string;
|
|
162
192
|
platform?: Platform;
|
|
193
|
+
/** Replaces `os.tmpdir()` as the value of `${TMPDIR}`. */
|
|
194
|
+
tempDir?: string;
|
|
163
195
|
}
|
|
164
|
-
|
|
196
|
+
interface ResolvedPaths {
|
|
165
197
|
config: PathCandidate[];
|
|
166
198
|
sessions: PathCandidate[];
|
|
167
199
|
instructions: PathCandidate[];
|
|
168
200
|
skills: PathCandidate[];
|
|
201
|
+
skillsSyncTarget: SkillsSyncTarget | null;
|
|
169
202
|
commands: PathCandidate[];
|
|
170
203
|
promptTemplates: PathCandidate[];
|
|
171
204
|
promptTemplateSyncTarget: PromptTemplateSyncTarget | null;
|
|
172
205
|
hooks: PathCandidate[];
|
|
206
|
+
/** Temp roots, moved by a set `temp` override from {@link EnvOverride}. */
|
|
207
|
+
temp: PathCandidate[];
|
|
173
208
|
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/harness.d.ts
|
|
174
211
|
type InvocationOptions = Readonly<{
|
|
175
212
|
model?: string;
|
|
176
213
|
structured?: boolean;
|
|
177
214
|
tools?: boolean;
|
|
178
215
|
readOnly?: boolean;
|
|
179
216
|
}>;
|
|
180
|
-
|
|
217
|
+
declare abstract class Harness {
|
|
181
218
|
abstract readonly id: HarnessId;
|
|
182
219
|
abstract readonly name: string;
|
|
183
220
|
abstract readonly binaries: string[];
|
|
@@ -186,12 +223,18 @@ export declare abstract class Harness {
|
|
|
186
223
|
abstract readonly persistence: StorageDescriptor[];
|
|
187
224
|
abstract readonly instructions: PathCandidate[];
|
|
188
225
|
abstract readonly skills: PathCandidate[];
|
|
226
|
+
/** User-scope skills directory that skill synchronization links; null when none is verified. */
|
|
227
|
+
readonly skillsSyncTarget: SkillsSyncTarget | null;
|
|
189
228
|
abstract readonly commands: PathCandidate[];
|
|
190
229
|
/** Reusable prompt files; empty when no CLI template location is verified. */
|
|
191
230
|
readonly promptTemplates: PathCandidate[];
|
|
192
231
|
/** Stable user-scope destination used by prompt template synchronization. */
|
|
193
232
|
readonly promptTemplateSyncTarget: PromptTemplateSyncTarget | null;
|
|
194
233
|
abstract readonly hooks: PathCandidate[];
|
|
234
|
+
/** Where the harness keeps its temp files; empty when not verified. */
|
|
235
|
+
readonly temp: PathCandidate[];
|
|
236
|
+
/** Environment variables that move a root of this harness; empty when none is verified. */
|
|
237
|
+
readonly envOverrides: EnvOverride[];
|
|
195
238
|
abstract readonly capabilities: HarnessCapabilities;
|
|
196
239
|
abstract readonly detection: HarnessDetection;
|
|
197
240
|
/** Non-interactive invocation recipe; null when the harness has no headless mode. */
|
|
@@ -239,13 +282,22 @@ export declare abstract class Harness {
|
|
|
239
282
|
/**
|
|
240
283
|
* Runs one prompt through the harness non-interactively and collects the
|
|
241
284
|
* output. stdin is closed so a harness that falls back to interactive mode
|
|
242
|
-
* exits instead of waiting forever.
|
|
285
|
+
* exits instead of waiting forever. Inside a harness that `invoke` started, it rejects.
|
|
243
286
|
*
|
|
244
287
|
* @param prompt - Prompt sent to the harness.
|
|
245
288
|
* @param options - Invocation, environment, timeout, and cancellation options.
|
|
246
289
|
* @returns {Promise<InvokeResult>} The completed process result.
|
|
247
290
|
*/
|
|
248
291
|
invoke(prompt: string, options?: InvokeOptions): Promise<InvokeResult>;
|
|
292
|
+
/**
|
|
293
|
+
* Turns the events a `streamArgs` run printed back into the text the plain
|
|
294
|
+
* run would have printed.
|
|
295
|
+
*
|
|
296
|
+
* @param _stdout - Event output as captured, possibly cut short.
|
|
297
|
+
* @param _complete - False when a deadline or cancellation stopped the run.
|
|
298
|
+
* @returns {string} The answer text, or what the model had written so far.
|
|
299
|
+
*/
|
|
300
|
+
protected foldStreamOutput(_stdout: string, _complete: boolean): string;
|
|
249
301
|
/**
|
|
250
302
|
* Explains why the installed CLI cannot run a read-only recipe that carries a
|
|
251
303
|
* version floor, or returns null when no floor applies or the installed
|
|
@@ -258,7 +310,8 @@ export declare abstract class Harness {
|
|
|
258
310
|
/**
|
|
259
311
|
* Expands the native model-listing recipe without spawning anything.
|
|
260
312
|
*
|
|
261
|
-
* @param search - Optional
|
|
313
|
+
* @param search - Optional model search filter; without native `searchArgs` it is applied
|
|
314
|
+
* to the parsed output instead, so the command is the unfiltered one.
|
|
262
315
|
* @returns {{ command: string, args: string[] } | null} The command, or null when unsupported.
|
|
263
316
|
*/
|
|
264
317
|
buildModelListInvocation(search?: string): {
|
|
@@ -273,6 +326,14 @@ export declare abstract class Harness {
|
|
|
273
326
|
* @returns {Promise<ListModelsResult>} The normalized command and model result.
|
|
274
327
|
*/
|
|
275
328
|
listModels(options?: ListModelsOptions): Promise<ListModelsResult>;
|
|
329
|
+
/**
|
|
330
|
+
* The value `model` takes for one listed model: `provider/id` unless the
|
|
331
|
+
* harness overrides it.
|
|
332
|
+
*
|
|
333
|
+
* @param model - A model returned by {@link listModels}.
|
|
334
|
+
* @returns {string} The selector this harness's `modelArgs` accept.
|
|
335
|
+
*/
|
|
336
|
+
modelSelector(model: Readonly<AvailableModel>): string;
|
|
276
337
|
/**
|
|
277
338
|
* Converts a successful native model-listing response to the shared shape.
|
|
278
339
|
*
|
|
@@ -290,10 +351,20 @@ export declare abstract class Harness {
|
|
|
290
351
|
*/
|
|
291
352
|
resolveCandidates<T extends PathCandidate>(entries: readonly T[], options?: ResolveOptions): T[];
|
|
292
353
|
resolve(options?: ResolveOptions): ResolvedPaths;
|
|
354
|
+
/**
|
|
355
|
+
* Temp roots for the platform. A `temp` override set in the environment
|
|
356
|
+
* replaces its default root, the same move the harness makes itself.
|
|
357
|
+
*
|
|
358
|
+
* @param options - Platform and path-resolution overrides.
|
|
359
|
+
* @returns {PathCandidate[]} Resolved temp roots.
|
|
360
|
+
*/
|
|
361
|
+
private resolveTemp;
|
|
293
362
|
}
|
|
294
|
-
|
|
363
|
+
type HarnessConstructor = new () => Harness;
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/mcp-servers.d.ts
|
|
295
366
|
/** One resolved config file together with the servers it declares. */
|
|
296
|
-
|
|
367
|
+
interface McpConfigListing {
|
|
297
368
|
path: string;
|
|
298
369
|
scope: McpConfigFile["scope"];
|
|
299
370
|
format: McpConfigFile["format"];
|
|
@@ -305,7 +376,7 @@ export interface McpConfigListing {
|
|
|
305
376
|
error?: string;
|
|
306
377
|
}
|
|
307
378
|
/** Thrown when a server's env cannot be written the way the target dialect requires. */
|
|
308
|
-
|
|
379
|
+
declare class McpEnvError extends Error {
|
|
309
380
|
readonly name = "McpEnvError";
|
|
310
381
|
}
|
|
311
382
|
/**
|
|
@@ -316,7 +387,7 @@ export declare class McpEnvError extends Error {
|
|
|
316
387
|
* @param options - Platform and path-resolution overrides.
|
|
317
388
|
* @returns {McpConfigListing[]} One listing per declared config file.
|
|
318
389
|
*/
|
|
319
|
-
|
|
390
|
+
declare function listMcpServers(harness: Harness, options?: ResolveOptions): McpConfigListing[];
|
|
320
391
|
/**
|
|
321
392
|
* Adds (or replaces) one MCP server in a harness's config. The rest of the
|
|
322
393
|
* file is preserved: JSON through a parse/serialize round trip (formatting
|
|
@@ -328,7 +399,7 @@ export declare function listMcpServers(harness: Harness, options?: ResolveOption
|
|
|
328
399
|
* @param options - Platform and path-resolution overrides.
|
|
329
400
|
* @returns {{ path: string, replaced: boolean }} The written path and replacement status.
|
|
330
401
|
*/
|
|
331
|
-
|
|
402
|
+
declare function addMcpServer(harness: Harness, server: McpServerConfig, scope?: "user" | "project", options?: ResolveOptions): {
|
|
332
403
|
path: string;
|
|
333
404
|
replaced: boolean;
|
|
334
405
|
};
|
|
@@ -341,7 +412,7 @@ export declare function addMcpServer(harness: Harness, server: McpServerConfig,
|
|
|
341
412
|
* @param options - Platform and path-resolution overrides.
|
|
342
413
|
* @returns {{ path: string, removed: boolean }} The targeted path and removal status.
|
|
343
414
|
*/
|
|
344
|
-
|
|
415
|
+
declare function removeMcpServer(harness: Harness, name: string, scope?: "user" | "project", options?: ResolveOptions): {
|
|
345
416
|
path: string;
|
|
346
417
|
removed: boolean;
|
|
347
418
|
};
|
|
@@ -352,16 +423,16 @@ export declare function removeMcpServer(harness: Harness, name: string, scope?:
|
|
|
352
423
|
* @param text - JSONC source text.
|
|
353
424
|
* @returns {unknown} The parsed JSON value.
|
|
354
425
|
*/
|
|
355
|
-
|
|
426
|
+
declare function parseJsonc(text: string): unknown;
|
|
356
427
|
/**
|
|
357
428
|
* Resolves the master sync file path: $XDG_CONFIG_HOME or ~/.config.
|
|
358
429
|
*
|
|
359
430
|
* @param options - Path-resolution overrides.
|
|
360
431
|
* @returns {string} The resolved master MCP config path.
|
|
361
432
|
*/
|
|
362
|
-
|
|
433
|
+
declare function masterMcpPath(options?: ResolveOptions): string;
|
|
363
434
|
/** One harness's outcome of a sync run. */
|
|
364
|
-
|
|
435
|
+
interface SyncTargetResult {
|
|
365
436
|
id: string;
|
|
366
437
|
path?: string;
|
|
367
438
|
/** Reason this harness could not be targeted; `results` is empty then. */
|
|
@@ -376,7 +447,7 @@ export interface SyncTargetResult {
|
|
|
376
447
|
}>;
|
|
377
448
|
}
|
|
378
449
|
/** Outcome of resetting the harness configs to the master list. */
|
|
379
|
-
|
|
450
|
+
interface SyncReport {
|
|
380
451
|
source: string;
|
|
381
452
|
servers: string[];
|
|
382
453
|
targets: SyncTargetResult[];
|
|
@@ -387,7 +458,7 @@ export interface SyncReport {
|
|
|
387
458
|
* @param options - Path-resolution overrides.
|
|
388
459
|
* @returns {{ path: string, servers: McpServerConfig[], excludes: string[] }} The master list.
|
|
389
460
|
*/
|
|
390
|
-
|
|
461
|
+
declare function readMasterMcpServers(options?: ResolveOptions): {
|
|
391
462
|
path: string;
|
|
392
463
|
servers: McpServerConfig[];
|
|
393
464
|
/** Harness ids the master list opts out of syncing. */
|
|
@@ -402,9 +473,11 @@ export declare function readMasterMcpServers(options?: ResolveOptions): {
|
|
|
402
473
|
* @param options - Platform and path-resolution overrides.
|
|
403
474
|
* @returns {SyncReport} Per-harness synchronization outcomes.
|
|
404
475
|
*/
|
|
405
|
-
|
|
476
|
+
declare function syncMcpServers(harnesses: readonly Harness[], options?: ResolveOptions): SyncReport;
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/agents-sync.d.ts
|
|
406
479
|
/** Configuration read from agents.jsonc. */
|
|
407
|
-
|
|
480
|
+
interface AgentsConfig {
|
|
408
481
|
/** The master instructions file every harness links to. */
|
|
409
482
|
source: string;
|
|
410
483
|
/** Relative files to link beside every harness instructions target. */
|
|
@@ -414,9 +487,9 @@ export interface AgentsConfig {
|
|
|
414
487
|
/** Path the config was read from; absent when defaults were used. */
|
|
415
488
|
configPath?: string;
|
|
416
489
|
}
|
|
417
|
-
|
|
490
|
+
type AgentsSyncAction = "linked" | "relinked" | "adopted" | "unchanged" | "skipped";
|
|
418
491
|
/** One companion file's outcome for a harness target. */
|
|
419
|
-
|
|
492
|
+
interface AgentsCompanionTargetResult {
|
|
420
493
|
readonly source: string;
|
|
421
494
|
readonly path: string;
|
|
422
495
|
readonly action: Exclude<AgentsSyncAction, "skipped">;
|
|
@@ -424,7 +497,7 @@ export interface AgentsCompanionTargetResult {
|
|
|
424
497
|
readonly detail?: string;
|
|
425
498
|
}
|
|
426
499
|
/** One harness's outcome of an agents sync run. */
|
|
427
|
-
|
|
500
|
+
interface AgentsTargetResult {
|
|
428
501
|
id: string;
|
|
429
502
|
path?: string;
|
|
430
503
|
action: AgentsSyncAction;
|
|
@@ -434,7 +507,7 @@ export interface AgentsTargetResult {
|
|
|
434
507
|
companions?: readonly AgentsCompanionTargetResult[];
|
|
435
508
|
}
|
|
436
509
|
/** Outcome of one agents sync/doctor run. */
|
|
437
|
-
|
|
510
|
+
interface AgentsSyncReport {
|
|
438
511
|
source: string;
|
|
439
512
|
check: boolean;
|
|
440
513
|
targets: AgentsTargetResult[];
|
|
@@ -445,7 +518,7 @@ export interface AgentsSyncReport {
|
|
|
445
518
|
* @param options - Path-resolution overrides.
|
|
446
519
|
* @returns {AgentsConfig} The normalized sync configuration.
|
|
447
520
|
*/
|
|
448
|
-
|
|
521
|
+
declare function readAgentsConfig(options?: ResolveOptions): AgentsConfig;
|
|
449
522
|
/**
|
|
450
523
|
* Links every harness's user-scope instructions file to the master. In check
|
|
451
524
|
* mode nothing is written; the report shows what a real run would do.
|
|
@@ -455,10 +528,12 @@ export declare function readAgentsConfig(options?: ResolveOptions): AgentsConfig
|
|
|
455
528
|
* @param options - Path-resolution overrides.
|
|
456
529
|
* @returns {AgentsSyncReport} Per-harness synchronization outcomes.
|
|
457
530
|
*/
|
|
458
|
-
|
|
459
|
-
|
|
531
|
+
declare function syncAgentsFiles(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): AgentsSyncReport;
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region src/prompt-sync.d.ts
|
|
534
|
+
type PromptSyncAction = "linked" | "generated" | "relinked" | "replaced" | "adopted" | "removed" | "unchanged" | "skipped";
|
|
460
535
|
/** One prompt template's outcome at a harness destination. */
|
|
461
|
-
|
|
536
|
+
interface PromptTemplateTargetResult {
|
|
462
537
|
readonly name: string;
|
|
463
538
|
readonly source?: string;
|
|
464
539
|
readonly path: string;
|
|
@@ -467,15 +542,18 @@ export interface PromptTemplateTargetResult {
|
|
|
467
542
|
readonly detail?: string;
|
|
468
543
|
}
|
|
469
544
|
/** One harness's outcome of a prompt template sync run. */
|
|
470
|
-
|
|
545
|
+
interface PromptSyncTargetResult {
|
|
471
546
|
readonly id: string;
|
|
472
547
|
readonly path?: string;
|
|
473
548
|
readonly format?: PromptTemplateSyncTarget["format"];
|
|
549
|
+
/** Outcome for a Markdown destination, which is one link to the whole source directory. */
|
|
550
|
+
readonly action?: PromptSyncAction;
|
|
551
|
+
/** Backup path, skip reason, or a check-mode note. */
|
|
474
552
|
readonly detail?: string;
|
|
475
553
|
readonly templates: readonly PromptTemplateTargetResult[];
|
|
476
554
|
}
|
|
477
555
|
/** Outcome of one prompt template sync run. */
|
|
478
|
-
|
|
556
|
+
interface PromptSyncReport {
|
|
479
557
|
readonly source: string;
|
|
480
558
|
readonly check: boolean;
|
|
481
559
|
readonly templates: readonly string[];
|
|
@@ -483,13 +561,52 @@ export interface PromptSyncReport {
|
|
|
483
561
|
}
|
|
484
562
|
/**
|
|
485
563
|
* Synchronizes canonical Markdown prompt templates into each harness's stable
|
|
486
|
-
* user-scope destination. Markdown
|
|
487
|
-
*
|
|
564
|
+
* user-scope destination. A Markdown harness's destination becomes one symlink
|
|
565
|
+
* to the source directory; Gemini's directory holds only TOML commands
|
|
566
|
+
* generated from it. Anything else found there is backed up first. In check
|
|
567
|
+
* mode nothing is written.
|
|
488
568
|
*
|
|
489
569
|
* @param harnesses - Harnesses to inspect or update.
|
|
490
570
|
* @param check - Report intended changes without writing them.
|
|
491
571
|
* @param options - Path-resolution overrides.
|
|
492
572
|
* @returns {PromptSyncReport} Per-harness synchronization outcomes.
|
|
493
573
|
*/
|
|
494
|
-
|
|
495
|
-
//#
|
|
574
|
+
declare function syncPromptTemplates(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): PromptSyncReport;
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/directory-link.d.ts
|
|
577
|
+
type DirectoryLinkAction = "linked" | "relinked" | "adopted" | "unchanged" | "skipped";
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/skills-sync.d.ts
|
|
580
|
+
type SkillsSyncAction = DirectoryLinkAction;
|
|
581
|
+
/** One harness's outcome of a skill sync run. */
|
|
582
|
+
interface SkillsSyncTargetResult {
|
|
583
|
+
readonly id: string;
|
|
584
|
+
readonly path?: string;
|
|
585
|
+
readonly action: SkillsSyncAction;
|
|
586
|
+
/** Backup path, skip reason, or a check-mode note. */
|
|
587
|
+
readonly detail?: string;
|
|
588
|
+
}
|
|
589
|
+
/** Outcome of one skill sync run. */
|
|
590
|
+
interface SkillsSyncReport {
|
|
591
|
+
readonly source: string;
|
|
592
|
+
readonly check: boolean;
|
|
593
|
+
/** Source subdirectories that hold a SKILL.md. */
|
|
594
|
+
readonly skills: readonly string[];
|
|
595
|
+
readonly targets: readonly SkillsSyncTargetResult[];
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Links each harness's user-scope skills directory to the canonical skills
|
|
599
|
+
* directory under the agntn XDG data directory, so a skill added or edited
|
|
600
|
+
* through any harness lands in one place. Per-skill links into the source are
|
|
601
|
+
* replaced; any other content is backed up first. In check mode nothing is
|
|
602
|
+
* written.
|
|
603
|
+
*
|
|
604
|
+
* @param harnesses - Harnesses to inspect or update.
|
|
605
|
+
* @param check - Report intended changes without writing them.
|
|
606
|
+
* @param options - Path-resolution overrides.
|
|
607
|
+
* @returns {SkillsSyncReport} Per-harness synchronization outcomes.
|
|
608
|
+
*/
|
|
609
|
+
declare function syncSkills(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): SkillsSyncReport;
|
|
610
|
+
//#endregion
|
|
611
|
+
export { version as $, AvailableModel as A, InvokeResult as B, masterMcpPath as C, syncMcpServers as D, removeMcpServer as E, HarnessId as F, PathCandidate as G, ListModelsResult as H, HarnessInvocation as I, PromptTemplateSyncTarget as J, PathCategory as K, HarnessInvocationModes as L, EvidenceLevel as M, HarnessCapabilities as N, Harness as O, HarnessDetection as P, StorageDescriptor as Q, HarnessModelListing as R, listMcpServers as S, readMasterMcpServers as T, McpConfigFile as U, ListModelsOptions as V, McpServerConfig as W, ResolvedPaths as X, ResolveOptions as Y, SkillsSyncTarget as Z, McpConfigListing as _, PromptSyncAction as a, SyncTargetResult as b, PromptTemplateTargetResult as c, AgentsConfig as d, AgentsSyncAction as f, syncAgentsFiles as g, readAgentsConfig as h, syncSkills as i, EnvOverride as j, HarnessConstructor as k, syncPromptTemplates as l, AgentsTargetResult as m, SkillsSyncReport as n, PromptSyncReport as o, AgentsSyncReport as p, Platform as q, SkillsSyncTargetResult as r, PromptSyncTargetResult as s, SkillsSyncAction as t, AgentsCompanionTargetResult as u, McpEnvError as v, parseJsonc as w, addMcpServer as x, SyncReport as y, InvokeOptions as z };
|
|
612
|
+
//# sourceMappingURL=skills-sync.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-sync.d.mts","names":[],"sources":["../../src/types.ts","../../src/harness.ts","../../src/mcp-servers.ts","../../src/agents-sync.ts","../../src/prompt-sync.ts","../../src/directory-link.ts","../../src/skills-sync.ts"],"mappings":";cAEa;KAED;KAcA;KACA;UAEK;EACf;EACA;EACA,OAAO;EACP,YAAY;EACZ;;;KAIU;;;;;UAcK,oBAAoB;EACnC;;EAEA,WAAW;;;UAII,yBAAyB;EACxC;;;UAIe,iCAAiC;EAChD;EACA;;UAGe;EACf;EACA,OAAO;EACP;;UAGe;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;UAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;;;;;EAKA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;;EAEA;EACA;EACA;EACA;;EAEA;;;UAIe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA,SAAS;;UAGM;EACf;EACA,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;EAEA,SAAS;;EAET;;UAGe;EACf;EACA;EAC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