@mstar-harness/opencode 1.5.3 → 1.5.4

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to the `@mstar-harness/opencode` package are documented in t
4
4
 
5
5
  The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface releases.
6
6
 
7
+ ## 1.5.4
8
+
9
+ - Version alignment with harness **1.5.4** (bundled skills/commands: Cursor Task flat invoke schema in `mstar-host`).
10
+
11
+ See root [CHANGELOG.md](../../CHANGELOG.md) **1.5.4**.
12
+
7
13
  ## 1.5.3
8
14
 
9
15
  - Version alignment with harness **1.5.3** (bundled skills/commands: frontmatter YAML quotes + `/iteration-loop` scale `XL`).
@@ -64,7 +64,7 @@ When Assignment has **`SDD implementer session: sticky`** (`mstar-sdd/references
64
64
 
65
65
  ## Dispatch execution(canonical)
66
66
 
67
- Cursor PM dispatch = **`Task`** with `subagent_type` matching the Assignment `Execute as` role.
67
+ Cursor PM dispatch = **`Task`** with `subagent_type` matching the Assignment `Execute as` role. Flat JSON field shape → **Task invoke schema (Cursor)** below.
68
68
 
69
69
  - **1 Assignment ⇒ 1 Task**; parallel batches ⇒ **N Tasks in one message** (`parallel-dispatch.md`, `mstar-dispatch-gates`).
70
70
  - Assignment Markdown **does not** start work. PM thread **must not** implement, review, or edit specialist deliverables by loading another role reference in the same session (`Acting as role: …` is **not** dispatch).
@@ -73,6 +73,84 @@ Cursor PM dispatch = **`Task`** with `subagent_type` matching the Assignment `Ex
73
73
  - Concurrent writers / QC cwd alignment → **`mstar-branch-worktree`** (not a separate “mode”).
74
74
  - Implement subagents: recipient is already `Execute as`; **no** recursive Task with same `subagent_type`. Assignment wins (`Delegation: forbidden` unless stated).
75
75
 
76
+ ## Task invoke schema (Cursor)
77
+
78
+ Cursor’s live **Task** tool expects a **flat** JSON argument object. `prompt` and `subagent_type` are **sibling fields** — not nested, not stringified. Official behavior docs cover subagents/parallel/resume; the flat field shape below is Morning Star’s operational SSOT for Cursor (live-tool contract).
79
+
80
+ ### Canonical flat shape
81
+
82
+ ```json
83
+ {
84
+ "description": "3-5 word UI title",
85
+ "prompt": "<full Assignment Markdown body>",
86
+ "subagent_type": "<Execute as role id or built-in>",
87
+ "model": "<optional host slug>",
88
+ "run_in_background": false
89
+ }
90
+ ```
91
+
92
+ ### Required vs optional fields
93
+
94
+ | Field | Required | Notes |
95
+ |-------|----------|-------|
96
+ | `prompt` | yes | Full Assignment Markdown string (IDENTITY, gates, Plan Path, Working branch, …) |
97
+ | `subagent_type` | yes | Must equal Assignment `Execute as` (Morning Star role id when using custom agents) |
98
+ | `description` | recommended | Short UI title only (3–5 words); never the Assignment body |
99
+ | `model` | optional | Host slug from Assignment **Model tier** mapping |
100
+ | `run_in_background` | optional | Default false unless PM intentionally backgrounds |
101
+ | `resume` | sticky continue only | Omit on fresh dispatch; see sticky section |
102
+
103
+ ### Must-have example (single dispatch)
104
+
105
+ ```text
106
+ Task(
107
+ description: "Implement auth middleware",
108
+ prompt: "<full Assignment body>",
109
+ subagent_type: "fullstack-dev",
110
+ model: "<optional>",
111
+ run_in_background: false
112
+ )
113
+ ```
114
+
115
+ Rules:
116
+
117
+ - `subagent_type` **=** Assignment `Execute as` — never OpenCode’s `subagent` key.
118
+ - `prompt` = plain Markdown Assignment text, **not** a JSON object string of the whole call.
119
+ - `description` = UI title only; do not put the Assignment there.
120
+
121
+ ### Parallel batch (N Tasks, one message)
122
+
123
+ When `N ≥ 2`, emit **N** separate Task tool calls in **one** assistant message (`parallel-dispatch.md`). Each call is still a flat object with its own `prompt` + `subagent_type`.
124
+
125
+ ### Anti-patterns (do not send)
126
+
127
+ | Anti-pattern | Correct |
128
+ |--------------|---------|
129
+ | Args as one stringified JSON blob | Flat sibling fields on the Task tool |
130
+ | Field name `subagent` (OpenCode) | `subagent_type` |
131
+ | `CallMcpTool` / MCP wrap for Task | Native Task tool only |
132
+ | Missing `subagent_type` | Always set; match `Execute as` |
133
+ | Assignment JSON stuffed only into `prompt`, no top-level `subagent_type` | Both `prompt` and `subagent_type` present |
134
+ | Nested `{ "arguments": { ... } }` Task payload | Flat object at tool-call top level |
135
+ | Treating paste-only `## Assignment` as dispatch | Must emit Task call(s) |
136
+
137
+ ### Self-check before send
138
+
139
+ 1. Tool name is **Task** (not MCP, not OpenCode `task`+`subagent`).
140
+ 2. Top-level keys include **`prompt`** and **`subagent_type`** (siblings).
141
+ 3. `subagent_type` equals Assignment `Execute as`.
142
+ 4. `prompt` is Markdown Assignment text, not stringified JSON of the whole call.
143
+ 5. If sticky continue: `resume` + continuation prompt per sticky section; else omit `resume`.
144
+ 6. If `N ≥ 2`: this message contains **exactly N** Task calls (`parallel-dispatch.md`).
145
+
146
+ ### Sticky / resume (pointer)
147
+
148
+ First vs resume field set → **SDD sticky implementer (Cursor Task resume)** above. Do not restate those tables here.
149
+
150
+ - Fresh: `subagent_type` + full implementer prompt; capture agent id.
151
+ - Continue: `resume: <host_agent_id>` + continuation prompt; still flat sibling fields.
152
+ - Reviewers: never `resume`.
153
+
76
154
  ## Clarify
77
155
 
78
156
  - No `question` tool: structured Markdown or Cursor UI.
@@ -17,7 +17,7 @@ Printing `## Assignment` in the main thread **without** matching host invocation
17
17
 
18
18
  1. Finalize all `N` Assignment payloads (after any prerequisite turn).
19
19
  2. Count distinct `Execute as` sessions (`N`).
20
- 3. Issue **`N` host invocations first** — OpenCode: **N `task` tool** calls with **subagent**; Cursor: **N `Task`** with `subagent_type`; Kimi: **N `Agent`** calls (each prompt carries **Act as** + skill load; `subagent_type` ∈ {`coder`,`explore`,`plan`} only — see `kimi.md` C5/C5b); each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
20
+ 3. Issue **`N` host invocations first** — OpenCode: **N `task` tool** calls with **subagent**; Cursor: **N `Task`** with `subagent_type` (JSON field shape → `cursor.md` § Task invoke schema); Kimi: **N `Agent`** calls (each prompt carries **Act as** + skill load; `subagent_type` ∈ {`coder`,`explore`,`plan`} only — see `kimi.md` C5/C5b); each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
21
21
  4. Optionally post a short **Status Update** after invocations (audit trail only — does not replace step 3).
22
22
 
23
23
  ## Hard rules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {