@lmzhen/dsh-evolution-commands 0.48.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.
@@ -4,4 +4,11 @@ export interface HostCommandDef extends CommandDef {
4
4
  readonly usageLine: string;
5
5
  }
6
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;
7
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
@@ -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
@@ -20,9 +20,6 @@ export declare function summaryOf(entry: HostCommandDef, locale?: HostLocale): s
20
20
  export declare function renderHint(): string;
21
21
  /** The bare `/evolution` help body (one line per subcommand). */
22
22
  export declare function renderHelpText(locale?: HostLocale): string;
23
- /** Markdown command table fragment for README surfaces (T-WD2 pins it).
24
- * `|` inside a usage (curator run|pause|…) is escaped for the table cell. */
25
- export declare function renderCommandTable(): string;
26
23
  /** Union of every entry's authored value flags. */
27
24
  export declare const VALUE_FLAGS: readonly string[];
28
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.48.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.48.0",
33
- "@lmzhen/dsh-evolution-core": "^0.48.0",
34
- "@lmzhen/dsh-evolution-maintenance": "^0.48.0",
35
- "@lmzhen/dsh-evolution-state": "^0.48.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.48.0"
38
+ "@lmzhen/dsh-evolution-agent-preset": "^0.49.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@deepseek-ai/cordis": "^4.0.5",