@deepseek-harness-tui/dsh-tui 0.8.6 → 0.8.8

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.
Files changed (120) hide show
  1. package/README.md +15 -5
  2. package/bin/dsh-tui.js +269 -218
  3. package/cordis.patch.yml +48 -22
  4. package/lib/types/cc/figures.d.ts.map +1 -1
  5. package/lib/types/cc/figures.js +14 -13
  6. package/lib/types/cc/syntaxRuns.d.ts +16 -0
  7. package/lib/types/cc/syntaxRuns.d.ts.map +1 -0
  8. package/lib/types/cc/syntaxRuns.js +79 -0
  9. package/lib/types/commands.d.ts +14 -0
  10. package/lib/types/commands.d.ts.map +1 -1
  11. package/lib/types/commands.js +20 -1
  12. package/lib/types/components/Chat/SubagentMessage.d.ts +19 -0
  13. package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -0
  14. package/lib/types/components/Chat/SubagentMessage.js +75 -0
  15. package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
  16. package/lib/types/components/EffortInputBorder.js +2 -2
  17. package/lib/types/components/EffortTierBadge.js +1 -1
  18. package/lib/types/components/FileSuggestions.d.ts +8 -4
  19. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  20. package/lib/types/components/FileSuggestions.js +22 -12
  21. package/lib/types/components/HelpMenu.d.ts +8 -1
  22. package/lib/types/components/HelpMenu.d.ts.map +1 -1
  23. package/lib/types/components/HelpMenu.js +15 -4
  24. package/lib/types/components/LogoV2.d.ts +7 -1
  25. package/lib/types/components/LogoV2.d.ts.map +1 -1
  26. package/lib/types/components/LogoV2.js +13 -4
  27. package/lib/types/components/MessageList.d.ts +6 -2
  28. package/lib/types/components/MessageList.d.ts.map +1 -1
  29. package/lib/types/components/MessageList.js +17 -6
  30. package/lib/types/components/ModelPicker.js +2 -2
  31. package/lib/types/components/PromptInput.d.ts +1 -1
  32. package/lib/types/components/PromptInput.d.ts.map +1 -1
  33. package/lib/types/components/PromptInput.js +100 -36
  34. package/lib/types/components/SkillsPicker.js +2 -2
  35. package/lib/types/components/SplitDiffView.d.ts +1 -13
  36. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  37. package/lib/types/components/SplitDiffView.js +6 -105
  38. package/lib/types/components/SubagentCard.d.ts +9 -0
  39. package/lib/types/components/SubagentCard.d.ts.map +1 -0
  40. package/lib/types/components/SubagentCard.js +26 -0
  41. package/lib/types/components/SubagentDashboard.d.ts +13 -0
  42. package/lib/types/components/SubagentDashboard.d.ts.map +1 -0
  43. package/lib/types/components/SubagentDashboard.js +50 -0
  44. package/lib/types/components/SubagentDetailScene.d.ts +16 -0
  45. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -0
  46. package/lib/types/components/SubagentDetailScene.js +141 -0
  47. package/lib/types/components/SyntaxText.d.ts +15 -0
  48. package/lib/types/components/SyntaxText.d.ts.map +1 -0
  49. package/lib/types/components/SyntaxText.js +34 -0
  50. package/lib/types/components/ThinkingToggle.d.ts +3 -10
  51. package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
  52. package/lib/types/components/ThinkingToggle.js +4 -9
  53. package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
  54. package/lib/types/components/design-system/ListItem.js +1 -1
  55. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  56. package/lib/types/components/messages/AssistantThinkingMessage.js +18 -7
  57. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -0
  58. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  59. package/lib/types/components/messages/AssistantToolUseMessage.js +42 -6
  60. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
  61. package/lib/types/components/messages/UserPromptMessage.js +15 -2
  62. package/lib/types/dsh-adapter/channel.d.ts +64 -3
  63. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  64. package/lib/types/dsh-adapter/channel.js +387 -37
  65. package/lib/types/dsh-adapter/contract.d.ts +67 -4
  66. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  67. package/lib/types/dsh-adapter/contract.js +149 -15
  68. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  69. package/lib/types/dsh-adapter/index.js +6 -6
  70. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  71. package/lib/types/dsh-adapter/plugin.js +38 -0
  72. package/lib/types/dsh-adapter/shortcuts.js +3 -3
  73. package/lib/types/dsh-adapter/subagents.d.ts +87 -0
  74. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -0
  75. package/lib/types/dsh-adapter/subagents.js +204 -0
  76. package/lib/types/herdr.d.ts +28 -0
  77. package/lib/types/herdr.d.ts.map +1 -0
  78. package/lib/types/herdr.js +133 -0
  79. package/lib/types/i18n.d.ts +233 -32
  80. package/lib/types/i18n.d.ts.map +1 -1
  81. package/lib/types/i18n.js +87 -16
  82. package/lib/types/ink/ink.d.ts +4 -0
  83. package/lib/types/ink/ink.d.ts.map +1 -1
  84. package/lib/types/ink/ink.js +84 -38
  85. package/lib/types/ink/render-node-to-output.d.ts +6 -3
  86. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  87. package/lib/types/ink/render-node-to-output.js +33 -7
  88. package/lib/types/ink/selection.d.ts +29 -4
  89. package/lib/types/ink/selection.d.ts.map +1 -1
  90. package/lib/types/ink/selection.js +41 -5
  91. package/lib/types/minimalMode.d.ts +13 -0
  92. package/lib/types/minimalMode.d.ts.map +1 -0
  93. package/lib/types/minimalMode.js +17 -0
  94. package/lib/types/screens/Chat.d.ts +1 -1
  95. package/lib/types/screens/Chat.d.ts.map +1 -1
  96. package/lib/types/screens/Chat.js +94 -43
  97. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  98. package/lib/types/screens/StatusLine.js +6 -2
  99. package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
  100. package/lib/types/screens/TrajectoryScene.js +4 -2
  101. package/lib/types/theme.d.ts +8 -0
  102. package/lib/types/theme.d.ts.map +1 -1
  103. package/lib/types/theme.js +38 -14
  104. package/lib/types/tips.d.ts.map +1 -1
  105. package/lib/types/tips.js +25 -7
  106. package/lib/types/update.d.ts +18 -0
  107. package/lib/types/update.d.ts.map +1 -1
  108. package/lib/types/update.js +73 -2
  109. package/lib/types/utils/execFileNoThrow.d.ts +3 -20
  110. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
  111. package/lib/types/utils/execFileNoThrow.js +53 -32
  112. package/lib/types/utils/externalEditor.d.ts +12 -11
  113. package/lib/types/utils/externalEditor.d.ts.map +1 -1
  114. package/lib/types/utils/externalEditor.js +11 -11
  115. package/lib/types/utils/fileSuggestions.d.ts +19 -0
  116. package/lib/types/utils/fileSuggestions.d.ts.map +1 -0
  117. package/lib/types/utils/fileSuggestions.js +40 -0
  118. package/lib/types/utils/mentions.d.ts.map +1 -1
  119. package/lib/types/utils/mentions.js +3 -1
  120. package/package.json +81 -74
