@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,9 +2,9 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
ownedSlice
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EZJH7ED5.js";
|
|
6
6
|
|
|
7
|
-
// 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/error-body.js
|
|
8
8
|
var MAX_PROVIDER_ERROR_BODY_CHARS = 4e3;
|
|
9
9
|
function normalizeProviderError(error) {
|
|
10
10
|
if (!(error instanceof Error)) {
|
|
@@ -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/text.js
|
|
5
5
|
function contentText(content, separator = "\n") {
|
|
6
6
|
if (typeof content === "string")
|
|
7
7
|
return content;
|
|
@@ -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/env-api-keys.js
|
|
5
5
|
var __rewriteRelativeImportExtension = function(path, preserveJsx) {
|
|
6
6
|
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
7
7
|
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
5
|
-
var PI_AI_VERSION = "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/version.js
|
|
5
|
+
var PI_AI_VERSION = "1.6.1";
|
|
6
6
|
|
|
7
|
-
// 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/identity.js
|
|
8
8
|
var NVIDIA_NIM_HOST = "integrate.api.nvidia.com";
|
|
9
9
|
var OPENCODE_HOST = "opencode.ai";
|
|
10
10
|
function mergeClientIdentity(...sources) {
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
|
+
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
isRecord,
|
|
5
|
+
postClassifierRequest,
|
|
6
|
+
requiredNumber
|
|
7
|
+
} from "./chunk-CZXRZEV4.js";
|
|
8
|
+
import "./chunk-MRDORR5Z.js";
|
|
9
|
+
import {
|
|
10
|
+
formatProviderError,
|
|
11
|
+
normalizeProviderError
|
|
12
|
+
} from "./chunk-EOZLBW5E.js";
|
|
13
|
+
import "./chunk-NSISYP6D.js";
|
|
14
|
+
import {
|
|
15
|
+
calculateCost
|
|
16
|
+
} from "./chunk-WJAHXDL4.js";
|
|
17
|
+
import "./chunk-A3OFIREH.js";
|
|
18
|
+
import "./chunk-FNWUCFVO.js";
|
|
19
|
+
import "./chunk-EZJH7ED5.js";
|
|
20
|
+
import "./chunk-CWESUMYQ.js";
|
|
21
|
+
|
|
22
|
+
// 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-decision.js
|
|
23
|
+
var LABEL = "Pi Decision";
|
|
24
|
+
function finiteNonNegative(value) {
|
|
25
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
|
26
|
+
}
|
|
27
|
+
function requiredUnitInterval(value, field) {
|
|
28
|
+
const num = requiredNumber(LABEL, value, field);
|
|
29
|
+
if (num < 0 || num > 1) {
|
|
30
|
+
throw new Error(`${LABEL} returned out-of-range ${field}: ${num}`);
|
|
31
|
+
}
|
|
32
|
+
return num;
|
|
33
|
+
}
|
|
34
|
+
function parseUsage(value, model) {
|
|
35
|
+
if (!isRecord(value) || typeof value.input !== "number" && typeof value.output !== "number")
|
|
36
|
+
return void 0;
|
|
37
|
+
const input = finiteNonNegative(value.input);
|
|
38
|
+
const output = finiteNonNegative(value.output);
|
|
39
|
+
const cacheRead = finiteNonNegative(value.cacheRead);
|
|
40
|
+
const cacheWrite = finiteNonNegative(value.cacheWrite);
|
|
41
|
+
const totalTokens = typeof value.totalTokens === "number" && Number.isFinite(value.totalTokens) && value.totalTokens >= 0 ? value.totalTokens : input + output + cacheRead + cacheWrite;
|
|
42
|
+
const usage = {
|
|
43
|
+
input,
|
|
44
|
+
output,
|
|
45
|
+
cacheRead,
|
|
46
|
+
cacheWrite,
|
|
47
|
+
totalTokens,
|
|
48
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
|
|
49
|
+
};
|
|
50
|
+
if (isRecord(value.cost) && typeof value.cost.total === "number" && Number.isFinite(value.cost.total)) {
|
|
51
|
+
usage.cost = {
|
|
52
|
+
input: finiteNonNegative(value.cost.input),
|
|
53
|
+
output: finiteNonNegative(value.cost.output),
|
|
54
|
+
cacheRead: finiteNonNegative(value.cost.cacheRead),
|
|
55
|
+
cacheWrite: finiteNonNegative(value.cost.cacheWrite),
|
|
56
|
+
total: finiteNonNegative(value.cost.total),
|
|
57
|
+
...typeof value.cost.totalFromProvider === "boolean" ? { totalFromProvider: value.cost.totalFromProvider } : {}
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
calculateCost(model, usage);
|
|
61
|
+
}
|
|
62
|
+
return usage;
|
|
63
|
+
}
|
|
64
|
+
function parseProbabilities(value, id, criteria) {
|
|
65
|
+
if (!isRecord(value))
|
|
66
|
+
throw new Error(`${LABEL} returned invalid probabilities for ${id}`);
|
|
67
|
+
return Object.fromEntries(Object.entries(value).map(([choice, prob]) => {
|
|
68
|
+
if (!Object.hasOwn(criteria, choice)) {
|
|
69
|
+
throw new Error(`${LABEL} returned unknown choice "${choice}" in probabilities for ${id}`);
|
|
70
|
+
}
|
|
71
|
+
return [choice, requiredUnitInterval(prob, `probability for ${id}.${choice}`)];
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
function parseAnswer(id, question, answer) {
|
|
75
|
+
if (!isRecord(answer))
|
|
76
|
+
throw new Error(`${LABEL} returned an invalid answer for ${id}`);
|
|
77
|
+
if (question.type === "choice") {
|
|
78
|
+
if (answer.type !== "choice" || typeof answer.choice !== "string") {
|
|
79
|
+
throw new Error(`${LABEL} did not return a choice answer for ${id}`);
|
|
80
|
+
}
|
|
81
|
+
if (!Object.hasOwn(question.criteria, answer.choice)) {
|
|
82
|
+
throw new Error(`${LABEL} returned unknown choice "${answer.choice}" for ${id}`);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
type: "choice",
|
|
86
|
+
choice: answer.choice,
|
|
87
|
+
probabilities: parseProbabilities(answer.probabilities, id, question.criteria),
|
|
88
|
+
confidence: requiredUnitInterval(answer.confidence, `confidence for ${id}`)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (question.type === "score") {
|
|
92
|
+
if (answer.type !== "score")
|
|
93
|
+
throw new Error(`${LABEL} did not return a score answer for ${id}`);
|
|
94
|
+
const score = requiredNumber(LABEL, answer.score, `score for ${id}`);
|
|
95
|
+
const maxScore = Math.max(0, question.criteria.length - 1);
|
|
96
|
+
if (score < 0 || score > maxScore) {
|
|
97
|
+
throw new Error(`${LABEL} returned out-of-range score for ${id}: ${score}`);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
type: "score",
|
|
101
|
+
score,
|
|
102
|
+
confidence: requiredUnitInterval(answer.confidence, `confidence for ${id}`)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (answer.type !== "bool")
|
|
106
|
+
throw new Error(`${LABEL} did not return a bool answer for ${id}`);
|
|
107
|
+
return { type: "bool", probability: requiredUnitInterval(answer.probability, `probability for ${id}`) };
|
|
108
|
+
}
|
|
109
|
+
function parseAnswers(value, context) {
|
|
110
|
+
if (!isRecord(value))
|
|
111
|
+
throw new Error(`${LABEL} returned an unexpected response`);
|
|
112
|
+
return Object.fromEntries(Object.entries(context.questions).map(([id, question]) => {
|
|
113
|
+
if (!Object.hasOwn(value, id))
|
|
114
|
+
throw new Error(`${LABEL} did not return an answer for ${id}`);
|
|
115
|
+
return [id, parseAnswer(id, question, value[id])];
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
var classify = async (model, context, options) => {
|
|
119
|
+
const output = {
|
|
120
|
+
api: model.api,
|
|
121
|
+
provider: model.provider,
|
|
122
|
+
model: model.id,
|
|
123
|
+
answers: {},
|
|
124
|
+
stopReason: "stop",
|
|
125
|
+
timestamp: Date.now()
|
|
126
|
+
};
|
|
127
|
+
try {
|
|
128
|
+
if (model.api !== "pi-decision")
|
|
129
|
+
throw new Error(`Unsupported classifier API: ${model.api}`);
|
|
130
|
+
const images = context.images ?? [];
|
|
131
|
+
if (images.length > 0 && !model.input.includes("image")) {
|
|
132
|
+
throw new Error(`${LABEL} model ${model.id} does not support image input`);
|
|
133
|
+
}
|
|
134
|
+
const url = new URL("decision", `${model.baseUrl.replace(/\/+$/u, "")}/`);
|
|
135
|
+
const requestBody = {
|
|
136
|
+
model: model.id,
|
|
137
|
+
context: {
|
|
138
|
+
state: context.state,
|
|
139
|
+
...images.length > 0 ? { images } : {},
|
|
140
|
+
questions: context.questions
|
|
141
|
+
},
|
|
142
|
+
...options?.sessionId !== void 0 ? { options: { sessionId: options.sessionId } } : {}
|
|
143
|
+
};
|
|
144
|
+
const body = await postClassifierRequest(LABEL, url, model, requestBody, options);
|
|
145
|
+
if (!isRecord(body))
|
|
146
|
+
throw new Error(`${LABEL} returned an unexpected response`);
|
|
147
|
+
if (typeof body.responseId === "string" && body.responseId)
|
|
148
|
+
output.responseId = body.responseId;
|
|
149
|
+
const usage = parseUsage(body.usage, model);
|
|
150
|
+
if (usage)
|
|
151
|
+
output.usage = usage;
|
|
152
|
+
output.answers = parseAnswers(body.answers, context);
|
|
153
|
+
return output;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
output.answers = {};
|
|
156
|
+
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
157
|
+
output.errorMessage = formatProviderError(normalizeProviderError(error), `${LABEL} error`);
|
|
158
|
+
return output;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
export {
|
|
162
|
+
classify
|
|
163
|
+
};
|
|
@@ -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/hash.js
|
|
5
5
|
function shortHash(str) {
|
|
6
6
|
let h1 = 3735928559;
|
|
7
7
|
let h2 = 1103547991;
|
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
ResourceScope,
|
|
6
6
|
convertMessages,
|
|
7
7
|
convertTools,
|
|
8
|
+
formatGooglePromptBlockError,
|
|
8
9
|
getDisabledGoogleThinkingConfig,
|
|
10
|
+
getGoogleBudget,
|
|
9
11
|
isThinkingPart,
|
|
10
12
|
mapStopReason,
|
|
11
13
|
resolveGoogleFunctionCallingMode,
|
|
@@ -16,45 +18,45 @@ import {
|
|
|
16
18
|
toGoogleSdkThinkingLevel,
|
|
17
19
|
toGoogleThinkingLevel,
|
|
18
20
|
usesGoogleThinkingLevel
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QQPLW3ZX.js";
|
|
20
22
|
import "./chunk-MXYQOFZ5.js";
|
|
21
23
|
import "./chunk-RGDXDX7B.js";
|
|
22
24
|
import {
|
|
23
25
|
buildBaseOptions
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RQIN5JYO.js";
|
|
25
27
|
import {
|
|
26
28
|
sanitizeSurrogates
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-P7GPT4XL.js";
|
|
30
|
+
import "./chunk-MRDORR5Z.js";
|
|
29
31
|
import {
|
|
30
32
|
formatProviderError,
|
|
31
33
|
normalizeProviderError
|
|
32
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EOZLBW5E.js";
|
|
33
35
|
import {
|
|
34
36
|
providerHeadersToRecord
|
|
35
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NSISYP6D.js";
|
|
36
38
|
import {
|
|
37
39
|
getProviderEnvValue
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-LIIGX2XX.js";
|
|
39
41
|
import {
|
|
40
42
|
calculateCost,
|
|
41
43
|
clampThinkingLevel,
|
|
42
44
|
collapseSystemMessages,
|
|
43
45
|
getCurrentTools,
|
|
44
46
|
getInitialSystemMessage
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-WJAHXDL4.js";
|
|
46
48
|
import {
|
|
47
49
|
AssistantMessageEventStream
|
|
48
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-A3OFIREH.js";
|
|
49
51
|
import {
|
|
50
52
|
getIdentityHeaders
|
|
51
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-FNWUCFVO.js";
|
|
52
54
|
import {
|
|
53
55
|
getSystemMessageText
|
|
54
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-EZJH7ED5.js";
|
|
55
57
|
import "./chunk-CWESUMYQ.js";
|
|
56
58
|
|
|
57
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
59
|
+
// 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-vertex.js
|
|
58
60
|
var API_VERSION = "v1";
|
|
59
61
|
var GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
60
62
|
var toolCallCounter = 0;
|
|
@@ -80,23 +82,26 @@ var stream = (model, context, options) => {
|
|
|
80
82
|
timestamp: Date.now()
|
|
81
83
|
};
|
|
82
84
|
try {
|
|
83
|
-
if (options?.fetch && options.fetch !== globalThis.fetch) {
|
|
84
|
-
throw new Error("Custom fetch is not supported by the Google Vertex adapter");
|
|
85
|
-
}
|
|
86
85
|
const apiKey = resolveApiKey(options);
|
|
87
|
-
const client = apiKey ? createClientWithApiKey(model, apiKey, options?.headers, options?.identity) : createClient(model, resolveProject(options), resolveLocation(options), options?.headers, options?.env, options?.identity);
|
|
86
|
+
const client = apiKey ? createClientWithApiKey(model, apiKey, options?.headers, options?.identity, options?.fetch) : createClient(model, resolveProject(options), resolveLocation(options), options?.headers, options?.env, options?.identity, options?.fetch);
|
|
88
87
|
let params = buildParams(model, normalizedContext, options);
|
|
89
88
|
const nextParams = await options?.onPayload?.(params, model);
|
|
90
89
|
if (nextParams !== void 0) {
|
|
91
90
|
params = nextParams;
|
|
92
91
|
}
|
|
93
|
-
const googleStream = await retryGoogleRequest(() => client.models.generateContentStream(params), options);
|
|
92
|
+
const googleStream = await retryGoogleRequest(() => client.models.generateContentStream(params), model, options);
|
|
94
93
|
stream2.push({ type: "start", partial: output });
|
|
95
94
|
let currentBlock = null;
|
|
95
|
+
let receivedChunkCount = 0;
|
|
96
|
+
let promptBlockError;
|
|
96
97
|
const blocks = output.content;
|
|
97
98
|
const blockIndex = () => blocks.length - 1;
|
|
98
99
|
for await (const chunk of googleStream) {
|
|
99
100
|
await options?.onProviderStreamEvent?.(chunk, model);
|
|
101
|
+
receivedChunkCount++;
|
|
102
|
+
if (chunk.promptFeedback?.blockReason) {
|
|
103
|
+
promptBlockError ??= formatGooglePromptBlockError("Google Vertex", chunk.promptFeedback);
|
|
104
|
+
}
|
|
100
105
|
output.responseId ||= chunk.responseId;
|
|
101
106
|
const candidate = chunk.candidates?.[0];
|
|
102
107
|
if (candidate?.content?.parts) {
|
|
@@ -239,7 +244,10 @@ var stream = (model, context, options) => {
|
|
|
239
244
|
throw new Error("Request was aborted");
|
|
240
245
|
}
|
|
241
246
|
if (output.stopReason === "pending") {
|
|
242
|
-
|
|
247
|
+
if (promptBlockError)
|
|
248
|
+
throw new Error(promptBlockError);
|
|
249
|
+
const chunkLabel = receivedChunkCount === 1 ? "chunk" : "chunks";
|
|
250
|
+
throw new Error(`Google Vertex stream ended without a finish reason after receiving ${receivedChunkCount} ${chunkLabel}`);
|
|
243
251
|
}
|
|
244
252
|
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
245
253
|
const errorMessage = output.rawStopReason ? `Provider stopped with: ${output.rawStopReason}` : "An unknown error occurred";
|
|
@@ -292,7 +300,7 @@ var streamSimple = (model, context, options) => {
|
|
|
292
300
|
}
|
|
293
301
|
});
|
|
294
302
|
};
|
|
295
|
-
function createClient(model, project, location, optionsHeaders, env, identity) {
|
|
303
|
+
function createClient(model, project, location, optionsHeaders, env, identity, fetch) {
|
|
296
304
|
const googleAuthOptions = buildGoogleAuthOptions(env);
|
|
297
305
|
return new GoogleGenAI({
|
|
298
306
|
vertexai: true,
|
|
@@ -300,19 +308,19 @@ function createClient(model, project, location, optionsHeaders, env, identity) {
|
|
|
300
308
|
location,
|
|
301
309
|
apiVersion: API_VERSION,
|
|
302
310
|
...googleAuthOptions ? { googleAuthOptions } : {},
|
|
303
|
-
httpOptions: buildHttpOptions(model, optionsHeaders, identity)
|
|
311
|
+
httpOptions: buildHttpOptions(model, optionsHeaders, identity, fetch)
|
|
304
312
|
});
|
|
305
313
|
}
|
|
306
|
-
function createClientWithApiKey(model, apiKey, optionsHeaders, identity) {
|
|
314
|
+
function createClientWithApiKey(model, apiKey, optionsHeaders, identity, fetch) {
|
|
307
315
|
return new GoogleGenAI({
|
|
308
316
|
vertexai: true,
|
|
309
317
|
apiKey,
|
|
310
318
|
apiVersion: API_VERSION,
|
|
311
|
-
httpOptions: buildHttpOptions(model, optionsHeaders, identity)
|
|
319
|
+
httpOptions: buildHttpOptions(model, optionsHeaders, identity, fetch)
|
|
312
320
|
});
|
|
313
321
|
}
|
|
314
|
-
function buildHttpOptions(model, optionsHeaders, identity) {
|
|
315
|
-
const httpOptions = {};
|
|
322
|
+
function buildHttpOptions(model, optionsHeaders, identity, fetch) {
|
|
323
|
+
const httpOptions = { fetch: fetch ?? globalThis.fetch };
|
|
316
324
|
const baseUrl = resolveCustomBaseUrl(model.baseUrl);
|
|
317
325
|
if (baseUrl) {
|
|
318
326
|
httpOptions.baseUrl = baseUrl;
|
|
@@ -325,7 +333,7 @@ function buildHttpOptions(model, optionsHeaders, identity) {
|
|
|
325
333
|
if (headers) {
|
|
326
334
|
httpOptions.headers = headers;
|
|
327
335
|
}
|
|
328
|
-
return
|
|
336
|
+
return httpOptions;
|
|
329
337
|
}
|
|
330
338
|
function resolveCustomBaseUrl(baseUrl) {
|
|
331
339
|
const trimmed = baseUrl.trim();
|
|
@@ -381,7 +389,7 @@ function buildParams(model, context, options = {}) {
|
|
|
381
389
|
if (options.maxTokens !== void 0) {
|
|
382
390
|
generationConfig.maxOutputTokens = options.maxTokens;
|
|
383
391
|
}
|
|
384
|
-
const supportsStrictMode = supportsGoogleStrictToolSampling(model
|
|
392
|
+
const supportsStrictMode = supportsGoogleStrictToolSampling(model);
|
|
385
393
|
const functionCallingMode = currentTools.length > 0 ? resolveGoogleFunctionCallingMode(currentTools, options.toolChoice, supportsStrictMode) : void 0;
|
|
386
394
|
const systemInstruction = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : "";
|
|
387
395
|
const config = {
|
|
@@ -392,7 +400,10 @@ function buildParams(model, context, options = {}) {
|
|
|
392
400
|
},
|
|
393
401
|
...functionCallingMode !== void 0 && {
|
|
394
402
|
toolConfig: { functionCallingConfig: { mode: functionCallingMode } }
|
|
395
|
-
}
|
|
403
|
+
},
|
|
404
|
+
// Off for now, until we have evaluated the implications of the SDK's automatic continuation
|
|
405
|
+
// (extra requests and stream resumes inside the SDK). A CONTINUATION finish ends the turn as "length".
|
|
406
|
+
automaticContinuation: false
|
|
396
407
|
};
|
|
397
408
|
if (options.thinking?.enabled && model.reasoning) {
|
|
398
409
|
const thinkingConfig = { includeThoughts: true };
|
|
@@ -418,30 +429,6 @@ function buildParams(model, context, options = {}) {
|
|
|
418
429
|
};
|
|
419
430
|
return params;
|
|
420
431
|
}
|
|
421
|
-
function getGoogleBudget(model, level, customBudgets) {
|
|
422
|
-
if (customBudgets?.[level] !== void 0) {
|
|
423
|
-
return customBudgets[level];
|
|
424
|
-
}
|
|
425
|
-
if (model.id.includes("2.5-pro")) {
|
|
426
|
-
const budgets = {
|
|
427
|
-
minimal: 128,
|
|
428
|
-
low: 2048,
|
|
429
|
-
medium: 8192,
|
|
430
|
-
high: 32768
|
|
431
|
-
};
|
|
432
|
-
return budgets[level];
|
|
433
|
-
}
|
|
434
|
-
if (model.id.includes("2.5-flash")) {
|
|
435
|
-
const budgets = {
|
|
436
|
-
minimal: 128,
|
|
437
|
-
low: 2048,
|
|
438
|
-
medium: 8192,
|
|
439
|
-
high: 24576
|
|
440
|
-
};
|
|
441
|
-
return budgets[level];
|
|
442
|
-
}
|
|
443
|
-
return -1;
|
|
444
|
-
}
|
|
445
432
|
export {
|
|
446
433
|
stream,
|
|
447
434
|
streamSimple
|
|
@@ -2,25 +2,32 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
ownedSlice
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EZJH7ED5.js";
|
|
6
6
|
|
|
7
|
-
// 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/providers/radius-config.js
|
|
8
8
|
var DEFAULT_RADIUS_GATEWAY = "https://radius.pi.dev";
|
|
9
|
-
function
|
|
9
|
+
function isRadiusGatewayClassifierModel(value) {
|
|
10
10
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
11
11
|
return false;
|
|
12
12
|
const model = value;
|
|
13
|
-
return typeof model.id === "string" && typeof model.name === "string" &&
|
|
13
|
+
return typeof model.id === "string" && typeof model.name === "string" && Array.isArray(model.input) && typeof model.cost === "object" && model.cost !== null && !Array.isArray(model.cost) && typeof model.contextWindow === "number";
|
|
14
|
+
}
|
|
15
|
+
function isRadiusGatewayModel(value) {
|
|
16
|
+
if (!isRadiusGatewayClassifierModel(value))
|
|
17
|
+
return false;
|
|
18
|
+
const model = value;
|
|
19
|
+
return typeof model.reasoning === "boolean" && typeof model.maxTokens === "number";
|
|
14
20
|
}
|
|
15
21
|
function sanitizeRadiusGatewayConfig(config) {
|
|
16
22
|
if (typeof config !== "object" || config === null || Array.isArray(config))
|
|
17
23
|
return void 0;
|
|
18
|
-
const { baseUrl, models } = config;
|
|
24
|
+
const { baseUrl, models, classifiers } = config;
|
|
19
25
|
if (typeof baseUrl !== "string" || !Array.isArray(models))
|
|
20
26
|
return void 0;
|
|
21
27
|
return {
|
|
22
28
|
baseUrl,
|
|
23
|
-
models: models.filter(isRadiusGatewayModel).map((model) => ({ ...model }))
|
|
29
|
+
models: models.filter(isRadiusGatewayModel).map((model) => ({ ...model })),
|
|
30
|
+
...Array.isArray(classifiers) ? { classifiers: classifiers.filter(isRadiusGatewayClassifierModel).map((model) => ({ ...model })) } : {}
|
|
24
31
|
};
|
|
25
32
|
}
|
|
26
33
|
function normalizeRadiusGatewayUrl(value) {
|
|
@@ -38,6 +45,18 @@ function getRadiusModelsFromConfig(providerId, config) {
|
|
|
38
45
|
baseUrl: config.baseUrl
|
|
39
46
|
}));
|
|
40
47
|
}
|
|
48
|
+
function getRadiusAllModelsFromConfig(providerId, config) {
|
|
49
|
+
return [
|
|
50
|
+
...getRadiusModelsFromConfig(providerId, config),
|
|
51
|
+
...(config.classifiers ?? []).map((model) => ({
|
|
52
|
+
...model,
|
|
53
|
+
type: "classifier",
|
|
54
|
+
api: "pi-decision",
|
|
55
|
+
provider: providerId,
|
|
56
|
+
baseUrl: config.baseUrl
|
|
57
|
+
}))
|
|
58
|
+
];
|
|
59
|
+
}
|
|
41
60
|
function getRadiusModels(providerId, credential) {
|
|
42
61
|
const config = getRadiusCredentialConfig(credential);
|
|
43
62
|
return config ? getRadiusModelsFromConfig(providerId, config) : [];
|
|
@@ -63,7 +82,7 @@ async function loadRadiusGatewayConfig(gateway, apiKey, signal) {
|
|
|
63
82
|
export {
|
|
64
83
|
DEFAULT_RADIUS_GATEWAY,
|
|
65
84
|
normalizeRadiusGatewayUrl,
|
|
66
|
-
|
|
85
|
+
getRadiusAllModelsFromConfig,
|
|
67
86
|
getRadiusModels,
|
|
68
87
|
loadRadiusGatewayConfig
|
|
69
88
|
};
|