nolo-cli 0.252.0-alpha.2 → 0.253.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-RXHY2BDR.js → _executeModel-VUXEWLLQ.js} +29 -29
- package/{addContentAction-F4XO3VRF.js → addContentAction-MT4BECXT.js} +6 -6
- package/{addDialogAgentAction-NSCVHTZJ.js → addDialogAgentAction-ZZTJ5GBD.js} +5 -5
- package/{agentDeleteCommand-EJAI2VTH.js → agentDeleteCommand-SU5IKIW3.js} +41 -41
- package/{agentEmailCommands-YBKHZMMZ.js → agentEmailCommands-SHLVY627.js} +41 -41
- package/{agentListCommands-M2KYLAOB.js → agentListCommands-3NTMYMVI.js} +17 -17
- package/{agentMachineCommands-GLY6NJWZ.js → agentMachineCommands-MYXLAKQF.js} +13 -12
- package/{agentPullCommand-6OCNLVGC.js → agentPullCommand-2EYJ5ENC.js} +1 -1
- package/{agentRecordCommands-JANPX6XI.js → agentRecordCommands-EIZTKSWW.js} +41 -41
- package/{agentRunCommand-TNLAXLUU.js → agentRunCommand-RB3EIT4I.js} +41 -41
- package/{agentRunControl-KNNDEEDI.js → agentRunControl-5ABAIBQT.js} +2 -2
- package/{agentRuntimeLocal-EOW6FFXL.js → agentRuntimeLocal-IO3GGTCJ.js} +7 -7
- package/{agentSlice-PVFGBJXB.js → agentSlice-TQVS23WV.js} +6 -6
- package/{appDeleteCommands-3VCRRWUX.js → appDeleteCommands-ZQ4ZEKTC.js} +13 -12
- package/{appDeployCommands-XN6IEMYK.js → appDeployCommands-4XT7PFW5.js} +13 -12
- package/{appDeployStatusCommands-ZSJJXMVR.js → appDeployStatusCommands-5RVMRYQW.js} +13 -12
- package/{appGetCommands-DJ7YQCEE.js → appGetCommands-VH5W3RFK.js} +13 -12
- package/{appListCommands-4KU5CV5H.js → appListCommands-TAHZLAL3.js} +13 -12
- package/{authCommand-5DC3ES4Q.js → authCommand-HBO5G6RL.js} +3 -3
- package/{authCommands-BLXNAUF4.js → authCommands-T5FODCEG.js} +2 -2
- package/{builtinSkillRegistry-PQWEXSFW.js → builtinSkillRegistry-66PEOD4Y.js} +1 -1
- package/{chunk-25GCVHBZ.js → chunk-25BDZGD7.js} +1 -1
- package/{chunk-2HF6DINU.js → chunk-2BJ53346.js} +6 -6
- package/{chunk-VZWYP7LD.js → chunk-2RCMFPUZ.js} +2 -2
- package/{chunk-OQOXDQLB.js → chunk-2VYX3ZCR.js} +3 -3
- package/{chunk-UDQZ5JT7.js → chunk-3SEBCWLD.js} +17394 -17306
- package/{chunk-NWZRCUHM.js → chunk-4AFKLWZP.js} +101 -192
- package/{chunk-GUFTHWDO.js → chunk-4BQ5QKIG.js} +9 -9
- package/{chunk-YWLMUFZ5.js → chunk-4GWNEPY6.js} +1 -1
- package/{chunk-GJ4UTSAW.js → chunk-53UOBNTI.js} +4 -4
- package/{chunk-5QEOTC35.js → chunk-6AJIU6OC.js} +1 -1
- package/{chunk-NRWZHHOB.js → chunk-7STRX24O.js} +4 -4
- package/chunk-AIHNB5QH.js +1394 -0
- package/{chunk-BVCCRSGK.js → chunk-ANQ544EU.js} +5 -5
- package/{chunk-UTFTXJU3.js → chunk-CF7U32BX.js} +3 -3
- package/{chunk-MOAVLCCM.js → chunk-CMYZT2XN.js} +3 -3
- package/{chunk-U3ZK2MXG.js → chunk-CUQNRU4X.js} +3 -3
- package/{chunk-EQJK6LSN.js → chunk-D4CUS6NT.js} +3 -3
- package/{chunk-SBBSUBY3.js → chunk-DNY33GGQ.js} +1 -1
- package/{chunk-J4KLOLYP.js → chunk-FZSGYLFV.js} +3 -3
- package/{chunk-N2ZAY2DK.js → chunk-GFXPPQZN.js} +1 -1
- package/{chunk-BTQU2PRC.js → chunk-GK772DEV.js} +1 -1
- package/{chunk-N7UXTVAR.js → chunk-HEQJ5XND.js} +1 -1
- package/{chunk-BLBGVSLB.js → chunk-HEUHCHAR.js} +5 -5
- package/{chunk-EFM2IPZR.js → chunk-HQUGB2HM.js} +1 -1
- package/{chunk-WNIBQBOR.js → chunk-HS4JGZQH.js} +1 -1
- package/{chunk-NMXGIRSG.js → chunk-HSBHS6KT.js} +1 -1
- package/{chunk-N2MDL5AZ.js → chunk-IRORRPH2.js} +9 -9
- package/{chunk-7RYODZDD.js → chunk-J55F3IEZ.js} +1 -1
- package/chunk-JJABK3QO.js +321 -0
- package/{chunk-64ACTEAE.js → chunk-JKO32CCL.js} +1 -1
- package/{chunk-LUPZLKXL.js → chunk-JLZJL3WC.js} +31 -3
- package/{chunk-ZMXO5G3E.js → chunk-K4LLTJUO.js} +4 -2
- package/{chunk-MDWHMQON.js → chunk-M7GMJBQJ.js} +1 -1
- package/{chunk-FJPVVLP3.js → chunk-MARF3TN2.js} +4 -4
- package/{chunk-KO6JNZCF.js → chunk-MPOUZIF4.js} +21 -8
- package/{chunk-WJOC3AEM.js → chunk-MRYKRL2V.js} +1 -1
- package/{chunk-Z47UZT27.js → chunk-NMGG3NUB.js} +1 -1
- package/{chunk-EPBEZKYK.js → chunk-O3WZMJAN.js} +2 -2
- package/{chunk-3LL5HRIJ.js → chunk-OLS2J3WE.js} +1 -1
- package/{chunk-HZD5HXUO.js → chunk-OQFOE4SJ.js} +1 -1
- package/{chunk-VH7AQEEF.js → chunk-OWXOXKH7.js} +2 -2
- package/{chunk-7XO73H5X.js → chunk-P4JX7YMQ.js} +1 -1
- package/{chunk-Q5M27DUE.js → chunk-PR25J652.js} +1 -1
- package/{chunk-JX2IG37T.js → chunk-PTY2VZM5.js} +1 -1
- package/{chunk-OTNPEE4G.js → chunk-SID2TFMV.js} +87 -63
- package/{chunk-26KL6533.js → chunk-TI2JIXK4.js} +18 -18
- package/{chunk-NJDOID7N.js → chunk-TOHMK27J.js} +24 -26
- package/{chunk-F6GZFIGR.js → chunk-UHTT23PH.js} +14 -14
- package/{chunk-IQXMWBI6.js → chunk-UMI4NNZP.js} +2 -2
- package/{chunk-CSTCYYCR.js → chunk-VKAITWPC.js} +9 -9
- package/{chunk-UGHNYYOE.js → chunk-VPSPVLCM.js} +2 -2
- package/{chunk-OTOPQXP5.js → chunk-XWR2YD4L.js} +1 -1
- package/{chunk-K7RWY7JH.js → chunk-YQYSQUP3.js} +7 -7
- package/{chunk-ZMWDHPNG.js → chunk-Z2ZCKNKX.js} +1 -5
- package/{chunk-SSZHE2RK.js → chunk-ZYPXOQS2.js} +1 -1
- package/{cliAuthorityBrokerProcess-IUCB4XA6.js → cliAuthorityBrokerProcess-5ZFBTHLB.js} +1 -1
- package/{cliLocalAgentRecordReader-OHAC4JTY.js → cliLocalAgentRecordReader-2WBUVRVD.js} +9 -9
- package/{commandRegistry-YQMAXCLP.js → commandRegistry-JDCGWIWD.js} +61 -132
- package/{contentThunks-GSMUNWBA.js → contentThunks-B6BY7GS3.js} +11 -11
- package/{createAgentAutomationAction-RMADR4LG.js → createAgentAutomationAction-TQ6IA5SV.js} +11 -11
- package/{createDialogAction-CM5CBQVH.js → createDialogAction-QKMGD2TS.js} +12 -12
- package/{createPageAction-JMGVMCTH.js → createPageAction-7EEVGWGG.js} +12 -12
- package/{dbSlice-Q637QR4L.js → dbSlice-HXFRXGI3.js} +5 -5
- package/{deleteFile-TP6MKFUX.js → deleteFile-QDSZVTUJ.js} +3 -3
- package/{dialogCommands-ULWP5ASX.js → dialogCommands-MEH4CVRL.js} +17 -16
- package/{dialogSlice-ARQKXXTD.js → dialogSlice-6WIME53P.js} +9 -9
- package/{dialogUsageCommand-IHAXS7DW.js → dialogUsageCommand-3JMINURR.js} +1 -1
- package/{docCreateCommands-ZJFHCZV4.js → docCreateCommands-MVAYVGQ5.js} +12 -11
- package/{docDeleteCommands-LY5MF2BI.js → docDeleteCommands-TKXPRA3O.js} +13 -12
- package/{docReadCommands-4X2DHCNZ.js → docReadCommands-MR2YKCZP.js} +12 -11
- package/{docStore-QWRVKIRI.js → docStore-VEHQHXRM.js} +6 -6
- package/{docUpdateCommands-5TIT7DAJ.js → docUpdateCommands-VJ6A6F7F.js} +12 -11
- package/{handleSendMessageAction-TVR55KVT.js → handleSendMessageAction-X5LGNJX5.js} +22 -22
- package/{hostCredentialCreate-SIRXPUFR.js → hostCredentialCreate-AQYSWUKA.js} +41 -41
- package/index.js +6 -6
- package/{localRuntimeAdapter-VRB5EDDZ.js → localRuntimeAdapter-FA4OGZGU.js} +39 -39
- package/{localRuntimeAuthority-QKWTPBQQ.js → localRuntimeAuthority-UF2DAQ3F.js} +2 -2
- package/{localRuntimeDb-3CIC4SKC.js → localRuntimeDb-ZJFGNHML.js} +1 -1
- package/{machineCommands-MG3BB6XM.js → machineCommands-VKU6MAFA.js} +40 -40
- package/{machineWsRunDispatch-3TOO3NCU.js → machineWsRunDispatch-XQQHHOX4.js} +40 -40
- package/{mcpLocalAuthorizeCommand-LO7E4VQ5.js → mcpLocalAuthorizeCommand-Y3SOZFXT.js} +3 -3
- package/{memberThunks-IGYRMEQC.js → memberThunks-ZXEUM6DH.js} +7 -7
- package/package.json +1 -1
- package/{projectArchive-Q46BYZQ6.js → projectArchive-674NJOYI.js} +12 -12
- package/{read-MPPXZHAO.js → read-T5WPCAY7.js} +3 -3
- package/{readDocTool-PKZ35PCR.js → readDocTool-DW4DCRQG.js} +1 -1
- package/{readlineWorkspace-RBH6PSE7.js → readlineWorkspace-HFPEDOHN.js} +53 -71
- package/{removeDialogAgentAction-H6S7VLNA.js → removeDialogAgentAction-MXJEB77K.js} +6 -6
- package/{runAgentClientLoop-WZJ4HXOH.js → runAgentClientLoop-NU3JNHSH.js} +27 -27
- package/{runtimeDoctorCommands-QGZSKNSE.js → runtimeDoctorCommands-V3M3JTUV.js} +2 -2
- package/{setDialogExtraReferencesAction-CARUTAWS.js → setDialogExtraReferencesAction-BILVMHM7.js} +6 -6
- package/{setPrimaryDialogAgentAction-VRV56MLG.js → setPrimaryDialogAgentAction-CUBBWACR.js} +6 -6
- package/{settingThunks-4FC4HXGN.js → settingThunks-BRBBAGEK.js} +5 -5
- package/{spaceCommands-27Z5JAU3.js → spaceCommands-K4HHG7OO.js} +12 -11
- package/{streamAgentChatTurn-JKMBFM2O.js → streamAgentChatTurn-7FDXIRMB.js} +35 -35
- package/{switchDialogAgentAction-O236K6HB.js → switchDialogAgentAction-SSI2CSNE.js} +5 -5
- package/{tools-4RFLNHUW.js → tools-GC45557U.js} +23 -23
- package/{tuiRestart-GF4DGAAN.js → tuiRestart-7IKI6JZK.js} +3 -3
- package/{updateDialogTitleAction-F3ONQM3N.js → updateDialogTitleAction-OAC5MWMS.js} +11 -11
- package/{usageCommand-XVJ7ZUTM.js → usageCommand-HVCMX7BG.js} +2 -2
- package/{usageRebuildCommand-NK6S3D4J.js → usageRebuildCommand-VMPIZ2ME.js} +2 -2
- package/chunk-CGSIW2KI.js +0 -594
- package/chunk-HF4C5WIU.js +0 -980
- package/chunk-U5LOKQ2R.js +0 -176
- package/{chunk-REINTCQF.js → chunk-4CL6QIQZ.js} +3 -3
- package/{chunk-5BRVDQTX.js → chunk-KWARDHBI.js} +7 -7
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
upsertSSREntity,
|
|
3
3
|
write
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-53UOBNTI.js";
|
|
5
5
|
import {
|
|
6
6
|
getRuntimeServerContext,
|
|
7
7
|
resolveRecordAuthority
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4CL6QIQZ.js";
|
|
9
9
|
import {
|
|
10
10
|
TIMEOUT,
|
|
11
11
|
asyncThunkCreator,
|
|
@@ -471,7 +471,7 @@ var slice = createSliceWithThunks({
|
|
|
471
471
|
const overrides = {};
|
|
472
472
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
473
473
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
474
|
-
const { _executeModel } = await import("./_executeModel-
|
|
474
|
+
const { _executeModel } = await import("./_executeModel-VUXEWLLQ.js");
|
|
475
475
|
return _executeModel(
|
|
476
476
|
{
|
|
477
477
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -492,7 +492,7 @@ var slice = createSliceWithThunks({
|
|
|
492
492
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
493
493
|
*/
|
|
494
494
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
495
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
495
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-NU3JNHSH.js");
|
|
496
496
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
497
497
|
{
|
|
498
498
|
agentKey: args.agentKey,
|
|
@@ -508,7 +508,7 @@ var slice = createSliceWithThunks({
|
|
|
508
508
|
* 聊天轮次流式 Agent 调用
|
|
509
509
|
*/
|
|
510
510
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
511
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
511
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-7FDXIRMB.js");
|
|
512
512
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
513
513
|
}),
|
|
514
514
|
/**
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-P27E22MA.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZYPXOQS2.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliLocalRuntimePreparedAgentCache
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TOHMK27J.js";
|
|
10
10
|
import {
|
|
11
11
|
readCredentialAvailability
|
|
12
12
|
} from "./chunk-GIXWVN2W.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveAgentRecordFromHybridStore,
|
|
26
26
|
sanitizeAgentRecordForCliOutput,
|
|
27
27
|
writeAgentRecord
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-D4CUS6NT.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveCliAgentKeyInput
|
|
31
31
|
} from "./chunk-BR3GT6MR.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQYSQUP3.js";
|
|
4
4
|
import {
|
|
5
5
|
prepareAndPersistMessage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TI2JIXK4.js";
|
|
7
7
|
import {
|
|
8
8
|
require_format
|
|
9
9
|
} from "./chunk-BUDVRYES.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
removeCachedEntity,
|
|
17
17
|
upsertSSREntity,
|
|
18
18
|
write
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-53UOBNTI.js";
|
|
20
20
|
import {
|
|
21
21
|
isDevelopment
|
|
22
22
|
} from "./chunk-VYRTLHIT.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
patch,
|
|
6
6
|
readAndWait
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-53UOBNTI.js";
|
|
8
8
|
import {
|
|
9
9
|
require_react
|
|
10
10
|
} from "./chunk-RD3QLZQV.js";
|
|
@@ -335,7 +335,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
335
335
|
).unwrap();
|
|
336
336
|
if (dbSpaceId) {
|
|
337
337
|
try {
|
|
338
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
338
|
+
const { updateContentTitle } = await import("./contentThunks-B6BY7GS3.js");
|
|
339
339
|
await dispatch(
|
|
340
340
|
updateContentTitle({
|
|
341
341
|
spaceId: dbSpaceId,
|
|
@@ -378,7 +378,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
async function createDocState(args, thunkApi) {
|
|
381
|
-
const { createPageAction } = await import("./createPageAction-
|
|
381
|
+
const { createPageAction } = await import("./createPageAction-7EEVGWGG.js");
|
|
382
382
|
return createPageAction(args, thunkApi);
|
|
383
383
|
}
|
|
384
384
|
function subscribe(listener) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultReasoningEffort
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AIHNB5QH.js";
|
|
4
4
|
import {
|
|
5
5
|
buildLocalAgentLookupKeys,
|
|
6
6
|
shouldReadAgentKeyRemotely
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JKO32CCL.js";
|
|
8
8
|
import {
|
|
9
9
|
createHostCredentialBrokerChain,
|
|
10
10
|
createStrictHostCredentialBroker
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
formatInvalidAgentSkillModeMessage,
|
|
15
15
|
formatInvalidAgentSkillModesFieldMessage,
|
|
16
16
|
isAgentSkillModesFieldShapeValid
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PTY2VZM5.js";
|
|
18
18
|
import {
|
|
19
19
|
buildAgentApiKeyCredentialRef,
|
|
20
20
|
migrateAgentSecrets
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TOHMK27J.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4BQ5QKIG.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3SEBCWLD.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveLocalRuntimeEnvFromPolicy
|
|
13
13
|
} from "./chunk-USGHJSGO.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deriveCredentialGroup
|
|
3
|
-
} from "./chunk-HF4C5WIU.js";
|
|
4
1
|
import {
|
|
5
2
|
listUserRecordsFromServers,
|
|
6
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4GWNEPY6.js";
|
|
8
5
|
import {
|
|
9
6
|
agentRecordHasConfiguredCredential
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D4CUS6NT.js";
|
|
8
|
+
import {
|
|
9
|
+
deriveCredentialGroup
|
|
10
|
+
} from "./chunk-AIHNB5QH.js";
|
|
11
11
|
import {
|
|
12
12
|
isTombstoneRecord
|
|
13
13
|
} from "./chunk-BV3FLP2L.js";
|
|
@@ -3,29 +3,29 @@ import {
|
|
|
3
3
|
mergeReferences,
|
|
4
4
|
resolveReferenceAssets,
|
|
5
5
|
resolveToolsFromKeys
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2BJ53346.js";
|
|
7
7
|
import {
|
|
8
8
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
9
9
|
getAllToolRuns,
|
|
10
10
|
parseUiCard,
|
|
11
11
|
uiCardFallback
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4BQ5QKIG.js";
|
|
13
13
|
import {
|
|
14
14
|
getDocState
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CUQNRU4X.js";
|
|
16
16
|
import {
|
|
17
17
|
getTableState
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YQYSQUP3.js";
|
|
19
19
|
import {
|
|
20
20
|
selectAllMsgs
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TI2JIXK4.js";
|
|
22
22
|
import {
|
|
23
23
|
getCurrentSpaceIdRaw,
|
|
24
24
|
getViewMode
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DNY33GGQ.js";
|
|
26
26
|
import {
|
|
27
27
|
selectById
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-53UOBNTI.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveToolBaseUrl
|
|
31
31
|
} from "./chunk-KQHEGELM.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
projectToolMessageContent,
|
|
42
42
|
resolveAgentRecommendedSkillNames,
|
|
43
43
|
resolveAgentRequiredPackIds
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-PTY2VZM5.js";
|
|
45
45
|
import {
|
|
46
46
|
attachmentKind,
|
|
47
47
|
extractReferenceKeysFromMessage,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
expandEnabledPackPromptPatches,
|
|
64
64
|
expandEnabledPacks,
|
|
65
65
|
resolveEffectiveEnabledPacks
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-Z2ZCKNKX.js";
|
|
67
67
|
import {
|
|
68
68
|
metaKey
|
|
69
69
|
} from "./chunk-SYTHYBMI.js";
|
|
@@ -14,7 +14,7 @@ function buildCliLocalRuntimeDbEnv(env = process.env) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
async function getDefaultCliLocalRuntimeDb(options = {}) {
|
|
17
|
-
const { getDefaultCliLocalRuntimeDb: getAuthorityBackedDb } = await import("./localRuntimeAuthority-
|
|
17
|
+
const { getDefaultCliLocalRuntimeDb: getAuthorityBackedDb } = await import("./localRuntimeAuthority-UF2DAQ3F.js");
|
|
18
18
|
return getAuthorityBackedDb(options);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import {
|
|
2
|
+
omitNullishAgentSummaryFields,
|
|
3
|
+
promoteSharedCredentialGroupQuota,
|
|
4
|
+
sortSafeAgentSummaries,
|
|
5
|
+
summarizeCredentialGroups,
|
|
6
|
+
toCompactAgentSummary,
|
|
7
|
+
toSafeAgentSummary,
|
|
8
|
+
toUltraCompactAgentSummary
|
|
9
|
+
} from "./chunk-AIHNB5QH.js";
|
|
10
|
+
import {
|
|
11
|
+
DISPATCH_TIER_RANK,
|
|
12
|
+
resolveAgentSelectionPriority,
|
|
13
|
+
resolveModelTier
|
|
14
|
+
} from "./chunk-K4LLTJUO.js";
|
|
15
|
+
import {
|
|
16
|
+
DEFAULT_PROVIDER_RETRY_MS,
|
|
17
|
+
isAgentUnavailableNow,
|
|
18
|
+
isSubscriptionPeriodWindow,
|
|
19
|
+
resolveAgentAvailability
|
|
20
|
+
} from "./chunk-LS5KAVFQ.js";
|
|
21
|
+
|
|
22
|
+
// packages/ai/agent/agentDiscovery.ts
|
|
23
|
+
function isPreferredAgent(agent) {
|
|
24
|
+
return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
|
|
25
|
+
}
|
|
26
|
+
function isPublicDiscoveryAgent(agent) {
|
|
27
|
+
return agent.isPublic === true && !isPreferredAgent(agent);
|
|
28
|
+
}
|
|
29
|
+
function resolveDiscoveryScope(args) {
|
|
30
|
+
const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
|
|
31
|
+
const hasScope = rawScope !== void 0 && rawScope !== "";
|
|
32
|
+
const hasPublicOnly = typeof args?.publicOnly === "boolean";
|
|
33
|
+
const publicOnly = args?.publicOnly === true;
|
|
34
|
+
if (hasScope) {
|
|
35
|
+
if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
|
|
36
|
+
throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
|
|
37
|
+
}
|
|
38
|
+
const scope = rawScope;
|
|
39
|
+
if (hasPublicOnly) {
|
|
40
|
+
if (publicOnly && scope !== "public") {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
if (!publicOnly && scope === "public") {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return scope;
|
|
52
|
+
}
|
|
53
|
+
if (hasPublicOnly && publicOnly) {
|
|
54
|
+
return "public";
|
|
55
|
+
}
|
|
56
|
+
return "all";
|
|
57
|
+
}
|
|
58
|
+
function agentIdentityKeys(agent) {
|
|
59
|
+
return [agent.agentKey, agent.publicKey, agent.id].filter(
|
|
60
|
+
(key) => typeof key === "string" && key.length > 0
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function deduplicateAgentSummaries(agents) {
|
|
64
|
+
const byIdentity = /* @__PURE__ */ new Map();
|
|
65
|
+
for (const agent of agents) {
|
|
66
|
+
const keys = agentIdentityKeys(agent);
|
|
67
|
+
const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
|
|
68
|
+
if (!existing) {
|
|
69
|
+
for (const key of keys) byIdentity.set(key, agent);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
|
|
73
|
+
for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
|
|
74
|
+
}
|
|
75
|
+
return [...new Set(byIdentity.values())];
|
|
76
|
+
}
|
|
77
|
+
function filterAgentsByScope(agents, scope) {
|
|
78
|
+
const unique = deduplicateAgentSummaries(agents);
|
|
79
|
+
if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
|
|
80
|
+
if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
|
|
81
|
+
return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
|
|
82
|
+
}
|
|
83
|
+
function recommendPlanning(agents, caller, poolComplete) {
|
|
84
|
+
const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
|
|
85
|
+
const current = callerKey ? agents.find((a) => a.agentKey === callerKey) : void 0;
|
|
86
|
+
const currentTier = callerKey ? resolveModelTier(caller?.effectiveModel ?? current?.model) : "unknown";
|
|
87
|
+
const base = {
|
|
88
|
+
condition: "when_planning_needed_and_candidate_suitable",
|
|
89
|
+
action: "self",
|
|
90
|
+
currentTier,
|
|
91
|
+
poolComplete,
|
|
92
|
+
requiresPaidApproval: false
|
|
93
|
+
};
|
|
94
|
+
if (caller?.runKind === "subtask") return { ...base, reason: "bounded_subtask" };
|
|
95
|
+
if (!callerKey) return { ...base, reason: "caller_unknown" };
|
|
96
|
+
if (currentTier === "unknown") return { ...base, reason: "caller_tier_unknown" };
|
|
97
|
+
if (!poolComplete) return { ...base, reason: "pool_incomplete" };
|
|
98
|
+
const higher = agents.filter((a) => a.agentKey && a.agentKey !== callerKey && a.modelTier !== "unknown" && DISPATCH_TIER_RANK[a.modelTier] > DISPATCH_TIER_RANK[currentTier]);
|
|
99
|
+
const free = higher.filter((a) => a.requiresPaidApproval === false);
|
|
100
|
+
free.sort((a, b) => DISPATCH_TIER_RANK[b.modelTier] - DISPATCH_TIER_RANK[a.modelTier]);
|
|
101
|
+
const best = free[0];
|
|
102
|
+
if (best) return {
|
|
103
|
+
...base,
|
|
104
|
+
action: "delegate",
|
|
105
|
+
reason: "higher_suitable_agent",
|
|
106
|
+
agentKey: best.agentKey,
|
|
107
|
+
recommendedTier: best.modelTier
|
|
108
|
+
};
|
|
109
|
+
if (higher.length) return { ...base, reason: "paid_approval_required", requiresPaidApproval: true };
|
|
110
|
+
return { ...base, reason: "no_higher_suitable_agent" };
|
|
111
|
+
}
|
|
112
|
+
function resolvePaginationArgs(args) {
|
|
113
|
+
let limit;
|
|
114
|
+
let offset;
|
|
115
|
+
if (args?.limit !== void 0 && args?.limit !== null) {
|
|
116
|
+
const raw = args.limit;
|
|
117
|
+
if (typeof raw === "boolean") {
|
|
118
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
119
|
+
}
|
|
120
|
+
if (typeof raw === "number") {
|
|
121
|
+
if (!Number.isInteger(raw) || raw <= 0) {
|
|
122
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
123
|
+
}
|
|
124
|
+
limit = Math.min(raw, 500);
|
|
125
|
+
} else if (typeof raw === "string") {
|
|
126
|
+
if (raw.trim() !== "") {
|
|
127
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
128
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
129
|
+
}
|
|
130
|
+
const parsed = Number(raw.trim());
|
|
131
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
132
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
133
|
+
}
|
|
134
|
+
limit = Math.min(parsed, 500);
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
throw new Error(`Invalid limit '${String(raw)}': must be a positive integer.`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (args?.offset !== void 0 && args?.offset !== null) {
|
|
141
|
+
const raw = args.offset;
|
|
142
|
+
if (typeof raw === "boolean") {
|
|
143
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
144
|
+
}
|
|
145
|
+
if (typeof raw === "number") {
|
|
146
|
+
if (!Number.isInteger(raw) || raw < 0) {
|
|
147
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
148
|
+
}
|
|
149
|
+
offset = raw;
|
|
150
|
+
} else if (typeof raw === "string") {
|
|
151
|
+
if (raw.trim() !== "") {
|
|
152
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
153
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
154
|
+
}
|
|
155
|
+
const parsed = Number(raw.trim());
|
|
156
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
157
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
158
|
+
}
|
|
159
|
+
offset = parsed;
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
throw new Error(`Invalid offset '${String(raw)}': must be a non-negative integer.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return { limit, offset };
|
|
166
|
+
}
|
|
167
|
+
function matchesAgentQuery(agent, query) {
|
|
168
|
+
if (!query || typeof query !== "string") return true;
|
|
169
|
+
const q = query.trim().toLowerCase();
|
|
170
|
+
if (!q) return true;
|
|
171
|
+
const candidates = [
|
|
172
|
+
agent.name,
|
|
173
|
+
agent.model,
|
|
174
|
+
agent.provider,
|
|
175
|
+
agent.handle,
|
|
176
|
+
agent.agentKey,
|
|
177
|
+
agent.publicKey,
|
|
178
|
+
agent.id
|
|
179
|
+
];
|
|
180
|
+
return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
|
|
181
|
+
}
|
|
182
|
+
function nearestFundedSubscriptionReset(agent, now) {
|
|
183
|
+
let nearest = Infinity;
|
|
184
|
+
if (agent.billingSource !== "user_subscription") return nearest;
|
|
185
|
+
for (const window of agent.quota?.windows ?? []) {
|
|
186
|
+
const { resetAt, remaining, utilization } = window;
|
|
187
|
+
if (typeof resetAt === "number" && resetAt > now && resetAt < nearest && isSubscriptionPeriodWindow(window) && (typeof remaining === "number" && remaining > 0 || typeof utilization === "number" && utilization < 0.95)) {
|
|
188
|
+
nearest = resetAt;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return nearest;
|
|
192
|
+
}
|
|
193
|
+
function meteredUnitPrice(agent) {
|
|
194
|
+
if (agent.billingSource === "user_subscription" || agent.billingSource === "owner_subscription") return Infinity;
|
|
195
|
+
const input = agent.inputPrice !== null && Number.isFinite(agent.inputPrice) ? agent.inputPrice : 0;
|
|
196
|
+
const output = agent.outputPrice !== null && Number.isFinite(agent.outputPrice) ? agent.outputPrice : 0;
|
|
197
|
+
return input > 0 || output > 0 ? input + output : Infinity;
|
|
198
|
+
}
|
|
199
|
+
function buildAgentDiscoveryResult(options) {
|
|
200
|
+
const scope = resolveDiscoveryScope({
|
|
201
|
+
scope: options.scope,
|
|
202
|
+
publicOnly: options.publicOnly
|
|
203
|
+
});
|
|
204
|
+
const now = options.now ?? Date.now();
|
|
205
|
+
let scopedAgents = filterAgentsByScope(options.agents, scope);
|
|
206
|
+
if (options.query && typeof options.query === "string" && options.query.trim()) {
|
|
207
|
+
scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
|
|
208
|
+
}
|
|
209
|
+
scopedAgents = scopedAgents.map((agent) => {
|
|
210
|
+
const decision = resolveAgentAvailability(agent, now);
|
|
211
|
+
if (decision.status === "quota_exhausted") {
|
|
212
|
+
const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
|
|
213
|
+
const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
|
|
214
|
+
return {
|
|
215
|
+
...agent,
|
|
216
|
+
nextAvailableAt,
|
|
217
|
+
availableAt: nextAvailableAt,
|
|
218
|
+
availabilityStatus: decision.status,
|
|
219
|
+
availabilityReason: decision.reason
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
...agent,
|
|
224
|
+
availabilityStatus: decision.status,
|
|
225
|
+
availabilityReason: decision.reason
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
const unavailableCount = scopedAgents.filter((a) => isAgentUnavailableNow(a, now)).length;
|
|
229
|
+
const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
|
|
230
|
+
const pagination = resolvePaginationArgs({
|
|
231
|
+
limit: options.limit,
|
|
232
|
+
offset: options.offset
|
|
233
|
+
});
|
|
234
|
+
const offset = pagination.offset;
|
|
235
|
+
const limit = pagination.limit;
|
|
236
|
+
const sortedAgents = sortSafeAgentSummaries(scopedAgents);
|
|
237
|
+
const hasQuery = Boolean(options.query && typeof options.query === "string" && options.query.trim());
|
|
238
|
+
const hasFilteredCandidates = sortedAgents.length < options.agents.length;
|
|
239
|
+
let total;
|
|
240
|
+
if (hasQuery) {
|
|
241
|
+
total = sortedAgents.length;
|
|
242
|
+
} else if (hasFilteredCandidates) {
|
|
243
|
+
total = sortedAgents.length;
|
|
244
|
+
} else if (scope === "public") {
|
|
245
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
246
|
+
} else if (scope === "all") {
|
|
247
|
+
const privateOnlyCount = scopedAgents.filter((a) => isPreferredAgent(a) && a.isPublic !== true).length;
|
|
248
|
+
const publicPulledCount = scopedAgents.filter((a) => a.isPublic === true).length;
|
|
249
|
+
const effectivePublicTotal = typeof options.upstreamTotal === "number" && options.upstreamTotal > publicPulledCount ? options.upstreamTotal : publicPulledCount;
|
|
250
|
+
total = options.upstreamTruncated === true ? privateOnlyCount + effectivePublicTotal : sortedAgents.length;
|
|
251
|
+
} else {
|
|
252
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
253
|
+
}
|
|
254
|
+
const isTruncated = options.upstreamTruncated === true || !hasQuery && !hasFilteredCandidates && typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length;
|
|
255
|
+
const pagedAgents = typeof limit === "number" || typeof offset === "number" ? sortedAgents.slice(
|
|
256
|
+
offset ?? 0,
|
|
257
|
+
(offset ?? 0) + (limit ?? sortedAgents.length)
|
|
258
|
+
) : sortedAgents;
|
|
259
|
+
const projectedAgents = options.verbose === true ? pagedAgents.map(omitNullishAgentSummaryFields) : options.compact === true ? pagedAgents.map(toUltraCompactAgentSummary) : pagedAgents.map(toCompactAgentSummary);
|
|
260
|
+
const compacted = options.compact === true && options.verbose !== true ? promoteSharedCredentialGroupQuota(
|
|
261
|
+
projectedAgents,
|
|
262
|
+
credentialGroups
|
|
263
|
+
) : { agents: projectedAgents, groups: credentialGroups };
|
|
264
|
+
const tierHints = {};
|
|
265
|
+
const tierHintPreferences = /* @__PURE__ */ new Map();
|
|
266
|
+
for (const agent of sortedAgents) {
|
|
267
|
+
const { agentKey, name, model, modelTier, requiresPaidApproval, availabilityStatus } = agent;
|
|
268
|
+
if (!agentKey || requiresPaidApproval !== false || modelTier === "unknown" || availabilityStatus === "quota_exhausted" || availabilityStatus === "rate_limited") continue;
|
|
269
|
+
const priority = resolveAgentSelectionPriority(agent);
|
|
270
|
+
const current = tierHintPreferences.get(modelTier);
|
|
271
|
+
if (current && current.priority !== priority) continue;
|
|
272
|
+
const resetAt = nearestFundedSubscriptionReset(agent, now);
|
|
273
|
+
const price = resetAt === Infinity ? meteredUnitPrice(agent) : Infinity;
|
|
274
|
+
if (current && (resetAt > current.resetAt || resetAt === current.resetAt && price >= current.price)) continue;
|
|
275
|
+
tierHintPreferences.set(modelTier, { priority, resetAt, price });
|
|
276
|
+
tierHints[modelTier] = { agentKey, name, model };
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
total,
|
|
280
|
+
...typeof offset === "number" ? { offset } : {},
|
|
281
|
+
...typeof limit === "number" ? { limit } : {},
|
|
282
|
+
...isTruncated ? { truncated: true } : {},
|
|
283
|
+
unavailableCount,
|
|
284
|
+
availableCount: sortedAgents.length,
|
|
285
|
+
agents: compacted.agents,
|
|
286
|
+
planningRecommendation: recommendPlanning(
|
|
287
|
+
sortedAgents,
|
|
288
|
+
options.caller,
|
|
289
|
+
!isTruncated && scope === "all" && !hasQuery && !options.poolRestricted
|
|
290
|
+
),
|
|
291
|
+
...Object.keys(tierHints).length > 0 ? { tierHints } : {},
|
|
292
|
+
credentialGroups: compacted.groups
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function toDiscoverySafeAgentSummary(record2, options) {
|
|
296
|
+
const mergedOptions = record2?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
|
|
297
|
+
return toSafeAgentSummary(record2, mergedOptions);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// packages/ai/agent/dispatchSpeedProvenance.ts
|
|
301
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
302
|
+
function isServerDispatchSpeedSource(value, dialogId, userId) {
|
|
303
|
+
const dialog = record(value);
|
|
304
|
+
const proof = record(dialog.dispatchSpeedProvenance);
|
|
305
|
+
return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
|
|
306
|
+
}
|
|
307
|
+
function isLocalDispatchSpeedSource(value, dialogId, userId) {
|
|
308
|
+
const run = record(value);
|
|
309
|
+
const proof = record(run.dispatchSpeedProvenance);
|
|
310
|
+
return proof.version === 1 && proof.source === "cli-startAgentRun" && proof.userId === userId && typeof run.runId === "string" && run.runId.length > 0 && run.dialogId === dialogId && run.ephemeral !== true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export {
|
|
314
|
+
resolveDiscoveryScope,
|
|
315
|
+
resolvePaginationArgs,
|
|
316
|
+
matchesAgentQuery,
|
|
317
|
+
buildAgentDiscoveryResult,
|
|
318
|
+
toDiscoverySafeAgentSummary,
|
|
319
|
+
isServerDispatchSpeedSource,
|
|
320
|
+
isLocalDispatchSpeedSource
|
|
321
|
+
};
|