@linghun/tui 0.1.1 → 0.1.3
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/dist/agent-completion-finalizer.js +3 -3
- package/dist/background-control-runtime.js +55 -55
- package/dist/cache-command-runtime.js +3 -3
- package/dist/capability-runtime.js +34 -34
- package/dist/{chunk-TJLC3QAS.js → chunk-36ZWUJQS.js} +1 -1
- package/dist/{chunk-DTK5NBTV.js → chunk-4BFCUJX6.js} +95 -11
- package/dist/{chunk-YH6UIHNF.js → chunk-4QWCNMP6.js} +2 -2
- package/dist/{chunk-WKMBK5UP.js → chunk-4TO2LDMP.js} +1 -1
- package/dist/{chunk-QG2FJ3NR.js → chunk-5OZEJQBH.js} +3 -3
- package/dist/{chunk-J7ZE2JKP.js → chunk-6C32YAB5.js} +19 -7
- package/dist/{chunk-W3KHJNSH.js → chunk-6CHUZ2NF.js} +2 -2
- package/dist/{chunk-I3NTAIMF.js → chunk-6DBBXNEG.js} +3 -3
- package/dist/{chunk-GDQQNPBP.js → chunk-6GXIGN5W.js} +1 -1
- package/dist/{chunk-QLRTQHTR.js → chunk-6JGRNES6.js} +2 -2
- package/dist/{chunk-AZU7HXIT.js → chunk-6JPUBF7B.js} +18 -18
- package/dist/{chunk-KO64OFSG.js → chunk-7C6T7RKJ.js} +1 -1
- package/dist/{chunk-LDABZV5V.js → chunk-7RZE45OT.js} +1 -1
- package/dist/{chunk-4E56DWEZ.js → chunk-7XAOTGHZ.js} +5 -5
- package/dist/{chunk-MLUIOBKL.js → chunk-7ZMDQZ22.js} +4 -4
- package/dist/{chunk-X7A22JHP.js → chunk-A4H3UTJZ.js} +1 -1
- package/dist/{chunk-D3UTL2QX.js → chunk-ATY7WBIT.js} +1 -1
- package/dist/{chunk-ZOSK2UEU.js → chunk-BBK5BA5C.js} +99 -117
- package/dist/{chunk-7TYK55JT.js → chunk-BEDD7OFL.js} +5 -5
- package/dist/{chunk-SRZIA6B4.js → chunk-BNC4F63N.js} +1 -1
- package/dist/{chunk-LIPZJNXS.js → chunk-CQCJGMXG.js} +4 -4
- package/dist/{chunk-L2GU3PWU.js → chunk-DEIYY6NI.js} +324 -16
- package/dist/{chunk-5CXN4JLE.js → chunk-EGHM55EV.js} +4 -4
- package/dist/{chunk-HIIYRATQ.js → chunk-ESAACKVG.js} +11 -7
- package/dist/{chunk-O6MKVGVK.js → chunk-G7O26P5X.js} +1 -1
- package/dist/{chunk-APJIC2O5.js → chunk-GTIZNO5O.js} +84 -0
- package/dist/{chunk-UOHZQIVL.js → chunk-GXFYUZAM.js} +1 -1
- package/dist/{chunk-Y5ZV47XC.js → chunk-GYHEUVR2.js} +7 -7
- package/dist/{chunk-QTDGRZMZ.js → chunk-HJOC5WUV.js} +1 -1
- package/dist/{chunk-KOULRCYJ.js → chunk-HMGYFENJ.js} +2 -2
- package/dist/{chunk-SYBNJZEL.js → chunk-HPMBSOQ4.js} +1 -1
- package/dist/{chunk-4K6UB524.js → chunk-IPZZGDUU.js} +1 -1
- package/dist/{chunk-JJQETFCR.js → chunk-IQS34W5A.js} +4 -4
- package/dist/{chunk-WOBNOBB5.js → chunk-J7AAPUTV.js} +3 -3
- package/dist/{chunk-6CI6TKLN.js → chunk-JAVRQ3LM.js} +1 -1
- package/dist/{chunk-VCSRBS47.js → chunk-JLAJZPOC.js} +1 -1
- package/dist/{chunk-CD54BQJ5.js → chunk-JMUAQUQQ.js} +4 -4
- package/dist/{chunk-NL4M3V5D.js → chunk-KKZBBCHK.js} +1 -1
- package/dist/{chunk-RMLTVKOY.js → chunk-L4YVE3RG.js} +2 -2
- package/dist/{chunk-F6TVBCZV.js → chunk-LWW2IAFC.js} +1 -1
- package/dist/{chunk-VAGL7CNR.js → chunk-NMOVU75L.js} +4 -4
- package/dist/{chunk-K56D3X7S.js → chunk-NWZ44SFI.js} +112 -5
- package/dist/{chunk-DYDTLRHB.js → chunk-OH35XDD4.js} +2 -2
- package/dist/{chunk-BOV4K7FP.js → chunk-OI5TZ37D.js} +36 -1
- package/dist/{chunk-LQTVYUT3.js → chunk-OJTMM5CV.js} +2 -2
- package/dist/{chunk-SILJJAK2.js → chunk-OMWSM2DA.js} +2 -2
- package/dist/{chunk-HW2TBXVK.js → chunk-OPVRII63.js} +1 -1
- package/dist/{chunk-XWRHWM4H.js → chunk-OV5OT66G.js} +11 -11
- package/dist/{chunk-F43AMWLZ.js → chunk-PDTJVJVD.js} +1 -1
- package/dist/{chunk-DDXS2RDZ.js → chunk-PHPEPZAA.js} +1 -1
- package/dist/{chunk-UDQT5CWK.js → chunk-PI6T2AGS.js} +1 -1
- package/dist/{chunk-3BPKJMIV.js → chunk-Q57WS7YZ.js} +4 -4
- package/dist/{chunk-33E6RDCY.js → chunk-QD4SCW4A.js} +229 -192
- package/dist/{chunk-QJTET7EZ.js → chunk-QXV2N4F2.js} +4 -4
- package/dist/{chunk-RFSSKGCE.js → chunk-RDTVAQBD.js} +239 -75
- package/dist/{chunk-SOPYWTFV.js → chunk-RRUI3VWQ.js} +1 -1
- package/dist/{chunk-IN42UISW.js → chunk-SRJ4XWOR.js} +10 -5
- package/dist/{chunk-6RJVTUWI.js → chunk-T6UOCF5D.js} +5 -1
- package/dist/{chunk-P277M7Z5.js → chunk-TO6IN4LA.js} +201 -5
- package/dist/{chunk-VTQL23UM.js → chunk-TVNWAEJR.js} +1 -1
- package/dist/chunk-TY4KIVA6.js +50 -0
- package/dist/{chunk-UT2TYK2A.js → chunk-TYTVAFGB.js} +1 -1
- package/dist/{chunk-OMZYPQVA.js → chunk-UGYFQF6M.js} +1 -1
- package/dist/{chunk-JGDIO2NF.js → chunk-UO3KYTBU.js} +1 -1
- package/dist/{chunk-MXPBYB54.js → chunk-UYU4QN3P.js} +2 -2
- package/dist/{chunk-J6CYFWSW.js → chunk-VDQTNA4W.js} +20 -1
- package/dist/{chunk-KI7C6ZOD.js → chunk-VIJ7GDKI.js} +1 -1
- package/dist/{chunk-NKFKOEYX.js → chunk-WCMHJ6SS.js} +1 -1
- package/dist/{chunk-EORRZP3F.js → chunk-WX2OTJXL.js} +1 -1
- package/dist/{chunk-CRQORMFF.js → chunk-X37FSYAX.js} +1 -1
- package/dist/chunk-X7HMDZZQ.js +85 -0
- package/dist/{chunk-624A7BBJ.js → chunk-XYY5LRSF.js} +4 -4
- package/dist/{chunk-CDVYF7RU.js → chunk-YBTXLLO5.js} +4 -4
- package/dist/{chunk-UN53MBAR.js → chunk-YGXPS5F2.js} +2 -2
- package/dist/chunk-YQNK7HK3.js +87 -0
- package/dist/{chunk-KJVHLTQR.js → chunk-Z265MCGC.js} +12 -8
- package/dist/{chunk-RM5QMOFY.js → chunk-ZKPQ4KLK.js} +1 -1
- package/dist/{chunk-4UER2AKI.js → chunk-ZPFOP557.js} +190 -0
- package/dist/command-panel-runtime.js +33 -33
- package/dist/compact-cache-command-runtime.js +55 -55
- package/dist/compact-preflight-runtime.js +20 -20
- package/dist/connector-runtime.js +35 -35
- package/dist/deep-compact-runtime.js +6 -6
- package/dist/deferred-tools-catalog.js +5 -5
- package/dist/details-status-runtime.js +33 -33
- package/dist/evidence-runtime.d.ts.map +1 -1
- package/dist/evidence-runtime.js +12 -11
- package/dist/extension-command-runtime.js +7 -7
- package/dist/extension-slash-runtime.js +34 -34
- package/dist/failure-learning-command-runtime.js +35 -35
- package/dist/failure-learning-presenter.js +4 -4
- package/dist/failure-learning-runtime.js +3 -3
- package/dist/final-answer-gate.d.ts +1 -0
- package/dist/final-answer-gate.d.ts.map +1 -1
- package/dist/final-answer-gate.js +4 -2
- package/dist/git-command-runtime.js +34 -34
- package/dist/handoff-session-runtime.js +8 -8
- package/dist/headless-bench-runtime.d.ts +19 -1
- package/dist/headless-bench-runtime.d.ts.map +1 -1
- package/dist/headless-bench-runtime.js +3 -1
- package/dist/index-result-presenter.js +5 -5
- package/dist/index-runtime.js +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -69
- package/dist/job-agent-command-runtime.js +33 -33
- package/dist/job-runner-presenter.js +3 -3
- package/dist/job-runtime.js +9 -9
- package/dist/mcp-index-command-runtime.js +5 -5
- package/dist/mcp-index-runtime.js +38 -38
- package/dist/mcp-sse-runtime.js +3 -3
- package/dist/mcp-stdio-runtime.js +4 -4
- package/dist/memory-command-runtime.js +35 -35
- package/dist/memory-extraction-runtime.js +3 -3
- package/dist/memory-rules-runtime.js +3 -3
- package/dist/meta-scheduler-runtime.js +2 -2
- package/dist/model-command-runtime.js +34 -34
- package/dist/model-loop-runtime.d.ts +1 -1
- package/dist/model-loop-runtime.d.ts.map +1 -1
- package/dist/model-loop-runtime.js +1 -1
- package/dist/model-prompt-runtime.js +10 -10
- package/dist/model-stream-runtime.d.ts.map +1 -1
- package/dist/model-stream-runtime.js +55 -55
- package/dist/model-tool-runtime.d.ts +1 -0
- package/dist/model-tool-runtime.d.ts.map +1 -1
- package/dist/model-tool-runtime.js +57 -55
- package/dist/pending-details-presenter.js +3 -3
- package/dist/permission-approval-runtime.js +55 -55
- package/dist/permission-continuation-runtime.d.ts.map +1 -1
- package/dist/permission-continuation-runtime.js +4 -4
- package/dist/process-command-runtime.js +4 -4
- package/dist/process-guard.d.ts +3 -0
- package/dist/process-guard.d.ts.map +1 -1
- package/dist/process-guard.js +5 -1
- package/dist/provider-loop-runtime.js +3 -3
- package/dist/remote-command-runtime.js +34 -34
- package/dist/runner-runtime.js +8 -8
- package/dist/runtime-status-presenter.js +3 -3
- package/dist/runtime-status-snapshot.js +4 -4
- package/dist/shell/components/AgentProgressTree.js +2 -2
- package/dist/shell/components/BackgroundTaskOverlay.js +2 -2
- package/dist/shell/components/BtwPanel.js +2 -2
- package/dist/shell/components/CommandPanel.js +2 -2
- package/dist/shell/components/Composer.d.ts +16 -2
- package/dist/shell/components/Composer.d.ts.map +1 -1
- package/dist/shell/components/Composer.js +9 -7
- package/dist/shell/components/ConfigPanel.js +2 -2
- package/dist/shell/components/HelpPanel.js +2 -2
- package/dist/shell/components/HistorySearchPanel.js +2 -2
- package/dist/shell/components/MessageMarkdown.d.ts +23 -0
- package/dist/shell/components/MessageMarkdown.d.ts.map +1 -1
- package/dist/shell/components/MessageMarkdown.js +5 -3
- package/dist/shell/components/MouseInputRouter.js +5 -80
- package/dist/shell/components/OutputLine.d.ts.map +1 -1
- package/dist/shell/components/OutputLine.js +5 -3
- package/dist/shell/components/ProductBlock.d.ts.map +1 -1
- package/dist/shell/components/ProductBlock.js +4 -4
- package/dist/shell/components/ScrollViewport.js +3 -82
- package/dist/shell/components/SessionsPanel.js +2 -2
- package/dist/shell/components/ShellApp.d.ts.map +1 -1
- package/dist/shell/components/ShellApp.js +28 -23
- package/dist/shell/components/SlashSuggestions.js +2 -2
- package/dist/shell/components/StatusFooter.js +2 -2
- package/dist/shell/components/StatusTray.d.ts.map +1 -1
- package/dist/shell/components/StatusTray.js +2 -1
- package/dist/shell/components/StructuredDiff.js +2 -2
- package/dist/shell/components/TaskListView.js +2 -2
- package/dist/shell/components/TaskSuggestionBar.js +2 -2
- package/dist/shell/components/WorkflowProgressView.js +2 -2
- package/dist/shell/components/useAnchoredCursor.d.ts +6 -9
- package/dist/shell/components/useAnchoredCursor.d.ts.map +1 -1
- package/dist/shell/components/useAnchoredCursor.js +1 -1
- package/dist/shell/ink-renderer.d.ts.map +1 -1
- package/dist/shell/ink-renderer.js +28 -23
- package/dist/shell/models/transcript-selection-state.js +2 -2
- package/dist/shell/plain-renderer.d.ts.map +1 -1
- package/dist/shell/plain-renderer.js +2 -2
- package/dist/shell/text-utils.d.ts +16 -0
- package/dist/shell/text-utils.d.ts.map +1 -1
- package/dist/shell/text-utils.js +3 -1
- package/dist/shell/view-model.js +14 -14
- package/dist/slash-command-runtime.js +55 -55
- package/dist/slash-dispatch.js +4 -4
- package/dist/startup-runtime.js +2 -2
- package/dist/tool-output-presenter.d.ts +1 -0
- package/dist/tool-output-presenter.d.ts.map +1 -1
- package/dist/tool-output-presenter.js +3 -1
- package/dist/tui-agent-job-runtime.js +11 -11
- package/dist/tui-context-runtime.d.ts +2 -0
- package/dist/tui-context-runtime.d.ts.map +1 -1
- package/dist/tui-data-types.d.ts +1 -0
- package/dist/tui-data-types.d.ts.map +1 -1
- package/dist/tui-details-runtime.js +10 -10
- package/dist/tui-memory-runtime.js +5 -5
- package/dist/tui-output-surface.js +15 -15
- package/dist/tui-permission-runtime.js +5 -5
- package/dist/tui-state-runtime.js +4 -4
- package/dist/verification-command-runtime.js +12 -12
- package/dist/workflow-command-runtime.js +33 -33
- package/package.json +5 -5
- package/dist/chunk-GW5YDCRZ.js +0 -42
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
createRuntimeStatusSnapshot,
|
|
12
12
|
formatRuntimeStatusSnapshotForBtw
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZKPQ4KLK.js";
|
|
14
14
|
import {
|
|
15
15
|
checkAndWriteProviderCooldown,
|
|
16
16
|
recordProviderFallbackAttempt,
|
|
17
17
|
resolveRuntimeFallback
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4TO2LDMP.js";
|
|
19
19
|
import {
|
|
20
20
|
configureRemoteCommandRuntime,
|
|
21
21
|
consumeRemoteInboundMessage,
|
|
22
22
|
processRemoteInbound,
|
|
23
23
|
validateRemotePairingEnvelope
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IQS34W5A.js";
|
|
25
25
|
import {
|
|
26
26
|
formatLocalToolPermissionPrompt,
|
|
27
27
|
formatModelToolPermissionPrompt
|
|
@@ -30,24 +30,24 @@ import {
|
|
|
30
30
|
formatPendingApprovalDetails,
|
|
31
31
|
formatPendingNaturalCommandDetails,
|
|
32
32
|
formatWorkspaceTrustStatus
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HJOC5WUV.js";
|
|
34
34
|
import {
|
|
35
35
|
configureMemoryCommandRuntime,
|
|
36
36
|
executeMemoryMutation,
|
|
37
37
|
resumeSessionWithHandoff,
|
|
38
38
|
runAutoLearningOnTurnEnd
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GYHEUVR2.js";
|
|
40
40
|
import {
|
|
41
41
|
evaluateMetaScheduler,
|
|
42
42
|
formatMetaSchedulerDirective,
|
|
43
43
|
formatPolicyDecisionSummary,
|
|
44
44
|
hasActiveProviderFailure,
|
|
45
45
|
verifyFailureLearningContract
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-KKZBBCHK.js";
|
|
47
47
|
import {
|
|
48
48
|
configureModelCommandRuntime,
|
|
49
49
|
startModelSetup
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-J7AAPUTV.js";
|
|
51
51
|
import {
|
|
52
52
|
looksLikeModelSetupInput,
|
|
53
53
|
parseModelSetupPrefill
|
|
@@ -59,18 +59,18 @@ import {
|
|
|
59
59
|
refreshIndexStatus,
|
|
60
60
|
runIndexRepository,
|
|
61
61
|
stabilizeMcpToolList
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-OV5OT66G.js";
|
|
63
63
|
import {
|
|
64
64
|
formatIndexRefreshSummary
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-UYU4QN3P.js";
|
|
66
66
|
import {
|
|
67
67
|
isIgnoredIndexPath
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6CHUZ2NF.js";
|
|
69
69
|
import {
|
|
70
70
|
checkClaimSupport,
|
|
71
71
|
formatClaimCheck,
|
|
72
72
|
runArchitectureAndCompletenessFinalGate
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-TO6IN4LA.js";
|
|
74
74
|
import {
|
|
75
75
|
executeGitToolUse,
|
|
76
76
|
resolveStablePointApprove,
|
|
@@ -80,10 +80,10 @@ import {
|
|
|
80
80
|
} from "./chunk-7ZE5JFAZ.js";
|
|
81
81
|
import {
|
|
82
82
|
configureExtensionSlashRuntime
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-Q57WS7YZ.js";
|
|
84
84
|
import {
|
|
85
85
|
configureFailureLearningCommandRuntime
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-QXV2N4F2.js";
|
|
87
87
|
import {
|
|
88
88
|
startFeishuLongConnection
|
|
89
89
|
} from "./chunk-WJWYRBWH.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
inspectToolPairingSafety,
|
|
98
98
|
prepareMessagesForProviderPreflight,
|
|
99
99
|
recordCompactBoundary
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-EGHM55EV.js";
|
|
101
101
|
import {
|
|
102
102
|
appendBreakCacheEvent,
|
|
103
103
|
buildPromptCacheRequestFields,
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
formatCacheLog,
|
|
114
114
|
formatCompactStatus,
|
|
115
115
|
writeLightHints
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-7RZE45OT.js";
|
|
117
117
|
import {
|
|
118
118
|
cancelAgentByRef,
|
|
119
119
|
cancelAllAgents,
|
|
@@ -144,13 +144,13 @@ import {
|
|
|
144
144
|
transitionDurableJob,
|
|
145
145
|
upsertWorkflowBackgroundTask,
|
|
146
146
|
writeStatus
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-6JPUBF7B.js";
|
|
148
148
|
import {
|
|
149
149
|
addAllowRule,
|
|
150
150
|
decidePermission,
|
|
151
151
|
savePermissionState,
|
|
152
152
|
toPermissionPromptView
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-PHPEPZAA.js";
|
|
154
154
|
import {
|
|
155
155
|
createReviewReport,
|
|
156
156
|
createVerificationPlan,
|
|
@@ -160,7 +160,7 @@ import {
|
|
|
160
160
|
formatVerificationTaskSummary,
|
|
161
161
|
runVerificationCommand,
|
|
162
162
|
runVerificationPlan
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-7XAOTGHZ.js";
|
|
164
164
|
import {
|
|
165
165
|
abortBackgroundTask,
|
|
166
166
|
clearBackgroundAbortController,
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
listCancellableAgents,
|
|
176
176
|
registerBackgroundAbortController,
|
|
177
177
|
rememberBackgroundTask
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-YBTXLLO5.js";
|
|
179
179
|
import {
|
|
180
180
|
ShellBlockOutput,
|
|
181
181
|
beginAssistantStream,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
writeAssistantDelta,
|
|
186
186
|
writeErrorLine,
|
|
187
187
|
writeLocalCommandOutputLine
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-OH35XDD4.js";
|
|
189
189
|
import {
|
|
190
190
|
createTerminalReadinessView
|
|
191
191
|
} from "./chunk-PBIPV4LD.js";
|
|
@@ -193,26 +193,26 @@ import {
|
|
|
193
193
|
appendJobLog,
|
|
194
194
|
parseJobRunOptions,
|
|
195
195
|
rescheduleDurableJobAgents
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-NMOVU75L.js";
|
|
197
197
|
import {
|
|
198
198
|
refreshRunnerStatusForJob,
|
|
199
199
|
resolveNativeRunner,
|
|
200
200
|
startRunnerForDurableJob,
|
|
201
201
|
stopRunnerForDurableJob
|
|
202
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-JMUAQUQQ.js";
|
|
203
203
|
import {
|
|
204
204
|
detectEngineeringTaskProfile
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-ZPFOP557.js";
|
|
206
206
|
import {
|
|
207
207
|
formatHooksDoctor
|
|
208
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-5OZEJQBH.js";
|
|
209
209
|
import {
|
|
210
210
|
runCommandCapture
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-HMGYFENJ.js";
|
|
212
212
|
import {
|
|
213
213
|
createModelSystemPrompt,
|
|
214
214
|
sanitizeMainScreenLeakage
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-BEDD7OFL.js";
|
|
216
216
|
import {
|
|
217
217
|
collectInputFiles,
|
|
218
218
|
createReportFinalReferenceReminder,
|
|
@@ -230,11 +230,7 @@ import {
|
|
|
230
230
|
shouldSendReportEvidenceReminder,
|
|
231
231
|
shouldSendReportFinalReferenceReminder,
|
|
232
232
|
shouldSendReportWriteReminder
|
|
233
|
-
} from "./chunk-
|
|
234
|
-
import {
|
|
235
|
-
createAssistantPrimaryTextSanitizer,
|
|
236
|
-
formatToolOutput
|
|
237
|
-
} from "./chunk-BOV4K7FP.js";
|
|
233
|
+
} from "./chunk-6C32YAB5.js";
|
|
238
234
|
import {
|
|
239
235
|
buildRuntimeStatusForModel,
|
|
240
236
|
createModelCapabilitySummary,
|
|
@@ -243,13 +239,13 @@ import {
|
|
|
243
239
|
import {
|
|
244
240
|
formatBackgroundTask,
|
|
245
241
|
formatRunnerDoctor
|
|
246
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-PI6T2AGS.js";
|
|
247
243
|
import {
|
|
248
244
|
deferredToolListHashInput,
|
|
249
245
|
getCodebaseMemoryToolRisk,
|
|
250
246
|
isCodebaseMemoryToolName,
|
|
251
247
|
listDeferredTools
|
|
252
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-6DBBXNEG.js";
|
|
253
249
|
import {
|
|
254
250
|
appendBackgroundTaskEvent,
|
|
255
251
|
appendDeferredToolResultEvent,
|
|
@@ -273,7 +269,7 @@ import {
|
|
|
273
269
|
recordVerificationEvidence,
|
|
274
270
|
rememberEvidence,
|
|
275
271
|
truncateRoundAssistantForProvider
|
|
276
|
-
} from "./chunk-
|
|
272
|
+
} from "./chunk-DEIYY6NI.js";
|
|
277
273
|
import {
|
|
278
274
|
BACKGROUND_KIND_CAPS,
|
|
279
275
|
BACKGROUND_RUNNING_GLOBAL_CAP,
|
|
@@ -291,14 +287,18 @@ import {
|
|
|
291
287
|
import {
|
|
292
288
|
applyToolResultBudgetToMessages
|
|
293
289
|
} from "./chunk-O7S3HYE6.js";
|
|
290
|
+
import {
|
|
291
|
+
createAssistantPrimaryTextSanitizer,
|
|
292
|
+
formatToolOutput
|
|
293
|
+
} from "./chunk-OI5TZ37D.js";
|
|
294
294
|
import {
|
|
295
295
|
loadOrCreateHandoffPacket,
|
|
296
296
|
validateHandoffPacket,
|
|
297
297
|
writeHandoffPacket
|
|
298
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-7ZMDQZ22.js";
|
|
299
299
|
import {
|
|
300
300
|
createLinghunMdTemplate
|
|
301
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-OJTMM5CV.js";
|
|
302
302
|
import {
|
|
303
303
|
AGENT_CONTROL_TOOL_NAME,
|
|
304
304
|
COMMAND_PROPOSAL_TOOL_NAME,
|
|
@@ -320,7 +320,7 @@ import {
|
|
|
320
320
|
extractFileMentions,
|
|
321
321
|
sanitizeDeferredToolPrimaryText,
|
|
322
322
|
stripStructuredFinalAnswerClaims
|
|
323
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-NWZ44SFI.js";
|
|
324
324
|
import {
|
|
325
325
|
INDEX_REFRESH,
|
|
326
326
|
INDEX_REPAIR,
|
|
@@ -344,14 +344,14 @@ import {
|
|
|
344
344
|
import {
|
|
345
345
|
buildFailureLearningSummaryForPrompt,
|
|
346
346
|
recordFailureLearningDegradedWarning
|
|
347
|
-
} from "./chunk-
|
|
347
|
+
} from "./chunk-6GXIGN5W.js";
|
|
348
348
|
import {
|
|
349
349
|
runDeepCompact
|
|
350
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-L4YVE3RG.js";
|
|
351
351
|
import {
|
|
352
352
|
normalizeMemoryStatus,
|
|
353
353
|
pathExists
|
|
354
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-6JGRNES6.js";
|
|
355
355
|
import {
|
|
356
356
|
getWorkspaceReferenceSnapshot,
|
|
357
357
|
workspaceReferenceHash
|
|
@@ -402,7 +402,7 @@ import {
|
|
|
402
402
|
truncateDisplay,
|
|
403
403
|
uniqueStrings,
|
|
404
404
|
writeLine
|
|
405
|
-
} from "./chunk-
|
|
405
|
+
} from "./chunk-UGYFQF6M.js";
|
|
406
406
|
import {
|
|
407
407
|
checkBoundaryEditPreflight,
|
|
408
408
|
detectBashFileWriteTargets
|
|
@@ -3810,7 +3810,7 @@ function evaluateEngineeringFinalBoundary(context, assistantText) {
|
|
|
3810
3810
|
assistantText
|
|
3811
3811
|
);
|
|
3812
3812
|
if (!highRiskFinal && !signal.failureCategory) return { status: "passed" };
|
|
3813
|
-
if (signal.failureCategory === "missing_artifact" && !hasArtifactEvidence(context
|
|
3813
|
+
if (signal.failureCategory === "missing_artifact" && !hasArtifactEvidence(context)) {
|
|
3814
3814
|
return {
|
|
3815
3815
|
status: "needs_disclaimer",
|
|
3816
3816
|
unsupportedKinds: ["engineering_missing_artifact"],
|
|
@@ -3831,7 +3831,7 @@ function evaluateEngineeringFinalBoundary(context, assistantText) {
|
|
|
3831
3831
|
message: signal.finalBoundaryHint ?? "provider output was interrupted"
|
|
3832
3832
|
};
|
|
3833
3833
|
}
|
|
3834
|
-
if (signal.profile === "binary_or_artifact" && highRiskFinal && !hasArtifactEvidence(context
|
|
3834
|
+
if (signal.profile === "binary_or_artifact" && highRiskFinal && !hasArtifactEvidence(context)) {
|
|
3835
3835
|
return {
|
|
3836
3836
|
status: "needs_disclaimer",
|
|
3837
3837
|
unsupportedKinds: ["engineering_artifact_unverified"],
|
|
@@ -3856,18 +3856,14 @@ function evaluateEngineeringFinalBoundary(context, assistantText) {
|
|
|
3856
3856
|
}
|
|
3857
3857
|
return { status: "passed" };
|
|
3858
3858
|
}
|
|
3859
|
-
function hasArtifactEvidence(context
|
|
3859
|
+
function hasArtifactEvidence(context) {
|
|
3860
3860
|
const signalTargets = context.lastMetaSchedulerDecision?.policyDecision.engineeringSignal.artifactTargets ?? [];
|
|
3861
|
-
const targets = uniqueArtifactTargets(
|
|
3861
|
+
const targets = uniqueArtifactTargets(signalTargets);
|
|
3862
3862
|
return context.evidence.some((item) => {
|
|
3863
|
-
const
|
|
3864
|
-
if (
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
if (targets.length === 0) {
|
|
3868
|
-
return /(?:artifact|output file|out\.txt|non-empty|产物|输出文件)/iu.test(text);
|
|
3869
|
-
}
|
|
3870
|
-
return targets.some((target) => text.toLowerCase().includes(target.toLowerCase()));
|
|
3863
|
+
const artifactHint = readEvidenceDataRecord(item, "artifactHint");
|
|
3864
|
+
if (artifactHint?.exists !== true || typeof artifactHint.path !== "string") return false;
|
|
3865
|
+
if (targets.length === 0) return true;
|
|
3866
|
+
return targets.some((target) => pathsReferToSameArtifact(artifactHint.path, target));
|
|
3871
3867
|
});
|
|
3872
3868
|
}
|
|
3873
3869
|
function hasFullVerificationEvidence(context) {
|
|
@@ -3878,22 +3874,27 @@ function hasFullVerificationEvidence(context) {
|
|
|
3878
3874
|
);
|
|
3879
3875
|
}
|
|
3880
3876
|
function hasServiceVerificationEvidence(context) {
|
|
3881
|
-
return context.evidence.some(
|
|
3882
|
-
(item
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
);
|
|
3877
|
+
return context.evidence.some((item) => {
|
|
3878
|
+
const service = readEvidenceDataRecord(item, "service");
|
|
3879
|
+
const serviceHint = readEvidenceDataRecord(item, "serviceHint");
|
|
3880
|
+
return service?.ready === true || serviceHint?.ready === true;
|
|
3881
|
+
});
|
|
3886
3882
|
}
|
|
3887
|
-
function
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3883
|
+
function readEvidenceDataRecord(evidence, key) {
|
|
3884
|
+
if (!evidence.data || typeof evidence.data !== "object") return void 0;
|
|
3885
|
+
const value = evidence.data[key];
|
|
3886
|
+
return value && typeof value === "object" ? value : void 0;
|
|
3887
|
+
}
|
|
3888
|
+
function pathsReferToSameArtifact(actual, target) {
|
|
3889
|
+
const normalizedActual = normalizeArtifactEvidencePath(actual);
|
|
3890
|
+
const normalizedTarget = normalizeArtifactEvidencePath(target);
|
|
3891
|
+
return normalizedActual === normalizedTarget || basenameLike(normalizedActual) === basenameLike(normalizedTarget);
|
|
3892
|
+
}
|
|
3893
|
+
function normalizeArtifactEvidencePath(path) {
|
|
3894
|
+
return path.replace(/\\/g, "/").replace(/\/+/g, "/").toLowerCase();
|
|
3895
|
+
}
|
|
3896
|
+
function basenameLike(path) {
|
|
3897
|
+
return path.split("/").filter(Boolean).at(-1) ?? path;
|
|
3897
3898
|
}
|
|
3898
3899
|
function uniqueArtifactTargets(targets) {
|
|
3899
3900
|
const out = /* @__PURE__ */ new Set();
|
|
@@ -6520,7 +6521,7 @@ async function executeApprovedModelToolUse(toolCall, toolName, context, sessionI
|
|
|
6520
6521
|
if (preflight) {
|
|
6521
6522
|
writeLine(output, preflight);
|
|
6522
6523
|
}
|
|
6523
|
-
if (toolName === "Bash") {
|
|
6524
|
+
if (toolName === "Bash" && shouldTrackBashAsBackground(toolCall.input)) {
|
|
6524
6525
|
const guard = checkBackgroundStartGuard2(context, "bash", true);
|
|
6525
6526
|
if (guard) {
|
|
6526
6527
|
const evidence = await recordToolFailureEvidence(context, sessionId, toolName, guard);
|
|
@@ -6536,7 +6537,7 @@ async function executeApprovedModelToolUse(toolCall, toolName, context, sessionI
|
|
|
6536
6537
|
return { ok: false, tool: toolName, text: guard, evidenceId: evidence.id };
|
|
6537
6538
|
}
|
|
6538
6539
|
}
|
|
6539
|
-
const task = toolName === "Bash" ? createBackgroundTask(toolName, toolCall.input, context) : void 0;
|
|
6540
|
+
const task = toolName === "Bash" && shouldTrackBashAsBackground(toolCall.input) ? createBackgroundTask(toolName, toolCall.input, context) : void 0;
|
|
6540
6541
|
if (task) {
|
|
6541
6542
|
rememberBackgroundTask(context, task);
|
|
6542
6543
|
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
@@ -6569,13 +6570,19 @@ async function executeApprovedModelToolUse(toolCall, toolName, context, sessionI
|
|
|
6569
6570
|
result.output,
|
|
6570
6571
|
toolCall.input
|
|
6571
6572
|
);
|
|
6572
|
-
if (reportWriteGuard && (toolName === "Read" || toolName === "Glob" || toolName === "Grep")) {
|
|
6573
|
+
if (reportWriteGuard && (toolName === "Read" || toolName === "ReadSnippets" || toolName === "SourcePack" || toolName === "Glob" || toolName === "Grep")) {
|
|
6573
6574
|
reportWriteGuard.evidenceRead = true;
|
|
6574
6575
|
}
|
|
6575
6576
|
rememberToolFiles(context, toolName, toolCall.input, result.output);
|
|
6576
6577
|
const isError = isToolOutputFailure(toolName, result.output);
|
|
6577
6578
|
if (task) {
|
|
6578
|
-
|
|
6579
|
+
const bgData = result.output.data;
|
|
6580
|
+
if (bgData?.backgroundTaskId) {
|
|
6581
|
+
context.backgroundBashTaskMap?.set(bgData.backgroundTaskId, task.id);
|
|
6582
|
+
task.outputPath = bgData.outputPath;
|
|
6583
|
+
} else {
|
|
6584
|
+
finishBackgroundTaskFromToolOutput2(task, result.output, context);
|
|
6585
|
+
}
|
|
6579
6586
|
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
6580
6587
|
}
|
|
6581
6588
|
await appendToolResultEvent(
|
|
@@ -6604,7 +6611,10 @@ async function executeApprovedModelToolUse(toolCall, toolName, context, sessionI
|
|
|
6604
6611
|
"warning"
|
|
6605
6612
|
);
|
|
6606
6613
|
}
|
|
6607
|
-
|
|
6614
|
+
const bgStarted = !!result.output.data?.backgroundTaskId;
|
|
6615
|
+
if (!bgStarted) {
|
|
6616
|
+
clearBackgroundAbortController(context, task?.id ?? "");
|
|
6617
|
+
}
|
|
6608
6618
|
if (backgroundController) {
|
|
6609
6619
|
context.tools.abortSignal = previousAbortSignal;
|
|
6610
6620
|
}
|
|
@@ -6822,6 +6832,7 @@ async function executeDeferredDispatchToolUse(toolCall, context, sessionId, outp
|
|
|
6822
6832
|
);
|
|
6823
6833
|
return { ok: false, tool: dispatchName, text: result.text, evidenceId: evidence2.id };
|
|
6824
6834
|
}
|
|
6835
|
+
rememberSourcePackCandidatesFromToolData(context, input.tool_name, result.data);
|
|
6825
6836
|
const evidence = await recordToolEvidence(context, sessionId, "Read", {
|
|
6826
6837
|
text: result.text,
|
|
6827
6838
|
data: result.data
|
|
@@ -7752,9 +7763,15 @@ function rememberToolFiles(context, name, input, output) {
|
|
|
7752
7763
|
paths.push(path.replaceAll("\\", "/"));
|
|
7753
7764
|
}
|
|
7754
7765
|
}
|
|
7766
|
+
if (name === "ReadSnippets" && typeof input === "object" && input !== null) {
|
|
7767
|
+
paths.push(...extractPathsFromRanges(input.ranges));
|
|
7768
|
+
}
|
|
7755
7769
|
if (Array.isArray(output.changedFiles)) {
|
|
7756
7770
|
paths.push(...output.changedFiles);
|
|
7757
7771
|
}
|
|
7772
|
+
if (name === "SourcePack" || name === "ReadSnippets") {
|
|
7773
|
+
paths.push(...extractPathsFromToolData(output.data));
|
|
7774
|
+
}
|
|
7758
7775
|
if (name === "Glob" || name === "Grep") {
|
|
7759
7776
|
paths.push(...extractFileMentions(output.text));
|
|
7760
7777
|
}
|
|
@@ -7763,6 +7780,137 @@ function rememberToolFiles(context, name, input, output) {
|
|
|
7763
7780
|
...context.recentlyMentionedFiles
|
|
7764
7781
|
]).slice(0, 10);
|
|
7765
7782
|
}
|
|
7783
|
+
function rememberSourcePackCandidatesFromToolData(context, toolName, data) {
|
|
7784
|
+
if (!isSourcePackCandidateProducer(toolName)) {
|
|
7785
|
+
return;
|
|
7786
|
+
}
|
|
7787
|
+
const candidates = extractSourcePackCandidates(data);
|
|
7788
|
+
context.tools.sourcePackCandidates = candidates.length > 0 ? candidates : void 0;
|
|
7789
|
+
}
|
|
7790
|
+
function isSourcePackCandidateProducer(toolName) {
|
|
7791
|
+
if (typeof toolName !== "string") return false;
|
|
7792
|
+
const name = toolName.includes(".") ? toolName.split(".").at(-1) : toolName;
|
|
7793
|
+
return name === "search_code" || name === "search_graph" || name === "get_code_snippet" || name === "get_architecture";
|
|
7794
|
+
}
|
|
7795
|
+
function extractSourcePackCandidates(data) {
|
|
7796
|
+
const candidates = [];
|
|
7797
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7798
|
+
visitSourcePackCandidateData(data, 0, (record) => {
|
|
7799
|
+
const path = readCandidatePath(record);
|
|
7800
|
+
if (!path) return;
|
|
7801
|
+
const start = readCandidateStart(record);
|
|
7802
|
+
const end = readCandidateEnd(record, start);
|
|
7803
|
+
const key = `${path}:${start}:${end}`;
|
|
7804
|
+
if (seen.has(key)) return;
|
|
7805
|
+
seen.add(key);
|
|
7806
|
+
candidates.push({
|
|
7807
|
+
path,
|
|
7808
|
+
start,
|
|
7809
|
+
end,
|
|
7810
|
+
reason: readCandidateReason(record),
|
|
7811
|
+
confidence: readCandidateConfidence(record)
|
|
7812
|
+
});
|
|
7813
|
+
});
|
|
7814
|
+
return candidates.slice(0, 12);
|
|
7815
|
+
}
|
|
7816
|
+
function visitSourcePackCandidateData(value, depth, visit) {
|
|
7817
|
+
if (depth > 5 || value === null || value === void 0) return;
|
|
7818
|
+
if (Array.isArray(value)) {
|
|
7819
|
+
for (const item of value.slice(0, 40)) {
|
|
7820
|
+
visitSourcePackCandidateData(item, depth + 1, visit);
|
|
7821
|
+
}
|
|
7822
|
+
return;
|
|
7823
|
+
}
|
|
7824
|
+
if (typeof value !== "object") return;
|
|
7825
|
+
const record = value;
|
|
7826
|
+
visit(record);
|
|
7827
|
+
for (const item of Object.values(record).slice(0, 40)) {
|
|
7828
|
+
visitSourcePackCandidateData(item, depth + 1, visit);
|
|
7829
|
+
}
|
|
7830
|
+
}
|
|
7831
|
+
function readCandidatePath(record) {
|
|
7832
|
+
for (const key of ["path", "file", "file_path", "filepath", "source_path", "relative_path"]) {
|
|
7833
|
+
const value = record[key];
|
|
7834
|
+
if (typeof value !== "string") continue;
|
|
7835
|
+
const normalized = value.replaceAll("\\", "/").replace(/^\.\//u, "").trim();
|
|
7836
|
+
if (normalized && normalized !== "unknown" && !normalized.includes("\n") && !/^https?:\/\//iu.test(normalized)) {
|
|
7837
|
+
return normalized;
|
|
7838
|
+
}
|
|
7839
|
+
}
|
|
7840
|
+
return void 0;
|
|
7841
|
+
}
|
|
7842
|
+
function readCandidateStart(record) {
|
|
7843
|
+
const direct = readPositiveNumberField(record, [
|
|
7844
|
+
"start",
|
|
7845
|
+
"line",
|
|
7846
|
+
"line_number",
|
|
7847
|
+
"lineNumber",
|
|
7848
|
+
"start_line",
|
|
7849
|
+
"startLine",
|
|
7850
|
+
"lineno"
|
|
7851
|
+
]);
|
|
7852
|
+
if (direct !== void 0) return direct;
|
|
7853
|
+
const range = typeof record.range === "string" ? record.range.match(/(\d+)(?:\D+(\d+))?/u) : null;
|
|
7854
|
+
if (range?.[1]) return Math.max(1, Number.parseInt(range[1], 10));
|
|
7855
|
+
return 1;
|
|
7856
|
+
}
|
|
7857
|
+
function readCandidateEnd(record, start) {
|
|
7858
|
+
const direct = readPositiveNumberField(record, [
|
|
7859
|
+
"end",
|
|
7860
|
+
"end_line",
|
|
7861
|
+
"endLine",
|
|
7862
|
+
"line_end",
|
|
7863
|
+
"lineEnd"
|
|
7864
|
+
]);
|
|
7865
|
+
if (direct !== void 0) return Math.max(start, direct);
|
|
7866
|
+
const range = typeof record.range === "string" ? record.range.match(/(\d+)(?:\D+(\d+))?/u) : null;
|
|
7867
|
+
if (range?.[2]) return Math.max(start, Number.parseInt(range[2], 10));
|
|
7868
|
+
return start + 24;
|
|
7869
|
+
}
|
|
7870
|
+
function readPositiveNumberField(record, keys) {
|
|
7871
|
+
for (const key of keys) {
|
|
7872
|
+
const value = record[key];
|
|
7873
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 1) {
|
|
7874
|
+
return Math.trunc(value);
|
|
7875
|
+
}
|
|
7876
|
+
if (typeof value === "string" && /^\d+$/u.test(value)) {
|
|
7877
|
+
return Number.parseInt(value, 10);
|
|
7878
|
+
}
|
|
7879
|
+
}
|
|
7880
|
+
return void 0;
|
|
7881
|
+
}
|
|
7882
|
+
function readCandidateReason(record) {
|
|
7883
|
+
const parts = ["symbol", "name", "qualified_name", "kind", "type", "label"].map((key) => record[key]).filter((value) => typeof value === "string" || typeof value === "number").map((value) => String(value).trim()).filter(Boolean);
|
|
7884
|
+
return parts.length > 0 ? `index candidate: ${parts.slice(0, 3).join(" ")}` : "index candidate";
|
|
7885
|
+
}
|
|
7886
|
+
function readCandidateConfidence(record) {
|
|
7887
|
+
for (const key of ["confidence", "score", "similarity"]) {
|
|
7888
|
+
const value = record[key];
|
|
7889
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
7890
|
+
if (value < 0) return void 0;
|
|
7891
|
+
return value > 1 ? Math.min(0.95, value / 100) : Math.min(0.95, value);
|
|
7892
|
+
}
|
|
7893
|
+
}
|
|
7894
|
+
return void 0;
|
|
7895
|
+
}
|
|
7896
|
+
function extractPathsFromRanges(ranges) {
|
|
7897
|
+
if (!Array.isArray(ranges)) return [];
|
|
7898
|
+
return ranges.map(
|
|
7899
|
+
(item) => item && typeof item === "object" && typeof item.path === "string" ? item.path.replaceAll("\\", "/") : void 0
|
|
7900
|
+
).filter((item) => Boolean(item));
|
|
7901
|
+
}
|
|
7902
|
+
function extractPathsFromToolData(data) {
|
|
7903
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return [];
|
|
7904
|
+
const record = data;
|
|
7905
|
+
const candidatePaths = record.candidatePaths;
|
|
7906
|
+
if (Array.isArray(candidatePaths)) {
|
|
7907
|
+
return candidatePaths.filter((item) => typeof item === "string").map((item) => item.replaceAll("\\", "/"));
|
|
7908
|
+
}
|
|
7909
|
+
return [
|
|
7910
|
+
...extractPathsFromRanges(record.ranges),
|
|
7911
|
+
...extractPathsFromRanges(record.snippets)
|
|
7912
|
+
];
|
|
7913
|
+
}
|
|
7766
7914
|
async function recordReportIncompleteEvidence2(context, sessionId, guard) {
|
|
7767
7915
|
const evidence = createEvidenceRecord(
|
|
7768
7916
|
"command_output",
|
|
@@ -7877,18 +8025,28 @@ async function handleToolCommand(name, args, context, output) {
|
|
|
7877
8025
|
}
|
|
7878
8026
|
const progress = installToolProgressHandler(context, sessionId, callId, output, task);
|
|
7879
8027
|
let result;
|
|
8028
|
+
let bgStarted2 = false;
|
|
7880
8029
|
try {
|
|
7881
8030
|
result = await runTool2(name, input, context.tools);
|
|
8031
|
+
bgStarted2 = !!result.output.data?.backgroundTaskId;
|
|
7882
8032
|
} finally {
|
|
7883
8033
|
progress.restore();
|
|
7884
8034
|
await Promise.all(progress.pending);
|
|
7885
|
-
|
|
8035
|
+
if (!bgStarted2) {
|
|
8036
|
+
clearBackgroundAbortController(context, task?.id ?? "");
|
|
8037
|
+
}
|
|
7886
8038
|
if (backgroundController) {
|
|
7887
8039
|
context.tools.abortSignal = previousAbortSignal;
|
|
7888
8040
|
}
|
|
7889
8041
|
}
|
|
7890
8042
|
if (task) {
|
|
7891
|
-
|
|
8043
|
+
const bgData = result.output.data;
|
|
8044
|
+
if (bgData?.backgroundTaskId) {
|
|
8045
|
+
context.backgroundBashTaskMap?.set(bgData.backgroundTaskId, task.id);
|
|
8046
|
+
task.outputPath = bgData.outputPath ?? void 0;
|
|
8047
|
+
} else {
|
|
8048
|
+
finishBackgroundTaskFromToolOutput2(task, result.output, context);
|
|
8049
|
+
}
|
|
7892
8050
|
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
7893
8051
|
}
|
|
7894
8052
|
await context.store.appendEvent(sessionId, createToolEndEvent(callId, result.output));
|
|
@@ -8052,6 +8210,11 @@ function createBackgroundTask(name, input, context) {
|
|
|
8052
8210
|
nextAction: context.language === "en-US" ? "Wait for completion or use /interrupt." : "\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u7528 /interrupt \u4E2D\u65AD\u3002"
|
|
8053
8211
|
};
|
|
8054
8212
|
}
|
|
8213
|
+
function shouldTrackBashAsBackground(input) {
|
|
8214
|
+
if (typeof input !== "object" || input === null) return false;
|
|
8215
|
+
const record = input;
|
|
8216
|
+
return record.runInBackground === true || record.run_in_background === true;
|
|
8217
|
+
}
|
|
8055
8218
|
async function appendProgressEventSafely(context, sessionId, event) {
|
|
8056
8219
|
try {
|
|
8057
8220
|
await context.store.appendEvent(sessionId, event);
|
|
@@ -8135,6 +8298,7 @@ export {
|
|
|
8135
8298
|
executeIndexToolUse,
|
|
8136
8299
|
executeApprovedIndexToolUse,
|
|
8137
8300
|
rememberToolFiles,
|
|
8301
|
+
rememberSourcePackCandidatesFromToolData,
|
|
8138
8302
|
recordReportIncompleteEvidence2 as recordReportIncompleteEvidence,
|
|
8139
8303
|
handleToolCommand,
|
|
8140
8304
|
formatPlanProposal,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
displayWidth,
|
|
10
10
|
taskComposerMaxWidth,
|
|
11
11
|
wrapText
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GTIZNO5O.js";
|
|
13
13
|
|
|
14
14
|
// src/shell/plain-renderer.ts
|
|
15
15
|
function renderPlainShell(view, capability) {
|
|
@@ -103,6 +103,7 @@ function renderPlainMarkdownLines(text, noColor, options = {}) {
|
|
|
103
103
|
const out = [];
|
|
104
104
|
let inCode = false;
|
|
105
105
|
let codeLang;
|
|
106
|
+
const wrapWidth = Math.max(8, options.wrapWidth ?? 100);
|
|
106
107
|
const applyTone = (line) => {
|
|
107
108
|
if (options.error) return colorRed(line, noColor);
|
|
108
109
|
if (options.diagnostic) return colorCyan(line, noColor);
|
|
@@ -124,11 +125,11 @@ function renderPlainMarkdownLines(text, noColor, options = {}) {
|
|
|
124
125
|
continue;
|
|
125
126
|
}
|
|
126
127
|
if (!inCode) {
|
|
127
|
-
out.push(...wrapText(raw,
|
|
128
|
+
out.push(...wrapText(raw, wrapWidth).map(applyTone));
|
|
128
129
|
continue;
|
|
129
130
|
}
|
|
130
131
|
const isDiff = codeLang === "diff" || codeLang === "patch";
|
|
131
|
-
for (const wrapped of wrapText(raw.length === 0 ? " " : raw,
|
|
132
|
+
for (const wrapped of wrapText(raw.length === 0 ? " " : raw, Math.max(8, wrapWidth - 4))) {
|
|
132
133
|
const wrappedBody = isDiff && wrapped.startsWith("+") && !wrapped.startsWith("+++") ? colorGreen(wrapped, noColor) : isDiff && wrapped.startsWith("-") && !wrapped.startsWith("---") ? colorRed(wrapped, noColor) : dim(wrapped, noColor);
|
|
133
134
|
out.push(`${dim(" | ", noColor)}${wrappedBody}`);
|
|
134
135
|
}
|
|
@@ -273,7 +274,8 @@ function formatSingleBlock(block, view, noColor) {
|
|
|
273
274
|
const isToolSuccess = messageKind === "tool_result_success";
|
|
274
275
|
const renderedMessage = renderPlainMarkdownLines(body, noColor, {
|
|
275
276
|
dimAll,
|
|
276
|
-
diagnostic: isDiagnostic
|
|
277
|
+
diagnostic: isDiagnostic,
|
|
278
|
+
wrapWidth: Math.max(8, view.width - 6)
|
|
277
279
|
});
|
|
278
280
|
const out = isLocalOutput || isToolSuccess ? renderedMessage.map((line) => `${dim(" \u23BF ", noColor)}${line}`) : renderedMessage;
|
|
279
281
|
if (nextAction2) {
|
|
@@ -304,7 +306,10 @@ function formatSingleBlock(block, view, noColor) {
|
|
|
304
306
|
out.push(coloredFailMarker);
|
|
305
307
|
}
|
|
306
308
|
if (body) {
|
|
307
|
-
out.push(...renderPlainMarkdownLines(body, noColor, {
|
|
309
|
+
out.push(...renderPlainMarkdownLines(body, noColor, {
|
|
310
|
+
error: true,
|
|
311
|
+
wrapWidth: Math.max(8, view.width - 6)
|
|
312
|
+
}));
|
|
308
313
|
}
|
|
309
314
|
if (nextAction2) out.push(` ${dim(nextAction2, noColor)}`);
|
|
310
315
|
if (block.retrySeconds && block.retrySeconds > 0 && (block.retryAttempt ?? 0) >= 4) {
|