@cofy-x/dsh-console 0.1.0-alpha.3 → 0.1.0-alpha.5

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,7 @@ export declare const inject: string[];
10
10
  export interface Config {
11
11
  prompt?: string;
12
12
  debug?: boolean;
13
+ pokemon?: number;
13
14
  }
14
15
  export declare const Config: z<Config>;
15
16
  export declare function apply(ctx: Context, config: Config): void;
package/dist/dsh/index.js CHANGED
@@ -3,7 +3,8 @@ import {
3
3
  apply,
4
4
  inject,
5
5
  name
6
- } from "../chunk-2S7URHRK.js";
6
+ } from "../chunk-6BGDBP2N.js";
7
+ import "../chunk-WTD7XY24.js";
7
8
  import "../chunk-N3EQS35J.js";
8
9
  export {
9
10
  Config,
@@ -10,5 +10,6 @@ export declare const DSH_CONSOLE_STARTUP_SERVICE = "dshConsoleStartup";
10
10
  export interface DshConsoleStartupValues {
11
11
  prompt?: string;
12
12
  debug: boolean;
13
+ pokemon?: number;
13
14
  }
14
15
  export declare function apply(ctx: Context): void;
@@ -1,3 +1,8 @@
1
+ import {
2
+ POKEMON_NUMBER_ENV,
3
+ resolvePokemonNumber
4
+ } from "../chunk-WTD7XY24.js";
5
+
1
6
  // src/dsh/startup.ts
2
7
  import { Command } from "commander";
3
8
  import { parseCmdline } from "@deepseek-ai/dsh-cmdline";
@@ -5,13 +10,23 @@ var name = "dsh-console-startup";
5
10
  var inject = ["cmdlineArgs"];
6
11
  var DSH_CONSOLE_STARTUP_SERVICE = "dshConsoleStartup";
7
12
  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, {
11
- ...options.prompt === void 0 ? {} : { prompt: options.prompt },
12
- debug: options.debug
13
- });
14
- });
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");
17
+ program.action(
18
+ (options) => {
19
+ const pokemon = resolvePokemonNumber(
20
+ options.pokemon,
21
+ process.env[POKEMON_NUMBER_ENV]
22
+ );
23
+ ctx.provide(DSH_CONSOLE_STARTUP_SERVICE, {
24
+ ...options.prompt === void 0 ? {} : { prompt: options.prompt },
25
+ ...pokemon === void 0 ? {} : { pokemon },
26
+ debug: options.debug
27
+ });
28
+ }
29
+ );
15
30
  parseCmdline(ctx, program);
16
31
  }
17
32
  export {
package/dist/index.js CHANGED
@@ -2,7 +2,8 @@ import {
2
2
  Config,
3
3
  apply,
4
4
  name
5
- } from "./chunk-2S7URHRK.js";
5
+ } from "./chunk-6BGDBP2N.js";
6
+ import "./chunk-WTD7XY24.js";
6
7
  import "./chunk-N3EQS35J.js";
7
8
  export {
8
9
  Config,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofy-x/dsh-console",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "A TypeScript and React/Ink terminal frontend for DeepSeek Harness.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,12 +32,12 @@
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'",
39
39
  "test:performance": "vitest run --coverage.enabled=false --maxWorkers=1 src/ui/hooks/input/use-text-buffer.performance.test.ts",
40
- "typecheck": "tsc --noEmit",
40
+ "typecheck": "tsc --noEmit -p tsconfig.build.json && tsc -p tsconfig.json",
41
41
  "example": "tsx --tsconfig examples/tsconfig.run.json",
42
42
  "example:debug": "TSX_TSCONFIG_PATH=examples/tsconfig.run.json node --inspect-brk --import tsx/esm",
43
43
  "link": "pnpm run build && pnpm link --global",
@@ -96,6 +96,7 @@
96
96
  "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
97
97
  "@deepseek-ai/dsh-agent-default-model": "0.1.1-rc.2",
98
98
  "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
99
+ "@deepseek-ai/dsh-commands": "0.1.1-rc.2",
99
100
  "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
100
101
  "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
101
102
  "@deepseek-ai/dsh-permission-presets": "0.1.1-rc.2",
@@ -103,11 +104,12 @@
103
104
  "@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
104
105
  "@deepseek-ai/dsh-session-query": "0.1.1-rc.2",
105
106
  "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
107
+ "@deepseek-ai/dsh-subagent": "0.1.1-rc.2",
106
108
  "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
107
109
  "@deepseek-ai/dsh-user-approval": "0.1.1-rc.2",
108
110
  "@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
109
- "@deepseek-ai/dsh-commands": "0.1.1-rc.2",
110
111
  "@types/hast": "^3.0.4",
112
+ "@types/node": "^24.10.1",
111
113
  "@types/react": "^19.2.18",
112
114
  "@types/react-dom": "^19.2.0",
113
115
  "@types/yargs": "^17.0.34",
@@ -123,17 +125,18 @@
123
125
  "@deepseek-ai/dsh-agent": ">=0.1.0-rc.3 <0.2.0",
124
126
  "@deepseek-ai/dsh-agent-default-model": ">=0.1.0-rc.3 <0.2.0",
125
127
  "@deepseek-ai/dsh-attachment": ">=0.1.0-rc.3 <0.2.0",
128
+ "@deepseek-ai/dsh-commands": ">=0.1.0-rc.3 <0.2.0",
129
+ "@deepseek-ai/dsh-credentials": ">=0.1.0-rc.3 <0.2.0",
126
130
  "@deepseek-ai/dsh-llm": ">=0.1.0-rc.3 <0.2.0",
127
131
  "@deepseek-ai/dsh-permission-presets": ">=0.1.0-rc.3 <0.2.0",
128
132
  "@deepseek-ai/dsh-session": ">=0.1.0-rc.3 <0.2.0",
129
133
  "@deepseek-ai/dsh-session-projection": ">=0.1.0-rc.3 <0.2.0",
130
134
  "@deepseek-ai/dsh-session-query": ">=0.1.0-rc.3 <0.2.0",
135
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.3 <0.2.0",
136
+ "@deepseek-ai/dsh-subagent": ">=0.1.0-rc.3 <0.2.0",
131
137
  "@deepseek-ai/dsh-tools": ">=0.1.0-rc.3 <0.2.0",
132
138
  "@deepseek-ai/dsh-user-approval": ">=0.1.0-rc.3 <0.2.0",
133
- "@deepseek-ai/dsh-user-questions": ">=0.1.0-rc.3 <0.2.0",
134
- "@deepseek-ai/dsh-commands": ">=0.1.0-rc.3 <0.2.0",
135
- "@deepseek-ai/dsh-credentials": ">=0.1.0-rc.3 <0.2.0",
136
- "@deepseek-ai/dsh-settings": ">=0.1.0-rc.3 <0.2.0"
139
+ "@deepseek-ai/dsh-user-questions": ">=0.1.0-rc.3 <0.2.0"
137
140
  },
138
141
  "peerDependenciesMeta": {
139
142
  "@deepseek-ai/cordis": {
@@ -183,6 +186,9 @@
183
186
  },
184
187
  "@deepseek-ai/dsh-settings": {
185
188
  "optional": true
189
+ },
190
+ "@deepseek-ai/dsh-subagent": {
191
+ "optional": true
186
192
  }
187
193
  },
188
194
  "license": "Apache-2.0",