@skyf0xx/hedgehog-core-deepseek-harness 0.3.0 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyf0xx/hedgehog-core-deepseek-harness",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Hedgehog's deepseek-harness core: a pinned DSH/Cordis plugin workspace, a tool-plugin generator, and the skills that drive building DeepSeek Harness plugins with Hedgehog's build discipline.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dsh-plugin-shapes
3
- description: Use whenever `harness-eng` is writing a DSH plugin's own TypeScript — deciding whether it's a tool, hook, UI/slot, protocol-driver/service, agent-team, subagent, job, workflow, webhook, session-query, or Web Client slot/panel shape, or filling in that shape's DSL. Also the reference for the Agent-passing pattern that replaced `ctx.agent` and the `agent.inbox` API that replaced the `Inbox` runtime class. Trigger on "write the plugin", "register a tool", "hook into tools/pre-execute", "wire a service", "class-form plugin", "ctx.on", "ctx.tools.register", "ctx.agent", "agent.inbox", "spawn a subagent", "ctx.agentTeams", "ctx.jobs", "ctx.workflowEngine", "ctx.webhookRuntime", "ctx.sessionQuery", "ctx.slots", "ctx.sidebarRightTabs", "ctx.sidebarRight", "sidebar panel", "Web Client slot", or any `plugins/*/src/*.ts` edit. Catalogs the plugin-facing shapes DSH supports with real, doc-verified code — so the plugin body comes from a confirmed DSL instead of a guessed or half-remembered one.
3
+ description: Use whenever `harness-eng` is writing a DSH plugin's own TypeScript — deciding whether it's a tool, hook, UI/slot, protocol-driver/service, agent-team, subagent, job, workflow, webhook, session-query, Web Client slot/panel, or agent-preset shape, or filling in that shape's DSL. Also the reference for the Agent-passing pattern that replaced `ctx.agent` and the `agent.inbox` API that replaced the `Inbox` runtime class. Trigger on "write the plugin", "register a tool", "hook into tools/pre-execute", "wire a service", "class-form plugin", "ctx.on", "ctx.tools.register", "ctx.agent", "agent.inbox", "agent/created", "spawn a subagent", "ctx.agentTeams", "ctx.jobs", "ctx.workflowEngine", "ctx.webhookRuntime", "ctx.sessionQuery", "ctx.slots", "ctx.sidebarRightTabs", "ctx.sidebarRight", "ctx.agentPresets", "agent preset", "sidebar panel", "Web Client slot", or any `plugins/*/src/*.ts` edit. Catalogs the plugin-facing shapes DSH supports with real, doc-verified code — so the plugin body comes from a confirmed DSL instead of a guessed or half-remembered one.
4
4
  ---
5
5
 
6
6
  # DSH Plugin Shapes
