regent-code 3.0.2 → 3.0.3
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/.opencode/INSTALL.md +3 -3
- package/.opencode/package.json +1 -1
- package/README.md +26 -17
- package/mcp/index.js +1 -2
- package/mcp/install.js +25 -6
- package/mcp/version.js +9 -0
- package/package.json +3 -3
- package/regent-code-3.0.3.tgz +0 -0
- package/regent-code-3.0.2.tgz +0 -0
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.3 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.3"],
|
|
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.3` 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/.opencode/package.json
CHANGED
package/README.md
CHANGED
|
@@ -51,26 +51,26 @@ 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.3"],
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Version compatibility (dynamic, not pinned)
|
|
59
59
|
|
|
60
|
-
Since v3.0.
|
|
61
|
-
plugin
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
Since v3.0.3 regent-code resolves `@opencode-ai/client` and
|
|
61
|
+
`@opencode-ai/plugin` through the OpenCode **`beta` dist-tag** (`"beta"` in
|
|
62
|
+
`package.json`), which always points at the current beta build — the same
|
|
63
|
+
channel the CLI ships on. Every install resolves automatically to the newest
|
|
64
|
+
beta; no version chasing, no manual pin updates. (Avoid `npm install
|
|
65
|
+
pkg@<version>` in this repo: npm silently rewrites dependency ranges in the
|
|
66
|
+
manifest when given explicit versions — use plain `npm install` or `npm
|
|
67
|
+
update`.) The dispatch code is *runtime-adaptive* on top: generation results
|
|
66
68
|
are read from the persisted transcript when the service stores turns, otherwise
|
|
67
69
|
from the synchronous `session.generate` text; agent catalogs are queried with
|
|
68
70
|
and without an explicit location scope; and the caller-authorization guardrail
|
|
69
71
|
degrades OPEN when the runtime agent API is unresolvable (only recursion from
|
|
70
|
-
known worker sessions stays hard-blocked).
|
|
71
|
-
|
|
72
|
-
`.opencode/package.json`.
|
|
73
|
-
The `v3.0.2` git tag must be pushed to GitHub before this pinned spec resolves.
|
|
72
|
+
known worker sessions stays hard-blocked). The `v3.0.3` git tag must be pushed
|
|
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.
|
|
76
76
|
|
|
@@ -79,16 +79,18 @@ The `v3.0.2` git tag must be pushed 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.3 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 `node <absolute path to this package's mcp/cli.js>` directly. No per-connection npx bootstrap: `npx -y regent-code` re-resolves against the npm registry on every OpenCode session start and can re-provision the npx cache, which makes MCP connects flaky (handshake timeouts / connection-closed). Launching the installed file with `node` is deterministic and offline.
|
|
88
|
+
- **Plugin**: `plugins` → `regent-code@3.0.3`
|
|
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
|
+
|
|
92
94
|
> 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.
|
|
93
95
|
|
|
94
96
|
## MCP Server
|
|
@@ -114,7 +116,14 @@ Configure it in OpenCode by adding a local MCP server:
|
|
|
114
116
|
|
|
115
117
|
`<REPO>` is the path to where the repo is cloned; `cwd: "."` makes the server operate on the workspace directory, which is what the `explore` tool and subagent dispatch use as the working directory.
|
|
116
118
|
|
|
117
|
-
**Other machines / people — no local clone needed.** The package is published to npm,
|
|
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:
|
|
118
127
|
|
|
119
128
|
```jsonc
|
|
120
129
|
{
|
|
@@ -123,14 +132,14 @@ Configure it in OpenCode by adding a local MCP server:
|
|
|
123
132
|
"servers": {
|
|
124
133
|
"regent": {
|
|
125
134
|
"type": "local",
|
|
126
|
-
"command": ["
|
|
135
|
+
"command": ["node", "<NPM_GLOBAL>/regent-code/mcp/cli.js"]
|
|
127
136
|
}
|
|
128
137
|
}
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
```
|
|
132
141
|
|
|
133
|
-
`
|
|
142
|
+
`<NPM_GLOBAL>` is the npm global install directory (`npm root -g`). Launching the installed file with `node` means every OpenCode session start spawns the server directly — no per-connection npx registry resolution, so connection is deterministic and works offline. Dispatch tools still require a local OpenCode service to be running (see below), so the server behaves identically to a local install.
|
|
134
143
|
|
|
135
144
|
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`).
|
|
136
145
|
|
package/mcp/index.js
CHANGED
|
@@ -42,8 +42,7 @@ import {
|
|
|
42
42
|
} from './shared.js';
|
|
43
43
|
|
|
44
44
|
import { readPackagePrompts, renderPrompt } from './prompts.js';
|
|
45
|
-
|
|
46
|
-
const version = '3.0.1';
|
|
45
|
+
import { version } from './version.js';
|
|
47
46
|
|
|
48
47
|
// ── OpenCode client (lazy singleton) ─────────────────────────
|
|
49
48
|
let clientPromise = null;
|
package/mcp/install.js
CHANGED
|
@@ -8,20 +8,30 @@
|
|
|
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 {
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
12
|
import { parseTree, findNodeAtLocation, getNodeValue, modify, applyEdits } from 'jsonc-parser';
|
|
13
|
-
|
|
14
|
-
const require = createRequire(import.meta.url);
|
|
15
|
-
const { version } = require('../package.json');
|
|
13
|
+
import { version } from './version.js';
|
|
16
14
|
|
|
17
15
|
export const PLUGIN_SPEC = `regent-code@${version}`;
|
|
18
16
|
export const SERVER_NAME = 'regent';
|
|
17
|
+
|
|
18
|
+
// Launch the MCP server straight from the installed package. A per-connection
|
|
19
|
+
// `npx -y regent-code` bootstraps npm resolution against the registry and can
|
|
20
|
+
// re-provision the npx cache on every OpenCode session start, which makes MCP
|
|
21
|
+
// connects flaky (handshake timeouts / connection-closed). `node <path>` is
|
|
22
|
+
// deterministic and offline.
|
|
23
|
+
const CLI_PATH = fileURLToPath(new URL('./cli.js', import.meta.url));
|
|
24
|
+
|
|
19
25
|
export const SERVER_CONFIG = Object.freeze({
|
|
20
26
|
type: 'local',
|
|
21
|
-
command: ['
|
|
27
|
+
command: ['node', CLI_PATH],
|
|
22
28
|
cwd: '.',
|
|
23
29
|
});
|
|
24
30
|
|
|
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
|
+
|
|
25
35
|
const CONFIG_NAMES = ['opencode.jsonc', 'opencode.json'];
|
|
26
36
|
|
|
27
37
|
export class InstallError extends Error {}
|
|
@@ -198,7 +208,15 @@ export function install(options = {}) {
|
|
|
198
208
|
const existingText = existsSync(target.path) ? readFileSync(target.path, 'utf8') : null;
|
|
199
209
|
const base = existingText ?? `{\n}\n`;
|
|
200
210
|
const { text, report } = patchText(base);
|
|
201
|
-
|
|
211
|
+
const warnings = [...report.warnings];
|
|
212
|
+
|
|
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
|
+
}
|
|
202
220
|
if (text !== existingText) {
|
|
203
221
|
mkdirSync(dirname(target.path), { recursive: true });
|
|
204
222
|
writeFileSync(target.path, text);
|
|
@@ -206,6 +224,7 @@ export function install(options = {}) {
|
|
|
206
224
|
|
|
207
225
|
return {
|
|
208
226
|
...report,
|
|
227
|
+
...(warnings.length ? { warnings } : {}),
|
|
209
228
|
path: target.path,
|
|
210
229
|
scope: target.scope,
|
|
211
230
|
created: existingText === null,
|
package/mcp/version.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Single dynamic source for the package version: read from the installed
|
|
2
|
+
// package.json at runtime, never hardcoded. Both the installer (plugin/MCP
|
|
3
|
+
// spec pins) and the MCP server (serverInfo) import from here, so a version
|
|
4
|
+
// bump in package.json propagates everywhere without touching code.
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
export const version = require('../package.json').version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "regent-code",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
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",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "nathwn12",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
18
|
-
"@opencode-ai/client": "
|
|
19
|
-
"@opencode-ai/plugin": "
|
|
18
|
+
"@opencode-ai/client": "beta",
|
|
19
|
+
"@opencode-ai/plugin": "beta",
|
|
20
20
|
"jsonc-parser": "3.3.1"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
Binary file
|
package/regent-code-3.0.2.tgz
DELETED
|
Binary file
|