@agntn/harnesses 0.1.1 → 0.2.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 +130 -118
- package/dist/_chunks/agents-sync.d.mts +40 -41
- package/dist/_chunks/agents-sync.d.mts.map +1 -1
- package/dist/_chunks/agents-sync.mjs +49 -6
- package/dist/_chunks/agents-sync.mjs.map +1 -1
- package/dist/_chunks/libs/typebox.mjs +524 -600
- package/dist/_chunks/libs/typebox.mjs.map +1 -1
- package/dist/_chunks/mcp.mjs +1 -1
- package/dist/_chunks/mcp.mjs.map +1 -1
- package/dist/_chunks/tool-schemas.d.mts +12 -13
- package/dist/_chunks/tool-schemas.d.mts.map +1 -1
- package/dist/_chunks/types.mjs +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/mcp.d.mts +1 -2
- package/dist/mcp.d.mts.map +1 -1
- package/dist/tool-operations.d.mts +31 -31
- package/dist/tool-operations.d.mts.map +1 -1
- package/package.json +15 -14
- package/packages/pi/extensions/harnesses.ts +3 -1
package/README.md
CHANGED
|
@@ -5,160 +5,172 @@
|
|
|
5
5
|
[](https://npmx.dev/package/@agntn/harnesses)
|
|
6
6
|
[](https://deepwiki.com/agntn/harnesses)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
🧭 Thirteen coding CLIs, one map. You ask where Claude keeps skills, you get the path.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
> [!WARNING]
|
|
11
|
+
> **@agntn/harnesses is pre-1.0.** Paths follow upstream CLIs that still move. Building on it now means pinning the version.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Why?
|
|
14
|
+
|
|
15
|
+
Claude stores transcripts under a mangled copy of your cwd. Codex keeps TOML with comments you wanted to keep. Ask a model where Codex lives and it invents `.claude/`. So this is one registry: thirteen harnesses, same object, paths for your machine.
|
|
16
|
+
|
|
17
|
+
The rest of it sits on [harnesses.agntn.dev](https://harnesses.agntn.dev).
|
|
18
|
+
|
|
19
|
+
## ✨ Features
|
|
20
|
+
|
|
21
|
+
- 🧩 **Thirteen harnesses, one class.** Same fields on Claude, Codex, Pi and the rest.
|
|
22
|
+
- 📂 **Every path has a receipt.** Scope, evidence level, and a platform tag when the OS actually differs.
|
|
23
|
+
- 🔎 **Detects which CLI you're inside.** Environment variables first. Two project markers in one directory is `null`, not a guess.
|
|
24
|
+
- ▶️ **Headless runs with real modes.** Advisor without tools, full agent, or a native read-only sandbox. A mode the CLI cannot enforce is rejected.
|
|
25
|
+
- 🔌 **MCP across the dialects.** One master list at `~/.config/agntn/mcp.jsonc`. TOML edits keep the comments.
|
|
26
|
+
- 🔗 **One AGENTS.md behind the global files.** Symlinks, so an edit through Claude or Gemini is the same bytes.
|
|
27
|
+
- 📜 **Session types when the format is stable.** JSONL, SQLite, JSON. Unstable shapes stay `unknown`.
|
|
28
|
+
- 🤖 **Nine tools, three doors.** MCP, Pi and OMP call the same executors.
|
|
29
|
+
|
|
30
|
+
## 📦 Install
|
|
13
31
|
|
|
14
32
|
```bash
|
|
15
33
|
pnpm add @agntn/harnesses
|
|
16
34
|
```
|
|
17
35
|
|
|
18
|
-
|
|
36
|
+
Node.js 24 or newer.
|
|
19
37
|
|
|
20
|
-
|
|
21
|
-
import { getHarness, detectHarness, detectProjectHarnesses } from "@agntn/harnesses";
|
|
38
|
+
## 🚀 First call
|
|
22
39
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
```bash
|
|
41
|
+
npx @agntn/harnesses detect
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
System Scan
|
|
46
|
+
|
|
47
|
+
● antigravity Google Antigravity CLI v1.2.5
|
|
48
|
+
● claude Anthropic Claude Code v2.1.276
|
|
49
|
+
● codex OpenAI Codex CLI v0.154.0
|
|
50
|
+
○ cursor Cursor
|
|
51
|
+
● freebuff Freebuff
|
|
52
|
+
○ gemini Google Gemini CLI
|
|
53
|
+
○ github-copilot GitHub Copilot
|
|
54
|
+
● grok xAI Grok CLI v1.0.34
|
|
55
|
+
● mastracode Mastra Code
|
|
56
|
+
● omp OMP (oh-my-pi) v18.2.4
|
|
57
|
+
● opencode OpenCode CLI v2.0.5
|
|
58
|
+
● prime-agent Prime Agent v0.9.5
|
|
59
|
+
● pi Pi Coding Agent v0.85.1
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
No key, no config. No network either. `detect` looks at `PATH`. Filled dot is installed, hollow is not. After `pnpm add`, the same command is `pnpm exec harnesses`, or install it once with `pnpm add -g @agntn/harnesses`.
|
|
63
|
+
|
|
64
|
+
Same binary, more commands:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
harnesses list
|
|
68
|
+
harnesses info claude
|
|
69
|
+
harnesses paths pi
|
|
70
|
+
harnesses models pi gpt-5.4 --json
|
|
71
|
+
harnesses run claude "review this design"
|
|
72
|
+
harnesses run codex --read-only "review this"
|
|
73
|
+
harnesses mcp-servers list
|
|
74
|
+
harnesses agents sync --check
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`run` without `--tools` is the advisor. `--tools` is the full agent. `--read-only` asks the CLI for a sandbox and implies tools. Timeouts, `--cwd` and `--model` sit in the [CLI guide](https://harnesses.agntn.dev/guide/cli).
|
|
27
78
|
|
|
28
|
-
|
|
29
|
-
await codex.invoke("Review this patch", { readOnly: true, timeoutMs: 60_000 });
|
|
79
|
+
### Commands
|
|
30
80
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
81
|
+
| Command | What it does | Example |
|
|
82
|
+
| ------------- | ------------------------------------------------------ | ------------------------------------------- |
|
|
83
|
+
| `list` | Every known harness, id and name | `harnesses list` |
|
|
84
|
+
| `detect` | Which ones are installed, with versions | `harnesses detect` |
|
|
85
|
+
| `info` | Registry entry: modes, capabilities, path templates | `harnesses info claude` |
|
|
86
|
+
| `paths` | Those templates expanded for this machine | `harnesses paths pi` |
|
|
87
|
+
| `models` | Models the harness can use, through its native listing | `harnesses models pi` |
|
|
88
|
+
| `run` | One prompt through headless mode | `harnesses run claude "review this design"` |
|
|
89
|
+
| `mcp-servers` | MCP servers across the config dialects | `harnesses mcp-servers list` |
|
|
90
|
+
| `agents sync` | Link global instructions files to one master | `harnesses agents sync --check` |
|
|
91
|
+
| `mcp` | The MCP server on stdio | `harnesses mcp` |
|
|
35
92
|
|
|
36
|
-
|
|
93
|
+
`list`, `detect`, `info`, `paths` and `models` take `--json` or `--toon`. `run --json` is different: that one is the harness's own structured output.
|
|
94
|
+
|
|
95
|
+
## 🧠 Library
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
import { getHarness, detectHarness } from "@agntn/harnesses";
|
|
99
|
+
|
|
100
|
+
const claude = getHarness("claude");
|
|
37
101
|
const paths = claude.resolve({ platform: "linux", homeDir: "/home/dev" });
|
|
38
|
-
console.log(paths.
|
|
102
|
+
console.log(paths.skills);
|
|
39
103
|
|
|
40
|
-
// Detect which agent is running (env vars first, then project markers)
|
|
41
104
|
const active = detectHarness();
|
|
42
|
-
if (active)
|
|
43
|
-
console.log(`Running inside ${active.name}`);
|
|
44
|
-
}
|
|
105
|
+
if (active) console.log(active.id);
|
|
45
106
|
|
|
46
|
-
|
|
47
|
-
const harnesses = detectProjectHarnesses("/path/to/project");
|
|
107
|
+
await getHarness("codex").invoke("Review this patch", { readOnly: true });
|
|
48
108
|
```
|
|
49
109
|
|
|
50
|
-
|
|
110
|
+
That's most of it, really. `getHarness` wants an exact id. `detectHarness` uses env vars first, then a single project marker. `invoke()` talks to the CLI. A mode the CLI cannot run comes back as an error, not a quieter one. The rest: [Registry](https://harnesses.agntn.dev/guide/registry), [Invoke](https://harnesses.agntn.dev/guide/invoke), [MCP servers](https://harnesses.agntn.dev/guide/mcp-servers), [Instructions files](https://harnesses.agntn.dev/guide/agents-sync).
|
|
51
111
|
|
|
52
|
-
|
|
53
|
-
import type { ClaudeSessionEntry, CodexThread, GeminiConversationRecord } from "@agntn/harnesses";
|
|
54
|
-
```
|
|
112
|
+
## 🗺️ Harnesses
|
|
55
113
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
| Prime Agent | `prime-agent` | env + project | `.prime/agent/skills/` | - | JSONL + JSON |
|
|
72
|
-
| Freebuff | `freebuff` | project | `.agents/skills/` | - | JSON + JSONL |
|
|
73
|
-
|
|
74
|
-
### Native audio and video input
|
|
75
|
-
|
|
76
|
-
`audio` and `video` report whether the harness has a verified native route that puts that medium into model context. External conversion, MCP tools, and voice dictation that becomes text do not count. `false` means no native route was verified, not that every possible provider or extension was disproved.
|
|
77
|
-
|
|
78
|
-
| Agent | Audio | Video | Evidence boundary |
|
|
79
|
-
| --------------- | :---: | :---: | --------------------------------------------------------------------------- |
|
|
80
|
-
| Antigravity CLI | Yes | Yes | Native attachments; documented audio formats and direct video pasting |
|
|
81
|
-
| Gemini CLI | Yes | No | The `read_file` tool supports audio; native video support is not documented |
|
|
82
|
-
| Claude Code | No | No | No verified native route |
|
|
83
|
-
| Codex CLI | No | No | No verified native route |
|
|
84
|
-
| Grok CLI | No | No | Its ACP parser recognizes audio blocks, but the runtime rejects them |
|
|
85
|
-
| OpenCode | No | No | Its attachment documentation explicitly excludes audio and video |
|
|
86
|
-
| Cursor | No | No | Voice input is transcribed to text |
|
|
87
|
-
| GitHub Copilot | No | No | Voice input is transcribed locally to text |
|
|
88
|
-
| Mastra Code | No | No | No verified native route |
|
|
89
|
-
| OMP (oh-my-pi) | No | No | No verified native route |
|
|
90
|
-
| Pi Coding Agent | No | No | No verified native route |
|
|
91
|
-
| Prime Agent | No | No | No verified native route |
|
|
92
|
-
| Freebuff | No | No | No verified native route |
|
|
93
|
-
|
|
94
|
-
Primary references: [Antigravity prompting](https://antigravity.google/docs/cli/prompting/), [Antigravity changelog](https://github.com/google-antigravity/antigravity-cli/blob/main/CHANGELOG.md), [Gemini CLI tools](https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/tools.md), [Gemini CLI video request](https://github.com/google-gemini/gemini-cli/issues/27194), [OpenCode attachments](https://opencode.ai/v2/docs/attachments/), [Cursor prompting](https://cursor.com/docs/agent/prompting), and [Copilot CLI voice input](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input).
|
|
95
|
-
|
|
96
|
-
`invoke()` and `listModels()` accept `timeoutMs` and `signal?: AbortSignal`. Unset or `0` means no deadline. An already aborted signal skips spawning. Otherwise, the first cancellation or deadline starts cleanup: Linux and macOS use a dedicated process group, with `SIGTERM` followed by `SIGKILL` after 500 ms even if the root has exited. Windows uses `taskkill /T /F` immediately, with a 2 s budget for that command. Cleanup failures reject the call.
|
|
97
|
-
|
|
98
|
-
Stopped results retain captured output and set `exitCode: null`. Caller cancellation sets `aborted: true`, a deadline sets `timedOut: true`, and the first reason wins. Both flags are false on normal completion. Later aborts do nothing, and cancelled model listings return no parsed models. Pi, OMP, and MCP tools forward their host request signal, not a JSON argument supplied by the model.
|
|
114
|
+
| ID | Name | Project skills |
|
|
115
|
+
| ---------------- | ---------------------- | ---------------------- |
|
|
116
|
+
| `antigravity` | Google Antigravity CLI | `.agents/skills/` |
|
|
117
|
+
| `claude` | Anthropic Claude Code | `.claude/skills/` |
|
|
118
|
+
| `codex` | OpenAI Codex CLI | `.codex/skills/` |
|
|
119
|
+
| `cursor` | Cursor | `.cursor/skills/` |
|
|
120
|
+
| `freebuff` | Freebuff | `.agents/skills/` |
|
|
121
|
+
| `gemini` | Google Gemini CLI | `.gemini/skills/` |
|
|
122
|
+
| `github-copilot` | GitHub Copilot | `.github/skills/` |
|
|
123
|
+
| `grok` | xAI Grok CLI | `.grok/skills/` |
|
|
124
|
+
| `mastracode` | Mastra Code | `.mastracode/skills/` |
|
|
125
|
+
| `omp` | OMP (oh-my-pi) | `.omp/skills/` |
|
|
126
|
+
| `opencode` | OpenCode CLI | `.opencode/skills/` |
|
|
127
|
+
| `prime-agent` | Prime Agent | `.prime/agent/skills/` |
|
|
128
|
+
| `pi` | Pi Coding Agent | `.pi/skills/` |
|
|
99
129
|
|
|
100
|
-
|
|
101
|
-
const controller = new AbortController();
|
|
102
|
-
const pending = getHarness("pi").invoke("Review this change", {
|
|
103
|
-
tools: true,
|
|
104
|
-
readOnly: true,
|
|
105
|
-
signal: controller.signal,
|
|
106
|
-
});
|
|
107
|
-
controller.abort();
|
|
108
|
-
const result = await pending;
|
|
109
|
-
console.log(result.aborted);
|
|
110
|
-
```
|
|
130
|
+
That's the project directory. Most of them also keep a copy under your home directory, and a few read someone else's skills folder on purpose. Sessions, hooks, audio, video, the whole sheet: [Harnesses](https://harnesses.agntn.dev/harnesses).
|
|
111
131
|
|
|
112
|
-
|
|
132
|
+
## 🤖 Agents
|
|
113
133
|
|
|
114
|
-
|
|
134
|
+
```bash
|
|
135
|
+
harnesses mcp
|
|
136
|
+
pi install npm:@agntn/harnesses
|
|
137
|
+
omp install @agntn/harnesses
|
|
138
|
+
```
|
|
115
139
|
|
|
116
|
-
```
|
|
140
|
+
```json
|
|
117
141
|
{
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"harnesses": { "command": "npx", "args": ["-y", "@agntn/harnesses", "mcp"] }
|
|
144
|
+
}
|
|
121
145
|
}
|
|
122
146
|
```
|
|
123
147
|
|
|
124
|
-
|
|
148
|
+
Nine tools, the same nine on MCP, Pi and OMP. `harnesses_detect`, `harnesses_info` and `harnesses_mcp_list` only read. `harnesses_run` is the one that can spend tokens. `tools` is required, so the model has to pick advisor or agent. What each call returns is on the [Agents page](https://harnesses.agntn.dev/guide/agents).
|
|
125
149
|
|
|
126
|
-
|
|
150
|
+
## 🚫 What this does not do
|
|
127
151
|
|
|
128
|
-
|
|
152
|
+
It does not install skills, drive a browser, or run a sandbox of its own. `invoke()` is the harness CLI plus process cleanup. The wide, thin agent list is [unagent](https://github.com/onmax/unagent).
|
|
129
153
|
|
|
130
|
-
|
|
131
|
-
harnesses list # all known harnesses
|
|
132
|
-
harnesses detect # which ones are installed + versions
|
|
133
|
-
harnesses info claude # metadata, including supported invocation modes
|
|
134
|
-
harnesses paths claude # resolved paths for current platform
|
|
135
|
-
harnesses info codex --json # machine-readable output
|
|
136
|
-
harnesses models pi # models available to Pi
|
|
137
|
-
harnesses models pi gpt-5.4 --json
|
|
138
|
-
harnesses run claude "review this design" # advisor without tools mode (default)
|
|
139
|
-
harnesses run pi --model openai-codex/gpt-5.4 "review this design"
|
|
140
|
-
harnesses run claude --tools "fix lint" # full agent with tools enabled
|
|
141
|
-
harnesses run codex --read-only "review this" # tools inside a native read-only sandbox
|
|
142
|
-
harnesses mcp-servers list # MCP servers configured across all harnesses
|
|
143
|
-
harnesses mcp-servers add omp probe --command node --args "srv.mjs mcp"
|
|
144
|
-
harnesses mcp-servers remove omp probe
|
|
145
|
-
harnesses mcp-servers sync # reset all harnesses to ~/.config/agntn/mcp.jsonc
|
|
146
|
-
harnesses agents sync --check # doctor: link global AGENTS.md files to one master
|
|
147
|
-
harnesses mcp # run the MCP server over stdio
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
`tools` defaults to `false` in the library and CLI. The MCP, Pi, and OMP tools require agents to choose it explicitly. `false` must use a native CLI flag that removes tools from the model context; it is a lightweight advisor, not an agent constrained only by prompt wording. Set `tools: true` (or CLI `--tools`) whenever the task needs harness tools, including Grok's native X search. Add `readOnly: true` when those tools must stay inside a sandbox enforced by the harness CLI; the agent tools pass it beside `tools: true`, while the library and CLI let it imply tools. Read-only mode is rejected when a harness has no verified native recipe, so it never falls back to broader access. A recipe can also carry the lowest CLI version whose enforcement was verified, and `invoke()` rejects read-only runs on older or unknown versions: Grok runs `--sandbox read-only` from 1.0.13, and Claude Code keeps read-only runs on `Read`, `Glob` and `Grep` with `--strict-mcp-config` from 2.1.175. Harnesses whose CLI cannot disable tools reject advisor mode instead of silently running an agent and return an explicit `tools` retry when their full agent mode can handle the request.
|
|
154
|
+
## 🧩 Adding a harness
|
|
151
155
|
|
|
152
|
-
|
|
156
|
+
Want a fourteenth? One class extending `Harness`, then `registerHarness`. `getHarness`, the CLI and the tools pick it up. How to write that class: [Custom harnesses](https://harnesses.agntn.dev/guide/custom).
|
|
153
157
|
|
|
154
|
-
|
|
158
|
+
## 🛠️ Development
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+
```bash
|
|
161
|
+
pnpm install
|
|
162
|
+
pnpm lint # builds first, then oxlint and oxfmt --check
|
|
163
|
+
pnpm lint:fix
|
|
164
|
+
pnpm typecheck
|
|
165
|
+
pnpm test:run
|
|
166
|
+
pnpm build # obuild
|
|
167
|
+
pnpm docs # the Docus site, bundles src/ itself
|
|
168
|
+
```
|
|
157
169
|
|
|
158
|
-
|
|
170
|
+
## 💛 Thanks
|
|
159
171
|
|
|
160
|
-
|
|
172
|
+
Anthropic and OpenAI both run programs this package was built with. [Claude for Open Source](https://claude.com/contact-sales/claude-for-oss) and [Codex for Open Source](https://developers.openai.com/community/codex-for-oss). Thank you <3
|
|
161
173
|
|
|
162
|
-
## License
|
|
174
|
+
## 📄 License
|
|
163
175
|
|
|
164
176
|
[MIT](./LICENSE)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
declare const version: string;
|
|
2
|
-
type HarnessId = "antigravity" | "codex" | "gemini" | "grok" | "claude" | "opencode" | "cursor" | "freebuff" | "github-copilot" | "mastracode" | "omp" | "pi" | "prime-agent";
|
|
3
|
-
type EvidenceLevel = "official" | "community" | "inferred";
|
|
4
|
-
type Platform = "linux" | "darwin" | "win32";
|
|
5
|
-
interface PathCandidate {
|
|
1
|
+
export declare const version: string;
|
|
2
|
+
export type HarnessId = "antigravity" | "codex" | "gemini" | "grok" | "claude" | "opencode" | "cursor" | "freebuff" | "github-copilot" | "mastracode" | "omp" | "pi" | "prime-agent";
|
|
3
|
+
export type EvidenceLevel = "official" | "community" | "inferred";
|
|
4
|
+
export type Platform = "linux" | "darwin" | "win32";
|
|
5
|
+
export interface PathCandidate {
|
|
6
6
|
path: string;
|
|
7
7
|
scope: "user" | "project" | "system" | "data";
|
|
8
8
|
level: EvidenceLevel;
|
|
9
9
|
platforms?: Platform[];
|
|
10
10
|
note?: string;
|
|
11
11
|
}
|
|
12
|
-
interface StorageDescriptor {
|
|
12
|
+
export interface StorageDescriptor {
|
|
13
13
|
format: string;
|
|
14
14
|
level: EvidenceLevel;
|
|
15
15
|
note?: string;
|
|
16
16
|
}
|
|
17
|
-
interface HarnessCapabilities {
|
|
17
|
+
export interface HarnessCapabilities {
|
|
18
18
|
mcp: boolean;
|
|
19
19
|
vision: boolean;
|
|
20
20
|
/** Audio reaches the model without conversion or MCP. */
|
|
@@ -25,7 +25,7 @@ interface HarnessCapabilities {
|
|
|
25
25
|
streaming: boolean;
|
|
26
26
|
}
|
|
27
27
|
/** How to run one prompt through the harness non-interactively. */
|
|
28
|
-
interface HarnessInvocation {
|
|
28
|
+
export interface HarnessInvocation {
|
|
29
29
|
/** Binary to spawn; defaults to the harness's first `binaries` entry. */
|
|
30
30
|
binary?: string;
|
|
31
31
|
/** Full agent argument template; every "{prompt}" is replaced with the prompt text. */
|
|
@@ -48,7 +48,7 @@ interface HarnessInvocation {
|
|
|
48
48
|
note?: string;
|
|
49
49
|
}
|
|
50
50
|
/** Invocation modes a harness supports without fallback or prompt-only restrictions. */
|
|
51
|
-
interface HarnessInvocationModes {
|
|
51
|
+
export interface HarnessInvocationModes {
|
|
52
52
|
advisor: boolean;
|
|
53
53
|
advisorStructured: boolean;
|
|
54
54
|
readOnly: boolean;
|
|
@@ -57,7 +57,7 @@ interface HarnessInvocationModes {
|
|
|
57
57
|
agentStructured: boolean;
|
|
58
58
|
}
|
|
59
59
|
/** How to ask one harness CLI for the models currently available to it. */
|
|
60
|
-
interface HarnessModelListing {
|
|
60
|
+
export interface HarnessModelListing {
|
|
61
61
|
/** Arguments used when no search filter is supplied. */
|
|
62
62
|
args: string[];
|
|
63
63
|
/** Optional argument template for a search filter; every "{search}" is replaced. */
|
|
@@ -66,7 +66,7 @@ interface HarnessModelListing {
|
|
|
66
66
|
note?: string;
|
|
67
67
|
}
|
|
68
68
|
/** One model normalized from a harness's native model-listing output. */
|
|
69
|
-
interface AvailableModel {
|
|
69
|
+
export interface AvailableModel {
|
|
70
70
|
provider: string;
|
|
71
71
|
id: string;
|
|
72
72
|
contextWindow: number;
|
|
@@ -75,7 +75,7 @@ interface AvailableModel {
|
|
|
75
75
|
images: boolean;
|
|
76
76
|
}
|
|
77
77
|
/** Options for querying the models available to one harness. */
|
|
78
|
-
interface ListModelsOptions {
|
|
78
|
+
export interface ListModelsOptions {
|
|
79
79
|
search?: string;
|
|
80
80
|
cwd?: string;
|
|
81
81
|
env?: Record<string, string>;
|
|
@@ -84,7 +84,7 @@ interface ListModelsOptions {
|
|
|
84
84
|
/** Cancel with the same process cleanup as a timeout. */
|
|
85
85
|
signal?: AbortSignal;
|
|
86
86
|
}
|
|
87
|
-
interface InvokeOptions {
|
|
87
|
+
export interface InvokeOptions {
|
|
88
88
|
cwd?: string;
|
|
89
89
|
env?: Record<string, string>;
|
|
90
90
|
/** Harness-native model id or selector. */
|
|
@@ -100,7 +100,7 @@ interface InvokeOptions {
|
|
|
100
100
|
/** Use the harness's structured (JSON) output mode instead of plain text. */
|
|
101
101
|
structured?: boolean;
|
|
102
102
|
}
|
|
103
|
-
interface InvokeResult {
|
|
103
|
+
export interface InvokeResult {
|
|
104
104
|
command: string;
|
|
105
105
|
args: string[];
|
|
106
106
|
stdout: string;
|
|
@@ -112,12 +112,12 @@ interface InvokeResult {
|
|
|
112
112
|
aborted: boolean;
|
|
113
113
|
}
|
|
114
114
|
/** Result of one native model-listing command. */
|
|
115
|
-
interface ListModelsResult extends InvokeResult {
|
|
115
|
+
export interface ListModelsResult extends InvokeResult {
|
|
116
116
|
/** Empty on a successful no-match response or when the command itself failed. */
|
|
117
117
|
models: AvailableModel[];
|
|
118
118
|
}
|
|
119
119
|
/** Normalized MCP server entry, shared across every harness dialect. */
|
|
120
|
-
interface McpServerConfig {
|
|
120
|
+
export interface McpServerConfig {
|
|
121
121
|
name: string;
|
|
122
122
|
transport: "stdio" | "http" | "sse";
|
|
123
123
|
command?: string;
|
|
@@ -134,7 +134,7 @@ interface McpServerConfig {
|
|
|
134
134
|
enabled?: boolean;
|
|
135
135
|
}
|
|
136
136
|
/** How one harness config file stores its MCP servers. */
|
|
137
|
-
interface McpConfigFile extends PathCandidate {
|
|
137
|
+
export interface McpConfigFile extends PathCandidate {
|
|
138
138
|
format: "json" | "toml";
|
|
139
139
|
/** Object path to the server map inside the file, e.g. ["mcpServers"]. */
|
|
140
140
|
key: string[];
|
|
@@ -144,18 +144,18 @@ interface McpConfigFile extends PathCandidate {
|
|
|
144
144
|
*/
|
|
145
145
|
dialect: "standard" | "antigravity" | "opencode" | "prime" | "vscode";
|
|
146
146
|
}
|
|
147
|
-
interface HarnessDetection {
|
|
147
|
+
export interface HarnessDetection {
|
|
148
148
|
/** Environment variables that indicate running inside this agent. */
|
|
149
149
|
envVars: string[];
|
|
150
150
|
/** Project-level files or directories whose presence indicates this agent. */
|
|
151
151
|
projectMarkers: string[];
|
|
152
152
|
}
|
|
153
|
-
interface ResolveOptions {
|
|
153
|
+
export interface ResolveOptions {
|
|
154
154
|
homeDir?: string;
|
|
155
155
|
projectRoot?: string;
|
|
156
156
|
platform?: Platform;
|
|
157
157
|
}
|
|
158
|
-
interface ResolvedPaths {
|
|
158
|
+
export interface ResolvedPaths {
|
|
159
159
|
config: PathCandidate[];
|
|
160
160
|
sessions: PathCandidate[];
|
|
161
161
|
instructions: PathCandidate[];
|
|
@@ -169,7 +169,7 @@ type InvocationOptions = Readonly<{
|
|
|
169
169
|
tools?: boolean;
|
|
170
170
|
readOnly?: boolean;
|
|
171
171
|
}>;
|
|
172
|
-
declare abstract class Harness {
|
|
172
|
+
export declare abstract class Harness {
|
|
173
173
|
abstract readonly id: HarnessId;
|
|
174
174
|
abstract readonly name: string;
|
|
175
175
|
abstract readonly binaries: string[];
|
|
@@ -279,9 +279,9 @@ declare abstract class Harness {
|
|
|
279
279
|
resolveCandidates<T extends PathCandidate>(entries: readonly T[], options?: ResolveOptions): T[];
|
|
280
280
|
resolve(options?: ResolveOptions): ResolvedPaths;
|
|
281
281
|
}
|
|
282
|
-
type HarnessConstructor = new () => Harness;
|
|
282
|
+
export type HarnessConstructor = new () => Harness;
|
|
283
283
|
/** One resolved config file together with the servers it declares. */
|
|
284
|
-
interface McpConfigListing {
|
|
284
|
+
export interface McpConfigListing {
|
|
285
285
|
path: string;
|
|
286
286
|
scope: McpConfigFile["scope"];
|
|
287
287
|
format: McpConfigFile["format"];
|
|
@@ -293,7 +293,7 @@ interface McpConfigListing {
|
|
|
293
293
|
error?: string;
|
|
294
294
|
}
|
|
295
295
|
/** Thrown when a server's env cannot be written the way the target dialect requires. */
|
|
296
|
-
declare class McpEnvError extends Error {
|
|
296
|
+
export declare class McpEnvError extends Error {
|
|
297
297
|
readonly name = "McpEnvError";
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
@@ -304,7 +304,7 @@ declare class McpEnvError extends Error {
|
|
|
304
304
|
* @param options - Platform and path-resolution overrides.
|
|
305
305
|
* @returns {McpConfigListing[]} One listing per declared config file.
|
|
306
306
|
*/
|
|
307
|
-
declare function listMcpServers(harness: Harness, options?: ResolveOptions): McpConfigListing[];
|
|
307
|
+
export declare function listMcpServers(harness: Harness, options?: ResolveOptions): McpConfigListing[];
|
|
308
308
|
/**
|
|
309
309
|
* Adds (or replaces) one MCP server in a harness's config. The rest of the
|
|
310
310
|
* file is preserved: JSON through a parse/serialize round trip (formatting
|
|
@@ -316,7 +316,7 @@ declare function listMcpServers(harness: Harness, options?: ResolveOptions): Mcp
|
|
|
316
316
|
* @param options - Platform and path-resolution overrides.
|
|
317
317
|
* @returns {{ path: string, replaced: boolean }} The written path and replacement status.
|
|
318
318
|
*/
|
|
319
|
-
declare function addMcpServer(harness: Harness, server: McpServerConfig, scope?: "user" | "project", options?: ResolveOptions): {
|
|
319
|
+
export declare function addMcpServer(harness: Harness, server: McpServerConfig, scope?: "user" | "project", options?: ResolveOptions): {
|
|
320
320
|
path: string;
|
|
321
321
|
replaced: boolean;
|
|
322
322
|
};
|
|
@@ -329,7 +329,7 @@ declare function addMcpServer(harness: Harness, server: McpServerConfig, scope?:
|
|
|
329
329
|
* @param options - Platform and path-resolution overrides.
|
|
330
330
|
* @returns {{ path: string, removed: boolean }} The targeted path and removal status.
|
|
331
331
|
*/
|
|
332
|
-
declare function removeMcpServer(harness: Harness, name: string, scope?: "user" | "project", options?: ResolveOptions): {
|
|
332
|
+
export declare function removeMcpServer(harness: Harness, name: string, scope?: "user" | "project", options?: ResolveOptions): {
|
|
333
333
|
path: string;
|
|
334
334
|
removed: boolean;
|
|
335
335
|
};
|
|
@@ -340,16 +340,16 @@ declare function removeMcpServer(harness: Harness, name: string, scope?: "user"
|
|
|
340
340
|
* @param text - JSONC source text.
|
|
341
341
|
* @returns {unknown} The parsed JSON value.
|
|
342
342
|
*/
|
|
343
|
-
declare function parseJsonc(text: string): unknown;
|
|
343
|
+
export declare function parseJsonc(text: string): unknown;
|
|
344
344
|
/**
|
|
345
345
|
* Resolves the master sync file path: $XDG_CONFIG_HOME or ~/.config.
|
|
346
346
|
*
|
|
347
347
|
* @param options - Path-resolution overrides.
|
|
348
348
|
* @returns {string} The resolved master MCP config path.
|
|
349
349
|
*/
|
|
350
|
-
declare function masterMcpPath(options?: ResolveOptions): string;
|
|
350
|
+
export declare function masterMcpPath(options?: ResolveOptions): string;
|
|
351
351
|
/** One harness's outcome of a sync run. */
|
|
352
|
-
interface SyncTargetResult {
|
|
352
|
+
export interface SyncTargetResult {
|
|
353
353
|
id: string;
|
|
354
354
|
path?: string;
|
|
355
355
|
/** Reason this harness could not be targeted; `results` is empty then. */
|
|
@@ -364,7 +364,7 @@ interface SyncTargetResult {
|
|
|
364
364
|
}>;
|
|
365
365
|
}
|
|
366
366
|
/** Outcome of resetting the harness configs to the master list. */
|
|
367
|
-
interface SyncReport {
|
|
367
|
+
export interface SyncReport {
|
|
368
368
|
source: string;
|
|
369
369
|
servers: string[];
|
|
370
370
|
targets: SyncTargetResult[];
|
|
@@ -375,7 +375,7 @@ interface SyncReport {
|
|
|
375
375
|
* @param options - Path-resolution overrides.
|
|
376
376
|
* @returns {{ path: string, servers: McpServerConfig[], excludes: string[] }} The master list.
|
|
377
377
|
*/
|
|
378
|
-
declare function readMasterMcpServers(options?: ResolveOptions): {
|
|
378
|
+
export declare function readMasterMcpServers(options?: ResolveOptions): {
|
|
379
379
|
path: string;
|
|
380
380
|
servers: McpServerConfig[];
|
|
381
381
|
/** Harness ids the master list opts out of syncing. */
|
|
@@ -390,9 +390,9 @@ declare function readMasterMcpServers(options?: ResolveOptions): {
|
|
|
390
390
|
* @param options - Platform and path-resolution overrides.
|
|
391
391
|
* @returns {SyncReport} Per-harness synchronization outcomes.
|
|
392
392
|
*/
|
|
393
|
-
declare function syncMcpServers(harnesses: readonly Harness[], options?: ResolveOptions): SyncReport;
|
|
393
|
+
export declare function syncMcpServers(harnesses: readonly Harness[], options?: ResolveOptions): SyncReport;
|
|
394
394
|
/** Configuration read from agents.jsonc. */
|
|
395
|
-
interface AgentsConfig {
|
|
395
|
+
export interface AgentsConfig {
|
|
396
396
|
/** The master instructions file every harness links to. */
|
|
397
397
|
source: string;
|
|
398
398
|
/** Relative files to link beside every harness instructions target. */
|
|
@@ -402,9 +402,9 @@ interface AgentsConfig {
|
|
|
402
402
|
/** Path the config was read from; absent when defaults were used. */
|
|
403
403
|
configPath?: string;
|
|
404
404
|
}
|
|
405
|
-
type AgentsSyncAction = "linked" | "relinked" | "adopted" | "unchanged" | "skipped";
|
|
405
|
+
export type AgentsSyncAction = "linked" | "relinked" | "adopted" | "unchanged" | "skipped";
|
|
406
406
|
/** One companion file's outcome for a harness target. */
|
|
407
|
-
interface AgentsCompanionTargetResult {
|
|
407
|
+
export interface AgentsCompanionTargetResult {
|
|
408
408
|
readonly source: string;
|
|
409
409
|
readonly path: string;
|
|
410
410
|
readonly action: Exclude<AgentsSyncAction, "skipped">;
|
|
@@ -412,7 +412,7 @@ interface AgentsCompanionTargetResult {
|
|
|
412
412
|
readonly detail?: string;
|
|
413
413
|
}
|
|
414
414
|
/** One harness's outcome of an agents sync run. */
|
|
415
|
-
interface AgentsTargetResult {
|
|
415
|
+
export interface AgentsTargetResult {
|
|
416
416
|
id: string;
|
|
417
417
|
path?: string;
|
|
418
418
|
action: AgentsSyncAction;
|
|
@@ -422,7 +422,7 @@ interface AgentsTargetResult {
|
|
|
422
422
|
companions?: readonly AgentsCompanionTargetResult[];
|
|
423
423
|
}
|
|
424
424
|
/** Outcome of one agents sync/doctor run. */
|
|
425
|
-
interface AgentsSyncReport {
|
|
425
|
+
export interface AgentsSyncReport {
|
|
426
426
|
source: string;
|
|
427
427
|
check: boolean;
|
|
428
428
|
targets: AgentsTargetResult[];
|
|
@@ -433,7 +433,7 @@ interface AgentsSyncReport {
|
|
|
433
433
|
* @param options - Path-resolution overrides.
|
|
434
434
|
* @returns {AgentsConfig} The normalized sync configuration.
|
|
435
435
|
*/
|
|
436
|
-
declare function readAgentsConfig(options?: ResolveOptions): AgentsConfig;
|
|
436
|
+
export declare function readAgentsConfig(options?: ResolveOptions): AgentsConfig;
|
|
437
437
|
/**
|
|
438
438
|
* Links every harness's user-scope instructions file to the master. In check
|
|
439
439
|
* mode nothing is written; the report shows what a real run would do.
|
|
@@ -443,6 +443,5 @@ declare function readAgentsConfig(options?: ResolveOptions): AgentsConfig;
|
|
|
443
443
|
* @param options - Path-resolution overrides.
|
|
444
444
|
* @returns {AgentsSyncReport} Per-harness synchronization outcomes.
|
|
445
445
|
*/
|
|
446
|
-
declare function syncAgentsFiles(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): AgentsSyncReport;
|
|
447
|
-
export { AgentsCompanionTargetResult, AgentsConfig, AgentsSyncAction, AgentsSyncReport, AgentsTargetResult, AvailableModel, EvidenceLevel, Harness, HarnessCapabilities, HarnessConstructor, HarnessDetection, HarnessId, HarnessInvocation, HarnessInvocationModes, HarnessModelListing, InvokeOptions, InvokeResult, ListModelsOptions, ListModelsResult, McpConfigFile, McpConfigListing, McpEnvError, McpServerConfig, PathCandidate, Platform, ResolveOptions, ResolvedPaths, StorageDescriptor, SyncReport, SyncTargetResult, addMcpServer, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, removeMcpServer, syncAgentsFiles, syncMcpServers, version };
|
|
446
|
+
export declare function syncAgentsFiles(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): AgentsSyncReport;
|
|
448
447
|
//# sourceMappingURL=agents-sync.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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":"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"}
|