@@ -13,7 +13,7 @@ wrapper (`package.json`'s `dsh.bundle`, `cordis.patch.yml`) that every
13
13
  shape shares regardless of which one it implements — that's the
14
14
  tool-plugin generator's concern, not this skill's.
15
15
 
16
- **Verified against DSH tag `dsh-v0.1.7-alpha.1`.** Shapes 1-4 and the
16
+ **Verified against DSH tag `dsh-v0.1.7-rc.1`.** Shapes 1-4 and the
17
17
  "Every plugin body" structural forms were checked against
18
18
  `docs/user/develop/framework/events.md` and `service.md`. The Agent/Inbox
19
19
  section and Shapes 5-9 were checked against `docs/subsystems/core.md`,
@@ -21,16 +21,19 @@ section and Shapes 5-9 were checked against `docs/subsystems/core.md`,
21
21
  `docs/subsystems/jobs.md`, `docs/subsystems/workflow.md`,
22
22
  `docs/subsystems/webhook.md`, `docs/subsystems/session-query.md`. Shape 10
23
23
  was checked against `docs/subsystems/slots.md` and
24
- `docs/subsystems/sidebar-right.md`. All of the above plus the
25
- `dsh-v0.1.7-alpha.1` release notes were read at that tag, the same tag
26
- `workspace/package.json` pins `@deepseek-ai/dsh` and `@deepseek-ai/dsh-tools`
27
- to. This is the one owning statement of which DSH revision this skill's
28
- catalog was checked against — every confirmed-event, confirmed-signature,
29
- and "doesn't exist" claim below is only guaranteed true as of that tag. A
30
- re-pin to a newer `rc` or stable tag needs this skill's claims re-checked
31
- against the new tag's own docs before the pin line above is updated to
32
- match; don't bump the pin in `workspace/package.json` without also
33
- re-verifying this file.
24
+ `docs/subsystems/sidebar-right.md`. Shape 11 was added from
25
+ `docs/subsystems/core.md`'s `ctx.agentPresets` section, newly complete
26
+ enough at this tag to catalog. All of the above plus the release notes for
27
+ every version between `dsh-v0.1.7-alpha.1` (this file's previous verified
28
+ tag) and `dsh-v0.1.7-rc.1` were read at the new tag, which
29
+ `workspace/package.json` now pins `@deepseek-ai/dsh` and
30
+ `@deepseek-ai/dsh-tools` to. This is the one owning statement of which DSH
31
+ revision this skill's catalog was checked against — every confirmed-event,
32
+ confirmed-signature, and "doesn't exist" claim below is only guaranteed
33
+ true as of that tag. A re-pin to a newer `rc` or stable tag needs this
34
+ skill's claims re-checked against the new tag's own docs before the pin
35
+ line above is updated to match; don't bump the pin in
36
+ `workspace/package.json` without also re-verifying this file.
34
37
 
35
38
  ## Out of scope, and why
36
39
 
@@ -74,18 +77,8 @@ excluded at this tag:
74
77
  plugin's own `apply(ctx)` body, `cordis.patch.yml` entry, and Shape
75
78
  1-10 DSL are unaffected by how the Web app or Creator mode installs it
76
79
  at runtime.
77
- - **`ctx.agentPresets` (`AgentPresetRegistry`, `core.md`)** — Agent
78
- presets are declared and installed through plugin bundles (a
79
- plugin-facing `register(definition: PresetDefinition)` call, "the
80
- declaring plugin owns it"), which is squarely plugin-authoring surface
81
- and not yet catalogued here. `core.md` gives the method signatures but
82
- never states `PresetDefinition`'s field shape or a worked registration
83
- example, and no dedicated `docs/subsystems/agent-preset*.md` exists to
84
- fill that gap — there isn't enough here yet to catalog a confirmed
85
- Shape 11 responsibly. Treat a task that needs to register or resolve
86
- an Agent preset from a plugin as needing `packages/preset/agent-preset-registry/src/types.ts`
87
- read directly, not this skill; add a Shape 11 once a source read or a
88
- future doc pass gives `PresetDefinition`'s fields and a real example.
80
+ - **`ctx.agentPresets` is now catalogued as Shape 11**, below — see that
81
+ section for what's confirmed and what's still thin.
89
82
 
90
83
  ## v0.1 generator coverage: tool shape only
91
84
 
@@ -204,6 +197,26 @@ session-event type via `ctx.on`, inside function-form `apply`.
204
197
  at the tag pinned above): `agent/pre-step`, `agent/request`,
205
198
  `agent/request-error`, `tools/result`, `session/event`.
206
199
 
200
+ **Confirmed as of `dsh-v0.1.7-rc.1`, per `docs/subsystems/core.md`:**
201
+ `agent/created` (serial mode) — fires once an entered agent is ready for
202
+ per-agent initialization after factory setup; listeners run in order and
203
+ are awaited before creation resolves, and a throw or rejection fails
204
+ creation and skips later listeners:
205
+ ```ts
206
+ export function apply(ctx: Context) {
207
+ ctx.on('agent/created', async ({ agent, source, signal }) => {
208
+ // per-agent initialization; must not await agent.whenIdle() or its own owner's disposal
209
+ })
210
+ }
211
+ ```
212
+ This is a chore-level rename in the underlying framework (the previous,
213
+ unconfirmed `agent/session-start` name some earlier tags' release notes
214
+ described never appeared in this skill's catalog, so there is nothing to
215
+ migrate here) — treat `agent/created` as the confirmed name going
216
+ forward. `agent/disposed` (emit mode, fires after driver quiescence and
217
+ scoped-registration unwind) is also confirmed in the same doc, for the
218
+ symmetric teardown case.
219
+
207
220
  **Confirmed durable session-event types** (delivered through the
208
221
  `session/event` Cordis event, not separate `ctx.on` names of their own):
209
222
  `turn/*`, `step/*`, `tool/call`, `tool/result`, `compaction/*`.
@@ -553,6 +566,24 @@ request rather than guessing field names; log friction via `hedgehog
553
566
  friction add` if a needed field still isn't documented at the depth
554
567
  needed.
555
568
 
569
+ **Confirmed `subagent/*` events** (per `docs/subsystems/subagent.md` as of
570
+ `dsh-v0.1.7-rc.1`), all Shape 2's `ctx.on` pattern: `subagent/start` (emit
571
+ — a provider established a published child; for in-process providers
572
+ `ctx.agents.get(info.id)` resolves during this notification),
573
+ `subagent/end` (emit — a published child settled, paired with
574
+ `subagent/start`), `subagent/provider-added` and `subagent/provider-removed`
575
+ (emit — a provider entered or left the registry). Scope-filtered dispatch
576
+ on `start`/`end` keys the carrier by the delegating parent, so a
577
+ parent-scoped listener sees only its own delegations.
578
+
579
+ **Confirmed `ctx.subagentModelSelection`** (`SubagentModelSelectionConfig`,
580
+ same doc) — a singleton settings owner read when delegation tools are
581
+ composed for a Session, with one confirmed method: `current()` returns
582
+ `SubagentModelSelectionSettings` (enabled state and allowed routes). Its
583
+ exact settings shape isn't transcribed here; read
584
+ `packages/subagent/tool-subagent/src/model-selection-settings.ts` before
585
+ depending on a specific field.
586
+
556
587
  ## Shape 7: Background job plugin (`ctx.jobs`)
