nolo-cli 0.251.0-alpha.1 → 0.252.0-alpha.2
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-55PHWQWB.js → _executeModel-RXHY2BDR.js} +47 -47
- package/{action-WZTKEF5H.js → action-4MADDU52.js} +5 -5
- package/{addContentAction-LBVAQUF7.js → addContentAction-F4XO3VRF.js} +8 -8
- package/{addDialogAgentAction-6WAUSUSZ.js → addDialogAgentAction-NSCVHTZJ.js} +7 -7
- package/{agentDeleteCommand-KEO3KDK3.js → agentDeleteCommand-EJAI2VTH.js} +69 -68
- package/{agentEmailCommands-RWJQQRNT.js → agentEmailCommands-YBKHZMMZ.js} +69 -68
- package/{agentListCommands-L3TLPLNH.js → agentListCommands-M2KYLAOB.js} +226 -39
- package/{agentMachineCommands-EZWWXWDH.js → agentMachineCommands-GLY6NJWZ.js} +31 -29
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentRecordCommands-7W2CGHJJ.js → agentRecordCommands-JANPX6XI.js} +68 -67
- package/{agentRunCommand-POL6B6BO.js → agentRunCommand-TNLAXLUU.js} +68 -67
- package/{agentRunControl-FKSXBUAF.js → agentRunControl-KNNDEEDI.js} +8 -6
- package/{agentRuntimeLocal-WSHWNIMF.js → agentRuntimeLocal-EOW6FFXL.js} +26 -25
- package/{agentSlice-3G2YLTA4.js → agentSlice-PVFGBJXB.js} +8 -8
- package/{appDeleteCommands-DZZQCVYH.js → appDeleteCommands-3VCRRWUX.js} +33 -31
- package/{appDeployCommands-NJJBVNH5.js → appDeployCommands-XN6IEMYK.js} +33 -31
- package/{appDeployStatusCommands-GBOAFEYG.js → appDeployStatusCommands-ZSJJXMVR.js} +33 -31
- package/{appGetCommands-GOOKYMKO.js → appGetCommands-DJ7YQCEE.js} +33 -31
- package/{appListCommands-OBCGUG3S.js → appListCommands-4KU5CV5H.js} +33 -31
- package/{authCommand-77CRN332.js → authCommand-5DC3ES4Q.js} +12 -12
- package/{builtinSkillRegistry-PFTTFPWW.js → builtinSkillRegistry-PQWEXSFW.js} +1 -1
- package/{chromeOpsCommands-6RLEBBJJ.js → chromeOpsCommands-AA555ANS.js} +1 -1
- package/{chunk-LOXR4TQN.js → chunk-25GCVHBZ.js} +2 -2
- package/{chunk-A55E2OCP.js → chunk-26KL6533.js} +639 -125
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/{chunk-CUYFRVJF.js → chunk-2HF6DINU.js} +6 -6
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/{chunk-GMWZRXRM.js → chunk-3272HU62.js} +1 -1
- package/{chunk-43VT5PLM.js → chunk-3LL5HRIJ.js} +1 -1
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-T4V6C3J3.js → chunk-52M4RYVP.js} +1 -1
- package/{chunk-OQCAHPDQ.js → chunk-5QEOTC35.js} +4 -4
- package/{chunk-R7D5SRAZ.js → chunk-5UYDG6HP.js} +17 -0
- package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-UCMUXZJV.js → chunk-7XO73H5X.js} +111 -1
- package/{chunk-222CJNC2.js → chunk-BLBGVSLB.js} +3 -3
- package/{chunk-ZM5AZTQG.js → chunk-BTQU2PRC.js} +19 -7
- package/{chunk-QJ5YDTEF.js → chunk-BVCCRSGK.js} +42 -24
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/chunk-CGSIW2KI.js +594 -0
- package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
- package/{chunk-Q5KZ6F55.js → chunk-CSTCYYCR.js} +19 -17
- package/{chunk-D3E5MYXO.js → chunk-CYGFNMCH.js} +1 -1
- package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-MTS5DCL2.js → chunk-EG3JTV7H.js} +2 -2
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-D35TOEMM.js → chunk-EPBEZKYK.js} +137 -53
- package/{chunk-KJDN2YRH.js → chunk-EQJK6LSN.js} +4 -4
- package/{chunk-N3SEV3CG.js → chunk-F6GZFIGR.js} +79 -30
- package/{chunk-6UNJ6JGR.js → chunk-FJPVVLP3.js} +4 -4
- package/{chunk-L5HV76QT.js → chunk-FRC2DNTN.js} +1 -1
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-IFJ6OTI6.js → chunk-GJ4UTSAW.js} +33 -11
- package/{chunk-ZKKJZBNO.js → chunk-GUFTHWDO.js} +10 -10
- package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
- package/{chunk-W2N4OAKM.js → chunk-IQXMWBI6.js} +3 -3
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-PLS2MJVW.js → chunk-J4KLOLYP.js} +4 -4
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-CDIRKCPD.js → chunk-JX2IG37T.js} +153 -153
- package/{chunk-TGKAUEV3.js → chunk-K7RWY7JH.js} +14 -11
- package/{chunk-5IKKSJYX.js → chunk-KHYSFS3W.js} +76 -2
- package/{chunk-K5CIMK3R.js → chunk-KO6JNZCF.js} +115 -57
- package/{chunk-XJSEST7D.js → chunk-KQBGXCKM.js} +3 -3
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-HD5EKSLF.js → chunk-MDWHMQON.js} +3 -3
- package/{chunk-X337N4D6.js → chunk-MOAVLCCM.js} +4 -4
- package/{chunk-OARYOLF3.js → chunk-N2MDL5AZ.js} +12 -12
- package/{chunk-ZSRR6HCH.js → chunk-N2ZAY2DK.js} +1 -1
- package/{chunk-X3OZ655T.js → chunk-N7UXTVAR.js} +2 -2
- package/{chunk-KGOBJAWC.js → chunk-NJDOID7N.js} +207 -94
- package/{chunk-NTNX77FI.js → chunk-NRWZHHOB.js} +6 -6
- package/{chunk-3ZWJVKFB.js → chunk-NWZRCUHM.js} +84 -40
- package/{chunk-HQLCYPL4.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-IZWGO2ZS.js → chunk-OMIXG25B.js} +1 -1
- package/{chunk-CJ2BP6V7.js → chunk-OOV5JN25.js} +2 -2
- package/{chunk-3KWJPTVP.js → chunk-OQOXDQLB.js} +4 -4
- package/{chunk-LXKK7QFI.js → chunk-OTNPEE4G.js} +54 -24
- package/{chunk-LMMRWGGJ.js → chunk-OTOPQXP5.js} +2 -2
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
- package/{chunk-WZPG63Q4.js → chunk-PIVTQRX6.js} +43 -13
- package/{chunk-SLUZ6FBJ.js → chunk-Q5M27DUE.js} +1 -1
- package/{chunk-XC5RPSXK.js → chunk-QV32GSVO.js} +2 -2
- package/{chunk-WQDTSK5U.js → chunk-REINTCQF.js} +8 -2
- package/{chunk-IXAGRTAR.js → chunk-SBBSUBY3.js} +1 -1
- package/{chunk-MTM4LRVG.js → chunk-SCY2O7CU.js} +2 -2
- package/{chunk-FAFDIQJG.js → chunk-U3ZK2MXG.js} +3 -3
- package/{chunk-PKMDYRAM.js → chunk-UDQZ5JT7.js} +175 -241
- package/{chunk-UR4ZMRV3.js → chunk-UGHNYYOE.js} +2 -2
- package/{chunk-KZVRPCOR.js → chunk-UTFTXJU3.js} +4 -4
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-U2OWDHDE.js → chunk-VH7AQEEF.js} +2 -2
- package/{chunk-QLGL43SI.js → chunk-VZWYP7LD.js} +2 -2
- package/{chunk-6XVPMGXK.js → chunk-W4S5FQWQ.js} +10 -4
- package/{chunk-KRAPKTAS.js → chunk-WJOC3AEM.js} +2 -2
- package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
- package/{chunk-JUYI2D7J.js → chunk-WNIBQBOR.js} +1 -1
- package/{chunk-BQ4CZEVZ.js → chunk-YWLMUFZ5.js} +1 -1
- package/{chunk-CD64YXRB.js → chunk-Z47UZT27.js} +1 -1
- package/{chunk-75TXQ4GY.js → chunk-ZMWDHPNG.js} +15 -29
- package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
- package/{cliAgentConfigHelpers-N6LTB7UY.js → cliAgentConfigHelpers-FKBPFPKR.js} +6 -6
- package/{cliLocalAgentRecordReader-NFNGYOOW.js → cliLocalAgentRecordReader-OHAC4JTY.js} +30 -29
- package/{commandRegistry-OM5DU4DS.js → commandRegistry-YQMAXCLP.js} +81 -81
- package/{contentThunks-7URM43ET.js → contentThunks-GSMUNWBA.js} +20 -20
- package/{cooldownCommands-JEEV75B7.js → cooldownCommands-PT5L4LNB.js} +3 -3
- package/{createAgentAutomationAction-GGEXIKMC.js → createAgentAutomationAction-RMADR4LG.js} +20 -20
- package/{createDialogAction-IXXEMFRQ.js → createDialogAction-CM5CBQVH.js} +21 -21
- package/{createPageAction-IXIVLIOO.js → createPageAction-JMGVMCTH.js} +21 -21
- package/{db-J5KE7XRI.js → db-VR74ADGC.js} +5 -1
- package/{dbSlice-IE4ADINL.js → dbSlice-Q637QR4L.js} +7 -7
- package/{deleteFile-ZCQESEEQ.js → deleteFile-TP6MKFUX.js} +10 -5
- package/{dialogCommands-RPBHOZB6.js → dialogCommands-ULWP5ASX.js} +35 -33
- package/{dialogNotifyCommand-ECKI5MMA.js → dialogNotifyCommand-JKYVSR6K.js} +7 -7
- package/{dialogSlice-5FQB2TNN.js → dialogSlice-ARQKXXTD.js} +18 -18
- package/{docCreateCommands-XJ2X57DW.js → docCreateCommands-ZJFHCZV4.js} +32 -30
- package/{docDeleteCommands-45WGFFEB.js → docDeleteCommands-LY5MF2BI.js} +33 -31
- package/{docReadCommands-LRRVDS46.js → docReadCommands-4X2DHCNZ.js} +32 -30
- package/{docStore-SUAVM24F.js → docStore-QWRVKIRI.js} +8 -8
- package/{docUpdateCommands-QUYX6BVR.js → docUpdateCommands-5TIT7DAJ.js} +32 -30
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-FDIWBQUB.js → handleSendMessageAction-TVR55KVT.js} +36 -36
- package/{hostCredentialCreate-CEXQHYT4.js → hostCredentialCreate-SIRXPUFR.js} +68 -67
- package/index.js +8 -8
- package/{localDialogRead-USDZXKIL.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-O3JBRK6S.js → localRuntimeAdapter-VRB5EDDZ.js} +67 -66
- package/{machineCommands-I3YA7TNC.js → machineCommands-MG3BB6XM.js} +68 -67
- package/{machineWsRunDispatch-E5CIE2OJ.js → machineWsRunDispatch-3TOO3NCU.js} +68 -67
- package/{mcpLocalAuthorizeCommand-K5J2VMG6.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +6 -6
- package/{memberThunks-T7EAZE6A.js → memberThunks-IGYRMEQC.js} +9 -9
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +1 -1
- package/{projectArchive-A7E65AZO.js → projectArchive-Q46BYZQ6.js} +21 -21
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-MPPXZHAO.js} +10 -5
- package/{readDocTool-N7RVFQEE.js → readDocTool-PKZ35PCR.js} +1 -1
- package/{readlineWorkspace-2O65NBFG.js → readlineWorkspace-RBH6PSE7.js} +613 -209
- package/{removeDialogAgentAction-GRT72HLK.js → removeDialogAgentAction-H6S7VLNA.js} +9 -9
- package/{runAgentClientLoop-NWCZIXCG.js → runAgentClientLoop-WZJ4HXOH.js} +44 -44
- package/{runtimeDoctorCommands-26HYHFTK.js → runtimeDoctorCommands-QGZSKNSE.js} +5 -5
- package/{secretCommands-XR72SHLK.js → secretCommands-BXAQEOES.js} +2 -2
- package/{setDialogExtraReferencesAction-CBG3X46B.js → setDialogExtraReferencesAction-CARUTAWS.js} +8 -8
- package/{setPrimaryDialogAgentAction-EWTDZOAX.js → setPrimaryDialogAgentAction-VRV56MLG.js} +9 -9
- package/{settingThunks-X4PT66J2.js → settingThunks-4FC4HXGN.js} +7 -7
- package/{spaceCommands-EVSNTGRS.js → spaceCommands-27Z5JAU3.js} +31 -29
- package/{streamAgentChatTurn-SYP3OEM5.js → streamAgentChatTurn-JKMBFM2O.js} +57 -53
- package/{switchDialogAgentAction-YHPZ7K6E.js → switchDialogAgentAction-O236K6HB.js} +7 -7
- package/{tableCommands-44GC4N6J.js → tableCommands-C3P2HHKK.js} +2 -2
- package/{tools-2AO2SK4L.js → tools-4RFLNHUW.js} +37 -37
- package/{tuiRestart-HBQDF4AE.js → tuiRestart-GF4DGAAN.js} +7 -7
- package/{tuiSummaryLlmCaller-Q2PNR63K.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-6SI7NWVC.js → updateCommands-BZ4YDHNM.js} +3 -3
- package/{updateDialogTitleAction-MWVMBIPZ.js → updateDialogTitleAction-F3ONQM3N.js} +20 -20
- package/{usageCommand-D44AOTMH.js → usageCommand-XVJ7ZUTM.js} +1 -1
- package/{usageRebuildCommand-IRIMKDI5.js → usageRebuildCommand-NK6S3D4J.js} +2 -2
- package/{windowsSelfUpdate-BJIJKKIS.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
- package/{chunk-YHNUDTU4.js → chunk-VYRTLHIT.js} +3 -3
- package/{dialogUsageCommand-TBIA2QAF.js → dialogUsageCommand-IHAXS7DW.js} +3 -3
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
upsertSSREntity,
|
|
3
3
|
write
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GJ4UTSAW.js";
|
|
5
5
|
import {
|
|
6
6
|
getRuntimeServerContext,
|
|
7
7
|
resolveRecordAuthority
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-REINTCQF.js";
|
|
9
9
|
import {
|
|
10
10
|
TIMEOUT,
|
|
11
11
|
asyncThunkCreator,
|
|
12
12
|
buildCreateSlice,
|
|
13
13
|
noloRequest
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-W4S5FQWQ.js";
|
|
15
15
|
import {
|
|
16
16
|
applyAgentSecretMigrationUpdates,
|
|
17
|
+
buildAgentApiKeyCredentialRef,
|
|
17
18
|
migrateAgentSecrets,
|
|
18
19
|
normalizeAgentRuntimeToolPolicy
|
|
19
20
|
} from "./chunk-USGHJSGO.js";
|
|
@@ -104,6 +105,13 @@ async function agentRequest(server, state, path, method, body) {
|
|
|
104
105
|
clearTimeout(timeout);
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
var AGENT_CHANNEL_FIELDS = ["provider", "apiSource", "apiKeyRef", "customProviderUrl"];
|
|
109
|
+
function clearQuotaOnAgentChannelChange(previous, saved) {
|
|
110
|
+
if (!AGENT_CHANNEL_FIELDS.some((field) => (previous[field] ?? void 0) !== (saved[field] ?? void 0))) return;
|
|
111
|
+
delete saved.quota;
|
|
112
|
+
delete saved.quotaExhaustion;
|
|
113
|
+
delete saved.nextAvailableAt;
|
|
114
|
+
}
|
|
107
115
|
async function updateAgentRecord(options) {
|
|
108
116
|
const { server, state, dbKey, changes } = options;
|
|
109
117
|
if (dbKey.startsWith("agent-local-")) {
|
|
@@ -129,6 +137,7 @@ async function updateAgentRecord(options) {
|
|
|
129
137
|
return result2;
|
|
130
138
|
};
|
|
131
139
|
const saved = merge(previous, { ...changes, isPublic: false, userId: "local" });
|
|
140
|
+
clearQuotaOnAgentChannelChange(previous, saved);
|
|
132
141
|
saved.updatedAt = Date.now();
|
|
133
142
|
try {
|
|
134
143
|
await options.localDb.put(dbKey, saved);
|
|
@@ -261,6 +270,7 @@ var migrateRawApiKeyForAgent = async (args) => {
|
|
|
261
270
|
var createSliceWithThunks = buildCreateSlice({
|
|
262
271
|
creators: { asyncThunk: asyncThunkCreator }
|
|
263
272
|
});
|
|
273
|
+
var pendingCreateIds = /* @__PURE__ */ new WeakMap();
|
|
264
274
|
var initialState = {};
|
|
265
275
|
var normalizeAgentReferences = (references) => {
|
|
266
276
|
if (!Array.isArray(references)) return [];
|
|
@@ -342,6 +352,9 @@ var processAgentUpdateChanges = (data, userId, previousAgent) => {
|
|
|
342
352
|
if ("apiKey" in data) {
|
|
343
353
|
changes.apiKey = (data.apiKey ?? "").trim();
|
|
344
354
|
}
|
|
355
|
+
if (data.enableThinking !== void 0) {
|
|
356
|
+
changes.enableThinking = data.enableThinking;
|
|
357
|
+
}
|
|
345
358
|
if ("hasVision" in data && data.hasVision !== void 0) {
|
|
346
359
|
changes.hasVision = !!data.hasVision;
|
|
347
360
|
}
|
|
@@ -458,7 +471,7 @@ var slice = createSliceWithThunks({
|
|
|
458
471
|
const overrides = {};
|
|
459
472
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
460
473
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
461
|
-
const { _executeModel } = await import("./_executeModel-
|
|
474
|
+
const { _executeModel } = await import("./_executeModel-RXHY2BDR.js");
|
|
462
475
|
return _executeModel(
|
|
463
476
|
{
|
|
464
477
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -479,7 +492,7 @@ var slice = createSliceWithThunks({
|
|
|
479
492
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
480
493
|
*/
|
|
481
494
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
482
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
495
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-WZJ4HXOH.js");
|
|
483
496
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
484
497
|
{
|
|
485
498
|
agentKey: args.agentKey,
|
|
@@ -495,7 +508,7 @@ var slice = createSliceWithThunks({
|
|
|
495
508
|
* 聊天轮次流式 Agent 调用
|
|
496
509
|
*/
|
|
497
510
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
498
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
511
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-JKMBFM2O.js");
|
|
499
512
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
500
513
|
}),
|
|
501
514
|
/**
|
|
@@ -505,11 +518,19 @@ var slice = createSliceWithThunks({
|
|
|
505
518
|
* - 返回完整 Agent 对象(包含 id / meta 字段)
|
|
506
519
|
*/
|
|
507
520
|
createAgent: create.asyncThunk(
|
|
508
|
-
async ({ userId, formData, spaceId }, thunkApi) => {
|
|
521
|
+
async ({ userId, formData, spaceId, createAttempt }, thunkApi) => {
|
|
509
522
|
const effectiveUserId = asOptionalTrimmedString(userId) ?? "local";
|
|
510
523
|
const processed = processAgentCreateForm(formData, effectiveUserId);
|
|
511
524
|
const now = Date.now();
|
|
512
|
-
const
|
|
525
|
+
const previous = createAttempt && pendingCreateIds.get(createAttempt);
|
|
526
|
+
const pending = previous?.owner === effectiveUserId ? previous : {
|
|
527
|
+
owner: effectiveUserId,
|
|
528
|
+
id: ulid(),
|
|
529
|
+
usesPerAgentRef: false
|
|
530
|
+
};
|
|
531
|
+
pending.usesPerAgentRef ||= formData.credentialSynced === true;
|
|
532
|
+
if (createAttempt) pendingCreateIds.set(createAttempt, pending);
|
|
533
|
+
const { id } = pending;
|
|
513
534
|
const privateKey = createAgentKey.private(effectiveUserId, id);
|
|
514
535
|
const publicKey = createAgentKey.public(id);
|
|
515
536
|
let agent = {
|
|
@@ -544,9 +565,20 @@ var slice = createSliceWithThunks({
|
|
|
544
565
|
agentKey: privateKey,
|
|
545
566
|
apiKey: createRawApiKey,
|
|
546
567
|
apiKeyRef: agent.apiKeyRef,
|
|
547
|
-
credentialRef: agent.credentialRef
|
|
568
|
+
credentialRef: pending.usesPerAgentRef ? buildAgentApiKeyCredentialRef(privateKey) : agent.credentialRef
|
|
548
569
|
});
|
|
549
570
|
}
|
|
571
|
+
if (agent.credentialSynced === true) {
|
|
572
|
+
const ctx = getRuntimeServerContext(thunkApi.getState());
|
|
573
|
+
const ref = agent.credentialRef;
|
|
574
|
+
if (!createRawApiKey || !ctx.currentServer || !ctx.currentToken || !ref?.startsWith("api-key:") || !await pushServerSyncedCredential(
|
|
575
|
+
{ currentServer: ctx.currentServer, authToken: ctx.currentToken },
|
|
576
|
+
ref,
|
|
577
|
+
createRawApiKey
|
|
578
|
+
)) {
|
|
579
|
+
throw new Error("agent_credential_sync_failed");
|
|
580
|
+
}
|
|
581
|
+
}
|
|
550
582
|
await thunkApi.dispatch(
|
|
551
583
|
write({
|
|
552
584
|
data: agent,
|
|
@@ -567,21 +599,6 @@ var slice = createSliceWithThunks({
|
|
|
567
599
|
})
|
|
568
600
|
).unwrap();
|
|
569
601
|
}
|
|
570
|
-
if (agent.credentialSynced && createRawApiKey) {
|
|
571
|
-
const ctx = getRuntimeServerContext(thunkApi.getState());
|
|
572
|
-
const credentialRef = agent.credentialRef;
|
|
573
|
-
if (ctx.currentToken && credentialRef) {
|
|
574
|
-
try {
|
|
575
|
-
await pushServerSyncedCredential(
|
|
576
|
-
{ currentServer: ctx.currentServer ?? "", authToken: ctx.currentToken },
|
|
577
|
-
credentialRef,
|
|
578
|
-
createRawApiKey
|
|
579
|
-
);
|
|
580
|
-
} catch (error) {
|
|
581
|
-
console.error("[agent-credential-sync] push failed", error instanceof Error ? error.message : "unknown error");
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
602
|
try {
|
|
586
603
|
const { localFirstLog } = await import("./localFirstLog-OIETGK66.js");
|
|
587
604
|
localFirstLog("agent.create.done", {
|
|
@@ -595,6 +612,7 @@ var slice = createSliceWithThunks({
|
|
|
595
612
|
});
|
|
596
613
|
} catch {
|
|
597
614
|
}
|
|
615
|
+
if (createAttempt) pendingCreateIds.delete(createAttempt);
|
|
598
616
|
return agent;
|
|
599
617
|
}
|
|
600
618
|
),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveAgentCallPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DNNPARJK.js";
|
|
4
4
|
import {
|
|
5
5
|
CUSTOM_API_KEY_TEMPLATES,
|
|
6
6
|
SUBSCRIPTION_OAUTH_PROVIDERS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6SOWMEAY.js";
|
|
8
8
|
import {
|
|
9
9
|
findModelConfig,
|
|
10
10
|
getProviderByModelName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OKH74FML.js";
|
|
12
12
|
import {
|
|
13
13
|
asOptionalTrimmedString
|
|
14
14
|
} from "./chunk-G3SUCT4W.js";
|