dsh-ssh-tui 0.3.6 → 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.
- package/README.en.md +34 -18
- package/README.md +23 -8
- package/cordis.patch.yml +17 -3
- package/lib/index.js +58 -8
- package/lib/index.js.map +1 -1
- package/lib/route-memory.js +23 -4
- package/lib/route-memory.js.map +1 -1
- package/lib/subagent-model.js +37 -12
- package/lib/subagent-model.js.map +1 -1
- package/lib/supergrok-token.js +128 -0
- package/lib/supergrok-token.js.map +1 -0
- package/lib/tui.js +253 -105
- package/lib/tui.js.map +1 -1
- package/lib/types/route-memory.d.ts +10 -0
- package/lib/types/subagent-model.d.ts +4 -2
- package/lib/types/supergrok-token.d.ts +22 -0
- package/lib/types/tui.d.ts +24 -8
- package/package.json +29 -29
|
@@ -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>;
|
package/lib/types/tui.d.ts
CHANGED
|
@@ -359,16 +359,22 @@ export interface QuotaSnapshot {
|
|
|
359
359
|
windows: QuotaWindow[];
|
|
360
360
|
}
|
|
361
361
|
export declare function remainingPercentFromUsed(usedPercent: number): number;
|
|
362
|
-
/** Cross a remaining-percent threshold from above (50 / 25 / 10 / 5).
|
|
362
|
+
/** Cross a remaining-percent threshold from above (50 / 25 / 10 / 5).
|
|
363
|
+
* Only the tightest (lowest) crossed threshold is returned, so one drop
|
|
364
|
+
* never paints 50/25/10 as three identical warnings. */
|
|
363
365
|
export declare function crossedQuotaThresholds(previousRemaining: number | undefined, remaining: number): number[];
|
|
364
366
|
export declare function quotaAlertText(snapshot: QuotaSnapshot, window: QuotaWindow): string;
|
|
365
367
|
/**
|
|
366
368
|
* How often to re-fetch quota, based on the tightest window.
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
369
|
+
* Counted in model steps (not conversation turns): a turn with several
|
|
370
|
+
* tool/LLM steps should refresh more often because it spends more quota.
|
|
371
|
+
* Hourly/5h: every 10 steps, every 4 when near a threshold.
|
|
372
|
+
* Weekly: every 50 steps, every 10 when near.
|
|
373
|
+
* Monthly: every 80 steps, every 20 when near.
|
|
370
374
|
*/
|
|
371
|
-
export declare function
|
|
375
|
+
export declare function quotaRefreshEverySteps(window: QuotaWindow | undefined): number;
|
|
376
|
+
/** @deprecated Same cadence as {@link quotaRefreshEverySteps}; the name predates step accounting. */
|
|
377
|
+
export declare const quotaRefreshEveryTurns: typeof quotaRefreshEverySteps;
|
|
372
378
|
export declare function parseSuperGrokBilling(payload: unknown): QuotaSnapshot;
|
|
373
379
|
export declare function parseOpenCodeGoQuota(payload: unknown, provider: string): QuotaSnapshot;
|
|
374
380
|
export declare function formatQuotaSnapshot(snapshot: QuotaSnapshot): string;
|
|
@@ -577,6 +583,7 @@ export declare class SshTui {
|
|
|
577
583
|
private lastPaintWidth;
|
|
578
584
|
private lastPaintHeight;
|
|
579
585
|
private lastChromeStart;
|
|
586
|
+
private lastTranscriptStart;
|
|
580
587
|
private paintIntervalMs;
|
|
581
588
|
private paintLink;
|
|
582
589
|
private paintProbed;
|
|
@@ -585,7 +592,7 @@ export declare class SshTui {
|
|
|
585
592
|
private llmRetry;
|
|
586
593
|
private quotaSnapshot;
|
|
587
594
|
private quotaAlerted;
|
|
588
|
-
private
|
|
595
|
+
private quotaStepsSinceRefresh;
|
|
589
596
|
private quotaRefreshInFlight;
|
|
590
597
|
private searchHits;
|
|
591
598
|
private searchIndex;
|
|
@@ -658,6 +665,8 @@ export declare class SshTui {
|
|
|
658
665
|
/** Terminal bell on completion (opt out with DSH_TUI_NO_BELL=1). */
|
|
659
666
|
private playCompletionSignal;
|
|
660
667
|
private render;
|
|
668
|
+
/** Color one line with an explicit SGR code (tool state colors, etc.). */
|
|
669
|
+
private styleStatusText;
|
|
661
670
|
private styleLine;
|
|
662
671
|
/**
|
|
663
672
|
* Apply the TUI's subagent model selection to every child-agent request.
|
|
@@ -737,6 +746,14 @@ export declare class SshTui {
|
|
|
737
746
|
private rememberedRoute;
|
|
738
747
|
private rememberRoute;
|
|
739
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;
|
|
740
757
|
/** Provider route the next subagent request should use. */
|
|
741
758
|
private effectiveSubagentProvider;
|
|
742
759
|
/**
|
|
@@ -745,7 +762,6 @@ export declare class SshTui {
|
|
|
745
762
|
* switching to xAI is treated as stale.
|
|
746
763
|
*/
|
|
747
764
|
private syncSubagentToProvider;
|
|
748
|
-
private promptSubagentAfterProviderSwitch;
|
|
749
765
|
private clearQuotaForProvider;
|
|
750
766
|
/** Persist one subagent selection and publish it to the live request waterfall. */
|
|
751
767
|
private saveSubagentSelection;
|
|
@@ -755,7 +771,7 @@ export declare class SshTui {
|
|
|
755
771
|
private runSubmodelCommand;
|
|
756
772
|
/** /subeffort: pick the reasoning effort subagent children use. */
|
|
757
773
|
private runSubeffortCommand;
|
|
758
|
-
/** /mode: pick an agent preset (standard / minimal /
|
|
774
|
+
/** /mode: pick an agent preset (standard / minimal / ptc / cordis / routing-suite / ...). */
|
|
759
775
|
private runModeCommand;
|
|
760
776
|
/** /resume: switch to a past session, or open a picker when no id is given. */
|
|
761
777
|
private runResumeCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ssh-tui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "SSH-friendly interactive terminal TUI plugin for DeepSeek Harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -80,20 +80,20 @@
|
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
83
|
-
"@deepseek-ai/dsh-agent": "
|
|
84
|
-
"@deepseek-ai/dsh-agent-default-model": "
|
|
85
|
-
"@deepseek-ai/dsh-agent-loop": "
|
|
86
|
-
"@deepseek-ai/dsh-agent-presets": "
|
|
87
|
-
"@deepseek-ai/dsh-cmdline": "
|
|
88
|
-
"@deepseek-ai/dsh-commands": "
|
|
89
|
-
"@deepseek-ai/dsh-credentials": "
|
|
90
|
-
"@deepseek-ai/dsh-llm": "
|
|
91
|
-
"@deepseek-ai/dsh-session": "
|
|
92
|
-
"@deepseek-ai/dsh-settings": "
|
|
93
|
-
"@deepseek-ai/dsh-subagent": "
|
|
94
|
-
"@deepseek-ai/dsh-user-approval": "
|
|
95
|
-
"@deepseek-ai/dsh-user-questions": "
|
|
96
|
-
"@deepseek-ai/dsh-session-persistence": "
|
|
83
|
+
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-agent-default-model": ">=0.1.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-agent-loop": ">=0.1.1-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-agent-presets": ">=0.1.1-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-cmdline": ">=0.1.1-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-commands": ">=0.1.1-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2",
|
|
90
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2",
|
|
91
|
+
"@deepseek-ai/dsh-session": ">=0.1.1-rc.2",
|
|
92
|
+
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2",
|
|
93
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.1-rc.2",
|
|
94
|
+
"@deepseek-ai/dsh-user-approval": ">=0.1.1-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-user-questions": ">=0.1.1-rc.2",
|
|
96
|
+
"@deepseek-ai/dsh-session-persistence": ">=0.1.1-rc.2"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|
|
99
99
|
"@deepseek-ai/dsh-user-approval": {
|
|
@@ -111,21 +111,21 @@
|
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
114
|
-
"@deepseek-ai/dsh-agent": "
|
|
115
|
-
"@deepseek-ai/dsh-agent-default-model": "
|
|
116
|
-
"@deepseek-ai/dsh-agent-loop": "
|
|
117
|
-
"@deepseek-ai/dsh-agent-presets": "
|
|
118
|
-
"@deepseek-ai/dsh-cmdline": "
|
|
119
|
-
"@deepseek-ai/dsh-commands": "
|
|
120
|
-
"@deepseek-ai/dsh-credentials": "
|
|
121
|
-
"@deepseek-ai/dsh-llm": "
|
|
122
|
-
"@deepseek-ai/dsh-session": "
|
|
123
|
-
"@deepseek-ai/dsh-settings": "
|
|
124
|
-
"@deepseek-ai/dsh-subagent": "
|
|
125
|
-
"@deepseek-ai/dsh-user-approval": "
|
|
126
|
-
"@deepseek-ai/dsh-user-questions": "
|
|
114
|
+
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.2",
|
|
115
|
+
"@deepseek-ai/dsh-agent-default-model": ">=0.1.1-rc.2",
|
|
116
|
+
"@deepseek-ai/dsh-agent-loop": ">=0.1.1-rc.2",
|
|
117
|
+
"@deepseek-ai/dsh-agent-presets": ">=0.1.1-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-cmdline": ">=0.1.1-rc.2",
|
|
119
|
+
"@deepseek-ai/dsh-commands": ">=0.1.1-rc.2",
|
|
120
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2",
|
|
122
|
+
"@deepseek-ai/dsh-session": ">=0.1.1-rc.2",
|
|
123
|
+
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2",
|
|
124
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.1-rc.2",
|
|
125
|
+
"@deepseek-ai/dsh-user-approval": ">=0.1.1-rc.2",
|
|
126
|
+
"@deepseek-ai/dsh-user-questions": ">=0.1.1-rc.2",
|
|
127
127
|
"@types/node": "^24.0.0",
|
|
128
128
|
"typescript": "^5.9.0",
|
|
129
|
-
"@deepseek-ai/dsh-session-persistence": "
|
|
129
|
+
"@deepseek-ai/dsh-session-persistence": ">=0.1.1-rc.2"
|
|
130
130
|
}
|
|
131
131
|
}
|