regent-code 3.0.3 → 3.0.4
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/.github/workflows/ci.yml +3 -0
- package/.opencode/INSTALL.md +3 -3
- package/AGENTS.md +6 -0
- package/README.md +9 -34
- package/mcp/cli.js +1 -0
- package/mcp/install.js +5 -20
- package/package.json +4 -3
- package/regent-code-3.0.4.tgz +0 -0
- package/regent-code-3.0.3.tgz +0 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -36,3 +36,6 @@ jobs:
|
|
|
36
36
|
- name: Test
|
|
37
37
|
working-directory: .opencode
|
|
38
38
|
run: node --test tests/regent.test.js tests/regent.v2.test.js tests/regent.live-test.js tests/regent.hybrid.v2.6.1.test.js tests/regent.runtime.v2.6.1.test.js
|
|
39
|
+
|
|
40
|
+
- name: Test MCP suites (bin contract + installer + server)
|
|
41
|
+
run: node --test mcp/tests/bin.test.js mcp/tests/install.test.js mcp/tests/mcp.test.js
|
package/.opencode/INSTALL.md
CHANGED
|
@@ -6,7 +6,7 @@ If the package is published to npm, both the plugin and the MCP server install
|
|
|
6
6
|
with a single command against any existing `opencode.json` / `opencode.jsonc`:
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
npx -y regent-code@3.0.
|
|
9
|
+
npx -y regent-code@3.0.4 install
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Patches the project config (or the global `~/.config/opencode/` config) to add
|
|
@@ -19,7 +19,7 @@ Patches the project config (or the global `~/.config/opencode/` config) to add
|
|
|
19
19
|
```jsonc
|
|
20
20
|
{
|
|
21
21
|
"$schema": "https://opencode.ai/config.json",
|
|
22
|
-
"plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.
|
|
22
|
+
"plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.4"],
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -32,7 +32,7 @@ Patches the project config (or the global `~/.config/opencode/` config) to add
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
The pinned version is recommended. Use the unpinned branch only when you intentionally want the latest changes. The `v3.0.
|
|
35
|
+
The pinned version is recommended. Use the unpinned branch only when you intentionally want the latest changes. The `v3.0.4` git tag must be pushed to GitHub before the pinned spec resolves.
|
|
36
36
|
|
|
37
37
|
## Single-source rule (duplicate plugin ID)
|
|
38
38
|
|
package/AGENTS.md
CHANGED
|
@@ -28,6 +28,12 @@ All 108 tests across the five suites must pass before committing.
|
|
|
28
28
|
- Error paths produce structured JSON, never throw
|
|
29
29
|
- `context.directory` → `process.cwd()` fallback
|
|
30
30
|
|
|
31
|
+
## Bin targets
|
|
32
|
+
|
|
33
|
+
- Every `package.json` `bin` file MUST start with `#!/usr/bin/env node`. Without it, npm generates a passthrough `.cmd` shim on Windows that ShellExecutes the file through its extension association (opens an editor) instead of running it under node. Enforced by `mcp/tests/bin.test.js`.
|
|
34
|
+
- The MCP launch contract is the single command `npx -y regent-code` - no absolute paths, no global installs, no hand-written `.cmd`/`.ps1` shims. Enforced by the same test.
|
|
35
|
+
- `npm run prepublishOnly` (wired to `npm run verify`) gates every `npm publish`; CI runs the MCP suites too.
|
|
36
|
+
|
|
31
37
|
## Verdict gates
|
|
32
38
|
|
|
33
39
|
Before committing:
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Add Regent to your OpenCode configuration:
|
|
|
51
51
|
```jsonc
|
|
52
52
|
{
|
|
53
53
|
"$schema": "https://opencode.ai/config.json",
|
|
54
|
-
"plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.
|
|
54
|
+
"plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.4"],
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -69,7 +69,7 @@ are read from the persisted transcript when the service stores turns, otherwise
|
|
|
69
69
|
from the synchronous `session.generate` text; agent catalogs are queried with
|
|
70
70
|
and without an explicit location scope; and the caller-authorization guardrail
|
|
71
71
|
degrades OPEN when the runtime agent API is unresolvable (only recursion from
|
|
72
|
-
known worker sessions stays hard-blocked). The `v3.0.
|
|
72
|
+
known worker sessions stays hard-blocked). The `v3.0.4` git tag must be pushed
|
|
73
73
|
to GitHub before this pinned spec resolves.
|
|
74
74
|
|
|
75
75
|
> **Windows dev-machine warning (single-source rule):** when this repository is open as an OpenCode project, its own `.opencode/plugins/regent.js` is auto-loaded as a project plugin. Do NOT also pin regent in `opencode.jsonc` on the same machine — two active sources make host plugin reloads fail with `Duplicate plugin ID: regent`, leaving sessions with a torn tool surface and blocking live skill/plugin edits. Either develop unpinned (project plugin only) or pin the repo file directly: `"plugins": ["file:///Q:/PROJECTS/PERSONAL/regent-code/.opencode/plugins/regent.js"]`. One source of truth, always.
|
|
@@ -79,25 +79,23 @@ to GitHub before this pinned spec resolves.
|
|
|
79
79
|
The fastest way to get **both** the plugin and the MCP server on any machine — no cloning, no manual config edits, no local files:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
npx -y regent-code@3.0.
|
|
82
|
+
npx -y regent-code@3.0.4 install
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
The installer finds an existing `opencode.json` / `opencode.jsonc` (project config in the current directory first, then the global `~/.config/opencode/` config) and adds both entries:
|
|
86
86
|
|
|
87
|
-
- **MCP server**: `mcp.servers.regent` → runs `
|
|
88
|
-
- **Plugin**: `plugins` → `regent-code@3.0.
|
|
87
|
+
- **MCP server**: `mcp.servers.regent` → runs `["npx", "-y", "regent-code"]`. That single command spawns the server through the package's `bin` — no absolute paths, no global install, no per-machine shims.
|
|
88
|
+
- **Plugin**: `plugins` → `regent-code@3.0.4`
|
|
89
89
|
|
|
90
90
|
It is **idempotent and non-destructive** — it only adds or updates regent entries, preserving comments, trailing commas, and every unrelated setting in the file. Re-run it to upgrade the pinned version. Flags: `--global` forces the user config, `--file <path>` targets an exact file, `--help` explains all options. Restart the OpenCode session afterwards — plugin load and MCP connection happen on config load.
|
|
91
91
|
|
|
92
|
-
> When the installer is invoked from npm's ephemeral npx cache, it prints a warning: the absolute path it wrote can be pruned by npm. Run `npm install -g regent-code@3.0.3` once and re-run the installer so the entry points at the persistent global install.
|
|
93
|
-
|
|
94
92
|
> On the machine that develops regent-code itself, respect the single-source rule above: do not add a second pin when the repo is open as a project.
|
|
95
93
|
|
|
96
94
|
## MCP Server
|
|
97
95
|
|
|
98
96
|
Since v3.0.0, regent-code ships a second distribution alongside the plugin: a Model Context Protocol (MCP) server that exposes the same six tools (`delegate`, `delegate_many`, `research`, `explore`, `changed-files`, `verify`) plus the Regent command and skill corpus as MCP prompts. It is out-of-process and works from any MCP client (Claude Desktop, Cursor, or OpenCode).
|
|
99
97
|
|
|
100
|
-
Configure it in OpenCode by adding a local MCP server:
|
|
98
|
+
Configure it in OpenCode by adding a local MCP server — the exact entry the installer writes:
|
|
101
99
|
|
|
102
100
|
```jsonc
|
|
103
101
|
{
|
|
@@ -106,7 +104,7 @@ Configure it in OpenCode by adding a local MCP server:
|
|
|
106
104
|
"servers": {
|
|
107
105
|
"regent": {
|
|
108
106
|
"type": "local",
|
|
109
|
-
"command": ["
|
|
107
|
+
"command": ["npx", "-y", "regent-code"],
|
|
110
108
|
"cwd": "."
|
|
111
109
|
}
|
|
112
110
|
}
|
|
@@ -114,32 +112,9 @@ Configure it in OpenCode by adding a local MCP server:
|
|
|
114
112
|
}
|
|
115
113
|
```
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
**Other machines / people — no local clone needed.** The package is published to npm. Recommended: install globally once, then let the installer write the entry (see "One-command install" above):
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
npm install -g regent-code@3.0.3
|
|
123
|
-
npx -y regent-code@3.0.3 install --global
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Or add the server to `opencode.jsonc` manually with a direct node launch:
|
|
127
|
-
|
|
128
|
-
```jsonc
|
|
129
|
-
{
|
|
130
|
-
"$schema": "https://opencode.ai/config.json",
|
|
131
|
-
"mcp": {
|
|
132
|
-
"servers": {
|
|
133
|
-
"regent": {
|
|
134
|
-
"type": "local",
|
|
135
|
-
"command": ["node", "<NPM_GLOBAL>/regent-code/mcp/cli.js"]
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
115
|
+
`npx -y regent-code` is the single, canonical launch command — it runs on any machine with Node/npm installed, from the npm registry or the npx cache. No cloning, no global install, no absolute path, no shims. `cwd: "."` makes the server operate on the workspace directory, which is what the `explore` tool and subagent dispatch use as the working directory.
|
|
141
116
|
|
|
142
|
-
|
|
117
|
+
**Other machines / people — no local clone needed.** The package is published to npm. On any machine, either hand-write the entry above or run the one-command installer (see "One-command install" above).
|
|
143
118
|
|
|
144
119
|
Tool names surface in OpenCode as `<server>_<tool>`, so `regent_delegate`, `regent_delegate_many`, `regent_research`, `regent_explore`, `regent_changed-files`, `regent_verify`. Prompts surface as commands named `<server>:<prompt>`; the prompts are namespaced `command.<name>` (e.g. `/regent:command.orchestrate`, `/regent:command.tdd`) and `skill.<id>` (e.g. `/regent:skill.using-regent`).
|
|
145
120
|
|
package/mcp/cli.js
CHANGED
package/mcp/install.js
CHANGED
|
@@ -8,30 +8,22 @@
|
|
|
8
8
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
9
9
|
import { join, dirname, resolve } from 'node:path';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
11
|
-
import { fileURLToPath } from 'node:url';
|
|
12
11
|
import { parseTree, findNodeAtLocation, getNodeValue, modify, applyEdits } from 'jsonc-parser';
|
|
13
12
|
import { version } from './version.js';
|
|
14
13
|
|
|
15
14
|
export const PLUGIN_SPEC = `regent-code@${version}`;
|
|
16
15
|
export const SERVER_NAME = 'regent';
|
|
17
16
|
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// deterministic and offline.
|
|
23
|
-
const CLI_PATH = fileURLToPath(new URL('./cli.js', import.meta.url));
|
|
24
|
-
|
|
17
|
+
// The MCP server launches with a single portable command. `npx -y regent-code`
|
|
18
|
+
// runs the package's `bin` (mcp/cli.js) from the npm registry or npx cache —
|
|
19
|
+
// no absolute paths, no global install, no per-machine shims. This is the only
|
|
20
|
+
// supported launch path; the installer writes exactly this entry.
|
|
25
21
|
export const SERVER_CONFIG = Object.freeze({
|
|
26
22
|
type: 'local',
|
|
27
|
-
command: ['
|
|
23
|
+
command: ['npx', '-y', 'regent-code'],
|
|
28
24
|
cwd: '.',
|
|
29
25
|
});
|
|
30
26
|
|
|
31
|
-
// npm's ephemeral npx cache (`_npx/<hash>/...`) can be pruned by npm; warn the
|
|
32
|
-
// user to install globally so the config's absolute path keeps resolving.
|
|
33
|
-
const EPHEMERAL_NPX_CACHE = '_npx';
|
|
34
|
-
|
|
35
27
|
const CONFIG_NAMES = ['opencode.jsonc', 'opencode.json'];
|
|
36
28
|
|
|
37
29
|
export class InstallError extends Error {}
|
|
@@ -210,13 +202,6 @@ export function install(options = {}) {
|
|
|
210
202
|
const { text, report } = patchText(base);
|
|
211
203
|
const warnings = [...report.warnings];
|
|
212
204
|
|
|
213
|
-
if (CLI_PATH.includes(EPHEMERAL_NPX_CACHE)) {
|
|
214
|
-
warnings.push(
|
|
215
|
-
`MCP entry points into npm's ephemeral npx cache (${CLI_PATH}); npm can prune it. ` +
|
|
216
|
-
`Run "npm install -g ${PLUGIN_SPEC}" once, then re-run "npx -y ${PLUGIN_SPEC} install" ` +
|
|
217
|
-
`so the config points at the persistent global install.`,
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
205
|
if (text !== existingText) {
|
|
221
206
|
mkdirSync(dirname(target.path), { recursive: true });
|
|
222
207
|
writeFileSync(target.path, text);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "regent-code",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Agent orchestration for OpenCode. From idea to shipped — zero ceremony. Plugin + MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": ".opencode/plugins/regent.js",
|
|
@@ -30,8 +30,9 @@
|
|
|
30
30
|
"format": "prettier --write .opencode/plugins/ skills/ mcp/ --no-error-on-unmatched-pattern",
|
|
31
31
|
"format:check": "prettier --check .opencode/plugins/ skills/ mcp/ --no-error-on-unmatched-pattern",
|
|
32
32
|
"typecheck": "tsc --noEmit",
|
|
33
|
-
"test": "node --test .opencode/tests/regent.test.js .opencode/tests/regent.live-test.js .opencode/tests/regent.v2.test.js .opencode/tests/regent.hybrid.v2.6.1.test.js .opencode/tests/regent.runtime.v2.6.1.test.js mcp/tests/mcp.test.js mcp/tests/install.test.js",
|
|
34
|
-
"verify": "npm run format:check && npm run lint && npm run typecheck && npm test"
|
|
33
|
+
"test": "node --test .opencode/tests/regent.test.js .opencode/tests/regent.live-test.js .opencode/tests/regent.v2.test.js .opencode/tests/regent.hybrid.v2.6.1.test.js .opencode/tests/regent.runtime.v2.6.1.test.js mcp/tests/mcp.test.js mcp/tests/install.test.js mcp/tests/bin.test.js",
|
|
34
|
+
"verify": "npm run format:check && npm run lint && npm run typecheck && npm test",
|
|
35
|
+
"prepublishOnly": "npm run verify"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@eslint/js": "^10.0.1",
|
|
Binary file
|
package/regent-code-3.0.3.tgz
DELETED
|
Binary file
|