@@ -1,20 +1,83 @@
1
- export declare const UPSTREAM_VALIDATED_VERSION = "0.1.0-rc.7";
1
+ /** Primary validated upstream line (newest). */
2
+ export declare const UPSTREAM_VALIDATED_VERSION = "0.1.1-rc.2";
3
+ /**
4
+ * Every upstream prerelease line the adapter has been validated against,
5
+ * oldest first.
6
+ *
7
+ * 0.1.1-rc.2 = primary; 0.1.1-rc.1 = transitional line of the same family
8
+ * (install- and type-level compatibility); 0.1.0-rc.8 = previous family
9
+ * (full CI coverage); 0.1.0-rc.7 = full CI coverage as well; 0.1.0-rc.6 =
10
+ * legacy line (install- and type-level compatibility, feature surface may
11
+ * lack later additions — new features must degrade gracefully there).
12
+ * The peer range in package.json is deliberately wider than this list: an
13
+ * install on an older or newer line is allowed but reports drift at boot.
14
+ */
15
+ export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0-rc.7", "0.1.0-rc.8", "0.1.1-rc.1", "0.1.1-rc.2"];
2
16
  /**
3
17
  * Framework packages version on their own lines; the contract validates
4
18
  * their MAJOR (breaking surface), not the harness rc number.
5
19
  */
6
20
  export declare const UPSTREAM_FRAMEWORK_MAJORS: Record<string, number>;
7
21
  /** Official packages the adapter consumes at runtime or as types. */
8
- export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-presets", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions"];
22
+ export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-presets", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions"];
9
23
  export interface UpstreamDriftEntry {
10
24
  package: string;
11
25
  installed: string | undefined;
12
26
  validated: string;
13
27
  }
