@lmzhen/dsh-evolution-commands 0.47.0 → 0.49.0

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.
@@ -12,6 +12,15 @@ import type { Context } from '@deepseek-ai/cordis';
12
12
  import { type ChannelState, type DiagnosticsView } from '@lmzhen/dsh-evolution-core';
13
13
  /** The install form the running profile was classified as (the seven values DoctorReport uses). */
14
14
  export type InstallFormId = 'full' | 'human-gated' | 'preset' | 'host' | 'layered' | 'preset-only' | 'none';
15
+ /** The ONE install-form decision; callers only supply the facts their detection read. */
16
+ export declare function classifyInstallForm(input: {
17
+ readonly full: boolean;
18
+ readonly preset: boolean;
19
+ readonly host: boolean;
20
+ readonly humanGated: boolean;
21
+ readonly layeredPreset: boolean;
22
+ readonly presetDirInstalled: boolean;
23
+ }): InstallFormId;
15
24
  /** One preset's probe result (reviewer/maintainer). */
16
25
  export interface PresetFacts {
17
26
  readonly registered: boolean;
@@ -1,6 +1,7 @@
1
1
  import type { HostLocale } from '@lmzhen/dsh-evolution-core';
2
2
  import { type PlatformServiceProbe, type ScopedProbeReport } from '@lmzhen/dsh-evolution-core';
3
3
  import type { DiagnosticsView } from '@lmzhen/dsh-evolution-core';
4
+ import { type InstallFormId } from './doctor-view.ts';
4
5
  import type { MountedProfile } from './profiles.ts';
5
6
  /** P2-20 (audit): the TS-side copy of the install-target tails. The script
6
7
  * side (install-layered.mjs, verify-profile-bundles.mjs) imports the list
@@ -74,7 +75,7 @@ export interface DoctorReport {
74
75
  * per-session install reported `none` and the action ladder advised
75
76
  * installing `all` — which double-mounts the preset's model rows (the
76
77
  * exact conflict this report flags). */
77
- installForm: 'full' | 'human-gated' | 'host' | 'preset' | 'layered' | 'preset-only' | 'none';
78
+ installForm: InstallFormId;
78
79
  /** Aggregated across ALL profiles under `home` (N13, v12): doctor answers
79
80
  * "is any profile carrying an evolution bundle / which install forms exist"
80
81
  * — not "what this runtime mounted". `services.review` is the runtime-side
@@ -463,14 +463,14 @@ export declare const HOST_COMMANDS: {
463
463
  readonly pt: "atualizado — uma nova geração corresponde byte a byte a este arquivo";
464
464
  };
465
465
  readonly "doctor.presetDiffers": {
466
- readonly zh: "与最新生成不同 — 这是安装时快照;重新运行安装器(/evolution preset install)以重新生成";
467
- readonly en: "DIFFERS from a fresh generation — it is an install-time snapshot; re-run the installer (/evolution preset install) to regenerate";
468
- readonly ja: "最新の生成結果と異なります — インストール時のスナップショットです。インストーラー(/evolution preset install)を再実行して再生成してください";
469
- readonly es: "DIFIERE de una generación nueva — es una instantánea del momento de instalar; vuelve a ejecutar el instalador (/evolution preset install) para regenerarla";
470
- readonly fr: "DIFFÈRE d’une nouvelle génération — c’est un instantané de l’installation ; relancez l’installateur (/evolution preset install) pour la régénérer";
471
- readonly de: "WEICHT von einer neuen Erzeugung ab — es ist ein Installations-Snapshot; Installer erneut ausführen (/evolution preset install), um ihn neu zu erzeugen";
472
- readonly ru: "ОТЛИЧАЕТСЯ от новой генерации — это снимок на момент установки; запустите установщик повторно (/evolution preset install)";
473
- readonly pt: "DIFERE de uma nova geração — é um instantâneo do momento da instalação; execute o instalador novamente (/evolution preset install)";
466
+ readonly zh: "与最新生成不同 — 这是安装时快照;重新运行安装器(all/host)以重新生成";
467
+ readonly en: "DIFFERS from a fresh generation — it is an install-time snapshot; re-run the installer (all/host) to regenerate";
468
+ readonly ja: "最新の生成結果と異なります — インストール時のスナップショットです。インストーラー(all/host)を再実行して再生成してください";
469
+ readonly es: "DIFIERE de una generación nueva — es una instantánea del momento de instalar; vuelve a ejecutar el instalador (all/host) para regenerarla";
470
+ readonly fr: "DIFFÈRE d’une nouvelle génération — c’est un instantané de l’installation ; relancez l’installateur (all/host) pour la régénérer";
471
+ readonly de: "WEICHT von einer neuen Erzeugung ab — es ist ein Installations-Snapshot; Installer erneut ausführen (all/host), um ihn neu zu erzeugen";
472
+ readonly ru: "ОТЛИЧАЕТСЯ от новой генерации — это снимок на момент установки; запустите установщик повторно (all/host)";
473
+ readonly pt: "DIFERE de uma nova geração — é um instantâneo do momento da instalação; execute o instalador novamente (all/host)";
474
474
  };
475
475
  readonly "doctor.presetUnknown": {
476
476
  readonly zh: "未知 — 无法重新生成({detail})";
@@ -0,0 +1,14 @@
1
+ /** Typed host-command definitions: one source for help, surface and dispatch. */
2
+ import type { CommandDef } from './command-catalog.ts';
3
+ export interface HostCommandDef extends CommandDef {
4
+ readonly usageLine: string;
5
+ }
6
+ export declare const HOST_COMMAND_DEFS: readonly HostCommandDef[];
7
+ /** Resolve a parsed command to its declaration: the longest `words` prefix wins. */
8
+ export declare function hostCommandDefForCommand(command: {
9
+ readonly name: string;
10
+ readonly positionals: readonly string[];
11
+ }): HostCommandDef | undefined;
12
+ /** Resolve one single-token command name to its declaration. */
13
+ export declare function hostCommandDefForName(name: string): HostCommandDef | undefined;
14
+ //# sourceMappingURL=host-command-defs.d.ts.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The approval-facing commands: the pending window and the three decisions.
3
+ * They share one context; the parser and the handler table stay in index.ts until D3 moves them.
4
+ * @module evolution-commands/src/host-commands/approval-commands
5
+ */
6
+ import type { ApprovalLike } from '@lmzhen/dsh-evolution-approval';
7
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
8
+ import type { HostLocale } from '@lmzhen/dsh-evolution-core';
9
+ import type { ParsedCommand } from '../parse.ts';
10
+ /** What the approval handlers need from the command body. */
11
+ export interface ApprovalCommandContext {
12
+ readonly command: ParsedCommand;
13
+ readonly approval: ApprovalLike | undefined;
14
+ readonly locale: HostLocale;
15
+ }
16
+ /**
17
+ * The pending window, including the executing rows and the TTL note.
18
+ * @param context - approval service, command shape and locale.
19
+ * @returns the rendered window or the service error.
20
+ */
21
+ export declare function runPendingCommand(context: ApprovalCommandContext): Promise<CommandResult>;
22
+ /**
23
+ * One decision verb: approve, reject or release, with the service-unavailable posture of each.
24
+ * @param verb - the decision.
25
+ * @param id - the staged record id.
26
+ * @param context - approval service and locale.
27
+ * @returns the service message as success or error.
28
+ */
29
+ export declare function runDecisionCommand(verb: 'approve' | 'reject' | 'release', id: string, context: ApprovalCommandContext): Promise<CommandResult>;
30
+ //# sourceMappingURL=approval-commands.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The curator subcommands: run / pause / resume / status / scope / report.
3
+ * One function keeps their shared service lookup and error posture together.
4
+ * @module evolution-commands/src/host-commands/curator-command
5
+ */
6
+ import type { HostLocale } from '@lmzhen/dsh-evolution-core';
7
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
8
+ /** What the curator handler needs from the command body. */
9
+ export interface CuratorCommandContext {
10
+ readonly input: string;
11
+ readonly ctx: {
12
+ get(name: string): unknown;
13
+ };
14
+ readonly locale: HostLocale;
15
+ }
16
+ /**
17
+ * Run one curator subcommand. Returns undefined when the input is not a curator command,
18
+ * so the legacy chain can answer.
19
+ * @param context - raw input, service context and locale.
20
+ * @returns the command result or undefined.
21
+ */
22
+ export declare function runCuratorCommand(context: CuratorCommandContext): Promise<CommandResult | undefined>;
23
+ /** The read-only mutations log (separate command id, same curator service). */
24
+ export declare function runMutationsCommand(context: CuratorCommandContext): Promise<CommandResult | undefined>;
25
+ //# sourceMappingURL=curator-command.d.ts.map
@@ -0,0 +1,21 @@
1
+ /** The read-only doctor surface: the CLI view and its --json form. */
2
+ import type { HostLocale } from '@lmzhen/dsh-evolution-core';
3
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
4
+ import { diagnose } from '../doctor.ts';
5
+ /** What the doctor handler needs. */
6
+ export interface DoctorCommandContext {
7
+ readonly input: string;
8
+ readonly ctx: Parameters<typeof diagnose>[0];
9
+ readonly runs: () => {
10
+ running: number;
11
+ orphaned: number;
12
+ };
13
+ readonly locale: HostLocale;
14
+ }
15
+ /**
16
+ * Render the doctor report for the bare and --json forms.
17
+ * @param context - raw input, plugin context, run counts and locale.
18
+ * @returns the report, or undefined for a different command.
19
+ */
20
+ export declare function runDoctorCommand(context: DoctorCommandContext): Promise<CommandResult | undefined>;
21
+ //# sourceMappingURL=doctor-command.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** Extracted command handlers; the legacy chain answers whatever is not here. */
2
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
3
+ import type { SettingsProviderLike } from '@lmzhen/dsh-evolution-core';
4
+ import { type ApprovalCommandContext } from './approval-commands.ts';
5
+ /** What every extracted handler receives. */
6
+ export interface CommandHandlerContext extends ApprovalCommandContext {
7
+ readonly input: string;
8
+ readonly provider?: SettingsProviderLike | undefined;
9
+ readonly ctx?: {
10
+ get(name: string): unknown;
11
+ } | undefined;
12
+ readonly runs?: (() => {
13
+ running: number;
14
+ orphaned: number;
15
+ }) | undefined;
16
+ readonly refusal?: ((what: string) => CommandResult | undefined) | undefined;
17
+ }
18
+ export type CommandHandler = (context: CommandHandlerContext) => Promise<CommandResult | undefined> | CommandResult | undefined;
19
+ export declare const HOST_COMMAND_HANDLERS: Readonly<Record<string, CommandHandler>>;
20
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1,17 @@
1
+ /** The read-only `params` surface: provider rows filtered by group, text or JSON. */
2
+ import type { HostLocale, SettingsProviderLike } from '@lmzhen/dsh-evolution-core';
3
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
4
+ import type { ParsedCommand } from '../parse.ts';
5
+ /** What the params handler needs. */
6
+ export interface ParamsCommandContext {
7
+ readonly command: ParsedCommand;
8
+ readonly provider: SettingsProviderLike | undefined;
9
+ readonly locale: HostLocale;
10
+ }
11
+ /**
12
+ * Render the parameter registry. Unreadable provider is a refusal, not an empty override set.
13
+ * @param context - command, settings provider and locale.
14
+ * @returns the rows/JSON, or the settings/group error.
15
+ */
16
+ export declare function runParamsCommand(context: ParamsCommandContext): CommandResult;
17
+ //# sourceMappingURL=params-command.d.ts.map
@@ -0,0 +1,17 @@
1
+ /** The two whole/single-tree restore commands, both behind the same replayability refusal. */
2
+ import type { HostLocale } from '@lmzhen/dsh-evolution-core';
3
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
4
+ /** What the restore handlers need. */
5
+ export interface RestoreCommandContext {
6
+ readonly input: string;
7
+ readonly ctx: {
8
+ get(name: string): unknown;
9
+ };
10
+ readonly locale: HostLocale;
11
+ readonly refusal: (what: string) => CommandResult | undefined;
12
+ }
13
+ /** The whole-tree restore. A tail is refused so a missing `skill ` prefix cannot roll back everything. */
14
+ export declare function runRestoreCommand(context: RestoreCommandContext): Promise<CommandResult | undefined>;
15
+ /** One skill restore. */
16
+ export declare function runSkillRestoreCommand(context: RestoreCommandContext): Promise<CommandResult | undefined>;
17
+ //# sourceMappingURL=restore-commands.d.ts.map
@@ -0,0 +1,17 @@
1
+ /** The read-only skill history and its undo (the undo write stays behind the refusal seam). */
2
+ import type { HostLocale } from '@lmzhen/dsh-evolution-core';
3
+ import type { CommandResult } from '@lmzhen/dsh-evolution-core/platform';
4
+ /** What the two handlers need. */
5
+ export interface SkillHistoryCommandContext {
6
+ readonly input: string;
7
+ readonly ctx: {
8
+ get(name: string): unknown;
9
+ };
10
+ readonly locale: HostLocale;
11
+ readonly refusal: (what: string) => CommandResult | undefined;
12
+ }
13
+ /** `skill history <name>`: content versions and support-file versions, kept apart. */
14
+ export declare function runSkillHistoryCommand(context: SkillHistoryCommandContext): Promise<CommandResult | undefined>;
15
+ /** `skill undo <name> [--to vN | --unit <id>]`. */
16
+ export declare function runSkillUndoCommand(context: SkillHistoryCommandContext): Promise<CommandResult | undefined>;
17
+ //# sourceMappingURL=skill-history-commands.d.ts.map
@@ -55,31 +55,6 @@ export declare function paramGroups(entries?: readonly ParamExposure[]): string[
55
55
  export declare function renderParamRows(rows: readonly ParamSurfaceRow[], options: {
56
56
  providerMounted: boolean;
57
57
  }): string;
58
- /**
59
- * Parse one command-line value into what the settings document stores: JSON
60
- * when it parses (numbers, booleans, quoted strings, arrays, objects), the raw
61
- * text otherwise, so a bare word like `enforce` stays a word.
62
- * @param raw - the text typed after the parameter id.
63
- * @returns the value to write.
64
- */
65
- export declare function parseParamValue(raw: string): unknown;
66
- /** One accepted write, as the command echoes it back. */
67
- export interface ParamWriteEcho {
68
- id: string;
69
- namespace: string;
70
- applies: ParamExposure['applies'];
71
- before: unknown;
72
- after: unknown;
73
- /** Whether the user section already carried this key. */
74
- wasOverridden: boolean;
75
- }
76
- /**
77
- * Render the write result: the value move, then where it landed and when it
78
- * takes effect (the two things a caller cannot infer from the command line).
79
- * @param write - the accepted write.
80
- * @returns the command text.
81
- */
82
- export declare function renderPolicySet(write: ParamWriteEcho): string;
83
58
  /**
84
59
  * Render the rows as JSON for scripts (same fields, no formatting).
85
60
  * @param rows - rows from {@link paramSurfaceRows}.
@@ -13,8 +13,6 @@
13
13
  *
14
14
  * @module @lmzhen/dsh-evolution-commands/parse
15
15
  */
16
- /** The flags whose declared form takes a value, derived from the command table's usage lines. */
17
- export { VALUE_FLAGS } from './registry.ts';
18
16
  /** One parsed command line. */
19
17
  export interface ParsedCommand {
20
18
  /** The subcommand name, lower-cased (the table stores it lower-case too). */
@@ -39,19 +37,6 @@ export interface ParseFailure {
39
37
  * @returns whether the line was refused.
40
38
  */
41
39
  export declare function isParseFailure(result: ParsedCommand | ParseFailure): result is ParseFailure;
42
- /**
43
- * Read one SUB-FORM line: `maintain status`, `maintain report`, … — the shape the regexes used to own.
44
- *
45
- * A sub-form matches only when: the line parses, the name matches, the first positional is the sub-form,
46
- * and every flag the line carries is DECLARED by the table (an undeclared flag keeps the old
47
- * "unknown arguments" answer instead of silently becoming a bare flag).
48
- * @param input - the text after `/evolution`.
49
- * @param name - the subcommand name the table declares (e.g. `maintain`).
50
- * @param sub - the sub-form word (e.g. `status`).
51
- * @param declaredFlags - the flags the table declares for `name` (`flagsOf(name)`).
52
- * @returns the parsed command, or null when this line is not that sub-form.
53
- */
54
- export declare function subcommandOf(input: string, name: string, sub: string, declaredFlags: readonly string[]): ParsedCommand | null;
55
40
  /**
56
41
  * Parse one command line into its name, flags and positionals.
57
42
  * @param input - the text after `/evolution`.
@@ -24,7 +24,7 @@ export type ProfilesScan = {
24
24
  export declare function scanProfiles(home: string): ProfilesScan;
25
25
  /** Every profile directory under one home, by name — the DIAGNOSTIC question (doctor's cross-profile
26
26
  * summary). An unreadable home answers the empty list here because doctor reports the failure on its
27
- * own DEGRADED row; a write path must ask {@link installExclusionTarget} instead.
27
+ * own DEGRADED row.
28
28
  * @param home - the resolved DSH home.
29
29
  * @returns one entry per profile directory carrying a manifest.
30
30
  */
@@ -54,21 +54,4 @@ export interface MountedProfile {
54
54
  /** The bundles this plane actually STARTED (the platform's `startedBundles`). */
55
55
  readonly bundles: readonly string[];
56
56
  }
57
- /** Where the preset-install exclusion must look: THIS plane only, or an explicit refusal.
58
- *
59
- * The write path does NOT scan the home: the mounted profile is the whole question (its started
60
- * bundles plus the ones its own manifest declares — either can double-mount), and a question that
61
- * cannot be answered still REFUSES. That is what makes a leftover profile from the other plane
62
- * harmless here: it is not this plane's profile, so it is never consulted.
63
- * @param mounted - the mounted profile, or undefined outside a profile (a bare library mount).
64
- * @returns the profile to judge with its bundle rows, or the reason a refusal is mandatory.
65
- */
66
- export declare function installExclusionTarget(mounted: MountedProfile | undefined): {
67
- readonly kind: 'mounted';
68
- readonly profile: HomeProfile;
69
- readonly bundles: readonly string[];
70
- } | {
71
- readonly kind: 'undecidable';
72
- readonly reason: string;
73
- };
74
57
  //# sourceMappingURL=profiles.d.ts.map
@@ -1,13 +1,7 @@
1
1
  import type { HostLocale } from '@lmzhen/dsh-evolution-core';
2
- export interface CommandEntry {
3
- /** The subcommand as typed after `/evolution`. Variants use `|` (curator run|pause). */
4
- usage: string;
5
- /** C7: true when the subcommand only READS (no skill/param write). Stored: not derivable. */
6
- readonly: boolean;
7
- /** One-line purpose rendered in the help output. */
8
- summary: string;
9
- }
10
- /** The flags the TABLE declares for one subcommand (name → `--flag`), DERIVED from its usage. */
2
+ import { type HostCommandDef } from './host-command-defs.ts';
3
+ export { HOST_COMMAND_DEFS } from './host-command-defs.ts';
4
+ /** The flags the TABLE declares for one subcommand (name → `--flag`). */
11
5
  export declare function flagsOf(name: string): string[];
12
6
  /**
13
7
  * C7 shape, DERIVED: the entry IDENTITY key, and it is HIERARCHICAL (E-08).
@@ -19,23 +13,13 @@ export declare function flagsOf(name: string): string[];
19
13
  * still resolve: the one call site that named an entry by a name the key no longer produced was the preset
20
14
  * dispatch branch, and it now asks for the entry own key (`preset install`).
21
15
  */
22
- export declare function entryName(entry: CommandEntry): string;
23
- /** C7 shape, DERIVED: the flags a `usage` declares, in the form `--flag` (value flags keep their name). */
24
- export declare function entryFlags(entry: CommandEntry): string[];
25
- export declare const COMMAND_ENTRIES: CommandEntry[];
16
+ export declare function entryName(entry: HostCommandDef): string;
17
+ /** The one summary source: the generated command i18n catalog. */
18
+ export declare function summaryOf(entry: HostCommandDef, locale?: HostLocale): string;
26
19
  /** The input-declaration hint (single line, ` | `-separated). */
27
20
  export declare function renderHint(): string;
28
21
  /** The bare `/evolution` help body (one line per subcommand). */
29
22
  export declare function renderHelpText(locale?: HostLocale): string;
30
- /** Markdown command table fragment for README surfaces (T-WD2 pins it).
31
- * `|` inside a usage (curator run|pause|…) is escaped for the table cell. */
32
- export declare function renderCommandTable(): string;
33
- /**
34
- * The flags whose declared form takes a value, DERIVED from the usage text: a flag followed by
35
- * `=` or by a placeholder token (not another flag/bracket) is a value flag. Boolean flags stay
36
- * out. The parser imports this, so `--proposal p1` cannot be read as a bare boolean again.
37
- */
38
- export declare function entryValueFlags(entry: CommandEntry): string[];
39
- /** Union of every usage's value flags (the parse table's ONE source). */
23
+ /** Union of every entry's authored value flags. */
40
24
  export declare const VALUE_FLAGS: readonly string[];
41
25
  //# sourceMappingURL=registry.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-commands",
3
3
  "description": "Human commands for the evolution family (/evolution pending|curator|maintain|doctor) (community build)",
4
- "version": "0.47.0",
4
+ "version": "0.49.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,13 +29,13 @@
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
31
  "@deepseek-ai/schemastery": "^3.18.5",
32
- "@lmzhen/dsh-evolution-approval": "^0.47.0",
33
- "@lmzhen/dsh-evolution-core": "^0.47.0",
34
- "@lmzhen/dsh-evolution-maintenance": "^0.47.0",
35
- "@lmzhen/dsh-evolution-state": "^0.47.0"
32
+ "@lmzhen/dsh-evolution-approval": "^0.49.0",
33
+ "@lmzhen/dsh-evolution-core": "^0.49.0",
34
+ "@lmzhen/dsh-evolution-maintenance": "^0.49.0",
35
+ "@lmzhen/dsh-evolution-state": "^0.49.0"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@lmzhen/dsh-evolution-agent-preset": "^0.47.0"
38
+ "@lmzhen/dsh-evolution-agent-preset": "^0.49.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@deepseek-ai/cordis": "^4.0.5",