strands-darwin 0.0.47 → 0.0.49
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.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/patches/{@strands-agents+sdk+1.18.0.patch → @strands-agents+sdk+1.20.0.patch} +28 -52
- package/dist/src/agent/background-delegation.d.ts +1 -1
- package/dist/src/agent/background-delegation.js +3 -3
- package/dist/src/agent/cache-miss.d.ts +3 -3
- package/dist/src/agent/cache-miss.js +6 -3
- package/dist/src/agent/cache-miss.js.map +1 -1
- package/dist/src/agent/compact.js +1 -1
- package/dist/src/agent/cost.d.ts +1 -1
- package/dist/src/agent/permission-rules.d.ts +11 -7
- package/dist/src/agent/permission-rules.js +64 -7
- package/dist/src/agent/permission-rules.js.map +1 -1
- package/dist/src/agent/permission.js +2 -1
- package/dist/src/agent/permission.js.map +1 -1
- package/dist/src/agent/runtime.d.ts +28 -5
- package/dist/src/agent/runtime.js +152 -8
- package/dist/src/agent/runtime.js.map +1 -1
- package/dist/src/agent/session-label-write.d.ts +1 -0
- package/dist/src/agent/session-label-write.js +50 -0
- package/dist/src/agent/session-label-write.js.map +1 -0
- package/dist/src/agent/session-label.d.ts +19 -0
- package/dist/src/agent/session-label.js +112 -0
- package/dist/src/agent/session-label.js.map +1 -0
- package/dist/src/agent/usage-state.d.ts +29 -0
- package/dist/src/agent/usage-state.js +131 -0
- package/dist/src/agent/usage-state.js.map +1 -0
- package/dist/src/agent/usage.d.ts +1 -1
- package/dist/src/agents/child-result-text.d.ts +26 -0
- package/dist/src/agents/child-result-text.js +29 -0
- package/dist/src/agents/child-result-text.js.map +1 -0
- package/dist/src/agents/subagent-tool.js +6 -5
- package/dist/src/agents/subagent-tool.js.map +1 -1
- package/dist/src/agents/workflow-tool.d.ts +15 -2
- package/dist/src/agents/workflow-tool.js +24 -5
- package/dist/src/agents/workflow-tool.js.map +1 -1
- package/dist/src/cli-main.js +4 -0
- package/dist/src/cli-main.js.map +1 -1
- package/dist/src/cli-sessions.d.ts +30 -2
- package/dist/src/cli-sessions.js +53 -13
- package/dist/src/cli-sessions.js.map +1 -1
- package/dist/src/collaboration/local.d.ts +11 -0
- package/dist/src/collaboration/local.js +23 -4
- package/dist/src/collaboration/local.js.map +1 -1
- package/dist/src/commands/custom-commands.d.ts +1 -1
- package/dist/src/commands/custom-commands.js +3 -1
- package/dist/src/commands/custom-commands.js.map +1 -1
- package/dist/src/headless-runner.js +10 -7
- package/dist/src/headless-runner.js.map +1 -1
- package/dist/src/headless.d.ts +1 -1
- package/dist/src/headless.js +1 -1
- package/dist/src/mcp/codegraph-preflight.js +8 -4
- package/dist/src/mcp/codegraph-preflight.js.map +1 -1
- package/dist/src/mcp/oauth-login.js +1 -1
- package/dist/src/mcp/oauth-login.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +1 -2
- package/dist/src/mcp/oauth-provider.js +9 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-store.d.ts +1 -2
- package/dist/src/mcp/oauth-store.js +9 -2
- package/dist/src/mcp/oauth-store.js.map +1 -1
- package/dist/src/mcp/prompts.d.ts +0 -18
- package/dist/src/mcp/prompts.js +25 -4
- package/dist/src/mcp/prompts.js.map +1 -1
- package/dist/src/mcp/web-search-empty-results.js +8 -4
- package/dist/src/mcp/web-search-empty-results.js.map +1 -1
- package/dist/src/npm-package/patch-package-format.d.ts +5 -5
- package/dist/src/npm-package/patch-package-format.js +4 -4
- package/dist/src/sdk-patch-preflight.js +1 -1
- package/dist/src/tools/file-editor-serial.d.ts +5 -3
- package/dist/src/tools/file-editor-serial.js +5 -3
- package/dist/src/tools/file-editor-serial.js.map +1 -1
- package/dist/src/trajectory/record.d.ts +1 -1
- package/dist/src/tui/App.d.ts +1 -1
- package/dist/src/tui/App.js +48 -17
- package/dist/src/tui/App.js.map +1 -1
- package/dist/src/tui/InputBox.d.ts +4 -2
- package/dist/src/tui/InputBox.js +3 -3
- package/dist/src/tui/InputBox.js.map +1 -1
- package/dist/src/tui/help-format.d.ts +1 -1
- package/dist/src/tui/help-format.js +1 -1
- package/dist/src/tui/prompt-editor.d.ts +15 -7
- package/dist/src/tui/prompt-editor.js +23 -39
- package/dist/src/tui/prompt-editor.js.map +1 -1
- package/dist/src/tui/sessions-format.d.ts +10 -0
- package/dist/src/tui/sessions-format.js +46 -0
- package/dist/src/tui/sessions-format.js.map +1 -0
- package/dist/src/tui/status-format.d.ts +2 -0
- package/dist/src/tui/status-format.js +2 -1
- package/dist/src/tui/status-format.js.map +1 -1
- package/dist/src/tui/task-wake.d.ts +1 -1
- package/dist/src/tui/task-wake.js +1 -1
- package/dist/src/tui/turn-state.d.ts +1 -1
- package/dist/src/tui/turn-state.js +10 -2
- package/dist/src/tui/turn-state.js.map +1 -1
- package/package.json +3 -2
|
@@ -10,12 +10,14 @@ export declare const MUTATING_FILE_EDITOR_COMMANDS: ReadonlySet<string>;
|
|
|
10
10
|
* the parent's system prompt, so a child whose prompt omits the rule still sees it.
|
|
11
11
|
*/
|
|
12
12
|
export declare const FILE_EDITOR_PAYLOAD_GUIDANCE = "Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload.";
|
|
13
|
+
/** SRF-040: whole existing content is checked before slicing or editing, not per payload. */
|
|
14
|
+
export declare const FILE_EDITOR_EXISTING_FILE_GUIDANCE = "The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.";
|
|
13
15
|
/**
|
|
14
16
|
* The description the runtime gives `makeFileEditor({ description })`: the SDK's own
|
|
15
|
-
* text first,
|
|
16
|
-
*
|
|
17
|
+
* text first, then the separate payload and existing-file bounds. The wrapper below
|
|
18
|
+
* never touches it — it stays a projection of what it wraps.
|
|
17
19
|
*/
|
|
18
|
-
export declare const FILE_EDITOR_DESCRIPTION = "Filesystem editor tool for viewing, creating, and editing files. Supports view (with line ranges), create, str_replace, and insert operations. Files must use absolute paths. Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload.";
|
|
20
|
+
export declare const FILE_EDITOR_DESCRIPTION = "Filesystem editor tool for viewing, creating, and editing files. Supports view (with line ranges), create, str_replace, and insert operations. Files must use absolute paths. Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload. The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.";
|
|
19
21
|
export declare class SerializedFileEditorTool extends Tool {
|
|
20
22
|
private readonly original;
|
|
21
23
|
readonly name: string;
|
|
@@ -31,12 +31,14 @@ export const MUTATING_FILE_EDITOR_COMMANDS = new Set(['create', 'str_replace', '
|
|
|
31
31
|
* the parent's system prompt, so a child whose prompt omits the rule still sees it.
|
|
32
32
|
*/
|
|
33
33
|
export const FILE_EDITOR_PAYLOAD_GUIDANCE = "Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls — never as one whole-document payload.";
|
|
34
|
+
/** SRF-040: whole existing content is checked before slicing or editing, not per payload. */
|
|
35
|
+
export const FILE_EDITOR_EXISTING_FILE_GUIDANCE = 'The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.';
|
|
34
36
|
/**
|
|
35
37
|
* The description the runtime gives `makeFileEditor({ description })`: the SDK's own
|
|
36
|
-
* text first,
|
|
37
|
-
*
|
|
38
|
+
* text first, then the separate payload and existing-file bounds. The wrapper below
|
|
39
|
+
* never touches it — it stays a projection of what it wraps.
|
|
38
40
|
*/
|
|
39
|
-
export const FILE_EDITOR_DESCRIPTION = `${DEFAULT_FILE_EDITOR_DESCRIPTION} ${FILE_EDITOR_PAYLOAD_GUIDANCE}`;
|
|
41
|
+
export const FILE_EDITOR_DESCRIPTION = `${DEFAULT_FILE_EDITOR_DESCRIPTION} ${FILE_EDITOR_PAYLOAD_GUIDANCE} ${FILE_EDITOR_EXISTING_FILE_GUIDANCE}`;
|
|
40
42
|
export class SerializedFileEditorTool extends Tool {
|
|
41
43
|
original;
|
|
42
44
|
name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-editor-serial.js","sourceRoot":"","sources":["../../../src/tools/file-editor-serial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,IA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E,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -323,7 +323,7 @@ export interface ShellCommandRecord extends RecordEnvelope {
|
|
|
323
323
|
* delegation label the transcript row shows (`subagent general#bg1: count things`),
|
|
324
324
|
* `taskId` the SDK task id, `exitCode`/`signal` always `null`, and `state` is
|
|
325
325
|
* `succeeded`/`failed` from the run's tool result — the report itself is never here,
|
|
326
|
-
* it reaches the model only as the SDK's own `
|
|
326
|
+
* it reaches the model only as the SDK's own `strands_manage_background_task` pair.
|
|
327
327
|
*/
|
|
328
328
|
export interface TaskNotificationFields {
|
|
329
329
|
taskId: string;
|
package/dist/src/tui/App.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare function workingStatusIndex(frame: number): number;
|
|
|
53
53
|
export declare function formatUsageReport(usage: UsageTotals, config: AppConfig, resumed: boolean, turnInFlight?: boolean, lastTurn?: UsageTotals, children?: {
|
|
54
54
|
dispatches: number;
|
|
55
55
|
usage: UsageTotals;
|
|
56
|
-
}, callStats?: SessionCallStats, modelShares?: readonly ModelUsageShare[], cacheMisses?: CacheMissReport): string;
|
|
56
|
+
}, callStats?: SessionCallStats, modelShares?: readonly ModelUsageShare[], cacheMisses?: CacheMissReport, historyComplete?: boolean): string;
|
|
57
57
|
/**
|
|
58
58
|
* Wraps a reducer dispatch so every notice is also written to the diagnostics log,
|
|
59
59
|
* with the severity it was shown at — or hands the dispatch straight back when there
|
package/dist/src/tui/App.js
CHANGED
|
@@ -83,6 +83,7 @@ import { liveBackgroundDelegationRefusal } from '../agent/background-delegation.
|
|
|
83
83
|
import { createContextWarnLatch, formatContextReport, formatContextReportWithBreakdown } from './context-format.js';
|
|
84
84
|
import { COPY_COMMAND_USAGE, runCopyCommand } from './copy-command.js';
|
|
85
85
|
import { formatHelpReport } from './help-format.js';
|
|
86
|
+
import { readSessionsReport } from './sessions-format.js';
|
|
86
87
|
import { formatMcpReport } from './mcp-format.js';
|
|
87
88
|
import { describeMode, formatPromptCache, formatPromptCacheState, formatStatusReport, formatThinking, } from './status-format.js';
|
|
88
89
|
import { PlanChecklist } from './PlanChecklist.js';
|
|
@@ -238,14 +239,14 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
238
239
|
*/
|
|
239
240
|
const applyDestructive = useCallback((edit) => {
|
|
240
241
|
const current = editorRef.current;
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
242
|
+
const deletion = edit(current);
|
|
243
|
+
if (deletion.value.text !== current.text)
|
|
243
244
|
undoStack.current = pushUndo(undoStack.current, current);
|
|
244
|
-
const cut = updateLastCut(lastCut.current, current,
|
|
245
|
+
const cut = updateLastCut(lastCut.current, current, deletion);
|
|
245
246
|
lastCut.current = cut.text;
|
|
246
247
|
if (cut.overflow)
|
|
247
248
|
dispatch({ type: 'notice', text: LAST_CUT_OVERFLOW_NOTICE, severity: 'warn' });
|
|
248
|
-
setEditor(
|
|
249
|
+
setEditor(deletion.value);
|
|
249
250
|
}, [dispatch, setEditor]);
|
|
250
251
|
// The frame's fixed furniture. Only the header is *measured*: its height depends
|
|
251
252
|
// on nothing below it, so measuring it cannot oscillate. Everything else states
|
|
@@ -1002,13 +1003,16 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
1002
1003
|
lifecycleOutcome = turnAborted.current ? 'cancelled' : 'failure';
|
|
1003
1004
|
turnAborted.current = true;
|
|
1004
1005
|
// Only final failure reaches here: the exact stream continuation above
|
|
1005
|
-
// keeps its inbox.
|
|
1006
|
+
// keeps its inbox. Drop what was already queued before idle can drain
|
|
1007
|
+
// it, but leave the listening incarnation in place — a turn failure is
|
|
1008
|
+
// not a new process, and retiring the UUID is how a long cross-project
|
|
1009
|
+
// session loses every peer it can send to.
|
|
1006
1010
|
if (lifecycleOutcome === 'failure') {
|
|
1007
1011
|
const local = runtime.collaboration;
|
|
1008
|
-
const
|
|
1009
|
-
local?.
|
|
1010
|
-
if (
|
|
1011
|
-
dispatch({ type: 'notice', severity: 'warn', text: '
|
|
1012
|
+
const queued = local?.pending ?? 0;
|
|
1013
|
+
local?.dropQueued('turn failed');
|
|
1014
|
+
if (queued > 0)
|
|
1015
|
+
dispatch({ type: 'notice', severity: 'warn', text: 'Queued peer messages dropped after turn failure; they are not replayed. This endpoint stays published at the same address.' });
|
|
1012
1016
|
}
|
|
1013
1017
|
// A throttled turn names how retry ended — the cap (`after N attempts`) or a
|
|
1014
1018
|
// wait Esc cut short — from the runtime's own outcome, never the message text.
|
|
@@ -1179,6 +1183,23 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
1179
1183
|
});
|
|
1180
1184
|
return;
|
|
1181
1185
|
}
|
|
1186
|
+
// Saved snapshots in this project only. Local idle/busy before queueing; one
|
|
1187
|
+
// Static notice, no runtime state transition or model/tool/MCP work.
|
|
1188
|
+
if (/^\/sessions(?:\s|$)/.test(text)) {
|
|
1189
|
+
setEditor({ text: '', cursor: { offset: 0, affinity: 'downstream' } });
|
|
1190
|
+
setSelectedCompletion(0);
|
|
1191
|
+
if (text !== '/sessions') {
|
|
1192
|
+
dispatch({ type: 'notice', text: '/sessions takes no arguments' });
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
try {
|
|
1196
|
+
dispatch({ type: 'notice', text: await readSessionsReport(runtime.info.projectRoot) });
|
|
1197
|
+
}
|
|
1198
|
+
catch {
|
|
1199
|
+
dispatch({ type: 'notice', text: 'could not list saved sessions in this project' });
|
|
1200
|
+
}
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1182
1203
|
// SER-057: the last *completed* answer's transcript text onto the clipboard —
|
|
1183
1204
|
// OSC 52 through Ink's own stdout writer first (this is usually an SSH session),
|
|
1184
1205
|
// the platform tool only when a display is present. Before the busy guard like
|
|
@@ -1206,7 +1227,7 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
1206
1227
|
dispatch({ type: 'userInput', text });
|
|
1207
1228
|
dispatch({
|
|
1208
1229
|
type: 'notice',
|
|
1209
|
-
text: formatUsageReport(runtime.usage, runtime.config, runtime.info.resumed, status === 'streaming', runtime.lastTurnUsage, runtime.childUsage, runtime.callStats, runtime.modelShares, runtime.cacheMissReport()),
|
|
1230
|
+
text: formatUsageReport(runtime.usage, runtime.config, runtime.info.resumed, status === 'streaming', runtime.lastTurnUsage, runtime.childUsage, runtime.callStats, runtime.modelShares, runtime.cacheMissReport(), runtime.hasCompleteUsageHistory),
|
|
1210
1231
|
});
|
|
1211
1232
|
return;
|
|
1212
1233
|
}
|
|
@@ -1513,6 +1534,15 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
1513
1534
|
});
|
|
1514
1535
|
return;
|
|
1515
1536
|
}
|
|
1537
|
+
// User-only display metadata. Read the untrimmed suffix so exterior controls
|
|
1538
|
+
// cannot disappear in submit's ordinary trim; never send or queue this command.
|
|
1539
|
+
if (/^\/rename(?:\s|$)/.test(text)) {
|
|
1540
|
+
setEditor({ text: '', cursor: { offset: 0, affinity: 'downstream' } });
|
|
1541
|
+
setSelectedCompletion(0);
|
|
1542
|
+
const suffix = raw.trimStart().slice('/rename'.length);
|
|
1543
|
+
dispatch({ type: 'notice', text: await runtime.renameSession(suffix) });
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1516
1546
|
// One consolidated read of state the session already holds (SER-026), on the
|
|
1517
1547
|
// /mcp precedent: a formatter over existing accessors, never a new information
|
|
1518
1548
|
// channel — no model call, no connection attempt, no mutation. Above the busy
|
|
@@ -1542,6 +1572,7 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
1542
1572
|
text: formatStatusReport({
|
|
1543
1573
|
config: runtime.config,
|
|
1544
1574
|
sessionId: runtime.info.sessionId,
|
|
1575
|
+
sessionLabel: runtime.sessionLabel,
|
|
1545
1576
|
resumed: runtime.info.resumed,
|
|
1546
1577
|
promptCache: runtime.promptCache,
|
|
1547
1578
|
thinking: runtime.thinking,
|
|
@@ -3085,7 +3116,7 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
|
|
|
3085
3116
|
setSelectedCompletion(0);
|
|
3086
3117
|
endRecall();
|
|
3087
3118
|
});
|
|
3088
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { history: heldHistory ?? state.history, ...(state.staticEpoch === 0 ? { welcome: initialWelcome } : {}), liveText: state.liveText, liveCodeOpen: fenceOpenAfter(state.committedAnswer), columns: columns, maxLiveRows: grants.live, staticEpoch: state.staticEpoch }), _jsx(Box, { ref: headerRef, flexDirection: "column", children: _jsx(Header, { runtime: runtime, status: effectiveStatus, frame: frame, tangent: tangent, goal: goal, runningTaskCount: runningTaskCount, draftStashed: statusHint === undefined && draftStash !== undefined }) }), _jsxs(Box, { ref: chromeRef, flexDirection: "column", children: [state.thinking && effectiveStatus === 'streaming' && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: `thinking…${busyElapsedMs === undefined ? '' : busySuffix(busyElapsedMs, undefined, busyRetryWait)}` })), _jsx(ActiveToolCalls, { tools: state.activeTools, frame: frame, toolDetailsExpanded: state.toolDetailsExpanded, columns: columns, maxRows: grants.tools }), _jsx(PlanChecklist, { plan: state.livePlan, maxRows: grants.plan }), _jsx(QueuedMessages, { entries: queued, maxRows: grants.queued }), activeRuleReview !== undefined ? _jsx(PermissionRulePreview, { review: activeRuleReview }) : pendingPermission !== undefined ? (_jsx(PermissionPrompt, { request: pendingPermission, waiting: permissions.waiting, columns: columns, maxRows: grants.prompt })) : (_jsx(InputBox, { layout: layout, completions: completions, completionKind: completionKind, completionNote: completionNote, commandDescriptions: commandDescriptions, selectedCompletion: selectedCompletion, editable: effectiveStatus !== 'compacting', offset: { top: chrome.top, left: chrome.left }, maxRows: grants.prompt, hint: streamingHint, attachment: attachedImage === undefined ? undefined : clipboardImageFact(attachedImage), recallIndicator: recallIndicator, historySearch: historySearchProjection, rewindSearch: rewindSearchProjection }))] })] }));
|
|
3119
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { history: heldHistory ?? state.history, ...(state.staticEpoch === 0 ? { welcome: initialWelcome } : {}), liveText: state.liveText, liveCodeOpen: fenceOpenAfter(state.committedAnswer), columns: columns, maxLiveRows: grants.live, staticEpoch: state.staticEpoch }), _jsx(Box, { ref: headerRef, flexDirection: "column", children: _jsx(Header, { runtime: runtime, status: effectiveStatus, frame: frame, tangent: tangent, goal: goal, runningTaskCount: runningTaskCount, draftStashed: statusHint === undefined && draftStash !== undefined }) }), _jsxs(Box, { ref: chromeRef, flexDirection: "column", children: [state.thinking && effectiveStatus === 'streaming' && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: `thinking…${busyElapsedMs === undefined ? '' : busySuffix(busyElapsedMs, undefined, busyRetryWait)}` })), _jsx(ActiveToolCalls, { tools: state.activeTools, frame: frame, toolDetailsExpanded: state.toolDetailsExpanded, columns: columns, maxRows: grants.tools }), _jsx(PlanChecklist, { plan: state.livePlan, maxRows: grants.plan }), _jsx(QueuedMessages, { entries: queued, maxRows: grants.queued }), activeRuleReview !== undefined ? _jsx(PermissionRulePreview, { review: activeRuleReview }) : pendingPermission !== undefined ? (_jsx(PermissionPrompt, { request: pendingPermission, waiting: permissions.waiting, columns: columns, maxRows: grants.prompt })) : (_jsx(InputBox, { layout: layout, completions: completions, completionKind: completionKind, completionNote: completionNote, commandDescriptions: commandDescriptions, selectedCompletion: selectedCompletion, editable: effectiveStatus !== 'compacting', shellMode: parseShellCommand(draft) !== undefined, offset: { top: chrome.top, left: chrome.left }, maxRows: grants.prompt, hint: streamingHint, attachment: attachedImage === undefined ? undefined : clipboardImageFact(attachedImage), recallIndicator: recallIndicator, historySearch: historySearchProjection, rewindSearch: rewindSearchProjection }))] })] }));
|
|
3089
3120
|
}
|
|
3090
3121
|
/** The hint row under the draft, or nothing when the session is idle. */
|
|
3091
3122
|
function hintForStatus(status, busyReadout, queuedCount = 0, queuedWakeCount = 0, goalSuffix = '') {
|
|
@@ -3194,7 +3225,7 @@ function capabilityCount(count, label) {
|
|
|
3194
3225
|
* working), and that comparison is what a column makes readable. An unavailable
|
|
3195
3226
|
* provider metric remains text rather than masquerading as numeric zero.
|
|
3196
3227
|
*/
|
|
3197
|
-
export function formatUsageReport(usage, config, resumed, turnInFlight = false, lastTurn, children, callStats, modelShares, cacheMisses) {
|
|
3228
|
+
export function formatUsageReport(usage, config, resumed, turnInFlight = false, lastTurn, children, callStats, modelShares, cacheMisses, historyComplete = !resumed) {
|
|
3198
3229
|
const rows = usageRows(usage, config);
|
|
3199
3230
|
const derived = cacheEffectivenessRows(usage, config);
|
|
3200
3231
|
// The miss count is a fact only once a miss was observed (SER-074): a session
|
|
@@ -3225,11 +3256,11 @@ export function formatUsageReport(usage, config, resumed, turnInFlight = false,
|
|
|
3225
3256
|
}
|
|
3226
3257
|
}
|
|
3227
3258
|
}
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3259
|
+
const heading = !historyComplete
|
|
3260
|
+
? 'token usage — this session (earlier usage unavailable: no valid saved counters)'
|
|
3261
|
+
: resumed
|
|
3262
|
+
? 'token usage — this session (including earlier runs)'
|
|
3263
|
+
: 'token usage — this session';
|
|
3233
3264
|
// Asked mid-turn, the totals are the ones from before it: the meter accumulates
|
|
3234
3265
|
// a model call when it finishes. Said out loud, because numbers that do not move
|
|
3235
3266
|
// while the agent is visibly working read as a broken counter.
|