nolo-cli 0.103.0-alpha.1 → 0.104.0-alpha.1
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-3UCNJCQA.js → _executeModel-4W7C3ACS.js} +10 -10
- package/{agentEmailCommands-WLYF3JRS.js → agentEmailCommands-O2KH4G7U.js} +9 -9
- package/{agentListCommands-JP7S7PT2.js → agentListCommands-GUDMBDHZ.js} +2 -61
- package/{agentMachineCommands-HNGAR5GI.js → agentMachineCommands-5I5CCUBM.js} +1 -1
- package/{agentRecordCommands-SXFPW3DL.js → agentRecordCommands-RSS44XHC.js} +9 -9
- package/{agentRunCommand-JIQ4HY4D.js → agentRunCommand-P7VHL4ZR.js} +10 -9
- package/{agentSlice-SICQBMCM.js → agentSlice-6LBOYNKN.js} +1 -1
- package/{chatQueueReduxAdapter-HHMUDNXL.js → chatQueueReduxAdapter-WFROMKD3.js} +2 -2
- package/{chunk-XS5SWEDQ.js → chunk-2J5Y72GY.js} +1 -1
- package/{chunk-DNUUJ45N.js → chunk-3ZW5ZJMM.js} +2 -2
- package/{chunk-LW4VFPAY.js → chunk-4J4QNKTW.js} +46 -6
- package/{chunk-CUQEXCAU.js → chunk-7SOWRCQQ.js} +1 -1
- package/{chunk-OZGZPSEG.js → chunk-A6FMKU7M.js} +1 -1
- package/{chunk-4EG4QFTK.js → chunk-B6P4QKEN.js} +2 -2
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-RSONHHPE.js → chunk-DJWMIXDZ.js} +2 -2
- package/{chunk-IONPPCL5.js → chunk-EEGDMATE.js} +65 -0
- package/{chunk-XVZ22N6C.js → chunk-FQUHIG5X.js} +8 -8
- package/{chunk-TQBHNYVR.js → chunk-H66KLASO.js} +8 -8
- package/{chunk-F2RNI7ZR.js → chunk-ITBLTYQB.js} +4 -4
- package/{chunk-AGVEIAQA.js → chunk-NXUYQBDZ.js} +5 -5
- package/{chunk-3WLK2JQ5.js → chunk-U3JZVWIB.js} +3 -3
- package/{chunk-B3TVQ6PI.js → chunk-W324THOB.js} +2 -2
- package/{chunk-3N3W7KBB.js → chunk-YY7I6GQ3.js} +3 -3
- package/{contentThunks-S4S7QPSO.js → contentThunks-LXOZUD2Y.js} +3 -3
- package/{createAgentAutomationAction-ODGL2YGP.js → createAgentAutomationAction-M5NDEIC6.js} +3 -3
- package/{createDialogAction-GFKRXTK4.js → createDialogAction-TDFOINOY.js} +4 -4
- package/{createPageAction-FBV3OWX7.js → createPageAction-WY5ZKP2M.js} +3 -3
- package/{dialogSlice-LEO27SQG.js → dialogSlice-HSGREZGA.js} +2 -2
- package/{docStore-MNX5MHA5.js → docStore-IIS36NGG.js} +1 -1
- package/{handleSendMessageAction-YB6KQFJS.js → handleSendMessageAction-FEHCWMN2.js} +6 -48
- package/index.js +16 -16
- package/{machineCommands-7GVQCUAK.js → machineCommands-G5J754EH.js} +9 -9
- package/{machineWsRunDispatch-XA7TD7Z7.js → machineWsRunDispatch-VXYBYYKM.js} +9 -9
- package/package.json +1 -1
- package/{readlineWorkspace-WA7JNI6J.js → readlineWorkspace-TGCYJFEB.js} +25 -17
- package/{runAgentClientLoop-JGFQ6KIR.js → runAgentClientLoop-UY76PPZM.js} +8 -8
- package/{streamAgentChatTurn-XLFZ66UC.js → streamAgentChatTurn-3YVIO4KE.js} +9 -9
- package/{tools-NF5AB34X.js → tools-Q6IBBG33.js} +6 -6
- package/{updateDialogTitleAction-6MBTD4UE.js → updateDialogTitleAction-GF5T3VMK.js} +3 -3
|
@@ -18,6 +18,70 @@ import {
|
|
|
18
18
|
publicAgentKey
|
|
19
19
|
} from "./chunk-M2EJHDJP.js";
|
|
20
20
|
|
|
21
|
+
// packages/ai/agent/quotaSnapshot.ts
|
|
22
|
+
function findTightestQuotaWindow(quota, now = Date.now()) {
|
|
23
|
+
if (!quota || !Array.isArray(quota.windows) || quota.windows.length === 0) {
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
let best;
|
|
27
|
+
let bestScore = -Infinity;
|
|
28
|
+
for (const w of quota.windows) {
|
|
29
|
+
let score = 0;
|
|
30
|
+
if (typeof w.utilization === "number" && w.utilization >= 0) {
|
|
31
|
+
score = 500 + Math.min(w.utilization, 1) * 500;
|
|
32
|
+
} else if (typeof w.remaining === "number" && typeof w.limit === "number" && w.limit > 0) {
|
|
33
|
+
const util = Math.max(0, 1 - w.remaining / w.limit);
|
|
34
|
+
score = 500 + util * 500;
|
|
35
|
+
} else if (typeof w.resetAt === "number" && w.resetAt > now) {
|
|
36
|
+
score = 200;
|
|
37
|
+
} else if (typeof w.remaining === "number") {
|
|
38
|
+
score = 100;
|
|
39
|
+
}
|
|
40
|
+
if (score > bestScore) {
|
|
41
|
+
bestScore = score;
|
|
42
|
+
best = w;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return best ?? quota.windows[0];
|
|
46
|
+
}
|
|
47
|
+
function formatQuotaSummary(quota, now = Date.now(), options) {
|
|
48
|
+
const tightest = findTightestQuotaWindow(quota, now);
|
|
49
|
+
if (!tightest) return void 0;
|
|
50
|
+
const compact = options?.compact === true;
|
|
51
|
+
const parts = [];
|
|
52
|
+
if (typeof tightest.utilization === "number") {
|
|
53
|
+
const pct = Math.round(tightest.utilization * 100);
|
|
54
|
+
parts.push(`${pct}%\u5DF2\u7528`);
|
|
55
|
+
} else if (typeof tightest.remaining === "number") {
|
|
56
|
+
if (typeof tightest.limit === "number") {
|
|
57
|
+
parts.push(`${tightest.remaining}/${tightest.limit}${tightest.unit ? ` ${tightest.unit}` : ""}`);
|
|
58
|
+
} else {
|
|
59
|
+
parts.push(`\u4F59${tightest.remaining}${tightest.unit ? ` ${tightest.unit}` : ""}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (compact) return parts.length > 0 ? parts[0] : void 0;
|
|
63
|
+
if (tightest.scope && tightest.scope !== "user" && tightest.scope !== "project" && tightest.scope !== tightest.unit) {
|
|
64
|
+
parts.push(tightest.scope);
|
|
65
|
+
}
|
|
66
|
+
if (typeof tightest.resetAt === "number" && tightest.resetAt > now) {
|
|
67
|
+
const diffSec = Math.round((tightest.resetAt - now) / 1e3);
|
|
68
|
+
if (diffSec < 60) {
|
|
69
|
+
parts.push(`${diffSec}s\u540E\u91CD\u7F6E`);
|
|
70
|
+
} else if (diffSec < 3600) {
|
|
71
|
+
parts.push(`${Math.round(diffSec / 60)}m\u540E\u91CD\u7F6E`);
|
|
72
|
+
} else if (diffSec < 86400) {
|
|
73
|
+
const hours = (diffSec / 3600).toFixed(1).replace(/\.0$/, "");
|
|
74
|
+
parts.push(`${hours}h\u540E\u91CD\u7F6E`);
|
|
75
|
+
} else {
|
|
76
|
+
const days = (diffSec / 86400).toFixed(1).replace(/\.0$/, "");
|
|
77
|
+
parts.push(`${days}d\u540E\u91CD\u7F6E`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (parts.length === 0) return void 0;
|
|
81
|
+
if (parts.length === 1 && parts[0] === tightest.scope) return void 0;
|
|
82
|
+
return parts.join(" \xB7 ");
|
|
83
|
+
}
|
|
84
|
+
|
|
21
85
|
// packages/cli/agentListHelpers.ts
|
|
22
86
|
function parseAgentRecordId(privateKey, explicitId) {
|
|
23
87
|
if (explicitId) return explicitId;
|
|
@@ -239,6 +303,7 @@ async function decorateAgentsWithPublicStatusAcrossServers(args) {
|
|
|
239
303
|
}
|
|
240
304
|
|
|
241
305
|
export {
|
|
306
|
+
formatQuotaSummary,
|
|
242
307
|
normalizeListedAgent,
|
|
243
308
|
toSafeListedAgentSummary,
|
|
244
309
|
parseAgentListArgs,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-AGGIDPCZ.js";
|
|
15
15
|
import {
|
|
16
16
|
runLlm
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
18
18
|
import {
|
|
19
19
|
cleanupCliSessionForDialog
|
|
20
20
|
} from "./chunk-TOP2VXOR.js";
|
|
@@ -19371,7 +19371,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
19371
19371
|
runtimeOptions: args.runtimeOptions
|
|
19372
19372
|
});
|
|
19373
19373
|
if (agentKeyToUse) {
|
|
19374
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
19374
|
+
const { streamAgentChatTurn } = await import("./agentSlice-6LBOYNKN.js");
|
|
19375
19375
|
await dispatch(
|
|
19376
19376
|
streamAgentChatTurn({
|
|
19377
19377
|
agentKey: agentKeyToUse,
|
|
@@ -20507,7 +20507,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
20507
20507
|
}
|
|
20508
20508
|
if (isCurrentDialog) {
|
|
20509
20509
|
await thunkApi.dispatch(resetMsgs());
|
|
20510
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
20510
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-HSGREZGA.js");
|
|
20511
20511
|
dispatch(clearPendingAttachments2());
|
|
20512
20512
|
}
|
|
20513
20513
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -20515,15 +20515,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
20515
20515
|
|
|
20516
20516
|
// packages/chat/dialog/dialogSlice.ts
|
|
20517
20517
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
20518
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
20518
|
+
const { createDialogAction } = await import("./createDialogAction-TDFOINOY.js");
|
|
20519
20519
|
return createDialogAction(args, thunkApi);
|
|
20520
20520
|
};
|
|
20521
20521
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
20522
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
20522
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-M5NDEIC6.js");
|
|
20523
20523
|
return createAgentAutomationAction(args, thunkApi);
|
|
20524
20524
|
};
|
|
20525
20525
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
20526
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
20526
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-GF5T3VMK.js");
|
|
20527
20527
|
return updateDialogTitleAction(args, thunkApi);
|
|
20528
20528
|
};
|
|
20529
20529
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -20547,7 +20547,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
20547
20547
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
20548
20548
|
};
|
|
20549
20549
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
20550
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
20550
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-FEHCWMN2.js");
|
|
20551
20551
|
return handleSendMessageAction(args, thunkApi);
|
|
20552
20552
|
};
|
|
20553
20553
|
function clearDialogState() {
|
|
@@ -20560,7 +20560,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
20560
20560
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
20561
20561
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
20562
20562
|
try {
|
|
20563
|
-
const { createDocState } = await import("./docStore-
|
|
20563
|
+
const { createDocState } = await import("./docStore-IIS36NGG.js");
|
|
20564
20564
|
const pageKey = await createDocState(
|
|
20565
20565
|
{ slateData, title },
|
|
20566
20566
|
{ dispatch, getState }
|
|
@@ -81,10 +81,10 @@ import {
|
|
|
81
81
|
} from "./chunk-VF4K2QE6.js";
|
|
82
82
|
import {
|
|
83
83
|
createDocState
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-W324THOB.js";
|
|
85
85
|
import {
|
|
86
86
|
createDialogAction
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-3ZW5ZJMM.js";
|
|
88
88
|
import {
|
|
89
89
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
90
90
|
addContentToSpace,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
updateContentCategory,
|
|
103
103
|
updateContentTitle,
|
|
104
104
|
writeStoredCollapsedCategories
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-A6FMKU7M.js";
|
|
106
106
|
import {
|
|
107
107
|
getCurrentSpaceId,
|
|
108
108
|
getCurrentSpaceIdRaw,
|
|
@@ -124,14 +124,14 @@ import {
|
|
|
124
124
|
selectMsgById,
|
|
125
125
|
uiAskChoiceFunc,
|
|
126
126
|
uiAskChoiceFunctionSchema
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-FQUHIG5X.js";
|
|
128
128
|
import {
|
|
129
129
|
createAgent,
|
|
130
130
|
deleteServerSyncedCredential,
|
|
131
131
|
runLlm,
|
|
132
132
|
streamAgentChatTurn,
|
|
133
133
|
updateAgent
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
135
135
|
import {
|
|
136
136
|
getActiveDialogKey,
|
|
137
137
|
selectCurrentDialogKey,
|
|
@@ -3945,7 +3945,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3945
3945
|
const deletedDialogIds = [];
|
|
3946
3946
|
const deletedDialogKeys = [];
|
|
3947
3947
|
const failures = [];
|
|
3948
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3948
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-HSGREZGA.js");
|
|
3949
3949
|
for (const target of targets) {
|
|
3950
3950
|
try {
|
|
3951
3951
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -14906,7 +14906,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14906
14906
|
if (!executionInput) {
|
|
14907
14907
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
14908
14908
|
}
|
|
14909
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
14909
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-Q6IBBG33.js");
|
|
14910
14910
|
const { executor } = findToolExecutor2(run.toolName);
|
|
14911
14911
|
toolRunStarted({
|
|
14912
14912
|
id: run.id,
|
|
@@ -17413,7 +17413,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17413
17413
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
17414
17414
|
};
|
|
17415
17415
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
17416
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
17416
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-IIS36NGG.js");
|
|
17417
17417
|
if (getDocState().pageKey === id) {
|
|
17418
17418
|
applyExternalDocUpdate({
|
|
17419
17419
|
slateData: finalSlateData,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
import {
|
|
62
62
|
inlineImageUrlsForCustomProvider,
|
|
63
63
|
prepareTools
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-DJWMIXDZ.js";
|
|
65
65
|
import {
|
|
66
66
|
getServerProviderSecret
|
|
67
67
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
rememberMemoryFunctionSchema,
|
|
81
81
|
resolveAgentRequiredPackIds,
|
|
82
82
|
setTodoListFunc
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-H66KLASO.js";
|
|
84
84
|
import {
|
|
85
85
|
fetchWithTransientRetry,
|
|
86
86
|
isTransientFetchError
|
|
@@ -109,14 +109,14 @@ import {
|
|
|
109
109
|
prepareTokenUsageData,
|
|
110
110
|
resolveBuiltinPlatformAgentConfig,
|
|
111
111
|
runKeyed
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-FQUHIG5X.js";
|
|
113
113
|
import {
|
|
114
114
|
BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
|
|
115
115
|
BUILTIN_TITLE_LLM_CONFIG
|
|
116
116
|
} from "./chunk-MC4XLIJ7.js";
|
|
117
117
|
import {
|
|
118
118
|
fetchServerSyncedCredential
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
120
120
|
import {
|
|
121
121
|
require_date_fns
|
|
122
122
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJWMIXDZ.js";
|
|
9
9
|
import {
|
|
10
10
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
11
11
|
buildInvalidToolCallSelfHealResult,
|
|
12
12
|
parseToolCallArguments,
|
|
13
13
|
performFetchRequest,
|
|
14
14
|
sanitizeOutboundMessages
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-U3JZVWIB.js";
|
|
16
16
|
import {
|
|
17
17
|
createSSEParser,
|
|
18
18
|
createToolRunId,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
toolRunSetPending,
|
|
24
24
|
toolRunStarted,
|
|
25
25
|
toolRunSucceeded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H66KLASO.js";
|
|
27
27
|
import {
|
|
28
28
|
getPublicImageAgentMode
|
|
29
29
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
messageStreamEnd,
|
|
36
36
|
messageStreaming,
|
|
37
37
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FQUHIG5X.js";
|
|
39
39
|
import {
|
|
40
40
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
42
42
|
import {
|
|
43
43
|
addActiveController,
|
|
44
44
|
removeActiveController,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
clipMultilineText,
|
|
9
9
|
fetchAndSerializeTable
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H66KLASO.js";
|
|
11
11
|
import {
|
|
12
12
|
isGatewayHttpStatus
|
|
13
13
|
} from "./chunk-NF64D32W.js";
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
} from "./chunk-MEYIRKDN.js";
|
|
29
29
|
import {
|
|
30
30
|
fetchAndCacheMessages
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FQUHIG5X.js";
|
|
32
32
|
import {
|
|
33
33
|
shouldUseServerProxy
|
|
34
34
|
} from "./chunk-YYLHWIW6.js";
|
|
35
35
|
import {
|
|
36
36
|
fetchServerSyncedCredential
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
38
38
|
import {
|
|
39
39
|
buildSkillGuidancePromptBlock,
|
|
40
40
|
extractRuntimePageCapabilities,
|
|
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
326
326
|
).unwrap();
|
|
327
327
|
if (dbSpaceId) {
|
|
328
328
|
try {
|
|
329
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
329
|
+
const { updateContentTitle } = await import("./contentThunks-LXOZUD2Y.js");
|
|
330
330
|
await dispatch(
|
|
331
331
|
updateContentTitle({
|
|
332
332
|
spaceId: dbSpaceId,
|
|
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
async function createDocState(args, thunkApi) {
|
|
368
|
-
const { createPageAction } = await import("./createPageAction-
|
|
368
|
+
const { createPageAction } = await import("./createPageAction-WY5ZKP2M.js");
|
|
369
369
|
return createPageAction(args, thunkApi);
|
|
370
370
|
}
|
|
371
371
|
function subscribe(listener) {
|
|
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
|
|
|
304
304
|
const overrides = {};
|
|
305
305
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
306
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
307
|
+
const { _executeModel } = await import("./_executeModel-4W7C3ACS.js");
|
|
308
308
|
return _executeModel(
|
|
309
309
|
{
|
|
310
310
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
|
|
|
325
325
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
326
|
*/
|
|
327
327
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
328
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-UY76PPZM.js");
|
|
329
329
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
330
|
{
|
|
331
331
|
agentKey: args.agentKey,
|
|
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
|
|
|
341
341
|
* 聊天轮次流式 Agent 调用
|
|
342
342
|
*/
|
|
343
343
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
344
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-3YVIO4KE.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
updateContentPinned,
|
|
8
8
|
updateContentTitle,
|
|
9
9
|
uploadAndAddFileToSpace
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-A6FMKU7M.js";
|
|
11
11
|
import "./chunk-ZJ7UHBJS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FQUHIG5X.js";
|
|
13
13
|
import "./chunk-MC4XLIJ7.js";
|
|
14
14
|
import "./chunk-3BMYXEUW.js";
|
|
15
15
|
import "./chunk-YYLHWIW6.js";
|
|
16
16
|
import "./chunk-AGGIDPCZ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-YY7I6GQ3.js";
|
|
18
18
|
import "./chunk-TOP2VXOR.js";
|
|
19
19
|
import "./chunk-5RGU3J7P.js";
|
|
20
20
|
import "./chunk-6YTOJY35.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A6FMKU7M.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-FQUHIG5X.js";
|
|
6
6
|
import "./chunk-MC4XLIJ7.js";
|
|
7
7
|
import "./chunk-3BMYXEUW.js";
|
|
8
8
|
import "./chunk-YYLHWIW6.js";
|
|
9
9
|
import "./chunk-AGGIDPCZ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-YY7I6GQ3.js";
|
|
11
11
|
import "./chunk-TOP2VXOR.js";
|
|
12
12
|
import "./chunk-5RGU3J7P.js";
|
|
13
13
|
import "./chunk-6YTOJY35.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogAction,
|
|
3
3
|
isLocalOwnerDialogAgents
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-3ZW5ZJMM.js";
|
|
5
|
+
import "./chunk-A6FMKU7M.js";
|
|
6
6
|
import "./chunk-ZJ7UHBJS.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FQUHIG5X.js";
|
|
8
8
|
import "./chunk-MC4XLIJ7.js";
|
|
9
9
|
import "./chunk-3BMYXEUW.js";
|
|
10
10
|
import "./chunk-YYLHWIW6.js";
|
|
11
11
|
import "./chunk-AGGIDPCZ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-YY7I6GQ3.js";
|
|
13
13
|
import "./chunk-TOP2VXOR.js";
|
|
14
14
|
import "./chunk-5RGU3J7P.js";
|
|
15
15
|
import "./chunk-6YTOJY35.js";
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
client_default
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-A6FMKU7M.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentSpaceId
|
|
20
20
|
} from "./chunk-ZJ7UHBJS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-FQUHIG5X.js";
|
|
22
22
|
import "./chunk-MC4XLIJ7.js";
|
|
23
23
|
import "./chunk-3BMYXEUW.js";
|
|
24
24
|
import "./chunk-YYLHWIW6.js";
|
|
25
25
|
import "./chunk-AGGIDPCZ.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-YY7I6GQ3.js";
|
|
27
27
|
import "./chunk-TOP2VXOR.js";
|
|
28
28
|
import "./chunk-5RGU3J7P.js";
|
|
29
29
|
import "./chunk-6YTOJY35.js";
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
switchDialogAgent,
|
|
21
21
|
updateDialogTitle,
|
|
22
22
|
updateTokens
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FQUHIG5X.js";
|
|
24
24
|
import "./chunk-MC4XLIJ7.js";
|
|
25
25
|
import "./chunk-3BMYXEUW.js";
|
|
26
26
|
import "./chunk-YYLHWIW6.js";
|
|
27
27
|
import "./chunk-AGGIDPCZ.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-YY7I6GQ3.js";
|
|
29
29
|
import "./chunk-TOP2VXOR.js";
|
|
30
30
|
import {
|
|
31
31
|
getActiveDialogAgentId
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
scanValidationDetails
|
|
3
|
+
} from "./chunk-BMQ2MJUK.js";
|
|
1
4
|
import {
|
|
2
5
|
waitForAbortableDelay
|
|
3
6
|
} from "./chunk-N4G4PKQ6.js";
|
|
@@ -6,14 +9,14 @@ import {
|
|
|
6
9
|
prepareAndPersistUserMessage,
|
|
7
10
|
resolveHandleSendMessageContext,
|
|
8
11
|
selectAllMsgs
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FQUHIG5X.js";
|
|
10
13
|
import "./chunk-MC4XLIJ7.js";
|
|
11
14
|
import "./chunk-3BMYXEUW.js";
|
|
12
15
|
import "./chunk-YYLHWIW6.js";
|
|
13
16
|
import "./chunk-AGGIDPCZ.js";
|
|
14
17
|
import {
|
|
15
18
|
streamAgentChatTurn
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YY7I6GQ3.js";
|
|
17
20
|
import "./chunk-TOP2VXOR.js";
|
|
18
21
|
import "./chunk-5RGU3J7P.js";
|
|
19
22
|
import {
|
|
@@ -90,21 +93,6 @@ function asRecord(value) {
|
|
|
90
93
|
function asString(value) {
|
|
91
94
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
92
95
|
}
|
|
93
|
-
function sanitizeSafeUrl(rawUrl) {
|
|
94
|
-
if (typeof rawUrl !== "string") return void 0;
|
|
95
|
-
const trimmed = rawUrl.trim();
|
|
96
|
-
if (/^https?:\/\//i.test(trimmed)) {
|
|
97
|
-
try {
|
|
98
|
-
const parsed = new URL(trimmed);
|
|
99
|
-
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
|
|
100
|
-
return trimmed;
|
|
101
|
-
}
|
|
102
|
-
} catch {
|
|
103
|
-
return void 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return void 0;
|
|
107
|
-
}
|
|
108
96
|
function extractFullErrorText(error) {
|
|
109
97
|
if (!error) return "Unknown error";
|
|
110
98
|
if (typeof error === "string") return error;
|
|
@@ -126,37 +114,7 @@ function extractFullErrorText(error) {
|
|
|
126
114
|
return error?.message || error?.error || String(error);
|
|
127
115
|
}
|
|
128
116
|
function collectValidationFromDetails(details) {
|
|
129
|
-
|
|
130
|
-
let url;
|
|
131
|
-
let text;
|
|
132
|
-
let learnMoreUrl;
|
|
133
|
-
for (const detail of details) {
|
|
134
|
-
const rec = asRecord(detail);
|
|
135
|
-
if (!rec) continue;
|
|
136
|
-
const metadata = asRecord(rec.metadata);
|
|
137
|
-
if (metadata) {
|
|
138
|
-
url = url ?? sanitizeSafeUrl(metadata.validation_url);
|
|
139
|
-
text = text ?? asString(metadata.validation_url_link_text);
|
|
140
|
-
learnMoreUrl = learnMoreUrl ?? sanitizeSafeUrl(metadata.validation_learn_more_url);
|
|
141
|
-
}
|
|
142
|
-
const help = asRecord(rec);
|
|
143
|
-
if (Array.isArray(help.links)) {
|
|
144
|
-
for (const link of help.links) {
|
|
145
|
-
const linkRec = asRecord(link);
|
|
146
|
-
if (!linkRec) continue;
|
|
147
|
-
const linkUrl = sanitizeSafeUrl(linkRec.url);
|
|
148
|
-
if (!linkUrl) continue;
|
|
149
|
-
const desc = asString(linkRec.description);
|
|
150
|
-
if (!url && desc && /verify|continue/i.test(desc)) {
|
|
151
|
-
url = linkUrl;
|
|
152
|
-
text = desc;
|
|
153
|
-
} else if (!learnMoreUrl && /learn more/i.test(desc ?? "")) {
|
|
154
|
-
learnMoreUrl = linkUrl;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return { url, text, learnMoreUrl };
|
|
117
|
+
return scanValidationDetails(details);
|
|
160
118
|
}
|
|
161
119
|
function resolveErrorStage(errorText) {
|
|
162
120
|
if (/127\.0\.0\.1:3233|localhost:3233|desktop daemon|desktop agent runtime|runDesktopAgentRuntime|Local turn stream/i.test(
|
package/index.js
CHANGED
|
@@ -127,7 +127,7 @@ function createDaemonShortcutCommand(path, description, command2) {
|
|
|
127
127
|
// packages/cli/agentInternalCommandEntries.ts
|
|
128
128
|
function getAgentInternalCommandEntries() {
|
|
129
129
|
const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args2, ctx) => {
|
|
130
|
-
const { runAgentRunCommand } = await import("./agentRunCommand-
|
|
130
|
+
const { runAgentRunCommand } = await import("./agentRunCommand-P7VHL4ZR.js");
|
|
131
131
|
return runAgentRunCommand(args2, {
|
|
132
132
|
env: ctx.env,
|
|
133
133
|
scriptDir: ctx.scriptDir,
|
|
@@ -139,11 +139,11 @@ function getAgentInternalCommandEntries() {
|
|
|
139
139
|
createAgentRunCommand(["run"], "Run a no-login local agent in this workspace"),
|
|
140
140
|
createAgentRunCommand(["chat"], "Chat with an agent"),
|
|
141
141
|
createEnvCommand(["agent", "list"], "List owned agents", async (args2, deps) => {
|
|
142
|
-
const { runAgentListCommand } = await import("./agentListCommands-
|
|
142
|
+
const { runAgentListCommand } = await import("./agentListCommands-GUDMBDHZ.js");
|
|
143
143
|
return runAgentListCommand(args2, deps);
|
|
144
144
|
}),
|
|
145
145
|
createEnvCommand(["agent", "create"], "Create a new agent", async (args2, deps) => {
|
|
146
|
-
const { runAgentCreateCommand } = await import("./agentRecordCommands-
|
|
146
|
+
const { runAgentCreateCommand } = await import("./agentRecordCommands-RSS44XHC.js");
|
|
147
147
|
return runAgentCreateCommand(args2, deps);
|
|
148
148
|
}),
|
|
149
149
|
createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args2, deps) => {
|
|
@@ -159,7 +159,7 @@ function getAgentInternalCommandEntries() {
|
|
|
159
159
|
return runAgentPullCommand(args2, deps);
|
|
160
160
|
}),
|
|
161
161
|
createEnvCommand(["agent", "read"], "Read a single agent", async (args2, deps) => {
|
|
162
|
-
const { runAgentReadCommand } = await import("./agentRecordCommands-
|
|
162
|
+
const { runAgentReadCommand } = await import("./agentRecordCommands-RSS44XHC.js");
|
|
163
163
|
return runAgentReadCommand(args2, deps);
|
|
164
164
|
}),
|
|
165
165
|
createAgentRunCommand(["agent", "run"], "Run an agent"),
|
|
@@ -188,26 +188,26 @@ function getAgentInternalCommandEntries() {
|
|
|
188
188
|
return runSetupOfflineMarxistsAgentCommand(args2, deps);
|
|
189
189
|
}),
|
|
190
190
|
createEnvCommand(["agent", "update"], "Update agent fields", async (args2, deps) => {
|
|
191
|
-
const { runAgentUpdateCommand } = await import("./agentRecordCommands-
|
|
191
|
+
const { runAgentUpdateCommand } = await import("./agentRecordCommands-RSS44XHC.js");
|
|
192
192
|
return runAgentUpdateCommand(args2, deps);
|
|
193
193
|
}),
|
|
194
194
|
createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args2, deps) => {
|
|
195
|
-
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-
|
|
195
|
+
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-O2KH4G7U.js");
|
|
196
196
|
return runAgentEmailProvisionCommand(args2, deps);
|
|
197
197
|
}),
|
|
198
198
|
createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args2, deps) => {
|
|
199
|
-
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-
|
|
199
|
+
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-O2KH4G7U.js");
|
|
200
200
|
return runAgentEmailBindCommand(args2, deps);
|
|
201
201
|
}),
|
|
202
202
|
createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args2, deps) => {
|
|
203
|
-
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-
|
|
203
|
+
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-O2KH4G7U.js");
|
|
204
204
|
return runAgentEmailTransferCommand(args2, deps);
|
|
205
205
|
}),
|
|
206
206
|
createEnvCommand(
|
|
207
207
|
["agent", "email", "create-and-provision"],
|
|
208
208
|
"Create an agent and provision its controlled inbox",
|
|
209
209
|
async (args2, deps) => {
|
|
210
|
-
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-
|
|
210
|
+
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-O2KH4G7U.js");
|
|
211
211
|
return runAgentEmailCreateAndProvisionCommand(args2, deps);
|
|
212
212
|
}
|
|
213
213
|
),
|
|
@@ -228,15 +228,15 @@ function getAgentInternalCommandEntries() {
|
|
|
228
228
|
return runAgentRevokeGrantCommand(args2, deps);
|
|
229
229
|
}),
|
|
230
230
|
createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args2, deps) => {
|
|
231
|
-
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-
|
|
231
|
+
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-5I5CCUBM.js");
|
|
232
232
|
return runAgentBindCurrentCommand(args2, deps);
|
|
233
233
|
}),
|
|
234
234
|
createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args2, deps) => {
|
|
235
|
-
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-
|
|
235
|
+
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-5I5CCUBM.js");
|
|
236
236
|
return runAgentSmokeCurrentCommand(args2, deps);
|
|
237
237
|
}),
|
|
238
238
|
createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args2, deps) => {
|
|
239
|
-
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-
|
|
239
|
+
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-5I5CCUBM.js");
|
|
240
240
|
return runAgentRuntimeDoctorCommand(args2, deps);
|
|
241
241
|
}),
|
|
242
242
|
createAgentRunCommand(["agent", "chat"], "Chat with an agent")
|
|
@@ -488,15 +488,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
|
|
|
488
488
|
return runWhoamiCommand({ args: args2, env: ctx.env });
|
|
489
489
|
}),
|
|
490
490
|
createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args2, deps) => {
|
|
491
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
491
|
+
const { runMachineConnectCommand } = await import("./machineCommands-G5J754EH.js");
|
|
492
492
|
return runMachineConnectCommand(args2, deps);
|
|
493
493
|
}),
|
|
494
494
|
createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args2, deps) => {
|
|
495
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
495
|
+
const { runMachineConnectCommand } = await import("./machineCommands-G5J754EH.js");
|
|
496
496
|
return runMachineConnectCommand(args2, deps);
|
|
497
497
|
}),
|
|
498
498
|
createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args2, deps) => {
|
|
499
|
-
const { runMachineStatusCommand } = await import("./machineCommands-
|
|
499
|
+
const { runMachineStatusCommand } = await import("./machineCommands-G5J754EH.js");
|
|
500
500
|
return runMachineStatusCommand(args2, deps);
|
|
501
501
|
}),
|
|
502
502
|
createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args2, deps) => {
|
|
@@ -892,7 +892,7 @@ async function runScript(script, forwardedArgs, env) {
|
|
|
892
892
|
return proc.exited;
|
|
893
893
|
}
|
|
894
894
|
async function launchTuiWorkspace(args2) {
|
|
895
|
-
const { startTuiWorkspace } = await import("./readlineWorkspace-
|
|
895
|
+
const { startTuiWorkspace } = await import("./readlineWorkspace-TGCYJFEB.js");
|
|
896
896
|
const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-WFRWERGK.js");
|
|
897
897
|
return startTuiWorkspace({
|
|
898
898
|
...args2,
|