regent-code 3.0.5 → 3.0.6

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.
@@ -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.5 install
9
+ npx -y regent-code@3.0.6 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.5"],
22
+ "plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.6"],
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.5` git tag must be pushed to GitHub before the pinned spec resolves.
35
+ The pinned version is recommended. Use the unpinned branch only when you intentionally want the latest changes. The `v3.0.6` 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/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.5"],
54
+ "plugins": ["regent-code@git+https://github.com/nathwn12/regent-code.git#v3.0.6"],
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.5` git tag must be pushed
72
+ known worker sessions stays hard-blocked). The `v3.0.6` 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,13 +79,13 @@ 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.5 install
82
+ npx -y regent-code@3.0.6 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
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.5`
88
+ - **Plugin**: `plugins` → `regent-code@3.0.6`
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
 
package/mcp/index.js CHANGED
@@ -227,7 +227,11 @@ async function dispatchSubagent(client, resolveWorker, args, taskId = '') {
227
227
  }
228
228
 
229
229
  const key = 'mcp';
230
- const directory = process.cwd();
230
+ // Worker sessions attach to the service's CURRENT project by default —
231
+ // explicit foreign locations resolve to unloaded scopes with empty agent
232
+ // catalogs ("Agent not found"). Override only via REGENT_WORKER_LOCATION.
233
+ const workerLocation = (process.env.REGENT_WORKER_LOCATION || '').trim();
234
+ const directory = workerLocation || process.cwd();
231
235
  let session;
232
236
 
233
237
  try {
@@ -243,7 +247,8 @@ async function dispatchSubagent(client, resolveWorker, args, taskId = '') {
243
247
  for (let index = 0; index < selection.agents.length; index++) {
244
248
  const agent = selection.agents[index];
245
249
  try {
246
- const createInput = { title, agent, location: { directory } };
250
+ const createInput = { title, agent };
251
+ if (workerLocation) createInput.location = { directory: workerLocation };
247
252
  const sessionResult = await withRetry(() => client.session.create(createInput));
248
253
  session = unwrapData(sessionResult);
249
254
  if (session?.id) break;
@@ -634,7 +639,7 @@ export function createRegentServer() {
634
639
  const client = await getClient();
635
640
  const resolveWorker = await createWorkerResolver(client, {
636
641
  workerAgent: process.env.REGENT_WORKER_AGENT,
637
- location: process.cwd(),
642
+ location: process.env.REGENT_WORKER_LOCATION || '',
638
643
  });
639
644
  const result = await dispatchSubagent(client, resolveWorker, /** @type {any} */ (args));
640
645
  return toContent(result);
@@ -659,7 +664,7 @@ export function createRegentServer() {
659
664
  const client = await getClient();
660
665
  const resolveWorker = await createWorkerResolver(client, {
661
666
  workerAgent: process.env.REGENT_WORKER_AGENT,
662
- location: process.cwd(),
667
+ location: process.env.REGENT_WORKER_LOCATION || '',
663
668
  });
664
669
  const queue = [...args.tasks];
665
670
  const results = [];
@@ -704,7 +709,7 @@ export function createRegentServer() {
704
709
  const client = await getClient();
705
710
  const resolveWorker = await createWorkerResolver(client, {
706
711
  workerAgent: process.env.REGENT_WORKER_AGENT,
707
- location: process.cwd(),
712
+ location: process.env.REGENT_WORKER_LOCATION || '',
708
713
  });
709
714
  const results = await Promise.all(
710
715
  args.questions.map(async (q) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "regent-code",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
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",
Binary file
Binary file