dsh-ssh-tui 0.3.7 → 0.3.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.
@@ -10,26 +10,36 @@ export declare const ROUTE_MEMORY_SCHEMA: z<Schemastery.ObjectS<{
10
10
  providers: z<import("@deepseek-ai/cosmokit").Dict<{
11
11
  model?: string | null | undefined;
12
12
  reasoningEffort?: string | null | undefined;
13
+ updatedAt?: number | null | undefined;
13
14
  } & import("@deepseek-ai/cosmokit").Dict, string>, import("@deepseek-ai/cosmokit").Dict<Schemastery.ObjectT<{
14
15
  model: z<string, string>;
15
16
  reasoningEffort: z<string, string>;
17
+ updatedAt: z<number, number>;
16
18
  }>, string>>;
17
19
  }>, Schemastery.ObjectT<{
18
20
  providers: z<import("@deepseek-ai/cosmokit").Dict<{
19
21
  model?: string | null | undefined;
20
22
  reasoningEffort?: string | null | undefined;
23
+ updatedAt?: number | null | undefined;
21
24
  } & import("@deepseek-ai/cosmokit").Dict, string>, import("@deepseek-ai/cosmokit").Dict<Schemastery.ObjectT<{
22
25
  model: z<string, string>;
23
26
  reasoningEffort: z<string, string>;
27
+ updatedAt: z<number, number>;
24
28
  }>, string>>;
25
29
  }>>;
26
30
  export interface RememberedRoute {
27
31
  model: string;
28
32
  reasoningEffort?: string;
33
+ /** Epoch ms of the last time this route was persisted (0 for legacy entries). */
34
+ updatedAt?: number;
29
35
  }
30
36
  export type RouteMemoryMap = Record<string, RememberedRoute>;
31
37
  export declare function parseRouteMemory(raw: unknown): RouteMemoryMap;
32
38
  export declare function rememberedRouteFor(memory: RouteMemoryMap, provider: string): RememberedRoute | undefined;
39
+ /** The most recently persisted route (highest updatedAt), or undefined. */
40
+ export declare function latestRememberedRoute(memory: RouteMemoryMap): (RememberedRoute & {
41
+ provider: string;
42
+ }) | undefined;
33
43
  /** Register the route-memory settings section so /model and /provider can persist. */
34
44
  export declare function installRouteMemory(ctx: Context): void;
35
45
  export declare function upsertRememberedRoute(memory: RouteMemoryMap, provider: string, route: RememberedRoute): RouteMemoryMap;
@@ -19,9 +19,11 @@ export declare const DEFAULT_SUBAGENT_MODEL = "deepseek-v4-flash";
19
19
  export declare const DEFAULT_XAI_SUBAGENT_MODEL = "grok-4.5";
20
20
  /**
21
21
  * Choose the default subagent model for a parent provider, preferring a
22
- * same-family listed model over a leftover DeepSeek flash id.
22
+ * same-family listed model over a leftover DeepSeek flash id. When the
23
+ * parent's own model id is supplied, candidates closest to that name win,
24
+ * with flash-like ids ranked first.
23
25
  */
24
- export declare function defaultSubagentModelForProvider(provider: string, listed?: readonly string[]): string;
26
+ export declare function defaultSubagentModelForProvider(provider: string, listed?: readonly string[], parentModel?: string): string;
25
27
  /**
26
28
  * True when the stored subagent model still belongs to the parent provider
27
29
  * family. An explicit leftover DeepSeek flash id after switching to xAI is
@@ -0,0 +1,22 @@
1
+ export declare const SUPERGROK_AUTH_PATHS: readonly [string, string];
2
+ export declare const SUPERGROK_REFRESH_SKEW_MS: number;
3
+ export interface SuperGrokStoredToken {
4
+ accessToken: string;
5
+ refreshToken: string | null;
6
+ expiresAt: number | null;
7
+ clientId: string | null;
8
+ path: string;
9
+ }
10
+ export declare function parseSuperGrokAuthFile(raw: unknown, path: string): SuperGrokStoredToken | undefined;
11
+ export declare function superGrokTokenNeedsRefresh(token: SuperGrokStoredToken, now?: number, skewMs?: number): boolean;
12
+ export declare function loadSuperGrokToken(paths?: readonly string[]): Promise<SuperGrokStoredToken | undefined>;
13
+ export declare function persistSuperGrokToken(path: string, tokenResponse: {
14
+ access_token: string;
15
+ refresh_token?: string;
16
+ expires_in?: number;
17
+ }, previousRefreshToken: string, now?: number): Promise<SuperGrokStoredToken>;
18
+ export declare function resolveFreshSuperGrokToken(options?: {
19
+ force?: boolean;
20
+ now?: number;
21
+ paths?: readonly string[];
22
+ }): Promise<string | undefined>;
@@ -665,6 +665,8 @@ export declare class SshTui {
665
665
  /** Terminal bell on completion (opt out with DSH_TUI_NO_BELL=1). */
666
666
  private playCompletionSignal;
667
667
  private render;
668
+ /** Color one line with an explicit SGR code (tool state colors, etc.). */
669
+ private styleStatusText;
668
670
  private styleLine;
669
671
  /**
670
672
  * Apply the TUI's subagent model selection to every child-agent request.
@@ -744,6 +746,14 @@ export declare class SshTui {
744
746
  private rememberedRoute;
745
747
  private rememberRoute;
746
748
  private applyModelSelection;
749
+ /**
750
+ * Persist the default provider/model selection. `agentDefaultModel` may be
751
+ * unavailable or its settings namespace may not be registered in this
752
+ * process, so a failed `saveSelection` falls back to writing the
753
+ * `agent-default-model` settings section directly and surfaces a warning
754
+ * when neither path sticks.
755
+ */
756
+ private persistDefaultSelection;
747
757
  /** Provider route the next subagent request should use. */
748
758
  private effectiveSubagentProvider;
749
759
  /**
@@ -752,7 +762,6 @@ export declare class SshTui {
752
762
  * switching to xAI is treated as stale.
753
763
  */
754
764
  private syncSubagentToProvider;
755
- private promptSubagentAfterProviderSwitch;
756
765
  private clearQuotaForProvider;
757
766
  /** Persist one subagent selection and publish it to the live request waterfall. */
758
767
  private saveSubagentSelection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ssh-tui",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "SSH-friendly interactive terminal TUI plugin for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",