opencode-agent-teams 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -0
  2. package/package.json +1 -51
package/dist/index.js CHANGED
@@ -101,6 +101,25 @@ function topologicalSort(tasks) {
101
101
  }
102
102
  return levels;
103
103
  }
104
+ async function getCurrentModel(client, sessionID) {
105
+ try {
106
+ const { data: msgs } = await client.session.messages({
107
+ path: { id: sessionID },
108
+ query: { limit: 5 },
109
+ });
110
+ if (!msgs)
111
+ return undefined;
112
+ for (const msg of msgs) {
113
+ if (msg.info.role === "assistant" && msg.info.modelID && msg.info.providerID) {
114
+ return { providerID: msg.info.providerID, modelID: msg.info.modelID };
115
+ }
116
+ }
117
+ return undefined;
118
+ }
119
+ catch {
120
+ return undefined;
121
+ }
122
+ }
104
123
  const plugin = async (ctx) => {
105
124
  return {
106
125
  tool: {
@@ -181,6 +200,7 @@ const plugin = async (ctx) => {
181
200
  const plan = loadPlan(args.plan_id);
182
201
  if (!plan)
183
202
  return `Plan "${args.plan_id}" not found. Create it first with team_create.`;
203
+ const model = await getCurrentModel(ctx.client, context.sessionID);
184
204
  const run = {
185
205
  planID: plan.id,
186
206
  tasks: plan.tasks.map((t) => ({
@@ -218,6 +238,7 @@ const plugin = async (ctx) => {
218
238
  path: { id: session.id },
219
239
  body: {
220
240
  agent: taskDef.agent || "general",
241
+ model: model,
221
242
  parts: [{ type: "text", text: taskDef.prompt }],
222
243
  },
223
244
  });
@@ -341,6 +362,7 @@ const plugin = async (ctx) => {
341
362
  },
342
363
  async execute(args, context) {
343
364
  const taskID = `bg-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
365
+ const model = await getCurrentModel(ctx.client, context.sessionID);
344
366
  try {
345
367
  const { data: session, error: createErr } = await ctx.client.session.create({
346
368
  body: {
@@ -364,6 +386,7 @@ const plugin = async (ctx) => {
364
386
  path: { id: session.id },
365
387
  body: {
366
388
  agent: args.agent || "general",
389
+ model: model,
367
390
  parts: [{ type: "text", text: args.prompt }],
368
391
  },
369
392
  });
package/package.json CHANGED
@@ -1,51 +1 @@
1
- {
2
- "name": "opencode-agent-teams",
3
- "version": "1.0.0",
4
- "description": "OpenCode plugin for parallel agent execution, background tasks, and team coordination. Create teams of agents that work together, run tasks in parallel respecting dependencies, and fire off background work without blocking.",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "files": ["dist"],
15
- "scripts": {
16
- "build": "tsc",
17
- "prepublishOnly": "npm run build"
18
- },
19
- "keywords": [
20
- "opencode",
21
- "plugin",
22
- "teams",
23
- "agents",
24
- "parallel",
25
- "background",
26
- "orchestration"
27
- ],
28
- "author": {
29
- "name": "Maycol B.T",
30
- "email": "soymaycol.cn@gmail.com",
31
- "url": "https://github.com/SoyMaycol"
32
- },
33
- "publishConfig": {
34
- "access": "public"
35
- },
36
- "license": "MIT",
37
- "repository": {
38
- "type": "git",
39
- "url": "https://github.com/SoyMaycol/opencode-teams"
40
- },
41
- "peerDependencies": {
42
- "@opencode-ai/plugin": ">=1.0.0",
43
- "@opencode-ai/sdk": ">=1.0.0"
44
- },
45
- "devDependencies": {
46
- "@opencode-ai/plugin": "1.4.6",
47
- "@opencode-ai/sdk": "latest",
48
- "@types/node": "^22.0.0",
49
- "typescript": "^5.0.0"
50
- }
51
- }
1
+ {"name":"opencode-agent-teams","version":"1.0.1","description":"OpenCode plugin for parallel agent execution, background tasks, and team coordination. Create teams of agents that work together, run tasks in parallel respecting dependencies, and fire off background work without blocking.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"files":["dist"],"scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["opencode","plugin","teams","agents","parallel","background","orchestration"],"author":{"name":"Maycol B.T","email":"soymaycol.cn@gmail.com","url":"https://github.com/SoyMaycol"},"publishConfig":{"access":"public"},"license":"MIT","repository":{"type":"git","url":"https://github.com/SoyMaycol/opencode-teams"},"peerDependencies":{"@opencode-ai/plugin":">=1.0.0","@opencode-ai/sdk":">=1.0.0"},"devDependencies":{"@opencode-ai/plugin":"1.4.6","@opencode-ai/sdk":"latest","@types/node":"^22.0.0","typescript":"^5.0.0"}}