@op1/threads 0.1.6 → 0.1.7

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
@@ -1,6 +1,6 @@
1
1
  # @op1/threads
2
2
 
3
- Managed top-level worker sessions for OpenCode 2.0.3. The server entrypoint is `index.ts`; the terminal entrypoint is `tui.ts`.
3
+ Managed top-level worker sessions for OpenCode 2.0.7. The server entrypoint is `index.ts`; the terminal entrypoint is `tui.ts`.
4
4
 
5
5
  ## Install
6
6
 
@@ -58,7 +58,7 @@ All fields are strings except `evidence`, which is an array of strings. Verdicts
58
58
 
59
59
  `directory` must exist and be absolute. Without `agent`, the worker inherits the coordinator's active agent and resolved model, with agent permissions followed by session permissions.
60
60
 
61
- Set `agent` to use a configured profile, such as `agent: "vera-core"` for a VERA workstream or `agent: "vera-auditor-readonly"` for an independent review. The plugin resolves the profile in the assigned directory. OpenCode supplies its system prompt and step limit. The profile's model and variant take precedence; a profile without a model inherits the coordinator's resolved model. Explicit selection supports `primary`, `all`, and `subagent` profiles on OpenCode 2.0.3.
61
+ Set `agent` to use a configured profile, such as `agent: "vera-core"` for a VERA workstream or `agent: "vera-auditor-readonly"` for an independent review. The plugin resolves the profile in the assigned directory. OpenCode supplies its system prompt and step limit. The profile's model and variant take precedence; a profile without a model inherits the coordinator's resolved model. Explicit selection supports `primary`, `all`, and `subagent` profiles on OpenCode 2.0.7.
62
62
 
63
63
  Explicit selection requires the caller's ordered agent and session rules to allow `subagent` for that exact agent ID. A matching `deny` or `ask` rejects the request before creation. OpenCode's plugin API cannot request approval for an input-dependent agent ID.
64
64
 
@@ -115,7 +115,7 @@ The input accepts at most 100 coordinator IDs. Raw HTTP RPC requests wrap the in
115
115
 
116
116
  ## Verification and limits
117
117
 
118
- Run `bun run typecheck`, `bun test`, and `bun run verify:live`. The live check requires OpenCode 2.0.3, Python, and `uv`. It starts a separate local server, a deterministic model endpoint, and a terminal process with isolated configuration and data. It verifies actual tool calls, durable messages, permission restrictions, worker limits, deleted-worker cleanup, restart behavior, and native tab visibility, busy state, and focus.
118
+ Run `bun run typecheck`, `bun test`, and `bun run verify:live`. The live check requires OpenCode 2.0.7, Python, and `uv`. It starts a separate local server, a deterministic model endpoint, and a terminal process with isolated configuration and data. It verifies actual tool calls, durable messages, permission restrictions, worker limits, deleted-worker cleanup, restart behavior, and native tab visibility, busy state, and focus.
119
119
 
120
120
  Run `bun run verify:tabs` to verify project grouping across real git worktrees, activity-based ordering, permission prompts, completed and resumed workers, focus preservation, and TUI reopening.
121
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op1/threads",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Visible top-level worker sessions for OpenCode V2, with native tabs and durable reports.",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -30,8 +30,8 @@
30
30
  "verify:tabs": "uv run --with pyte python scripts/verify-tab-groups.py"
31
31
  },
32
32
  "dependencies": {
33
- "@opencode/plugin": "2.0.3",
34
- "@opencode/schema": "2.0.3",
33
+ "@opencode/plugin": "2.0.7",
34
+ "@opencode/schema": "2.0.7",
35
35
  "zod": "4.1.8"
36
36
  },
37
37
  "peerDependencies": {
package/src/threads.ts CHANGED
@@ -358,7 +358,7 @@ export function threads(
358
358
  await owned(actor, input.workerID);
359
359
  await ctx.session.interrupt({
360
360
  sessionID: input.workerID,
361
- continue: false,
361
+ resume: false,
362
362
  });
363
363
  return view(await ctx.session.get({ sessionID: input.workerID }));
364
364
  },
package/tui.ts CHANGED
@@ -132,32 +132,26 @@ export default Plugin.define({
132
132
  if (!role || !session?.title) continue;
133
133
  const title = `[${role}] ${session.title.replace(/^\[(?:Main|Worker)\] /, "")}`;
134
134
  if (title === session.title) continue;
135
- await ctx.client.session.rename({ sessionID: tab.sessionID, title });
135
+ await ctx.client.session.update({ sessionID: tab.sessionID, title });
136
136
  }
137
137
  groupTabs();
138
138
  }
139
+ lastError = undefined;
140
+ } catch (error) {
141
+ const message = `Managed worker tabs: ${String(error)}`;
142
+ if (!stopped && message !== lastError)
143
+ ctx.ui.toast.show({ message, variant: "error" });
144
+ lastError = message;
139
145
  } finally {
140
146
  running = false;
141
147
  if (reopenPending) {
142
148
  reopenPending = false;
143
- void reconcile(true).catch((error) =>
144
- ctx.ui.toast.show({ message: String(error), variant: "error" }),
145
- );
149
+ void reconcile(true);
146
150
  }
147
151
  }
148
152
  }
149
153
  const refresh = () => {
150
- void reconcile().then(
151
- () => {
152
- lastError = undefined;
153
- },
154
- (error: unknown) => {
155
- const message = `Managed worker tabs: ${String(error)}`;
156
- if (!stopped && message !== lastError)
157
- ctx.ui.toast.show({ message, variant: "error" });
158
- lastError = message;
159
- },
160
- );
154
+ void reconcile();
161
155
  };
162
156
  const stopEvents = ctx.data.listen(({ details }) => {
163
157
  if (details.type.startsWith("session.")) refresh();
@@ -178,16 +172,7 @@ export default Plugin.define({
178
172
  title: "Reopen managed worker tabs",
179
173
  palette: true,
180
174
  slash: { name: "threads" },
181
- run: async () => {
182
- try {
183
- await reconcile(true);
184
- } catch (error) {
185
- ctx.ui.toast.show({
186
- message: String(error),
187
- variant: "error",
188
- });
189
- }
190
- },
175
+ run: () => reconcile(true),
191
176
  },
192
177
  ],
193
178
  }));