@yugoo-design/companion 0.1.0-beta.11 → 0.1.0-beta.13

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 (39) hide show
  1. package/README.md +10 -6
  2. package/package.json +1 -1
  3. package/payload/desktop-preparation/hosts/workbuddy/design-SKILL.md +54 -4
  4. package/payload/desktop-preparation/materials.json +7 -6
  5. package/payload/desktop-preparation/plugin/design-system/skills/design-panel/native-execution.md +435 -0
  6. package/payload/desktop-preparation/qwenwork-package.mjs +1 -1
  7. package/payload/desktop-preparation/qwenwork-template/skills/yugoo/native-execution.md +75 -6
  8. package/payload/desktop-preparation/src/workbuddy-mcp-relay.mjs +44 -17
  9. package/payload/desktop-preparation/src/workbuddy-relay-probe.mjs +25 -14
  10. package/payload/desktop-preparation/workbuddy-package.mjs +8 -2
  11. package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
  12. package/payload/overlays/claude-code/skills/yugoo/native-execution.md +74 -5
  13. package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
  14. package/payload/overlays/codex/skills/design-panel/native-execution.md +74 -5
  15. package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
  16. package/payload/overlays/qoder/skills/yugoo/native-execution.md +74 -5
  17. package/payload/shared/authoring/panel-components.json +317 -216
  18. package/payload/shared/bundles/role_access/panel.yaml +7 -0
  19. package/payload/shared/scripts/{content-archive-Dc-eUqE_.mjs → content-archive-CSdtYjTT.mjs} +2 -2
  20. package/payload/shared/scripts/{core-entry-Bj1isC2W.mjs → core-entry-CCOXUWXc.mjs} +61 -4
  21. package/payload/shared/scripts/design.mjs +23 -4
  22. package/payload/shared/scripts/{git-index-library-08zOq52I.mjs → git-index-library-B13yHuBj.mjs} +76 -76
  23. package/payload/shared/scripts/{git-index-library-C_wZ6wUq.mjs → git-index-library-Cb11yV6m.mjs} +1 -1
  24. package/payload/shared/scripts/{git-native-NCzpyKUp.mjs → git-native-BsLG3Dyx.mjs} +3 -3
  25. package/payload/shared/scripts/git-native-worker.js +1 -1
  26. package/payload/shared/scripts/git-runtime-check.mjs +1 -1
  27. package/payload/shared/scripts/knowledge-snapshot-query.mjs +1 -1
  28. package/payload/shared/scripts/{load-B9zD0DAZ.mjs → load-B1XGiCBF.mjs} +1 -1
  29. package/payload/shared/scripts/{panel-preview-CE8w39XL.mjs → panel-preview-DvQDHmsY.mjs} +2 -2
  30. package/payload/shared/scripts/{server-DWGjbv7N.mjs → server-DZXeZst5.mjs} +3876 -2776
  31. package/payload/shared/scripts/{studio-content-archive-DmZ57yxv.mjs → studio-content-archive-DbDtTp62.mjs} +3 -3
  32. package/payload/shared/scripts/{studio-instance-composition-BONpvYpU.mjs → studio-instance-composition-CweJdRME.mjs} +2 -2
  33. package/payload/shared/scripts/{studio-instances-B_x9lgOw.mjs → studio-instances-BU8X5uCA.mjs} +2 -2
  34. package/payload/shared/scripts/{studio-panel-drafts-mDQAikiO.mjs → studio-panel-drafts-5X-jpPZ-.mjs} +3 -3
  35. package/payload/shared/scripts/{windows-private-storage-C0NrKMtt.mjs → windows-private-storage-lAQSj037.mjs} +1 -1
  36. package/payload/shared/scripts/workbuddy-panel-service.mjs +65 -18
  37. package/payload/shared/web/client.js +47652 -47475
  38. package/release-manifest.json +42 -41
  39. package/payload/shared/scripts/{windows-private-storage-1S6Keug-.mjs → windows-private-storage-Coy_k4ND.mjs} +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Yugoo Design Companion — beta
2
2
 
3
- Package: `@yugoo-design/companion@0.1.0-beta.11`.
3
+ Package: `@yugoo-design/companion@0.1.0-beta.13`.
4
4
 
5
5
  Yugoo Design (语构设计系统) is an interactive design plugin for native Agent Hosts.
6
6
  It combines domain methods, Design Projects, versioned Design Files and shared
@@ -21,7 +21,7 @@ selected beta to the exact version and integrity before acquisition; keep the
21
21
  previous installed version available during updates. Do not substitute `latest`.
22
22
 
23
23
  ```sh
24
- ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.11 --registry=https://registry.npmjs.org
24
+ ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.13 --registry=https://registry.npmjs.org
25
25
  npx --no-install design-system --help
26
26
  ```
27
27
 
@@ -38,7 +38,7 @@ allowBuilds:
38
38
  ```
39
39
 
40
40
  ```sh
41
- ONNXRUNTIME_NODE_INSTALL_CUDA=skip pnpm add --save-exact @yugoo-design/companion@0.1.0-beta.11 --registry=https://registry.npmjs.org
41
+ ONNXRUNTIME_NODE_INSTALL_CUDA=skip pnpm add --save-exact @yugoo-design/companion@0.1.0-beta.13 --registry=https://registry.npmjs.org
42
42
  pnpm exec design-system --help
