@nervekit/desktop 0.40.1 → 0.41.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/README.md +5 -2
- package/THIRD-PARTY-LICENSES.txt +968 -30
- package/dist/bin.js +1 -0
- package/dist/{chunk-OY6PIAR7.js → chunk-2ICPO4UM.js} +5 -5
- package/dist/{chunk-SQ7CWNIT.js → chunk-3CZXUKLG.js} +1 -1
- package/dist/{chunk-QFXKQNMT.js → chunk-4OCDR4DU.js} +14 -17
- package/dist/chunk-62DQXVPO.js +69 -0
- package/dist/chunk-6GUJQURI.js +142 -0
- package/dist/{chunk-CEX2GWGZ.js → chunk-6IHXVT5H.js} +1 -1
- package/dist/{chunk-MH3SUHI2.js → chunk-6ZS7TA6E.js} +2 -2
- package/dist/chunk-7FSH3ABG.js +249 -0
- package/dist/chunk-7HGFEQSD.js +224 -0
- package/dist/chunk-7RPHIJT3.js +153 -0
- package/dist/{chunk-5Y3NEEOK.js → chunk-AAEIGAGD.js} +9 -9
- package/dist/{chunk-HKLAYK2Z.js → chunk-APY4TUR3.js} +210 -0
- package/dist/chunk-BACYVEE6.js +128 -0
- package/dist/chunk-BG2KGLIA.js +783 -0
- package/dist/{chunk-XBHEYY65.js → chunk-BN5YDZUZ.js} +1205 -326
- package/dist/chunk-BUD4JHBZ.js +7017 -0
- package/dist/{chunk-MN7PZ2PH.js → chunk-DDBE2VLT.js} +2 -2
- package/dist/chunk-EF7ZZKA3.js +168 -0
- package/dist/{chunk-TJR6ASRW.js → chunk-EUT45AKW.js} +22 -24
- package/dist/{chunk-L3YB2QLN.js → chunk-FCAIYPDJ.js} +2 -2
- package/dist/{chunk-AJGPULMX.js → chunk-FZ557YWE.js} +47603 -55411
- package/dist/chunk-HPINJGBO.js +359 -0
- package/dist/{chunk-H5UKINTD.js → chunk-IRRR3PWN.js} +68 -65
- package/dist/{chunk-CWHAK2HX.js → chunk-IVBMHEPK.js} +33 -55
- package/dist/{chunk-FESN7DND.js → chunk-JBEWFFOK.js} +1 -1
- package/dist/{chunk-CKVFGRVV.js → chunk-KEXKZKN4.js} +54 -7
- package/dist/{chunk-UGDIHDAR.js → chunk-KUFIFCB4.js} +1 -1
- package/dist/chunk-L5WGVYXM.js +42 -0
- package/dist/{chunk-ONWQH2W6.js → chunk-LGIIT2NF.js} +15 -18
- package/dist/{chunk-KSZJ3HGD.js → chunk-LP4APBBQ.js} +1 -1
- package/dist/{chunk-DBXMYYPJ.js → chunk-M3ELKCNA.js} +1 -1
- package/dist/chunk-MI6L5CEA.js +183 -0
- package/dist/chunk-N4OXAS3A.js +40 -0
- package/dist/chunk-N6BUYKF3.js +340 -0
- package/dist/{chunk-KIGB3FK6.js → chunk-NVVW3MWJ.js} +9 -8
- package/dist/{chunk-V53CETNZ.js → chunk-O5JHHRFN.js} +242 -105
- package/dist/{chunk-KQPEOUCA.js → chunk-O6FDXE54.js} +19 -23
- package/dist/{chunk-QWTKCUIZ.js → chunk-OMCM3MHS.js} +11 -9
- package/dist/{chunk-55OGZFNA.js → chunk-P72Y5ZBH.js} +31 -15
- package/dist/{chunk-AON37AL2.js → chunk-PVPJAGWR.js} +29 -4
- package/dist/{chunk-24GQ74HM.js → chunk-Q3C7TQ2M.js} +3 -3
- package/dist/chunk-Q5E4ZL2R.js +14 -0
- package/dist/chunk-QFK2SWD2.js +258 -0
- package/dist/chunk-RJR7DJJK.js +32 -0
- package/dist/{chunk-BXVRC3HF.js → chunk-RL52LSTV.js} +1 -1
- package/dist/{chunk-KAZFF2RD.js → chunk-RTB6CF7F.js} +137 -113
- package/dist/{chunk-TW6FURZ7.js → chunk-SDDKYMIP.js} +18313 -4317
- package/dist/{chunk-S2PITDVA.js → chunk-TQURLRHD.js} +1 -1
- package/dist/{chunk-2Z5FLMLE.js → chunk-TSAUBRRU.js} +1 -1
- package/dist/chunk-U3TEC52G.js +64 -0
- package/dist/chunk-U5KGV63C.js +39 -0
- package/dist/{chunk-FOFVPPPV.js → chunk-UVRULOOP.js} +10 -9
- package/dist/{chunk-QVHYARC2.js → chunk-VOATSLRG.js} +5 -1
- package/dist/{chunk-WXRYBXYR.js → chunk-W7LEYYFH.js} +53 -65
- package/dist/chunk-WC5HHPPM.js +22 -0
- package/dist/{chunk-3DGBM7UW.js → chunk-WG62RHZ2.js} +3 -3
- package/dist/{chunk-D7WIIZAV.js → chunk-WIQEPAUG.js} +10 -9
- package/dist/chunk-XM27UVWN.js +250 -0
- package/dist/{chunk-4MMJDHFX.js → chunk-XTUSLUQ7.js} +70 -71
- package/dist/{chunk-N5B2RRSS.js → chunk-Z6AY5VOZ.js} +47 -26
- package/dist/{chunk-I6NVW4NX.js → chunk-ZGWXLG5X.js} +29 -33
- package/dist/{chunk-XNYZEQ3U.js → chunk-ZUWBEV2O.js} +1 -1
- package/dist/chunk-ZVH6EB7S.js +29 -0
- package/dist/daemon.js +65 -26
- package/dist/extension-assets/atlassian/docs/confluence-raw.md +31 -0
- package/dist/extension-assets/atlassian/docs/confluence-writing.md +101 -0
- package/dist/extension-assets/atlassian/docs/jira-raw.md +16 -0
- package/dist/extension-assets/atlassian/docs/jira-workflows.md +77 -0
- package/dist/extension-assets/atlassian/docs/project-knowledge.md +25 -0
- package/dist/extension-assets/atlassian/docs/storage.md +58 -0
- package/dist/extension-assets/atlassian/icon.svg +20 -0
- package/dist/extension-assets/diagram/docs/diagrams.md +12 -0
- package/dist/extension-assets/imagegen/docs/imagegen.md +17 -0
- package/dist/extension-assets/web-search/icon.svg +1 -0
- package/dist/git-isolated-reader-helper.js +1 -1
- package/dist/html-to-markdown.worker.js +6 -7028
- package/dist/main.js +583 -164
- package/dist/preload.cjs +45 -2
- package/dist/quick-script-docs/runtime/documents.md +54 -0
- package/dist/quick-script-docs/runtime/files.md +11 -0
- package/dist/quick-script-docs/runtime/images.md +10 -0
- package/dist/sandbox-libraries/docx.LICENSE +21 -0
- package/dist/sandbox-libraries/docx.min.js +9 -0
- package/dist/sandbox-libraries/jszip.LICENSE +651 -0
- package/dist/sandbox-libraries/jszip.min.js +13 -0
- package/dist/sandbox-libraries/mammoth.LICENSE +22 -0
- package/dist/sandbox-libraries/mammoth.browser.min.js +13 -0
- package/dist/sandbox-libraries/papaparse.LICENSE +20 -0
- package/dist/sandbox-libraries/papaparse.min.js +7 -0
- package/dist/sandbox-libraries/pptxgen.bundle.js +96 -0
- package/dist/sandbox-libraries/pptxgenjs.LICENSE +21 -0
- package/dist/sandbox-libraries/xlsx.LICENSE +201 -0
- package/dist/sandbox-libraries/xlsx.full.min.js +24 -0
- package/dist/web/assets/{AsyncBashCenterHost-HGsdxUJ3.js → AsyncBashCenterHost-D2Sy43Ub.js} +1 -1
- package/dist/web/assets/ConversationListItem-DvxCcAYm.js +3 -0
- package/dist/web/assets/ConversationsWorkbenchPanel-YeNq9LRn.js +1 -0
- package/dist/web/assets/DiscoverCenterHost-B6K-QnBF.js +1 -0
- package/dist/web/assets/{FileCenterHost-DigJOU5M.js → FileCenterHost-Dlk53K5G.js} +1 -1
- package/dist/web/assets/FilesWorkbenchPanel-PeCu12oU.js +12 -0
- package/dist/web/assets/{GitDiffCenterHost-IuZfF3hG.js → GitDiffCenterHost-3_Ea0RyG.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-CScC0CfH.js → GitWorkbenchPanel-CYvCkOAW.js} +1 -1
- package/dist/web/assets/{LaunchCenterHost-CIu7bcoZ.js → LaunchCenterHost-CP773N_3.js} +1 -1
- package/dist/web/assets/LaunchConfigurationNotice-CtmZ1uIQ.js +1 -0
- package/dist/web/assets/{LaunchesWorkbenchPanel-Vy0Gm7gg.js → LaunchesWorkbenchPanel-DP3yVfkO.js} +1 -1
- package/dist/web/assets/LogsCenterHost-BFP0doQf.js +1 -0
- package/dist/web/assets/{MermaidCenterHost-DDh4ArdK.js → MermaidCenterHost-Bjl6Dvrq.js} +1 -1
- package/dist/web/assets/MobileFilesBody-CDp21MGZ.js +1 -0
- package/dist/web/assets/{MobileFilesHost-C1jev2Un.js → MobileFilesHost-DlJI_yau.js} +1 -1
- package/dist/web/assets/MobileLaunchOutputHost-y3TehLWF.js +1 -0
- package/dist/web/assets/MobileLaunchesHost-CBNtDTrs.js +2 -0
- package/dist/web/assets/MobileLogsHost-BSb2lydK.js +1 -0
- package/dist/web/assets/MobileNoteEditorHost-7yW7hIC2.js +1 -0
- package/dist/web/assets/{MobileNotesHost-BZeYpK9H.js → MobileNotesHost-CvDHzpAh.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsHost-U3Mx3EN8.js → MobileProjectSettingsHost-CjtPfyKT.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsPageHost-CMvxbjfs.js → MobileProjectSettingsPageHost-j_7N-B9L.js} +1 -1
- package/dist/web/assets/{MobileSettingsHost-CP8Z_-gH.js → MobileSettingsHost-DXIKNF01.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageHost-BPjXKTMV.js → MobileSettingsPageHost-CEzo7J9p.js} +1 -1
- package/dist/web/assets/MobileSettingsPageScreen-99wMLRsn.js +1 -0
- package/dist/web/assets/NotesWorkbenchPanel-DqTwXBBv.js +1 -0
- package/dist/web/assets/ProjectSettingsCenterHost-D96cL0uH.js +1 -0
- package/dist/web/assets/{PullRequestCenterHost-CZhXfCX2.js → PullRequestCenterHost-DY0yPDK2.js} +1 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-D07LE8vJ.js +1 -0
- package/dist/web/assets/{SearchWorkbenchPanel-qLgszneN.js → SearchWorkbenchPanel-D2_3iXo8.js} +1 -1
- package/dist/web/assets/SettingsCenter-BQWc24di.js +1 -0
- package/dist/web/assets/SettingsCenterHost-BvgNfeZN.js +1 -0
- package/dist/web/assets/{SystemPromptCenterHost-ya5AvXsd.js → SystemPromptCenterHost-BLHkB7lp.js} +1 -1
- package/dist/web/assets/activity-notices-C9aphS1s.js +1 -0
- package/dist/web/assets/adapters-DNU88KT0.js +1 -0
- package/dist/web/assets/agent-profiles.svelte-DgI8wSS2.js +1 -0
- package/dist/web/assets/api-CHNbLvvY.js +1 -0
- package/dist/web/assets/center-tabs.svelte-CyhCD_6b.js +1 -0
- package/dist/web/assets/channel-6wGoOwGx.js +57 -0
- package/dist/web/assets/circle-question-mark-C7NgqbLL.js +1 -0
- package/dist/web/assets/code-DJR0pnqV.js +7 -0
- package/dist/web/assets/{confirm-dialog-Bw_IxcZD.js → confirm-dialog-BDjzMiC4.js} +1 -1
- package/dist/web/assets/{conversation-connection-3GxIuhbS.js → conversation-connection-mLNyfV2d.js} +1 -1
- package/dist/web/assets/dialog-CkRcLEJT.js +1 -0
- package/dist/web/assets/discover-Dh4m7djO.js +4 -0
- package/dist/web/assets/dist-DSApqEag.js +1 -0
- package/dist/web/assets/file-tabs.svelte-cX3MMyG6.js +2 -0
- package/dist/web/assets/filesystem-BbIXrkGB.js +1 -0
- package/dist/web/assets/{git-store.svelte-CM5k7yRU.js → git-store.svelte-D3uwRVnj.js} +1 -1
- package/dist/web/assets/{git.api-D2CfUXZW.js → git.api-CTu-tG8A.js} +1 -1
- package/dist/web/assets/index-BrxjAwg0.js +46 -0
- package/dist/web/assets/index-yEOHI1Z7.css +1 -0
- package/dist/web/assets/launches-CC4gLnSa.js +5 -0
- package/dist/web/assets/{launches.api-BZxyWF8t.js → launches.api-CaotSs6l.js} +1 -1
- package/dist/web/assets/launches.svelte-DDA5J-RZ.js +2 -0
- package/dist/web/assets/{message-square-CqLxHJuW.js → list-checks-zV9Dp7Cu.js} +1 -1
- package/dist/web/assets/{logs.api-Coi8HJuy.js → logs.api-DMmVlkSz.js} +1 -1
- package/dist/web/assets/{maintenance-state.svelte-CDO9i4dk.js → maintenance-state.svelte-l9v7Hg3i.js} +2 -2
- package/dist/web/assets/notify.svelte-BTEXJZ8P.js +1 -0
- package/dist/web/assets/popover-panel-C-weKOk3.js +5 -0
- package/dist/web/assets/pr-view-loader.svelte-C0NClMS6.js +1 -0
- package/dist/web/assets/progress-CKEsTSOk.js +1 -0
- package/dist/web/assets/scratch-notes-state.svelte-B_rY_-9q.js +1 -0
- package/dist/web/assets/{scratch-notes.api-Cbvag3bv.js → scratch-notes.api-B2gOOK6Z.js} +1 -1
- package/dist/web/assets/search-input-CEr0SmAB.js +1 -0
- package/dist/web/assets/settings-2-CWd8Y06n.js +1 -0
- package/dist/web/assets/settings-CRmC19nG.js +1 -0
- package/dist/web/assets/settings-CXoAzSmm.js +1 -0
- package/dist/web/assets/settings-actions.svelte-BB6u_lQ0.js +1 -0
- package/dist/web/assets/settings-page-controllers.svelte-al78EDTL.js +29 -0
- package/dist/web/assets/sheet-content-DauQ7hPL.js +1 -0
- package/dist/web/assets/shell-CYbWnH52.js +4 -0
- package/dist/web/assets/shell-layout.svelte-CmEWk428.js +2 -0
- package/dist/web/assets/textarea-BEZ65po_.js +1 -0
- package/dist/web/assets/views-BumCSQ3W.js +2 -0
- package/dist/web/assets/{workbench-connection-gGGv4o8i.js → workbench-connection-CGHdORw3.js} +1 -1
- package/dist/web/assets/{workspace-Cc47dGjw.js → workspace-CW738NJG.js} +1 -1
- package/dist/web/assets/{workspace-actions.svelte-B3oum_9S.js → workspace-actions.svelte-DL9xv7lJ.js} +1 -1
- package/dist/web/assets/workspace-selectors.svelte-BRJvPEBh.js +105 -0
- package/dist/web/index.html +142 -83
- package/dist/web/sw.js +1 -1
- package/dist/worker.js +14 -9
- package/package.json +8 -9
- package/dist/chunk-RUZ2UAYH.js +0 -365
- package/dist/guides/confluence/SKILL.md +0 -36
- package/dist/guides/jira/SKILL.md +0 -34
- package/dist/resize-worker.js +0 -168
- package/dist/web/assets/ConversationListItem-Caz2KiJH.js +0 -3
- package/dist/web/assets/ConversationsWorkbenchPanel-B6dzWkG1.js +0 -1
- package/dist/web/assets/DiscoverCenterHost-B186WBRA.js +0 -1
- package/dist/web/assets/FilesWorkbenchPanel-VPvx3Bmi.js +0 -12
- package/dist/web/assets/LaunchConfigurationNotice-5yb4cH27.js +0 -1
- package/dist/web/assets/LogsCenterHost-BXBozCYw.js +0 -1
- package/dist/web/assets/MobileFilesBody-Cda_7gDp.js +0 -1
- package/dist/web/assets/MobileLaunchOutputHost-Bsv12o2H.js +0 -1
- package/dist/web/assets/MobileLaunchesHost-C9VH-2bn.js +0 -2
- package/dist/web/assets/MobileLogsHost-BMDXc-WC.js +0 -1
- package/dist/web/assets/MobileNoteEditorHost-BA6WIY1Y.js +0 -1
- package/dist/web/assets/MobileSettingsPageScreen-C5rHdrUU.js +0 -1
- package/dist/web/assets/NotesWorkbenchPanel-Bf6rySTL.js +0 -1
- package/dist/web/assets/ProjectSettingsCenterHost-BVXpBixy.js +0 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-BBnZJVnI.js +0 -1
- package/dist/web/assets/SettingsCenter-7BfrBfiy.js +0 -1
- package/dist/web/assets/SettingsCenterHost-Ck5uHILP.js +0 -1
- package/dist/web/assets/adapters-DxJoo6Za.js +0 -1
- package/dist/web/assets/agent-profiles.svelte-D5YHPc90.js +0 -1
- package/dist/web/assets/api-eaGLre0q.js +0 -1
- package/dist/web/assets/center-tabs.svelte-JJGozG_H.js +0 -1
- package/dist/web/assets/channel-B503YLZR.js +0 -57
- package/dist/web/assets/chevron-left-DPEFG6UJ.js +0 -1
- package/dist/web/assets/circle-alert-Cp2l2jcj.js +0 -5
- package/dist/web/assets/clock-Db6f9HtS.js +0 -1
- package/dist/web/assets/code-BRQC0Tpn.js +0 -7
- package/dist/web/assets/dialog-DU4gXD1J.js +0 -1
- package/dist/web/assets/discover-B3I5g1_G.js +0 -4
- package/dist/web/assets/dist-B_NFPhKV.js +0 -1
- package/dist/web/assets/file-tabs.svelte-DKtVVVCq.js +0 -2
- package/dist/web/assets/filesystem-ReGivxAC.js +0 -1
- package/dist/web/assets/index-DIQuyMVT.css +0 -1
- package/dist/web/assets/index-FJEmK_L5.js +0 -48
- package/dist/web/assets/launches-DiAl56ED.js +0 -5
- package/dist/web/assets/launches.svelte-BVs1pAhl.js +0 -2
- package/dist/web/assets/notebook-pen-lVsLYSe4.js +0 -1
- package/dist/web/assets/notify.svelte-BKVBraTJ.js +0 -1
- package/dist/web/assets/pencil-BrlypebI.js +0 -1
- package/dist/web/assets/pr-view-loader.svelte-DcIwqDJV.js +0 -1
- package/dist/web/assets/progress-DBCSpVPn.js +0 -1
- package/dist/web/assets/scratch-notes-state.svelte-Br_WiMEp.js +0 -1
- package/dist/web/assets/search-input-zU4WCZiz.js +0 -1
- package/dist/web/assets/settings-2-8MSBUGAl.js +0 -1
- package/dist/web/assets/settings-9LBrw4Nv.js +0 -1
- package/dist/web/assets/settings-B7uXsflY.js +0 -1
- package/dist/web/assets/settings-actions.svelte-B8psX3cj.js +0 -1
- package/dist/web/assets/settings-page-controllers.svelte-CU0i08wo.js +0 -30
- package/dist/web/assets/shell-DB5Db5-E.js +0 -4
- package/dist/web/assets/shell-layout.svelte-BT2508sa.js +0 -2
- package/dist/web/assets/textarea-CeoFJ0-t.js +0 -1
- package/dist/web/assets/views-Z-n-GTYY.js +0 -2
- package/dist/web/assets/workspace-selectors.svelte-DLUlSgEE.js +0 -131
- /package/dist/{html-to-markdown.worker.js.LEGAL.txt → chunk-BUD4JHBZ.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-CKVFGRVV.js.LEGAL.txt → chunk-KEXKZKN4.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-TW6FURZ7.js.LEGAL.txt → chunk-SDDKYMIP.js.LEGAL.txt} +0 -0
|
@@ -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.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js
|
|
5
5
|
var FifoQueue = class {
|
|
6
6
|
incoming = [];
|
|
7
7
|
outgoing = [];
|
|
@@ -112,7 +112,7 @@ function createAssistantMessageEventStream() {
|
|
|
112
112
|
return new AssistantMessageEventStream();
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
115
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
|
|
116
116
|
function formatThrownValue(value) {
|
|
117
117
|
if (value instanceof Error)
|
|
118
118
|
return value.message || value.name;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
|
+
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
trustedHttpUrl
|
|
5
|
+
} from "./chunk-Q5E4ZL2R.js";
|
|
6
|
+
import {
|
|
7
|
+
pollOAuthDeviceCodeFlow
|
|
8
|
+
} from "./chunk-U3TEC52G.js";
|
|
9
|
+
import "./chunk-CWESUMYQ.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/auth/oauth/meta.js
|
|
12
|
+
var CLIENT_ID = "1031625952748946";
|
|
13
|
+
var AUTH_HOST = "https://auth.meta.com";
|
|
14
|
+
var DEVICE_AUTHORIZATION_URL = `${AUTH_HOST}/oidc/device/authorization/`;
|
|
15
|
+
var DEVICE_TOKEN_URL = `${AUTH_HOST}/oidc/device/token/`;
|
|
16
|
+
var API_KEY_MINT_URL = "https://api.meta.ai/muse-code/key";
|
|
17
|
+
var API_KEY_LIFETIME_MS = 24 * 60 * 60 * 1e3;
|
|
18
|
+
var REQUEST_TIMEOUT_MS = 30 * 1e3;
|
|
19
|
+
function requestSignal(signal) {
|
|
20
|
+
return AbortSignal.any([AbortSignal.timeout(REQUEST_TIMEOUT_MS), signal]);
|
|
21
|
+
}
|
|
22
|
+
async function readJson(response) {
|
|
23
|
+
try {
|
|
24
|
+
const json = await response.json();
|
|
25
|
+
return json && typeof json === "object" ? json : null;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function errorDetail(json) {
|
|
31
|
+
for (const key of ["error_description", "detail", "message", "error"]) {
|
|
32
|
+
const value = json?.[key];
|
|
33
|
+
if (typeof value === "string" && value.trim())
|
|
34
|
+
return `: ${value.trim()}`;
|
|
35
|
+
}
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
function positiveNumber(value) {
|
|
39
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
40
|
+
}
|
|
41
|
+
async function startDeviceAuthorization(signal) {
|
|
42
|
+
const response = await fetch(DEVICE_AUTHORIZATION_URL, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
46
|
+
Accept: "application/json"
|
|
47
|
+
},
|
|
48
|
+
body: new URLSearchParams({ client_id: CLIENT_ID }).toString(),
|
|
49
|
+
signal: requestSignal(signal)
|
|
50
|
+
});
|
|
51
|
+
const json = await readJson(response);
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
throw new Error(`Meta device authorization failed with status ${response.status}${errorDetail(json)}`);
|
|
54
|
+
}
|
|
55
|
+
const deviceCode = json?.device_code;
|
|
56
|
+
const userCode = json?.user_code;
|
|
57
|
+
const verificationUri = trustedHttpUrl(json?.verification_uri_complete) ?? trustedHttpUrl(json?.verification_uri);
|
|
58
|
+
if (typeof deviceCode !== "string" || !deviceCode || typeof userCode !== "string" || !userCode || !verificationUri) {
|
|
59
|
+
throw new Error(`Invalid Meta device authorization response: ${JSON.stringify(json)}`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
deviceCode,
|
|
63
|
+
userCode,
|
|
64
|
+
verificationUri,
|
|
65
|
+
intervalSeconds: positiveNumber(json?.interval),
|
|
66
|
+
expiresInSeconds: positiveNumber(json?.expires_in)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function pollForIdentityToken(device, signal) {
|
|
70
|
+
return pollOAuthDeviceCodeFlow({
|
|
71
|
+
intervalSeconds: device.intervalSeconds,
|
|
72
|
+
expiresInSeconds: device.expiresInSeconds,
|
|
73
|
+
waitBeforeFirstPoll: true,
|
|
74
|
+
signal,
|
|
75
|
+
poll: async () => {
|
|
76
|
+
const response = await fetch(DEVICE_TOKEN_URL, {
|
|
77
|
+
method: "POST",
|
|
78
|
+
headers: {
|
|
79
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
80
|
+
Accept: "application/json"
|
|
81
|
+
},
|
|
82
|
+
body: new URLSearchParams({
|
|
83
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
84
|
+
device_code: device.deviceCode,
|
|
85
|
+
client_id: CLIENT_ID
|
|
86
|
+
}).toString(),
|
|
87
|
+
signal: requestSignal(signal)
|
|
88
|
+
});
|
|
89
|
+
const json = await readJson(response);
|
|
90
|
+
if (response.ok && typeof json?.access_token === "string" && json.access_token) {
|
|
91
|
+
return { status: "complete", value: json.access_token };
|
|
92
|
+
}
|
|
93
|
+
switch (json?.error) {
|
|
94
|
+
case "authorization_pending":
|
|
95
|
+
return { status: "pending" };
|
|
96
|
+
case "slow_down":
|
|
97
|
+
return { status: "slow_down", intervalSeconds: positiveNumber(json?.interval) };
|
|
98
|
+
case "access_denied":
|
|
99
|
+
return { status: "failed", message: "Meta login was denied." };
|
|
100
|
+
case "expired_token":
|
|
101
|
+
return { status: "failed", message: "Meta device authorization expired. Please restart login." };
|
|
102
|
+
default:
|
|
103
|
+
return {
|
|
104
|
+
status: "failed",
|
|
105
|
+
message: `Meta device token request failed with status ${response.status}${errorDetail(json)}`
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async function mintApiKey(identityToken, signal) {
|
|
112
|
+
const response = await fetch(API_KEY_MINT_URL, {
|
|
113
|
+
method: "POST",
|
|
114
|
+
headers: {
|
|
115
|
+
Accept: "application/json",
|
|
116
|
+
Authorization: `Bearer ${identityToken}`,
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
"x-api-version": "1.0.0"
|
|
119
|
+
},
|
|
120
|
+
body: "{}",
|
|
121
|
+
signal: requestSignal(signal)
|
|
122
|
+
});
|
|
123
|
+
const json = await readJson(response);
|
|
124
|
+
if (response.status === 401 || response.status === 403) {
|
|
125
|
+
throw new Error(`Meta session expired (status ${response.status}). Run \`/login meta\` to sign in again.${errorDetail(json)}`);
|
|
126
|
+
}
|
|
127
|
+
if (!response.ok) {
|
|
128
|
+
throw new Error(`Meta API key mint failed with status ${response.status}${errorDetail(json)}`);
|
|
129
|
+
}
|
|
130
|
+
const apiKey = json?.api_key;
|
|
131
|
+
if (typeof apiKey !== "string" || !apiKey) {
|
|
132
|
+
const actionUrl = trustedHttpUrl(json?.action_url);
|
|
133
|
+
throw new Error(`Meta did not issue an API key.${actionUrl ? ` Complete setup at ${actionUrl}` : ""}`);
|
|
134
|
+
}
|
|
135
|
+
return { type: "oauth", refresh: identityToken, access: apiKey, expires: Date.now() + API_KEY_LIFETIME_MS };
|
|
136
|
+
}
|
|
137
|
+
async function loginMeta(interaction) {
|
|
138
|
+
try {
|
|
139
|
+
const device = await startDeviceAuthorization(interaction.signal);
|
|
140
|
+
interaction.notify({
|
|
141
|
+
type: "device_code",
|
|
142
|
+
userCode: device.userCode,
|
|
143
|
+
verificationUri: device.verificationUri,
|
|
144
|
+
intervalSeconds: device.intervalSeconds,
|
|
145
|
+
expiresInSeconds: device.expiresInSeconds
|
|
146
|
+
});
|
|
147
|
+
const identityToken = await pollForIdentityToken(device, interaction.signal);
|
|
148
|
+
interaction.notify({ type: "progress", message: "Enabling Meta Model API access..." });
|
|
149
|
+
return await mintApiKey(identityToken, interaction.signal);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (interaction.signal.aborted)
|
|
152
|
+
throw new Error("Login cancelled");
|
|
153
|
+
throw e;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
var metaOAuth = {
|
|
157
|
+
name: "Meta (Muse subscription)",
|
|
158
|
+
isSubscription: true,
|
|
159
|
+
loginLabel: "Sign in with Meta",
|
|
160
|
+
login: loginMeta,
|
|
161
|
+
refresh: (credential, signal) => mintApiKey(credential.refresh, signal),
|
|
162
|
+
async toAuth(credential) {
|
|
163
|
+
return { apiKey: credential.access };
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
metaOAuth
|
|
168
|
+
};
|
|
@@ -5,53 +5,54 @@ import {
|
|
|
5
5
|
convertResponsesTools,
|
|
6
6
|
getResponsesToolSupport,
|
|
7
7
|
processResponsesStream
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IRRR3PWN.js";
|
|
9
9
|
import {
|
|
10
10
|
buildCopilotDynamicHeaders,
|
|
11
11
|
hasCopilotVisionInput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TQURLRHD.js";
|
|
13
13
|
import {
|
|
14
14
|
clampOpenAIPromptCacheKey
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-KSZJ3HGD.js";
|
|
15
|
+
} from "./chunk-KUFIFCB4.js";
|
|
17
16
|
import {
|
|
18
17
|
OpenAI
|
|
19
18
|
} from "./chunk-NW3DH7IK.js";
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-LP4APBBQ.js";
|
|
21
20
|
import {
|
|
22
21
|
buildBaseOptions,
|
|
23
22
|
createGrammarToolInputProperties,
|
|
24
23
|
resolveSamplingParams
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-Z6AY5VOZ.js";
|
|
25
|
+
import "./chunk-TSAUBRRU.js";
|
|
26
|
+
import {
|
|
27
|
+
retryProviderRequest
|
|
28
|
+
} from "./chunk-3CZXUKLG.js";
|
|
27
29
|
import {
|
|
28
30
|
formatProviderError,
|
|
29
31
|
normalizeProviderError
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
retryProviderRequest
|
|
33
|
-
} from "./chunk-SQ7CWNIT.js";
|
|
32
|
+
} from "./chunk-PVPJAGWR.js";
|
|
34
33
|
import {
|
|
35
34
|
headersToRecord
|
|
36
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-6IHXVT5H.js";
|
|
37
36
|
import {
|
|
38
37
|
getProviderEnvValue
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-JBEWFFOK.js";
|
|
39
|
+
import "./chunk-BG2KGLIA.js";
|
|
40
40
|
import {
|
|
41
41
|
clampThinkingLevel,
|
|
42
42
|
getDeclaredTools,
|
|
43
43
|
resolveTranscript,
|
|
44
44
|
resolveTranscriptTools
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-W7LEYYFH.js";
|
|
46
46
|
import {
|
|
47
47
|
AssistantMessageEventStream
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-DDBE2VLT.js";
|
|
49
49
|
import {
|
|
50
50
|
getIdentityHeaders
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-Q3C7TQ2M.js";
|
|
52
|
+
import "./chunk-U5KGV63C.js";
|
|
52
53
|
import "./chunk-CWESUMYQ.js";
|
|
53
54
|
|
|
54
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
55
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js
|
|
55
56
|
var OPENAI_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "openai-codex", "opencode"]);
|
|
56
57
|
var OPENAI_RESPONSES_MIN_OUTPUT_TOKENS = 16;
|
|
57
58
|
var CHATGPT_USAGE_URL = "https://chatgpt.com/settings/usage";
|
|
@@ -94,6 +95,7 @@ function getCompat(model) {
|
|
|
94
95
|
supportsDeveloperRole: model.compat?.supportsDeveloperRole ?? true,
|
|
95
96
|
supportsMidConvoSystemMessages: model.compat?.supportsMidConvoSystemMessages ?? false,
|
|
96
97
|
sessionAffinityFormat: model.compat?.sessionAffinityFormat ?? detectSessionAffinityFormat(model),
|
|
98
|
+
promptCacheKeyMode: model.compat?.promptCacheKeyMode ?? "auto",
|
|
97
99
|
supportsLongCacheRetention: model.compat?.supportsLongCacheRetention ?? true,
|
|
98
100
|
supportsStrictMode: model.compat?.supportsStrictMode ?? false,
|
|
99
101
|
supportsOpenAIGrammarTools: model.compat?.supportsOpenAIGrammarTools ?? false,
|
|
@@ -188,11 +190,6 @@ var stream = (model, context, options) => {
|
|
|
188
190
|
stream2.push({ type: "done", reason: output.stopReason, message: output });
|
|
189
191
|
stream2.end();
|
|
190
192
|
} catch (error) {
|
|
191
|
-
for (const block of output.content) {
|
|
192
|
-
delete block.index;
|
|
193
|
-
delete block.partialJson;
|
|
194
|
-
delete block.customInput;
|
|
195
|
-
}
|
|
196
193
|
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
197
194
|
const errorMessage = formatProviderError(normalizeProviderError(error), `${model.provider === "openai" ? "OpenAI" : model.provider} API error`);
|
|
198
195
|
if (errorMessage.includes("subscription_sharing_usage_limit_exceeded")) {
|
|
@@ -239,7 +236,7 @@ function createClient(model, context, apiKey, optionsHeaders, identity, fetch, s
|
|
|
239
236
|
headers["x-session-id"] = sessionId;
|
|
240
237
|
} else {
|
|
241
238
|
if (compat.sessionAffinityFormat === "openai") {
|
|
242
|
-
headers
|
|
239
|
+
headers["session-id"] = sessionId;
|
|
243
240
|
}
|
|
244
241
|
headers["x-client-request-id"] = sessionId;
|
|
245
242
|
}
|
|
@@ -269,12 +266,13 @@ function buildParams(model, context, options, compat, grammarToolInputProperties
|
|
|
269
266
|
configurationUpdateEffort
|
|
270
267
|
});
|
|
271
268
|
const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env);
|
|
269
|
+
const sendPromptCacheKey = cacheRetention !== "none" && compat.promptCacheKeyMode !== "disabled";
|
|
272
270
|
const omitUnsupportedFields = isChatGPTSignIn(model, options?.apiKey);
|
|
273
271
|
const params = {
|
|
274
272
|
model: model.id,
|
|
275
273
|
input: messages,
|
|
276
274
|
stream: true,
|
|
277
|
-
prompt_cache_key:
|
|
275
|
+
prompt_cache_key: sendPromptCacheKey ? clampOpenAIPromptCacheKey(options?.sessionId) : void 0,
|
|
278
276
|
prompt_cache_retention: omitUnsupportedFields ? void 0 : getPromptCacheRetention(compat, cacheRetention),
|
|
279
277
|
prompt_cache_options: omitUnsupportedFields ? void 0 : getPromptCacheOptions(compat, cacheRetention),
|
|
280
278
|
store: false
|
|
@@ -2,9 +2,9 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getProviderEnvValue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JBEWFFOK.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.
|
|
7
|
+
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js
|
|
8
8
|
var DEFAULT_AZURE_API_VERSION = "v1";
|
|
9
9
|
function parseDeploymentNameMap(value) {
|
|
10
10
|
const map = /* @__PURE__ */ new Map();
|