@humain/humain-code 0.8.5 → 0.8.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/CHANGELOG.md +27 -2
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/{anthropic-messages-42CGJCSR.js → anthropic-messages-QMSJV4J5.js} +3 -3
- package/dist/bundle/chunks/{ask-VH7GNX75.js → ask-VVSJA5VG.js} +2 -2
- package/dist/bundle/chunks/{azure-openai-responses-DOKKMBUN.js → azure-openai-responses-P57ZD6XP.js} +3 -3
- package/dist/bundle/chunks/chunk-2QVKRSKH.js +4 -0
- package/dist/bundle/chunks/{chunk-SASR4VNV.js → chunk-3BZUQ54Z.js} +1 -1
- package/dist/bundle/chunks/{chunk-XGOJCV6Z.js → chunk-4K6ISLTX.js} +1 -1
- package/dist/bundle/chunks/{chunk-BNZZJ4LO.js → chunk-4QVJYVS5.js} +1 -1
- package/dist/bundle/chunks/{chunk-MXF3KYLZ.js → chunk-4UXFF4IH.js} +1 -1
- package/dist/bundle/chunks/{chunk-53DWQSBC.js → chunk-6PJEPQBW.js} +2 -2
- package/dist/bundle/chunks/{chunk-4SL6URR3.js → chunk-7X7QN6MX.js} +5 -3
- package/dist/bundle/chunks/{chunk-N3W4ALAM.js → chunk-A7AH3VMJ.js} +69 -66
- package/dist/bundle/chunks/{chunk-H35P7ROY.js → chunk-B345VDHB.js} +9 -7
- package/dist/bundle/chunks/{chunk-A5ZMBTTM.js → chunk-B57IK7TV.js} +2 -2
- package/dist/bundle/chunks/{chunk-KJ3QRSSY.js → chunk-BVBEJBVY.js} +1 -1
- package/dist/bundle/chunks/{chunk-AER66CNP.js → chunk-BXDTDGHH.js} +1 -1
- package/dist/bundle/chunks/chunk-CDLUE6BJ.js +4 -0
- package/dist/bundle/chunks/{chunk-FLWO3H5J.js → chunk-DBC6XUKA.js} +1 -1
- package/dist/bundle/chunks/{chunk-BDNX23GT.js → chunk-EB2ZJYOO.js} +268 -232
- package/dist/bundle/chunks/{chunk-2RXTZK2V.js → chunk-EK4QE622.js} +147 -37
- package/dist/bundle/chunks/{chunk-K5EFEIFP.js → chunk-H6CKS7HC.js} +1 -1
- package/dist/bundle/chunks/{chunk-UTRUALFN.js → chunk-HV25WMNO.js} +1 -1
- package/dist/bundle/chunks/{chunk-7XRMMCKG.js → chunk-IP7R6BIN.js} +935 -529
- package/dist/bundle/chunks/{chunk-HRNYDRL7.js → chunk-J5R2BQJS.js} +1 -1
- package/dist/bundle/chunks/{chunk-5C5K4EVJ.js → chunk-JNSFJADB.js} +1 -1
- package/dist/bundle/chunks/{chunk-CG43CMFH.js → chunk-KBIPIIKE.js} +1 -1
- package/dist/bundle/chunks/{chunk-3OOOEJV4.js → chunk-MS3SLC2V.js} +10 -10
- package/dist/bundle/chunks/{chunk-WCKS2DPT.js → chunk-NO6T6CDO.js} +1 -1
- package/dist/bundle/chunks/{chunk-VWUEKLRH.js → chunk-NSSJ6OJK.js} +141 -225
- package/dist/bundle/chunks/{chunk-MZYHSWHX.js → chunk-OR3ORXP3.js} +2 -2
- package/dist/bundle/chunks/{chunk-MLOUZAVZ.js → chunk-PU7SKUJ6.js} +2 -2
- package/dist/bundle/chunks/{chunk-QZXLTW7V.js → chunk-RRGJHRKF.js} +1 -1
- package/dist/bundle/chunks/{chunk-625QJSFJ.js → chunk-SDPK3KZ3.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZFFDBTG3.js → chunk-SPLJOIKL.js} +1 -1
- package/dist/bundle/chunks/{chunk-O44A4E4K.js → chunk-TNKPCYIM.js} +1 -1
- package/dist/bundle/chunks/{chunk-5KUCY54O.js → chunk-UY5TOBH2.js} +1 -1
- package/dist/bundle/chunks/{chunk-FHP5BULR.js → chunk-VFPA5KPR.js} +1 -1
- package/dist/bundle/chunks/chunk-VP27C46J.js +23 -0
- package/dist/bundle/chunks/{chunk-B3FT6L6S.js → chunk-XZJT5U3V.js} +1 -1
- package/dist/bundle/chunks/{chunk-UOSJTMCL.js → chunk-YCGPXBJP.js} +1 -1
- package/dist/bundle/chunks/{chunk-COZTJAOY.js → chunk-YRSNKHEF.js} +384 -781
- package/dist/bundle/chunks/{chunk-MQYR4Q6X.js → chunk-YSRWNEZW.js} +1 -1
- package/dist/bundle/chunks/{chunk-EWPEY4F4.js → chunk-ZAO4KC6J.js} +884 -898
- package/dist/bundle/chunks/{chunk-V2HTCZRF.js → chunk-ZXOTVZUX.js} +1 -1
- package/dist/bundle/chunks/{chunk-T5WECB2D.js → chunk-ZZNGVD5Q.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-ZAZW4M4B.js → cloudflare-workers-ai-system-one-4BO66KHO.js} +1 -1
- package/dist/bundle/chunks/{compat-2RC4CJNV.js → compat-EOHVO2W3.js} +4 -4
- package/dist/bundle/chunks/{curator-server-MW645JI3.js → curator-server-72V7LMHQ.js} +1 -1
- package/dist/bundle/chunks/{dist-3DAGUOYC.js → dist-FW7ELRQH.js} +1 -1
- package/dist/bundle/chunks/{dist-K4QIXV5O.js → dist-YEVRRTWL.js} +8 -8
- package/dist/bundle/chunks/{dist-VXQT3DQY.js → dist-ZRUKAVTU.js} +3 -3
- package/dist/bundle/chunks/{doctor-EH7X36SK.js → doctor-HJKC434Y.js} +29 -28
- package/dist/bundle/chunks/{easter-egg-3d-Z24JLXD4.js → easter-egg-3d-M37PJBL5.js} +1 -1
- package/dist/bundle/chunks/entry-M5TRX7N4.js +2 -0
- package/dist/bundle/chunks/{execute-C4BZQRPQ.js → execute-MIXK3CFW.js} +2 -2
- package/dist/bundle/chunks/{extract-XVQCIS7D.js → extract-WB6Y6ISY.js} +2 -2
- package/dist/bundle/chunks/{flow-implementer-J6QTLBTH.js → flow-implementer-ZNK5KVOG.js} +5 -5
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-P2P45MYP.js → google-generative-ai-B2BT7X4W.js} +3 -3
- package/dist/bundle/chunks/{google-vertex-SHY4IS5F.js → google-vertex-PCFDFRHY.js} +3 -3
- package/dist/bundle/chunks/{host-YESS2VAB.js → host-RF6R6GLZ.js} +1 -1
- package/dist/bundle/chunks/{inprocess-OHNEKTFB.js → inprocess-6MLIANGV.js} +6 -6
- package/dist/bundle/chunks/interactive-mode-QKREO5BH.js +6 -0
- package/dist/bundle/chunks/{llama-cpp-classify-RSRH4KV2.js → llama-cpp-classify-DMJSUUAD.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-YTMJKHHI.js → mistral-conversations-OXWTIYWX.js} +2 -2
- package/dist/bundle/chunks/{openai-codex-responses-NUCJOJSZ.js → openai-codex-responses-YGXOZKWL.js} +3 -3
- package/dist/bundle/chunks/{openai-completions-E5NRJUHA.js → openai-completions-WDVOHMN6.js} +4 -4
- package/dist/bundle/chunks/{openai-decisions-342J5ZYG.js → openai-decisions-45LGQAD5.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-BN5Z4HFI.js → openai-responses-OZDPUN4M.js} +3 -3
- package/dist/bundle/chunks/{openrouter-images-7RNG3JVF.js → openrouter-images-2IKRVRTZ.js} +2 -2
- package/dist/bundle/chunks/{pi-messages-2L7FV5OK.js → pi-messages-VZOJLMWW.js} +2 -2
- package/dist/bundle/chunks/{questionnaire-session-XEVAK7JS.js → questionnaire-session-RSZE5I3P.js} +2 -2
- package/dist/bundle/chunks/{session-picker-666KJIVM.js → session-picker-EUPZJEFF.js} +2 -2
- package/dist/bundle/chunks/{startup-ui-INEVSNGK.js → startup-ui-RTSTUGUC.js} +2 -2
- package/dist/bundle/chunks/{typesafe-system-one-UJUNSZG4.js → typesafe-system-one-IVWD24CQ.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-6FVRJTM3.js → virtual-modules-LS3DOCYU.js} +8 -8
- package/dist/bundle/cli-runtime.js +5 -5
- package/dist/bundle/flow/package.json +1 -1
- package/dist/bundle/index.js +11 -11
- package/dist/bundle/rpc-entry.js +5 -5
- package/dist/coordination/adapter/delivery.d.ts +6 -0
- package/dist/coordination/adapter/delivery.d.ts.map +1 -1
- package/dist/coordination/adapter/delivery.js +39 -4
- package/dist/coordination/adapter/delivery.js.map +1 -1
- package/dist/coordination/adapter/index.d.ts +2 -0
- package/dist/coordination/adapter/index.d.ts.map +1 -1
- package/dist/coordination/adapter/index.js +26 -0
- package/dist/coordination/adapter/index.js.map +1 -1
- package/dist/coordination/adapter/tool.js +3 -3
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +2 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +4 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +16 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +5 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +31 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +5 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +8 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/forge-build-token.d.ts +3 -0
- package/dist/forge-build-token.d.ts.map +1 -0
- package/dist/forge-build-token.js +17 -0
- package/dist/forge-build-token.js.map +1 -0
- package/dist/humain/checklist/vendor/commands.d.ts +7 -0
- package/dist/humain/checklist/vendor/commands.d.ts.map +1 -1
- package/dist/humain/checklist/vendor/commands.js +65 -13
- package/dist/humain/checklist/vendor/commands.js.map +1 -1
- package/dist/humain/checklist/vendor/index.d.ts.map +1 -1
- package/dist/humain/checklist/vendor/index.js +4 -3
- package/dist/humain/checklist/vendor/index.js.map +1 -1
- package/dist/humain/hcode/build-token.d.ts +35 -0
- package/dist/humain/hcode/build-token.d.ts.map +1 -0
- package/dist/humain/hcode/build-token.js +406 -0
- package/dist/humain/hcode/build-token.js.map +1 -0
- package/dist/humain/hcode/contracts.d.ts +3 -1
- package/dist/humain/hcode/contracts.d.ts.map +1 -1
- package/dist/humain/hcode/contracts.js +7 -4
- package/dist/humain/hcode/contracts.js.map +1 -1
- package/dist/humain/hcode/notices.d.ts +5 -0
- package/dist/humain/hcode/notices.d.ts.map +1 -1
- package/dist/humain/hcode/notices.js +5 -0
- package/dist/humain/hcode/notices.js.map +1 -1
- package/dist/humain/hcode/provider.d.ts.map +1 -1
- package/dist/humain/hcode/provider.js +1 -1
- package/dist/humain/hcode/provider.js.map +1 -1
- package/dist/humain/hcode/run-credential.d.ts +3 -1
- package/dist/humain/hcode/run-credential.d.ts.map +1 -1
- package/dist/humain/hcode/run-credential.js +123 -19
- package/dist/humain/hcode/run-credential.js.map +1 -1
- package/dist/humain/hcode/sandbox.d.ts.map +1 -1
- package/dist/humain/hcode/sandbox.js +10 -4
- package/dist/humain/hcode/sandbox.js.map +1 -1
- package/dist/modes/interactive/chat-viewport.d.ts +4 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/chat-viewport.js +29 -5
- package/dist/modes/interactive/chat-viewport.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +2 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +29 -12
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-line.js +2 -2
- package/dist/modes/interactive/components/status-line.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +18 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +91 -3
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-group.d.ts +22 -0
- package/dist/modes/interactive/components/tool-group.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-group.js +117 -0
- package/dist/modes/interactive/components/tool-group.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +12 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +155 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/sidebar/git-work.d.ts +18 -0
- package/dist/modes/interactive/sidebar/git-work.d.ts.map +1 -0
- package/dist/modes/interactive/sidebar/git-work.js +56 -0
- package/dist/modes/interactive/sidebar/git-work.js.map +1 -0
- package/dist/modes/interactive/sidebar/sidebar-component.d.ts +13 -0
- package/dist/modes/interactive/sidebar/sidebar-component.d.ts.map +1 -0
- package/dist/modes/interactive/sidebar/sidebar-component.js +61 -0
- package/dist/modes/interactive/sidebar/sidebar-component.js.map +1 -0
- package/dist/modes/interactive/sidebar/sidebar-model.d.ts +69 -0
- package/dist/modes/interactive/sidebar/sidebar-model.d.ts.map +1 -0
- package/dist/modes/interactive/sidebar/sidebar-model.js +217 -0
- package/dist/modes/interactive/sidebar/sidebar-model.js.map +1 -0
- package/dist/modes/interactive/tool-grouping.d.ts +11 -0
- package/dist/modes/interactive/tool-grouping.d.ts.map +1 -0
- package/dist/modes/interactive/tool-grouping.js +32 -0
- package/dist/modes/interactive/tool-grouping.js.map +1 -0
- package/docs/coordination.md +7 -3
- package/docs/environment-variables.md +14 -0
- package/docs/forge-run-bootstrap.md +77 -42
- package/docs/keybindings.md +2 -0
- package/docs/providers.md +14 -0
- package/docs/settings.md +16 -1
- package/docs/slash-commands.md +3 -0
- package/examples/sdk/12-full-control.ts +1 -1
- package/npm-shrinkwrap.json +7 -6
- package/package.json +3 -2
- package/schemas/keybindings.schema.json +8 -0
- package/schemas/settings.schema.json +29 -0
- package/src/humain/caveman/UPSTREAM.md +15 -3
- package/src/humain/caveman/upstream.json +2 -2
- package/dist/bundle/chunks/chunk-HWFAAGYK.js +0 -23
- package/dist/bundle/chunks/chunk-RP6MWUAP.js +0 -4
- package/dist/bundle/chunks/entry-3EL6GOWK.js +0 -2
- package/dist/bundle/chunks/interactive-mode-ZREVRX7W.js +0 -5
- /package/dist/bundle/chunks/{chunk-T7F2TEIS.js → chunk-3IX4NEXK.js} +0 -0
|
@@ -14,6 +14,7 @@ import chalk from "chalk";
|
|
|
14
14
|
import { spawn } from "child_process";
|
|
15
15
|
import { trackUserWait } from "../../agent-monitor/user-wait.js";
|
|
16
16
|
import { APP_COMMAND, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, ENV_OFFLINE, getAgentDir, getAuthPath, getChangelogUrl, getDebugLogPath, getDocsPath, usesDefaultAgentDir, VERSION, } from "../../config.js";
|
|
17
|
+
import { getLiveSessionCount } from "../../coordination/adapter/index.js";
|
|
17
18
|
import { formatAccountUsageReport } from "../../core/account-reporting.js";
|
|
18
19
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
19
20
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
@@ -51,6 +52,8 @@ import { readClaudeUsage } from "../../extensions/usage/overview.js";
|
|
|
51
52
|
import { resolveAdhdSessionMode } from "../../humain/adhd/index.js";
|
|
52
53
|
import { renderHumainCodeIcon, renderHumainCodeIconInline } from "../../humain/brand-logo.js";
|
|
53
54
|
import { CAVEMAN_LEVELS, getCavemanDefaultMode, resolveCavemanSessionMode } from "../../humain/caveman/index.js";
|
|
55
|
+
import { getChecklistProvider } from "../../humain/checklist/index.js";
|
|
56
|
+
import { setSidebarTaskSurfaceVisible } from "../../humain/checklist/vendor/commands.js";
|
|
54
57
|
import { bindFlowAccountsHost, createFlowAccountReporter, FLOW_ACCOUNT_PERSISTENCE_NOTICE, flowUsageTargets, formatFlowAccountAdvanced, listFlowAccountMetadata, nodeLabelContainsStoredKey, readFlowNodeFallbackState, refreshFlowCatalog, updateFlowNodeFallback, } from "../../humain/flow-accounts-host.js";
|
|
55
58
|
import { HUMAIN_FUSE_PROVIDER } from "../../humain/fuse-provider.js";
|
|
56
59
|
import { HUMAIN_GATEWAY_PROVIDER } from "../../humain/gateway/constants.js";
|
|
@@ -114,6 +117,7 @@ import { StatusLineContainer } from "./components/status-line.js";
|
|
|
114
117
|
import { ThemedText } from "./components/themed-text.js";
|
|
115
118
|
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
116
119
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
120
|
+
import { ToolGroupComponent } from "./components/tool-group.js";
|
|
117
121
|
import { TranscriptContainer } from "./components/transcript-container.js";
|
|
118
122
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
119
123
|
import { TrustSelectorComponent } from "./components/trust-selector.js";
|
|
@@ -126,8 +130,11 @@ import { getModelSearchText } from "./model-search.js";
|
|
|
126
130
|
import { formatOAuthAccountOption, formatOAuthAccountResetTime, formatOAuthAccountUsage, subscriptionAccountUsage, } from "./oauth-account-format.js";
|
|
127
131
|
import { dialogBlockedStatus, ProgramStatusReporter } from "./program-status-reporter.js";
|
|
128
132
|
import { shareSession } from "./session-share.js";
|
|
133
|
+
import { SidebarComponent } from "./sidebar/sidebar-component.js";
|
|
134
|
+
import { SidebarModel } from "./sidebar/sidebar-model.js";
|
|
129
135
|
import { DEFAULT_THEME_NAME, getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getSelectListTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
130
136
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
137
|
+
import { isReadOnlyTool } from "./tool-grouping.js";
|
|
131
138
|
import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
132
139
|
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
133
140
|
function isEmbeddedStatus(editor) {
|
|
@@ -346,6 +353,11 @@ export class InteractiveMode {
|
|
|
346
353
|
documentContainer;
|
|
347
354
|
transcriptScrollView;
|
|
348
355
|
fullscreenLayoutRoot;
|
|
356
|
+
chatViewport;
|
|
357
|
+
sidebarContainer;
|
|
358
|
+
sidebarModel;
|
|
359
|
+
sidebarNarrowNoticeShown = false;
|
|
360
|
+
sidebarRegularNoticeShown = false;
|
|
349
361
|
pendingMessagesContainer;
|
|
350
362
|
statusContainer;
|
|
351
363
|
statusDetailsVisible = false;
|
|
@@ -407,6 +419,26 @@ export class InteractiveMode {
|
|
|
407
419
|
streamingMessage = undefined;
|
|
408
420
|
// Tool execution tracking: toolCallId -> component
|
|
409
421
|
pendingTools = new Map();
|
|
422
|
+
activeToolGroup;
|
|
423
|
+
addToolDisplayRow(row, toolName) {
|
|
424
|
+
if (this.settingsManager.getToolDisplay() !== "grouped") {
|
|
425
|
+
this.activeToolGroup = undefined;
|
|
426
|
+
this.chatContainer.addChild(row);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
if (this.activeToolGroup !== this.chatContainer.children.at(-1))
|
|
430
|
+
this.activeToolGroup = undefined;
|
|
431
|
+
const readOnly = isReadOnlyTool(toolName);
|
|
432
|
+
let group = readOnly ? this.activeToolGroup : undefined;
|
|
433
|
+
if (!group) {
|
|
434
|
+
group = new ToolGroupComponent();
|
|
435
|
+
group.setOutputPad(this.outputPad);
|
|
436
|
+
group.setExpanded(this.toolOutputExpanded);
|
|
437
|
+
this.chatContainer.addChild(group);
|
|
438
|
+
}
|
|
439
|
+
group.add(row);
|
|
440
|
+
this.activeToolGroup = readOnly ? group : undefined;
|
|
441
|
+
}
|
|
410
442
|
// Tool output expansion state
|
|
411
443
|
toolOutputExpanded = false;
|
|
412
444
|
// Thinking block visibility state
|
|
@@ -835,6 +867,8 @@ export class InteractiveMode {
|
|
|
835
867
|
}
|
|
836
868
|
this.renderer = nextUi;
|
|
837
869
|
this.options.tuiMode = mode;
|
|
870
|
+
if (this.chatViewport)
|
|
871
|
+
this.updateSidebarVisibility(terminal.columns);
|
|
838
872
|
this.mountInteractiveTui(nextUi, components);
|
|
839
873
|
nextUi.invalidate();
|
|
840
874
|
nextUi.setFocus(focus);
|
|
@@ -879,7 +913,9 @@ export class InteractiveMode {
|
|
|
879
913
|
scrollbarThumbStyle: (text) => theme.fg("scrollbarThumb", text),
|
|
880
914
|
});
|
|
881
915
|
this.transcriptScrollView = viewport.transcript;
|
|
916
|
+
this.chatViewport = viewport;
|
|
882
917
|
this.fullscreenLayoutRoot = viewport.root;
|
|
918
|
+
this.configureSidebar();
|
|
883
919
|
this.mountInteractiveTui(this.renderer, [
|
|
884
920
|
this.documentContainer,
|
|
885
921
|
this.pendingMessagesContainer,
|
|
@@ -1922,6 +1958,9 @@ export class InteractiveMode {
|
|
|
1922
1958
|
this.session.setAutoEffortInteractive(true);
|
|
1923
1959
|
this.footer.setSession(this.session);
|
|
1924
1960
|
this.footerDataProvider.setCwd(this.sessionManager.getCwd());
|
|
1961
|
+
this.sidebarModel?.dispose();
|
|
1962
|
+
this.sidebarModel = undefined;
|
|
1963
|
+
this.configureSidebar();
|
|
1925
1964
|
this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
|
|
1926
1965
|
this.outputPad = this.settingsManager.getOutputPad();
|
|
1927
1966
|
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
@@ -2066,6 +2105,7 @@ export class InteractiveMode {
|
|
|
2066
2105
|
* the session.
|
|
2067
2106
|
*/
|
|
2068
2107
|
clearPendingTools() {
|
|
2108
|
+
this.activeToolGroup = undefined;
|
|
2069
2109
|
for (const component of this.pendingTools.values())
|
|
2070
2110
|
component.dispose();
|
|
2071
2111
|
this.pendingTools.clear();
|
|
@@ -2942,8 +2982,13 @@ export class InteractiveMode {
|
|
|
2942
2982
|
this.ui.onDebug = () => this.handleDebugCommand();
|
|
2943
2983
|
this.defaultEditor.onAction("app.model.select", () => this.showModelSelector());
|
|
2944
2984
|
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
|
2985
|
+
this.defaultEditor.onAction("app.sidebar.toggle", () => this.setSidebarVisible(!this.settingsManager.getSidebarSettings().enabled));
|
|
2986
|
+
this.defaultEditor.onAction("app.tasks.toggle", () => {
|
|
2987
|
+
if (!this.footer.sidebarVisible && this.isExtensionCommand("/checklist toggle"))
|
|
2988
|
+
void this.session.prompt("/checklist toggle").catch((error) => this.showError(String(error)));
|
|
2989
|
+
});
|
|
2945
2990
|
this.defaultEditor.onAction("app.checklist.sidebar", () => {
|
|
2946
|
-
if (this.isExtensionCommand("/checklist sidebar"))
|
|
2991
|
+
if (!this.footer.sidebarVisible && this.isExtensionCommand("/checklist sidebar"))
|
|
2947
2992
|
void this.session.prompt("/checklist sidebar").catch((error) => this.showError(String(error)));
|
|
2948
2993
|
});
|
|
2949
2994
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
@@ -3061,6 +3106,17 @@ export class InteractiveMode {
|
|
|
3061
3106
|
this.ui.requestRender();
|
|
3062
3107
|
return;
|
|
3063
3108
|
}
|
|
3109
|
+
if (/^\/sidebar(?:\s|$)/.test(text)) {
|
|
3110
|
+
const argument = text.slice("/sidebar".length).trim();
|
|
3111
|
+
if (argument === "on" || argument === "off") {
|
|
3112
|
+
this.setSidebarVisible(argument === "on");
|
|
3113
|
+
}
|
|
3114
|
+
else {
|
|
3115
|
+
this.showError("Usage: /sidebar on|off");
|
|
3116
|
+
}
|
|
3117
|
+
this.editor.setText("");
|
|
3118
|
+
return;
|
|
3119
|
+
}
|
|
3064
3120
|
if (text === "/settings") {
|
|
3065
3121
|
this.showSettingsSelector();
|
|
3066
3122
|
this.editor.setText("");
|
|
@@ -3310,6 +3366,7 @@ export class InteractiveMode {
|
|
|
3310
3366
|
}
|
|
3311
3367
|
break;
|
|
3312
3368
|
case "turn_start":
|
|
3369
|
+
this.activeToolGroup = undefined;
|
|
3313
3370
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
3314
3371
|
this.ui.terminal.setProgress(true);
|
|
3315
3372
|
}
|
|
@@ -3396,6 +3453,7 @@ export class InteractiveMode {
|
|
|
3396
3453
|
this.ui.requestRender();
|
|
3397
3454
|
}
|
|
3398
3455
|
else if (event.message.role === "assistant") {
|
|
3456
|
+
this.activeToolGroup = undefined;
|
|
3399
3457
|
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers(), () => this.ui.requestRender());
|
|
3400
3458
|
this.streamingMessage = event.message;
|
|
3401
3459
|
this.chatContainer.addChild(this.streamingComponent);
|
|
@@ -3404,6 +3462,8 @@ export class InteractiveMode {
|
|
|
3404
3462
|
}
|
|
3405
3463
|
break;
|
|
3406
3464
|
case "message_update":
|
|
3465
|
+
if (event.assistantMessageEvent.type === "text_delta" && event.assistantMessageEvent.delta.length > 0)
|
|
3466
|
+
this.activeToolGroup = undefined;
|
|
3407
3467
|
if (this.workingMessage === undefined &&
|
|
3408
3468
|
this.activeStatusIndicator?.kind === "working" &&
|
|
3409
3469
|
this.activeStatusIndicator instanceof WorkingStatusIndicator) {
|
|
@@ -3417,16 +3477,22 @@ export class InteractiveMode {
|
|
|
3417
3477
|
this.streamingComponent.updateContent(this.streamingMessage, true);
|
|
3418
3478
|
// Throttled argument parsing reuses the same object between parses; those deltas draw nothing new.
|
|
3419
3479
|
let changed = event.assistantMessageEvent.type !== "toolcall_delta";
|
|
3480
|
+
let afterAssistantText = false;
|
|
3420
3481
|
for (const content of this.streamingMessage.content) {
|
|
3482
|
+
if (content.type === "text" && content.text.length > 0)
|
|
3483
|
+
afterAssistantText = true;
|
|
3421
3484
|
if (content.type === "toolCall") {
|
|
3422
3485
|
if (!this.pendingTools.has(content.id)) {
|
|
3486
|
+
if (afterAssistantText)
|
|
3487
|
+
this.activeToolGroup = undefined;
|
|
3423
3488
|
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
3489
|
+
grouped: this.settingsManager.getToolDisplay() === "grouped",
|
|
3424
3490
|
showImages: this.settingsManager.getShowImages(),
|
|
3425
3491
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3426
3492
|
outputPad: this.outputPad,
|
|
3427
3493
|
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
3428
3494
|
component.setExpanded(this.toolOutputExpanded);
|
|
3429
|
-
this.
|
|
3495
|
+
this.addToolDisplayRow(component, content.name);
|
|
3430
3496
|
this.pendingTools.set(content.id, component);
|
|
3431
3497
|
changed = true;
|
|
3432
3498
|
}
|
|
@@ -3435,6 +3501,7 @@ export class InteractiveMode {
|
|
|
3435
3501
|
// Existing rows request their own render when arguments change.
|
|
3436
3502
|
component?.updateArgs(content.arguments);
|
|
3437
3503
|
}
|
|
3504
|
+
afterAssistantText = false;
|
|
3438
3505
|
}
|
|
3439
3506
|
}
|
|
3440
3507
|
if (changed)
|
|
@@ -3510,12 +3577,13 @@ export class InteractiveMode {
|
|
|
3510
3577
|
let component = this.pendingTools.get(event.toolCallId);
|
|
3511
3578
|
if (!component) {
|
|
3512
3579
|
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
3580
|
+
grouped: this.settingsManager.getToolDisplay() === "grouped",
|
|
3513
3581
|
showImages: this.settingsManager.getShowImages(),
|
|
3514
3582
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3515
3583
|
outputPad: this.outputPad,
|
|
3516
3584
|
}, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd());
|
|
3517
3585
|
component.setExpanded(this.toolOutputExpanded);
|
|
3518
|
-
this.
|
|
3586
|
+
this.addToolDisplayRow(component, event.toolName);
|
|
3519
3587
|
this.pendingTools.set(event.toolCallId, component);
|
|
3520
3588
|
}
|
|
3521
3589
|
component.markExecutionStarted();
|
|
@@ -3531,6 +3599,8 @@ export class InteractiveMode {
|
|
|
3531
3599
|
break;
|
|
3532
3600
|
}
|
|
3533
3601
|
case "tool_execution_end": {
|
|
3602
|
+
if (event.isError && !event.parentToolCallId)
|
|
3603
|
+
this.activeToolGroup = undefined;
|
|
3534
3604
|
if (event.isError)
|
|
3535
3605
|
this.maybeShowInstallChangeWarning();
|
|
3536
3606
|
const component = this.pendingTools.get(event.toolCallId);
|
|
@@ -3890,6 +3960,7 @@ export class InteractiveMode {
|
|
|
3890
3960
|
const message = item;
|
|
3891
3961
|
// Assistant messages need special handling for tool calls
|
|
3892
3962
|
if (message.role === "assistant") {
|
|
3963
|
+
this.activeToolGroup = undefined;
|
|
3893
3964
|
const meta = messageMeta?.get(message);
|
|
3894
3965
|
this.addMessageToChat(message, {
|
|
3895
3966
|
messageId: meta?.id,
|
|
@@ -3897,14 +3968,17 @@ export class InteractiveMode {
|
|
|
3897
3968
|
});
|
|
3898
3969
|
// Render tool call components
|
|
3899
3970
|
for (const content of message.content) {
|
|
3971
|
+
if (content.type === "text" && content.text.length > 0)
|
|
3972
|
+
this.activeToolGroup = undefined;
|
|
3900
3973
|
if (content.type === "toolCall") {
|
|
3901
3974
|
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
3975
|
+
grouped: this.settingsManager.getToolDisplay() === "grouped",
|
|
3902
3976
|
showImages: this.settingsManager.getShowImages(),
|
|
3903
3977
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3904
3978
|
outputPad: this.outputPad,
|
|
3905
3979
|
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
3906
3980
|
component.setExpanded(this.toolOutputExpanded);
|
|
3907
|
-
this.
|
|
3981
|
+
this.addToolDisplayRow(component, content.name);
|
|
3908
3982
|
if (message.stopReason === "aborted" || message.stopReason === "error") {
|
|
3909
3983
|
let errorMessage;
|
|
3910
3984
|
if (message.stopReason === "aborted") {
|
|
@@ -3935,10 +4009,13 @@ export class InteractiveMode {
|
|
|
3935
4009
|
const component = renderedPendingTools.get(message.toolCallId);
|
|
3936
4010
|
if (component) {
|
|
3937
4011
|
component.updateResult(message);
|
|
4012
|
+
if (message.isError)
|
|
4013
|
+
this.activeToolGroup = undefined;
|
|
3938
4014
|
renderedPendingTools.delete(message.toolCallId);
|
|
3939
4015
|
}
|
|
3940
4016
|
}
|
|
3941
4017
|
else {
|
|
4018
|
+
this.activeToolGroup = undefined;
|
|
3942
4019
|
// All other messages use standard rendering
|
|
3943
4020
|
const meta = messageMeta?.get(message);
|
|
3944
4021
|
this.addMessageToChat(message, {
|
|
@@ -4854,6 +4931,7 @@ export class InteractiveMode {
|
|
|
4854
4931
|
quietStartup: this.settingsManager.getQuietStartup(),
|
|
4855
4932
|
clearOnShrink: this.settingsManager.getClearOnShrink(),
|
|
4856
4933
|
showTerminalProgress: this.settingsManager.getShowTerminalProgress(),
|
|
4934
|
+
sidebar: this.settingsManager.getSidebarSettings(),
|
|
4857
4935
|
tuiMode: this.ui.mode,
|
|
4858
4936
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
4859
4937
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
@@ -4898,7 +4976,7 @@ export class InteractiveMode {
|
|
|
4898
4976
|
onShowImagesChange: (enabled) => {
|
|
4899
4977
|
this.settingsManager.setShowImages(enabled);
|
|
4900
4978
|
for (const child of this.chatContainer.children) {
|
|
4901
|
-
if (child instanceof ToolExecutionComponent) {
|
|
4979
|
+
if (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {
|
|
4902
4980
|
child.setShowImages(enabled);
|
|
4903
4981
|
}
|
|
4904
4982
|
}
|
|
@@ -4906,7 +4984,7 @@ export class InteractiveMode {
|
|
|
4906
4984
|
onImageWidthCellsChange: (width) => {
|
|
4907
4985
|
this.settingsManager.setImageWidthCells(width);
|
|
4908
4986
|
for (const child of this.chatContainer.children) {
|
|
4909
|
-
if (child instanceof ToolExecutionComponent) {
|
|
4987
|
+
if (child instanceof ToolExecutionComponent || child instanceof ToolGroupComponent) {
|
|
4910
4988
|
child.setImageWidthCells(width);
|
|
4911
4989
|
}
|
|
4912
4990
|
}
|
|
@@ -5045,6 +5123,11 @@ export class InteractiveMode {
|
|
|
5045
5123
|
onShowTerminalProgressChange: (enabled) => {
|
|
5046
5124
|
this.settingsManager.setShowTerminalProgress(enabled);
|
|
5047
5125
|
},
|
|
5126
|
+
onSidebarEnabledChange: (enabled) => this.setSidebarVisible(enabled),
|
|
5127
|
+
onSidebarWidthChange: (width) => {
|
|
5128
|
+
this.settingsManager.setSidebarSettings({ width });
|
|
5129
|
+
this.configureSidebar();
|
|
5130
|
+
},
|
|
5048
5131
|
onTuiModeChange: (mode) => {
|
|
5049
5132
|
if (!this.switchTuiMode(mode)) {
|
|
5050
5133
|
selector?.getSettingsList().updateValue("tui-mode", this.ui.mode);
|
|
@@ -5101,6 +5184,69 @@ export class InteractiveMode {
|
|
|
5101
5184
|
};
|
|
5102
5185
|
});
|
|
5103
5186
|
}
|
|
5187
|
+
/** Persist the opt-in setting and update the existing viewport without replacing its scroll state. */
|
|
5188
|
+
setSidebarVisible(enabled) {
|
|
5189
|
+
this.settingsManager.setSidebarSettings({ enabled });
|
|
5190
|
+
this.configureSidebar();
|
|
5191
|
+
if (enabled && this.ui.mode === "regular")
|
|
5192
|
+
this.showSidebarRegularNotice();
|
|
5193
|
+
}
|
|
5194
|
+
showSidebarRegularNotice() {
|
|
5195
|
+
if (this.sidebarRegularNoticeShown)
|
|
5196
|
+
return;
|
|
5197
|
+
this.sidebarRegularNoticeShown = true;
|
|
5198
|
+
this.showStatus("The sidebar needs fullscreen mode (tuiMode: fullscreen).");
|
|
5199
|
+
}
|
|
5200
|
+
configureSidebar() {
|
|
5201
|
+
if (!this.chatViewport)
|
|
5202
|
+
return;
|
|
5203
|
+
const { enabled, width } = this.settingsManager.getSidebarSettings();
|
|
5204
|
+
if (enabled)
|
|
5205
|
+
this.sidebarContainer ??= new Container();
|
|
5206
|
+
this.chatViewport.setSidebar(enabled ? this.sidebarContainer : undefined, width, (columns) => this.updateSidebarVisibility(columns));
|
|
5207
|
+
this.updateSidebarVisibility(this.ui.terminal.columns);
|
|
5208
|
+
this.fullscreenLayoutRoot = this.chatViewport.root;
|
|
5209
|
+
if (TuiLayouts.isViewportTUI(this.renderer))
|
|
5210
|
+
this.renderer.setLayoutRoot(this.fullscreenLayoutRoot);
|
|
5211
|
+
this.ui.requestRender();
|
|
5212
|
+
}
|
|
5213
|
+
updateSidebarVisibility(columns) {
|
|
5214
|
+
const requested = this.settingsManager.getSidebarSettings().enabled;
|
|
5215
|
+
if (!requested || this.ui.mode === "fullscreen")
|
|
5216
|
+
this.sidebarRegularNoticeShown = false;
|
|
5217
|
+
else
|
|
5218
|
+
this.showSidebarRegularNotice();
|
|
5219
|
+
const enabled = requested && this.ui.mode === "fullscreen";
|
|
5220
|
+
const visible = enabled && columns >= 100;
|
|
5221
|
+
this.footer.sidebarVisible = visible;
|
|
5222
|
+
setSidebarTaskSurfaceVisible(visible);
|
|
5223
|
+
if (!visible) {
|
|
5224
|
+
this.sidebarModel?.dispose();
|
|
5225
|
+
this.sidebarModel = undefined;
|
|
5226
|
+
this.sidebarContainer?.clear();
|
|
5227
|
+
if (enabled && !this.sidebarNarrowNoticeShown) {
|
|
5228
|
+
this.sidebarNarrowNoticeShown = true;
|
|
5229
|
+
this.showStatus("Sidebar hidden: the terminal is narrower than 100 columns.");
|
|
5230
|
+
}
|
|
5231
|
+
return false;
|
|
5232
|
+
}
|
|
5233
|
+
if (!this.sidebarModel) {
|
|
5234
|
+
const session = this.session;
|
|
5235
|
+
this.sidebarModel = new SidebarModel({
|
|
5236
|
+
cwd: this.sessionManager.getCwd(),
|
|
5237
|
+
getContextUsage: () => session.getContextUsage(),
|
|
5238
|
+
getSessionEntries: () => this.sessionManager.getEntries(),
|
|
5239
|
+
subscribe: (listener) => session.subscribe(listener),
|
|
5240
|
+
footer: this.footerDataProvider,
|
|
5241
|
+
checklist: getChecklistProvider(),
|
|
5242
|
+
getLiveSessionCount,
|
|
5243
|
+
});
|
|
5244
|
+
this.sidebarContainer?.clear();
|
|
5245
|
+
this.sidebarContainer?.addChild(new SidebarComponent(this.sidebarModel, theme, () => this.ui.terminal.rows));
|
|
5246
|
+
this.sidebarModel.onChange(() => this.ui.requestRender());
|
|
5247
|
+
}
|
|
5248
|
+
return true;
|
|
5249
|
+
}
|
|
5104
5250
|
handleThinkingCommand(searchTerm) {
|
|
5105
5251
|
const availableLevels = this.session.getAvailableThinkingLevels();
|
|
5106
5252
|
if (!searchTerm) {
|
|
@@ -7988,6 +8134,9 @@ export class InteractiveMode {
|
|
|
7988
8134
|
this.clearStatusIndicator();
|
|
7989
8135
|
this.themeController.disableAutoSync();
|
|
7990
8136
|
this.clearExtensionTerminalInputListeners();
|
|
8137
|
+
this.sidebarModel?.dispose();
|
|
8138
|
+
this.sidebarModel = undefined;
|
|
8139
|
+
setSidebarTaskSurfaceVisible(false);
|
|
7991
8140
|
this.footer.dispose();
|
|
7992
8141
|
this.footerDataProvider.dispose();
|
|
7993
8142
|
this.unsubscribeCapabilityChanges?.();
|