@te-river/opencode-team-mode 1.2.1 → 1.4.0

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/dist/agents.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * TeamMode agent definitions.
3
3
  *
4
- * Each agent is injected into the OpenCode config via the plugin's v2
5
- * `setup` hook. Users see them in the agent picker of OpenCode Desktop
6
- * and can invoke them with `@agent-name` or via the `/team-*` commands.
4
+ * Each agent is injected into the OpenCode config via the plugin's v1
5
+ * `config` hook (the mechanism the shipped 1.18.x loader actually calls).
6
+ * Users see them in the agent picker of OpenCode Desktop and can invoke
7
+ * them with `@agent-name` or via the `/team-*` commands.
7
8
  *
8
9
  * Prompt design principles (v1.2):
9
10
  * - TodoList discipline is a hard rule for the Team Lead (plan-first for
@@ -15,6 +16,6 @@
15
16
  * dispatch embeds the relevant prior outputs.
16
17
  * - Research findings carry confidence tags and critical ones are verified.
17
18
  */
18
- import type { AgentItem } from "./types.js";
19
- export declare const agents: Record<string, AgentItem>;
19
+ import type { AgentConfig } from "./types.js";
20
+ export declare const agents: Record<string, AgentConfig>;
20
21
  //# sourceMappingURL=agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AA+Z3C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAO5C,CAAA"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAyZ7C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAO9C,CAAA"}
package/dist/agents.js CHANGED
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * TeamMode agent definitions.
3
3
  *
4
- * Each agent is injected into the OpenCode config via the plugin's v2
5
- * `setup` hook. Users see them in the agent picker of OpenCode Desktop
6
- * and can invoke them with `@agent-name` or via the `/team-*` commands.
4
+ * Each agent is injected into the OpenCode config via the plugin's v1
5
+ * `config` hook (the mechanism the shipped 1.18.x loader actually calls).
6
+ * Users see them in the agent picker of OpenCode Desktop and can invoke
7
+ * them with `@agent-name` or via the `/team-*` commands.
7
8
  *
8
9
  * Prompt design principles (v1.2):
9
10
  * - TodoList discipline is a hard rule for the Team Lead (plan-first for
@@ -36,7 +37,7 @@ const BLACKBOARD_GUARANTEE = `
36
37
  /* Team Lead — orchestrator */
37
38
  /* ------------------------------------------------------------------ */
38
39
  const teamLead = {
39
- mode: "all",
40
+ mode: "primary",
40
41
  description: "Team lead orchestrator — decomposes complex tasks, dispatches sub-agents " +
41
42
  "(architect, implementer, reviewer, tester, researcher), enforces a " +
42
43
  "review/test feedback loop, and synthesises their outputs into a coherent " +
@@ -155,7 +156,6 @@ adoption:
155
156
  bash: "allow",
156
157
  webfetch: "allow",
157
158
  task: "allow",
158
- todowrite: "allow",
159
159
  },
160
160
  };
161
161
  /* ------------------------------------------------------------------ */
@@ -399,12 +399,7 @@ by the team — flag prominently if that is the case.
399
399
  - State which product/version each finding applies to.
400
400
  `,
401
401
  color: "#A78BFA", // violet
402
- permission: {
403
- edit: "allow",
404
- bash: "allow",
405
- webfetch: "allow",
406
- websearch: "allow",
407
- },
402
+ permission: { edit: "allow", bash: "allow", webfetch: "allow", websearch: "allow" },
408
403
  };
409
404
  /* Append the blackboard write guarantee to every specialist prompt. */
410
405
  for (const a of [architect, implementer, reviewer, tester, researcher]) {
@@ -1 +1 @@
1
- {"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,wEAAwE;AACxE,y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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCT;IACC,KAAK,EAAE,SAAS,EAAE,OAAO;IACzB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;CAChE,CAAA;AAED,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,MAAM,UAAU,GAAgB;IAC9B,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,iEAAiE;QACjE,sEAAsE;QACtE,yEAAyE;QACzE,mCAAmC;IACrC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCT;IACC,KAAK,EAAE,SAAS,EAAE,SAAS;IAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE;CACpF,CAAA;AAED,uEAAuE;AACvE,KAAK,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;IACvE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,GAAG,oBAAoB,CAAA;AACpD,CAAC;AAED,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE,MAAM,CAAC,MAAM,MAAM,GAAgC;IACjD,WAAW,EAAE,QAAQ;IACrB,SAAS;IACT,WAAW;IACX,QAAQ;IACR,MAAM;IACN,UAAU;CACX,CAAA"}
@@ -5,6 +5,6 @@
5
5
  * `config` hook. Users invoke them with `/team-plan`, `/team-review`, etc.
6
6
  * in both OpenCode Desktop and the TUI.
7
7
  */
8
- import type { CommandItem } from "./types.js";
9
- export declare const commands: Record<string, CommandItem>;
8
+ import type { CommandConfig } from "./types.js";
9
+ export declare const commands: Record<string, CommandConfig>;
10
10
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAwI7C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAOhD,CAAA"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAwI/C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAOlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,wEAAwE;AACxE,MAAM,QAAQ,GAAgB;IAC5B,WAAW,EACT,+FAA+F;IACjG,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE;;;;;;;;;;;;;kDAasC;CACjD,CAAA;AAED,wEAAwE;AACxE,MAAM,aAAa,GAAgB;IACjC,WAAW,EACT,0FAA0F;IAC5F,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE;;;;;;;;4DAQgD;CAC3D,CAAA;AAED,wEAAwE;AACxE,MAAM,UAAU,GAAgB;IAC9B,WAAW,EACT,0EAA0E;IAC5E,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE;;;;;;;;;;;;;gEAaoD;CAC/D,CAAA;AAED,wEAAwE;AACxE,MAAM,QAAQ,GAAgB;IAC5B,WAAW,EACT,2EAA2E;IAC7E,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE;;;;;;;;;;;8BAWkB;CAC7B,CAAA;AAED,wEAAwE;AACxE,MAAM,YAAY,GAAgB;IAChC,WAAW,EACT,uEAAuE;IACzE,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;;;;;;;;;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wE;AACxE,MAAM,OAAO,GAAkB;IAC7B,WAAW,EACT,mGAAmG;IACrG,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;sEA0B0D;CACrE,CAAA;AAED,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE,MAAM,CAAC,MAAM,QAAQ,GAAkC;IACrD,WAAW,EAAE,QAAQ;IACrB,gBAAgB,EAAE,aAAa;IAC/B,aAAa,EAAE,UAAU;IACzB,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,YAAY;IAC7B,UAAU,EAAE,OAAO;CACpB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,24 @@
1
1
  /**
2
- * opencode-team-mode — OpenCode v2 plugin entry point.
2
+ * opencode-team-mode — OpenCode plugin entry point.
3
3
  *
4
- * Uses the v2 Promise API with an explicit `id` field. The `id` is the
5
- * display name shown in OpenCode Desktop's plugin list (instead of the
6
- * raw file path).
4
+ * Contract with the SHIPPED OpenCode Desktop loader (1.18.x, verified by
5
+ * reading the binary's own applyPlugin/readV1Plugin code):
6
+ *
7
+ * export default {
8
+ * id: "team-mode", → Desktop plugin display name
9
+ * server: async (input, options) => ({ config(cfg) { ...inject... } })
10
+ * }
11
+ *
12
+ * `server()` is the ONLY function the loader calls; a `setup` property is
13
+ * silently ignored (root cause of v1.1-v1.3 not appearing in the picker).
14
+ * The v1 `config` hook receives the merged opencode config and is the
15
+ * supported way to add agents/commands.
7
16
  *
8
17
  * Options (via the tuple plugin form):
9
- * "plugin": [["@te-river/opencode-team-mode", { "ttlDays": 7 }]]
18
+ * "plugin": [["@te-river/opencode-team-mode@latest", { "ttlDays": 7 }]]
10
19
  * `ttlDays` controls blackboard auto-cleanup; default 5.
11
20
  */
12
- export declare const Plugin: import("./types.js").PluginDefinition;
13
- export default Plugin;
21
+ import type { OpenCodePlugin } from "./types.js";
22
+ declare const plugin: OpenCodePlugin;
23
+ export default plugin;
14
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiCH,eAAO,MAAM,MAAM,uCAuCjB,CAAA;AAEF,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAsBhE,QAAA,MAAM,MAAM,EAAE,cAmCb,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  /**
2
- * opencode-team-mode — OpenCode v2 plugin entry point.
2
+ * opencode-team-mode — OpenCode plugin entry point.
3
3
  *
4
- * Uses the v2 Promise API with an explicit `id` field. The `id` is the
5
- * display name shown in OpenCode Desktop's plugin list (instead of the
6
- * raw file path).
4
+ * Contract with the SHIPPED OpenCode Desktop loader (1.18.x, verified by
5
+ * reading the binary's own applyPlugin/readV1Plugin code):
6
+ *
7
+ * export default {
8
+ * id: "team-mode", → Desktop plugin display name
9
+ * server: async (input, options) => ({ config(cfg) { ...inject... } })
10
+ * }
11
+ *
12
+ * `server()` is the ONLY function the loader calls; a `setup` property is
13
+ * silently ignored (root cause of v1.1-v1.3 not appearing in the picker).
14
+ * The v1 `config` hook receives the merged opencode config and is the
15
+ * supported way to add agents/commands.
7
16
  *
8
17
  * Options (via the tuple plugin form):
9
- * "plugin": [["@te-river/opencode-team-mode", { "ttlDays": 7 }]]
18
+ * "plugin": [["@te-river/opencode-team-mode@latest", { "ttlDays": 7 }]]
10
19
  * `ttlDays` controls blackboard auto-cleanup; default 5.
11
20
  */
12
- import { define } from "./types.js";
13
21
  import { agents } from "./agents.js";
14
22
  import { commands } from "./commands.js";
15
23
  import { startBlackboardMaintenance, resolveTtlMs, DEFAULT_TTL_DAYS, } from "./blackboard.js";
16
- /** Best-effort workspace directory from plugin context, else cwd. */
17
- function resolveDirectory(ctx) {
18
- for (const candidate of [ctx.directory, ctx.project]) {
19
- if (typeof candidate === "string" && candidate.length > 0)
20
- return candidate;
21
- }
22
- return process.cwd();
23
- }
24
24
  /** Runtime addendum to the team-lead prompt: concrete board + TTL. */
25
25
  function blackboardNote(root, ttlDays) {
26
26
  return [
@@ -33,43 +33,41 @@ function blackboardNote(root, ttlDays) {
33
33
  ` Your own delete-after-report is the fast path; the sweep is the safety net.`,
34
34
  ].join("\n");
35
35
  }
36
- export const Plugin = define({
36
+ const plugin = {
37
37
  id: "team-mode",
38
- setup: async (ctx) => {
38
+ server: async (input, options) => {
39
39
  // ---------- blackboard maintenance (code-level TTL sweeper) ----------
40
- const directory = resolveDirectory(ctx);
41
- const ttlMs = resolveTtlMs(ctx.options);
40
+ const directory = typeof input?.directory === "string" && input.directory.length > 0
41
+ ? input.directory
42
+ : process.cwd();
43
+ const ttlMs = resolveTtlMs(options);
42
44
  const ttlDays = Math.round(ttlMs / (24 * 60 * 60 * 1000)) || DEFAULT_TTL_DAYS;
43
45
  const boardRoot = startBlackboardMaintenance(directory, ttlMs);
44
- // ---------- inject team agents ----------
45
- await ctx.agent.transform((agent) => {
46
- for (const [name, def] of Object.entries(agents)) {
47
- agent.update(name, (item) => {
48
- item.description = def.description;
49
- item.mode = def.mode;
50
- item.prompt =
51
- name === "team-lead"
52
- ? def.prompt + blackboardNote(boardRoot, ttlDays)
53
- : def.prompt;
54
- item.color = def.color;
55
- // Authoritative permission from the plugin — overrides any stale
56
- // file-based agent definition that might deny blackboard writes.
57
- if (def.permission)
58
- item.permission = def.permission;
59
- });
60
- }
61
- });
62
- // ---------- inject team commands ----------
63
- await ctx.command.transform((command) => {
64
- for (const [name, def] of Object.entries(commands)) {
65
- command.update(name, (item) => {
66
- item.description = def.description;
67
- item.template = def.template;
68
- item.agent = def.agent;
69
- });
70
- }
71
- });
46
+ const note = blackboardNote(boardRoot, ttlDays);
47
+ return {
48
+ // ---------- v1 config hook: inject agents & commands ----------
49
+ config(cfg) {
50
+ if (!cfg.agent)
51
+ cfg.agent = {};
52
+ for (const [name, def] of Object.entries(agents)) {
53
+ // Respect user-defined overrides: never clobber an existing entry.
54
+ if (cfg.agent[name])
55
+ continue;
56
+ cfg.agent[name] = {
57
+ ...def,
58
+ prompt: name === "team-lead" ? (def.prompt ?? "") + note : def.prompt,
59
+ };
60
+ }
61
+ if (!cfg.command)
62
+ cfg.command = {};
63
+ for (const [name, def] of Object.entries(commands)) {
64
+ if (cfg.command[name])
65
+ continue;
66
+ cfg.command[name] = def;
67
+ }
68
+ },
69
+ };
72
70
  },
73
- });
74
- export default Plugin;
71
+ };
72
+ export default plugin;
75
73
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AAExB,qEAAqE;AACrE,SAAS,gBAAgB,CAAC,GAAkB;IAC1C,KAAK,MAAM,SAAS,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,SAAS,CAAA;IAC7E,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAA;AACtB,CAAC;AAED,sEAAsE;AACtE,SAAS,cAAc,CAAC,IAAY,EAAE,OAAe;IACnD,OAAO;QACL,EAAE;QACF,EAAE;QACF,k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GAAG,CAAC,OAAO,GAAG,EAAE,CAAA;gBAClC,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACnD,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;wBAAE,SAAQ;oBAC/B,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;gBACzB,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/types.d.ts CHANGED
@@ -1,45 +1,69 @@
1
1
  /**
2
- * OpenCode v2 Plugin type definitions.
2
+ * OpenCode plugin type definitions — contract for the shipped 1.18.x loader.
3
3
  *
4
- * These types match the v2 Promise plugin API used by OpenCode Desktop.
5
- * The v2 format requires an `id` field which controls the display name
6
- * shown in the Desktop UI.
4
+ * Verified against the desktop binary's own loader code
5
+ * (app.asar/out/main/chunks/node-*.js, readV1Plugin + applyPlugin):
6
+ *
7
+ * async function applyPlugin(load, input, hooks) {
8
+ * const plugin = readV1Plugin(load.mod, load.spec, "server", "detect");
9
+ * if (plugin) {
10
+ * hooks.push(await plugin.server(input, load.options)); // ← only server()
11
+ * return;
12
+ * }
13
+ * // legacy: bare function default export also works
14
+ * }
15
+ *
16
+ * Facts encoded here:
17
+ * - `setup` is NEVER called on this loader version (v1.1-v1.3 died here).
18
+ * - default export MUST be an object with a `server(input, options)`
19
+ * function; `id` on the object controls the Desktop plugin display name.
20
+ * - server() returns v1 Hooks; the `config(cfg)` hook receives the merged
21
+ * opencode config and is the working mechanism to inject agents/commands.
22
+ * - Agent/command entries inside cfg use the v1 config shape:
23
+ * prompt (string) + permission (object keyed by tool).
7
24
  */
8
- export interface AgentItem {
25
+ export interface AgentPermission {
26
+ [tool: string]: string | Record<string, string>;
27
+ }
28
+ export interface AgentConfig {
9
29
  description?: string;
10
30
  mode?: "primary" | "subagent" | "all";
31
+ /** v1 config field for the system prompt (NOT `system`). */
11
32
  prompt?: string;
12
33
  model?: string;
13
34
  color?: string;
14
35
  hidden?: boolean;
15
- permission?: Record<string, unknown>;
36
+ steps?: number;
37
+ temperature?: number;
38
+ permission?: AgentPermission;
16
39
  [key: string]: unknown;
17
40
  }
18
- export interface CommandItem {
41
+ export interface CommandConfig {
19
42
  description?: string;
20
43
  template?: string;
21
44
  agent?: string;
22
- model?: string;
23
45
  [key: string]: unknown;
24
46
  }
25
- export interface TransformEditor<T> {
26
- update(name: string, updater: (item: T) => void): void;
47
+ export interface OpenCodeConfig {
48
+ agent?: Record<string, AgentConfig>;
49
+ command?: Record<string, CommandConfig>;
50
+ [key: string]: unknown;
51
+ }
52
+ export interface Hooks {
53
+ config?: (cfg: OpenCodeConfig) => void | Promise<void>;
54
+ [hook: string]: unknown;
27
55
  }
28
- export interface PluginContext {
29
- agent: {
30
- transform<T = void>(callback: (editor: TransformEditor<AgentItem>) => T | Promise<T>): Promise<T>;
31
- reload(): Promise<void>;
32
- };
33
- command: {
34
- transform<T = void>(callback: (editor: TransformEditor<CommandItem>) => T | Promise<T>): Promise<T>;
35
- reload(): Promise<void>;
36
- };
37
- options?: Record<string, unknown>;
56
+ export interface PluginInput {
57
+ client: unknown;
58
+ project: string;
59
+ directory: string;
60
+ worktree?: string;
61
+ $?: unknown;
62
+ serverUrl?: URL;
38
63
  [key: string]: unknown;
39
64
  }
40
- export interface PluginDefinition {
65
+ export interface OpenCodePlugin {
41
66
  readonly id: string;
42
- readonly setup: (ctx: PluginContext) => Promise<void>;
67
+ readonly server: (input: PluginInput, options?: Record<string, unknown>) => Promise<Hooks>;
43
68
  }
44
- export declare function define(plugin: PluginDefinition): PluginDefinition;
45
69
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MA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B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAID,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtD,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAID,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAID,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,CACf,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,OAAO,CAAC,KAAK,CAAC,CAAA;CACpB"}
package/dist/types.js CHANGED
@@ -1,11 +1,26 @@
1
1
  /**
2
- * OpenCode v2 Plugin type definitions.
2
+ * OpenCode plugin type definitions — contract for the shipped 1.18.x loader.
3
3
  *
4
- * These types match the v2 Promise plugin API used by OpenCode Desktop.
5
- * The v2 format requires an `id` field which controls the display name
6
- * shown in the Desktop UI.
4
+ * Verified against the desktop binary's own loader code
5
+ * (app.asar/out/main/chunks/node-*.js, readV1Plugin + applyPlugin):
6
+ *
7
+ * async function applyPlugin(load, input, hooks) {
8
+ * const plugin = readV1Plugin(load.mod, load.spec, "server", "detect");
9
+ * if (plugin) {
10
+ * hooks.push(await plugin.server(input, load.options)); // ← only server()
11
+ * return;
12
+ * }
13
+ * // legacy: bare function default export also works
14
+ * }
15
+ *
16
+ * Facts encoded here:
17
+ * - `setup` is NEVER called on this loader version (v1.1-v1.3 died here).
18
+ * - default export MUST be an object with a `server(input, options)`
19
+ * function; `id` on the object controls the Desktop plugin display name.
20
+ * - server() returns v1 Hooks; the `config(cfg)` hook receives the merged
21
+ * opencode config and is the working mechanism to inject agents/commands.
22
+ * - Agent/command entries inside cfg use the v1 config shape:
23
+ * prompt (string) + permission (object keyed by tool).
7
24
  */
8
- export function define(plugin) {
9
- return plugin;
10
- }
25
+ export {};
11
26
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmDH,MAAM,UAAU,MAAM,CAAC,MAAwB;IAC7C,OAAO,MAAM,CAAA;AACf,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@te-river/opencode-team-mode",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "Team collaboration mode plugin for OpenCode Desktop — injects specialized agents (architect, reviewer, implementer, tester, researcher) and team workflow commands into your OpenCode workspace.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",