@cofy-x/dsh-console 0.1.0-alpha.4 → 0.1.0-alpha.6

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.
@@ -0,0 +1,32 @@
1
+ // src/config/pokemon-selection.ts
2
+ var POKEMON_NUMBER_ENV = "DSH_CONSOLE_POKEMON";
3
+ function parsePokemonNumber(raw, source) {
4
+ const value = raw.trim();
5
+ if (!/^\d+$/.test(value)) {
6
+ throw new Error(`${source} must be a positive integer.`);
7
+ }
8
+ const pokemonNumber = Number(value);
9
+ if (!Number.isSafeInteger(pokemonNumber) || pokemonNumber < 1) {
10
+ throw new Error(`${source} must be a positive integer.`);
11
+ }
12
+ return pokemonNumber;
13
+ }
14
+ function resolvePokemonNumber(cliValue, envValue) {
15
+ if (cliValue !== void 0) {
16
+ return parsePokemonNumber(cliValue, "--pokemon");
17
+ }
18
+ if (envValue !== void 0) {
19
+ return parsePokemonNumber(envValue, POKEMON_NUMBER_ENV);
20
+ }
21
+ return void 0;
22
+ }
23
+
24
+ export {
25
+ POKEMON_NUMBER_ENV,
26
+ resolvePokemonNumber
27
+ };
28
+ /**
29
+ * @license
30
+ * Copyright 2026 cofy-x
31
+ * SPDX-License-Identifier: Apache-2.0
32
+ */
@@ -10,6 +10,9 @@ export declare const inject: string[];
10
10
  export interface Config {
11
11
  prompt?: string;
12
12
  debug?: boolean;
13
+ pokemon?: number;
14
+ continueSession?: boolean;
15
+ resumeSessionId?: string;
13
16
  }
14
17
  export declare const Config: z<Config>;
15
18
  export declare function apply(ctx: Context, config: Config): void;