557
588
 
558
589
  `ctx.jobs` is an **abstract seam**, not a ready-to-call service by
@@ -857,6 +888,54 @@ which this pass did not fetch in full — confirm the provider contract
857
888
  there before implementing one, and log friction via `hedgehog friction
858
889
  add` if it's thin.
859
890
 
891
+ ## Shape 11: Agent preset plugin (`ctx.agentPresets`)
892
+
893
+ A plugin that declares a reusable, YAML-backed Agent composition — the
894
+ mechanism `dsh-v0.1.7-rc.1`'s release notes describe as "Agent presets
895
+ declared and installed through plugin bundles." Confirmed against
896
+ `docs/subsystems/core.md`'s `ctx.agentPresets` (`AgentPresetRegistry`)
897
+ section, newly complete enough at this tag to catalog (earlier tags gave
898
+ method signatures without enough surrounding context to responsibly
899
+ document a worked example):
900
+
901
+ ```ts
902
+ export const inject = ['agentPresets']
903
+ export function apply(ctx: Context) {
904
+ const dispose = ctx.agentPresets.register(/* PresetDefinition — see honesty note */)
905
+ // dispose() later removes this plugin's registration
906
+ }
907
+ ```
908
+
909
+ Confirmed methods on `ctx.agentPresets`: `register(definition)` (registers
910
+ and eagerly loads a definition; returns a disposer — "the declaring plugin
911
+ owns it"; activation failure stays visible in the roster rather than
912
+ throwing), `list()` (every declared preset including activation
913
+ failures), `remoteExportList()` (the selection roster and chooser policy),
914
+ `resolve(id?)` (resolve an identity without starting an Agent),
915
+ `readDocument(agentPreset)` (a declaration's child-plugin list as YAML,
916
+ view-only), `mount(ctx, id?)` (bind an unpublished Agent to the current
917
+ preset revision, called from a Agent's own `setup` callback — see the
918
+ `CreateAgentOptions`/`AgentSetup` material in the Agent-passing section
919
+ above for when `setup` runs), `composeFrom(ctx, parent)` (join a child to
920
+ its parent's exact retained revision), `composedPreset(ctx)` (read the
921
+ preset id a live Agent is bound to), `serviceFor(agent, name)` (read a
922
+ service scoped inside an Agent's isolated preset group),
923
+ `recompose(ctx, id)` (rebind a blank Agent — the caller owns the
924
+ blank-session check), `select(agent, agentPreset)` (select a preset before
925
+ a session's first turn), `acquireScope(id?)` (a disposable revision lease
926
+ for cold transcript presentation), and `compositionInventory()` (plugin
927
+ rows without creating an Agent).
928
+
929
+ **Honesty note:** `PresetDefinition`'s exact field shape is still not
930
+ spelled out in prose in `core.md` — the doc's JSDoc for `register()` calls
931
+ it only "parsed configuration supplied by the declaring plugin." Read
932
+ `packages/preset/agent-preset-registry/src/types.ts` directly before
933
+ constructing one rather than guessing field names, and log friction via
934
+ `hedgehog friction add` if that source file doesn't cleanly resolve the
935
+ shape either. Likewise `AgentPreset`, `AgentPresetRoster`,
936
+ `AgentPresetDocument`, and `AgentPresetComposition` are named as return
937
+ types but not expanded here.
938
+
860
939
  ## Constraints
861
940
 
862
941
  - This skill catalogs shape and DSL only — it doesn't judge which shape
@@ -900,7 +979,9 @@ add` if it's thin.
900
979
  Client slots) is new to this skill as of `dsh-v0.1.5-alpha.2` and has a
901
980
  large, only-partially-transcribed surface (`client-resources.md`'s
902
981
  provider contract, the full owner-props table per slot) — treat gaps
903
- there the same as any other honesty-note gap, not as settled.
982
+ there the same as any other honesty-note gap, not as settled. Shape 11
983
+ (Agent presets) is new as of `dsh-v0.1.7-rc.1` and leaves
984
+ `PresetDefinition`'s field shape unresolved — treat it the same way.
904
985
  - Doesn't cover the bundle/manifest wrapper (`package.json`'s `dsh.bundle`
905
986
  block, `files`, `cordis.patch.yml`'s `insert` entry) — that wrapper is
906
987
  the same across every shape and is the generator's concern, not this
@@ -10,9 +10,9 @@
10
10
  "generate:tool": "node tools/generators/cli.mjs tool"
11
11
  },
12
12
  "dependencies": {
13
- "@deepseek-ai/dsh": "0.1.7-alpha.1",
14
- "@deepseek-ai/cordis": "4.0.3",
15
- "@deepseek-ai/dsh-tools": "0.1.7-alpha.1"
13
+ "@deepseek-ai/dsh": "0.1.7-rc.1",
14
+ "@deepseek-ai/cordis": "4.0.4",
15
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.1"
16
16
  },
17
17
  "pnpm": {
18
18
  "overrides": {