@staix/agent-hosts 0.2.0 → 0.4.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  Install an exact version after it is published.
6
6
 
7
7
  ```sh
8
- bun add --exact @staix/agent-hosts@0.2.0
8
+ bun add --exact @staix/agent-hosts@0.4.0
9
9
  ```
10
10
 
11
11
  ## Supported hosts
@@ -20,10 +20,13 @@ bun add --exact @staix/agent-hosts@0.2.0
20
20
  | `jcode` | user `~/.jcode/mcp.json` | JSON `servers` (alias `mcpServers`) | `0.99.1`, `1.0.3` |
21
21
  | `opencode` | user `~/.config/opencode/opencode.json` | JSON `mcp` | `1.18.35`, `1.19.5` |
22
22
  | `gemini` | user `~/.gemini/settings.json` | JSON `mcpServers` | `0.61.0`, `0.67.0` |
23
+ | `copilot` | user `~/.copilot/mcp-config.json` | JSON `mcpServers` | `1.0.107` |
23
24
  | `agy` | project `.agents/mcp_config.json` | JSON `mcpServers` | `1.5.18` |
24
25
 
25
26
  `HOSTS` records the file scopes, environment overrides, format, entry fields, and verified versions. `HostDefinition.entry` lists the minimum fields read by the host. Extra fields, including `env`, pass through. `CLAUDE_CONFIG_DIR` moves the Claude file into that directory as `.claude.json`. `QWEN_HOME` expands `~` against the injected home. A set but empty `JCODE_HOME` is refused. OpenCode and Gemini honor absolute `XDG_CONFIG_HOME` and `GEMINI_CLI_HOME` respectively, with an empty value treated as unset. Version evidence is available in [PR #5](https://github.com/STAIxBWLB/agent-hosts/pull/5), the [six-host verification receipt](docs/verification/2026-11-28-host-versions.md), and the [Antigravity 1.5.18 receipt](docs/verification/2026-11-27-agy-1.5.18.md).
26
27
 
28
+ Copilot uses an absolute `COPILOT_HOME` and falls back to `~/.copilot` when it is empty or unset. The resolver refuses relative values to avoid routing a write through the current working directory. See the [Copilot 1.0.107 verification receipt](docs/verification/2026-11-29-copilot-1.0.107.md).
29
+
27
30
  Version 0.2.0 adds Antigravity support for the direct workspace file. On the verified version, `agy mcp list` listed the user-scope control and omitted both project files. Pass `scopes: ["project"]` and `workspaceRoot` to resolve the project file.
28
31
 
29
32
  ## API
@@ -50,10 +53,10 @@ if (plan.change === "refused") throw new Error(plan.reason);
50
53
 
51
54
  - `realPath(path)` resolves an existing physical path and throws for a missing path or dangling link. It handles Bun's backslash and symlink-parent edge cases.
52
55
  - `resolveHostPaths({ env, home, workspaceRoot?, hosts?, scopes?, redirectManagedProfiles? })` returns `home`, per-host `paths`, pre-redirect `legacyPaths`, `redirects`, per-host `refusals`, and per-host `roots.current` and `roots.legacy` for locating sibling files such as hooks. Pass the environment and home explicitly. It selects user files by default. Supply `scopes: ["project"]` and `workspaceRoot` for Kimi or Antigravity project files. Select exactly one file per host when calling the entry API. Managed Claude and Codex profiles redirect to the personal source by default. Set `redirectManagedProfiles: false` to keep the configured path. The resolver trims Claude, Codex, Kimi, and Pi overrides and omits files whose location override is invalid. Other hosts remain available.
53
- - `planEntry({ host, paths, name, entry })` returns `add`, `replace`, `remove`, `unchanged`, or `refused` with a stable `code` and a human-readable `reason`. A successful preview contains the decoded `current` entry (or `undefined`), the before and after images, and an intent digest. Supply a plain JSON-compatible entry object or use `entry: null` to remove an entry with an undo receipt. Removing an absent entry is unchanged. Preview writes nothing.
56
+ - `planEntry({ host, paths, name, entry, owner? })` returns `add`, `replace`, `remove`, `unchanged`, or `refused` with a stable `code` and a human-readable `reason`. A successful preview contains the decoded `current` entry (or `undefined`), the before and after images, and an intent digest. Supply a plain JSON-compatible entry object or use `entry: null` to remove an entry with an undo receipt. Removing an absent entry is unchanged. Preview writes nothing. A suite receipt owned by `asuite` returns `suite-managed` for other callers and directs them to run `asuite sync`.
54
57
  - `applyEntry(plan, { receiptDir, env? })` rechecks file state and host policy under an exclusive lock, publishes the change, and records a versioned receipt. Use an absolute receipt directory. Generate a fresh plan if the file changed since preview. A matching entry with no receipt stays unclaimed. OpenCode requires fresh injected `env` on every apply. The plan carries routing-variable names without storing their values.
55
58
  - `undoEntry({ host, paths, name, receiptDir })` restores the prior owned entry or removes the one it installed. A conflicting edit to the entry is left in place and the error names the file. The result identifies the config and receipt paths. If `legacy: true` is returned, the legacy receipt still exists and the consumer manages its cleanup. An unchanged undo carries a code from `UNDO_NOOP_CODES`. If someone deleted an installed entry, undo consumes its package receipt without restoring the prior entry. An explicit removal remains undoable.
56
- - `readEntryReceipt({ host, paths, name, receiptDir })` reads the current or historical receipt without writing. It returns `file`, `receipt`, `intent`, `before`, `after`, and optional `pending` or `legacy`. Entry-only legacy formats yield synthesized MCP images because they store values rather than file snapshots.
59
+ - `readEntryReceipt({ host, paths, name, receiptDir })` reads the current or historical receipt without writing. It returns `file`, `receipt`, `intent`, `before`, `after`, and optional `owner`, `pending`, or `legacy`. Entry-only legacy formats yield synthesized MCP images because they store values rather than file snapshots.
57
60
  - `REFUSAL_CODES` lists stable refusal identifiers used by both path and entry operations. Apply and undo throw `EntryRefusal` with a `code`, a human-readable `reason`, and `file` when a path is known. Refused plans also include `file` when known.
58
61
  - `UNDO_NOOP_CODES` lists `no-receipt`, `entry-already-absent`, and `entry-already-restored` for unchanged undo results.
59
62
 
@@ -61,7 +64,9 @@ OpenCode preview and apply refuse nonblank `OPENCODE_CONFIG`, `OPENCODE_CONFIG_D
61
64
 
62
65
  Writes use bounded reads, refuse linked paths, and publish through a temporary file while preserving the config's mode. Configuration is capped at 8 MiB. The `<config>.agent-hosts.lock` file serializes package writers. Take any consumer-specific lock around package calls. If a stale lock blocks an operation, confirm that its writer has stopped before removing the named lock.
63
66
 
64
- Package receipts use `entry-<digest([file, name])>.json` and carry version 1. A pending replacement can temporarily store its previous receipt at `<receipt>.previous-<digest>`. Consumers scanning the receipt directory should ignore these recovery files. Apply and undo return the receipt intent when one is known. Retry the same plan after interrupted publication. Undo can cancel a pending apply while the config still matches its start image. After publication, finish the apply before undoing.
67
+ The resolver sets `suiteReceipts` from the first nonblank value in `AGENT_SUITE_HOME/receipts`, `AGENTHUB_HOME/suite/receipts`, and `~/.agenthub/suite/receipts`, trimming the environment values before joining the paths. The suite home is resolved to its physical path before appending `receipts`. The receipt directory and file still refuse links. A relative override refuses entry previews. Apply repeats the suite ownership check under the config lock. A malformed or unsafe suite receipt yields `invalid-receipt`.
68
+
69
+ Package receipts use `entry-<digest([file, name])>.json` and carry version 1. New receipts include the plan's `owner` when supplied. Existing receipts without an owner remain valid and belong to the tool holding them. The owner does not enter the intent digest. A pending replacement can temporarily store its previous receipt at `<receipt>.previous-<digest>`. Consumers scanning the receipt directory should ignore these recovery files. Apply and undo return the receipt intent when one is known. Retry the same plan after interrupted publication. Undo can cancel a pending apply while the config still matches its start image. After publication, finish the apply before undoing.
65
70
 
66
71
  ### Use the codecs directly
67
72
 
@@ -83,11 +88,34 @@ The JSON codec accepts strict JSON and keeps unrelated bytes. The TOML codecs us
83
88
  | `HostId`, `HostScope` | Keys of `HOSTS` and the `user` or `project` scope. Pass a hub-owned path through the host's environment override. |
84
89
  | `HostDefinition`, `HostConfig`, `HostFormat`, `HomeOverride` | Host metadata, per-file scope and path, JSON key or TOML table, and environment override rules. |
85
90
  | `ResolveHostPathsOptions`, `HostPaths`, `HostRedirect`, `HostRefusal` | Resolver inputs, its path maps, managed-profile redirects, and path refusals. |
86
- | `EntryTarget`, `PlanEntryOptions`, `ApplyEntryOptions` | Host, resolved paths, and name. Planning adds the desired `entry`. Apply takes a receipt directory and optional refreshed environment. |
91
+ | `EntryTarget`, `PlanEntryOptions`, `ApplyEntryOptions` | Host, resolved paths, and name. Planning adds the desired `entry` and optional `owner`. Apply takes a receipt directory and optional refreshed environment. |
87
92
  | `EntryPlan`, `EntryResult`, `EntryReceipt` | Preview result, apply or undo result, and read-only receipt projection. |
88
93
  | `RefusalCode`, `UndoNoopCode` | Machine-readable identifiers from `REFUSAL_CODES` and `UNDO_NOOP_CODES`. |
89
94
  | `ConfigImage`, `JsonMcpCodecOptions` | Base64 `bytes` or `null` for an absent file, plus numeric `mode`, and the JSON codec's key and entry options. |
90
95
 
96
+ ## Skill roots and links
97
+
98
+ `SKILL_HOSTS` lists verified user installation roots for Claude, Codex, Pi, Qwen, OpenCode, and Gemini. Each definition lists its verified host versions. `resolveSkillRoots({ home, env, hosts?, scopes?, workspaceRoot?, redirectManagedProfiles? })` returns roots, redirects and refusals. Use the injected home and environment. The resolver applies the same override validation and optional managed-profile redirects as MCP. For OpenCode, it selects `OPENCODE_CONFIG_DIR/skills` ahead of `XDG_CONFIG_HOME/opencode/skills`. Project scope has no supported skill roots in this release. See the [versioned skill root verification](docs/verification/2026-11-29-skill-roots.md).
99
+
100
+ ```ts
101
+ import { applySkillEntry, planSkillEntry, resolveSkillRoots, undoSkillEntry } from "@staix/agent-hosts";
102
+
103
+ const { roots } = resolveSkillRoots({ home, env, hosts: ["codex"] });
104
+ const root = roots.codex?.[0];
105
+ if (!root) throw new Error("No Codex skill root resolved");
106
+
107
+ const target = { host: "codex" as const, root, name: "example", receiptDir };
108
+ const preview = planSkillEntry({ ...target, sourcePath });
109
+ if (preview.change === "refused") throw new Error(preview.reason);
110
+ applySkillEntry(preview);
111
+ // Later, with the same target and receipt directory:
112
+ undoSkillEntry(target);
113
+ ```
114
+
115
+ Pass absolute physical paths for `root`, `receiptDir` and `sourcePath`. The source is an existing directory whose contents the caller manages. Preview writes nothing. Apply installs a relative symlink and records versioned ownership in the receipt directory. `classifySkillTarget({ targetPath, host?, receiptDir? })` recognizes an owned link when its recorded identity matches. Existing foreign links, unmanaged files or directories, sibling-tool ownership markers and the reserved `.system` name are refused.
116
+
117
+ Use the same `receiptDir` for each operation on a host and skill name. A changed profile root requires `retarget: true` in a new preview. Apply then publishes at the new root and removes the unchanged old link. Undo removes only the unchanged recorded link. If the link has already been deleted, undo retires the receipt and reports `entry-already-absent`. To resume an interrupted apply, preview and apply the same root and source again.
118
+
91
119
  ## Consumer migration
92
120
 
93
121
  For each migration, use one PR per consumer and pin `@staix/agent-hosts` to the exact release. Keep the existing entry name and pass the consumer's existing setup directory as `receiptDir` so undo can find earlier receipts. Replay the [copy fixtures](fixtures/copies/) and [legacy receipts](fixtures/receipts/), and list behavior changes in the consumer PR. [Fixture divergences](fixtures/DIVERGENCES.md)
@@ -122,3 +150,7 @@ bun scripts/check-pack.ts
122
150
  CI runs tests with a temporary home. Tests inject fixture host paths and run offline. The npm tarball allowlist covers `src`, `fixtures`, `README.md`, `LICENSE`, and npm's required `package.json`.
123
151
 
124
152
  The npm package owner registers `STAIxBWLB/agent-hosts` with workflow filename `release.yml` and enables direct publishing. Each tag requires the person's consent. The workflow publishes via npm OIDC after checking that the tag matches the manifest version and its commit belongs to `main`. [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/)
153
+
154
+ ## Cross-language fixture contract
155
+
156
+ Vendor `fixtures/` at an exact release tag and verify the inventory and each SHA-256 against `fixtures/MANIFEST.sha256`. The fixture families cover host edits, refusal behavior, receipt compatibility, and receipt names. See the [fixture contract](fixtures/README.md).
@@ -0,0 +1,16 @@
1
+ 5b4a835e205b510bcc5204679ac5ace48d8626e6aaa8063e92217ca4609f7335 DIVERGENCES.md
2
+ 7f8391aa32429813b6d1f6e304aacf0de5f2131859ce6b48a75a530a930d3745 README.md
3
+ e79a02446aea6b89d54e30946374f8818f2b69d818a254c431e6b2967ae4b0a2 copies/agent-mem.json
4
+ 94abb085f0d438fdf936c93a203db7558bdd671349a53ef241695adcec90b2bf copies/agent-research.json
5
+ 1dd918ad5fee48f29367ffd42ef3eeef99d7a2149f453e87bbb764dc4fa492b9 copies/vault-mem.json
6
+ 7d934f31aed6fc5a40809b394cf1672ff60cc69187e521a9c6a2a3bfe693425a receipts/agent-mem/agy-v1.json
7
+ 553286e724a794cd54887e2e782e588c4e931d3934396cb9de4ccd6025f2a4d0 receipts/agent-mem/v1.json
8
+ 25bfd80b252dedb40fe4797a2402975ba32547bbaa434393d116d9fee6f9119e receipts/agent-mem/v2.json
9
+ 1c4b8f47cd22f7882dd97646d1e865088189197fad3861f65c87d4678795f6f9 receipts/agent-research/agy-v1.json
10
+ 2739899d872b591ae0189f6f4c1c4720a622f30d19d89342fdaf000f55c9e5a8 receipts/agent-research/v1.json
11
+ 7aed60699ddbe0e905c40a5c0a084f7fbd295a483cb56efcfaeb98d7f985bff9 receipts/package/owner-absent.json
12
+ c9eb12528a9da84a72c584812c7a729b65e2538e1d6823866a8e3fb06fd1cc59 receipts/package/owner-present.json
13
+ 9219de85785b7c9f4b9be0a4194156e866f42caac0da7464cb5e37dfd3d88e04 receipts/vault-mem/agy-v1.json
14
+ 6bff19067d9381cb15b44beb8616be3eb940939bc6a523b38d2f7392dca5c29d receipts/vault-mem/v1.json
15
+ 1c26dd18d1490b09a2614f23e1948a922030ca3bac87b90f8cd50c7c188be299 v1/copilot.json
16
+ 5f442671a0c022ed76d70400271e74f759f0e853d9636d69359b18a9f992f609 v1/suite-managed.json
@@ -0,0 +1,10 @@
1
+ # Host contract fixtures
2
+
3
+ Vendor these files from an exact agent-hosts release tag. From inside the vendored fixture directory, verify all files with `sha256sum -c MANIFEST.sha256`. Also compare the inventory to the manifest so extra files fail validation. The manifest covers every file under this directory except itself. Preserve raw bytes on checkout and during vendoring.
4
+
5
+ - `v1/` contains versioned host behavior cases and fixed vectors for the receipt basename. Cases use the capture shape from `copies/`. Expand `$FIXTURE` in paths to the absolute temporary home. `owner` identifies the caller, `suiteReceipt` references a package receipt to seed in the resolved suite receipt directory, `links` maps config paths to file symlink targets, and `directoryLinks` maps directory symlinks to their targets before resolving host paths. `suiteReceipts`, when present, is the expected resolved directory. Receipt `file` placeholders are expanded while seeding. Config text and modes are fixture expectations.
6
+ - `copies/` captures configuration behavior from existing TypeScript consumers.
7
+ - `receipts/` holds historical consumer receipts and package v1 receipts.
8
+ - `DIVERGENCES.md` records differences between consumer copies and the package.
9
+
10
+ After adding, removing, or changing a fixture, regenerate the manifest with `bun scripts/fixture-manifest.ts`. Fixture changes ship in a minor release during 0.x.
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 1,
3
+ "host": "copilot",
4
+ "file": "$FIXTURE/.copilot/mcp-config.json",
5
+ "name": "managed",
6
+ "intent": "0b94d73653701e2cb41bcecfc36ed121f345dc10510128fa8252ec811b9dc884",
7
+ "before": {
8
+ "bytes": "eyJtY3BTZXJ2ZXJzIjp7Im90aGVyIjp7ImNvbW1hbmQiOiJrZWVwIn19LCJrZWVwIjp0cnVlfQo=",
9
+ "mode": 384
10
+ },
11
+ "after": {
12
+ "bytes": "eyJtY3BTZXJ2ZXJzIjp7Im90aGVyIjp7ImNvbW1hbmQiOiJrZWVwIn0sIm1hbmFnZWQiOnsiY29tbWFuZCI6InByZXZpb3VzIiwiYXJncyI6WyJtY3Atc2hpbSIsImV4YW1wbGUiXSwidHlwZSI6ImxvY2FsIiwidG9vbHMiOlsiKiJdfX0sImtlZXAiOnRydWV9Cg==",
13
+ "mode": 384
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 1,
3
+ "host": "copilot",
4
+ "file": "$FIXTURE/.copilot/mcp-config.json",
5
+ "name": "managed",
6
+ "intent": "0b94d73653701e2cb41bcecfc36ed121f345dc10510128fa8252ec811b9dc884",
7
+ "before": {
8
+ "bytes": "eyJtY3BTZXJ2ZXJzIjp7Im90aGVyIjp7ImNvbW1hbmQiOiJrZWVwIn19LCJrZWVwIjp0cnVlfQo=",
9
+ "mode": 384
10
+ },
11
+ "after": {
12
+ "bytes": "eyJtY3BTZXJ2ZXJzIjp7Im90aGVyIjp7ImNvbW1hbmQiOiJrZWVwIn0sIm1hbmFnZWQiOnsiY29tbWFuZCI6InByZXZpb3VzIiwiYXJncyI6WyJtY3Atc2hpbSIsImV4YW1wbGUiXSwidHlwZSI6ImxvY2FsIiwidG9vbHMiOlsiKiJdfX0sImtlZXAiOnRydWV9Cg==",
13
+ "mode": 384
14
+ },
15
+ "owner": "asuite"
16
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "cases": [
3
+ {
4
+ "id": "add",
5
+ "host": "copilot",
6
+ "name": "managed",
7
+ "key": "mcpServers",
8
+ "file": "$FIXTURE/.copilot/mcp-config.json",
9
+ "env": {},
10
+ "entry": {
11
+ "command": "asuite",
12
+ "args": [
13
+ "mcp-shim",
14
+ "example"
15
+ ],
16
+ "type": "local",
17
+ "tools": [
18
+ "*"
19
+ ]
20
+ },
21
+ "plan": {
22
+ "change": "add",
23
+ "files": [
24
+ "$FIXTURE/.copilot/mcp-config.json"
25
+ ]
26
+ },
27
+ "before": {
28
+ "$FIXTURE/.copilot/mcp-config.json": {
29
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"}},\"keep\":true}\n",
30
+ "mode": 384
31
+ }
32
+ },
33
+ "afterApply": {
34
+ "$FIXTURE/.copilot/mcp-config.json": {
35
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
36
+ "mode": 384
37
+ }
38
+ },
39
+ "afterUndo": {
40
+ "$FIXTURE/.copilot/mcp-config.json": {
41
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"}},\"keep\":true}\n",
42
+ "mode": 384
43
+ }
44
+ }
45
+ },
46
+ {
47
+ "id": "replace",
48
+ "host": "copilot",
49
+ "name": "managed",
50
+ "key": "mcpServers",
51
+ "file": "$FIXTURE/.copilot/mcp-config.json",
52
+ "env": {},
53
+ "entry": {
54
+ "command": "asuite",
55
+ "args": [
56
+ "mcp-shim",
57
+ "example"
58
+ ],
59
+ "type": "local",
60
+ "tools": [
61
+ "*"
62
+ ]
63
+ },
64
+ "plan": {
65
+ "change": "replace",
66
+ "files": [
67
+ "$FIXTURE/.copilot/mcp-config.json"
68
+ ]
69
+ },
70
+ "before": {
71
+ "$FIXTURE/.copilot/mcp-config.json": {
72
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
73
+ "mode": 384
74
+ }
75
+ },
76
+ "afterApply": {
77
+ "$FIXTURE/.copilot/mcp-config.json": {
78
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
79
+ "mode": 384
80
+ }
81
+ },
82
+ "afterUndo": {
83
+ "$FIXTURE/.copilot/mcp-config.json": {
84
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
85
+ "mode": 384
86
+ }
87
+ }
88
+ },
89
+ {
90
+ "id": "unchanged",
91
+ "host": "copilot",
92
+ "name": "managed",
93
+ "key": "mcpServers",
94
+ "file": "$FIXTURE/.copilot/mcp-config.json",
95
+ "env": {},
96
+ "entry": {
97
+ "command": "asuite",
98
+ "args": [
99
+ "mcp-shim",
100
+ "example"
101
+ ],
102
+ "type": "local",
103
+ "tools": [
104
+ "*"
105
+ ]
106
+ },
107
+ "plan": {
108
+ "change": "unchanged",
109
+ "files": [
110
+ "$FIXTURE/.copilot/mcp-config.json"
111
+ ]
112
+ },
113
+ "before": {
114
+ "$FIXTURE/.copilot/mcp-config.json": {
115
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
116
+ "mode": 384
117
+ }
118
+ },
119
+ "afterApply": {
120
+ "$FIXTURE/.copilot/mcp-config.json": {
121
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
122
+ "mode": 384
123
+ }
124
+ },
125
+ "afterUndo": {
126
+ "$FIXTURE/.copilot/mcp-config.json": {
127
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
128
+ "mode": 384
129
+ }
130
+ }
131
+ },
132
+ {
133
+ "id": "symlinked-config",
134
+ "host": "copilot",
135
+ "name": "managed",
136
+ "key": "mcpServers",
137
+ "file": "$FIXTURE/.copilot/mcp-config.json",
138
+ "env": {},
139
+ "entry": {
140
+ "command": "asuite",
141
+ "args": [
142
+ "mcp-shim",
143
+ "example"
144
+ ],
145
+ "type": "local",
146
+ "tools": [
147
+ "*"
148
+ ]
149
+ },
150
+ "plan": {
151
+ "change": "refused",
152
+ "files": [
153
+ "$FIXTURE/.copilot/mcp-config.json"
154
+ ],
155
+ "code": "unsafe-path"
156
+ },
157
+ "before": {
158
+ "$FIXTURE/.copilot/mcp-config.json": {
159
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
160
+ "mode": 384
161
+ }
162
+ },
163
+ "links": {
164
+ "$FIXTURE/.copilot/mcp-config.json": "$FIXTURE/linked.json"
165
+ }
166
+ }
167
+ ]
168
+ }
@@ -0,0 +1,295 @@
1
+ {
2
+ "receiptNames": [
3
+ {
4
+ "file": "/home/fixture/.copilot/mcp-config.json",
5
+ "name": "managed",
6
+ "basename": "entry-f397138c2fc609b00e9b0b400df9488c63928714ff2c098804eb2da1d4bbafaf.json"
7
+ },
8
+ {
9
+ "file": "/home/fixture/한글/config.json",
10
+ "name": "quote\"and\\slash",
11
+ "basename": "entry-e8cfc859f3ae4e9015a953958405745f639a9b3fb263e141e69158ab080ffd26.json"
12
+ }
13
+ ],
14
+ "cases": [
15
+ {
16
+ "id": "other-owner-refused",
17
+ "host": "copilot",
18
+ "name": "managed",
19
+ "key": "mcpServers",
20
+ "file": "$FIXTURE/.copilot/mcp-config.json",
21
+ "env": {},
22
+ "entry": {
23
+ "command": "asuite",
24
+ "args": [
25
+ "mcp-shim",
26
+ "example"
27
+ ],
28
+ "type": "local",
29
+ "tools": [
30
+ "*"
31
+ ]
32
+ },
33
+ "plan": {
34
+ "change": "refused",
35
+ "files": [
36
+ "$FIXTURE/.copilot/mcp-config.json"
37
+ ],
38
+ "code": "suite-managed"
39
+ },
40
+ "before": {
41
+ "$FIXTURE/.copilot/mcp-config.json": {
42
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
43
+ "mode": 384
44
+ }
45
+ },
46
+ "owner": "ares",
47
+ "suiteReceipt": "receipts/package/owner-present.json"
48
+ },
49
+ {
50
+ "id": "missing-owner-refused",
51
+ "host": "copilot",
52
+ "name": "managed",
53
+ "key": "mcpServers",
54
+ "file": "$FIXTURE/.copilot/mcp-config.json",
55
+ "env": {},
56
+ "entry": {
57
+ "command": "asuite",
58
+ "args": [
59
+ "mcp-shim",
60
+ "example"
61
+ ],
62
+ "type": "local",
63
+ "tools": [
64
+ "*"
65
+ ]
66
+ },
67
+ "plan": {
68
+ "change": "refused",
69
+ "files": [
70
+ "$FIXTURE/.copilot/mcp-config.json"
71
+ ],
72
+ "code": "suite-managed"
73
+ },
74
+ "before": {
75
+ "$FIXTURE/.copilot/mcp-config.json": {
76
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
77
+ "mode": 384
78
+ }
79
+ },
80
+ "suiteReceipt": "receipts/package/owner-present.json"
81
+ },
82
+ {
83
+ "id": "suite-owner-can-replace",
84
+ "host": "copilot",
85
+ "name": "managed",
86
+ "key": "mcpServers",
87
+ "file": "$FIXTURE/.copilot/mcp-config.json",
88
+ "env": {},
89
+ "entry": {
90
+ "command": "asuite",
91
+ "args": [
92
+ "mcp-shim",
93
+ "example"
94
+ ],
95
+ "type": "local",
96
+ "tools": [
97
+ "*"
98
+ ]
99
+ },
100
+ "plan": {
101
+ "change": "replace",
102
+ "files": [
103
+ "$FIXTURE/.copilot/mcp-config.json"
104
+ ]
105
+ },
106
+ "before": {
107
+ "$FIXTURE/.copilot/mcp-config.json": {
108
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
109
+ "mode": 384
110
+ }
111
+ },
112
+ "owner": "asuite",
113
+ "suiteReceipt": "receipts/package/owner-present.json",
114
+ "afterApply": {
115
+ "$FIXTURE/.copilot/mcp-config.json": {
116
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
117
+ "mode": 384
118
+ }
119
+ },
120
+ "afterUndo": {
121
+ "$FIXTURE/.copilot/mcp-config.json": {
122
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"}},\"keep\":true}\n",
123
+ "mode": 384
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "id": "no-suite-receipt",
129
+ "host": "copilot",
130
+ "name": "managed",
131
+ "key": "mcpServers",
132
+ "file": "$FIXTURE/.copilot/mcp-config.json",
133
+ "env": {},
134
+ "entry": {
135
+ "command": "asuite",
136
+ "args": [
137
+ "mcp-shim",
138
+ "example"
139
+ ],
140
+ "type": "local",
141
+ "tools": [
142
+ "*"
143
+ ]
144
+ },
145
+ "plan": {
146
+ "change": "replace",
147
+ "files": [
148
+ "$FIXTURE/.copilot/mcp-config.json"
149
+ ]
150
+ },
151
+ "before": {
152
+ "$FIXTURE/.copilot/mcp-config.json": {
153
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
154
+ "mode": 384
155
+ }
156
+ },
157
+ "owner": "ares",
158
+ "afterApply": {
159
+ "$FIXTURE/.copilot/mcp-config.json": {
160
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
161
+ "mode": 384
162
+ }
163
+ },
164
+ "afterUndo": {
165
+ "$FIXTURE/.copilot/mcp-config.json": {
166
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
167
+ "mode": 384
168
+ }
169
+ }
170
+ },
171
+ {
172
+ "id": "linked-default-hub-without-suite-receipt",
173
+ "host": "copilot",
174
+ "name": "managed",
175
+ "key": "mcpServers",
176
+ "file": "$FIXTURE/.copilot/mcp-config.json",
177
+ "env": {},
178
+ "entry": {
179
+ "command": "asuite",
180
+ "args": [
181
+ "mcp-shim",
182
+ "example"
183
+ ],
184
+ "type": "local",
185
+ "tools": [
186
+ "*"
187
+ ]
188
+ },
189
+ "plan": {
190
+ "change": "replace",
191
+ "files": [
192
+ "$FIXTURE/.copilot/mcp-config.json"
193
+ ]
194
+ },
195
+ "before": {
196
+ "$FIXTURE/.copilot/mcp-config.json": {
197
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
198
+ "mode": 384
199
+ }
200
+ },
201
+ "owner": "ares",
202
+ "afterApply": {
203
+ "$FIXTURE/.copilot/mcp-config.json": {
204
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"asuite\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
205
+ "mode": 384
206
+ }
207
+ },
208
+ "afterUndo": {
209
+ "$FIXTURE/.copilot/mcp-config.json": {
210
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
211
+ "mode": 384
212
+ }
213
+ },
214
+ "directoryLinks": {
215
+ "$FIXTURE/.agenthub": "$FIXTURE/physical-hub"
216
+ },
217
+ "suiteReceipts": "$FIXTURE/physical-hub/suite/receipts"
218
+ },
219
+ {
220
+ "id": "linked-hub-override-with-asuite-receipt",
221
+ "host": "copilot",
222
+ "name": "managed",
223
+ "key": "mcpServers",
224
+ "file": "$FIXTURE/.copilot/mcp-config.json",
225
+ "env": {
226
+ "AGENTHUB_HOME": "$FIXTURE/hub-link"
227
+ },
228
+ "entry": {
229
+ "command": "asuite",
230
+ "args": [
231
+ "mcp-shim",
232
+ "example"
233
+ ],
234
+ "type": "local",
235
+ "tools": [
236
+ "*"
237
+ ]
238
+ },
239
+ "plan": {
240
+ "change": "refused",
241
+ "files": [
242
+ "$FIXTURE/.copilot/mcp-config.json"
243
+ ],
244
+ "code": "suite-managed"
245
+ },
246
+ "before": {
247
+ "$FIXTURE/.copilot/mcp-config.json": {
248
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
249
+ "mode": 384
250
+ }
251
+ },
252
+ "suiteReceipt": "receipts/package/owner-present.json",
253
+ "directoryLinks": {
254
+ "$FIXTURE/hub-link": "$FIXTURE/physical-hub"
255
+ },
256
+ "suiteReceipts": "$FIXTURE/physical-hub/suite/receipts"
257
+ },
258
+ {
259
+ "id": "linked-suite-receipts-refused",
260
+ "host": "copilot",
261
+ "name": "managed",
262
+ "key": "mcpServers",
263
+ "file": "$FIXTURE/.copilot/mcp-config.json",
264
+ "env": {},
265
+ "entry": {
266
+ "command": "asuite",
267
+ "args": [
268
+ "mcp-shim",
269
+ "example"
270
+ ],
271
+ "type": "local",
272
+ "tools": [
273
+ "*"
274
+ ]
275
+ },
276
+ "plan": {
277
+ "change": "refused",
278
+ "files": [
279
+ "$FIXTURE/.copilot/mcp-config.json"
280
+ ],
281
+ "code": "invalid-receipt"
282
+ },
283
+ "before": {
284
+ "$FIXTURE/.copilot/mcp-config.json": {
285
+ "text": "{\"mcpServers\":{\"other\":{\"command\":\"keep\"},\"managed\":{\"command\":\"previous\",\"args\":[\"mcp-shim\",\"example\"],\"type\":\"local\",\"tools\":[\"*\"]}},\"keep\":true}\n",
286
+ "mode": 384
287
+ }
288
+ },
289
+ "directoryLinks": {
290
+ "$FIXTURE/.agenthub/suite/receipts": "$FIXTURE/physical-receipts"
291
+ },
292
+ "suiteReceipts": "$FIXTURE/.agenthub/suite/receipts"
293
+ }
294
+ ]
295
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staix/agent-hosts",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Host configuration and MCP server entry management for Bun",
5
5
  "type": "module",
6
6
  "repository": {