28
+ /** A parsed upstream prerelease version, e.g. `0.1.1-rc.2` → `[0, 1, 1, 2]`. */
29
+ export type UpstreamVersionTuple = readonly [number, number, number, number];
30
+ /** Parse an upstream prerelease version; undefined when unparseable. */
31
+ export declare function parseUpstreamVersion(version: string | undefined): UpstreamVersionTuple | undefined;
32
+ /** Human-readable summary of the validated lines, e.g. `0.1.1-rc.2 (0.1.0-rc.6/7/8, 0.1.1-rc.1/2)`. */
33
+ export declare const UPSTREAM_VALIDATED_LABEL: string;
14
34
  export declare function installedUpstreamVersions(): Record<string, string | undefined>;
15
35
  /**
16
- * Report every blessed package whose installed version is NOT the validated
17
- * release line. Empty array = the running install matches the contract.
36
+ * The installed upstream version of one blessed package, parsed; undefined
37
+ * when missing or not on an `x.y.z-rc.n` prerelease line. Feature gates
38
+ * compare this against the line a behavior was introduced on, so the
39
+ * adapter degrades on older installs instead of calling APIs they do not
40
+ * have.
41
+ */
42
+ export declare function installedUpstreamVersion(packageName: string): UpstreamVersionTuple | undefined;
43
+ /**
44
+ * Whether the installed version of `packageName` is at or beyond `minimum`
45
+ * (a literal like `'0.1.0-rc.8'`). Unparseable or older installs return
46
+ * false so features introduced on the minimum line degrade gracefully.
47
+ */
48
+ export declare function installedMeetsVersion(packageName: string, minimum: string): boolean;
49
+ /**
50
+ * The distinct installed prerelease versions across the blessed harness
51
+ * packages (framework packages excluded). One entry = coherent install;
52
+ * several = a mixed tree, which the per-package drift check cannot see.
53
+ * Empty when nothing (or no harness package) is installed.
54
+ */
55
+ export declare function installedUpstreamLines(): string[];
56
+ /**
57
+ * Report every blessed package whose installed version is NOT one of the
58
+ * validated release lines. Empty array = the running install matches the
59
+ * contract.
18
60
  */
19
61
  export declare function upstreamDrift(): UpstreamDriftEntry[];
62
+ /**
63
+ * Classification of a drifted install for the one-line boot notice:
64
+ * `newer` / `older` — every drifted harness package sits on a single
65
+ * parseable version off one end of the validated window; `mixed` — several
66
+ * distinct versions coexist (unstable tree); `broken` — something is
67
+ * missing or unparseable and wording cannot get more specific.
68
+ */
69
+ export type UpstreamDriftKind = 'newer' | 'older' | 'mixed' | 'broken';
70
+ /** Merged drift verdict consumed by the logo header notice (LogoV2). */
71
+ export interface UpstreamDriftSummary {
72
+ kind: UpstreamDriftKind;
73
+ /** Distinct installed versions among drifted packages ('missing' for absent ones). */
74
+ versions: string[];
75
+ }
76
+ /**
77
+ * Collapse {@link upstreamDrift} into a single summary for the boot notice:
78
+ * undefined when the install matches the contract. Only harness rc packages
79
+ * decide newer/older/mixed; a framework-only drift (e.g. a cordis major
80
+ * bump) reports `broken`, since its version line is not comparable.
81
+ */
82
+ export declare function upstreamDriftSummary(): UpstreamDriftSummary | undefined;
20
83
  //# sourceMappingURL=contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,0BAA0B,eAAe,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAG5D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,8xBA0B5B,CAAA;AAEV,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB;AAWD,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAgB9E;AAOD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAsBpD"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings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C,IAAI,EAAE,iBAAiB,CAAA;IACvB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,oBAAoB,GAAG,SAAS,CAuBvE"}
@@ -1,17 +1,40 @@
1
1
  /**
2
2
  * Upstream compatibility contract.
3
3
  *
4
- * The TUI is validated against one upstream release line (0.1.0-rc.7).
5
- * Every official package this adapter touches is blessed here; anything
6
- * else must go through upstream channels or the adapter, never the UI.
4
+ * The TUI is validated against a set of upstream prerelease lines — the
5
+ * current primary (0.1.1-rc.2) plus older lines kept in backward
6
+ * compatibility across the 0.1.1 and 0.1.0 release families. Every official
7
+ * package this adapter touches is blessed here; anything else must go
8
+ * through upstream channels or the adapter, never the UI.
7
9
  *
8
- * `upstreamDrift()` powers both the boot-time warning (dev visibility) and
9
- * the CI gate (scripts/verify-upstream-contract.ts) so a mismatched
10
- * install fails in CI before it fails on a user's machine.
10
+ * `upstreamDrift()` powers the CI gate (scripts/verify-upstream-contract.ts)
11
+ * so a mismatched install fails in CI before it fails on a user's machine.
12
+ * `upstreamDriftSummary()` collapses the per-package entries into the
13
+ * single natural-language boot notice the logo header shows (see LogoV2).
11
14
  */
