@nervekit/desktop 0.42.0 → 0.43.0
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/THIRD-PARTY-LICENSES.txt +210 -16
- package/dist/builtin/configure-nerve/SKILL.md +19 -10
- package/dist/builtin/configure-nerve/reference/agent-preferences.md +9 -0
- package/dist/builtin/configure-nerve/reference/agent-profiles.md +2 -6
- package/dist/builtin/configure-nerve/reference/agents-md.md +1 -1
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/artifacts.d.ts +10 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/text.d.ts +4 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/collections/match-terms.d.ts +8 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/callout/callout.svelte.d.ts +1 -1
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/display/status.d.ts +3 -0
- package/dist/builtin/configure-nerve/{guide/extensions.md → reference/extensions/build.md} +4 -4
- package/dist/builtin/configure-nerve/reference/extensions/manifest.md +1 -1
- package/dist/builtin/configure-nerve/reference/extensions/overview.md +2 -2
- package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/lib.mjs +2 -2
- package/dist/builtin/configure-nerve/reference/extensions/scripts/nerve-version.json +1 -0
- package/dist/builtin/configure-nerve/reference/extensions/sharing.md +2 -2
- package/dist/builtin/configure-nerve/reference/extensions/themes.md +1 -1
- package/dist/builtin/configure-nerve/reference/permissions.md +2 -2
- package/dist/builtin/configure-nerve/reference/prompt-suggestions.md +2 -2
- package/dist/builtin/configure-nerve/reference/skills.md +9 -9
- package/dist/{chunk-QFK2SWD2.js → chunk-34SYO66C.js} +11 -11
- package/dist/{chunk-6ZS7TA6E.js → chunk-35O66NLU.js} +2 -2
- package/dist/{chunk-7FSH3ABG.js → chunk-57A5HFXL.js} +4 -4
- package/dist/{chunk-EF7ZZKA3.js → chunk-5K7U6UXA.js} +3 -3
- package/dist/{chunk-WIQEPAUG.js → chunk-5S5O3V5G.js} +11 -10
- package/dist/{chunk-MTHLTFG4.js → chunk-5VLAJMQQ.js} +97 -105
- package/dist/{chunk-MI6L5CEA.js → chunk-5WMHGTVL.js} +2 -2
- package/dist/{chunk-NVVW3MWJ.js → chunk-6IJORN3N.js} +9 -9
- package/dist/{chunk-OMCM3MHS.js → chunk-7GSR2AW5.js} +10 -9
- package/dist/{chunk-WG62RHZ2.js → chunk-7MJT6LHU.js} +14 -4
- package/dist/{chunk-DDBE2VLT.js → chunk-A3OFIREH.js} +2 -2
- package/dist/{chunk-ZGWXLG5X.js → chunk-BNBEFI2M.js} +66 -76
- package/dist/{chunk-7RPHIJT3.js → chunk-C7L4BBGD.js} +4 -4
- package/dist/{chunk-2ICPO4UM.js → chunk-CZXRZEV4.js} +16 -14
- package/dist/{chunk-H5CAHDII.js → chunk-EBDLSTDH.js} +51414 -50054
- package/dist/{chunk-PVPJAGWR.js → chunk-EOZLBW5E.js} +2 -2
- package/dist/{chunk-U5KGV63C.js → chunk-EZJH7ED5.js} +1 -1
- package/dist/{chunk-RL52LSTV.js → chunk-F3X2KHP4.js} +1 -1
- package/dist/{chunk-Q3C7TQ2M.js → chunk-FNWUCFVO.js} +3 -3
- package/dist/chunk-FQVIQOV5.js +163 -0
- package/dist/{chunk-LP4APBBQ.js → chunk-FZ7U3GZI.js} +1 -1
- package/dist/{chunk-MBMZEIOG.js → chunk-G5SVCJCT.js} +38 -51
- package/dist/{chunk-62DQXVPO.js → chunk-HDTS5AS5.js} +26 -7
- package/dist/{chunk-376GN4PB.js → chunk-HKBJTS2Z.js} +173 -79
- package/dist/{chunk-WC5HHPPM.js → chunk-HRJJKZGM.js} +1 -1
- package/dist/chunk-I7OMW4RJ.js +87 -0
- package/dist/{chunk-TQURLRHD.js → chunk-IL67WXRA.js} +1 -1
- package/dist/{chunk-QDEH776O.js → chunk-KBBBQCYV.js} +179 -20
- package/dist/{chunk-KUFIFCB4.js → chunk-KDGUQYYY.js} +1 -1
- package/dist/{chunk-IRRR3PWN.js → chunk-KQD4DYEP.js} +68 -35
- package/dist/{chunk-JBEWFFOK.js → chunk-LIIGX2XX.js} +1 -1
- package/dist/{chunk-IVBMHEPK.js → chunk-LX33FMTS.js} +23 -36
- package/dist/{chunk-HPINJGBO.js → chunk-METH7J6V.js} +13 -12
- package/dist/{chunk-N6BUYKF3.js → chunk-MLE6MKPY.js} +7 -7
- package/dist/{chunk-3CZXUKLG.js → chunk-MRDORR5Z.js} +8 -1
- package/dist/{chunk-6IHXVT5H.js → chunk-NSISYP6D.js} +1 -1
- package/dist/{chunk-P72Y5ZBH.js → chunk-O2IYZBX6.js} +15 -26
- package/dist/{chunk-TSAUBRRU.js → chunk-P7GPT4XL.js} +1 -1
- package/dist/{chunk-F5XCJ6UV.js → chunk-PA37GH3T.js} +33 -58
- package/dist/{chunk-BACYVEE6.js → chunk-QC6DSC4D.js} +2 -2
- package/dist/{chunk-ZVH6EB7S.js → chunk-QKRWXA5W.js} +1 -1
- package/dist/{chunk-D6C32XHS.js → chunk-QQPLW3ZX.js} +17359 -12634
- package/dist/chunk-QQPLW3ZX.js.LEGAL.txt +59 -0
- package/dist/{chunk-N4OXAS3A.js → chunk-R22FWLXU.js} +1 -1
- package/dist/{chunk-7HGFEQSD.js → chunk-R7UJIPJA.js} +5 -5
- package/dist/{chunk-NW3DH7IK.js → chunk-RAHBWFWV.js} +8457 -2726
- package/dist/{chunk-O5JHHRFN.js → chunk-RMV6IZ2C.js} +32 -116
- package/dist/{chunk-Z6AY5VOZ.js → chunk-RQIN5JYO.js} +9 -6
- package/dist/{chunk-Q5E4ZL2R.js → chunk-S2UG5HD6.js} +1 -1
- package/dist/{chunk-U3TEC52G.js → chunk-S637DPAG.js} +1 -1
- package/dist/chunk-S6KM4DOB.js +37 -0
- package/dist/{chunk-MPDKZVHT.js → chunk-SVX46YXY.js} +1 -3
- package/dist/{chunk-XTUSLUQ7.js → chunk-TLDULBKV.js} +70 -24
- package/dist/{chunk-L5WGVYXM.js → chunk-UFE7IMKQ.js} +2 -2
- package/dist/{chunk-ZUWBEV2O.js → chunk-UQHUYEFW.js} +1 -1
- package/dist/{chunk-XM27UVWN.js → chunk-V7WOX4O7.js} +3 -3
- package/dist/{chunk-W7LEYYFH.js → chunk-WJAHXDL4.js} +41 -32
- package/dist/{chunk-6GUJQURI.js → chunk-WLTE6OJM.js} +2 -2
- package/dist/{chunk-BG2KGLIA.js → chunk-WMZAJ7XA.js} +2 -2
- package/dist/chunk-WOLKTL4F.js +32 -0
- package/dist/{chunk-DHIDYKXJ.js → chunk-XIVWNWL7.js} +1778 -1701
- package/dist/{chunk-EUT45AKW.js → chunk-YODV42KQ.js} +25 -32
- package/dist/{chunk-FCAIYPDJ.js → chunk-ZFFWWZIA.js} +2 -2
- package/dist/{chunk-O6FDXE54.js → chunk-ZVUAJ7UV.js} +25 -36
- package/dist/daemon.js +15 -15
- package/dist/ext-frame/base.css +1 -1
- package/dist/extension-assets/atlassian/docs/confluence-writing.md +5 -5
- package/dist/extension-assets/diagram/bundle.js +3 -0
- package/dist/git-isolated-reader-helper.js +1 -1
- package/dist/main.js +57 -128
- package/dist/quick-script-docs/runtime/artifacts.md +11 -0
- package/dist/quick-script-docs/runtime/documents.md +21 -12
- package/dist/quick-script-docs/runtime/editing.md +44 -0
- package/dist/quick-script-docs/runtime/images.md +1 -1
- package/dist/sandbox-libraries/credential-runtime.js +3 -0
- package/dist/sandbox-libraries/extension-runtime.js +3 -0
- package/dist/web/assets/{AsyncBashCenterHost-DldW4utc.js → AsyncBashCenterHost-Dcx6zVCo.js} +1 -1
- package/dist/web/assets/{ConversationListItem-CCaGnyA1.js → ConversationListItem-DALhochc.js} +3 -3
- package/dist/web/assets/{ConversationsWorkbenchPanel-DLM3saY5.js → ConversationsWorkbenchPanel-ChtoTW2H.js} +1 -1
- package/dist/web/assets/{DiscoverCenterHost-DVNL8uZQ.js → DiscoverCenterHost-Bju7ypB-.js} +1 -1
- package/dist/web/assets/{ExtensionPageCenterHost-CHKg6c3M.js → ExtensionPageCenterHost-BO-5q4j_.js} +1 -1
- package/dist/web/assets/FileCenterComposedHost-BxLlLMBI.js +1 -0
- package/dist/web/assets/{FilesWorkbenchPanel-BxjUf50f.js → FilesWorkbenchPanel-jyqwIQAe.js} +4 -4
- package/dist/web/assets/{GitDiffCenterHost-DmtKqHer.js → GitDiffCenterHost-D8i3Jq9A.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-BmyMyvL8.js → GitWorkbenchPanel-CtZPJKqJ.js} +1 -1
- package/dist/web/assets/{LaunchCenterHost-1xrIDf73.js → LaunchCenterHost-CSy1io6s.js} +1 -1
- package/dist/web/assets/{LaunchConfigurationNotice-BfRdIOv0.js → LaunchConfigurationNotice-DugBa05c.js} +1 -1
- package/dist/web/assets/{LaunchesWorkbenchPanel-BhCyWFHf.js → LaunchesWorkbenchPanel-CNqGG_AP.js} +1 -1
- package/dist/web/assets/{LogStream-CibF_jgC.js → LogStream-DfJ4LiCv.js} +1 -1
- package/dist/web/assets/{LogsCenterHost-CdqD6zH8.js → LogsCenterHost-xynA0TWK.js} +1 -1
- package/dist/web/assets/{MermaidCenterHost-BjwJLU-2.js → MermaidCenterHost-kAV1ocvE.js} +1 -1
- package/dist/web/assets/MobileFilesBody-CiwIT8Vf.js +1 -0
- package/dist/web/assets/MobileFilesHost-DvQOpQFH.js +1 -0
- package/dist/web/assets/MobileLaunchOutputHost-pFJgIV1_.js +1 -0
- package/dist/web/assets/MobileLaunchesHost-0VtdW0x8.js +2 -0
- package/dist/web/assets/{MobileNoteEditorHost-lfAeMVH9.js → MobileNoteEditorHost-DSuZ0mU5.js} +1 -1
- package/dist/web/assets/{MobileNotesHost-DOi0goPc.js → MobileNotesHost-Lg699XCv.js} +2 -2
- package/dist/web/assets/MobileSettingsHost-Bv1P74ck.js +2 -0
- package/dist/web/assets/{MobileSettingsPageHost-CtpUzfVG.js → MobileSettingsPageHost-DudFqhZC.js} +1 -1
- package/dist/web/assets/{NotesWorkbenchPanel-CsbMYHAw.js → NotesWorkbenchPanel-C8sctQWR.js} +1 -1
- package/dist/web/assets/{PullRequestCenterHost-B22Ua7bA.js → PullRequestCenterHost-BWJ-exw1.js} +1 -1
- package/dist/web/assets/{PullRequestsWorkbenchPanel-DOIHvZ6H.js → PullRequestsWorkbenchPanel-8Fb0-hW3.js} +1 -1
- package/dist/web/assets/SearchWorkbenchPanel-B35YmwtL.js +1 -0
- package/dist/web/assets/SettingsCenterHost-BuiirrId.js +1 -0
- package/dist/web/assets/SystemPromptCenterHost-BqKV92Ew.js +2 -0
- package/dist/web/assets/{ThemePreviewPicker-B_DTUsui.js → ThemePreviewPicker-C6J0H91i.js} +1 -1
- package/dist/web/assets/adapters-C5HB2cBr.js +1 -0
- package/dist/web/assets/agent-profiles.svelte-DjdXLJnE.js +1 -0
- package/dist/web/assets/appearance.svelte-fB4gKc-X.js +1 -0
- package/dist/web/assets/center-tabs.svelte-8YpJhA1o.js +2 -0
- package/dist/web/assets/{channel-CxF1CmEY.js → channel-3Wv484LF.js} +2 -2
- package/dist/web/assets/{client-CVZRorEj.js → client-CjIsgPXA.js} +1 -1
- package/dist/web/assets/code-BDTZAlQg.js +7 -0
- package/dist/web/assets/conversation-activity-CZJfUGoL.js +1 -0
- package/dist/web/assets/conversation-connection-Dm9Zr6Yb.js +1 -0
- package/dist/web/assets/discover-Cwv6pB0p.js +4 -0
- package/dist/web/assets/{dist-DZN4bTV3.js → dist-BB4fpXjy.js} +1 -1
- package/dist/web/assets/{dist-DkQMSgZ5.js → dist-BBlCv_-z.js} +1 -1
- package/dist/web/assets/{dist-HTsJAisd.js → dist-BENZZeCy.js} +1 -1
- package/dist/web/assets/{dist-BWsookwC.js → dist-BqcaQXZ-.js} +1 -1
- package/dist/web/assets/{dist-CDM0qUmO.js → dist-CIK1TmOX.js} +1 -1
- package/dist/web/assets/{dist-EmwCDpCc.js → dist-DUPZ8ZaX.js} +1 -1
- package/dist/web/assets/{dist-BVmTdBxj.js → dist-DoKRJEPu.js} +1 -1
- package/dist/web/assets/{easing-DfoPn4-z.js → easing-B6dSt4eu.js} +1 -1
- package/dist/web/assets/empty-CtUlV5QU.js +1 -0
- package/dist/web/assets/eraser-B8qFMviR.js +1 -0
- package/dist/web/assets/{extension-themes.svelte-BAce41Wm.js → extension-themes.svelte-D2TAUtUA.js} +2 -2
- package/dist/web/assets/{file-tabs.svelte-CaZRhyw0.js → file-tabs.svelte-DxL_vZZv.js} +2 -2
- package/dist/web/assets/{files-dFQS0tcX.css → files-N9JiAfxr.css} +1 -1
- package/dist/web/assets/files-vq7_WbHL.js +156 -0
- package/dist/web/assets/filesystem-DiVFVMn3.js +1 -0
- package/dist/web/assets/floating-toolbar-Cqtfs8M7.js +1 -0
- package/dist/web/assets/{git-store.svelte-DkeLA_WZ.js → git-store.svelte-D9S4P9gI.js} +1 -1
- package/dist/web/assets/{icon-action-efe9ZEWq.js → icon-action-C9h3TdBz.js} +1 -1
- package/dist/web/assets/index-B8XniJoh.js +165 -0
- package/dist/web/assets/index-DC_ohlBG.css +1 -0
- package/dist/web/assets/{launches-ZxeZFPI8.js → launches-CmB4KShL.js} +5 -5
- package/dist/web/assets/launches.api-C4z0obJK.js +1 -0
- package/dist/web/assets/{launches.svelte-QFDoCgug.js → launches.svelte-D2bNAphM.js} +2 -2
- package/dist/web/assets/{logs.api-gZ2mVC9q.js → logs.api-BtGxtYFi.js} +1 -1
- package/dist/web/assets/{maintenance-state.svelte-xMmmI9yr.js → maintenance-state.svelte-BusQWeCR.js} +2 -2
- package/dist/web/assets/menu-icons-DLuZ586C.js +1 -0
- package/dist/web/assets/{mermaid-ACpEwsfj.js → mermaid-DL5xfcqL.js} +1 -1
- package/dist/web/assets/mobile-launch-rows-DR6V5AUH.js +1 -0
- package/dist/web/assets/page-tabs.svelte-Cc5F8hMx.js +4 -0
- package/dist/web/assets/panel-BW0llJiU.js +1 -0
- package/dist/web/assets/popover-panel-SA7quIc1.js +4 -0
- package/dist/web/assets/{pr-view-loader.svelte-CZfxwzwL.js → pr-view-loader.svelte-eOmDNaGf.js} +1 -1
- package/dist/web/assets/progress-BZbo8ynI.js +1 -0
- package/dist/web/assets/{scratch-notes-state.svelte-rBeSOn4h.js → scratch-notes-state.svelte-B4NySamQ.js} +1 -1
- package/dist/web/assets/{scratch-notes.api-Co80EGtL.js → scratch-notes.api-BMBs2yoU.js} +1 -1
- package/dist/web/assets/settings-Cu_0wNkX.js +1 -0
- package/dist/web/assets/settings-DTw27q0i.js +1 -0
- package/dist/web/assets/settings-scope-Bz4U5ImL.js +35 -0
- package/dist/web/assets/shell-BiZy0tcZ.js +1 -0
- package/dist/web/assets/{shell-layout.svelte-D5u4i1UJ.js → shell-layout.svelte-Dyx_fbRn.js} +2 -2
- package/dist/web/assets/{lock-open-BBTCOUg5.js → tag-Bp1l7psd.js} +1 -1
- package/dist/web/assets/time-egBWJGDu.js +1 -0
- package/dist/web/assets/views-DIrSFdZB.js +2 -0
- package/dist/web/assets/{workbench-connection-Gsy9bIuP.js → workbench-connection-BpvUZMVX.js} +1 -1
- package/dist/web/assets/workspace-actions.svelte-DE0mQsY6.js +1 -0
- package/dist/web/assets/{workspace-selectors.svelte-D-EQR_-Z.js → workspace-selectors.svelte-B90FdGfV.js} +2 -2
- package/dist/web/assets/{workspace-CUoFFOwJ.js → workspace-uXAUsF3x.js} +1 -1
- package/dist/web/index.html +47 -47
- package/dist/web/sw.js +1 -1
- package/dist/worker.js +14 -14
- package/package.json +7 -7
- package/dist/builtin/configure-nerve/guide/collaboration.md +0 -15
- package/dist/builtin/configure-nerve/scripts/nerve-version.json +0 -1
- package/dist/chunk-D6C32XHS.js.LEGAL.txt +0 -25
- package/dist/chunk-RJR7DJJK.js +0 -32
- package/dist/chunk-UVRULOOP.js +0 -35
- package/dist/quick-script-docs/runtime/files.md +0 -11
- package/dist/web/assets/FileCenterComposedHost-kxFWeFmP.js +0 -1
- package/dist/web/assets/MobileFilesBody-4bLT2m0j.js +0 -1
- package/dist/web/assets/MobileFilesHost-X_0r4Z16.js +0 -1
- package/dist/web/assets/MobileLaunchOutputHost-BEchaBtD.js +0 -1
- package/dist/web/assets/MobileLaunchesHost-S7Z3DySI.js +0 -2
- package/dist/web/assets/MobileSettingsHost-94-sABuO.js +0 -2
- package/dist/web/assets/SearchWorkbenchPanel-CKccBrNr.js +0 -1
- package/dist/web/assets/SettingsCenterHost-BM-xIy5S.js +0 -1
- package/dist/web/assets/SystemPromptCenterHost-VL4DXNId.js +0 -1
- package/dist/web/assets/adapters-CbIIxNp9.js +0 -1
- package/dist/web/assets/agent-profiles.svelte-8LAIYKmb.js +0 -1
- package/dist/web/assets/appearance.svelte-CLR_fMAx.js +0 -1
- package/dist/web/assets/center-tabs.svelte-BCriw5Eu.js +0 -1
- package/dist/web/assets/code-H_8FkG35.js +0 -7
- package/dist/web/assets/conversation-activity-Dl7udunb.js +0 -1
- package/dist/web/assets/conversation-connection-B226pY9T.js +0 -1
- package/dist/web/assets/discover-DTlfL84I.js +0 -4
- package/dist/web/assets/empty-B8eEKvqc.js +0 -1
- package/dist/web/assets/file-code-CMYYNL9l.js +0 -1
- package/dist/web/assets/files-eAvb-uRC.js +0 -48
- package/dist/web/assets/filesystem-CmkTuQNl.js +0 -1
- package/dist/web/assets/floating-toolbar-BwJ2tdsN.js +0 -1
- package/dist/web/assets/index-CH1Mvlxk.css +0 -1
- package/dist/web/assets/index-DNfABG4x.js +0 -172
- package/dist/web/assets/launches.api-BEsX6AKZ.js +0 -1
- package/dist/web/assets/menu-icons-C24r3TCF.js +0 -1
- package/dist/web/assets/mobile-launch-rows-Ci7ldwx6.js +0 -1
- package/dist/web/assets/page-tabs.svelte-VZp38ac7.js +0 -4
- package/dist/web/assets/panel-DEG1zXHj.js +0 -1
- package/dist/web/assets/popover-panel-B1cUdhY5.js +0 -5
- package/dist/web/assets/progress-D2Cb6vK_.js +0 -1
- package/dist/web/assets/settings-B_ed0eye.js +0 -1
- package/dist/web/assets/settings-Dzj6Az_d.js +0 -1
- package/dist/web/assets/settings-scope-BjQBgG9v.js +0 -33
- package/dist/web/assets/shell-CbR1KanT.js +0 -1
- package/dist/web/assets/time-DqcZ_PFK.js +0 -1
- package/dist/web/assets/views-D4ociG21.js +0 -2
- package/dist/web/assets/workspace-actions.svelte-BMp3D2e1.js +0 -1
- /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/create-extension.mjs +0 -0
- /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/install-extension.mjs +0 -0
- /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/upgrade-extension.mjs +0 -0
- /package/dist/builtin/configure-nerve/{reference/writing-for-agents.md → writing-for-agents.md} +0 -0
- /package/dist/{chunk-H5CAHDII.js.LEGAL.txt → chunk-EBDLSTDH.js.LEGAL.txt} +0 -0
|
@@ -2,47 +2,50 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
combineAbortSignals
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UQHUYEFW.js";
|
|
6
|
+
import {
|
|
7
|
+
SseDecoder
|
|
8
|
+
} from "./chunk-I7OMW4RJ.js";
|
|
6
9
|
import {
|
|
7
10
|
shortHash
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FZ7U3GZI.js";
|
|
9
12
|
import {
|
|
10
13
|
buildBaseOptions,
|
|
11
14
|
getJsonSchemaToolParameters,
|
|
12
15
|
resolveJsonSchemaStrictSampling,
|
|
13
16
|
transformMessages
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RQIN5JYO.js";
|
|
15
18
|
import {
|
|
16
19
|
sanitizeSurrogates
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-P7GPT4XL.js";
|
|
18
21
|
import {
|
|
19
22
|
truncateErrorText
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EOZLBW5E.js";
|
|
21
24
|
import {
|
|
22
25
|
headersToRecord
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NSISYP6D.js";
|
|
24
27
|
import {
|
|
25
28
|
ToolCallArgumentsStream
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-WMZAJ7XA.js";
|
|
27
30
|
import {
|
|
28
31
|
calculateCost,
|
|
29
32
|
clampThinkingLevel,
|
|
30
33
|
getCurrentTools,
|
|
31
34
|
resolveTranscript
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-WJAHXDL4.js";
|
|
33
36
|
import {
|
|
34
37
|
AssistantMessageEventStream
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-A3OFIREH.js";
|
|
36
39
|
import {
|
|
37
40
|
getIdentityHeaders
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-FNWUCFVO.js";
|
|
39
42
|
import {
|
|
40
43
|
getSystemMessageText,
|
|
41
44
|
renderSystemMessageUpdate
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-EZJH7ED5.js";
|
|
43
46
|
import "./chunk-CWESUMYQ.js";
|
|
44
47
|
|
|
45
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
48
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js
|
|
46
49
|
var MISTRAL_TOOL_CALL_ID_LENGTH = 9;
|
|
47
50
|
var MAX_MISTRAL_ERROR_BODY_CHARS = 4e3;
|
|
48
51
|
var stream = (model, context, options) => {
|
|
@@ -313,8 +316,7 @@ function isMistralRecord(value) {
|
|
|
313
316
|
var MISTRAL_STREAM_DONE = /* @__PURE__ */ Symbol("mistral-stream-done");
|
|
314
317
|
async function* readMistralEvents(body, signal) {
|
|
315
318
|
const reader = body.getReader();
|
|
316
|
-
const
|
|
317
|
-
let buffer = "";
|
|
319
|
+
const sse = new SseDecoder();
|
|
318
320
|
const onAbort = () => {
|
|
319
321
|
void reader.cancel().catch(() => {
|
|
320
322
|
});
|
|
@@ -327,25 +329,17 @@ async function* readMistralEvents(body, signal) {
|
|
|
327
329
|
const { done, value } = await reader.read();
|
|
328
330
|
if (signal?.aborted)
|
|
329
331
|
throw signal.reason;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const event = parseMistralEvent(buffer.slice(0, boundary.index));
|
|
334
|
-
buffer = buffer.slice(boundary.index + boundary.length);
|
|
332
|
+
const events = done ? sse.end() : sse.push(value);
|
|
333
|
+
for (const { data } of events) {
|
|
334
|
+
const event = parseMistralEvent(data.trim());
|
|
335
335
|
if (event === MISTRAL_STREAM_DONE)
|
|
336
336
|
return;
|
|
337
337
|
if (event)
|
|
338
338
|
yield event;
|
|
339
|
-
boundary = findMistralEventBoundary(buffer);
|
|
340
339
|
}
|
|
341
340
|
if (done)
|
|
342
341
|
break;
|
|
343
342
|
}
|
|
344
|
-
if (buffer.trim()) {
|
|
345
|
-
const event = parseMistralEvent(buffer);
|
|
346
|
-
if (event !== MISTRAL_STREAM_DONE && event)
|
|
347
|
-
yield event;
|
|
348
|
-
}
|
|
349
343
|
} finally {
|
|
350
344
|
signal?.removeEventListener("abort", onAbort);
|
|
351
345
|
try {
|
|
@@ -358,12 +352,7 @@ async function* readMistralEvents(body, signal) {
|
|
|
358
352
|
}
|
|
359
353
|
}
|
|
360
354
|
}
|
|
361
|
-
function
|
|
362
|
-
const match = /\r\n\r\n|\r\n\r|\r\n\n|\r\r\n|\n\r\n|\r\r|\n\r|\n\n/u.exec(buffer);
|
|
363
|
-
return match?.index === void 0 ? void 0 : { index: match.index, length: match[0].length };
|
|
364
|
-
}
|
|
365
|
-
function parseMistralEvent(raw) {
|
|
366
|
-
const data = raw.split(/\r\n|\r|\n/u).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trimStart()).join("\n").trim();
|
|
355
|
+
function parseMistralEvent(data) {
|
|
367
356
|
if (!data)
|
|
368
357
|
return void 0;
|
|
369
358
|
if (data === "[DONE]")
|
|
@@ -382,7 +371,7 @@ function buildChatPayload(model, context, messages, options) {
|
|
|
382
371
|
};
|
|
383
372
|
const currentTools = getCurrentTools(context.messages);
|
|
384
373
|
if (currentTools.length > 0)
|
|
385
|
-
payload.tools = toFunctionTools(currentTools);
|
|
374
|
+
payload.tools = toFunctionTools(currentTools, model.compat?.supportsStrictMode ?? false);
|
|
386
375
|
if (options?.temperature !== void 0)
|
|
387
376
|
payload.temperature = options.temperature;
|
|
388
377
|
if (options?.maxTokens !== void 0)
|
|
@@ -557,9 +546,9 @@ async function consumeChatStream(model, output, stream2, mistralStream, onProvid
|
|
|
557
546
|
});
|
|
558
547
|
}
|
|
559
548
|
}
|
|
560
|
-
function toFunctionTools(tools) {
|
|
549
|
+
function toFunctionTools(tools, supportsStrictMode) {
|
|
561
550
|
return tools.map((tool) => {
|
|
562
|
-
const strict = resolveJsonSchemaStrictSampling(tool,
|
|
551
|
+
const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictMode);
|
|
563
552
|
return {
|
|
564
553
|
type: "function",
|
|
565
554
|
function: {
|
|
@@ -709,8 +698,6 @@ function mapChatStopReason(reason) {
|
|
|
709
698
|
return { stopReason: "length" };
|
|
710
699
|
case "tool_calls":
|
|
711
700
|
return { stopReason: "toolUse" };
|
|
712
|
-
case "error":
|
|
713
|
-
return { stopReason: "error", errorMessage: "Provider stopped with: error (server error)" };
|
|
714
701
|
default:
|
|
715
702
|
return { stopReason: "error", errorMessage: `Provider stopped with: ${reason}` };
|
|
716
703
|
}
|
|
@@ -2,19 +2,19 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
sleep
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HRJJKZGM.js";
|
|
6
6
|
import {
|
|
7
7
|
trustedHttpUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S2UG5HD6.js";
|
|
9
9
|
import {
|
|
10
10
|
pollOAuthDeviceCodeFlow
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-S637DPAG.js";
|
|
12
12
|
import {
|
|
13
13
|
GITHUB_COPILOT_MODELS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WOLKTL4F.js";
|
|
15
15
|
import "./chunk-CWESUMYQ.js";
|
|
16
16
|
|
|
17
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
17
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js
|
|
18
18
|
var decode = (s) => atob(s);
|
|
19
19
|
var CLIENT_ID = decode("SXYxLmI1MDdhMDhjODdlY2ZlOTg=");
|
|
20
20
|
var COPILOT_HEADERS = {
|
|
@@ -80,16 +80,18 @@ function parseGitHubCopilotModelCatalog(raw, allowPolicyFallback) {
|
|
|
80
80
|
return [
|
|
81
81
|
{
|
|
82
82
|
id,
|
|
83
|
+
type: capabilities?.type,
|
|
83
84
|
pickerEnabled: item.model_picker_enabled === true,
|
|
84
85
|
policyState: asRecord(item.policy)?.state
|
|
85
86
|
}
|
|
86
87
|
];
|
|
87
88
|
});
|
|
89
|
+
const classifierModelIds = accountModels.filter((model) => model.type === "decisions" && model.policyState !== "disabled").map((model) => model.id);
|
|
88
90
|
const pickerModelIds = accountModels.filter((model) => model.pickerEnabled && model.policyState !== "disabled").map((model) => model.id);
|
|
89
91
|
const usePolicyFallback = allowPolicyFallback && pickerModelIds.length === 0;
|
|
90
92
|
const availableModelIds = pickerModelIds.length > 0 || !allowPolicyFallback ? pickerModelIds : accountModels.filter((model) => model.policyState === "enabled").map((model) => model.id);
|
|
91
93
|
const policyModelIds = accountModels.filter((model) => model.policyState === "unconfigured" && Object.hasOwn(GITHUB_COPILOT_MODELS, model.id) && (model.pickerEnabled || usePolicyFallback)).map((model) => model.id);
|
|
92
|
-
return { availableModelIds, policyModelIds };
|
|
94
|
+
return { availableModelIds, classifierModelIds, policyModelIds };
|
|
93
95
|
}
|
|
94
96
|
async function fetchWithRateLimitRetry(url, init, signal, retryPolicy) {
|
|
95
97
|
const retryBudgetSignal = retryPolicy.maxRetries > 0 && retryPolicy.maxElapsedMs > 0 ? AbortSignal.timeout(retryPolicy.maxElapsedMs) : void 0;
|
|
@@ -248,13 +250,11 @@ async function refreshGitHubCopilotAccessToken(refreshToken, enterpriseDomain, s
|
|
|
248
250
|
}
|
|
249
251
|
async function refreshGitHubCopilotToken(refreshToken, enterpriseDomain, signal) {
|
|
250
252
|
const credentials = await refreshGitHubCopilotAccessToken(refreshToken, enterpriseDomain, signal);
|
|
251
|
-
const { availableModelIds } = await fetchGitHubCopilotModels(credentials.access, enterpriseDomain, signal, {
|
|
252
|
-
maxRetries: 0,
|
|
253
|
-
maxElapsedMs: 0
|
|
254
|
-
});
|
|
253
|
+
const { availableModelIds, classifierModelIds } = await fetchGitHubCopilotModels(credentials.access, enterpriseDomain, signal, { maxRetries: 0, maxElapsedMs: 0 });
|
|
255
254
|
return {
|
|
256
255
|
...credentials,
|
|
257
|
-
availableModelIds
|
|
256
|
+
availableModelIds,
|
|
257
|
+
availableClassifierModelIds: classifierModelIds
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
260
|
async function enableGitHubCopilotModel(token, modelId, enterpriseDomain, signal) {
|
|
@@ -332,7 +332,8 @@ async function loginGitHubCopilot(interaction) {
|
|
|
332
332
|
}
|
|
333
333
|
return {
|
|
334
334
|
...credentials,
|
|
335
|
-
availableModelIds: [.../* @__PURE__ */ new Set([...models.availableModelIds, ...enabledModelIds])]
|
|
335
|
+
availableModelIds: [.../* @__PURE__ */ new Set([...models.availableModelIds, ...enabledModelIds])],
|
|
336
|
+
availableClassifierModelIds: models.classifierModelIds
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
339
|
function copilotEnterpriseDomain(credential) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
pollOAuthDeviceCodeFlow
|
|
5
|
-
} from "./chunk-U3TEC52G.js";
|
|
6
3
|
import {
|
|
7
4
|
startOAuthCallbackServer,
|
|
8
5
|
waitForCallbackOrManualInput
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WLTE6OJM.js";
|
|
10
7
|
import {
|
|
11
8
|
generatePKCE
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QC6DSC4D.js";
|
|
10
|
+
import {
|
|
11
|
+
pollOAuthDeviceCodeFlow
|
|
12
|
+
} from "./chunk-S637DPAG.js";
|
|
13
13
|
import {
|
|
14
14
|
getProviderEnvValue
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LIIGX2XX.js";
|
|
16
16
|
import "./chunk-CWESUMYQ.js";
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
18
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js
|
|
19
19
|
var _randomBytes = null;
|
|
20
20
|
if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) {
|
|
21
21
|
import("node:crypto").then((m) => {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
headersToRecord
|
|
5
|
+
} from "./chunk-NSISYP6D.js";
|
|
3
6
|
|
|
4
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
7
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js
|
|
5
8
|
var DEFAULT_MAX_RETRY_DELAY_MS = 6e4;
|
|
6
9
|
function isProviderError(error) {
|
|
7
10
|
if (!(error instanceof Error) || !("status" in error) || !("headers" in error))
|
|
@@ -73,6 +76,10 @@ async function retryProviderRequest(request, options = {}) {
|
|
|
73
76
|
} catch (error) {
|
|
74
77
|
if (options.signal?.aborted)
|
|
75
78
|
throw createAbortError();
|
|
79
|
+
if (isProviderError(error) && error.status !== void 0) {
|
|
80
|
+
const headers = error.headers ? headersToRecord(error.headers) : {};
|
|
81
|
+
await options.onErrorResponse?.({ status: error.status, headers });
|
|
82
|
+
}
|
|
76
83
|
if (retriesRemaining <= 0 || !isProviderError(error) || !isRetryableProviderError(error))
|
|
77
84
|
throw error;
|
|
78
85
|
if (error.status !== void 0 && options.noRetryStatuses?.includes(error.status))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
4
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/utils/headers.js
|
|
5
5
|
function headersToRecord(headers) {
|
|
6
6
|
const result = {};
|
|
7
7
|
for (const [key, value] of headers.entries()) {
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SseDecoder
|
|
5
|
+
} from "./chunk-I7OMW4RJ.js";
|
|
3
6
|
import {
|
|
4
7
|
headersToRecord,
|
|
5
8
|
providerHeadersToRecord
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NSISYP6D.js";
|
|
7
10
|
import {
|
|
8
11
|
getProviderEnvValue
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LIIGX2XX.js";
|
|
10
13
|
import {
|
|
11
14
|
ToolCallArgumentsStream
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WMZAJ7XA.js";
|
|
13
16
|
import {
|
|
14
17
|
AssistantMessageEventStream,
|
|
15
18
|
appendAssistantMessageDiagnostic,
|
|
16
19
|
createAssistantMessageDiagnostic
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A3OFIREH.js";
|
|
18
21
|
import {
|
|
19
22
|
getIdentityHeaders
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FNWUCFVO.js";
|
|
21
24
|
import {
|
|
22
25
|
ownedSlice
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EZJH7ED5.js";
|
|
24
27
|
import "./chunk-CWESUMYQ.js";
|
|
25
28
|
|
|
26
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
29
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js
|
|
27
30
|
var PiMessagesResponseError = class extends Error {
|
|
28
31
|
code;
|
|
29
32
|
diagnosticDetails;
|
|
@@ -195,41 +198,27 @@ function createEventConverter(model) {
|
|
|
195
198
|
};
|
|
196
199
|
}
|
|
197
200
|
async function* readPiMessagesEvents(stream2) {
|
|
198
|
-
const decoder = new TextDecoder();
|
|
199
201
|
const reader = stream2.getReader();
|
|
200
|
-
|
|
202
|
+
const sse = new SseDecoder();
|
|
201
203
|
try {
|
|
202
204
|
while (true) {
|
|
203
205
|
const { done, value } = await reader.read();
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const event = parsePiMessagesEvent(buffer.slice(0, split));
|
|
206
|
+
const events = done ? sse.end() : sse.push(value);
|
|
207
|
+
for (const { data } of events) {
|
|
208
|
+
const text = data.trim();
|
|
209
|
+
const event = text && text !== "[DONE]" ? JSON.parse(text) : void 0;
|
|
209
210
|
if (event) {
|
|
210
211
|
yield event;
|
|
211
212
|
}
|
|
212
|
-
buffer = buffer.slice(split + 2);
|
|
213
|
-
split = buffer.indexOf("\n\n");
|
|
214
213
|
}
|
|
215
214
|
if (done) {
|
|
216
215
|
break;
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
|
-
if (buffer.trim()) {
|
|
220
|
-
const event = parsePiMessagesEvent(buffer);
|
|
221
|
-
if (event) {
|
|
222
|
-
yield event;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
218
|
} finally {
|
|
226
219
|
reader.releaseLock();
|
|
227
220
|
}
|
|
228
221
|
}
|
|
229
|
-
function parsePiMessagesEvent(raw) {
|
|
230
|
-
const data = raw.split("\n").find((line) => line.startsWith("data:"))?.slice(5).trim();
|
|
231
|
-
return data && data !== "[DONE]" ? JSON.parse(data) : void 0;
|
|
232
|
-
}
|
|
233
222
|
function createErrorEvent(model, error, aborted) {
|
|
234
223
|
const reason = aborted ? "aborted" : "error";
|
|
235
224
|
const assistantMessage = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
4
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js
|
|
5
5
|
function sanitizeSurrogates(text) {
|
|
6
6
|
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
7
7
|
}
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
GoogleGenAI,
|
|
5
5
|
convertMessages,
|
|
6
6
|
convertTools,
|
|
7
|
+
formatGooglePromptBlockError,
|
|
7
8
|
getDisabledGoogleThinkingConfig,
|
|
9
|
+
getGoogleBudget,
|
|
8
10
|
isThinkingPart,
|
|
9
11
|
mapStopReason,
|
|
10
12
|
resolveGoogleFunctionCallingMode,
|
|
@@ -15,42 +17,42 @@ import {
|
|
|
15
17
|
toGoogleSdkThinkingLevel,
|
|
16
18
|
toGoogleThinkingLevel,
|
|
17
19
|
usesGoogleThinkingLevel
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QQPLW3ZX.js";
|
|
19
21
|
import "./chunk-MXYQOFZ5.js";
|
|
20
22
|
import "./chunk-RGDXDX7B.js";
|
|
21
23
|
import {
|
|
22
24
|
buildBaseOptions
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RQIN5JYO.js";
|
|
24
26
|
import {
|
|
25
27
|
sanitizeSurrogates
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-P7GPT4XL.js";
|
|
29
|
+
import "./chunk-MRDORR5Z.js";
|
|
28
30
|
import {
|
|
29
31
|
formatProviderError,
|
|
30
32
|
normalizeProviderError
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-EOZLBW5E.js";
|
|
32
34
|
import {
|
|
33
35
|
providerHeadersToRecord
|
|
34
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-NSISYP6D.js";
|
|
35
37
|
import {
|
|
36
38
|
calculateCost,
|
|
37
39
|
clampThinkingLevel,
|
|
38
40
|
collapseSystemMessages,
|
|
39
41
|
getCurrentTools,
|
|
40
42
|
getInitialSystemMessage
|
|
41
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WJAHXDL4.js";
|
|
42
44
|
import {
|
|
43
45
|
AssistantMessageEventStream
|
|
44
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-A3OFIREH.js";
|
|
45
47
|
import {
|
|
46
48
|
getIdentityHeaders
|
|
47
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-FNWUCFVO.js";
|
|
48
50
|
import {
|
|
49
51
|
getSystemMessageText
|
|
50
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-EZJH7ED5.js";
|
|
51
53
|
import "./chunk-CWESUMYQ.js";
|
|
52
54
|
|
|
53
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
55
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js
|
|
54
56
|
var toolCallCounter = 0;
|
|
55
57
|
var stream = (model, context, options) => {
|
|
56
58
|
const stream2 = new AssistantMessageEventStream();
|
|
@@ -74,26 +76,29 @@ var stream = (model, context, options) => {
|
|
|
74
76
|
timestamp: Date.now()
|
|
75
77
|
};
|
|
76
78
|
try {
|
|
77
|
-
if (options?.fetch && options.fetch !== globalThis.fetch) {
|
|
78
|
-
throw new Error("Custom fetch is not supported by the Google Generative AI adapter");
|
|
79
|
-
}
|
|
80
79
|
const apiKey = options?.apiKey;
|
|
81
80
|
if (!apiKey) {
|
|
82
81
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
83
82
|
}
|
|
84
|
-
const client = createClient(model, apiKey, options?.headers, options?.identity);
|
|
83
|
+
const client = createClient(model, apiKey, options?.headers, options?.identity, options?.fetch);
|
|
85
84
|
let params = buildParams(model, normalizedContext, options);
|
|
86
85
|
const nextParams = await options?.onPayload?.(params, model);
|
|
87
86
|
if (nextParams !== void 0) {
|
|
88
87
|
params = nextParams;
|
|
89
88
|
}
|
|
90
|
-
const googleStream = await retryGoogleRequest(() => client.models.generateContentStream(params), options);
|
|
89
|
+
const googleStream = await retryGoogleRequest(() => client.models.generateContentStream(params), model, options);
|
|
91
90
|
stream2.push({ type: "start", partial: output });
|
|
92
91
|
let currentBlock = null;
|
|
92
|
+
let receivedChunkCount = 0;
|
|
93
|
+
let promptBlockError;
|
|
93
94
|
const blocks = output.content;
|
|
94
95
|
const blockIndex = () => blocks.length - 1;
|
|
95
96
|
for await (const chunk of googleStream) {
|
|
96
97
|
await options?.onProviderStreamEvent?.(chunk, model);
|
|
98
|
+
receivedChunkCount++;
|
|
99
|
+
if (chunk.promptFeedback?.blockReason) {
|
|
100
|
+
promptBlockError ??= formatGooglePromptBlockError("Google", chunk.promptFeedback);
|
|
101
|
+
}
|
|
97
102
|
output.responseId ||= chunk.responseId;
|
|
98
103
|
const candidate = chunk.candidates?.[0];
|
|
99
104
|
if (candidate?.content?.parts) {
|
|
@@ -236,7 +241,10 @@ var stream = (model, context, options) => {
|
|
|
236
241
|
throw new Error("Request was aborted");
|
|
237
242
|
}
|
|
238
243
|
if (output.stopReason === "pending") {
|
|
239
|
-
|
|
244
|
+
if (promptBlockError)
|
|
245
|
+
throw new Error(promptBlockError);
|
|
246
|
+
const chunkLabel = receivedChunkCount === 1 ? "chunk" : "chunks";
|
|
247
|
+
throw new Error(`Google stream ended without a finish reason after receiving ${receivedChunkCount} ${chunkLabel}`);
|
|
240
248
|
}
|
|
241
249
|
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
242
250
|
const errorMessage = output.rawStopReason ? `Provider stopped with: ${output.rawStopReason}` : "An unknown error occurred";
|
|
@@ -287,8 +295,8 @@ var streamSimple = (model, context, options) => {
|
|
|
287
295
|
}
|
|
288
296
|
});
|
|
289
297
|
};
|
|
290
|
-
function createClient(model, apiKey, optionsHeaders, identity) {
|
|
291
|
-
const httpOptions = {};
|
|
298
|
+
function createClient(model, apiKey, optionsHeaders, identity, fetch) {
|
|
299
|
+
const httpOptions = { fetch: fetch ?? globalThis.fetch };
|
|
292
300
|
if (model.baseUrl) {
|
|
293
301
|
httpOptions.baseUrl = model.baseUrl;
|
|
294
302
|
httpOptions.apiVersion = "";
|
|
@@ -297,10 +305,7 @@ function createClient(model, apiKey, optionsHeaders, identity) {
|
|
|
297
305
|
if (headers) {
|
|
298
306
|
httpOptions.headers = headers;
|
|
299
307
|
}
|
|
300
|
-
return new GoogleGenAI({
|
|
301
|
-
apiKey,
|
|
302
|
-
httpOptions: Object.keys(httpOptions).length > 0 ? httpOptions : void 0
|
|
303
|
-
});
|
|
308
|
+
return new GoogleGenAI({ apiKey, httpOptions });
|
|
304
309
|
}
|
|
305
310
|
function buildParams(model, context, options = {}) {
|
|
306
311
|
const contents = convertMessages(model, context);
|
|
@@ -313,7 +318,7 @@ function buildParams(model, context, options = {}) {
|
|
|
313
318
|
if (options.maxTokens !== void 0) {
|
|
314
319
|
generationConfig.maxOutputTokens = options.maxTokens;
|
|
315
320
|
}
|
|
316
|
-
const supportsStrictMode = supportsGoogleStrictToolSampling(model
|
|
321
|
+
const supportsStrictMode = supportsGoogleStrictToolSampling(model);
|
|
317
322
|
const functionCallingMode = currentTools.length > 0 ? resolveGoogleFunctionCallingMode(currentTools, options.toolChoice, supportsStrictMode) : void 0;
|
|
318
323
|
const systemInstruction = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : "";
|
|
319
324
|
const config = {
|
|
@@ -324,7 +329,10 @@ function buildParams(model, context, options = {}) {
|
|
|
324
329
|
},
|
|
325
330
|
...functionCallingMode !== void 0 && {
|
|
326
331
|
toolConfig: { functionCallingConfig: { mode: functionCallingMode } }
|
|
327
|
-
}
|
|
332
|
+
},
|
|
333
|
+
// Off for now, until we have evaluated the implications of the SDK's automatic continuation
|
|
334
|
+
// (extra requests and stream resumes inside the SDK). A CONTINUATION finish ends the turn as "length".
|
|
335
|
+
automaticContinuation: false
|
|
328
336
|
};
|
|
329
337
|
if (options.thinking?.enabled && model.reasoning) {
|
|
330
338
|
const thinkingConfig = { includeThoughts: true };
|
|
@@ -350,39 +358,6 @@ function buildParams(model, context, options = {}) {
|
|
|
350
358
|
};
|
|
351
359
|
return params;
|
|
352
360
|
}
|
|
353
|
-
function getGoogleBudget(model, level, customBudgets) {
|
|
354
|
-
if (customBudgets?.[level] !== void 0) {
|
|
355
|
-
return customBudgets[level];
|
|
356
|
-
}
|
|
357
|
-
if (model.id.includes("2.5-pro")) {
|
|
358
|
-
const budgets = {
|
|
359
|
-
minimal: 128,
|
|
360
|
-
low: 2048,
|
|
361
|
-
medium: 8192,
|
|
362
|
-
high: 32768
|
|
363
|
-
};
|
|
364
|
-
return budgets[level];
|
|
365
|
-
}
|
|
366
|
-
if (model.id.includes("2.5-flash-lite")) {
|
|
367
|
-
const budgets = {
|
|
368
|
-
minimal: 512,
|
|
369
|
-
low: 2048,
|
|
370
|
-
medium: 8192,
|
|
371
|
-
high: 24576
|
|
372
|
-
};
|
|
373
|
-
return budgets[level];
|
|
374
|
-
}
|
|
375
|
-
if (model.id.includes("2.5-flash")) {
|
|
376
|
-
const budgets = {
|
|
377
|
-
minimal: 128,
|
|
378
|
-
low: 2048,
|
|
379
|
-
medium: 8192,
|
|
380
|
-
high: 24576
|
|
381
|
-
};
|
|
382
|
-
return budgets[level];
|
|
383
|
-
}
|
|
384
|
-
return -1;
|
|
385
|
-
}
|
|
386
361
|
export {
|
|
387
362
|
stream,
|
|
388
363
|
streamSimple
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
4
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/utils/oauth-page.js
|
|
5
5
|
var LOGO_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800" aria-hidden="true"><path fill="#F09082" d="M165.29 165.29H517.36V400H400V282.65H165.29Z"/><path fill="#4D9ABF" d="M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"/><path fill="#F1BE58" d="M517.36 400H634.72V634.72H517.36Z"/></svg>`;
|
|
6
6
|
function escapeHtml(value) {
|
|
7
7
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
@@ -102,7 +102,7 @@ function oauthErrorHtml(message, details) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
105
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/auth/oauth/pkce.js
|
|
106
106
|
function base64urlEncode(bytes) {
|
|
107
107
|
let binary = "";
|
|
108
108
|
for (const byte of bytes) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
4
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.6.1_@smithy+signature-v4@5.7.3_google-auth-library@10.7.0_suppo_bdf1b0d1b5e752e25be2c525cddbb146/node_modules/@earendil-works/pi-ai/dist/session-resources.js
|
|
5
5
|
var sessionResourceCleanups = /* @__PURE__ */ new Set();
|
|
6
6
|
function registerSessionResourceCleanup(cleanup) {
|
|
7
7
|
sessionResourceCleanups.add(cleanup);
|