package/dist/dsh/index.js CHANGED
@@ -3,8 +3,9 @@ import {
3
3
  apply,
4
4
  inject,
5
5
  name
6
- } from "../chunk-ZO6HZW3P.js";
7
- import "../chunk-N3EQS35J.js";
6
+ } from "../chunk-4NKDFR6S.js";
7
+ import "../chunk-WTD7XY24.js";
8
+ import "../chunk-4L2DX7CL.js";
8
9
  export {
9
10
  Config,
10
11
  apply,
@@ -3,6 +3,7 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { Command } from 'commander';
6
7
  import type { Context } from '@deepseek-ai/cordis';
7
8
  export declare const name = "dsh-console-startup";
8
9
  export declare const inject: string[];
@@ -10,5 +11,9 @@ export declare const DSH_CONSOLE_STARTUP_SERVICE = "dshConsoleStartup";
10
11
  export interface DshConsoleStartupValues {
11
12
  prompt?: string;
12
13
  debug: boolean;
14
+ pokemon?: number;
15
+ continueSession?: boolean;
16
+ resumeSessionId?: string;
13
17
  }
18
+ export declare function createStartupCommand(provide: (values: DshConsoleStartupValues) => void, env?: NodeJS.ProcessEnv): Command;
14
19
  export declare function apply(ctx: Context): void;
@@ -1,22 +1,61 @@
1
+ import {
2
+ POKEMON_NUMBER_ENV,
3
+ resolvePokemonNumber
4
+ } from "../chunk-WTD7XY24.js";
5
+
1
6
  // src/dsh/startup.ts
2
- import { Command } from "commander";
7
+ import { Command, Option } from "commander";
3
8
  import { parseCmdline } from "@deepseek-ai/dsh-cmdline";
4
9
  var name = "dsh-console-startup";
5
10
  var inject = ["cmdlineArgs"];
6
11
  var DSH_CONSOLE_STARTUP_SERVICE = "dshConsoleStartup";
7
- function apply(ctx) {
8
- const program = new Command().name("dsh-console").description("Run DeepSeek Harness with the DSH Console terminal frontend.").helpOption("-h, --help", "show this help").option("-d, --debug", "enable DSH Console diagnostics", false).option("-p, --prompt <text>", "submit an initial prompt after startup");
9
- program.action((options) => {
10
- ctx.provide(DSH_CONSOLE_STARTUP_SERVICE, {
12
+ function createStartupCommand(provide, env = process.env) {
13
+ const program = new Command().name("dsh-console").description("Run DeepSeek Harness with the DSH Console terminal frontend.").helpOption("-h, --help", "show this help").option("-d, --debug", "enable DSH Console diagnostics", false).option(
14
+ "--pokemon <number>",
15
+ "use a bundled Pokemon number for this launch"
16
+ ).option("-p, --prompt <text>", "submit an initial prompt after startup").addOption(
17
+ new Option(
18
+ "-c, --continue",
19
+ "resume the latest Session for this directory"
20
+ ).conflicts("resume")
21
+ ).addOption(
22
+ new Option(
23
+ "--resume <session-id>",
24
+ "resume a specific Session for this directory"
25
+ ).conflicts("continue")
26
+ ).action((options) => {
27
+ const resumeSessionId = options.resume?.trim();
28
+ if (options.resume !== void 0 && !resumeSessionId) {
29
+ program.error(
30
+ "error: option '--resume <session-id>' requires a non-empty Session id"
31
+ );
32
+ }
33
+ const pokemon = resolvePokemonNumber(
34
+ options.pokemon,
35
+ env[POKEMON_NUMBER_ENV]
36
+ );
37
+ provide({
11
38
  ...options.prompt === void 0 ? {} : { prompt: options.prompt },
39
+ ...pokemon === void 0 ? {} : { pokemon },
40
+ ...options.continue === true ? { continueSession: true } : {},
41
+ ...resumeSessionId === void 0 ? {} : { resumeSessionId },
12
42
  debug: options.debug
13
43
  });
14
44
  });
15
- parseCmdline(ctx, program);
45
+ return program;
46
+ }
47
+ function apply(ctx) {
48
+ parseCmdline(
49
+ ctx,
50
+ createStartupCommand(
51
+ (values) => ctx.provide(DSH_CONSOLE_STARTUP_SERVICE, values)
52
+ )
53
+ );
16
54
  }
17
55
  export {
18
56
  DSH_CONSOLE_STARTUP_SERVICE,
19
57
  apply,
58
+ createStartupCommand,
20
59
  inject,
21
60
  name
22
61
  };
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@ import {
2
2
  Config,
3
3
  apply,
4
4
  name
5
- } from "./chunk-ZO6HZW3P.js";
6
- import "./chunk-N3EQS35J.js";
5
+ } from "./chunk-4NKDFR6S.js";
6
+ import "./chunk-WTD7XY24.js";
7
+ import "./chunk-4L2DX7CL.js";
7
8
  export {
8
9
  Config,
9
10
  apply,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerExtensionContentRenderer
3
- } from "../chunk-N3EQS35J.js";
3
+ } from "../chunk-4L2DX7CL.js";
4
4
  export {
5
5
  registerExtensionContentRenderer
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofy-x/dsh-console",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "A TypeScript and React/Ink terminal frontend for DeepSeek Harness.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "prepack": "pnpm run build",
33
33
  "start": "node dist/index.js",
34
34
  "debug": "node --inspect-brk dist/index.js",
35
- "lint": "eslint . --ext .ts,.tsx",
35
+ "lint": "eslint . --ext .ts,.tsx --max-warnings=0",
36
36
  "format": "prettier --write .",
37
37
  "test": "vitest run",
38
38
  "test:ci": "vitest run --coverage --exclude '**/*.performance.test.ts'",
@@ -104,6 +104,8 @@
104
104
  "@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
105
105
  "@deepseek-ai/dsh-session-query": "0.1.1-rc.2",
106
106
  "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
107
+ "@deepseek-ai/dsh-subagent": "0.1.1-rc.2",
108
+ "@deepseek-ai/dsh-tool-todo": "0.1.1-rc.2",
107
109
  "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
108
110
  "@deepseek-ai/dsh-user-approval": "0.1.1-rc.2",
109
111
  "@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
@@ -132,6 +134,8 @@
132
134
  "@deepseek-ai/dsh-session-projection": ">=0.1.0-rc.3 <0.2.0",
133
135
  "@deepseek-ai/dsh-session-query": ">=0.1.0-rc.3 <0.2.0",
134
136
  "@deepseek-ai/dsh-settings": ">=0.1.0-rc.3 <0.2.0",
137
+ "@deepseek-ai/dsh-subagent": ">=0.1.0-rc.3 <0.2.0",
138
+ "@deepseek-ai/dsh-tool-todo": ">=0.1.0-rc.3 <0.2.0",
135
139
  "@deepseek-ai/dsh-tools": ">=0.1.0-rc.3 <0.2.0",
136
140
  "@deepseek-ai/dsh-user-approval": ">=0.1.0-rc.3 <0.2.0",
137
141
  "@deepseek-ai/dsh-user-questions": ">=0.1.0-rc.3 <0.2.0"
@@ -167,6 +171,9 @@
167
171
  "@deepseek-ai/dsh-session-query": {
168
172
  "optional": true
169
173
  },
174
+ "@deepseek-ai/dsh-tool-todo": {
175
+ "optional": true
176
+ },
170
177
  "@deepseek-ai/dsh-tools": {
171
178
  "optional": true
172
179
  },
@@ -184,6 +191,9 @@
184
191
  },
185
192
  "@deepseek-ai/dsh-settings": {
186
193
  "optional": true
194
+ },
195
+ "@deepseek-ai/dsh-subagent": {
196
+ "optional": true
187
197
  }
188
198
  },
189
199
  "license": "Apache-2.0",