nolo-cli 0.89.0-alpha.1 → 0.90.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/README.md +2 -2
- package/{_executeModel-I3XRMAJ2.js → _executeModel-W26HVI75.js} +38 -38
- package/{action-7GHFPDSQ.js → action-6DXQGJMX.js} +7 -7
- package/{addContentAction-ZNVB2NOV.js → addContentAction-I7VX5SAC.js} +5 -5
- package/{addDialogAgentAction-CIDFWATM.js → addDialogAgentAction-OJSFV7DZ.js} +4 -4
- package/{agentDeleteCommand-DCTG26JW.js → agentDeleteCommand-XNFWCKBH.js} +24 -23
- package/{agentEmailCommands-MRRHBLDQ.js → agentEmailCommands-W3X3EJ3V.js} +50 -49
- package/{agentGrantCommands-R3VQEZJR.js → agentGrantCommands-YW6PQAQ2.js} +2 -2
- package/{agentListCommands-CUE46CSP.js → agentListCommands-DFWFU6XO.js} +32 -25
- package/{agentMachineCommands-FYDEKBIO.js → agentMachineCommands-LMFOAEL4.js} +24 -23
- package/{agentProviderCommands-X3FA6BUM.js → agentProviderCommands-ZBYHGTGY.js} +1 -1
- package/{agentPullCommand-U73W5IBM.js → agentPullCommand-GLOOXJ2E.js} +2 -2
- package/{agentRecordCommands-P2MSNP7R.js → agentRecordCommands-FVVVCQFM.js} +48 -47
- package/{agentRunCommand-QJGP7JEN.js → agentRunCommand-HTBVIBGV.js} +49 -48
- package/{agentRunControl-T44MESII.js → agentRunControl-XLGD3UZ5.js} +1 -1
- package/{agentRuntimeLocal-T43UNWAY.js → agentRuntimeLocal-2JFG4HDU.js} +20 -19
- package/{agentSlice-7GDS5Q2S.js → agentSlice-ZNLGFUB5.js} +5 -5
- package/{appDeleteCommands-YBKY3VEI.js → appDeleteCommands-2UN4N2NR.js} +25 -24
- package/{appDeployCommands-EBC76HO4.js → appDeployCommands-37D74KRR.js} +25 -24
- package/{appDeployStatusCommands-WXRC5KEK.js → appDeployStatusCommands-QBLWL2IA.js} +25 -24
- package/{appGetCommands-VZZQEDOV.js → appGetCommands-6KXIDF2T.js} +25 -24
- package/{appListCommands-HYSPVQ77.js → appListCommands-G2WFGEWQ.js} +25 -24
- package/{authCommand-E4GDVKMW.js → authCommand-V2DJ7DB7.js} +84 -18
- package/{authCommands-VOTT6XWX.js → authCommands-RGOGCPP6.js} +2 -2
- package/{builtinSkillRegistry-5SYVTS6Z.js → builtinSkillRegistry-WBGYKIAZ.js} +5 -5
- package/{chatQueueReduxAdapter-CXEWIDFZ.js → chatQueueReduxAdapter-XCJHIY3R.js} +17 -17
- package/{chunk-P3AS5IPM.js → chunk-2ADBVBEM.js} +3 -2
- package/{chunk-GRJTR4PU.js → chunk-2AYMFHUG.js} +4 -4
- package/{chunk-UO66QKGI.js → chunk-2F4VYGFW.js} +2 -2
- package/{chunk-LEYH5NOH.js → chunk-3CMTBX3X.js} +4 -4
- package/{chunk-GXWEF4IZ.js → chunk-3CR2LC6X.js} +1 -1
- package/{chunk-ZKGIAM7I.js → chunk-3R5PH4IP.js} +1 -1
- package/{chunk-VW3YGKWR.js → chunk-4BYPU626.js} +294 -203
- package/{chunk-PHDKTASK.js → chunk-4DRWWIOL.js} +1 -1
- package/{chunk-BNMZ7QUV.js → chunk-576IMUGH.js} +1 -1
- package/{chunk-AYT2OKNM.js → chunk-5DFFKASO.js} +3 -3
- package/{chunk-Q246OUG5.js → chunk-5NMZNPTN.js} +5 -5
- package/{chunk-5XTOKQLW.js → chunk-5UTFL4QJ.js} +6 -2
- package/{chunk-6RCZYDDC.js → chunk-5V4NJHRM.js} +6 -6
- package/chunk-5ZUL4CUO.js +10 -0
- package/{chunk-US463UAD.js → chunk-6BEA566T.js} +2 -2
- package/{chunk-UINEAQ2R.js → chunk-6D6VBVEW.js} +1 -1
- package/{chunk-JC2WQS66.js → chunk-7MYYE7WX.js} +20 -16
- package/{chunk-3T4PRBHV.js → chunk-A2C4AKKM.js} +1 -1
- package/{chunk-6ZC5KPXV.js → chunk-AQZRTHDZ.js} +903 -40
- package/{chunk-UWMQ6FPM.js → chunk-ASGDO77C.js} +118 -1
- package/{chunk-2KDR4CWE.js → chunk-BYMV6QZG.js} +24 -1
- package/{chunk-XCSSFPTB.js → chunk-CLI4LFSM.js} +1 -1
- package/{chunk-HH65VA5U.js → chunk-CPH3W5A7.js} +15 -3
- package/{chunk-TGRQUFLU.js → chunk-DNQPPRHY.js} +1 -1
- package/{chunk-2XEVK4BT.js → chunk-DPQ2WVBY.js} +1 -1
- package/{chunk-OCL2YCAU.js → chunk-F2CGG72C.js} +40 -40
- package/{chunk-S6STPUMG.js → chunk-FQYMLZ6C.js} +5 -5
- package/{chunk-BJIRLHJR.js → chunk-GII32WZW.js} +1 -0
- package/{chunk-VARZWSKW.js → chunk-GRYGRGPS.js} +3 -3
- package/{chunk-L2VNQQ7M.js → chunk-HMEMJ7GH.js} +364 -24
- package/{chunk-OZX2IPKM.js → chunk-HQCSU3DI.js} +1 -1
- package/{chunk-VQD6BTML.js → chunk-HYZHJ5GW.js} +3 -3
- package/{chunk-OAJRZ35U.js → chunk-IIKPWSPX.js} +1 -1
- package/{chunk-W7PGACND.js → chunk-JBBZ5KUM.js} +10 -10
- package/{chunk-KC5FAHVS.js → chunk-JEDZAO7L.js} +1 -1
- package/{chunk-LSV2BOJL.js → chunk-JTK3TJYV.js} +1 -1
- package/{chunk-X77EN2BJ.js → chunk-K7M3MWCE.js} +2 -2
- package/{chunk-OHUU52T3.js → chunk-L2ICPOAL.js} +1 -1
- package/{chunk-EVBFYPDC.js → chunk-MC4XLIJ7.js} +6 -2
- package/{chunk-DS3SQTDT.js → chunk-MJHQ3NRV.js} +1 -1
- package/{chunk-Q4KVAB6L.js → chunk-N3OAPEZE.js} +28 -9
- package/{chunk-T4F2EQGN.js → chunk-ND2J3NRB.js} +2 -2
- package/{chunk-IMDA4FW4.js → chunk-NFMHIUY3.js} +61 -46
- package/{chunk-JITSBA52.js → chunk-PH5J5VUY.js} +2 -2
- package/{chunk-FMODTASJ.js → chunk-Q5FJJ6XI.js} +1 -7
- package/{chunk-JYYZCK2Z.js → chunk-QFMFJZLO.js} +1 -1
- package/{chunk-WSOMSDQB.js → chunk-QHETQ3KI.js} +35 -1
- package/{chunk-IZAWJCG7.js → chunk-RZANZZL2.js} +1 -1
- package/{chunk-SPAQ4PVV.js → chunk-SAFZABH7.js} +1 -1
- package/{chunk-EXWOCYCR.js → chunk-SMZSWB44.js} +10 -5
- package/{chunk-HJKGQPYF.js → chunk-TL6L5XUT.js} +1 -1
- package/{chunk-4FRNB4ZG.js → chunk-TVNI5FLG.js} +4 -4
- package/{chunk-5EJZGJS2.js → chunk-UA5S3LQQ.js} +3 -3
- package/{chunk-Y2IFJ7VM.js → chunk-UTCCPWB2.js} +3 -3
- package/{chunk-KT6LENVP.js → chunk-VHJLQHPQ.js} +2 -2
- package/{chunk-6H7GN3JL.js → chunk-VRLI2WNW.js} +10 -1
- package/{chunk-23RQKXP6.js → chunk-WS22FPWT.js} +1 -1
- package/{chunk-NVHJWYUO.js → chunk-WXPVOQD7.js} +35 -33
- package/{chunk-MFW4BGJS.js → chunk-XKQJJK4F.js} +1 -1
- package/{chunk-GIG262ZG.js → chunk-XMGHGEN6.js} +1 -1
- package/{chunk-IO7DYRPW.js → chunk-XTUY5EL4.js} +16 -12
- package/{chunk-OKCTLCKS.js → chunk-YOXYA2GU.js} +1 -1
- package/{chunk-ZIHJVHFH.js → chunk-Z33ARZCP.js} +1 -1
- package/{chunk-ZSG2AQU4.js → chunk-ZAB3A45K.js} +62 -11
- package/{chunk-YZHP76TR.js → chunk-ZBT3WNBK.js} +1 -1
- package/{contentThunks-Y2ACIFDB.js → contentThunks-VURN3DFW.js} +18 -18
- package/{createAgentAutomationAction-TNE3QMJR.js → createAgentAutomationAction-QZAAY77R.js} +18 -18
- package/{createDialogAction-BMGHBTQB.js → createDialogAction-CHGXVTAC.js} +20 -20
- package/{createPageAction-FFNIZPIS.js → createPageAction-IOGAFIN7.js} +18 -18
- package/{dbSlice-4CUQE35F.js → dbSlice-YXQ6RYIH.js} +4 -4
- package/{dialogCommands-3JC3BIXC.js → dialogCommands-XREAP6WQ.js} +26 -25
- package/{dialogSlice-3E7Z7HZV.js → dialogSlice-DOPGWGS4.js} +17 -17
- package/{docCreateCommands-6LNQLCTA.js → docCreateCommands-3PYZGSCL.js} +24 -23
- package/{docDeleteCommands-ZJOAPWZS.js → docDeleteCommands-3Y6MU44Q.js} +25 -24
- package/{docReadCommands-LJTRSBG6.js → docReadCommands-UBANMAFR.js} +24 -23
- package/{docStore-R47ABXBB.js → docStore-SYYFBENY.js} +5 -5
- package/{docUpdateCommands-7P3QF3N2.js → docUpdateCommands-4GK2X6BN.js} +24 -23
- package/{getPricing-TV6ZB7ES.js → getPricing-F2C65RIX.js} +3 -3
- package/{handleSendMessageAction-FFYOGXAO.js → handleSendMessageAction-NPVTY2GE.js} +17 -17
- package/index.js +81 -81
- package/{machineCommands-FN5GGQV3.js → machineCommands-I66X2XB7.js} +47 -46
- package/{machineWsRunDispatch-H47IA7ZT.js → machineWsRunDispatch-W4FVBOUM.js} +47 -46
- package/{memberThunks-N35XAOC6.js → memberThunks-5T4J6KXQ.js} +5 -5
- package/{models-CMXFDBQH.js → models-WW7VFNXB.js} +2 -2
- package/{offlineMarxistsAgentCommand-GEH6SNNA.js → offlineMarxistsAgentCommand-JEWCIAWM.js} +1 -1
- package/package.json +1 -1
- package/{providerPresetApply-D2GGHPI7.js → providerPresetApply-OCWWKBSD.js} +6 -6
- package/{providerRegistry-MU6C4ABD.js → providerRegistry-ZJQU7AJ7.js} +6 -6
- package/{read-2PV4PN2E.js → read-M2Q6WEKB.js} +3 -3
- package/{readDocTool-FGK5XGAW.js → readDocTool-T37P3YPB.js} +1 -1
- package/{readlineWorkspace-NXKHYZEU.js → readlineWorkspace-VY5AMOGR.js} +123 -91
- package/{removeDialogAgentAction-O2POGBOE.js → removeDialogAgentAction-HB3JBVAI.js} +7 -7
- package/{runAgentClientLoop-CEBV5UPD.js → runAgentClientLoop-3NDADLVE.js} +36 -36
- package/{setDialogExtraReferencesAction-KPSVVY3C.js → setDialogExtraReferencesAction-4XLHRV37.js} +5 -5
- package/{setPrimaryDialogAgentAction-RMJETONI.js → setPrimaryDialogAgentAction-C3JOFC4W.js} +7 -7
- package/{settingSlice-I6MTTNDX.js → settingSlice-CZRURSTH.js} +6 -6
- package/{spaceCommands-JHT4ALCQ.js → spaceCommands-ENYCUUZH.js} +24 -23
- package/{streamAgentChatTurn-SFCZP4GY.js → streamAgentChatTurn-634OFUSR.js} +44 -42
- package/{switchDialogAgentAction-OQSGWVQQ.js → switchDialogAgentAction-C6KVUKJP.js} +4 -4
- package/{tableCommands-SUNTHAYX.js → tableCommands-O6NWHFKV.js} +1 -1
- package/{toolApiClient-VGYUB4P5.js → toolApiClient-7PSIFQPJ.js} +2 -2
- package/{tools-K3YOTESV.js → tools-ILBLCF7D.js} +33 -33
- package/tuiSummaryLlmCaller-LFUBZKXK.js +127 -0
- package/{updateCommands-Y363MC3L.js → updateCommands-2M74UL7P.js} +2 -2
- package/{updateDialogTitleAction-CSPKYQRO.js → updateDialogTitleAction-RKFET73N.js} +38 -21
- package/tuiSummaryLlmCaller-T2OA5ZVB.js +0 -116
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FQYMLZ6C.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
5
|
import {
|
|
6
6
|
isAssistantToolStub,
|
|
7
7
|
selectAllMsgs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HMEMJ7GH.js";
|
|
9
9
|
import {
|
|
10
|
+
BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
|
|
10
11
|
BUILTIN_TITLE_LLM_CONFIG
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MC4XLIJ7.js";
|
|
12
13
|
import "./chunk-3BMYXEUW.js";
|
|
13
14
|
import "./chunk-YYLHWIW6.js";
|
|
14
15
|
import "./chunk-AGGIDPCZ.js";
|
|
15
16
|
import {
|
|
16
17
|
runLlm
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-TVNI5FLG.js";
|
|
19
|
+
import "./chunk-6BEA566T.js";
|
|
19
20
|
import "./chunk-5RGU3J7P.js";
|
|
20
21
|
import "./chunk-6YTOJY35.js";
|
|
21
22
|
import {
|
|
@@ -26,43 +27,43 @@ import {
|
|
|
26
27
|
buildDialogFallbackTitleFromMessages,
|
|
27
28
|
resolveDialogTitle
|
|
28
29
|
} from "./chunk-2MBTWINN.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-F2CGG72C.js";
|
|
30
31
|
import {
|
|
31
32
|
serializeMessageContent
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-VHJLQHPQ.js";
|
|
33
34
|
import "./chunk-PSCNXBYA.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-ND2J3NRB.js";
|
|
35
36
|
import "./chunk-BYXBJQAS.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-VRLI2WNW.js";
|
|
37
38
|
import "./chunk-DWLEOOGR.js";
|
|
38
39
|
import "./chunk-HVURBGF3.js";
|
|
39
40
|
import "./chunk-ONXOABJR.js";
|
|
40
41
|
import "./chunk-W7XHHYWM.js";
|
|
41
42
|
import "./chunk-HNMXYYJR.js";
|
|
42
43
|
import "./chunk-7S4YWN7P.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-WS22FPWT.js";
|
|
45
|
+
import "./chunk-ASGDO77C.js";
|
|
46
|
+
import "./chunk-PH5J5VUY.js";
|
|
46
47
|
import "./chunk-Y5GCAMGP.js";
|
|
47
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-RZANZZL2.js";
|
|
48
49
|
import "./chunk-KX6YBIHG.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-4DRWWIOL.js";
|
|
50
51
|
import {
|
|
51
52
|
normalizeSpaceId
|
|
52
53
|
} from "./chunk-UAD2WT54.js";
|
|
53
54
|
import {
|
|
54
55
|
patch,
|
|
55
56
|
selectById
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-UA5S3LQQ.js";
|
|
57
58
|
import "./chunk-VMFTFOWF.js";
|
|
58
59
|
import "./chunk-WWC7I6TA.js";
|
|
59
60
|
import "./chunk-ABQYVJBJ.js";
|
|
60
61
|
import "./chunk-QSJ3HFEF.js";
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-L2ICPOAL.js";
|
|
63
|
+
import "./chunk-TL6L5XUT.js";
|
|
63
64
|
import {
|
|
64
65
|
extractCustomId
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-GII32WZW.js";
|
|
66
67
|
import "./chunk-UKWGR5SS.js";
|
|
67
68
|
import "./chunk-QOKAKDPE.js";
|
|
68
69
|
import "./chunk-OW765XBU.js";
|
|
@@ -175,14 +176,30 @@ var updateDialogTitleActionWithDeps = async (args, thunkApi, deps = {}) => {
|
|
|
175
176
|
const content = JSON.stringify(
|
|
176
177
|
messageContext.map((msg) => ({ role: msg.role, content: msg.content }))
|
|
177
178
|
);
|
|
178
|
-
|
|
179
|
+
const runTitleLlm = (llmConfig) => dispatch(
|
|
179
180
|
runLlmAction({
|
|
180
|
-
llmConfig
|
|
181
|
+
llmConfig,
|
|
181
182
|
content,
|
|
182
183
|
billingDialogKey: dialogKey,
|
|
183
|
-
systemPromptOverride:
|
|
184
|
+
systemPromptOverride: llmConfig.prompt
|
|
184
185
|
})
|
|
185
186
|
).unwrap();
|
|
187
|
+
const hasUsableTitle = (value) => typeof value === "string" && value.trim().length > 0;
|
|
188
|
+
try {
|
|
189
|
+
generatedTitle = await runTitleLlm(BUILTIN_TITLE_LLM_CONFIG);
|
|
190
|
+
} catch {
|
|
191
|
+
generatedTitle = "";
|
|
192
|
+
}
|
|
193
|
+
if (!hasUsableTitle(generatedTitle)) {
|
|
194
|
+
try {
|
|
195
|
+
generatedTitle = await runTitleLlm({
|
|
196
|
+
...BUILTIN_TITLE_LLM_CONFIG,
|
|
197
|
+
model: BUILTIN_DIALOG_LLM_FALLBACK_MODEL
|
|
198
|
+
});
|
|
199
|
+
} catch {
|
|
200
|
+
generatedTitle = "";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
186
203
|
}
|
|
187
204
|
const title = resolveDialogTitle(generatedTitle, fallbackTitle);
|
|
188
205
|
const spaceId = dialogConfig?.spaceId && normalizeSpaceId(dialogConfig.spaceId);
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BUILTIN_SUMMARY_LLM_CONFIG
|
|
3
|
-
} from "./chunk-EVBFYPDC.js";
|
|
4
|
-
import {
|
|
5
|
-
buildPlatformChatCompletionRequest,
|
|
6
|
-
canUsePlatformChatProvider,
|
|
7
|
-
parsePlatformChatCompletionResponse,
|
|
8
|
-
resolvePlatformChatProviderConfig
|
|
9
|
-
} from "./chunk-EXWOCYCR.js";
|
|
10
|
-
import "./chunk-CQ3WA2NE.js";
|
|
11
|
-
import "./chunk-N7J63Q6C.js";
|
|
12
|
-
import "./chunk-PUOC4YRO.js";
|
|
13
|
-
import "./chunk-X77EN2BJ.js";
|
|
14
|
-
import {
|
|
15
|
-
COMPACTION_SUMMARY_SYSTEM_PROMPT
|
|
16
|
-
} from "./chunk-KT6LENVP.js";
|
|
17
|
-
import "./chunk-PSCNXBYA.js";
|
|
18
|
-
import "./chunk-T4F2EQGN.js";
|
|
19
|
-
import "./chunk-BYXBJQAS.js";
|
|
20
|
-
import "./chunk-6H7GN3JL.js";
|
|
21
|
-
import "./chunk-DWLEOOGR.js";
|
|
22
|
-
import "./chunk-W7XHHYWM.js";
|
|
23
|
-
import "./chunk-UWMQ6FPM.js";
|
|
24
|
-
import "./chunk-PHDKTASK.js";
|
|
25
|
-
import "./chunk-UAD2WT54.js";
|
|
26
|
-
import "./chunk-5EJZGJS2.js";
|
|
27
|
-
import "./chunk-VMFTFOWF.js";
|
|
28
|
-
import "./chunk-WWC7I6TA.js";
|
|
29
|
-
import "./chunk-ABQYVJBJ.js";
|
|
30
|
-
import "./chunk-QSJ3HFEF.js";
|
|
31
|
-
import "./chunk-OHUU52T3.js";
|
|
32
|
-
import "./chunk-HJKGQPYF.js";
|
|
33
|
-
import "./chunk-BJIRLHJR.js";
|
|
34
|
-
import "./chunk-UKWGR5SS.js";
|
|
35
|
-
import "./chunk-QOKAKDPE.js";
|
|
36
|
-
import "./chunk-OW765XBU.js";
|
|
37
|
-
import "./chunk-SEJ5OS6F.js";
|
|
38
|
-
import "./chunk-GBRG75BQ.js";
|
|
39
|
-
import "./chunk-KUG52IAP.js";
|
|
40
|
-
import "./chunk-3EUW3WEO.js";
|
|
41
|
-
import "./chunk-U6VC4MU4.js";
|
|
42
|
-
import "./chunk-LCBAMY2M.js";
|
|
43
|
-
import "./chunk-4SN6J65J.js";
|
|
44
|
-
import "./chunk-CF7PE763.js";
|
|
45
|
-
import "./chunk-G3SUCT4W.js";
|
|
46
|
-
import "./chunk-4VNS5WPM.js";
|
|
47
|
-
|
|
48
|
-
// packages/cli/client/tuiSummaryLlmCaller.ts
|
|
49
|
-
function createTuiSummaryLlmCaller(env, options) {
|
|
50
|
-
const fetchImpl = options?.fetchImpl ?? fetch;
|
|
51
|
-
const timeoutMs = options?.timeoutMs ?? 3e4;
|
|
52
|
-
return async (content) => {
|
|
53
|
-
if (!canUsePlatformChatProvider(env)) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const providerConfig = await resolvePlatformChatProviderConfig({
|
|
58
|
-
agentConfig: { ...BUILTIN_SUMMARY_LLM_CONFIG, key: BUILTIN_SUMMARY_LLM_CONFIG.id },
|
|
59
|
-
env,
|
|
60
|
-
apiKeyRefResolver: options?.apiKeyRefResolver,
|
|
61
|
-
credentialBroker: options?.credentialBroker
|
|
62
|
-
});
|
|
63
|
-
if (!providerConfig?.authToken) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
const messages = [
|
|
67
|
-
{ role: "system", content: COMPACTION_SUMMARY_SYSTEM_PROMPT },
|
|
68
|
-
{ role: "user", content }
|
|
69
|
-
];
|
|
70
|
-
const request = buildPlatformChatCompletionRequest({
|
|
71
|
-
providerConfig,
|
|
72
|
-
messages,
|
|
73
|
-
stream: false
|
|
74
|
-
});
|
|
75
|
-
let parsedBody = {};
|
|
76
|
-
if (typeof request.init?.body === "string") {
|
|
77
|
-
parsedBody = safeParseJson(request.init.body) ?? {};
|
|
78
|
-
} else if (typeof request.init?.body === "object" && request.init?.body !== null) {
|
|
79
|
-
parsedBody = request.init.body;
|
|
80
|
-
}
|
|
81
|
-
const patchedBody = {
|
|
82
|
-
...parsedBody,
|
|
83
|
-
reasoning_effort: "low"
|
|
84
|
-
};
|
|
85
|
-
const response = await fetchImpl(request.url, {
|
|
86
|
-
...request.init,
|
|
87
|
-
body: JSON.stringify(patchedBody),
|
|
88
|
-
signal: AbortSignal.timeout(timeoutMs)
|
|
89
|
-
});
|
|
90
|
-
if (!response.ok) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
const raw = await response.text().catch(() => "");
|
|
94
|
-
const data = safeParseJson(raw);
|
|
95
|
-
if (!data) return null;
|
|
96
|
-
const parsed = parsePlatformChatCompletionResponse({
|
|
97
|
-
providerConfig,
|
|
98
|
-
data,
|
|
99
|
-
trace: []
|
|
100
|
-
});
|
|
101
|
-
return parsed?.content?.trim() || null;
|
|
102
|
-
} catch {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function safeParseJson(raw) {
|
|
108
|
-
try {
|
|
109
|
-
return JSON.parse(raw);
|
|
110
|
-
} catch {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export {
|
|
115
|
-
createTuiSummaryLlmCaller
|
|
116
|
-
};
|