12
15
  import { readFileSync } from 'node:fs';
13
16
  import { fileURLToPath } from 'node:url';
14
- export const UPSTREAM_VALIDATED_VERSION = '0.1.0-rc.7';
17
+ /** Primary validated upstream line (newest). */
18
+ export const UPSTREAM_VALIDATED_VERSION = '0.1.1-rc.2';
19
+ /**
20
+ * Every upstream prerelease line the adapter has been validated against,
21
+ * oldest first.
22
+ *
23
+ * 0.1.1-rc.2 = primary; 0.1.1-rc.1 = transitional line of the same family
24
+ * (install- and type-level compatibility); 0.1.0-rc.8 = previous family
25
+ * (full CI coverage); 0.1.0-rc.7 = full CI coverage as well; 0.1.0-rc.6 =
26
+ * legacy line (install- and type-level compatibility, feature surface may
27
+ * lack later additions — new features must degrade gracefully there).
28
+ * The peer range in package.json is deliberately wider than this list: an
29
+ * install on an older or newer line is allowed but reports drift at boot.
30
+ */
31
+ export const UPSTREAM_VALIDATED_VERSIONS = [
32
+ '0.1.0-rc.6',
33
+ '0.1.0-rc.7',
34
+ '0.1.0-rc.8',
35
+ '0.1.1-rc.1',
36
+ '0.1.1-rc.2',
37
+ ];
15
38
  /**
16
39
  * Framework packages version on their own lines; the contract validates
17
40
  * their MAJOR (breaking surface), not the harness rc number.
@@ -34,6 +57,7 @@ export const UPSTREAM_BLESSED_PACKAGES = [
34
57
  '@deepseek-ai/dsh-llm',
35
58
  '@deepseek-ai/dsh-persona',
36
59
  '@deepseek-ai/dsh-session',
60
+ '@deepseek-ai/dsh-settings',
37
61
  '@deepseek-ai/dsh-skill',
38
62
  '@deepseek-ai/dsh-storage',
39
63
  '@deepseek-ai/dsh-storage-domain',
@@ -48,6 +72,39 @@ export const UPSTREAM_BLESSED_PACKAGES = [
48
72
  '@deepseek-ai/dsh-user-approval',
49
73
  '@deepseek-ai/dsh-user-questions',
50
74
  ];
75
+ /** Parse an upstream prerelease version; undefined when unparseable. */
76
+ export function parseUpstreamVersion(version) {
77
+ const match = /^(\d+)\.(\d+)\.(\d+)-rc\.(\d+)$/u.exec(version ?? '');
78
+ return match === null ? undefined : [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
79
+ }
80
+ /** Order two parsed versions: negative/positive/zero as a `<`/`>`/`=`. */
81
+ function compareVersions(a, b) {
82
+ for (let i = 0; i < a.length; i++) {
83
+ if (a[i] > b[i])
84
+ return 1;
85
+ if (a[i] < b[i])
86
+ return -1;
87
+ }
88
+ return 0;
89
+ }
90
+ /** Collapse {@link UPSTREAM_VALIDATED_VERSIONS} into per-release rc groups,
91
+ * e.g. `0.1.0-rc.6/7/8, 0.1.1-rc.1/2`. */
92
+ function validatedLinesLabel() {
93
+ const groups = [];
94
+ for (const version of UPSTREAM_VALIDATED_VERSIONS) {
95
+ const [major, minor, patch, rc] = parseUpstreamVersion(version);
96
+ const release = `${major}.${minor}.${patch}`;
97
+ let group = groups.find(candidate => candidate.release === release);
98
+ if (group === undefined) {
99
+ group = { release, rcs: [] };
100
+ groups.push(group);
101
+ }
102
+ group.rcs.push(rc);
103
+ }
104
+ return groups.map(({ release, rcs }) => `${release}-rc.${rcs.join('/')}`).join(', ');
105
+ }
106
+ /** Human-readable summary of the validated lines, e.g. `0.1.1-rc.2 (0.1.0-rc.6/7/8, 0.1.1-rc.1/2)`. */
107
+ export const UPSTREAM_VALIDATED_LABEL = `${UPSTREAM_VALIDATED_VERSION} (${validatedLinesLabel()})`;
51
108
  function resolvePackageJson(packageName) {
52
109
  try {
53
110
  const path = import.meta.resolve(`${packageName}/package.json`);
@@ -57,7 +114,13 @@ function resolvePackageJson(packageName) {
57
114
  return undefined;
58
115
  }
59
116
  }
117
+ let cachedVersions;
60
118
  export function installedUpstreamVersions() {
119
+ // Package manifests do not change mid-process; memoize so per-call gates
120
+ // (e.g. the command-images line check) stay cheap. Frozen so callers can
121
+ // never corrupt the shared cache.
122
+ if (cachedVersions !== undefined)
123
+ return cachedVersions;
61
124
  const result = {};
62
125
  for (const packageName of UPSTREAM_BLESSED_PACKAGES) {
63
126
  let version;
@@ -73,17 +136,55 @@ export function installedUpstreamVersions() {
73
136
  }
74
137
  result[packageName] = version;
75
138
  }
76
- return result;
139
+ cachedVersions = Object.freeze(result);
140
+ return cachedVersions;
141
+ }
142
+ /**
143
+ * The installed upstream version of one blessed package, parsed; undefined
144
+ * when missing or not on an `x.y.z-rc.n` prerelease line. Feature gates
145
+ * compare this against the line a behavior was introduced on, so the
146
+ * adapter degrades on older installs instead of calling APIs they do not
147
+ * have.
148
+ */
149
+ export function installedUpstreamVersion(packageName) {
150
+ return parseUpstreamVersion(installedUpstreamVersions()[packageName]);
151
+ }
152
+ /**
153
+ * Whether the installed version of `packageName` is at or beyond `minimum`
154
+ * (a literal like `'0.1.0-rc.8'`). Unparseable or older installs return
155
+ * false so features introduced on the minimum line degrade gracefully.
156
+ */
157
+ export function installedMeetsVersion(packageName, minimum) {
158
+ const installed = installedUpstreamVersion(packageName);
159
+ const floor = parseUpstreamVersion(minimum);
160
+ if (installed === undefined || floor === undefined)
161
+ return false;
162
+ return compareVersions(installed, floor) >= 0;
77
163
  }
78
- function rcNumber(version) {
79
- const match = /0\.1\.0-rc\.(\d+)/u.exec(version ?? '');
80
- return match === null ? undefined : Number(match[1]);
164
+ /**
165
+ * The distinct installed prerelease versions across the blessed harness
166
+ * packages (framework packages excluded). One entry = coherent install;
167
+ * several = a mixed tree, which the per-package drift check cannot see.
168
+ * Empty when nothing (or no harness package) is installed.
169
+ */
170
+ export function installedUpstreamLines() {
171
+ const lines = new Set();
172
+ for (const packageName of UPSTREAM_BLESSED_PACKAGES) {
173
+ if (UPSTREAM_FRAMEWORK_MAJORS[packageName] !== undefined)
174
+ continue;
175
+ const version = installedUpstreamVersions()[packageName];
176
+ if (version !== undefined && parseUpstreamVersion(version) !== undefined)
177
+ lines.add(version);
178
+ }
179
+ return [...lines].sort((a, b) => compareVersions(parseUpstreamVersion(a), parseUpstreamVersion(b)));
81
180
  }
82
181
  /**
83
- * Report every blessed package whose installed version is NOT the validated
84
- * release line. Empty array = the running install matches the contract.
182
+ * Report every blessed package whose installed version is NOT one of the
183
+ * validated release lines. Empty array = the running install matches the
184
+ * contract.
85
185
  */
86
186
  export function upstreamDrift() {
187
+ const validated = new Set(UPSTREAM_VALIDATED_VERSIONS);
87
188
  const drift = [];
88
189
  for (const [packageName, installed] of Object.entries(installedUpstreamVersions())) {
89
190
  const expected = UPSTREAM_BLESSED_PACKAGES.includes(packageName);
@@ -96,15 +197,48 @@ export function upstreamDrift() {
96
197
  matches = installedMajor === frameworkMajor;
97
198
  }
98
199
  else {
99
- matches = rcNumber(installed) === rcNumber(UPSTREAM_VALIDATED_VERSION);
200
+ matches = installed !== undefined && validated.has(installed);
100
201
  }
101
202
  if (!matches) {
102
203
  drift.push({
103
204
  package: packageName,
104
205
  installed,
105
- validated: frameworkMajor !== undefined ? `major ${frameworkMajor}` : UPSTREAM_VALIDATED_VERSION,
206
+ validated: frameworkMajor !== undefined ? `major ${frameworkMajor}` : UPSTREAM_VALIDATED_LABEL,
106
207
  });
107
208
  }
108
209
  }
109
210
  return drift;
110
211
  }
212
+ /**
213
+ * Collapse {@link upstreamDrift} into a single summary for the boot notice:
214
+ * undefined when the install matches the contract. Only harness rc packages
215
+ * decide newer/older/mixed; a framework-only drift (e.g. a cordis major
216
+ * bump) reports `broken`, since its version line is not comparable.
217
+ */
218
+ export function upstreamDriftSummary() {
219
+ const drift = upstreamDrift();
220
+ if (drift.length === 0)
221
+ return undefined;
222
+ const harness = drift.filter(entry => UPSTREAM_FRAMEWORK_MAJORS[entry.package] === undefined);
223
+ const versions = [...new Set(drift.map(entry => entry.installed ?? 'missing'))];
224
+ if (harness.some(entry => entry.installed === undefined)) {
225
+ return { kind: 'broken', versions };
226
+ }
227
+ const harnessVersions = [...new Set(harness.map(entry => entry.installed))];
228
+ if (harnessVersions.length > 1) {
229
+ return { kind: 'mixed', versions };
230
+ }
231
+ const installed = parseUpstreamVersion(harnessVersions[0] ?? '');
232
+ const validated = parseUpstreamVersion(UPSTREAM_VALIDATED_VERSION);
233
+ if (installed === undefined) {
234
+ return { kind: 'broken', versions };
235
+ }
236
+ const order = compareVersions(installed, validated);
237
+ if (order > 0)
238
+ return { kind: 'newer', versions };
239
+ if (order < 0)
240
+ return { kind: 'older', versions };
241
+ // Identical to the primary validated version — cannot happen (it would
242
+ // not be drift); report broken rather than staying silent.
243
+ return { kind: 'broken', versions };
244
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,O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C;;8EAE0E;IAC1E,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACjC,sEAAsE;IACtE,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACpC;;;yDAGqD;IACrD,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CA8ChC,CAAA;AAEF;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASvE"}
@@ -64,12 +64,12 @@ export const Config = Schema.object({
64
64
  * @returns a promise settling when the TUI teardown completes.
65
65
  */
66
66
  export async function apply(ctx, config) {
67
- const { upstreamDrift, UPSTREAM_VALIDATED_VERSION } = await import('./contract.js');
68
- for (const entry of upstreamDrift()) {
69
- console.warn(`[dsh-tui] upstream drift: ${entry.package} installed=${entry.installed ?? 'missing'} ` +
70
- `validated=${UPSTREAM_VALIDATED_VERSION} — the TUI was validated against ` +
71
- `${UPSTREAM_VALIDATED_VERSION}; upgrade the profile when upstream is bumped.`);
72
- }
67
+ // Upstream drift is NO LONGER spammed to stderr here: per-package
68
+ // console.warn lines interleave with the TUI frame redraw and arrive
69
+ // garbled (typewriter animation repaints over them). The merged,
70
+ // natural-language notice now renders in the logo header under the
71
+ // startup tip (LogoV2 ← upstreamDriftSummary); CI keeps the hard gate
72
+ // via scripts/verify-upstream-contract.ts.
73
73
  const { apply: ccTuiApply } = await import('./plugin.js');
74
74
  return ccTuiApply(ctx, config);
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAA;AAGhE,OAAO,KAAK,EAAE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AK,IAAI,CAAA;IACrC,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB,CAcA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,KAAK,GAAG,SAAS,CAAA;IAC5B,YAAY,EAAE,KAAK,CAAA;CACpB,GAAG,OAAO,CAQV"}
@@ -25,6 +25,7 @@ import { checkForTuiUpdate, installedTuiVersion, isBootDeadlockTarget, isVersion
25
25
  import { getLang, isLang, resolveStartupLang, setLang, t, writeLangPref } from '../i18n.js';
26
26
  import { DEFAULT_STATUS_BAR, normalizeStatusBar, normalizeToolBackground } from '../tuiDisplayPrefs.js';
27
27
  import { detectLegacyEnv, migrateLegacyDataDir, RENAMED_ENV } from '../utils/paths.js';
28
+ import { attachHerdrIntegration } from '../herdr.js';
28
29
  import { Chat } from '../screens/Chat.js';
29
30
  import { getHostDialogStore } from './dialogs.js';
30
31
  import { getHostStatusStore } from './status.js';
@@ -357,6 +358,11 @@ export async function apply(ctx, config) {
357
358
  trajectory: Schema.boolean().default(DEFAULT_STATUS_BAR.trajectory),
358
359
  shortcutHint: Schema.boolean().default(DEFAULT_STATUS_BAR.shortcutHint),
359
360
  }).default({ ...DEFAULT_STATUS_BAR }),
361
+ // Header pixel whale art; on unless settings.yaml says otherwise.
362
+ whale: Schema.boolean().default(true),
363
+ // Minimal mode: strips the header splash, emoji glyphs, and
364
+ // decorative colors; code highlight and tool colors stay.
365
+ minimal: Schema.boolean().default(false),
360
366
  // No default on purpose: an unset `lang` keeps the field showing
361
367
  // the effective language (see the section's format below) and lets
362
368
  // cordis.yml / lang.json keep their precedence.
@@ -365,6 +371,12 @@ export async function apply(ctx, config) {
365
371
  const applyLayout = (value) => {
366
372
  channel.setDiffLayout(value.diffLayout ?? config.diffLayout ?? 'auto');
367
373
  };
374
+ const applyWhale = (value) => {
375
+ channel.setWhale(value.whale ?? true);
376
+ };
377
+ const applyMinimal = (value) => {
378
+ channel.setMinimal(value.minimal ?? false);
379
+ };
368
380
  // The /settings language field writes `lang` through the settings
369
381
  // service (user layer): apply it live and mirror it to lang.json so
370
382
  // the /lang command and next-boot resolution agree. DSH_TUI_LANG
@@ -385,6 +397,8 @@ export async function apply(ctx, config) {
385
397
  };
386
398
  const apply = (next) => {
387
399
  applyLayout(next);
400
+ applyWhale(next);
401
+ applyMinimal(next);
388
402
  applyLang(next);
389
403
  applyDisplay(next);
390
404
  };
@@ -595,6 +609,22 @@ export async function apply(ctx, config) {
595
609
  group: 'status-bar',
596
610
  kind: 'boolean',
597
611
  },
612
+ {
613
+ path: ['whale'],
614
+ label: 'Whale art',
615
+ descriptions: { zh: '鲸鱼娘' },
616
+ hint: 'Show the pixel whale in the header splash.',
617
+ hintDescriptions: { zh: '开屏头部显示像素鲸鱼娘。' },
618
+ kind: 'boolean',
619
+ },
620
+ {
621
+ path: ['minimal'],
622
+ label: 'Minimal mode',
623
+ descriptions: { zh: '极简模式' },
624
+ hint: 'Hide the header splash, emoji glyphs, and decorative colors; code highlight and tool colors stay. Trims the status bar to model + cwd.',
625
+ hintDescriptions: { zh: '隐藏开屏头部、emoji 状态符与装饰性配色;代码高亮与工具配色保留,底栏只留模型与目录。' },
626
+ kind: 'boolean',
627
+ },
598
628
  ],
599
629
  });
600
630
  ctx.effect(() => unregister);
@@ -612,6 +642,14 @@ export async function apply(ctx, config) {
612
642
  ctx.on('approval/request', (req, next) => String(req.agent.id) === channel.agentId ? approvalStore.park(req) : next());
613
643
  ctx.effect(() => () => approvalStore.settleAll('cancelled'));
614
644
  }
645
+ const herdr = attachHerdrIntegration({
646
+ channel,
647
+ questions: questionStore,
648
+ approvals: approvalStore,
649
+ });
650
+ if (herdr !== undefined) {
651
+ ctx.effect(() => () => herdr.dispose());
652
+ }
615
653
  // Positional command-line arguments are the initial prompt (issue #53):
616
654
  // `dsh-tui "run the tests"` forwards positionals through the dsh CLI,
617
655
  // which mounts them as ctx.cmdlineArgs. Submit once the channel exists —
@@ -43,9 +43,9 @@ const NAMED_KEYS = {
43
43
  * Combos the TUI owns, globally or inside the prompt editor (the editor's
44
44
  * bindings are checked AFTER plugin shortcuts, so refusing them here is
45
45
  * what keeps "locals win" true). Built-in handlers match a MODIFIER SUBSET
46
- * (`isMod(key) && input === 'x'` — they never exclude an extra Shift), so
46
+ * (`key.ctrl && input === 'g'` — they never exclude an extra Shift), so
47
47
  * the reserved check below refuses a plugin combo whose SHIFTLESS form is
48
- * reserved: ctrl+shift+x would shadow Ctrl+X on terminals that report both
48
+ * reserved: ctrl+shift+g would shadow Ctrl+G on terminals that report both
49
49
  * as the same keypress (ConPTY does), and would be dead weight on terminals
50
50
  * that don't.
51
51
  */
@@ -54,7 +54,7 @@ const RESERVED_COMBOS = new Set([
54
54
  'ctrl+d', // exit on empty input
55
55
  'ctrl+t', // startup context panel
56
56
  'ctrl+r', // history search
57
- 'ctrl+x', // external editor
57
+ 'ctrl+g', // external editor
58
58
  'ctrl+o', // transcript mode toggle
59
59
  'ctrl+l', // terminal redraw
60
60
  'ctrl+e', // show all messages / line end
@@ -0,0 +1,87 @@
1
+ /** Unified subagent activity domain model used by the adapter and every view. */
2
+ export type SubagentStatus = 'starting' | 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown';
3
+ export type SubagentOutputKind = 'text' | 'thinking' | 'tool' | 'error' | 'system';
4
+ export interface SubagentOutputLine {
5
+ kind: SubagentOutputKind;
6
+ text: string;
7
+ at: number;
8
+ /** False while the line is still absorbing streaming deltas. */
9
+ settled?: boolean;
10
+ }
11
+ export interface SubagentToolCall {
12
+ id?: string;
13
+ name: string;
14
+ status: 'running' | 'completed' | 'failed';
15
+ startedAt: number;
16
+ endedAt?: number;
17
+ argsPreview?: string;
18
+ resultPreview?: string;
19
+ error?: string;
20
+ }
21
+ export interface SubagentTokenUsage {
22
+ input?: number;
23
+ output?: number;
24
+ total?: number;
25
+ context?: number;
26
+ }
27
+ export interface SubagentState {
28
+ agentId: string;
29
+ runId?: string;
30
+ description: string;
31
+ provider?: string;
32
+ model?: string;
33
+ effort?: string;
34
+ status: SubagentStatus;
35
+ startedAt: number;
36
+ completedAt?: number;
37
+ endedAt?: number;
38
+ local?: boolean;
39
+ parentSessionId?: string;
40
+ sessionId?: string;
41
+ stopReason?: string;
42
+ error?: string;
43
+ /** Compatibility projection for older consumers. */
44
+ output: string[];
45
+ outputEvents: SubagentOutputLine[];
46
+ toolCalls: SubagentToolCall[];
47
+ tokens?: SubagentTokenUsage;
48
+ summary?: string;
49
+ }
50
+ export declare class SubagentActivityStore {
51
+ private states;
52
+ private sessionToAgent;
53
+ private listeners;
54
+ private commitLine;
55
+ private pushLine;
56
+ onSpawned(agentId: string, provider?: string, model?: string, info?: Partial<SubagentState>): void;
57
+ linkSession(agentId: string, session: unknown): void;
58
+ getSubagentIdBySession(session: unknown): string | undefined;
59
+ appendOutput(agentId: string, text: string, kind?: SubagentOutputKind): void;
60
+ /** Mark the streaming tail line complete (run settlement). */
61
+ flushOutput(agentId: string): void;
62
+ onSessionEvent(agentId: string, event: unknown): void;
63
+ /** Merge partial updates (model discovery, session id) into one subagent. */
64
+ patch(agentId: string, partial: Partial<SubagentState>): void;
65
+ /** One-line preview of a tool-result content block (text or item list). */
66
+ private previewOf;
67
+ recordTool(agentId: string, input: Partial<SubagentToolCall> & {
68
+ name?: string;
69
+ }): void;
70
+ setTokens(agentId: string, usage: {
71
+ inputTokens?: number;
72
+ outputTokens?: number;
73
+ input?: number;
74
+ output?: number;
75
+ total?: number;
76
+ context?: number;
77
+ }): void;
78
+ onCompleted(agentId: string, summary?: string, stopReason?: string): void;
79
+ onFailed(agentId: string, error: string): void;
80
+ onCancelled(agentId: string, reason?: string, summary?: string): void;
81
+ private finish;
82
+ snapshot(): SubagentState[];
83
+ get(agentId: string): SubagentState | undefined;
84
+ subscribe(listener: () => void): () => void;
85
+ private notify;
86
+ }
87
+ //# sourceMappingURL=subagents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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