dsh-embedded-workbench 0.8.2 → 0.8.3

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Amethyst Luna
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amethyst Luna
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/lib/index.js CHANGED
@@ -1,197 +1,208 @@
1
- /**
2
- * embedded-workbench — DeepSeek Harness native plugin for the Embedded
3
- * Workbench toolbox. Injects the session-start gate text (1% Rule, Red
4
- * Flags, Plan Verification Gate, skills roster) into the first model step
5
- * of every agent session, mirroring the SessionStart hook the Claude Code
6
- * plugin installs. The 8 skills ship in this package's `skills/` directory
7
- * and are registered at apply time into dsh's `ctx.skills` registry through
8
- * the standard filesystem provider, so they appear in every session catalog
9
- * without a manual copy step.
10
- *
11
- * Injection listens on agent/pre-step and appends the gate to the FIRST
12
- * model step that runs, once per session (guarded by the session's durable
13
- * history). Session-start inbox injection was dropped: a blank-session preset
14
- * switch (agentPreset.select -> recompose) can clear the inbox before the
15
- * first step, losing the gate for the whole session. The pre-step decision is
16
- * the durable path - anchored/bootstrap presets that strip first-step injected
17
- * reminders (skill catalog, AGENTS.md, gate plugins) simply defer this message
18
- * to the first step after their promotion, and the history guard re-injects it
19
- * there. The default gate text is the dsh-native adaptation of
20
- * `hooks/session-start-content.md`: behavior rules
21
- * (1% Rule / Red Flags / Plan Verification Gate) stay in sync, while
22
- * presentation is adapted to dsh's native skill catalog — no roster table
23
- * (the model sees skills in its catalog) and no install instructions (those
24
- * live in `.dsh/INSTALL.md`). Deployments override via Config.
25
- *
26
- * @module embedded-workbench-dsh
27
- */
28
- import { fileURLToPath } from 'node:url';
29
- import z from '@deepseek-ai/schemastery';
30
- import { createUserMessage } from '@deepseek-ai/dsh-llm';
31
- import { FileSystemSkillProvider } from '@deepseek-ai/dsh-skill-filesystem';
32
- export const name = 'embedded-workbench';
33
- // Skills are contributed through the registry service, which dsh-base always
34
- // mounts before bundle rows such as this one apply.
35
- export const inject = ['skills'];
36
- // Absolute path of the package's shipped skills directory. `lib/index.js`
37
- // lives one level below the package root, so `../skills` from the module URL
38
- // lands on `<package>/skills` regardless of where the package was installed.
39
- const SKILLS_DIR = fileURLToPath(new URL('../skills', import.meta.url));
40
- const GATE_PLUGIN_ID = 'embedded-workbench';
41
- const DEFAULT_GATE_CONTENT = `<EXTREMELY_IMPORTANT>
42
- Plugin embedded-workbench is active. You have embedded C/C++ firmware development skills — names and "Use when" triggers are in your skill catalog; load them with the skill tool. No custom agents in dsh: use the native subagent tooling for parallel work.
43
-
44
- **1% Rule**: If there is even a 1% chance a skill applies to your task, invoke it before responding. If the skill turns out to be wrong for the situation, discard it and move on. The cost of loading a skill is trivial compared to the cost of a preventable mistake.
45
-
46
- **Red Flags** — if you think any of these, STOP. You are rationalizing:
47
-
48
- | You think | Reality |
49
- |-----------|---------|
50
- | "This is just a quick fix" | Quick fixes break things. A 3-line design check costs 30 seconds. |
51
- | "I already understand this code" | You are looking at one file. The blast radius may span 5 modules. |
52
- | "The skill is overkill for this" | Simple things become complex. Check for skills. |
53
- | "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
54
- | "I can just read the file directly" | Skills have patterns and pitfalls you will not discover by reading. |
55
- | "I remember this skill content" | Skills evolve. Always load the current version. |
56
- | "I've explored enough, time to exit plan mode" | The exit_plan_mode tool is the verification gate. Have you loaded the logicprobe skill — or, if it is not installed, the built-in fallback fact-check skill? Every plan must pass this gate before exit. |
57
- | "This plan is too simple for logicprobe" | logicprobe auto-classifies depth; the fallback fact-check verifies every claim regardless. You don't decide. |
58
- | "I already read the code, I know the file paths are correct" | Load the logicprobe skill or the fallback fact-check skill, verify each claim, append the "## Plan Verification" block. |
59
-
60
- **Plan Verification Gate**: Before calling exit_plan_mode (or presenting a plan for approval), load the logicprobe skill (a separate plugin) — or, if it is missing from your skill catalog, load the built-in fallback fact-check skill for claim-by-claim verification, tell the user that behavioral/model claims degrade to manual confirmation, and recommend installing logicprobe. If neither is loaded, inform the user "此计划未经核查,是否需要我先做事实核查?" Silent skip is not an option.
61
-
62
- To load workflows and engineering policies: load the embedded-workbench skill.
63
-
64
- **Proactive features**: When you see state machines, protocol refactoring, behavioral claims ("always"/"never"), or multi-module tasks — suggest verification (logicprobe, or the built-in fact-check fallback if logicprobe is not installed), adversarial probing, or parallel subagents BEFORE the user asks. Most users do not know these exist.
65
- </EXTREMELY_IMPORTANT>`;
66
- export const Config = z.object({
67
- enabled: z.boolean().default(true),
68
- gateContent: z.string().default(DEFAULT_GATE_CONTENT),
69
- });
70
- function gateMessage(text) {
71
- return createUserMessage({
72
- content: [{ type: 'text', text }],
73
- // `form` omitted — an undeclared context is the documented default.
74
- source: { kind: 'plugin', plugin: GATE_PLUGIN_ID },
75
- });
76
- }
77
- /**
78
- * Model-visible catalog entry (cordis_inspect_list / cordis_inspect_query):
79
- * lets the model read this plugin's runtime status without guessing. Mirrors
80
- * the registration pattern of the official dsh-tool-cordis host providers.
81
- */
82
- function inspectProvider(config) {
83
- return {
84
- manifest: {
85
- id: 'embedded-workbench',
86
- description: 'Session-start gate injection for the Embedded Workbench toolbox — folds the 1% Rule / Red Flags / Plan Verification Gate text into the first model step of every agent session.',
87
- methods: [
88
- {
89
- name: 'status',
90
- description: 'Read whether the gate injection is active and how large the injected gate text is.',
91
- inputSchema: {
92
- type: 'object',
93
- properties: {},
94
- additionalProperties: false,
95
- },
96
- outputSchema: {
97
- type: 'object',
98
- description: 'Gate-injection plugin status.',
99
- properties: {
100
- enabled: { type: 'boolean', description: 'Whether the gate folds into the first model step.' },
101
- gateContentLength: { type: 'integer', description: 'Length in characters of the injected gate text.' },
102
- },
103
- required: ['enabled', 'gateContentLength'],
104
- additionalProperties: false,
105
- },
106
- },
107
- ],
108
- },
109
- query: async (method) => {
110
- if (method === 'status') {
111
- return {
112
- enabled: config.enabled,
113
- gateContentLength: config.gateContent.length,
114
- };
115
- }
116
- return null;
117
- },
118
- };
119
- }
120
- export function apply(ctx, config) {
121
- // Catalog visibility is optional: register only when the inspect registry
122
- // service is mounted, so headless assemblies without it keep the gate
123
- // injection working. The registry may be provided AFTER this row applies
124
- // (base-bundle rows can mount later), so registration is retried on the
125
- // first agent/session-start — by then the app is fully booted.
126
- let providerRegistered = false;
127
- const registerProvider = () => {
128
- if (providerRegistered)
129
- return;
130
- const inspect = ctx.get('cordisInspect');
131
- if (inspect === undefined)
132
- return;
133
- try {
134
- ctx.effect(() => inspect.register(inspectProvider(config)), 'embedded-workbench: inspect provider');
135
- providerRegistered = true;
136
- }
137
- catch (err) {
138
- console.warn('[embedded-workbench] inspect provider registration failed', err);
139
- }
140
- };
141
- registerProvider();
142
- // Ship the bundled skills through the registry: reuse the standard
143
- // filesystem provider over this package's own `skills/` directory, so
144
- // catalog discovery, frontmatter parsing, and SKILL.md loading behave
145
- // exactly like project/user skills while the plugin stays self-contained.
146
- // Registration lands in the global registry layer (this row mounts at the
147
- // profile root), so every agent preset sees the skills. `registerProvider`
148
- // returns the effect disposer; its teardown unregisters and invalidates.
149
- ctx.skills.registerProvider((control) => {
150
- return new FileSystemSkillProvider(ctx, control, {
151
- providerName: 'embedded-workbench',
152
- includeDefaultRoots: false,
153
- customSkillDirs: [SKILLS_DIR],
154
- });
155
- });
156
- if (!config.enabled)
157
- return;
158
- // Inject the gate once per session on the FIRST model step that runs,
159
- // instead of at session-start: session-start injection lands in the agent's
160
- // inbox, which a blank-session preset switch (agentPreset.select ->
161
- // recompose) can clear before the first step - the gate would then be lost
162
- // for the whole session. The pre-step decision is the durable path a
163
- // first-step injection takes: the gate is appended to the first step's
164
- // decision and enters session history there, so every later step (and a
165
- // resume) skips it. Anchored/bootstrap presets that strip first-step
166
- // injected reminders (skill catalog, AGENTS.md, gate plugins) simply defer
167
- // this message to the first step after their promotion - the history guard
168
- // re-injects it there, so the gate still lands exactly once per session.
169
- ctx.on('agent/pre-step', async ({ agent }, next) => {
170
- const decision = await next();
171
- if (decision.kind === 'reject')
172
- return decision;
173
- registerProvider();
174
- if (gateInHistory(agent.session))
175
- return decision;
176
- return {
177
- kind: 'enter',
178
- messages: [...decision.messages, gateMessage(config.gateContent)],
179
- };
180
- });
181
- }
182
- /**
183
- * Whether the gate already entered this session's durable history. The
184
- * pre-step listener re-appends the gate until it does; once a step committed
185
- * it, every later step (and a resume of a session that kept it) skips the
186
- * injection. A session whose gate was dropped before any step ran (e.g. an
187
- * inbox cleared by a blank-session preset switch) simply re-injects on the
188
- * first step that runs.
189
- */
190
- function gateInHistory(session) {
191
- return session.events.some((event) => {
192
- if (event.type !== 'user/message')
193
- return false;
194
- const source = event.data.source;
195
- return source.kind === 'plugin' && source.plugin === GATE_PLUGIN_ID;
196
- });
197
- }
1
+ /**
2
+ * embedded-workbench — DeepSeek Harness native plugin for the Embedded
3
+ * Workbench toolbox. Injects the session-start gate text (1% Rule, Red
4
+ * Flags, Plan Verification Gate, skills roster) into the first model step
5
+ * of every agent session, mirroring the SessionStart hook the Claude Code
6
+ * plugin installs. The 8 skills ship in this package's `skills/` directory
7
+ * and are registered at apply time into dsh's `ctx.skills` registry through
8
+ * the standard filesystem provider, so they appear in every session catalog
9
+ * without a manual copy step.
10
+ *
11
+ * Injection listens on agent/pre-step and appends the gate to the FIRST
12
+ * model step that runs, once per session (guarded by the session's durable
13
+ * history). Session-start inbox injection was dropped: a blank-session preset
14
+ * switch (agentPreset.select -> recompose) can clear the inbox before the
15
+ * first step, losing the gate for the whole session. The pre-step decision is
16
+ * the durable path - anchored/bootstrap presets that strip first-step injected
17
+ * reminders (skill catalog, AGENTS.md, gate plugins) simply defer this message
18
+ * to the first step after their promotion, and the history guard re-injects it
19
+ * there. The default gate text is the dsh-native adaptation of
20
+ * `hooks/session-start-content.md`: behavior rules
21
+ * (1% Rule / Red Flags / Plan Verification Gate) stay in sync, while
22
+ * presentation is adapted to dsh's native skill catalog — no roster table
23
+ * (the model sees skills in its catalog) and no install instructions (those
24
+ * live in `.dsh/INSTALL.md`). Deployments override via Config.
25
+ *
26
+ * @module embedded-workbench-dsh
27
+ */
28
+ import { fileURLToPath } from 'node:url';
29
+ import z from '@deepseek-ai/schemastery';
30
+ import { createUserMessage } from '@deepseek-ai/dsh-llm';
31
+ import { FileSystemSkillProvider } from '@deepseek-ai/dsh-skill-filesystem';
32
+ export const name = 'embedded-workbench';
33
+ // Skills are contributed through the registry service, which dsh-base always
34
+ // mounts before bundle rows such as this one apply.
35
+ export const inject = ['skills'];
36
+ // Absolute path of the package's shipped skills directory. `lib/index.js`
37
+ // lives one level below the package root, so `../skills` from the module URL
38
+ // lands on `<package>/skills` regardless of where the package was installed.
39
+ const SKILLS_DIR = fileURLToPath(new URL('../skills', import.meta.url));
40
+ const GATE_PLUGIN_ID = 'embedded-workbench';
41
+ const DEFAULT_GATE_CONTENT = `<EXTREMELY_IMPORTANT>
42
+ Plugin embedded-workbench is active. You have embedded C/C++ firmware development skills — names and "Use when" triggers are in your skill catalog; load them with the skill tool. No custom agents in dsh: use the native subagent tooling for parallel work.
43
+
44
+ **1% Rule**: If there is even a 1% chance a skill applies to your task, invoke it before responding. If the skill turns out to be wrong for the situation, discard it and move on. The cost of loading a skill is trivial compared to the cost of a preventable mistake.
45
+
46
+ **Red Flags** — if you think any of these, STOP. You are rationalizing:
47
+
48
+ | You think | Reality |
49
+ |-----------|---------|
50
+ | "This is just a quick fix" | Quick fixes break things. A 3-line design check costs 30 seconds. |
51
+ | "I already understand this code" | You are looking at one file. The blast radius may span 5 modules. |
52
+ | "The skill is overkill for this" | Simple things become complex. Check for skills. |
53
+ | "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
54
+ | "I can just read the file directly" | Skills have patterns and pitfalls you will not discover by reading. |
55
+ | "I remember this skill content" | Skills evolve. Always load the current version. |
56
+ | "I've explored enough, time to exit plan mode" | The exit_plan_mode tool is the verification gate. Have you loaded the logicprobe skill — or, if it is not installed, the built-in fallback fact-check skill? Every plan must pass this gate before exit. |
57
+ | "This plan is too simple for logicprobe" | logicprobe auto-classifies depth; the fallback fact-check verifies every claim regardless. You don't decide. |
58
+ | "I already read the code, I know the file paths are correct" | Load the logicprobe skill or the fallback fact-check skill, verify each claim, append the "## Plan Verification" block. |
59
+
60
+ **Plan Verification Gate**: Before calling exit_plan_mode (or presenting a plan for approval), load the logicprobe skill (a separate plugin) — or, if it is missing from your skill catalog, load the built-in fallback fact-check skill for claim-by-claim verification, tell the user that behavioral/model claims degrade to manual confirmation, and recommend installing logicprobe. If neither is loaded, inform the user "此计划未经核查,是否需要我先做事实核查?" Silent skip is not an option.
61
+
62
+ To load workflows and engineering policies: load the embedded-workbench skill.
63
+
64
+ **Proactive features**: When you see state machines, protocol refactoring, behavioral claims ("always"/"never"), or multi-module tasks — suggest verification (logicprobe, or the built-in fact-check fallback if logicprobe is not installed), adversarial probing, or parallel subagents BEFORE the user asks. Most users do not know these exist.
65
+ </EXTREMELY_IMPORTANT>`;
66
+ export const Config = z.object({
67
+ enabled: z.boolean().default(true),
68
+ gateContent: z.string().default(DEFAULT_GATE_CONTENT),
69
+ });
70
+ function gateMessage(text) {
71
+ return createUserMessage({
72
+ content: [{ type: 'text', text }],
73
+ // `form` omitted — an undeclared context is the documented default.
74
+ source: { kind: 'plugin', plugin: GATE_PLUGIN_ID },
75
+ });
76
+ }
77
+ function readSessionEvents(session) {
78
+ const source = session;
79
+ if (typeof source.snapshotEvents === 'function') {
80
+ const snapshot = source.snapshotEvents();
81
+ if (Array.isArray(snapshot))
82
+ return snapshot;
83
+ }
84
+ if (Array.isArray(source.events))
85
+ return source.events;
86
+ return [];
87
+ }
88
+ /**
89
+ * Model-visible catalog entry (cordis_inspect_list / cordis_inspect_query):
90
+ * lets the model read this plugin's runtime status without guessing. Mirrors
91
+ * the registration pattern of the official dsh-tool-cordis host providers.
92
+ */
93
+ function inspectProvider(config) {
94
+ return {
95
+ manifest: {
96
+ id: 'embedded-workbench',
97
+ description: 'Session-start gate injection for the Embedded Workbench toolbox — folds the 1% Rule / Red Flags / Plan Verification Gate text into the first model step of every agent session.',
98
+ methods: [
99
+ {
100
+ name: 'status',
101
+ description: 'Read whether the gate injection is active and how large the injected gate text is.',
102
+ inputSchema: {
103
+ type: 'object',
104
+ properties: {},
105
+ additionalProperties: false,
106
+ },
107
+ outputSchema: {
108
+ type: 'object',
109
+ description: 'Gate-injection plugin status.',
110
+ properties: {
111
+ enabled: { type: 'boolean', description: 'Whether the gate folds into the first model step.' },
112
+ gateContentLength: { type: 'integer', description: 'Length in characters of the injected gate text.' },
113
+ },
114
+ required: ['enabled', 'gateContentLength'],
115
+ additionalProperties: false,
116
+ },
117
+ },
118
+ ],
119
+ },
120
+ query: async (method) => {
121
+ if (method === 'status') {
122
+ return {
123
+ enabled: config.enabled,
124
+ gateContentLength: config.gateContent.length,
125
+ };
126
+ }
127
+ return null;
128
+ },
129
+ };
130
+ }
131
+ export function apply(ctx, config) {
132
+ // Catalog visibility is optional: register only when the inspect registry
133
+ // service is mounted, so headless assemblies without it keep the gate
134
+ // injection working. The registry may be provided AFTER this row applies
135
+ // (base-bundle rows can mount later), so registration is retried on the
136
+ // first agent/session-start — by then the app is fully booted.
137
+ let providerRegistered = false;
138
+ const registerProvider = () => {
139
+ if (providerRegistered)
140
+ return;
141
+ const inspect = ctx.get('cordisInspect');
142
+ if (inspect === undefined)
143
+ return;
144
+ try {
145
+ ctx.effect(() => inspect.register(inspectProvider(config)), 'embedded-workbench: inspect provider');
146
+ providerRegistered = true;
147
+ }
148
+ catch (err) {
149
+ console.warn('[embedded-workbench] inspect provider registration failed', err);
150
+ }
151
+ };
152
+ registerProvider();
153
+ // Ship the bundled skills through the registry: reuse the standard
154
+ // filesystem provider over this package's own `skills/` directory, so
155
+ // catalog discovery, frontmatter parsing, and SKILL.md loading behave
156
+ // exactly like project/user skills while the plugin stays self-contained.
157
+ // Registration lands in the global registry layer (this row mounts at the
158
+ // profile root), so every agent preset sees the skills. `registerProvider`
159
+ // returns the effect disposer; its teardown unregisters and invalidates.
160
+ ctx.skills.registerProvider((control) => {
161
+ return new FileSystemSkillProvider(ctx, control, {
162
+ providerName: 'embedded-workbench',
163
+ includeDefaultRoots: false,
164
+ customSkillDirs: [SKILLS_DIR],
165
+ });
166
+ });
167
+ if (!config.enabled)
168
+ return;
169
+ // Inject the gate once per session on the FIRST model step that runs,
170
+ // instead of at session-start: session-start injection lands in the agent's
171
+ // inbox, which a blank-session preset switch (agentPreset.select ->
172
+ // recompose) can clear before the first step - the gate would then be lost
173
+ // for the whole session. The pre-step decision is the durable path a
174
+ // first-step injection takes: the gate is appended to the first step's
175
+ // decision and enters session history there, so every later step (and a
176
+ // resume) skips it. Anchored/bootstrap presets that strip first-step
177
+ // injected reminders (skill catalog, AGENTS.md, gate plugins) simply defer
178
+ // this message to the first step after their promotion - the history guard
179
+ // re-injects it there, so the gate still lands exactly once per session.
180
+ ctx.on('agent/pre-step', async ({ agent }, next) => {
181
+ const decision = await next();
182
+ if (decision.kind === 'reject')
183
+ return decision;
184
+ registerProvider();
185
+ if (gateInHistory(agent.session))
186
+ return decision;
187
+ return {
188
+ kind: 'enter',
189
+ messages: [...decision.messages, gateMessage(config.gateContent)],
190
+ };
191
+ });
192
+ }
193
+ /**
194
+ * Whether the gate already entered this session's durable history. The
195
+ * pre-step listener re-appends the gate until it does; once a step committed
196
+ * it, every later step (and a resume of a session that kept it) skips the
197
+ * injection. A session whose gate was dropped before any step ran (e.g. an
198
+ * inbox cleared by a blank-session preset switch) simply re-injects on the
199
+ * first step that runs.
200
+ */
201
+ function gateInHistory(session) {
202
+ return readSessionEvents(session).some((event) => {
203
+ if (event.type !== 'user/message')
204
+ return false;
205
+ const source = event.data?.source;
206
+ return source?.kind === 'plugin' && source.plugin === GATE_PLUGIN_ID;
207
+ });
208
+ }
@@ -1,43 +1,43 @@
1
- /**
2
- * embedded-workbench — DeepSeek Harness native plugin for the Embedded
3
- * Workbench toolbox. Injects the session-start gate text (1% Rule, Red
4
- * Flags, Plan Verification Gate, skills roster) into the first model step
5
- * of every agent session, mirroring the SessionStart hook the Claude Code
6
- * plugin installs. The 8 skills ship in this package's `skills/` directory
7
- * and are registered at apply time into dsh's `ctx.skills` registry through
8
- * the standard filesystem provider, so they appear in every session catalog
9
- * without a manual copy step.
10
- *
11
- * Injection listens on agent/pre-step and appends the gate to the FIRST
12
- * model step that runs, once per session (guarded by the session's durable
13
- * history). Session-start inbox injection was dropped: a blank-session preset
14
- * switch (agentPreset.select -> recompose) can clear the inbox before the
15
- * first step, losing the gate for the whole session. The pre-step decision is
16
- * the durable path - anchored/bootstrap presets that strip first-step injected
17
- * reminders (skill catalog, AGENTS.md, gate plugins) simply defer this message
18
- * to the first step after their promotion, and the history guard re-injects it
19
- * there. The default gate text is the dsh-native adaptation of
20
- * `hooks/session-start-content.md`: behavior rules
21
- * (1% Rule / Red Flags / Plan Verification Gate) stay in sync, while
22
- * presentation is adapted to dsh's native skill catalog — no roster table
23
- * (the model sees skills in its catalog) and no install instructions (those
24
- * live in `.dsh/INSTALL.md`). Deployments override via Config.
25
- *
26
- * @module embedded-workbench-dsh
27
- */
28
- import type { Context } from '@deepseek-ai/cordis';
29
- import z from '@deepseek-ai/schemastery';
30
- export declare const name = "embedded-workbench";
31
- export declare const inject: string[];
32
- export interface Config {
33
- enabled: boolean;
34
- gateContent: string;
35
- }
36
- export declare const Config: z<Schemastery.ObjectS<{
37
- enabled: z<boolean, boolean>;
38
- gateContent: z<string, string>;
39
- }>, Schemastery.ObjectT<{
40
- enabled: z<boolean, boolean>;
41
- gateContent: z<string, string>;
42
- }>>;
43
- export declare function apply(ctx: Context, config: Config): void;
1
+ /**
2
+ * embedded-workbench — DeepSeek Harness native plugin for the Embedded
3
+ * Workbench toolbox. Injects the session-start gate text (1% Rule, Red
4
+ * Flags, Plan Verification Gate, skills roster) into the first model step
5
+ * of every agent session, mirroring the SessionStart hook the Claude Code
6
+ * plugin installs. The 8 skills ship in this package's `skills/` directory
7
+ * and are registered at apply time into dsh's `ctx.skills` registry through
8
+ * the standard filesystem provider, so they appear in every session catalog
9
+ * without a manual copy step.
10
+ *
11
+ * Injection listens on agent/pre-step and appends the gate to the FIRST
12
+ * model step that runs, once per session (guarded by the session's durable
13
+ * history). Session-start inbox injection was dropped: a blank-session preset
14
+ * switch (agentPreset.select -> recompose) can clear the inbox before the
15
+ * first step, losing the gate for the whole session. The pre-step decision is
16
+ * the durable path - anchored/bootstrap presets that strip first-step injected
17
+ * reminders (skill catalog, AGENTS.md, gate plugins) simply defer this message
18
+ * to the first step after their promotion, and the history guard re-injects it
19
+ * there. The default gate text is the dsh-native adaptation of
20
+ * `hooks/session-start-content.md`: behavior rules
21
+ * (1% Rule / Red Flags / Plan Verification Gate) stay in sync, while
22
+ * presentation is adapted to dsh's native skill catalog — no roster table
23
+ * (the model sees skills in its catalog) and no install instructions (those
24
+ * live in `.dsh/INSTALL.md`). Deployments override via Config.
25
+ *
26
+ * @module embedded-workbench-dsh
27
+ */
28
+ import type { Context } from '@deepseek-ai/cordis';
29
+ import z from '@deepseek-ai/schemastery';
30
+ export declare const name = "embedded-workbench";
31
+ export declare const inject: string[];
32
+ export interface Config {
33
+ enabled: boolean;
34
+ gateContent: string;
35
+ }
36
+ export declare const Config: z<Schemastery.ObjectS<{
37
+ enabled: z<boolean, boolean>;
38
+ gateContent: z<string, string>;
39
+ }>, Schemastery.ObjectT<{
40
+ enabled: z<boolean, boolean>;
41
+ gateContent: z<string, string>;
42
+ }>>;
43
+ export declare function apply(ctx: Context, config: Config): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-embedded-workbench",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Embedded C/C++ firmware development toolbox — 4 agents, 8 skills covering FreeRTOS, ISR, NVM storage, Keil MDK, ARMCLANG, HardFault, state machines, architecture, LVGL patterns, and claim fact-checking. Ships a native DeepSeek Harness (dsh) bundle that injects the session-start gate into the first model step.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -32,14 +32,15 @@
32
32
  "patch": "./cordis.patch.yml"
33
33
  },
34
34
  "compatibility": {
35
- "dsh": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-alpha.2 || ^0.1.2-alpha.3",
35
+ "dsh": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-alpha.2 || ^0.1.2-alpha.3 || ^0.1.2-alpha.4",
36
36
  "dshReleases": {
37
37
  "0.1.0-rc.7": "compatible",
38
38
  "0.1.0-rc.8": "compatible",
39
39
  "0.1.1-rc.1": "compatible",
40
40
  "0.1.1-rc.2": "compatible",
41
41
  "0.1.2-alpha.2": "compatible",
42
- "0.1.2-alpha.3": "compatible"
42
+ "0.1.2-alpha.3": "compatible",
43
+ "0.1.2-alpha.4": "compatible"
43
44
  },
44
45
  "profiles": [
45
46
  "headless"