nolo-cli 0.106.0-alpha.1 → 0.106.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/README.md +1 -1
- package/{_executeModel-C5ZUOC7O.js → _executeModel-EP6HAX3W.js} +77 -69
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-NZZNAVCB.js} +13 -12
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-5HVGEIXI.js} +19 -20
- package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-M25A6UGB.js} +118 -43
- package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-RUL4NL64.js} +99 -89
- package/agentListCommands-KSPFKHFO.js +741 -0
- package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-IHBB6PHD.js} +48 -44
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-ND4S2Q6Q.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-7OKIBN6H.js +138 -0
- package/agentRunCommand-GBKJTQQU.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-E5HXZNXZ.js} +44 -40
- package/{agentSlice-7OEXULAY.js → agentSlice-7T3ZLYET.js} +15 -14
- package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-TTJUYTQN.js} +46 -42
- package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-65WYK2TQ.js} +46 -42
- package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-U4XESYYG.js} +46 -42
- package/{appGetCommands-EXWT3QAE.js → appGetCommands-VNHZZC4D.js} +46 -42
- package/{appListCommands-PKRLSWRE.js → appListCommands-O667ZEU6.js} +46 -42
- package/{authCommand-F4EFRRX6.js → authCommand-SUHHTVHA.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-PUGT65WS.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-ZNV445LB.js → chunk-2NGKYC3L.js} +29 -9
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-XA2FJW4L.js → chunk-3SXZ6SUC.js} +11 -9
- package/{chunk-UKZDAFYT.js → chunk-3VKDWQMJ.js} +6 -10
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-PQFHGD77.js → chunk-4VDS344D.js} +161 -14
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-5F7UKMLN.js} +8 -4
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-YCJN2RA3.js → chunk-6AIURTE7.js} +20 -11
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-S4VLC46A.js → chunk-AM4G3LDJ.js} +66 -54
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-TJGWNDGO.js → chunk-AZB6HR4I.js} +846 -276
- package/{chunk-L5UXH3B2.js → chunk-BIH7KCDJ.js} +58 -9
- package/{chunk-UZGQNTVW.js → chunk-BPLIXNC6.js} +8 -6
- package/chunk-CEQ75WPL.js +915 -0
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-GPCZ7UXG.js → chunk-DBKRC5O2.js} +1 -1
- package/chunk-DJ3JABG5.js +7990 -0
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-UOBDA2JS.js → chunk-DSXRVBTA.js} +118 -90
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HJUYAD4A.js → chunk-EBS4FKW4.js} +5 -5
- package/{chunk-LC43IGO4.js → chunk-EHGIEGLI.js} +834 -962
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-TOP2VXOR.js → chunk-FJKZSR5P.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/{chunk-ZCYXJSTU.js → chunk-GMP3NBAA.js} +65 -95
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-OIVSQH2O.js → chunk-GU7DC2TD.js} +300 -5
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-RJXZDT2P.js → chunk-HNA5KV37.js} +23 -28
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-ACTMNVHM.js → chunk-I5YMDACN.js} +1 -1
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-Q67DOFOO.js → chunk-IYIXAIEB.js} +199 -92
- package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-OEVAY4J6.js → chunk-JWNBEIME.js} +18 -20
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-JZL6EHZR.js → chunk-LGWABBTZ.js} +47 -67
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-GEPUP7OO.js → chunk-LOPP5VT6.js} +3 -3
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-BNGW5ASC.js → chunk-LYLO5U3H.js} +15 -2
- package/{chunk-4OEFYTWL.js → chunk-MJ3CRU77.js} +85 -50
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-NA35QHCF.js → chunk-NTNKA5VL.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-NWENLDMM.js +42 -0
- package/chunk-O7SVKKLY.js +875 -0
- package/{chunk-FM2YTE6D.js → chunk-OAXBDMT7.js} +1 -1
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-EYAQT56M.js → chunk-ODTBO4W6.js} +9 -6
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-EEGDMATE.js → chunk-OQ5IVGCV.js} +86 -81
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-OYTWDOQV.js} +155 -8
- package/{chunk-JRQFUXY7.js → chunk-OZ2IIIRP.js} +99 -22
- package/{chunk-WV42OMV7.js → chunk-PFLF4R4E.js} +8 -8
- package/{chunk-J4MOO56S.js → chunk-QDH32WF5.js} +10 -2
- package/{chunk-3DII57IT.js → chunk-QVAWUJAJ.js} +1 -1
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-6OZ36FXI.js → chunk-SJ7CUF65.js} +22 -4
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/{chunk-ETI2NYVF.js → chunk-SYEBIZOF.js} +4 -4
- package/{chunk-J3WULTWA.js → chunk-TLKXNTQJ.js} +19 -17
- package/chunk-TLYSGGPG.js +15 -0
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/chunk-UM7TA3K4.js +1008 -0
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/chunk-VBQGO5NX.js +164 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VYKXIHRP.js +13692 -0
- package/chunk-VZLO4XJD.js +17 -0
- package/{chunk-DNCEALKX.js → chunk-WMWYWYK2.js} +22 -29
- package/{chunk-H56FOERC.js → chunk-XDQ7PHU3.js} +567 -684
- package/{chunk-AEOE4Z6Q.js → chunk-XGOHDYM2.js} +39 -15
- package/{chunk-53HEEOTT.js → chunk-XLWMNFBZ.js} +83 -16
- package/{chunk-V4MJDUSR.js → chunk-YFU5EELM.js} +2 -2
- package/{chunk-IUTWFZOX.js → chunk-YQFLBS6A.js} +68 -46
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-5H7KJX7J.js → chunk-ZVGXD7UJ.js} +5 -5
- package/{chunk-H62HCIUP.js → chunk-ZYM73IHG.js} +36 -22
- package/commandRegistry-6QIAUQDS.js +833 -0
- package/{contentThunks-AZVYDLM4.js → contentThunks-5DDMUQ7B.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-NQ6AZM42.js} +40 -37
- package/createDialogAction-QZ6X4A7O.js +70 -0
- package/{createPageAction-I3HH23O3.js → createPageAction-NCGEJBVK.js} +47 -43
- package/{chunk-GDNQO3QR.js → cursorProvider-YGGNMVWX.js} +2751 -10172
- package/{dbSlice-XVWBAGYN.js → dbSlice-RCZ7NRAF.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-YVMHDEOX.js → dialogCommands-OGQLEF63.js} +49 -46
- package/{dialogSlice-LVJ67QWE.js → dialogSlice-GIKNUHNW.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-RW6LNYT6.js} +48 -44
- package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-Z742TRNY.js} +49 -45
- package/{docReadCommands-QHMQVSLP.js → docReadCommands-5DIGA42Y.js} +47 -43
- package/{docStore-UJNL6SBT.js → docStore-6GUOZH52.js} +17 -13
- package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-ZFZ2QEVK.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-QVSNUFZ6.js} +4 -4
- package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-B2VXOLMM.js} +109 -42
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-2QNINBNI.js → machineCommands-AI3N7JHQ.js} +93 -83
- package/machineWsRunDispatch-RPF2D6VV.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-YICJI4IS.js} +20 -18
- package/{models-T3SG6MJ5.js → models-FTNFVO3D.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-OJJXQ7NM.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-DXFBDCGQ.js} +11 -7
- package/{read-COE3ZYR6.js → read-XMBM52Y4.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-LAQHKCVT.js} +5 -3
- package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-EPUCVZ73.js} +2594 -2030
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-HDUI2MU3.js} +22 -26
- package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-OXQMDGAN.js} +78 -71
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-ADBVOP4O.js} +16 -14
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-PXVXQJ62.js} +23 -27
- package/{chunk-AFUORTY4.js → settingThunks-G2MJRKUE.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-BMXKR7H6.js → spaceCommands-Z662QYY6.js} +51 -47
- package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-YJYEJHP7.js} +214 -114
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-Z3RZACGF.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-GHI3WBEI.js +117 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-WTC6GCQC.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-GJCNWTPY.js} +84 -45
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-3GWH4E4G.js +0 -410
- package/agentRecordCommands-P76DPWKV.js +0 -128
- package/agentRunCommand-EQPL4F4K.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-ZBDDI2E5.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-WC6UUQ2C.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-H6URYLIZ.js +0 -65
- package/machineWsRunDispatch-S3XXOKR7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-4AJZHAK3.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
package/chunk-PUOC4YRO.js
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
asTrimmedLowercaseString
|
|
3
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
4
|
-
import {
|
|
5
|
-
isRecord
|
|
6
|
-
} from "./chunk-KUG52IAP.js";
|
|
7
|
-
import {
|
|
8
|
-
asOptionalTrimmedString
|
|
9
|
-
} from "./chunk-G3SUCT4W.js";
|
|
10
|
-
|
|
11
|
-
// packages/core/ollamaEndpoint.ts
|
|
12
|
-
function isOllamaEndpoint(endpoint) {
|
|
13
|
-
if (!endpoint || typeof endpoint !== "string") return false;
|
|
14
|
-
try {
|
|
15
|
-
const url = new URL(endpoint.includes("://") ? endpoint : `http://${endpoint}`);
|
|
16
|
-
if (url.port === "11434") return true;
|
|
17
|
-
const host = url.hostname.toLowerCase();
|
|
18
|
-
return host === "ollama.com" || host.endsWith(".ollama.com") || host === "ollama.ai" || host.endsWith(".ollama.ai");
|
|
19
|
-
} catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// packages/ai/llm/usageRequestOptions.ts
|
|
25
|
-
var STREAM_USAGE_PROVIDERS = /* @__PURE__ */ new Set([
|
|
26
|
-
"google",
|
|
27
|
-
"openrouter",
|
|
28
|
-
"xai",
|
|
29
|
-
"openai",
|
|
30
|
-
"fireworks",
|
|
31
|
-
"mistral",
|
|
32
|
-
"cloudflare",
|
|
33
|
-
"gmi",
|
|
34
|
-
// OpenAI-compatible hosted providers expose the terminal usage chunk when
|
|
35
|
-
// requested, including DeepInfra and Vultr. Keep this capability decision
|
|
36
|
-
// in the shared seam so proxy and local runtimes cannot drift.
|
|
37
|
-
"deepinfra",
|
|
38
|
-
"vultr",
|
|
39
|
-
// Explicit local-runtime providers with OpenAI-compatible streaming: both
|
|
40
|
-
// DeepSeek official and Ollama honor stream_options.include_usage on their
|
|
41
|
-
// chat.completions endpoints. Without them, locally-configured agents lose
|
|
42
|
-
// token statistics / local billing (the whitelist replaced the previous
|
|
43
|
-
// always-on include_usage). ollama-cloud is the Ollama Cloud subscription
|
|
44
|
-
// endpoint (https://ollama.com/v1), an OpenAI-compatible API that likewise
|
|
45
|
-
// honors stream_options.include_usage.
|
|
46
|
-
"deepseek",
|
|
47
|
-
"ollama",
|
|
48
|
-
"ollama-cloud",
|
|
49
|
-
// RunInfra hosted fallback channel: OpenAI-compatible chat.completions
|
|
50
|
-
// endpoint, supports stream_options.include_usage (measured to return
|
|
51
|
-
// prompt_tokens_details.cached_tokens).
|
|
52
|
-
"runinfra",
|
|
53
|
-
"baseten",
|
|
54
|
-
// Kimi For Coding subscription (api.kimi.com/coding/v1): OpenAI-compatible
|
|
55
|
-
// chat.completions streaming that only emits the terminal usage frame when
|
|
56
|
-
// stream_options.include_usage is requested (measured; the official
|
|
57
|
-
// kimi-code CLI also sends include_usage). Custom agents pointing at the
|
|
58
|
-
// same endpoint are covered by the endpoint check below, not here.
|
|
59
|
-
"kimi-code"
|
|
60
|
-
]);
|
|
61
|
-
var KIMI_CODE_ENDPOINT_MARKER = "api.kimi.com";
|
|
62
|
-
var isKimiCodeEndpoint = (endpoint) => typeof endpoint === "string" && endpoint.includes(KIMI_CODE_ENDPOINT_MARKER);
|
|
63
|
-
var EXTRA_USAGE_FIELD_PROVIDERS = /* @__PURE__ */ new Set(["openrouter"]);
|
|
64
|
-
var normalizeProviderName = (providerName) => asTrimmedLowercaseString(providerName);
|
|
65
|
-
var getUsageRequestOptions = (providerName, options) => {
|
|
66
|
-
const normalizedProvider = normalizeProviderName(providerName);
|
|
67
|
-
const api = options?.api ?? "chat-completions";
|
|
68
|
-
const shouldRequestStreamUsage = STREAM_USAGE_PROVIDERS.has(normalizedProvider) || normalizedProvider === "custom" && (isKimiCodeEndpoint(options?.endpoint) || isOllamaEndpoint(options?.endpoint));
|
|
69
|
-
if (api === "responses") {
|
|
70
|
-
return EXTRA_USAGE_FIELD_PROVIDERS.has(normalizedProvider) ? {
|
|
71
|
-
usage: {
|
|
72
|
-
include: true
|
|
73
|
-
}
|
|
74
|
-
} : {};
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
...shouldRequestStreamUsage ? {
|
|
78
|
-
stream_options: {
|
|
79
|
-
include_usage: true
|
|
80
|
-
}
|
|
81
|
-
} : {},
|
|
82
|
-
...EXTRA_USAGE_FIELD_PROVIDERS.has(normalizedProvider) ? {
|
|
83
|
-
usage: {
|
|
84
|
-
include: true
|
|
85
|
-
}
|
|
86
|
-
} : {}
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
91
|
-
function preserveAgentStateFields(source, target, options) {
|
|
92
|
-
const mutableTarget = target;
|
|
93
|
-
if (source.role === "assistant") {
|
|
94
|
-
if (!options?.stripReasoningContent && typeof source.reasoning_content === "string") {
|
|
95
|
-
mutableTarget.reasoning_content = source.reasoning_content;
|
|
96
|
-
}
|
|
97
|
-
if (Array.isArray(source.tool_calls)) {
|
|
98
|
-
mutableTarget.tool_calls = source.tool_calls;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (source.role === "tool") {
|
|
102
|
-
const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
|
|
103
|
-
if (toolCallId) mutableTarget.tool_call_id = toolCallId;
|
|
104
|
-
}
|
|
105
|
-
return target;
|
|
106
|
-
}
|
|
107
|
-
function toOpenAiCompatibleMessages(messages, options) {
|
|
108
|
-
return messages.map(
|
|
109
|
-
(message) => preserveAgentStateFields(message, {
|
|
110
|
-
role: message.role,
|
|
111
|
-
content: message.content ?? ""
|
|
112
|
-
}, options)
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
function shouldStripReasoningContentForOutbound(provider, model) {
|
|
116
|
-
const p = provider?.trim().toLowerCase();
|
|
117
|
-
const m = model?.trim().toLowerCase();
|
|
118
|
-
if (!p || !m) return false;
|
|
119
|
-
if (p === "deepseek" || p === "nolo") {
|
|
120
|
-
return m === "deepseek-flash" || m === "deepseek-v4-flash" || m === "deepseek-v4-flash-vision-exp" || m === "deepseek-v4-pro";
|
|
121
|
-
}
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// packages/integrations/openai/responsesHelpers.ts
|
|
126
|
-
var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
|
|
127
|
-
var sanitizeResponsesParameters = (parameters) => {
|
|
128
|
-
if (!isRecord(parameters)) {
|
|
129
|
-
return parameters;
|
|
130
|
-
}
|
|
131
|
-
const next = { ...parameters };
|
|
132
|
-
for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
|
|
133
|
-
delete next[key];
|
|
134
|
-
}
|
|
135
|
-
return next;
|
|
136
|
-
};
|
|
137
|
-
var appendTextPart = (parts, text, role) => {
|
|
138
|
-
if (!text) return;
|
|
139
|
-
const last = parts.at(-1);
|
|
140
|
-
const textType = role === "assistant" ? "output_text" : "input_text";
|
|
141
|
-
if (last?.type === textType) {
|
|
142
|
-
last.text += text;
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
parts.push({ type: textType, text });
|
|
146
|
-
};
|
|
147
|
-
var normalizeMessageParts = (content, role) => {
|
|
148
|
-
if (typeof content === "string") {
|
|
149
|
-
if (!content) return [];
|
|
150
|
-
return [
|
|
151
|
-
{
|
|
152
|
-
type: role === "assistant" ? "output_text" : "input_text",
|
|
153
|
-
text: content
|
|
154
|
-
}
|
|
155
|
-
];
|
|
156
|
-
}
|
|
157
|
-
const parts = [];
|
|
158
|
-
for (const part of content ?? []) {
|
|
159
|
-
const typedPart = part;
|
|
160
|
-
if (typedPart?.type === "text" && typeof typedPart.text === "string") {
|
|
161
|
-
appendTextPart(parts, typedPart.text, role);
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
|
|
165
|
-
if (role === "assistant") continue;
|
|
166
|
-
parts.push({
|
|
167
|
-
type: "input_image",
|
|
168
|
-
image_url: typedPart.image_url.url,
|
|
169
|
-
detail: typedPart.image_url.detail
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return parts;
|
|
174
|
-
};
|
|
175
|
-
var normalizeToolOutput = (content) => {
|
|
176
|
-
if (typeof content === "string") return content;
|
|
177
|
-
return JSON.stringify(content ?? "");
|
|
178
|
-
};
|
|
179
|
-
var toResponsesTools = (tools) => {
|
|
180
|
-
if (!Array.isArray(tools) || tools.length === 0) return void 0;
|
|
181
|
-
const normalized = tools.map((tool) => {
|
|
182
|
-
const fn = tool?.function;
|
|
183
|
-
const name = fn?.name ?? tool?.name;
|
|
184
|
-
if (!name) return null;
|
|
185
|
-
const parameters = fn?.parameters ?? tool?.parameters;
|
|
186
|
-
return {
|
|
187
|
-
type: "function",
|
|
188
|
-
name,
|
|
189
|
-
...typeof (fn?.description ?? tool?.description) === "string" ? { description: fn?.description ?? tool?.description } : {},
|
|
190
|
-
parameters: sanitizeResponsesParameters(parameters),
|
|
191
|
-
...fn?.strict !== void 0 || tool?.strict !== void 0 ? { strict: fn?.strict ?? tool?.strict } : {}
|
|
192
|
-
};
|
|
193
|
-
}).filter(Boolean);
|
|
194
|
-
return normalized.length > 0 ? normalized : void 0;
|
|
195
|
-
};
|
|
196
|
-
var convertMessagesToResponsesInput = (messages, options) => {
|
|
197
|
-
const input = [];
|
|
198
|
-
for (const message of messages) {
|
|
199
|
-
if (!message?.role) continue;
|
|
200
|
-
if (message.role === "tool") {
|
|
201
|
-
if (!message.tool_call_id) continue;
|
|
202
|
-
input.push({
|
|
203
|
-
type: "function_call_output",
|
|
204
|
-
call_id: message.tool_call_id,
|
|
205
|
-
output: normalizeToolOutput(message.content)
|
|
206
|
-
});
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
const role = message.role;
|
|
210
|
-
if (role === "assistant" && !options?.stripReasoningContent && typeof message.reasoning_content === "string" && message.reasoning_content) {
|
|
211
|
-
input.push({
|
|
212
|
-
type: "reasoning",
|
|
213
|
-
content: [
|
|
214
|
-
{ type: "reasoning_text", text: message.reasoning_content }
|
|
215
|
-
]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const contentParts = normalizeMessageParts(message.content, role);
|
|
219
|
-
if (contentParts.length > 0) {
|
|
220
|
-
input.push({
|
|
221
|
-
type: "message",
|
|
222
|
-
role,
|
|
223
|
-
content: contentParts
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
if (role === "assistant" && Array.isArray(message.content)) {
|
|
227
|
-
const replayImages = message.content.map((part) => part).filter(
|
|
228
|
-
(part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
|
|
229
|
-
).map((part) => ({
|
|
230
|
-
type: "input_image",
|
|
231
|
-
image_url: part.image_url.url,
|
|
232
|
-
detail: part.image_url.detail
|
|
233
|
-
}));
|
|
234
|
-
if (replayImages.length > 0) {
|
|
235
|
-
input.push({
|
|
236
|
-
type: "message",
|
|
237
|
-
role: "user",
|
|
238
|
-
content: replayImages
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (role === "assistant" && Array.isArray(message.tool_calls)) {
|
|
243
|
-
for (const toolCall of message.tool_calls) {
|
|
244
|
-
if (!toolCall?.id || !toolCall.function?.name) continue;
|
|
245
|
-
input.push({
|
|
246
|
-
type: "function_call",
|
|
247
|
-
call_id: toolCall.id,
|
|
248
|
-
name: toolCall.function.name,
|
|
249
|
-
arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return input;
|
|
255
|
-
};
|
|
256
|
-
var extractTextFromResponseOutput = (response) => {
|
|
257
|
-
const parts = [];
|
|
258
|
-
for (const item of response?.output ?? []) {
|
|
259
|
-
if (item?.type !== "message") continue;
|
|
260
|
-
for (const content of item.content ?? []) {
|
|
261
|
-
if (content?.type === "output_text" && typeof content.text === "string") {
|
|
262
|
-
parts.push(content.text);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return parts.join("");
|
|
267
|
-
};
|
|
268
|
-
var extractReasoningFromResponseOutput = (response) => {
|
|
269
|
-
const parts = [];
|
|
270
|
-
for (const item of response?.output ?? []) {
|
|
271
|
-
if (item?.type !== "reasoning") continue;
|
|
272
|
-
if (typeof item.content === "string") {
|
|
273
|
-
parts.push(item.content);
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
276
|
-
for (const content of item.content ?? []) {
|
|
277
|
-
if (typeof content === "string") parts.push(content);
|
|
278
|
-
else if (typeof content?.text === "string") parts.push(content.text);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return parts.join("");
|
|
282
|
-
};
|
|
283
|
-
var toDataUrl = (base64Data, mimeType) => {
|
|
284
|
-
const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
|
|
285
|
-
return `data:${normalizedMimeType};base64,${base64Data}`;
|
|
286
|
-
};
|
|
287
|
-
var extractImagePartsFromResponseOutput = (response) => {
|
|
288
|
-
const images = [];
|
|
289
|
-
for (const item of response?.output ?? []) {
|
|
290
|
-
if (item?.type === "image_generation_call") {
|
|
291
|
-
const result = asOptionalTrimmedString(item.result);
|
|
292
|
-
if (result) {
|
|
293
|
-
const outputFormat = asOptionalTrimmedString(item.output_format);
|
|
294
|
-
images.push({
|
|
295
|
-
type: "image_url",
|
|
296
|
-
image_url: {
|
|
297
|
-
url: toDataUrl(
|
|
298
|
-
result,
|
|
299
|
-
outputFormat ? `image/${outputFormat}` : void 0
|
|
300
|
-
)
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
if (item?.type !== "message") continue;
|
|
307
|
-
for (const content of item.content ?? []) {
|
|
308
|
-
const result = asOptionalTrimmedString(content?.result);
|
|
309
|
-
if (content?.type === "output_image" && result) {
|
|
310
|
-
images.push({
|
|
311
|
-
type: "image_url",
|
|
312
|
-
image_url: {
|
|
313
|
-
url: toDataUrl(
|
|
314
|
-
result,
|
|
315
|
-
content.mime_type ?? content.mimeType ?? null
|
|
316
|
-
)
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return images;
|
|
323
|
-
};
|
|
324
|
-
var extractToolCallsFromResponseOutput = (response) => {
|
|
325
|
-
const calls = [];
|
|
326
|
-
for (const item of response?.output ?? []) {
|
|
327
|
-
if (item?.type !== "function_call") continue;
|
|
328
|
-
if (!item.call_id || !item.name) continue;
|
|
329
|
-
calls.push({
|
|
330
|
-
id: item.call_id,
|
|
331
|
-
type: "function",
|
|
332
|
-
function: {
|
|
333
|
-
name: item.name,
|
|
334
|
-
arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
return calls;
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
// packages/agent-runtime/promptCacheKey.ts
|
|
342
|
-
function collectStablePromptPrefix(messages, fallbackPrompt) {
|
|
343
|
-
const systemTexts = [];
|
|
344
|
-
if (fallbackPrompt?.trim()) systemTexts.push(fallbackPrompt.trim());
|
|
345
|
-
for (const raw of messages) {
|
|
346
|
-
if (!raw || typeof raw !== "object") continue;
|
|
347
|
-
const message = raw;
|
|
348
|
-
const role = String(message.role ?? "");
|
|
349
|
-
if (role !== "system" && role !== "developer") continue;
|
|
350
|
-
if (typeof message.content === "string") {
|
|
351
|
-
const boundary = Number(message.stable_prefix_chars);
|
|
352
|
-
const text = Number.isFinite(boundary) && boundary > 0 ? message.content.slice(0, boundary) : message.content;
|
|
353
|
-
if (text.trim()) systemTexts.push(text.trim());
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return systemTexts.join("\n\n");
|
|
357
|
-
}
|
|
358
|
-
function stablePromptCacheKey(parts, namespace) {
|
|
359
|
-
const value = JSON.stringify(parts);
|
|
360
|
-
let hash = 2166136261;
|
|
361
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
362
|
-
hash ^= value.charCodeAt(index);
|
|
363
|
-
hash = Math.imul(hash, 16777619) >>> 0;
|
|
364
|
-
}
|
|
365
|
-
return `${namespace}-${hash.toString(16).padStart(8, "0")}`;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// packages/core/chat/imageParts.ts
|
|
369
|
-
function isImageUrlPart(part) {
|
|
370
|
-
return isRecord(part) && part.type === "image_url";
|
|
371
|
-
}
|
|
372
|
-
function hasImageParts(messages) {
|
|
373
|
-
return messages.some(
|
|
374
|
-
(message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export {
|
|
379
|
-
isOllamaEndpoint,
|
|
380
|
-
getUsageRequestOptions,
|
|
381
|
-
isImageUrlPart,
|
|
382
|
-
hasImageParts,
|
|
383
|
-
preserveAgentStateFields,
|
|
384
|
-
toOpenAiCompatibleMessages,
|
|
385
|
-
shouldStripReasoningContentForOutbound,
|
|
386
|
-
toResponsesTools,
|
|
387
|
-
convertMessagesToResponsesInput,
|
|
388
|
-
extractTextFromResponseOutput,
|
|
389
|
-
extractReasoningFromResponseOutput,
|
|
390
|
-
extractImagePartsFromResponseOutput,
|
|
391
|
-
extractToolCallsFromResponseOutput,
|
|
392
|
-
collectStablePromptPrefix,
|
|
393
|
-
stablePromptCacheKey
|
|
394
|
-
};
|
package/chunk-Q5FJJ6XI.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// packages/agent-runtime/devinOAuth.ts
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
var DEVIN_CONNECT_URL = "https://server.codeium.com/exa.api_server_pb.ApiServerService/GetChatMessage";
|
|
6
|
-
function buildDevinAuthUrl(orgId) {
|
|
7
|
-
const cleanOrg = orgId?.trim();
|
|
8
|
-
if (cleanOrg) {
|
|
9
|
-
return `https://app.devin.ai/org/${encodeURIComponent(cleanOrg)}/settings/keys`;
|
|
10
|
-
}
|
|
11
|
-
return "https://app.devin.ai/settings/keys";
|
|
12
|
-
}
|
|
13
|
-
function extractDevinToken(input) {
|
|
14
|
-
const raw = input?.trim();
|
|
15
|
-
if (!raw) return null;
|
|
16
|
-
if (/^https?:\/\//i.test(raw)) {
|
|
17
|
-
try {
|
|
18
|
-
const url = new URL(raw);
|
|
19
|
-
const queryToken = url.searchParams.get("token") || url.searchParams.get("access_token") || url.searchParams.get("auth_token");
|
|
20
|
-
if (queryToken?.trim()) return queryToken.trim();
|
|
21
|
-
if (url.hash) {
|
|
22
|
-
const hashParams = new URLSearchParams(url.hash.replace(/^#/, ""));
|
|
23
|
-
const hashToken = hashParams.get("token") || hashParams.get("access_token") || hashParams.get("auth_token");
|
|
24
|
-
if (hashToken?.trim()) return hashToken.trim();
|
|
25
|
-
}
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return raw || null;
|
|
30
|
-
}
|
|
31
|
-
function parseDevinCredentialsToml(content) {
|
|
32
|
-
for (const line of content.split(/\r?\n/)) {
|
|
33
|
-
const cogMatch = line.match(/(cog_[A-Za-z0-9_-]+)/);
|
|
34
|
-
if (cogMatch?.[1]) {
|
|
35
|
-
return cogMatch[1].trim();
|
|
36
|
-
}
|
|
37
|
-
const match = line.match(
|
|
38
|
-
/^\s*(?:windsurf_api_key|devin_api_key|api_key|api_token|token)\s*=\s*"([^"]+)"\s*$/i
|
|
39
|
-
);
|
|
40
|
-
if (match?.[1]) {
|
|
41
|
-
return match[1].trim();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function detectLocalDevinCredentials(options) {
|
|
47
|
-
const baseHome = options?.homeDir || homedir();
|
|
48
|
-
const xdgData = process.env.XDG_DATA_HOME;
|
|
49
|
-
const candidateCliPaths = [
|
|
50
|
-
xdgData ? join(xdgData, "devin", "credentials.toml") : null,
|
|
51
|
-
join(baseHome, ".local", "share", "devin", "credentials.toml"),
|
|
52
|
-
process.env.APPDATA ? join(process.env.APPDATA, "devin", "credentials.toml") : null
|
|
53
|
-
].filter((p) => Boolean(p));
|
|
54
|
-
for (const credPath of candidateCliPaths) {
|
|
55
|
-
if (existsSync(credPath)) {
|
|
56
|
-
try {
|
|
57
|
-
const content = readFileSync(credPath, "utf-8");
|
|
58
|
-
const token = parseDevinCredentialsToml(content);
|
|
59
|
-
if (token) {
|
|
60
|
-
return {
|
|
61
|
-
found: true,
|
|
62
|
-
token,
|
|
63
|
-
source: "devin-cli",
|
|
64
|
-
sourcePath: credPath
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
} catch {
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const codeiumPath = join(baseHome, ".codeium", "config.json");
|
|
72
|
-
if (existsSync(codeiumPath)) {
|
|
73
|
-
try {
|
|
74
|
-
const parsed = JSON.parse(readFileSync(codeiumPath, "utf-8"));
|
|
75
|
-
const token = parsed.apiKey || parsed.api_key;
|
|
76
|
-
if (token?.trim()) {
|
|
77
|
-
return {
|
|
78
|
-
found: true,
|
|
79
|
-
token: token.trim(),
|
|
80
|
-
source: "codeium-config",
|
|
81
|
-
sourcePath: codeiumPath
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
} catch {
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return { found: false };
|
|
88
|
-
}
|
|
89
|
-
function buildDevinOAuthCredential(token, now = Date.now()) {
|
|
90
|
-
return {
|
|
91
|
-
provider: "devin",
|
|
92
|
-
accessToken: token.trim(),
|
|
93
|
-
obtainedAt: now
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
DEVIN_CONNECT_URL,
|
|
99
|
-
buildDevinAuthUrl,
|
|
100
|
-
extractDevinToken,
|
|
101
|
-
detectLocalDevinCredentials,
|
|
102
|
-
buildDevinOAuthCredential
|
|
103
|
-
};
|
package/chunk-S7Z2HMCN.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// packages/cli/secretScan.ts
|
|
2
|
-
var SECRET_PATTERNS = [
|
|
3
|
-
{ label: "password", pattern: /\bpassword\s*[:=]\s*["']?[^"',\s#]{8,}/i },
|
|
4
|
-
{ label: "psk", pattern: /\bpsk\s*[:=]\s*["']?[^"',\s#]{8,}/i },
|
|
5
|
-
{ label: "api key", pattern: /\b(api[_-]?key|apikey)\s*[:=]\s*["']?[^"',\s#]{12,}/i },
|
|
6
|
-
{ label: "token", pattern: /\b(token|secret)\s*[:=]\s*["']?[^"',\s#]{12,}/i },
|
|
7
|
-
{ label: "private key", pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----/ }
|
|
8
|
-
];
|
|
9
|
-
function findPotentialSecrets(text) {
|
|
10
|
-
return text.split(/\r?\n/).flatMap(
|
|
11
|
-
(line, index) => SECRET_PATTERNS.filter(({ pattern }) => pattern.test(line)).map(({ label }) => ({
|
|
12
|
-
label,
|
|
13
|
-
line: index + 1,
|
|
14
|
-
preview: line.length > 120 ? `${line.slice(0, 117)}...` : line
|
|
15
|
-
}))
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
function formatSecretFindings(findings) {
|
|
19
|
-
return findings.map((finding) => ` line ${finding.line} (${finding.label}): ${finding.preview}`).join("\n");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
findPotentialSecrets,
|
|
24
|
-
formatSecretFindings
|
|
25
|
-
};
|