@itookit/dsht 0.3.4 → 0.3.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.
@@ -236,7 +236,7 @@ export const StatusBar = memo(function StatusBar({ controller, expanded = false,
236
236
  const workspace = state.workspaces.find(item => item.workspaceId === state.workspaceId);
237
237
  const view = controller.telemetry.view(state.sessionId);
238
238
  const costs = controller.costs;
239
- const sessionCost = costs?.hasSession(state.sessionId) ? costText(costs.total(state.sessionId)) : '?';
239
+ const sessionCost = controller.sessionCostText;
240
240
  const todayCost = costs ? costText(costs.today()) : '?';
241
241
  // `*` belongs to costText alone; incomplete coverage is a separate degradation, reported by `!`.
242
242
  const coverage = costs?.coverage ?? 'complete';
@@ -258,7 +258,7 @@ export const StatusBar = memo(function StatusBar({ controller, expanded = false,
258
258
  const billed = buckets[0] === undefined || buckets[2] === undefined ? undefined : buckets[0] + buckets[2] + (buckets[3] ?? 0);
259
259
  const hit = cacheHitText(buckets[2], billed);
260
260
  const compactCount = (value) => value === undefined ? '?' : compactNumber.format(value);
261
- const phase = state.transcript.livePhase;
261
+ const phase = state.session.record.livePhase;
262
262
  const clock = running && since !== undefined ? ` ${clockText(now - since)}` : '';
263
263
  const phaseLabel = phase === undefined ? undefined
264
264
  : phase.kind === 'tool' ? `${phase.name ?? 'tool'} ${phaseText(now - phase.startedAt)}`
@@ -325,7 +325,7 @@ const StatusDetails = memo(function StatusDetails({ controller, theme, width, no
325
325
  const workspace = state.workspaces.find(item => item.workspaceId === state.workspaceId);
326
326
  const view = controller.telemetry.view(state.sessionId);
327
327
  const costs = controller.costs;
328
- const sessionCost = costs?.hasSession(state.sessionId) ? costText(costs.total(state.sessionId)) : '?';
328
+ const sessionCost = controller.sessionCostText;
329
329
  const todayCost = costs ? costText(costs.today()) : '?';
330
330
  // `*` belongs to costText alone; incomplete coverage is a separate degradation, reported by `!`.
331
331
  const coverage = costs?.coverage ?? 'complete';
@@ -340,7 +340,7 @@ const StatusDetails = memo(function StatusDetails({ controller, theme, width, no
340
340
  { key: 'activity', color: state.pending.length > 0 ? theme.status.critical : running ? theme.colors.context : theme.colors.muted, text: state.pending.length > 0
341
341
  ? '? Needs you · answer the request above to continue'
342
342
  : running
343
- ? `◐ Working · ${duration}${state.transcript.activeTurnStartedAt === undefined ? ' (observed)' : ''} · Ctrl+C Stop`
343
+ ? `◐ Working · ${duration}${state.session.record.activeTurnStartedAt === undefined ? ' (observed)' : ''} · Ctrl+C Stop`
344
344
  : '● Ready · Ctrl+C exit' },
345
345
  { key: 'host', text: `${safeText(controller.base)} · ${safeText(state.status)}${!state.online ? ' · offline, last known status' : ''}` },
346
346
  ...state.sessionId
@@ -27,12 +27,9 @@ export declare function RemovalDialog({ removal, enabled, canSelect, onCancel, o
27
27
  onCancel(): void;
28
28
  onConfirm(): void;
29
29
  }): import("react").JSX.Element;
30
- /** Two-step model and reasoning-effort selector. */
31
- export interface ModelState {
32
- catalog: ObjectValue;
33
- provider?: string;
34
- model?: ObjectValue;
35
- }
30
+ import type { ModelState } from '../../session/index.ts';
31
+ /** Two-step model and reasoning-effort selector; the state shape is shared with the session. */
32
+ export type { ModelState };
36
33
  /** Model routes and adapter-owned reasoning efforts.
37
34
  * @param props - Catalog, current step and its selection actions.
38
35
  * @returns The model or effort picker.
package/dsht-m.png CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itookit/dsht",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "description": "Remote-first TUI for DeepSeek Harness with SSH-friendly mobile access and request-level cost tracking",
6
6
  "engines": {
@@ -1,19 +0,0 @@
1
- /** Bounded, process-local recall history; never stores transcripts or writes prompt text to disk. */
2
- export declare class InputHistory {
3
- private entries;
4
- private bytes;
5
- private position;
6
- private draft;
7
- /** Remember submitted input, coalescing consecutive duplicates and enforcing both budgets.
8
- * @param value - Submitted command or prompt, excluding interaction answers.
9
- */
10
- record(value: string): void;
11
- /** Leave recall navigation when the composer is edited or otherwise replaced. */
12
- reset(): void;
13
- /** Recall older/newer input, restoring the original unsent draft at the end.
14
- * @param direction - Negative for older input, positive for newer input.
15
- * @param current - Current composer content before beginning recall.
16
- * @returns Recalled input, or the original draft when returning to the newest position.
17
- */
18
- move(direction: -1 | 1, current: string): string;
19
- }
@@ -1,43 +0,0 @@
1
- /** Bounded, process-local recall history; never stores transcripts or writes prompt text to disk. */
2
- export class InputHistory {
3
- entries = [];
4
- bytes = 0;
5
- position;
6
- draft = '';
7
- /** Remember submitted input, coalescing consecutive duplicates and enforcing both budgets.
8
- * @param value - Submitted command or prompt, excluding interaction answers.
9
- */
10
- record(value) {
11
- this.reset();
12
- if (!value || this.entries.at(-1) === value || value.length * 2 > 256 * 1024)
13
- return;
14
- this.entries.push(value);
15
- this.bytes += value.length * 2;
16
- while (this.entries.length > 200 || this.bytes > 256 * 1024)
17
- this.bytes -= this.entries.shift().length * 2;
18
- }
19
- /** Leave recall navigation when the composer is edited or otherwise replaced. */
20
- reset() { this.position = undefined; this.draft = ''; }
21
- /** Recall older/newer input, restoring the original unsent draft at the end.
22
- * @param direction - Negative for older input, positive for newer input.
23
- * @param current - Current composer content before beginning recall.
24
- * @returns Recalled input, or the original draft when returning to the newest position.
25
- */
26
- move(direction, current) {
27
- if (!this.entries.length)
28
- return current;
29
- if (this.position === undefined) {
30
- if (direction > 0)
31
- return current;
32
- this.position = this.entries.length;
33
- this.draft = current;
34
- }
35
- this.position = Math.max(0, Math.min(this.entries.length, this.position + direction));
36
- if (this.position === this.entries.length) {
37
- const draft = this.draft;
38
- this.reset();
39
- return draft;
40
- }
41
- return this.entries[this.position];
42
- }
43
- }