@mstar-harness/dsh 3.5.1 → 3.6.0-alpha.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/README.i18n.yaml +2 -2
- package/README.md +15 -17
- package/README.zh.md +15 -17
- package/dist/client/index.d.ts +1 -1
- package/dist/client/panel/PanelView.d.ts +2 -2
- package/dist/client/panel/use-mstar-engine-status.d.ts +8 -8
- package/dist/client.js +5 -5
- package/dist/gates/_shared.d.ts +46 -14
- package/dist/gates/agent-personas.d.ts +3 -3
- package/dist/gates/fallbacks-advisory.d.ts +2 -2
- package/dist/gates/fallbacks-probe.d.ts +12 -6
- package/dist/gates/fallbacks-seeds.d.ts +12 -10
- package/dist/gates/fallbacks-structural.d.ts +101 -0
- package/dist/gates/goal-bridge.d.ts +1 -1
- package/dist/gates/role-persona.d.ts +191 -0
- package/dist/gates/system-prompt.d.ts +7 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +136 -111
- package/harness-skills/mstar-artifacts/references/status-and-residuals.md +25 -13
- package/harness-skills/mstar-coding-behavior/SKILL.md +2 -0
- package/harness-skills/mstar-harness-core/SKILL.md +13 -1
- package/harness-skills/mstar-iteration/SKILL.md +1 -1
- package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +12 -2
- package/package.json +20 -20
- package/dist/gates/fallbacks-decoration.d.ts +0 -108
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* registry, so without preservation a mstar-only batch would strip
|
|
15
15
|
* preset/companion ids of their seeded annotations (rows remain — R2).
|
|
16
16
|
* 2. `subagentRoleIds()` × `personaFor()` resolve the mstar personas from
|
|
17
|
-
* the `harness-agents/` mirror (the
|
|
17
|
+
* the `harness-agents/` mirror (the persona channel's existing lookup surface;
|
|
18
18
|
* `mode: primary` shells like `project-manager` are excluded).
|
|
19
19
|
* 3. Interpolation gate (HARD): any persona carrying the dsh system-prompt
|
|
20
20
|
* STRICT `{{...}}` hazard is skipped + warned BEFORE `declareSeeds` —
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
*
|
|
26
26
|
* The upstream `SeedDeclareOutcome` is passed through verbatim; the
|
|
27
27
|
* structured `SeedOutcomeView` is this module's own view (the service is a
|
|
28
|
-
* structural parameter — fake-testable, no runtime value import
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* structural parameter — fake-testable, no runtime value import). The
|
|
29
|
+
* upstream shapes are the local structural mirrors from
|
|
30
|
+
* `fallbacks-structural.ts` (mirroring `fallbacks-probe.ts`) — this module
|
|
31
|
+
* carries ZERO imports of `dsh-llm-fallbacks`, runtime or type.
|
|
31
32
|
*
|
|
32
33
|
* Failure semantics: a throwing readback is contained (skip + one warn —
|
|
33
34
|
* probe semantics); a rejecting `declareSeeds` PROPAGATES to the caller —
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
* Module boundary: no barrel — the entry imports this module by explicit
|
|
38
39
|
* relative path; the entry does not re-export it.
|
|
39
40
|
*/
|
|
40
|
-
import type {
|
|
41
|
+
import type { EffectiveRolesReadbackView, SeedDeclarationView, SeedDeclareOutcomeView } from './fallbacks-structural.ts';
|
|
41
42
|
/** Logger label for the mstar seeds declaration (dsh logger naming: `<scope>/<subject>`). */
|
|
42
43
|
export declare const SEEDS_LOGGER = "mstar/fallbacks-seeds";
|
|
43
44
|
/** Seed-declaration log levels the module sink understands. */
|
|
@@ -46,15 +47,16 @@ export type SeedsLogLevel = 'debug' | 'warn' | 'error';
|
|
|
46
47
|
export type SeedsLogSink = (level: SeedsLogLevel, message: string) => void;
|
|
47
48
|
/**
|
|
48
49
|
* The consumed service surface — a structural subset of the upstream
|
|
49
|
-
* `FallbacksService` (the two seed methods the declaration flow uses)
|
|
50
|
+
* `FallbacksService` (the two seed methods the declaration flow uses),
|
|
51
|
+
* typed over the local mirrors in `fallbacks-structural.ts`.
|
|
50
52
|
* Fake-testable: tests pass a spy object; the real service is assignable
|
|
51
53
|
* (structural typing anchors the contract against the installed `.d.ts`).
|
|
52
54
|
*/
|
|
53
55
|
export interface SeedsServiceView {
|
|
54
56
|
/** (a) Declare the companion's FULL current seed set (replacement semantics). */
|
|
55
|
-
declareSeeds(seeds: readonly
|
|
57
|
+
declareSeeds(seeds: readonly SeedDeclarationView[]): Promise<SeedDeclareOutcomeView>;
|
|
56
58
|
/** (b) Sync readback — effective taxonomy with seed annotations. */
|
|
57
|
-
getEffectiveRoles():
|
|
59
|
+
getEffectiveRoles(): EffectiveRolesReadbackView;
|
|
58
60
|
}
|
|
59
61
|
/** Options for {@link declareMstarSeeds}. */
|
|
60
62
|
export interface DeclareMstarSeedsOptions {
|
|
@@ -76,13 +78,13 @@ export interface PreservedSeedView {
|
|
|
76
78
|
/** Structured result of one {@link declareMstarSeeds} call — this module's own view. */
|
|
77
79
|
export interface SeedOutcomeView {
|
|
78
80
|
/** The full declaration batch handed to `declareSeeds` (mstar personas + preserved ids). */
|
|
79
|
-
declared:
|
|
81
|
+
declared: SeedDeclarationView[];
|
|
80
82
|
/** Locally skipped ids (interpolation gate / no usable default) — never declared. */
|
|
81
83
|
skipped: SeedSkipView[];
|
|
82
84
|
/** The seeded non-mstar ids preserved from the readback into the batch. */
|
|
83
85
|
preserved: PreservedSeedView[];
|
|
84
86
|
/** The upstream `SeedDeclareOutcome` — passed through verbatim. */
|
|
85
|
-
outcome:
|
|
87
|
+
outcome: SeedDeclareOutcomeView;
|
|
86
88
|
}
|
|
87
89
|
/**
|
|
88
90
|
* Declare the mstar subagent seeds: readback → merge-preserve seeded
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local structural mirrors of the consumed `dsh-llm-fallbacks` surface
|
|
3
|
+
* (plan `20260831-dsh-alpha2-optional-fallbacks` Task 2). dsh
|
|
4
|
+
* `0.1.2-alpha.2` natively covers subagent customization, so the fallbacks
|
|
5
|
+
* plugin is an OPTIONAL capability activated by the unchanged two-command
|
|
6
|
+
* install contract — and a dev-time-only dependency of this package (type
|
|
7
|
+
* mirroring here + the real-package test harness). The published package
|
|
8
|
+
* carries ZERO runtime AND ZERO type references to `dsh-llm-fallbacks`.
|
|
9
|
+
*
|
|
10
|
+
* Shapes mirror `dsh-llm-fallbacks@0.4.0-alpha.1` `dist/index.d.ts`
|
|
11
|
+
* (`FallbacksService`) and `dist/seeds.d.ts` (`SeedDeclaration`,
|
|
12
|
+
* `SeedSkipReason`, `SeedConflict`, `SeedDeclareOutcome`, `EffectiveRole`,
|
|
13
|
+
* `EffectiveRolesReadback`). Drift gates keeping the mirrors in sync:
|
|
14
|
+
*
|
|
15
|
+
* - Runtime: the probe spec's exact-keys `SERVICE_KEYS` 9-tuple +
|
|
16
|
+
* `RESOLVED_VERSION` pin (`tests/fallbacks-probe.spec.ts`) fails on a
|
|
17
|
+
* drifted resolver.
|
|
18
|
+
* - Compile-time: `typecheck:tests` compiles this module's consumers WITH
|
|
19
|
+
* the real package's `declare module '@deepseek-ai/cordis'` augmentation
|
|
20
|
+
* active (the tests import the package), so `fallbacksService`'s uncast
|
|
21
|
+
* `ctx.get('llm-fallbacks')` return is a real → view assignability check.
|
|
22
|
+
* The published build program never loads the augmentation — the untyped
|
|
23
|
+
* string overload applies there.
|
|
24
|
+
*
|
|
25
|
+
* Only the members mstar consumes carry faithful signatures
|
|
26
|
+
* (`detectLegacyKeys`, `declareSeeds`, `getEffectiveRoles`); the remaining
|
|
27
|
+
* service members are presence-typed function slots — the probe spec's
|
|
28
|
+
* `typeof === 'function'` assertions are their executable gate.
|
|
29
|
+
*
|
|
30
|
+
* Module boundary: no barrel — consumers import this module by explicit
|
|
31
|
+
* relative path; the entry does not re-export it.
|
|
32
|
+
*/
|
|
33
|
+
/** Mirror of upstream `SeedSkipReason` (dist/seeds.d.ts) — per-id skip reason, never coercion. */
|
|
34
|
+
export type SeedSkipReason = 'invalid-id' | 'reserved-id' | 'duplicate-in-batch';
|
|
35
|
+
/** Mirror of upstream `SeedDeclaration` (dist/seeds.d.ts) — one companion seed. */
|
|
36
|
+
export interface SeedDeclarationView {
|
|
37
|
+
id: string;
|
|
38
|
+
persona: string;
|
|
39
|
+
}
|
|
40
|
+
/** Mirror of upstream `SeedConflict` (dist/seeds.d.ts) — loud, non-destructive. */
|
|
41
|
+
export interface SeedConflictView {
|
|
42
|
+
id: string;
|
|
43
|
+
/** Existing row persona differs from the seed default — operator override retained, never overwritten. */
|
|
44
|
+
kind: 'persona-source';
|
|
45
|
+
}
|
|
46
|
+
/** Mirror of upstream `SeedDeclareOutcome` (dist/seeds.d.ts) — one `declareSeeds` result. */
|
|
47
|
+
export interface SeedDeclareOutcomeView {
|
|
48
|
+
applied: string[];
|
|
49
|
+
skipped: Array<{
|
|
50
|
+
id: string;
|
|
51
|
+
reason: SeedSkipReason;
|
|
52
|
+
}>;
|
|
53
|
+
conflicts: SeedConflictView[];
|
|
54
|
+
}
|
|
55
|
+
/** Mirror of upstream `EffectiveRole` (dist/seeds.d.ts) — readback entry with seed annotations. */
|
|
56
|
+
export interface EffectiveRoleView {
|
|
57
|
+
/** The config row id (raw declared form). */
|
|
58
|
+
id: string;
|
|
59
|
+
/** Effective row persona. */
|
|
60
|
+
persona: string;
|
|
61
|
+
/** Passthrough — never touched by seeds. */
|
|
62
|
+
chain?: string[];
|
|
63
|
+
/** Passthrough — never touched by seeds (mirrors upstream `FallbackStrategy`). */
|
|
64
|
+
fallback?: 'inherit-root' | 'none';
|
|
65
|
+
/** Id is in the live declaration set (trimmed row-id match). */
|
|
66
|
+
seeded: boolean;
|
|
67
|
+
/** `seeded` && row persona !== current seed default. */
|
|
68
|
+
personaOverridden: boolean;
|
|
69
|
+
/** Present iff seeded. */
|
|
70
|
+
seedPersona?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Mirror of upstream `EffectiveRolesReadback` (dist/seeds.d.ts) — effective taxonomy with seed annotations. */
|
|
73
|
+
export interface EffectiveRolesReadbackView {
|
|
74
|
+
roles: EffectiveRoleView[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Mirror of upstream `FallbacksService` (dist/index.d.ts) — the named
|
|
78
|
+
* cordis service `ctx.get('llm-fallbacks')` exposes while the plugin is
|
|
79
|
+
* applied. The 9 members are declared in the upstream order; the probe
|
|
80
|
+
* spec's `SERVICE_KEYS` tuple asserts exactly this set and order at runtime.
|
|
81
|
+
*/
|
|
82
|
+
export interface FallbacksServiceView {
|
|
83
|
+
/** Matches the plugin `name`. */
|
|
84
|
+
name: 'llm-fallbacks';
|
|
85
|
+
/** Package.json version string (module-load snapshot). */
|
|
86
|
+
version: string;
|
|
87
|
+
/** Presence-typed (unconsumed): role resolution. */
|
|
88
|
+
resolveRole: (...args: never[]) => unknown;
|
|
89
|
+
/** Presence-typed (unconsumed): chain resolution. */
|
|
90
|
+
resolveChain: (...args: never[]) => unknown;
|
|
91
|
+
/** Presence-typed (unconsumed): config validation. */
|
|
92
|
+
validateFallbacksConfig: (...args: never[]) => unknown;
|
|
93
|
+
/** Legacy config-key detector (consumed by the adoption advisory). */
|
|
94
|
+
detectLegacyKeys(source: Record<string, unknown>): string[];
|
|
95
|
+
/** (a) Declare the companion's FULL current seed set (replacement semantics). */
|
|
96
|
+
declareSeeds(seeds: readonly SeedDeclarationView[]): Promise<SeedDeclareOutcomeView>;
|
|
97
|
+
/** (b) Sync readback — effective taxonomy with seed annotations. */
|
|
98
|
+
getEffectiveRoles(): EffectiveRolesReadbackView;
|
|
99
|
+
/** Presence-typed (unconsumed): revert one id to the current seed default. */
|
|
100
|
+
revertSeededPersona: (...args: never[]) => unknown;
|
|
101
|
+
}
|
|
@@ -128,7 +128,7 @@ export declare function rootAgentOf(agent: unknown, agents: AgentsView): unknown
|
|
|
128
128
|
* Register the goal bridge: an `agent/session-start` listener (root filter
|
|
129
129
|
* inside the mirror — root and children alike fire, `runtime-types.ts:217`)
|
|
130
130
|
* plus a decision-point re-evaluation on `subagent/start` (the existing
|
|
131
|
-
* decision point — index.ts
|
|
131
|
+
* decision point — index.ts advisory slot), resolving the delegating ROOT
|
|
132
132
|
* via the `parentSession` walk — the two mirror edges are idempotent (get +
|
|
133
133
|
* compare when the mirror is in place — no churn) — plus a THIRD, advisory
|
|
134
134
|
* listener on the `session/event` firehose (Task 3): a `goal/change`
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native-first role-persona delivery (plan `20260831-dsh-alpha2-optional-fallbacks`
|
|
3
|
+
* Task 3): a role-matched subagent start merges the persona into the request's
|
|
4
|
+
* NATIVE `persona` slot (`@deepseek-ai/dsh-subagent`
|
|
5
|
+
* `SubagentStartRequest.persona`) — the additive `mstar:role-persona`
|
|
6
|
+
* system-prompt section is gone. Native semantics: the request persona
|
|
7
|
+
* registers the scoped `deployment:persona` section (order
|
|
8
|
+
* `DEPLOYMENT_PERSONA` = 0) on the child, SHADOWING the deployment persona
|
|
9
|
+
* for that child alone, is persisted in the child descriptor, and is
|
|
10
|
+
* reapplied on resume — delivery, persistence, and resume replay all belong
|
|
11
|
+
* to dsh. BOTH start surfaces are wrapped: the one-shot `start` AND the
|
|
12
|
+
* opt-in continuable `startContinuable` (tool-subagent
|
|
13
|
+
* `backgroundMode: 'continuable'` routes its background run through
|
|
14
|
+
* `ContinuableStartSpec.request`) — the old `subagent/start` emit
|
|
15
|
+
* decoration covered continuable children too, and this channel must not
|
|
16
|
+
* regress that.
|
|
17
|
+
*
|
|
18
|
+
* Interception seam: the cordis service-read waterfall
|
|
19
|
+
* (`Events['internal/get']`, `@deepseek-ai/cordis` 4.0.2
|
|
20
|
+
* `lib/types/events.d.ts`) — the framework's documented interception hook
|
|
21
|
+
* for values read through the context proxy. The listener wraps the
|
|
22
|
+
* `subagents` service VALUE on read (a prototype-delegating wrapper whose
|
|
23
|
+
* `start`/`startContinuable` merge the role persona into the request before
|
|
24
|
+
* delegating); the real `SubagentRuntime` object is never mutated — readers
|
|
25
|
+
* of `ctx.subagents` (the tool-subagent reads it per call through a
|
|
26
|
+
* plugin-fiber context) transparently receive the wrapper. The listener is
|
|
27
|
+
* owned by the applying fiber (cordis listener effects), so an HMR fiber
|
|
28
|
+
* swap unwinds and restores it like every other registration.
|
|
29
|
+
*
|
|
30
|
+
* The continuable request has no earlier seam: `registerContinuableSetup`
|
|
31
|
+
* contributions are child-scope installers (`(childCtx) => () => void` —
|
|
32
|
+
* no per-start data slot), so the earliest point where the continuable
|
|
33
|
+
* request exists is the `startContinuable(spec)` call itself, which the
|
|
34
|
+
* wrapper owns.
|
|
35
|
+
*
|
|
36
|
+
* Role identity uses the engine Assignment header grammar — the SAME
|
|
37
|
+
* parsers the dispatch gate uses (`assignmentHeaderRegion` +
|
|
38
|
+
* `parseAssignmentFields`) — over the start request's prompt text (the
|
|
39
|
+
* `ContentBlock[]` the child receives as its first user message). Persona
|
|
40
|
+
* lookup (plan `20260815-dsh-fallbacks-personas` Task 3) is the single
|
|
41
|
+
* {@link personaFor} surface — `Config.rolePersonas[executeAs]` →
|
|
42
|
+
* `harness-agents/` mirror default → skip (never gated on `roleMap` or on
|
|
43
|
+
* the fallbacks mounted state: persona delivery is fallbacks-independent).
|
|
44
|
+
* `roleMap` is a taxonomy bridge for logging + future rule-driven interop
|
|
45
|
+
* only. The mirror root is bound at apply (`setRolePersonaAgentsDir` ←
|
|
46
|
+
* `packagedAgentsDir()`), package-relative so the shipped bundle works from
|
|
47
|
+
* any launch cwd.
|
|
48
|
+
*
|
|
49
|
+
* Capability gates (native fail-loud contracts, per surface): one-shot
|
|
50
|
+
* `SubagentRuntime.start` REJECTS a request carrying `persona` for a
|
|
51
|
+
* provider whose `SubagentCapabilities.persona` is false (e.g.
|
|
52
|
+
* out-of-process providers) — "rejected rather than accepted-then-ignored"
|
|
53
|
+
* — so the one-shot merge checks `getProvider(name).capabilities.persona`
|
|
54
|
+
* first. Continuable children are composed by the continuation manager
|
|
55
|
+
* itself and are gated by `SubagentProvider.prepareContinuable` instead
|
|
56
|
+
* (upstream `SubagentCapabilities` doc: the flags "describe the ONE-SHOT
|
|
57
|
+
* path"), so the continuable merge checks `prepareContinuable` — the
|
|
58
|
+
* manager applies a merged persona unconditionally. Either way: gate miss →
|
|
59
|
+
* the persona is skipped with one contained debug log and the start
|
|
60
|
+
* proceeds unchanged — the contained degrade, never a failed dispatch.
|
|
61
|
+
*
|
|
62
|
+
* Precedence: an explicit `request.persona` (e.g. tool-subagent's own
|
|
63
|
+
* `Config.persona`) is caller intent and WINS — the role persona fills the
|
|
64
|
+
* slot only when the request does not already carry one.
|
|
65
|
+
*
|
|
66
|
+
* Degradation (the wrapper never throws before delegating — contained like
|
|
67
|
+
* the dispatch gate's degrade path): unparseable prompt / role-unmatched →
|
|
68
|
+
* silent pass-through; persona lookup miss with NO mirror → one debug log
|
|
69
|
+
* per apply (S-002 latch); a throwing merge aborts the merge only — the
|
|
70
|
+
* ORIGINAL request reaches the service and the start is never affected.
|
|
71
|
+
*
|
|
72
|
+
* Persona text is rendered by dsh system-prompt's STRICT `{{...}}`
|
|
73
|
+
* interpolation (the native persona has the same template semantics as the
|
|
74
|
+
* deployment persona), so persona values MUST NOT contain `{{` paired with
|
|
75
|
+
* a later `}}` — the Config schema rejects such values at plugin mount (see
|
|
76
|
+
* `_shared.ts` `rolePersonas` / `PERSONA_INTERPOLATION_HAZARD`); a mirror
|
|
77
|
+
* default carrying the hazard is warned + skipped at extraction (never a
|
|
78
|
+
* boot throw).
|
|
79
|
+
*
|
|
80
|
+
* Module boundary: no barrel — the entry imports this module by explicit
|
|
81
|
+
* relative path and re-exports the public names verbatim. No dsh-subagent
|
|
82
|
+
* dependency: the runtime surface is consumed structurally (same pattern as
|
|
83
|
+
* the probe's `LoaderEntryView` and T2's `fallbacks-structural.ts`).
|
|
84
|
+
*/
|
|
85
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
86
|
+
import type { Config } from './_shared.ts';
|
|
87
|
+
/** Logger label for the role-persona channel (dsh logger naming: `<scope>/<subject>`). */
|
|
88
|
+
export declare const ROLE_PERSONA_LOGGER = "mstar/role-persona";
|
|
89
|
+
/** One consumed prompt content block (`@deepseek-ai/dsh-llm` `ContentBlock` text members). */
|
|
90
|
+
interface PromptBlockView {
|
|
91
|
+
readonly type: string;
|
|
92
|
+
readonly text?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Structural view of the one-shot start request the channel merges into
|
|
96
|
+
* (`@deepseek-ai/dsh-subagent` `SubagentStartRequest` — consumed fields
|
|
97
|
+
* only: `prompt` is the role-extraction source, `persona` is the merge
|
|
98
|
+
* target). The wrapper forwards the request object SPREAD, so every
|
|
99
|
+
* non-consumed field (`label`, `parent`, `signal`, `agentOptions`, …)
|
|
100
|
+
* reaches the service unchanged at runtime; the view types only what this
|
|
101
|
+
* module reads. The continuable surface merges into the SAME view
|
|
102
|
+
* (`ContinuableStartSpec.request` is `Omit<SubagentStartRequest, 'label' |
|
|
103
|
+
* 'signal' | 'outputSchema'>` — same `prompt`/`persona` shape).
|
|
104
|
+
*/
|
|
105
|
+
export interface SubagentStartRequestView {
|
|
106
|
+
/** Content delivered as the child's user message (the Assignment carrier). */
|
|
107
|
+
readonly prompt: readonly PromptBlockView[];
|
|
108
|
+
/** Optional per-child persona — when already set, the caller wins. */
|
|
109
|
+
readonly persona?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Structural view of the continuable start spec the channel merges into
|
|
113
|
+
* (`@deepseek-ai/dsh-subagent` `ContinuableStartSpec` — consumed fields
|
|
114
|
+
* only). The wrapper forwards the spec object SPREAD, so every
|
|
115
|
+
* non-consumed field (`label`, `childId`, `signal`) reaches the service
|
|
116
|
+
* unchanged at runtime; the view types only what this module reads.
|
|
117
|
+
*/
|
|
118
|
+
export interface ContinuableStartSpecView {
|
|
119
|
+
/** The `ctx.subagents` provider whose continuable creation establishes the child. */
|
|
120
|
+
readonly provider: string;
|
|
121
|
+
/** The delegation request (the merge target: same view as the one-shot request). */
|
|
122
|
+
readonly request: SubagentStartRequestView;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Structural view of the capability set the channel gates on
|
|
126
|
+
* (`@deepseek-ai/dsh-subagent` `SubagentCapabilities` — only `persona` is
|
|
127
|
+
* consumed: the ONE-SHOT fail-loud contract rejects a persona request for a
|
|
128
|
+
* provider without it, so the one-shot merge must pre-check).
|
|
129
|
+
*/
|
|
130
|
+
interface SubagentCapabilitiesView {
|
|
131
|
+
readonly persona?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Structural view of one registered provider (`SubagentProvider` consumed
|
|
135
|
+
* surface). `prepareContinuable` is the NATIVE continuable gate (upstream:
|
|
136
|
+
* continuable children "are composed by the continuation manager itself
|
|
137
|
+
* and are gated by `SubagentProvider.prepareContinuable` instead") — its
|
|
138
|
+
* presence, not the one-shot `persona` flag, decides whether a merged
|
|
139
|
+
* persona can be honored on the continuable surface.
|
|
140
|
+
*/
|
|
141
|
+
interface SubagentProviderView {
|
|
142
|
+
readonly capabilities: SubagentCapabilitiesView;
|
|
143
|
+
readonly prepareContinuable?: unknown;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Structural view of the `subagents` runtime the wrapper delegates to
|
|
147
|
+
* (`@deepseek-ai/dsh-subagent` `SubagentRuntime` consumed surface:
|
|
148
|
+
* capability reads + one-shot and continuable starts). Start methods
|
|
149
|
+
* return the service's own promises/ids — opaque here, forwarded untouched.
|
|
150
|
+
*/
|
|
151
|
+
export interface SubagentsServiceView {
|
|
152
|
+
/** Look up a provider by name (the capability-gate read). */
|
|
153
|
+
getProvider(name: string): SubagentProviderView | undefined;
|
|
154
|
+
/** Establish one published child on the named provider (the delegated one-shot start). */
|
|
155
|
+
start(name: string, request: SubagentStartRequestView): unknown;
|
|
156
|
+
/** Establish one durable continuable child (the delegated continuable start). */
|
|
157
|
+
startContinuable(spec: ContinuableStartSpecView): unknown;
|
|
158
|
+
}
|
|
159
|
+
/** Role-persona log levels the module sink understands. */
|
|
160
|
+
export type RolePersonaLogLevel = 'debug' | 'warn';
|
|
161
|
+
/** Module-level log sink — bound by `apply` to `ctx.logger(ROLE_PERSONA_LOGGER)` (agent-flow ledger precedent). */
|
|
162
|
+
export type RolePersonaLogSink = (level: RolePersonaLogLevel, message: string) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Bind the role-persona log sink (the entry `apply` binds it to
|
|
165
|
+
* `ctx.logger(ROLE_PERSONA_LOGGER)`). Returns the PRIOR sink so a caller
|
|
166
|
+
* can restore it (test pattern: agent-flow `setAgentFlowLogger`).
|
|
167
|
+
*/
|
|
168
|
+
export declare function setRolePersonaLogger(sink: RolePersonaLogSink): RolePersonaLogSink;
|
|
169
|
+
/**
|
|
170
|
+
* Bind the persona-defaults mirror root. Returns the PRIOR binding so a
|
|
171
|
+
* caller can restore it (test pattern: {@link setRolePersonaLogger}).
|
|
172
|
+
* @param dir - the mirror root, or `undefined` to disable mirror defaults.
|
|
173
|
+
*/
|
|
174
|
+
export declare function setRolePersonaAgentsDir(dir: string | undefined): string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Register the native persona channel on the plugin's context: an
|
|
177
|
+
* `internal/get` waterfall listener (the cordis service-read interception
|
|
178
|
+
* hook) that wraps `ctx.subagents` reads. The listener is owned by the
|
|
179
|
+
* applying fiber — an HMR fiber swap unwinds it (reads return the raw
|
|
180
|
+
* service again) and a re-apply restores it.
|
|
181
|
+
*
|
|
182
|
+
* Never throws: the wrap step is contained — on any internal error the read
|
|
183
|
+
* returns the UNWRAPPED service value (persona delivery degrades, the
|
|
184
|
+
* runtime is untouched).
|
|
185
|
+
*
|
|
186
|
+
* @param ctx - the plugin's registrant context (the app composition root).
|
|
187
|
+
* @param config - validated plugin configuration (`rolePersonas` is the
|
|
188
|
+
* only payload source; `roleMap` is never consulted for the merge).
|
|
189
|
+
*/
|
|
190
|
+
export declare function registerRolePersonaChannel(ctx: Context, config: Config): void;
|
|
191
|
+
export {};
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* Task 2): the root session's ONE `mstar:harness-rules` pointer section plus
|
|
4
4
|
* the `mstar:engine-status` runtime-context summary, both registered on the
|
|
5
5
|
* GLOBAL prompt layer — visible to the root session AND every dispatched
|
|
6
|
-
* child —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* child — on their own names and layers (the child persona rides the NATIVE
|
|
7
|
+
* subagent persona channel since plan
|
|
8
|
+
* `20260831-dsh-alpha2-optional-fallbacks` Task 3 — no child-scoped
|
|
9
|
+
* `mstar:role-persona` section exists anymore; duplicate-name throws remain
|
|
10
|
+
* per name per layer, verified `scope/src/store.ts`).
|
|
9
11
|
*
|
|
10
12
|
* Content discipline:
|
|
11
13
|
* - The section is a POINTER block (presence / enforcement word / resolved
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
* re-read status.json / the compass / the ledger on every prompt
|
|
53
55
|
* assembly (the catalog's documented staleness tradeoff).
|
|
54
56
|
*
|
|
55
|
-
* Degradation (boot is never affected — the
|
|
57
|
+
* Degradation (boot is never affected — the persona channel's contained-degrade
|
|
56
58
|
* discipline):
|
|
57
59
|
* - Structural existence check via `ctx.get('systemPrompt')` — the
|
|
58
60
|
* `ctx.get('agents')` precedent: a DIRECT `ctx.systemPrompt` property
|
|
@@ -93,7 +95,7 @@ export declare const ENGINE_STATUS_CONTEXT_NAME = "mstar:engine-status";
|
|
|
93
95
|
export declare const ENGINE_STATUS_CONTEXT_ORDER = 100;
|
|
94
96
|
/** Harness-prompt log levels the module sink understands. */
|
|
95
97
|
export type HarnessPromptLogLevel = 'debug' | 'warn';
|
|
96
|
-
/** Module-level harness-prompt log sink — bound by `apply` to `ctx.logger(HARNESS_PROMPT_LOGGER)` (
|
|
98
|
+
/** Module-level harness-prompt log sink — bound by `apply` to `ctx.logger(HARNESS_PROMPT_LOGGER)` (module-sink precedent). */
|
|
97
99
|
export type HarnessPromptLogSink = (level: HarnessPromptLogLevel, message: string) => void;
|
|
98
100
|
/**
|
|
99
101
|
* Bind the harness-prompt log sink (the entry `apply` binds it to
|
package/dist/index.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export type { SkillLintAdvisory } from './gates/skill-lint.ts';
|
|
|
26
26
|
export { SeamVetoError, lintSeamWrite, lintDesignMdWrite, lintAuditWrite, lintCompoundWrite, lintRolesWrite } from './gates/seams.ts';
|
|
27
27
|
export type { SeamId, SeamLintAdvisory } from './gates/seams.ts';
|
|
28
28
|
export type { DispatchGateAdvisory } from './gates/dispatch.ts';
|
|
29
|
-
export {
|
|
30
|
-
export type {
|
|
29
|
+
export { ROLE_PERSONA_LOGGER, registerRolePersonaChannel, setRolePersonaAgentsDir, setRolePersonaLogger, } from './gates/role-persona.ts';
|
|
30
|
+
export type { RolePersonaLogLevel, RolePersonaLogSink, SubagentStartRequestView, SubagentsServiceView } from './gates/role-persona.ts';
|
|
31
31
|
export { ADVISORY_LOGGER, runFallbacksAdvisory, setAdvisoryLogger } from './gates/fallbacks-advisory.ts';
|
|
32
32
|
export type { AdvisoryLogLevel, AdvisoryLogSink } from './gates/fallbacks-advisory.ts';
|
|
33
33
|
export { DshHostAdapter } from './gates/adapter.ts';
|