43
43
  ```
44
44
 
@@ -86,7 +86,7 @@ process value:
86
86
  $previousOrtCuda = [Environment]::GetEnvironmentVariable('ONNXRUNTIME_NODE_INSTALL_CUDA', 'Process')
87
87
  try {
88
88
  $env:ONNXRUNTIME_NODE_INSTALL_CUDA = 'skip'
89
- npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.11 --registry=https://registry.npmjs.org
89
+ npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.13 --registry=https://registry.npmjs.org
90
90
  } finally {
91
91
  [Environment]::SetEnvironmentVariable('ONNXRUNTIME_NODE_INSTALL_CUDA', $previousOrtCuda, 'Process')
92
92
  }
@@ -108,14 +108,18 @@ to an already published package. Users do not install DSH and Companion separate
108
108
  | WorkBuddy | `install --host workbuddy`: prepare the stable marketplace and plugin; import or update and enable through the host. |
109
109
  | DSH | `install --host dsh`: run the existing plan/apply transaction with the bound aggregate, official CLI/Loader and an explicitly selected existing profile. |
110
110
 
111
- For a fresh WorkBuddy installation, use native suite `0.3.24` with
112
- `--suite-version 0.3.24`, the verified Node executable and a persistent external
111
+ For a fresh WorkBuddy installation, use native suite `0.3.26` with
112
+ `--suite-version 0.3.26`, the verified Node executable and a persistent external
113
113
  preparation destination. Import the returned `nativeImport.market` directory and
114
114
  enable its `yugoo-design` plugin. The fresh market is also named `yugoo-design`;
115
115
  no previous test market or preparation receipt is required. An owned update with
116
116
  `--previous-receipt` retains its original market name and directory, including
117
117
  historical test markets, rather than migrating a registered installation.
118
118
 
119
+ For QwenWork, use native suite `0.1.2` with `--suite-version 0.1.2`.
120
+ Its suite version advances independently of the WorkBuddy suite and Companion
121
+ npm version; desktop preparation writes that explicit version into the import.
122
+
119
123
  Supply the required host inputs shown by `design-system --help`. Without a host,
120
124
  the entry returns `host-selection-required`; missing inputs return
121
125
  `inputs-required`, both with exit code 2 and no installation attempted. The
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugoo-design/companion",
3
- "version": "0.1.0-beta.11",
3
+ "version": "0.1.0-beta.13",
4
4
  "description": "Yugoo Design Companion beta: interactive Design Projects and Panels in supported native Agent Hosts.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -5,6 +5,9 @@ description: Open and use Yugoo Design in this WorkBuddy conversation with a bro
5
5
 
6
6
  Use this Skill for an authorized Design task in the current WorkBuddy conversation.
7
7
  The user starts WorkBuddy normally; never create a host launcher or another model client.
8
+ For the main U/S/T and conditional background review protocols, read the installed
9
+ [native execution reference](native-execution.md). The WorkBuddy placement limits
10
+ below still apply: foreground Producers remain serial and Workers are unsupported.
8
11
 
9
12
  1. Obtain this conversation's exact `sessionId`, `nativeCwd` and `transcriptPath` from its current
10
13
  `YUGOO_WORKBUDDY_IDENTITY_PROBE` Hook context. This is routing evidence, not task
@@ -119,20 +122,67 @@ The user starts WorkBuddy normally; never create a host launcher or another mode
119
122
  validation still needs repair after return, resume the same Agent; do not
120
123
  repair its files in main or call its work complete based on a text response.
121
124
  Never use background mode for a foreground Producer.
122
- Workers/nested delegation and GRA are unavailable in this preview. Execute the
123
- Producer serially; never change a subagent Bundle to main mode or substitute
125
+ Workers/nested delegation remain unavailable. Background GRA requires the
126
+ current-service readiness proof described below; it does not enable Workers.
127
+ Execute the Producer serially; never change a subagent Bundle to main mode or substitute
124
128
  another model/CLI. Failed binding or absent native Agent/resume support is a
125
129
  real error, not permission to bypass the guard.
126
130
  5. The shared Panel validates and saves before notification. After a user-authorized
127
131
  save notice, read `design_status` once using its exact connection and read the
128
132
  canonical saved state. Confirm the actual answers; never reapply saved edits.
133
+ In the actual main continuation turn, call `design_main_context` for the current
134
+ exact U/S/T input and shared rubric. Reuse a current assessment; otherwise
135
+ assess the saved facts in main and call `report_design_clarity` with that exact
136
+ input before the final reply or next Design recommendation. Report at most once
137
+ per real user turn; a new save, Kit or user interjection requires fresh context,
138
+ not relabeling old scores. A background review cannot substitute for this main
139
+ report. Missing verified native history means unavailable, not a made-up score.
129
140
  If the widget is closed or the original conversation changes, notification may
130
141
  fail while files remain saved. Explain this and preserve the existing project;
131
142
  do not blindly repeat a send or create another project.
132
143
 
133
144
  KAG uses the shared local implementation and exposes actual status; report failures
134
- honestly. Serial native Producer bootstrap/resume and publication have a separate
135
- acceptance boundary from Workers and background GRA, which remain disabled. An interface
145
+ honestly. Successful saves already admit indexing. Use `design_knowledge_context`
146
+ and `design_query_knowledge` only when useful, retaining exact project/checkpoint/
147
+ revision pins and checking source facts; indexing never blocks save acknowledgement.
148
+
149
+ For GRA, immediately read `design_status.hostCapabilities` before any real review.
150
+ Only `backgroundReviewReadiness: ready` and `backgroundReviews: true` permit
151
+ dispatch. WorkBuddy 5.8.3's public `Agent(run_in_background=true)` can fall back
152
+ to synchronous execution when native background capability is disabled. Do not
153
+ probe it with a real review prompt. Unverified readiness keeps requests pending;
154
+ use the returned content-free `backgroundReviewProtocol.bootstrap` only when
155
+ `canAttemptReadiness` is true, as one explicit readiness check, then read status
156
+ again. When false, inspect the existing result and reported reason; do not launch
157
+ another probe. A missing native transport observation does not prove synchronous
158
+ execution; a verified synchronous child result cannot prove background readiness.
159
+ Do not change Host settings or repeat an uncertain probe. Proof must be newer than this exact Companion connection
160
+ opening; a historical descriptor from the same session is insufficient.
161
+
162
+ If setup is missing, WorkBuddy 5.8.3's Chinese desktop exposes avatar → 设置 →
163
+ 智能体 → 智能体团队管理 → 开启. Ask the user to inspect it and decide whether to
164
+ enable native multi-agent collaboration; never change Host settings or an expert
165
+ manifest yourself. Do not infer the current value from the startup default or a
166
+ synchronous fallback. The switch alone is not a verified background launch, and
167
+ this guide does not require a full Host restart. After normal plugin activation
168
+ or user-controlled setup, use the exact new conversation/connection and its
169
+ actual readiness contract. Foreground design, KAG and main U/S/T remain available
170
+ independently of GRA readiness.
171
+
172
+ When ready, honor the project GRA policy (`off` forbids automatic review) and reuse
173
+ the exact `dispatch:true` prepared IDs. Follow the installed native execution
174
+ reference: launch independent read-only native background reviewers, bind actual
175
+ structured task IDs with `design_bind_reviews`, and let each child read its own
176
+ `design_read_review` prompt/schema and submit through `design_submit_review`.
177
+ Review only the request's committed snapshot through `design_git_read`; keep its
178
+ checkpoint on every page, and do not edit Design Files or execute advice. Producer
179
+ write/command instructions above are not reviewer permissions. A synchronous
180
+ `lastId` result, teammate name or assistant assertion is not a background handle.
181
+ The server checks the descriptor against the actual parent Agent call; native
182
+ `TaskOutput(task_id, block=false)` structured receipts establish terminal state.
183
+ Unknown/externalized status stays unknown. Do not poll, wait for reviews, or block
184
+ the user's task. Serial Producer, conditional background GRA and unsupported
185
+ Workers retain separate acceptance boundaries. An interface
136
186
  receipt is not proof that the agent consumed a message; actual readback is required.
137
187
 
138
188
  Conversation history uses the exact Hook transcript path, verified session and cwd.
@@ -5,8 +5,9 @@
5
5
  "LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
6
6
  "NOTICE": "6b4eec391144fcbd96ec7b45a28764ab1932722a96325248377c3e28aac2c62d",
7
7
  "THIRD_PARTY_NOTICES.md": "bfcab921c6c15ccc47f9b1a6cc5941675c95962de5ea5b0edc50fbfa2aef136a",
8
- "hosts/workbuddy/design-SKILL.md": "3b7f3c2bbd4b0bd7262b83ddbfd7249f01453842bd1d3d88692a41de65acebda",
9
- "qwenwork-package.mjs": "ae340c245feb2beab0de9e02c09b37d9924fa0d6fe9f3dd1c329242e4a350c11",
8
+ "hosts/workbuddy/design-SKILL.md": "6f49c7d62a658c86a679dfeff486c9edf11c83095c17d6290ee03ccc933020a6",
9
+ "plugin/design-system/skills/design-panel/native-execution.md": "daa9696fef481bd9da827aba963ee4296eb288d8f72c56494fcc670e29f0e86c",
10
+ "qwenwork-package.mjs": "b43c2e9a7c3476497a3c81e143d36059cf0ce9509536aa882635cb370f2413db",
10
11
  "qwenwork-template/.claude-plugin/plugin.json": "7beaf01908b62b4ad6c0a371f09b45cb3236f622910c3769f8b3393e4cacb354",
11
12
  "qwenwork-template/.mcp.json": "931fdcd8efa8e0cfe1dbdda225c523d62dbc4bacb5a33d01eebe84933b712353",
12
13
  "qwenwork-template/LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
@@ -22,7 +23,7 @@
22
23
  "qwenwork-template/scripts/windows-private-storage.mjs": "27c3eb052278f0cb2850326e1d0864cfd2f3f6d2b1975ec7c24535ef6251ac94",
23
24
  "qwenwork-template/skills/design-component/SKILL.md": "85a1f2a016174787226eaa9e9e6675e86057212d322a65014edd71f3e4861b34",
24
25
  "qwenwork-template/skills/yugoo/SKILL.md": "3aedb6739f204c9931cf1d406e5a71d59fc3424875746ee5737e68e5a58236bc",
25
- "qwenwork-template/skills/yugoo/native-execution.md": "c23d1840c2557a4bdc9442edb3e6b488e1acb4dfb564b966e123c105710ec849",
26
+ "qwenwork-template/skills/yugoo/native-execution.md": "b4cbc2e7621ac8c9a89ad58f05f9a46b3b3ae241b290e7386728cb1a4aa2a8b2",
26
27
  "src/browser-access.mjs": "4b64284b9bfaaa32c8502ab00febdda4f8a972f4b41e822d4e708b27e7e3efdf",
27
28
  "src/native-hook-transport.mjs": "a5878335c40bc930d28d34e079de09f7628dc0cbcc828a1309826c1829640a83",
28
29
  "src/qwenwork-connection.mjs": "850b95ea4f57ccf4e1cb6463f98625b941d74f4df76bc24f05dbdf15b8597b3a",
@@ -30,12 +31,12 @@
30
31
  "src/windows-native-platform.mjs": "57ac50c9a8cc0371597d6d40e3efe4cbe2a470e98f75f0229721c7d5a48e7e98",
31
32
  "src/windows-private-storage.mjs": "27c3eb052278f0cb2850326e1d0864cfd2f3f6d2b1975ec7c24535ef6251ac94",
32
33
  "src/workbuddy-context-probe.mjs": "1553e01ab95d7d9f2099806a7af5dd76cab856bd5fe8483b29c4cd8f7d30bff8",
33
- "src/workbuddy-mcp-relay.mjs": "5a9fc1d8ef5acb90c471e9405c53591b9e94c8fb7b60d6e43a45f6ce48567d46",
34
+ "src/workbuddy-mcp-relay.mjs": "92a30918792f5d4543a7c94e2d86446e7df4069f8ce26fe20b9439dad7b30286",
34
35
  "src/workbuddy-message-probe.mjs": "9366d0ebc8c4133c8d3c4acb793c0319b9f6bb4a123381bd2d83f6ecb6275101",
35
36
  "src/workbuddy-panel-mcp.mjs": "55accb55244f86e86d9f36e445e450fedba47e7bce80cacd2ceb6327a14b99ef",
36
- "src/workbuddy-relay-probe.mjs": "ea20a6f03a9fe661990c10da0bf5b2431f784f3724a9827a250c84f480159e69",
37
+ "src/workbuddy-relay-probe.mjs": "c5ea46abadbf9dfe265eb40eb81ed08a4f6596dd5f673fd248843e7775160cc4",
37
38
  "src/workbuddy-relay-service.mjs": "44d60d6956250417507fb76c71c3030a01bc38e565e4572a761b46f255f8e669",
38
39
  "src/workbuddy-ui-probes.mjs": "a91d4651248125769254755bdf66a44bbc9e5a793dad0a137c35acbb10a89a88",
39
- "workbuddy-package.mjs": "1abed6c01af4a27e025e7cfb6079dc7d36a18ef90871a54ba5f88837f95f93ea"
40
+ "workbuddy-package.mjs": "9ec792fd0c56ccfe76a3cbf6215b38999677b7ce761ab2f9a95698684d6995ca"
40
41
  }
41
42
  }
@@ -0,0 +1,435 @@
1
+ # Native Design execution
2
+
3
+ The native Host owns spawning, concurrency, messages, cancellation and permissions. The
4
+ companion owns Design Files, Panels and the existing validation/Git/journal path.
5
+ Do not invoke a second model client, CLI process or app-server to simulate children;
6
+ for example, a second `codex exec`/`resume` is not native Codex delegation.
7
+ If native delegation is unavailable, report the limitation rather than claim
8
+ fanout succeeded. The Producer may perform the scoped artifact work itself.
9
+
10
+ ## Common bridge
11
+
12
+ `serve` prints a private `connection` file path. Keep it inside the local task
13
+ context; do not print its contents or include its token in a shared artifact.
14
+ Prefer the plugin's MCP tools. Pass `connection` as that exact file path on each
15
+ call; no temporary request file or shell process is needed. Do not infer the
16
+ calling child's identity from the connection, which belongs to the main session.
17
+
18
+ | Existing operation | MCP tool |
19
+ | --- | --- |
20
+
21
+ | `prepareBundle` | `design_prepare_bundle` |
22
+ | `registerNativeRun` | `design_register_run` |
23
+ | `finishNativeRun` | `design_finish_run` |
24
+ | `focusArtifact` | `design_focus_artifact` |
25
+ | `prepareReview`, `bindReviewRun`, `submitReview` | `design_prepare_review`, `design_bind_review`, `design_submit_review` |
26
+ | `prepareReviews`, `readReview`, `bindReviewRuns` | `design_prepare_reviews`, `design_read_review`, `design_bind_reviews` |
27
+ | `claimReviewAction`, `settleReviewAction` | `design_claim_action`, `design_settle_action` |
28
+ | `mainContext`, `reportMainClarity` | `design_main_context`, `report_design_clarity` |
29
+
30
+ ### Main U/S/T after saved output
31
+
32
+ At a meaningful saved Design output boundary, including the actual continuation
33
+ turn after Panel Save and continue, call `design_main_context`. It returns the
34
+ latest exact `input`, shared assessment method, current score and KAG status.
35
+ Use a current score; otherwise assess the saved facts against the agreed user
36
+ scope in this main conversation and call `report_design_clarity` with that exact
37
+ input before a final reply or next Design recommendation. The service verifies
38
+ the real native main call and records at most one new report per actual user
39
+ turn. An identical retry retains the original audit provenance. A newer save,
40
+ Kit change or user interjection invalidates old inputs: read context again,
41
+ never relabel old reasoning. If the current turn already reported, await a real
42
+ new user boundary before creating a different report. Missing verified native
43
+ history means unavailable assessment, not a fabricated turn or score.
44
+
45
+ This main report uses the existing Journal and clarity authority. It neither
46
+ runs a second evaluator nor waits for background GRA. U/S/T identifies useful
47
+ evidence gaps; it does not override explicit user work or impose mandatory
48
+ stages. KAG is derived discovery: successful saves already admit maintenance,
49
+ and pending indexing never gates the save acknowledgement or ordinary design.
50
+
51
+ ### Serial artifact focus
52
+
53
+ Before the main Agent or an existing native Producer begins work on one
54
+ artifact, call `design_focus_artifact` with the exact connection and either
55
+ `invocationId` from `design_begin_main_bundle` or the Producer's registered
56
+ `runId`. Supply `artifact_kind`, `artifact_id` and `artifact_file` together.
57
+ Keep the stable ID/path/kind identical when returning to the same target. For
58
+ example, after starting a Research main invocation:
59
+
60
+ ```json
61
+ {
62
+ "connection": "/exact/private/connection.json",
63
+ "invocationId": "<invocationId returned by design_begin_main_bundle>",
64
+ "artifact_kind": "direction",
65
+ "artifact_id": "R-001/D-001",
66
+ "artifact_file": "research/R-001/D-001.md"
67
+ }
68
+ ```
69
+
70
+ Replace the illustrative connection and invocation values with actual returned
71
+ values. For Producer execution, replace `invocationId` with its actual `runId`;
72
+ never register the main Agent as a Producer. The generic Companion CLI `call`
73
+ operation exposes the same bridge method `focusArtifact` with camel-case
74
+ `artifactKind`, `artifactId`, `artifactFile`. This only associates observed native
75
+ activity; it creates no artifact, attempt, agent or acceptance receipt. Canonical
76
+ Bundle JSON, other Bundle paths, settled invocations and Worker owners are rejected.
77
+
78
+ Workspace `artifactActivities` carries the actual native executor and a
79
+ `logTarget`. Pass its `artifactId` and optional main `invocationId` with the
80
+ actual `runId` to `readExecutionLog`. Only rows after focus and before the next
81
+ target switch or Bundle settlement are returned. Returning to a target aggregates
82
+ its separate segments. Earlier main conversation history is not artifact work.
83
+ Rows already evicted by the bounded native observer are marked truncated;
84
+ unavailable or invalid native logs produce unavailable activity, never completion.
85
+ Native status and published artifact availability remain independent facts.
86
+
87
+
88
+ Parameters below are unchanged apart from the additional `connection` path.
89
+ Use `design_status` for a compact execution/clarity/handoff read when needed,
90
+ not as a polling loop. Keep large artifacts in files with native filesystem tools.
91
+
92
+ If MCP tools are unavailable in this host/session, report that limitation and
93
+ use the existing CLI fallback: write a small request JSON outside `design_files`, then call:
94
+
95
+ ```sh
96
+ node /absolute/plugin-root/scripts/design.mjs call \
97
+ --connection /absolute/connection.json --request /absolute/request.json
98
+ ```
99
+
100
+ Requests have `{ "method": "operation", "params": { ... } }` shape. This local
101
+ bridge does not dispatch agents. Use native spawning tools for that operation.
102
+ The common operations below are available only while this companion is running.
103
+
104
+ ## Producer
105
+
106
+ `prepareBundle` also returns shared `cooperationMethod`, `workerMethod` and
107
+ `knowledgeMethod` guidance. Apply cooperationMethod and knowledgeMethod in the
108
+ Bundle executor, whether main or Producer. Forward workerMethod and
109
+ knowledgeMethod along with a bounded task/evidence brief to native Workers.
110
+ Source locators and relevant excerpts avoid blanket rereads; exact assets and
111
+ validator inputs remain file-backed. Query KAG only when useful to the task,
112
+ passing actual returned pins to children; missing capability/pins fall back to
113
+ source files without blocking. These fields do not change native permissions.
114
+
115
+ Execution placement comes from `prepareBundle.execution.mode`: `subagent`
116
+ (also the default for older manifests) creates a native Producer; `main` runs
117
+ the same Bundle method in this conversation. Worker fanout is a separate Bundle
118
+ decision, not a consequence of this mode. Do not silently substitute a mode when
119
+ the host cannot support it.
120
+
121
+ For `main`, call `beginMainBundle` (`design_begin_main_bundle`) with the skill.
122
+ Keep its exact `invocationId`; this is a Bundle invocation, **not** a native run
123
+ ID. Read the returned method/resources yourself, maintain canonical JSON and
124
+ perform the same validation. Call `finishMainBundle`
125
+ (`design_finish_main_bundle`) with that invocation ID and the same scope/outcome
126
+ described below. Correct validation failures here before retrying settlement.
127
+ Cancel/wait for any Workers before settling; a new main Bundle cannot start until
128
+ the current one is settled. Never register the main Agent as a Producer child.
129
+ Completing the Bundle does not end the main conversation. A focused main artifact
130
+ uses its actual conversation observer and bounded target segments; no Producer
131
+ rolling log or attempt is fabricated. Real Workers retain ordinary status and logs.
132
+
133
+ The following child-registration steps apply to `subagent` mode:
134
+
135
+ 1. Request `prepareBundle` with `{ "skill": "page_design" }` (the selected
136
+ Bundle name, not a fixed Page default). Read the returned Bundle method,
137
+ referenced artifact contract and the applicable Mindset. Pass a bounded user
138
+ task, exact returned resource paths and the same project context to a native
139
+ Producer child. The parent owns registration; the child does not scan sessions
140
+ or rediscover the installed Bundle. A not-yet-created output directory is normal.
141
+ 2. Register that child using `registerNativeRun`: `role: "producer"`, `skill`,
142
+ `artifactId` (Bundle name for its root), and exact native `runId`. For `host=codex` only,
143
+ an exact `launchCallId` or uniquely recorded `agentPath` from native spawn can
144
+ be supplied instead. The adapter resolves paths inside the bound host session
145
+ storage; do not search or print session metadata. Parent defaults to the main
146
+ conversation; a Worker of a Producer must supply its real Producer parent ID.
147
+ Explicit `transcriptPath` (and Qoder `taskPath`) remain supported. Native
148
+ metadata must prove the parent/child relationship and the native cwd supplied
149
+ to `serve --host-cwd` (not necessarily the Design Project root). Never
150
+ select a newest log or fabricate IDs. If metadata is not yet written,
151
+ register after it becomes available; don't respawn a duplicate child.
152
+ 3. The Producer maintains canonical JSON, preserves user edits and coordinates
153
+ artifacts. Workers can write distinct artifacts; only the Producer edits
154
+ the shared JSON. Producer takeover remains available. A missing reference
155
+ means planned, not completed; do not insert execution statuses into JSON.
156
+ 4. On child completion or an intentional user handoff, call `finishNativeRun`
157
+ with its `runId` and `scope: "completion"` or `scope: "state"` respectively.
158
+ This reads files directly, runs shared validation, and uses the existing
159
+ Bundle Git publication path. Fix actionable diagnostics in the generator.
160
+ On failure/cancellation call it with `outcome: "failed"`/`"cancelled"` to
161
+ audit existing facts; Git cadence does not depend on design success.
162
+
163
+ Native terminal events, not this bridge call, drive execution indicators. Panel
164
+ content is read from files even before settlement. If the Producer forgot the
165
+ settlement call, the parent performs it once; don't rerun generation just to
166
+ obtain a publication tool call.
167
+
168
+ ## Worker
169
+
170
+ For independent artifacts, follow the Bundle's delegation method. The native
171
+ parent is the Producer in `subagent` mode or the main Agent in `main` mode.
172
+ Give each Worker the artifact contract, its concrete task, existing shared
173
+ design inputs and exact `artifact_id`, `artifact_kind`, `artifact_file` from
174
+ the Bundle. No additional task schema is required in `skill.yaml`.
175
+
176
+ Register each actual child with `registerNativeRun`, `role: "worker"`, its
177
+ native `runId`, Producer `parentRunId`, exact native `transcriptPath`, `skill`,
178
+ `artifactId`, `artifactKind`, `artifactFile`. This maps native events/logs to the
179
+ correct entity and round. Do not reuse one child's identity for several files.
180
+ When the parent is the main Agent, supply its actual `parentRunId` and the exact
181
+ `invocationId` returned by `beginMainBundle` as well. Do not invent an intermediate
182
+ Producer. The main Agent then performs the same JSON integration duties below.
183
+
184
+ Workers write artifacts directly in `design_files`, use Bundle file-oriented
185
+ scripts for required layout/validation and repair diagnostics before returning.
186
+ Return only the path and compact validation result, not the complete HTML/XML.
187
+ The optional `finishNativeRun` call returns a compact file receipt. The Producer
188
+ updates canonical references as each Worker finishes, without waiting for the
189
+ remaining Workers. All workers must finish or be cancelled before the Producer
190
+ settles its Bundle. Do not hide failure by substituting another file.
191
+
192
+ ## Mapping existing Bundle tool terminology
193
+
194
+ | Bundle operation | Native Host operation |
195
+ | --- | --- |
196
+ | `design_delegate` | Native child spawn, followed by exact run/target registration |
197
+ | `read_skill_resource` | Read the referenced file under returned Bundle resources |
198
+ | `list`, `read`, `write`, `edit` and worker artifact tools | Native filesystem tools on the same Design Files project |
199
+ | `run_skill_script` | Native shell, run the actual Bundle script with its documented file-path arguments; use Design Files as cwd |
200
+ | `design_validate` | Packaged `validate --project … --skill … --scope …` |
201
+ | `design_publish`, `design_finish` | `finishNativeRun` for a Producer, `finishMainBundle` for main execution; state scope preserves the same handoff |
202
+
203
+ These mappings adapt execution, not the Bundle's schema, generation method or
204
+ validation criteria. Native permissions remain authoritative. Never disable
205
+ approvals or install dependencies silently to make a task pass.
206
+
207
+ ## Background GRA and U/S/T
208
+
209
+ ### Shared Design KAG
210
+
211
+ All Bundles can use the same stored graph; it is not a required preliminary
212
+ workflow. When a task needs cross-file evidence, `design_knowledge_context`
213
+ returns availability, a bounded starting context and the shared reading method.
214
+ Use `design_query_knowledge` for more: preserve its exact `project`, `checkpoint`
215
+ and `revision` pins, select source files or original entity IDs, then traverse
216
+ one-hop `incidentTo` neighborhoods with `direction` and optional `relationTypes`.
217
+ Pagination must retain the same filters. Read the referenced files to verify
218
+ facts; similarity is a candidate, and isolation or partial search is not proof
219
+ of a missing design. If pins become stale, restart the bounded investigation
220
+ from a new context rather than mixing versions. Unavailable graph access does
221
+ not block normal source-file work or authorize repeated retries.
222
+
223
+ The packaged local embedding runtime uses cached model weights by default. If
224
+ weights are missing, file projection still works and semantic coverage reports
225
+ an error, not completion. With the user's agreement to download model weights,
226
+ start Companion with `--allow-embedding-download`; text remains local. Use
227
+ `--disable-embedding` for structural-only operation. Do not silently change to
228
+ a cloud embedding endpoint. Packages include native inference dependencies for
229
+ their recorded build platform/architecture, not every operating system.
230
+
231
+ GRA's existing result may include evidence-backed relationships or justified
232
+ retractions of its own prior relationships; it does not edit Design Files.
233
+ Use exact IDs and the supplied output schema. Empty results do not clear graph
234
+ state. A negative search conclusion belongs to that review's checked scope and
235
+ file revision, not an enduring “missing” fact; reassess after source changes.
236
+ Clarity reads evidence but does not maintain relationships. Service-managed
237
+ reviewers receive a fixed read replica and read-only query helper when available;
238
+ they must not contact the main session or use its MCP connection.
239
+
240
+ First honor the current host's execution capability: if `design_status` reports
241
+ `hostCapabilities.backgroundReviews: false` or `reviewDispatchOwner: "unavailable"`,
242
+ do not prepare, spawn, bind or recheck reviews. Keep the existing requests/results
243
+ and explain the capability gap without changing the user's review policy. A Hook
244
+ notification and a synchronous Agent call do not establish background execution.
245
+ Clarity is a separate assessment capability; unavailable evaluation must not be
246
+ reported as a current score or as successful GRA. Continue the authorized
247
+ foreground task. The launch instructions below require available native
248
+ background execution as well as an exact `dispatch:true` reference.
249
+
250
+ For WorkBuddy, read `design_status.hostCapabilities` immediately before any real
251
+ review dispatch. Its `backgroundReviewReadiness` must be `ready`; the public
252
+ `backgroundReviewProtocol` alone does not prove capability. WorkBuddy 5.8.3 can
253
+ silently execute `Agent(run_in_background=true)` synchronously when background
254
+ capability is disabled. Never use a real review prompt to test this. With
255
+ unverified readiness, keep reviews pending and explain the normal Host capability
256
+ gap. The protocol includes a content-free readiness bootstrap that may be run
257
+ explicitly; it returns immediately without reading files, using tools or
258
+ assessing Design. Read status again afterwards. Do not change private Host
259
+ settings or automatically repeat the probe. Only a native descriptor created
260
+ after this exact Companion connection opened proves readiness; an old descriptor
261
+ in the same session is insufficient after restart.
262
+
263
+ Once ready and given an exact prepared review reference, use the ordinary native
264
+ `Agent` tool with `run_in_background=true`. Bind its structured `subAgent.sessionId`
265
+ task ID and exact background descriptor to that review; never use a teammate name,
266
+ assistant text, synchronous `lastId` result or a guessed log. The adapter verifies
267
+ the actual parent call, session, cwd and child path. Spawn RPC completion proves
268
+ only launch, not review completion. WorkBuddy's `TaskOutput(task_id, block=false)`
269
+ structured `agent-output` receipt supplies native status. Externalized/missing
270
+ status or newer unbound child activity remains unknown. Do not follow paths in
271
+ tool text, busy-poll, wait for review completion or block the main user task.
272
+
273
+ QwenWork has a separate native background contract. Read its current
274
+ `hostCapabilities.backgroundReviewReadiness` and `backgroundReviewProtocol`;
275
+ only `ready` permits real review dispatch. An explicitly requested content-free
276
+ bootstrap may establish readiness after this exact connection opened, but never
277
+ repeat it automatically or change Host settings. Its structured parent
278
+ `tool_result` must contain `isAsync: true` and `status: "async_launched"`, matched
279
+ to that exact native Agent call and the Host's task descriptor. A textual Agent
280
+ ID, synchronous fallback or older task is insufficient. Each actual review must
281
+ independently satisfy this proof when bound; bootstrap success is not a review
282
+ launch. Bind the actual native `agentId` as `runId`, plus its exact `taskPath` and
283
+ child `transcriptPath`. The QwenWork adapter observes native task status and
284
+ child evidence; do not copy WorkBuddy's version-1 descriptor or `TaskOutput`
285
+ contract, infer completion from the Agent RPC, busy-poll or wait in the foreground.
286
+ Unknown/unreadable native evidence remains unavailable. The installed-version
287
+ contract and limitations live in the QwenWork integration entry.
288
+
289
+ When `design_status` reports `reviewDispatchOwner: "companion"`, or preparation
290
+ returns `dispatchOwner: "companion"`, the service owns background review execution.
291
+ Do not prepare, spawn, bind, follow up, or wait for reviewer children. Continue the
292
+ user's design work; review results appear in the existing background area,
293
+ advisory queue and clarity score. The native-child instructions below apply only
294
+ when the main Agent owns dispatch. Enabling `serve --background-reviews` is an
295
+ explicit account-quota decision, not something to enable silently during setup.
296
+
297
+ Successful Panel saves and Bundle publications automatically admit KAG maintenance;
298
+ graph reads and Worker drafts do not trigger it. `design_status` also exposes the
299
+ project `reviewPolicy`: auto combines Agent initiative with a publication rule
300
+ after a configurable quiet window (default 30 seconds), continuous checks the
301
+ latest published checkpoint every configured N minutes even without file changes,
302
+ and off forbids autonomous GRA but still permits an
303
+ explicit human `design_recheck_reviews` request. Never change this user policy
304
+ yourself. Clarity is independent. In native-dispatch mode the rule queues a notice
305
+ with exact prepared review IDs; it does not itself spawn native children. Queue
306
+ acceptance is not execution, and uncertain delivery must not be blindly replayed.
307
+
308
+ Save/finish responses and `design_status` expose the same derived `reviews`
309
+ summary. It is a read-only reminder. `due` means evidence or
310
+ observed editing scope needs review; `prepared` means a request exists but is not
311
+ bound. Inspect/reuse it rather than blindly spawning a duplicate. `running` is
312
+ not a result; `unsubmitted`, `failed`, `interrupted` and `unavailable` require
313
+ inspection, not a claim that review passed or an automatic retry loop. Do not
314
+ poll in the main conversation or wait for reviews before continuing user work.
315
+
316
+ For useful Agent initiative in auto mode, use one
317
+ `prepareReviews` call, normally omitting `profiles`; it bypasses the rule's wait
318
+ and reuses current work. Do not mechanically call it after every save. In off
319
+ mode use `design_recheck_reviews` only for an explicit human request, with one
320
+ stable requestId across retries, without changing the policy. The service
321
+ considers all three GRA profiles and initial/stale
322
+ clarity, reusing current requests without dispatching duplicates. A paraphrased
323
+ context does not create a new default review. Explicit `profiles` remain for a
324
+ user-requested scoped reassessment or diagnostics, not arbitrary omission and
325
+ later catch-up rounds. These remain independent reviews, not one merged review.
326
+ Only entries with `dispatch:true` authorize a new launch in this batch. Reused
327
+ prepared requests require inspection of any prior launch before recovery; do not
328
+ spawn duplicates after an uncertain response. A batch shares preparation context,
329
+ not an immutable file snapshot: `revisionChanged:true` means do not dispatch it.
330
+ An explicit publication-rule notice is different: its exact requests deliberately
331
+ pin immutable historical Git commits. Read only that checkpoint, not live files;
332
+ historical results cannot become current advice, Clarity, or KAG observations.
333
+ WorkBuddy requests also pin committed evidence for Agent-initiated preparation;
334
+ follow each exact request's checkpoint and `design_git_read` pagination contract.
335
+ Pass `userContext` with the current user request, relevant requests to simplify
336
+ or defer, and concrete work still being edited. Do not invent user preferences.
337
+ Observed running targets are not exclusions: an Agent can still be alive after
338
+ settlement or resume after a pause. Review saved evidence and avoid judging
339
+ in-progress output as complete. Report any coverage limitation separately to the
340
+ parent; when that editing scope clears, check for a follow-up review even if the
341
+ file revision did not change.
342
+ The response supplies short request references. Reviewers use `readReview` with
343
+ their exact `reviewId` and `connection` to obtain the full prompt and schema;
344
+ the parent need not read or rewrite them. Do not dump Design Files into the parent.
345
+
346
+ Spawn independent native **background** review children from the main Agent.
347
+ Give each only its review ID, connection path and instructions to read its request
348
+ and submit its own structured result. Include that exact review ID literally in
349
+ the native Agent prompt. WorkBuddy and QwenWork verify both the current launch
350
+ boundary and this request assignment on first binding; an old task or READY
351
+ probe cannot become a new Reviewer, even when it belongs to the same session.
352
+ Exact already-bound historical evidence remains readable after reopening.
353
+ Launch independent children together when
354
+ the host supports it. Use one `bindReviewRuns` call with
355
+ `{bindings:[{reviewId,nativeRun},...]}` for the exact native launch results;
356
+ `nativeRun` can contain just the actual `runId` (or, for `host=codex` only, an exact launch reference
357
+ as above); the service fills paths and verifies native evidence. Do not send
358
+ reviewers to scan logs for their identity. Inspect per-entry errors: partial
359
+ success is possible, and successful bindings must not be relaunched. Never guess
360
+ the latest log path. The child reads the registered binding from `readReview`
361
+ before submission, eliminating a separate parent message carrying that binding.
362
+ It may read evidence while binding is pending. If still unbound when ready to
363
+ submit, report the pending binding and yield; do not poll or claim success.
364
+ If that same child has already yielded for binding (or ended without submitting),
365
+ after successful binding use one native follow-up/resume to tell it to read its
366
+ registered request and submit. Reuse the same child, not a new spawn. This is
367
+ recovery for an early finish, not a mandatory message for every running reviewer.
368
+ If the request is superseded or its revision changed, report that limitation;
369
+ do not present the old assessment as current. A reviewer
370
+ may handle another bounded profile or later revision with its own review ID and
371
+ schema; this does not reuse the previous result or grant editing authority.
372
+ Submit with `submitReview` params `{reviewId, nativeRun, result}`. The child may
373
+ read evidence while registration completes, but cannot publish before binding.
374
+ The single-review prepare/bind tools remain compatibility paths, not the default
375
+ multi-profile orchestration. Do not use them to reproduce four preparation rounds.
376
+ If a user save or message arrives during preparation, handle the user's work
377
+ first. Reconcile the existing requests at the next settled checkpoint, without
378
+ automatically completing the old batch or restarting it in the foreground.
379
+ Do not synchronously wait for GRA or treat review completion as a prerequisite
380
+ for foreground generation, user interaction, or a successful Bundle result.
381
+ Use native notifications for completion; no busy-loop polling or unbounded
382
+ self-respawning. A subsequent settled change can start the next bounded review.
383
+
384
+ The reviewers have no authority to edit Design Files or automatically accept
385
+ advice. Use `submitReview` for structured result publication, preserving the
386
+ exact review ID/native child binding. Errors return diagnostics for correction.
387
+ Do not force stale results onto newer project evidence. UI reads and polling
388
+ must never launch reviews. Native permission/cancellation remains with the Host.
389
+
390
+ GRA and U/S/T are distinct: U/S/T updates assessment; GRA contributes suggestions
391
+ to the shared advisory inbox. Only a real user acceptance dispatches a scoped
392
+ foreground action with the original exact action receipt. Queue acceptance is
393
+ not proof that the action started or completed.
394
+
395
+ For an accepted action in `main` mode, begin the exact target main Bundle and
396
+ claim it with `{receiptId, invocationId}` before editing. After file settlement,
397
+ use that same pair to settle the action; the main session need not end. A failed
398
+ claim grants no permission to execute the advisory.
399
+
400
+ For an accepted action in `subagent` mode, spawn the exact target Producer initially instructed to
401
+ wait before editing. Register its actual native identity, then call
402
+ `claimReviewAction` with `{receiptId, runId}`. Only after a successful claim send
403
+ the native Producer permission to begin this scoped action. After file settlement
404
+ via `finishNativeRun` and the native terminal event, call `settleReviewAction`
405
+ with `{receiptId, runId}`; the bridge derives the outcome, not the caller.
406
+ If claiming fails, cancel the waiting child and report the diagnostic. This is
407
+ workflow coordination, not a replacement for native host permissions.
408
+
409
+ ## Return control to the user
410
+
411
+ After the foreground Bundle settles, honor any already requested next task.
412
+ Otherwise briefly explain the result and, when a user choice is needed, offer
413
+ the most relevant next steps through the host's native question tool if it is
414
+ available in the current mode. Do not wait for GRA; use available evidence and
415
+ report unavailable clarity honestly. Ask about consequential choices, not routine
416
+ bookkeeping, and retain the option to adjust or stop.
417
+
418
+ If the native question tool is unavailable in this session/mode, do not omit the
419
+ next-step choice: ask one concise question in the main conversation with concrete
420
+ options and a short recommendation, including adjusting or stopping where useful.
421
+ A recommendation sentence alone is not a choice handoff: finish with an actual
422
+ question the user can answer, such as “继续梳理核心流程,还是先调整这些功能?”.
423
+ Do not invent a native question event from that prose, enable experimental host
424
+ features, or change collaboration mode to force a question tool to appear.
425
+ Use the tools actually exposed by the current host; a tool name in this document
426
+ does not make it callable. Do not switch modes or launch another host to manufacture a question
427
+ tool. The companion's message queue is not a native-question answer channel;
428
+ never present a queued message as an answer to a pending native question.
429
+
430
+ ## Development handoff and existing specs
431
+
432
+ When the user requests implementation or a development brief from a Design Project, use the selected project and the specified coding workspace; this is not a request to run another design Bundle. Confirm the actual project root, Kit pin and published design checkpoint with available host readers. Keep unpublished differences separate. Read only the records and artifacts relevant to the authorized task; KAG is a discovery aid, not a substitute for those originals, and unavailable or partial knowledge does not prevent reading the files.
433
+ Inspect the target repository's instructions and existing specs before proposing an output location. Recognize GitHub Spec Kit's specs/<feature>/spec.md, plan.md and tasks.md; OpenSpec's openspec/specs/<domain>/spec.md and openspec/changes/<change>/ proposal, spec deltas, design and tasks; and Kiro's .kiro/specs/<feature>/requirements.md, design.md and tasks.md. Preserve the actual repository's structure and responsibilities, including its current-spec versus proposed-change distinction. These paths are discovery hints, not permission to create every file or assume a framework is active. If several conventions coexist, follow the one governing this task; if none exists, propose an existing convention or an ordinary Markdown brief and resolve the location before writing. Do not install a framework or invent a Yugoo spec schema.
434
+ For the task-scoped brief, use ordinary Markdown links to the actual design source paths, relevant artifact paths and precise record IDs or JSON pointers, with the project, Kit pin and verified published checkpoint beside the links. Use relative links where the target workspace can resolve them; disclose external project paths instead of claiming they are portable. Do not invent a remote URL, copy all design artifacts, or treat a prototype, inference, score or unanswered field as a confirmed requirement. Organize the affected user behavior and scope, important exceptions and constraints, implementation tasks and observable acceptance criteria in the repository's existing requirement/design/task sections; keep design decisions, implementation proposals and unresolved product decisions distinct.
435
+ Produce the brief before coding when scope needs agreement. Existing user authorization carries forward; ask only about consequential unresolved scope or product decisions. Updating target specs or code requires that workspace's authorization, and this guidance grants none. Implement only the agreed slice and report checks actually run. For a design change, return the discrepancy to its owning Bundle's ordinary validation and publication route; after publication, update only affected spec links, tasks and acceptance criteria against the new checkpoint. Development specs and code do not write back to Design Files or silently become design authority. No second requirements store, automatic bidirectional synchronization or required full-project rewrite is introduced.
@@ -2,7 +2,7 @@
2
2
  import { readFile, writeFile } from 'node:fs/promises'
3
3
  import { join, win32 } from 'node:path'
4
4
  export function qwenWorkNativeExecutionReference(shared) {
5
- return '# QwenWork native execution\n\nRead SKILL.md for exact native task descriptor and user authorization requirements.\n\n' + shared.replaceAll('Codex', 'QwenWork').replace('`codex exec`', 'a native QwenWork agent')
5
+ return '# QwenWork native execution\n\nRead SKILL.md for exact native task descriptor and user authorization requirements. The shared reference below retains explicit host qualifiers: Codex-only launch references are not QwenWork parameters. Use the QwenWork background contract, never another Host\'s receipt format.\n\n' + shared
6
6
  }
7
7
  export function validateQwenWorkRuntime(value) {
8
8
  if (!value || !['executable', 'worker', 'nodeExecutable'].every(k => typeof value[k] === 'string' && win32.isAbsolute(value[k]) && !/[\r\n\0]/.test(value[k]))) throw Error('QwenWork requires explicit Windows executable, worker and Node paths.')