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

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.
package/README.md CHANGED
@@ -6,18 +6,25 @@
6
6
 
7
7
  ## Install
8
8
 
9
- DSH Console requires Node.js 24 or newer and a working DSH provider configuration.
9
+ DSH Console requires Node.js 24 or newer and a working DSH provider configuration. This release is verified from the npm-default DeepSeek Harness `0.1.1-rc.2` through the current source release `0.1.2-alpha.1`; install DSH normally without pinning the command to a version.
10
10
 
11
11
  ```sh
12
12
  npm install --global @deepseek-ai/dsh @cofy-x/dsh-console
13
13
  dsh-console --prompt "hello"
14
14
  ```
15
15
 
16
- Public Alpha releases are intentionally available through npm's default `latest` channel for a simple installation path, while the published version keeps its `-alpha.x` prerelease identifier so the maturity level remains explicit.
16
+ Public Alpha releases retain prerelease versions while the current published Console remains available through npm's default install path.
17
17
 
18
18
  ## Use
19
19
 
20
- The launcher initializes or locates the `dsh-console` DSH profile and starts an interactive terminal session. Useful commands include:
20
+ The launcher initializes or locates the `dsh-console` DSH profile and starts an interactive terminal session. It can continue persisted work before the TUI starts:
21
+
22
+ ```sh
23
+ dsh-console --continue
24
+ dsh-console --resume dsh-console-01234567-89ab-cdef-0123-456789abcdef --prompt "continue this work"
25
+ ```
26
+
27
+ Startup continuation is scoped to persisted top-level Console Sessions in the current directory. Useful interactive commands include:
21
28
 
22
29
  ```text
23
30
  /model Select the active DSH model
@@ -9,11 +9,13 @@
9
9
  import { existsSync, readFileSync } from 'node:fs';
10
10
  import { homedir } from 'node:os';
11
11
  import { dirname, join } from 'node:path';
12
- import { spawnSync } from 'node:child_process';
13
12
  import { fileURLToPath } from 'node:url';
13
+ import crossSpawn from 'cross-spawn';
14
14
 
15
15
  const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
16
- const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
16
+ const manifest = JSON.parse(
17
+ readFileSync(join(packageRoot, 'package.json'), 'utf8'),
18
+ );
17
19
  const profile = 'dsh-console';
18
20
  const RESTART_EXIT_CODE = 199;
19
21
  const forwardedArgs = process.argv.slice(2);
@@ -40,9 +42,14 @@ const installedManifest = join(
40
42
  );
41
43
 
42
44
  function run(command, args) {
43
- const result = spawnSync(command, args, { stdio: 'inherit', env: process.env });
45
+ const result = crossSpawn.sync(command, args, {
46
+ stdio: 'inherit',
47
+ env: process.env,
48
+ });
44
49
  if (result.error) {
45
- process.stderr.write(`dsh-console: unable to run ${command}: ${result.error.message}\n`);
50
+ process.stderr.write(
51
+ `dsh-console: unable to run ${command}: ${result.error.message}\n`,
52
+ );
46
53
  process.exit(1);
47
54
  }
48
55
  if (result.signal) process.kill(process.pid, result.signal);
@@ -54,7 +61,13 @@ if (!existsSync(installedManifest)) {
54
61
  const packageSpec =
55
62
  process.env.DSH_CONSOLE_PACKAGE_SPEC ||
56
63
  (localCheckout ? packageRoot : `@cofy-x/dsh-console@${manifest.version}`);
57
- const status = run('dsh', ['plugin', '--profile', profile, 'add', packageSpec]);
64
+ const status = run('dsh', [
65
+ 'plugin',
66
+ '--profile',
67
+ profile,
68
+ 'add',
69
+ packageSpec,
70
+ ]);
58
71
  if (status !== 0) process.exit(status);
59
72
  }
60
73
 
package/cordis.patch.yml CHANGED
@@ -13,3 +13,5 @@
13
13
  prompt: !!js ctx.dshConsoleStartup.prompt
14
14
  debug: !!js ctx.dshConsoleStartup.debug
15
15
  pokemon: !!js ctx.dshConsoleStartup.pokemon
16
+ continueSession: !!js ctx.dshConsoleStartup.continueSession
17
+ resumeSessionId: !!js ctx.dshConsoleStartup.resumeSessionId
@@ -2494,6 +2494,16 @@ function sanitizeForDisplay(str, maxLength) {
2494
2494
  }
2495
2495
  return sanitized;
2496
2496
  }
2497
+ function sanitizeMultilineForDisplay(str, maxLength) {
2498
+ if (!str) {
2499
+ return "";
2500
+ }
2501
+ let sanitized = stripUnsafeCharacters(str).replace(/\r\n?/g, "\n");
2502
+ if (maxLength && sanitized.length > maxLength) {
2503
+ sanitized = sanitized.substring(0, maxLength - 3) + "...";
2504
+ }
2505
+ return sanitized;
2506
+ }
2497
2507
  var stringWidthCache = new LRUCache(
2498
2508
  LRU_BUFFER_PERF_CACHE_LIMIT
2499
2509
  );
@@ -5845,6 +5855,7 @@ export {
5845
5855
  cpSlice,
5846
5856
  stripUnsafeCharacters,
5847
5857
  sanitizeForDisplay,
5858
+ sanitizeMultilineForDisplay,
5848
5859
  getCachedStringWidth,
5849
5860
  escapeAnsiCtrlCodes,
5850
5861
  theme,