/** * Morning Star harness gates for dsh (DeepSeek Harness). * * Cordis function plugin: named exports only — the dsh Loader discards the plugin's namespace * (dropping `inject` metadata) when a default export is present, so this module never * default-exports. Registrations happen through `ctx` effects/events in `apply`. * * @module @mstar-harness/dsh */ import { type Context } from '@deepseek-ai/cordis'; import { Config } from './gates/_shared.ts'; import type { StatusGateAdvisory } from './gates/status.ts'; import type { SkillLintAdvisory } from './gates/skill-lint.ts'; import type { SeamLintAdvisory } from './gates/seams.ts'; import { DshHostAdapter } from './gates/adapter.ts'; import type { DispatchGateAdvisory } from './gates/dispatch.ts'; export { DshMstar } from './service.ts'; export type { DshMstarOptions } from './service.ts'; export type { MstarEngineStatusSource, MstarEngineStatusPayload, MstarHarnessState, MstarIterationGateView, AgentFlowEventView, AgentFlowSummaryRow, AgentFlowView, WorkflowSelectionView, } from './types.ts'; export { SETTLE_SEAM, readAgentFlow, recordDispatch, recordSettle, recordWorkflowVerdict, } from './gates/agent-flow.ts'; export type { AgentFlowEvent, DispatchVerdict, SettleOutcome, WorkflowGateMode, WorkflowVerdict, WorkflowVerdictInput, } from './gates/agent-flow.ts'; export { Config, HarnessResolver, skillLocalConfig } from './gates/_shared.ts'; export type { StatusGateAdvisory } from './gates/status.ts'; export { SkillLintVetoError, lintSkillDoc, lintSkillWrite } from './gates/skill-lint.ts'; export type { SkillLintAdvisory } from './gates/skill-lint.ts'; export { SeamVetoError, lintSeamWrite, lintDesignMdWrite, lintAuditWrite, lintCompoundWrite, lintRolesWrite } from './gates/seams.ts'; export type { SeamId, SeamLintAdvisory } from './gates/seams.ts'; export type { DispatchGateAdvisory } from './gates/dispatch.ts'; export { ROLE_PERSONA_LOGGER, registerRolePersonaChannel, setRolePersonaLogger, } from './gates/role-persona.ts'; export type { RolePersonaLogLevel, RolePersonaLogSink, SubagentActivationSpecView, SubagentStartRequestView, SubagentsServiceView } from './gates/role-persona.ts'; export { ADVISORY_LOGGER, runFallbacksAdvisory, setAdvisoryLogger } from './gates/fallbacks-advisory.ts'; export type { AdvisoryLogLevel, AdvisoryLogSink, AdvisoryPassReport } from './gates/fallbacks-advisory.ts'; export { DshHostAdapter } from './gates/adapter.ts'; export type { DshHostAdapterOptions } from './gates/adapter.ts'; /** Cordis function-plugin name registered by the Loader. */ export declare const name = "dsh"; /** * Services required before this plugin's `apply` fiber starts. * `loader` — the dsh profile loader's entry tree — is guaranteed before * apply (the plugin row is composed BY the loader), so the Task 1 probe can * read `ctx.loader.entries()` at decision points (plugin-inventory * precedent; no runtime dependency on `@deepseek-ai/cordis-plugin-loader`). */ export declare const inject: string[]; declare module '@deepseek-ai/cordis' { interface Context { /** * The plugin's engine `HostAdapter` implementation (`host: 'dsh'`) — * provided as a dsh service (constructed in `apply`, same convention as * `ctx.dshMstar`) so host hooks and future inject consumers share the * one instance. */ dshHostAdapter: DshHostAdapter; } interface Events { /** * Advisory: a subagent dispatch passed the dispatch gate in warn mode * (violations logged, dispatch allowed). Emitted only when the Assignment * has violations; clean passes stay silent. * @param payload - the gate verdict and dispatch identity. * @mode emit */ 'mstar/dispatch-gate'(payload: DispatchGateAdvisory): void; /** * Advisory: a `{HARNESS_DIR}/status.json` write/edit intent passed the * status gate in warn mode (violations logged, write allowed). Emitted * only when the current document has violations; clean passes stay silent. * @param payload - the gate verdict and target. * @mode emit */ 'mstar/status-gate'(payload: StatusGateAdvisory): void; /** * Advisory: a `SKILL.md` write-intent under a configured skill root * found skill-authoring lint violations in the pre-write on-disk * document (warn mode), was allowed as a hard-mode repair escape, or * degraded to allow. Emitted only when the current document has * violations; clean passes stay silent. * @param payload - the lint verdict and target. * @mode emit */ 'mstar/skill-lint'(payload: SkillLintAdvisory): void; /** * Advisory: an artifact-scoped write-intent (DESIGN.md / DESIGN.dark.md, * review reports under `{REVIEW_DIR}`, knowledge docs under * `{HARNESS_DIR}/knowledge/`, mstar-roles SKILL.md + references) found * engine violations in the pre-write on-disk document (warn mode), was * allowed as a hard-mode repair escape, or degraded to allow. Emitted * only when the current document has violations; clean passes stay * silent. The `seam` field discriminates the four gates. * @param payload - the gate verdict, seam, and target. * @mode emit */ 'mstar/seam-lint'(payload: SeamLintAdvisory): void; } } /** * Apply the plugin to the registrant context: resolve `{HARNESS_DIR}` via the * engine (per-workspace — the probe never starts from the process cwd), * expose the engine surface as `ctx.dshMstar`, construct the host * adapter (the gates route through it — one code path with the host hooks), * and register the status gate on the fs intent waterfalls + the dispatch * gate on `tools/pre-execute`. * * Layering: the gates are co-located engine wrappers in this * module importing `@mstar-harness/engine` directly (same plugin, engine * bundled at build time); `ctx.dshMstar` is the composition/test façade for * future inject consumers (catalogs) — see the README Service section; the * adapter is the host-facing facade. The engine is the single grammar for * both paths. * @param ctx - Cordis context of the composed app. * @param config - validated plugin configuration. */ export declare function apply(ctx: Context, config: Config): void;