dsh-ssh-tui 0.1.6 → 0.1.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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Subagent model defaults and the settings section the TUI edits with
3
+ * `/submodel` and `/subeffort`.
4
+ *
5
+ * The provider is deliberately inherited from the running parent session:
6
+ * the subagent selection only overrides the provider when the user stored an
7
+ * explicit route. The model defaults to the lightweight `deepseek-v4-flash`.
8
+ */
9
+ import z from '@deepseek-ai/schemastery';
10
+ import type { Context } from '@deepseek-ai/cordis';
11
+ import { type ReasoningEffortId as ReasoningEffort } from '@deepseek-ai/dsh-llm';
12
+ /** Settings namespace carrying the TUI's subagent model selection. */
13
+ export declare const SUBAGENT_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
14
+ /** Lightweight default model used for subagent children. */
15
+ export declare const DEFAULT_SUBAGENT_MODEL = "deepseek-v4-flash";
16
+ /** Raw settings document shape. */
17
+ export interface SubagentSettings {
18
+ /** Explicit provider override; omitted means "same provider as the parent". */
19
+ provider?: string;
20
+ /** Subagent model id. */
21
+ model?: string;
22
+ /** Adapter-owned reasoning effort id. */
23
+ reasoningEffort?: string;
24
+ }
25
+ /** Live, typed subagent selection. */
26
+ export interface SubagentSelection {
27
+ /** Explicit provider override; undefined inherits the parent route. */
28
+ provider?: string;
29
+ /** Subagent model id. */
30
+ model: string;
31
+ /** Reasoning effort; undefined follows the provider/model default. */
32
+ reasoningEffort?: ReasoningEffort;
33
+ }
34
+ /** Mutable selection handle shared by the settings watcher and the TUI. */
35
+ export interface SubagentSelectionRef {
36
+ current: SubagentSelection;
37
+ }
38
+ /** Settings schema for `$DSH_HOME/settings.yaml`. */
39
+ export declare const SUBAGENT_SETTINGS_SCHEMA: z<Schemastery.ObjectS<{
40
+ provider: z<string, string>;
41
+ model: z<string, string>;
42
+ reasoningEffort: z<string, string>;
43
+ }>, Schemastery.ObjectT<{
44
+ provider: z<string, string>;
45
+ model: z<string, string>;
46
+ reasoningEffort: z<string, string>;
47
+ }>>;
48
+ /** Normalize a raw settings section into a live typed selection. */
49
+ export declare function normalizeSubagentSelection(value: unknown): SubagentSelection;
50
+ /**
51
+ * Install the settings-backed subagent selection for one TUI plugin fiber.
52
+ * Returns the mutable ref the request waterfall and the slash commands share.
53
+ */
54
+ export declare function createSubagentSelection(ctx: Context): SubagentSelectionRef;
55
+ /** Serialize a live selection back into the settings document shape. */
56
+ export declare function subagentSettingsValue(selection: SubagentSelection): SubagentSettings;
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { Agent, ModelSelection, ModelSelectionRef } from '@deepseek-ai/dsh-agent';
13
13
  import type { Context } from '@deepseek-ai/cordis';
14
+ import { type SubagentSelectionRef } from './subagent-model.js';
14
15
  /** Presentation configuration for the terminal channel. */
15
16
  export interface TuiConfig {
16
17
  /** Exact shared agent/session identity driven by this terminal. */
@@ -33,6 +34,8 @@ export interface TuiConfig {
33
34
  model?: string;
34
35
  /** Live model-selection ref installed on the agent; mutated by /model. */
35
36
  selectionRef?: ModelSelectionRef;
37
+ /** Settings-backed model/effort selection applied to subagent requests. */
38
+ subagentSelection?: SubagentSelectionRef;
36
39
  /** Active agent-preset id (standard/code/minimal/cordis/...). */
37
40
  presetId?: string;
38
41
  /** Display name of the active preset. */
@@ -201,6 +204,7 @@ export declare class SshTui {
201
204
  private readonly resume;
202
205
  private readonly providerName;
203
206
  private readonly selectionRef;
207
+ private readonly subagentSelection;
204
208
  private readonly onSwitchSession;
205
209
  private readonly onSelectionChanged;
206
210
  private readonly resumePicker;
@@ -279,6 +283,13 @@ export declare class SshTui {
279
283
  private playCompletionSignal;
280
284
  private render;
281
285
  private styleLine;
286
+ /**
287
+ * Apply the TUI's subagent model selection to every child-agent request.
288
+ * The parent request is left untouched (its own `/model` waterfall already
289
+ * owns the route); direct children created by tool-subagent inherit the
290
+ * parent provider unless `/submodel` stored an explicit subagent provider.
291
+ */
292
+ private readonly handleAgentRequest;
282
293
  private readonly handleSessionEvent;
283
294
  private readonly handleStatus;
284
295
  private readonly handleError;
@@ -327,6 +338,16 @@ export declare class SshTui {
327
338
  private pickModelOption;
328
339
  /** /model: pick a model and reasoning effort for the current provider. */
329
340
  private runModelCommand;
341
+ /** Provider route the next subagent request should use. */
342
+ private effectiveSubagentProvider;
343
+ /** Persist one subagent selection and publish it to the live request waterfall. */
344
+ private saveSubagentSelection;
345
+ /** Resolve the picker model list for one provider (endpoint first, then catalog). */
346
+ private subagentModelOptions;
347
+ /** /submodel: pick (or set) the model subagent children use. */
348
+ private runSubmodelCommand;
349
+ /** /subeffort: pick the reasoning effort subagent children use. */
350
+ private runSubeffortCommand;
330
351
  /** /mode: pick an agent preset (standard / minimal / code / cordis / routing-suite / ...). */
331
352
  private runModeCommand;
332
353
  /** /resume: switch to a past session, or open a picker when no id is given. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ssh-tui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "SSH-friendly interactive terminal TUI plugin for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -67,6 +67,7 @@
67
67
  "node": ">=22.19"
68
68
  },
69
69
  "dependencies": {
70
+ "@deepseek-ai/schemastery": "^3.18.1",
70
71
  "commander": "^14.0.0"
71
72
  },
72
73
  "peerDependencies": {