nolo-cli 0.151.0-alpha.2 → 0.151.0-alpha.4
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/{_executeModel-XHAFJ2MM.js → _executeModel-T7ANHTUW.js} +12 -12
- package/{agentDeleteCommand-DPUUS56Z.js → agentDeleteCommand-4L5KCKFY.js} +9 -9
- package/{agentEmailCommands-V4P5EFLP.js → agentEmailCommands-2IMMIRO2.js} +11 -11
- package/{agentMachineCommands-MELPAZZI.js → agentMachineCommands-KIWXWT6L.js} +1 -1
- package/{agentRecordCommands-FSWSSQIO.js → agentRecordCommands-727NPCRW.js} +10 -10
- package/{agentRunCommand-GDBJVOAT.js → agentRunCommand-LTVIZBDD.js} +11 -11
- package/{agentSlice-YO2ZLJMD.js → agentSlice-SLV57QGU.js} +1 -1
- package/{chunk-Y2DXOPSO.js → chunk-3T4ZG6AC.js} +9 -9
- package/{chunk-GQN2WLAI.js → chunk-626KHJNX.js} +2 -2
- package/{chunk-SSFDFOVT.js → chunk-AG7MCDLR.js} +2 -2
- package/{chunk-ZKZ5X2HS.js → chunk-AJ3G7X2K.js} +1 -1
- package/{chunk-AOCM7HPT.js → chunk-BJEZC5RA.js} +2 -2
- package/{chunk-7MOXKPHC.js → chunk-CYJWI3NH.js} +2 -2
- package/{chunk-IZ7OJB6K.js → chunk-DFDXM2Y4.js} +3 -3
- package/{chunk-LTRUTOHX.js → chunk-I2XLRXVX.js} +2 -2
- package/{chunk-PLXDDGBK.js → chunk-IK2TSJQA.js} +1 -1
- package/{chunk-7XKL25PW.js → chunk-OXCHKYMU.js} +8 -6
- package/{chunk-T6X3D7NB.js → chunk-PIDUNDFS.js} +5 -5
- package/{chunk-FJMRBOPO.js → chunk-PKZKOVA5.js} +5 -5
- package/{chunk-SMENBO3M.js → chunk-RN2GPWN6.js} +2 -2
- package/{chunk-ES633ZS5.js → chunk-ROCUB2H2.js} +2 -2
- package/{chunk-HKX3ULQB.js → chunk-U5GPBQDG.js} +1 -1
- package/{chunk-556RW72X.js → chunk-U5ICMAFV.js} +8 -8
- package/{chunk-Z7OJUX6S.js → chunk-V4EE3D54.js} +2 -2
- package/{chunk-PCKVQXYV.js → chunk-VWW6O2TL.js} +7 -7
- package/{commandRegistry-XN7C5GHO.js → commandRegistry-WIUTNXKC.js} +15 -15
- package/{contentThunks-5L7YQI3S.js → contentThunks-6AIWNSGO.js} +3 -3
- package/{createAgentAutomationAction-QOPOLCRK.js → createAgentAutomationAction-4BUS65DZ.js} +3 -3
- package/{createDialogAction-MZ66VY5Q.js → createDialogAction-QAIKSCG4.js} +4 -4
- package/{createPageAction-VQDJIXMY.js → createPageAction-DXCZ334C.js} +3 -3
- package/{dialogSlice-6RODVYCK.js → dialogSlice-PVUSMKFW.js} +2 -2
- package/{docStore-ZZA3OPM5.js → docStore-CSEBEMKP.js} +1 -1
- package/{handleSendMessageAction-DVG5U26T.js → handleSendMessageAction-G2TLYGC4.js} +7 -7
- package/index.js +3 -3
- package/{localRuntimeAdapter-HXRHFKRC.js → localRuntimeAdapter-B4TAYYA7.js} +9 -9
- package/{machineCommands-5KBF4RCC.js → machineCommands-6OBFD3XF.js} +10 -10
- package/{machineWsRunDispatch-4OQDEDOR.js → machineWsRunDispatch-OO7N3O3Y.js} +10 -10
- package/package.json +1 -1
- package/{readlineWorkspace-RIE62QVZ.js → readlineWorkspace-XL65W6GB.js} +187 -50
- package/{runAgentClientLoop-KLUUXBZS.js → runAgentClientLoop-GS3SGG37.js} +10 -10
- package/{streamAgentChatTurn-MN2SSPGA.js → streamAgentChatTurn-4XYC33KE.js} +12 -12
- package/{tools-W2MOLERY.js → tools-P77EE7Q4.js} +7 -7
- package/{updateDialogTitleAction-Z4JX6REN.js → updateDialogTitleAction-CIANVPZC.js} +3 -3
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
fitAnsiLine,
|
|
45
45
|
formatAssistantDisplay,
|
|
46
46
|
formatCreditsChip,
|
|
47
|
+
formatTokenCount,
|
|
47
48
|
getActiveThemeMode,
|
|
48
49
|
getActiveThemeName,
|
|
49
50
|
historyTokensBeforeLatestAssistant,
|
|
@@ -65,6 +66,7 @@ import {
|
|
|
65
66
|
resolveAuthorityTurnCount,
|
|
66
67
|
resolveCliColorEnabled,
|
|
67
68
|
resolveCliMemory,
|
|
69
|
+
resolveContextUsage,
|
|
68
70
|
resolveSkillReference,
|
|
69
71
|
resolveTerminalProgramStatusState,
|
|
70
72
|
resolveTuiBrightnessSignal,
|
|
@@ -89,9 +91,9 @@ import {
|
|
|
89
91
|
wrapTextToLines,
|
|
90
92
|
wrapTranscriptLine,
|
|
91
93
|
wrapTranscriptLineWithLayout
|
|
92
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-OXCHKYMU.js";
|
|
93
95
|
import "./chunk-6QDYSCPW.js";
|
|
94
|
-
import "./chunk-
|
|
96
|
+
import "./chunk-IK2TSJQA.js";
|
|
95
97
|
import {
|
|
96
98
|
getReadableCliDb
|
|
97
99
|
} from "./chunk-P5QACQDK.js";
|
|
@@ -101,7 +103,7 @@ import {
|
|
|
101
103
|
createCliLocalRuntimeAdapter,
|
|
102
104
|
createOriginShellGrant,
|
|
103
105
|
readTimestamp
|
|
104
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-PKZKOVA5.js";
|
|
105
107
|
import "./chunk-XS47QOFV.js";
|
|
106
108
|
import "./chunk-6MXDOUMH.js";
|
|
107
109
|
import {
|
|
@@ -152,16 +154,16 @@ import "./chunk-KFHQQ3NO.js";
|
|
|
152
154
|
import "./chunk-JEXVIMYZ.js";
|
|
153
155
|
import {
|
|
154
156
|
prepareTools
|
|
155
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-V4EE3D54.js";
|
|
156
158
|
import {
|
|
157
159
|
buildResponseGuidelines
|
|
158
160
|
} from "./chunk-W4S6OTSC.js";
|
|
159
161
|
import "./chunk-HS7MLR74.js";
|
|
160
|
-
import "./chunk-
|
|
162
|
+
import "./chunk-3T4ZG6AC.js";
|
|
161
163
|
import "./chunk-JKMLSTZK.js";
|
|
162
164
|
import "./chunk-I2ZMGXXF.js";
|
|
163
165
|
import "./chunk-OXME3PEE.js";
|
|
164
|
-
import "./chunk-
|
|
166
|
+
import "./chunk-ROCUB2H2.js";
|
|
165
167
|
import "./chunk-NF64D32W.js";
|
|
166
168
|
import "./chunk-XPWGOTBQ.js";
|
|
167
169
|
import "./chunk-ZIWPQEFU.js";
|
|
@@ -174,20 +176,20 @@ import "./chunk-IA7TRNNR.js";
|
|
|
174
176
|
import "./chunk-AGIM7IMJ.js";
|
|
175
177
|
import "./chunk-63W5N6P3.js";
|
|
176
178
|
import "./chunk-VF4K2QE6.js";
|
|
177
|
-
import "./chunk-
|
|
179
|
+
import "./chunk-626KHJNX.js";
|
|
178
180
|
import "./chunk-ILU2NPWY.js";
|
|
179
|
-
import "./chunk-
|
|
181
|
+
import "./chunk-AG7MCDLR.js";
|
|
180
182
|
import "./chunk-F32Z66T4.js";
|
|
181
183
|
import "./chunk-EYWJT7A2.js";
|
|
182
|
-
import "./chunk-
|
|
184
|
+
import "./chunk-AJ3G7X2K.js";
|
|
183
185
|
import {
|
|
184
186
|
extractReferenceKeysFromMessage
|
|
185
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-U5ICMAFV.js";
|
|
186
188
|
import "./chunk-523DITKR.js";
|
|
187
189
|
import "./chunk-UKZX3NHN.js";
|
|
188
190
|
import "./chunk-OFFL4DCR.js";
|
|
189
191
|
import "./chunk-QYPE3TS3.js";
|
|
190
|
-
import "./chunk-
|
|
192
|
+
import "./chunk-DFDXM2Y4.js";
|
|
191
193
|
import "./chunk-4JH2UMJR.js";
|
|
192
194
|
import "./chunk-ZJ7UHBJS.js";
|
|
193
195
|
import "./chunk-BYXBJQAS.js";
|
|
@@ -401,7 +403,7 @@ import {
|
|
|
401
403
|
import "./chunk-4VNS5WPM.js";
|
|
402
404
|
|
|
403
405
|
// packages/cli/tui/shellApprovalSession.ts
|
|
404
|
-
function createShellApprovalSession(confirm) {
|
|
406
|
+
function createShellApprovalSession(confirm, isAutoConfirm = () => false) {
|
|
405
407
|
let generation = new AbortController();
|
|
406
408
|
let ended = false;
|
|
407
409
|
let tail = Promise.resolve();
|
|
@@ -414,6 +416,7 @@ function createShellApprovalSession(confirm) {
|
|
|
414
416
|
const combined = AbortSignal.any([signal, epoch.signal]);
|
|
415
417
|
const result = tail.then(async () => {
|
|
416
418
|
if (ended || combined.aborted || request.expiresAt <= Date.now()) return false;
|
|
419
|
+
if (isAutoConfirm()) return true;
|
|
417
420
|
const timeout = new AbortController();
|
|
418
421
|
const timer = setTimeout(() => timeout.abort(), Math.max(0, request.expiresAt - Date.now()));
|
|
419
422
|
const scoped = AbortSignal.any([combined, timeout.signal]);
|
|
@@ -7832,6 +7835,16 @@ function formatCwd(cwd) {
|
|
|
7832
7835
|
const parts = cwd.split(/[/\\]/);
|
|
7833
7836
|
return parts.pop() || cwd;
|
|
7834
7837
|
}
|
|
7838
|
+
function truncateToWidth(text, maxWidth) {
|
|
7839
|
+
if (displayWidth(text) <= maxWidth) return text;
|
|
7840
|
+
if (maxWidth < 2) return "";
|
|
7841
|
+
let out = "";
|
|
7842
|
+
for (const ch of text) {
|
|
7843
|
+
if (displayWidth(`${out}${ch}\u2026`) > maxWidth) break;
|
|
7844
|
+
out += ch;
|
|
7845
|
+
}
|
|
7846
|
+
return out ? `${out}\u2026` : "";
|
|
7847
|
+
}
|
|
7835
7848
|
function formatElapsedSeconds(totalSeconds) {
|
|
7836
7849
|
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
7837
7850
|
const minutes = Math.floor(totalSeconds / 60);
|
|
@@ -7841,6 +7854,21 @@ function formatElapsedSeconds(totalSeconds) {
|
|
|
7841
7854
|
const mins = minutes % 60;
|
|
7842
7855
|
return `${hours}h ${mins}m`;
|
|
7843
7856
|
}
|
|
7857
|
+
function renderStatusContextSegment(state, compact) {
|
|
7858
|
+
const usage = resolveContextUsage({
|
|
7859
|
+
tokens: state.turnTokens,
|
|
7860
|
+
fallbackContextWindow: state.contextWindow,
|
|
7861
|
+
estimatedContextTokens: state.estimatedContextTokens,
|
|
7862
|
+
turnEstimatedTokens: state.liveTurnEstimatedTokens
|
|
7863
|
+
});
|
|
7864
|
+
if (usage.used === void 0 || usage.contextWindow === void 0) {
|
|
7865
|
+
return "ctx \u2014";
|
|
7866
|
+
}
|
|
7867
|
+
const pct = Math.min(100, usage.pct ?? 0);
|
|
7868
|
+
const pctText = pct > 0 && pct < 10 ? pct.toFixed(1) : Math.round(pct).toString();
|
|
7869
|
+
if (compact) return `ctx ${pctText}%`;
|
|
7870
|
+
return `ctx ${pctText}% \xB7 ${formatTokenCount(usage.used)}/${formatTokenCount(usage.contextWindow)}`;
|
|
7871
|
+
}
|
|
7844
7872
|
function resolveStatusLineCredits(state) {
|
|
7845
7873
|
const base = state.dialogCreditsBase;
|
|
7846
7874
|
const session = state.sessionCredits;
|
|
@@ -7866,57 +7894,141 @@ function renderStatusLine(state, maxWidth) {
|
|
|
7866
7894
|
const untrackedText = untracked > 0 ? ` ${themeText(`?${untracked}`, "muted", colorEnabled)}` : "";
|
|
7867
7895
|
parts.push(`${branchText}${modifiedText}${untrackedText}`);
|
|
7868
7896
|
}
|
|
7897
|
+
const contextFull = renderStatusContextSegment(state, false);
|
|
7898
|
+
const contextCompact = renderStatusContextSegment(state, true);
|
|
7899
|
+
let contextPart = themeText(contextFull, "muted", colorEnabled);
|
|
7900
|
+
parts.push(contextPart);
|
|
7869
7901
|
const credits = resolveStatusLineCredits(state);
|
|
7870
7902
|
const creditsSegment = credits !== void 0 && credits > 0 ? themeText(formatCreditsChip(credits), "muted", colorEnabled) : "";
|
|
7871
7903
|
if (creditsSegment) parts.push(creditsSegment);
|
|
7872
7904
|
const pendingProcessCount = state.pendingProcessNotices?.length ?? 0;
|
|
7873
7905
|
if (pendingProcessCount > 0) {
|
|
7874
|
-
parts.push(themeText(`\
|
|
7906
|
+
parts.push(themeText(`\u21AA ${pendingProcessCount} pending`, "info", colorEnabled));
|
|
7875
7907
|
}
|
|
7876
7908
|
if (state.autoConfirm === true) {
|
|
7877
7909
|
parts.push(themeText("\u23F5 auto", "warning", colorEnabled));
|
|
7878
7910
|
}
|
|
7911
|
+
let surface = colorEnabled ? surfaceBackgroundSequence() : "";
|
|
7912
|
+
let padWidth = surface ? 2 : 0;
|
|
7913
|
+
if (maxWidth && maxWidth > 0 && maxWidth <= padWidth) {
|
|
7914
|
+
surface = "";
|
|
7915
|
+
padWidth = 0;
|
|
7916
|
+
}
|
|
7917
|
+
let agentPart = agentSegment;
|
|
7918
|
+
let creditsPart = creditsSegment;
|
|
7879
7919
|
let visibleParts = parts;
|
|
7880
7920
|
if (maxWidth && maxWidth > 0) {
|
|
7881
|
-
const widthOf = (segments) => displayWidth(stripAnsi(segments.join(" \xB7 "))) +
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
if (
|
|
7885
|
-
|
|
7921
|
+
const widthOf = (segments) => displayWidth(stripAnsi(segments.join(" \xB7 "))) + padWidth;
|
|
7922
|
+
if (contextFull !== contextCompact && widthOf(visibleParts) > maxWidth) {
|
|
7923
|
+
const contextIndex = visibleParts.indexOf(contextPart);
|
|
7924
|
+
if (contextIndex >= 0) {
|
|
7925
|
+
contextPart = themeText(contextCompact, "muted", colorEnabled);
|
|
7926
|
+
visibleParts = visibleParts.with(contextIndex, contextPart);
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
if (widthOf(visibleParts) > maxWidth) {
|
|
7930
|
+
visibleParts = visibleParts.filter((part) => part !== cwdSegment);
|
|
7931
|
+
}
|
|
7932
|
+
if (widthOf(visibleParts) > maxWidth) {
|
|
7933
|
+
const agentIndex = visibleParts.indexOf(agentPart);
|
|
7934
|
+
if (agentIndex >= 0) {
|
|
7935
|
+
const othersWidth = widthOf(visibleParts.filter((part) => part !== agentPart));
|
|
7936
|
+
const nameBudget = maxWidth - othersWidth - 3 - displayWidth("\u2726 ") - displayWidth(modeSuffix);
|
|
7937
|
+
const shortName = truncateToWidth(state.agentName, nameBudget);
|
|
7938
|
+
if (shortName) {
|
|
7939
|
+
agentPart = themeText(`\u2726 ${shortName}${modeSuffix}`, "accent", colorEnabled);
|
|
7940
|
+
visibleParts = visibleParts.with(agentIndex, agentPart);
|
|
7941
|
+
}
|
|
7942
|
+
}
|
|
7943
|
+
}
|
|
7944
|
+
if (widthOf(visibleParts) > maxWidth) {
|
|
7945
|
+
visibleParts = visibleParts.filter((part) => part !== agentPart);
|
|
7946
|
+
}
|
|
7947
|
+
if (widthOf(visibleParts) > maxWidth) {
|
|
7948
|
+
visibleParts = visibleParts.filter((part) => part !== contextPart);
|
|
7949
|
+
}
|
|
7950
|
+
if (widthOf(visibleParts) > maxWidth && creditsPart) {
|
|
7951
|
+
const creditsIndex = visibleParts.indexOf(creditsPart);
|
|
7952
|
+
if (creditsIndex >= 0) {
|
|
7953
|
+
creditsPart = themeText(
|
|
7954
|
+
formatCreditsChip(credits ?? 0, { compact: true }),
|
|
7955
|
+
"muted",
|
|
7956
|
+
colorEnabled
|
|
7957
|
+
);
|
|
7958
|
+
visibleParts = visibleParts.with(creditsIndex, creditsPart);
|
|
7959
|
+
}
|
|
7886
7960
|
}
|
|
7887
7961
|
if (widthOf(visibleParts) > maxWidth && state.gitStatus) {
|
|
7888
7962
|
const gitIndex = visibleParts.findIndex((part) => stripAnsi(part).startsWith("\u2442 "));
|
|
7889
7963
|
if (gitIndex >= 0) {
|
|
7890
|
-
const { modified, untracked } = state.gitStatus;
|
|
7891
|
-
const
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
colorEnabled
|
|
7964
|
+
const { branch, modified, untracked } = state.gitStatus;
|
|
7965
|
+
const dirtyText = `${modified > 0 ? ` *${modified}` : ""}${untracked > 0 ? ` ?${untracked}` : ""}`;
|
|
7966
|
+
const othersWidth = widthOf(
|
|
7967
|
+
visibleParts.filter((part) => part !== visibleParts[gitIndex])
|
|
7895
7968
|
);
|
|
7896
|
-
|
|
7969
|
+
const branchBudget = maxWidth - othersWidth - 3 - displayWidth("\u2442 ") - displayWidth(dirtyText);
|
|
7970
|
+
const shortBranch = truncateToWidth(branch, branchBudget);
|
|
7971
|
+
if (shortBranch) {
|
|
7972
|
+
const branchText = themeText(`\u2442 ${shortBranch}`, "warning", colorEnabled);
|
|
7973
|
+
const modifiedText = modified > 0 ? ` ${themeText(`*${modified}`, "danger", colorEnabled)}` : "";
|
|
7974
|
+
const untrackedText = untracked > 0 ? ` ${themeText(`?${untracked}`, "muted", colorEnabled)}` : "";
|
|
7975
|
+
visibleParts = visibleParts.with(
|
|
7976
|
+
gitIndex,
|
|
7977
|
+
`${branchText}${modifiedText}${untrackedText}`
|
|
7978
|
+
);
|
|
7979
|
+
} else {
|
|
7980
|
+
const compactDirty = themeText(`\u2442${dirtyText}`, "warning", colorEnabled);
|
|
7981
|
+
visibleParts = visibleParts.with(gitIndex, compactDirty);
|
|
7982
|
+
}
|
|
7897
7983
|
}
|
|
7898
7984
|
}
|
|
7899
7985
|
if (widthOf(visibleParts) > maxWidth) {
|
|
7900
|
-
const
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7986
|
+
const budget = maxWidth - padWidth;
|
|
7987
|
+
const autoMark = state.autoConfirm === true ? themeText("\u23F5", "warning", colorEnabled) : "";
|
|
7988
|
+
const gitCounts = state.gitStatus ? themeText(
|
|
7989
|
+
`\u2442${state.gitStatus.modified > 0 ? `*${state.gitStatus.modified}` : ""}${state.gitStatus.untracked > 0 ? `?${state.gitStatus.untracked}` : ""}`,
|
|
7990
|
+
"warning",
|
|
7991
|
+
colorEnabled
|
|
7992
|
+
) : "";
|
|
7993
|
+
const gitMark = state.gitStatus ? themeText(
|
|
7994
|
+
`\u2442${state.gitStatus.modified > 0 ? "*" : ""}${state.gitStatus.untracked > 0 ? "?" : ""}`,
|
|
7995
|
+
"warning",
|
|
7996
|
+
colorEnabled
|
|
7997
|
+
) : "";
|
|
7998
|
+
const noticeFull = pendingProcessCount > 0 ? themeText(`\u21AA${pendingProcessCount}`, "info", colorEnabled) : "";
|
|
7999
|
+
const noticeMark = pendingProcessCount > 0 ? themeText("\u21AA", "info", colorEnabled) : "";
|
|
8000
|
+
const creditsFull = creditsSegment ? themeText(
|
|
8001
|
+
formatCreditsChip(credits ?? 0, { compact: true }),
|
|
8002
|
+
"muted",
|
|
8003
|
+
colorEnabled
|
|
8004
|
+
) : "";
|
|
8005
|
+
const creditsMark = creditsSegment ? themeText("\u26A1\u2026", "muted", colorEnabled) : "";
|
|
8006
|
+
const stages = [
|
|
8007
|
+
[autoMark, gitCounts, noticeFull, creditsFull],
|
|
8008
|
+
[autoMark, gitMark, noticeFull, creditsFull],
|
|
8009
|
+
[autoMark, gitMark, noticeMark, creditsFull],
|
|
8010
|
+
[autoMark, noticeMark, creditsFull],
|
|
8011
|
+
[autoMark, creditsFull],
|
|
8012
|
+
[autoMark, creditsMark],
|
|
8013
|
+
// `autoMark` alone is only an honest projection when nothing was omitted.
|
|
8014
|
+
// With a fee on the line, dropping it silently would claim "no cost".
|
|
8015
|
+
...creditsSegment ? [] : [[autoMark]]
|
|
8016
|
+
].map((stage) => stage.filter(Boolean)).filter((stage) => stage.length > 0);
|
|
8017
|
+
const fitted = stages.find(
|
|
8018
|
+
(stage) => displayWidth(stripAnsi(stage.join(" "))) <= budget
|
|
8019
|
+
);
|
|
8020
|
+
const autoWidth = displayWidth(stripAnsi(autoMark));
|
|
8021
|
+
const overflowMark = autoMark && autoWidth + displayWidth("\u2026") <= budget ? `${autoMark}\u2026` : budget >= 1 ? "\u2026" : "";
|
|
8022
|
+
visibleParts = fitted ? [fitted.join(" ")] : [overflowMark];
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
let body = visibleParts.join(sep);
|
|
8026
|
+
if (maxWidth && maxWidth > 0) {
|
|
8027
|
+
const budget = Math.max(0, maxWidth - padWidth);
|
|
8028
|
+
if (displayWidth(stripAnsi(body)) > budget) {
|
|
8029
|
+
body = budget >= 2 ? truncateToWidth(stripAnsi(body), budget) : budget >= 1 ? "\u2026" : "";
|
|
7916
8030
|
}
|
|
7917
8031
|
}
|
|
7918
|
-
const body = visibleParts.join(sep);
|
|
7919
|
-
const surface = colorEnabled ? surfaceBackgroundSequence() : "";
|
|
7920
8032
|
if (!surface) return body;
|
|
7921
8033
|
return `${surface} ${body} \x1B[49m`;
|
|
7922
8034
|
}
|
|
@@ -9315,15 +9427,21 @@ function buildProcessTaskCompletedTurnEvent(notice) {
|
|
|
9315
9427
|
};
|
|
9316
9428
|
}
|
|
9317
9429
|
var PENDING_NOTICE_PREFIX = "process-notice-v1:";
|
|
9318
|
-
function serializePendingProcessNotice(notice) {
|
|
9319
|
-
|
|
9430
|
+
function serializePendingProcessNotice(notice, ownerDialogId) {
|
|
9431
|
+
const withOwner = { ...notice, ownerDialogId: ownerDialogId ?? null };
|
|
9432
|
+
return `${PENDING_NOTICE_PREFIX}${JSON.stringify(withOwner)}`;
|
|
9320
9433
|
}
|
|
9321
9434
|
function parsePendingProcessNoticeLine(line) {
|
|
9322
9435
|
if (line.startsWith(PENDING_NOTICE_PREFIX)) {
|
|
9323
9436
|
try {
|
|
9324
9437
|
const parsed = JSON.parse(line.slice(PENDING_NOTICE_PREFIX.length));
|
|
9325
|
-
if (parsed && typeof parsed.taskId === "string"
|
|
9326
|
-
|
|
9438
|
+
if (parsed && typeof parsed.taskId === "string") {
|
|
9439
|
+
const { ownerDialogId, ...rest } = parsed;
|
|
9440
|
+
return {
|
|
9441
|
+
...rest,
|
|
9442
|
+
// 类型校验:只有非空字符串才是可信归属,其他形状一律降级为未知。
|
|
9443
|
+
ownerDialogId: typeof ownerDialogId === "string" && ownerDialogId.length > 0 ? ownerDialogId : null
|
|
9444
|
+
};
|
|
9327
9445
|
}
|
|
9328
9446
|
} catch {
|
|
9329
9447
|
}
|
|
@@ -9337,7 +9455,8 @@ function parsePendingProcessNoticeLine(line) {
|
|
|
9337
9455
|
pid: 0,
|
|
9338
9456
|
label: "",
|
|
9339
9457
|
command: line,
|
|
9340
|
-
status: "failed"
|
|
9458
|
+
status: "failed",
|
|
9459
|
+
ownerDialogId: null
|
|
9341
9460
|
};
|
|
9342
9461
|
}
|
|
9343
9462
|
const [, taskId, rawLabel, status, rawExit] = taskMatch;
|
|
@@ -9348,9 +9467,19 @@ function parsePendingProcessNoticeLine(line) {
|
|
|
9348
9467
|
label,
|
|
9349
9468
|
command: "",
|
|
9350
9469
|
status: normalizeStatus(status),
|
|
9470
|
+
ownerDialogId: null,
|
|
9351
9471
|
...rawExit !== void 0 ? { exitCode: Number(rawExit) } : {}
|
|
9352
9472
|
};
|
|
9353
9473
|
}
|
|
9474
|
+
function annotatePendingProcessNoticeOrigin(notice, currentDialogId) {
|
|
9475
|
+
const withOrigin = (origin) => ({
|
|
9476
|
+
...notice,
|
|
9477
|
+
label: notice.label.trim() ? `${origin} ${notice.label}` : origin
|
|
9478
|
+
});
|
|
9479
|
+
if (notice.ownerDialogId == null) return withOrigin("[\u5F52\u5C5E\u672A\u77E5]");
|
|
9480
|
+
if (notice.ownerDialogId === currentDialogId) return notice;
|
|
9481
|
+
return withOrigin(`[\u6765\u81EA\u53E6\u4E00\u5BF9\u8BDD ${notice.ownerDialogId}\uFF0C\u4E0D\u4EE3\u8868\u5F53\u524D\u4EFB\u52A1]`);
|
|
9482
|
+
}
|
|
9354
9483
|
function unescapeLabel(raw) {
|
|
9355
9484
|
return raw.replace(/\\(["\\])/g, "$1");
|
|
9356
9485
|
}
|
|
@@ -11628,7 +11757,14 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
|
|
|
11628
11757
|
const injectedProcessNoticeLines = state.pendingProcessNotices ? [...state.pendingProcessNotices] : [];
|
|
11629
11758
|
const processNoticeBlocks = injectedProcessNoticeLines.length > 0 ? [{
|
|
11630
11759
|
content: buildProcessTerminalTurnMessage(
|
|
11631
|
-
injectedProcessNoticeLines.map(
|
|
11760
|
+
injectedProcessNoticeLines.map(
|
|
11761
|
+
(line) => annotatePendingProcessNoticeOrigin(
|
|
11762
|
+
parsePendingProcessNoticeLine(line),
|
|
11763
|
+
// 本函数的 state 即当前 session 状态;首轮尚未回填 dialogId
|
|
11764
|
+
// 时为 undefined(标注侧按「不冒充当前任务」处理)。
|
|
11765
|
+
state.dialogId
|
|
11766
|
+
)
|
|
11767
|
+
)
|
|
11632
11768
|
),
|
|
11633
11769
|
cacheScope: "turn"
|
|
11634
11770
|
}] : [];
|
|
@@ -14872,7 +15008,8 @@ async function runTuiWorkspace(options) {
|
|
|
14872
15008
|
const deployWakeLifecycle = { dispose: null };
|
|
14873
15009
|
const pushPendingProcessNotice = (notice) => {
|
|
14874
15010
|
if (sessionEnded) return;
|
|
14875
|
-
const
|
|
15011
|
+
const ownerDialogId = getProcessRegistry().getByTaskId(notice.taskId)?.owner?.dialogId ?? null;
|
|
15012
|
+
const line = serializePendingProcessNotice(notice, ownerDialogId);
|
|
14876
15013
|
state = {
|
|
14877
15014
|
...state,
|
|
14878
15015
|
pendingProcessNotices: [...state.pendingProcessNotices ?? [], line]
|
|
@@ -15218,7 +15355,7 @@ ${request.permissionNotice}`,
|
|
|
15218
15355
|
output,
|
|
15219
15356
|
...anchor
|
|
15220
15357
|
}));
|
|
15221
|
-
}));
|
|
15358
|
+
}), () => state.autoConfirm === true);
|
|
15222
15359
|
const sessionShellGrant = createOriginShellGrant({
|
|
15223
15360
|
confirm: async (request) => {
|
|
15224
15361
|
return await runWithInputRequiredAttention(
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
fetchAgentContexts,
|
|
3
3
|
responsesJsonToChatCompletions,
|
|
4
4
|
updateAgentTokens
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CYJWI3NH.js";
|
|
6
6
|
import {
|
|
7
7
|
generateRequestBody,
|
|
8
8
|
performFetchRequest,
|
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
resolveClientWire,
|
|
11
11
|
sanitizeOutboundBody,
|
|
12
12
|
stripModelToolArgs
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BJEZC5RA.js";
|
|
14
14
|
import "./chunk-W4S6OTSC.js";
|
|
15
15
|
import "./chunk-HS7MLR74.js";
|
|
16
16
|
import {
|
|
17
17
|
findToolExecutor
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3T4ZG6AC.js";
|
|
19
19
|
import "./chunk-JKMLSTZK.js";
|
|
20
20
|
import "./chunk-I2ZMGXXF.js";
|
|
21
21
|
import "./chunk-OXME3PEE.js";
|
|
22
22
|
import {
|
|
23
23
|
mergeReferences
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-RN2GPWN6.js";
|
|
25
25
|
import {
|
|
26
26
|
getToolResultErrorData
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ROCUB2H2.js";
|
|
28
28
|
import "./chunk-NF64D32W.js";
|
|
29
29
|
import "./chunk-XPWGOTBQ.js";
|
|
30
30
|
import "./chunk-ZIWPQEFU.js";
|
|
@@ -35,18 +35,18 @@ import "./chunk-IA7TRNNR.js";
|
|
|
35
35
|
import "./chunk-AGIM7IMJ.js";
|
|
36
36
|
import "./chunk-63W5N6P3.js";
|
|
37
37
|
import "./chunk-VF4K2QE6.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-626KHJNX.js";
|
|
39
39
|
import "./chunk-ILU2NPWY.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-AG7MCDLR.js";
|
|
41
41
|
import "./chunk-F32Z66T4.js";
|
|
42
42
|
import "./chunk-EYWJT7A2.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-AJ3G7X2K.js";
|
|
44
|
+
import "./chunk-U5ICMAFV.js";
|
|
45
45
|
import "./chunk-523DITKR.js";
|
|
46
46
|
import "./chunk-UKZX3NHN.js";
|
|
47
47
|
import "./chunk-OFFL4DCR.js";
|
|
48
48
|
import "./chunk-QYPE3TS3.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-DFDXM2Y4.js";
|
|
50
50
|
import "./chunk-4JH2UMJR.js";
|
|
51
51
|
import "./chunk-ZJ7UHBJS.js";
|
|
52
52
|
import "./chunk-BYXBJQAS.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveTurnToolContext,
|
|
19
19
|
trimMessagesWithSummary,
|
|
20
20
|
validateAccessAndBalance
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PIDUNDFS.js";
|
|
22
22
|
import "./chunk-KFHQQ3NO.js";
|
|
23
23
|
import {
|
|
24
24
|
filterAndCleanMessages,
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
readStreamChunk,
|
|
28
28
|
sendOpenAICompletionsRequest,
|
|
29
29
|
updateTotalUsage
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VWW6O2TL.js";
|
|
31
31
|
import "./chunk-JEXVIMYZ.js";
|
|
32
32
|
import {
|
|
33
33
|
prepareTools
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-V4EE3D54.js";
|
|
35
35
|
import {
|
|
36
36
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
37
37
|
buildInvalidToolCallSelfHealResult,
|
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
sanitizeOutboundResponsesInput,
|
|
45
45
|
selectResponsesConversationState,
|
|
46
46
|
updateResponsesConversationState
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-BJEZC5RA.js";
|
|
48
48
|
import "./chunk-W4S6OTSC.js";
|
|
49
49
|
import "./chunk-HS7MLR74.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-3T4ZG6AC.js";
|
|
51
51
|
import {
|
|
52
52
|
isOwnedAgentRecord,
|
|
53
53
|
resolveBillingSource
|
|
@@ -58,12 +58,12 @@ import {
|
|
|
58
58
|
isContextOverflowText,
|
|
59
59
|
parseApiError,
|
|
60
60
|
performServerProxyFetchWithRetry
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RN2GPWN6.js";
|
|
62
62
|
import {
|
|
63
63
|
createSSEParser,
|
|
64
64
|
selectMaxExecutionTime,
|
|
65
65
|
waitForAbortableDelay
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-ROCUB2H2.js";
|
|
67
67
|
import "./chunk-NF64D32W.js";
|
|
68
68
|
import "./chunk-XPWGOTBQ.js";
|
|
69
69
|
import "./chunk-ZIWPQEFU.js";
|
|
@@ -79,12 +79,12 @@ import "./chunk-IA7TRNNR.js";
|
|
|
79
79
|
import "./chunk-AGIM7IMJ.js";
|
|
80
80
|
import "./chunk-63W5N6P3.js";
|
|
81
81
|
import "./chunk-VF4K2QE6.js";
|
|
82
|
-
import "./chunk-
|
|
82
|
+
import "./chunk-626KHJNX.js";
|
|
83
83
|
import "./chunk-ILU2NPWY.js";
|
|
84
|
-
import "./chunk-
|
|
84
|
+
import "./chunk-AG7MCDLR.js";
|
|
85
85
|
import "./chunk-F32Z66T4.js";
|
|
86
86
|
import "./chunk-EYWJT7A2.js";
|
|
87
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-AJ3G7X2K.js";
|
|
88
88
|
import {
|
|
89
89
|
addToolMessage,
|
|
90
90
|
addUserMessage,
|
|
@@ -101,14 +101,14 @@ import {
|
|
|
101
101
|
selectDialogConfigByKey,
|
|
102
102
|
updateTokens,
|
|
103
103
|
updateToolMessage
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-U5ICMAFV.js";
|
|
105
105
|
import "./chunk-523DITKR.js";
|
|
106
106
|
import {
|
|
107
107
|
isOAuthApiKeyRef
|
|
108
108
|
} from "./chunk-UKZX3NHN.js";
|
|
109
109
|
import "./chunk-OFFL4DCR.js";
|
|
110
110
|
import "./chunk-QYPE3TS3.js";
|
|
111
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-DFDXM2Y4.js";
|
|
112
112
|
import "./chunk-4JH2UMJR.js";
|
|
113
113
|
import {
|
|
114
114
|
getCurrentSpaceId
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
toolQueryFunc,
|
|
9
9
|
toolQueryFunctionSchema,
|
|
10
10
|
toolRegistry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3T4ZG6AC.js";
|
|
12
12
|
import "./chunk-JKMLSTZK.js";
|
|
13
13
|
import "./chunk-I2ZMGXXF.js";
|
|
14
14
|
import "./chunk-OXME3PEE.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-ROCUB2H2.js";
|
|
16
16
|
import "./chunk-NF64D32W.js";
|
|
17
17
|
import "./chunk-XPWGOTBQ.js";
|
|
18
18
|
import "./chunk-ZIWPQEFU.js";
|
|
@@ -23,18 +23,18 @@ import "./chunk-IA7TRNNR.js";
|
|
|
23
23
|
import "./chunk-AGIM7IMJ.js";
|
|
24
24
|
import "./chunk-63W5N6P3.js";
|
|
25
25
|
import "./chunk-VF4K2QE6.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-626KHJNX.js";
|
|
27
27
|
import "./chunk-ILU2NPWY.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-AG7MCDLR.js";
|
|
29
29
|
import "./chunk-F32Z66T4.js";
|
|
30
30
|
import "./chunk-EYWJT7A2.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-AJ3G7X2K.js";
|
|
32
|
+
import "./chunk-U5ICMAFV.js";
|
|
33
33
|
import "./chunk-523DITKR.js";
|
|
34
34
|
import "./chunk-UKZX3NHN.js";
|
|
35
35
|
import "./chunk-OFFL4DCR.js";
|
|
36
36
|
import "./chunk-QYPE3TS3.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-DFDXM2Y4.js";
|
|
38
38
|
import "./chunk-4JH2UMJR.js";
|
|
39
39
|
import "./chunk-ZJ7UHBJS.js";
|
|
40
40
|
import "./chunk-BYXBJQAS.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AJ3G7X2K.js";
|
|
4
4
|
import {
|
|
5
5
|
format,
|
|
6
6
|
isAssistantToolStub,
|
|
7
7
|
selectAllMsgs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-U5ICMAFV.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
|
|
11
11
|
BUILTIN_TITLE_LLM_CONFIG
|
|
@@ -15,7 +15,7 @@ import "./chunk-OFFL4DCR.js";
|
|
|
15
15
|
import "./chunk-QYPE3TS3.js";
|
|
16
16
|
import {
|
|
17
17
|
runLlm
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DFDXM2Y4.js";
|
|
19
19
|
import "./chunk-4JH2UMJR.js";
|
|
20
20
|
import "./chunk-ZJ7UHBJS.js";
|
|
21
21
|
import "./chunk-BYXBJQAS.js";
|