@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.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/dist/controller/controller.d.ts +107 -0
- package/dist/controller/controller.js +114 -1
- package/dist/cost/controller.d.ts +5 -0
- package/dist/cost/controller.js +2 -1
- package/dist/cost/scanner.d.ts +4 -2
- package/dist/cost/scanner.js +6 -3
- package/dist/session/controller.d.ts +141 -1
- package/dist/session/controller.js +362 -29
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.js +1 -0
- package/dist/session/info.d.ts +262 -0
- package/dist/session/info.js +326 -0
- package/dist/session/transcript.d.ts +37 -1
- package/dist/session/transcript.js +73 -0
- package/dist/state.d.ts +3 -2
- package/dist/state.js +2 -2
- package/dist/ui/app.js +183 -173
- package/dist/ui/chat/status.js +4 -4
- package/dist/ui/dialogs/index.d.ts +3 -6
- package/dsht-m.png +0 -0
- package/package.json +1 -1
- package/dist/ui/input/history.d.ts +0 -19
- package/dist/ui/input/history.js +0 -43
package/dist/ui/chat/status.js
CHANGED
|
@@ -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 =
|
|
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.
|
|
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 =
|
|
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.
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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,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
|
-
}
|
package/dist/ui/input/history.js
DELETED
|
@@ -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
|
-
}
|