@nervekit/desktop 0.40.2 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/THIRD-PARTY-LICENSES.txt +964 -4
- package/dist/bin.js +1 -0
- package/dist/{chunk-YJT4NXMV.js → chunk-2ICPO4UM.js} +5 -5
- package/dist/{chunk-EX63VKXY.js → chunk-3CZXUKLG.js} +1 -1
- package/dist/{chunk-KTGSBL6T.js → chunk-4OCDR4DU.js} +11 -11
- package/dist/{chunk-BNVMNV4O.js → chunk-62DQXVPO.js} +2 -2
- package/dist/{chunk-K2J2VZXO.js → chunk-6GUJQURI.js} +2 -2
- package/dist/{chunk-VBM7TD3X.js → chunk-6IHXVT5H.js} +1 -1
- package/dist/{chunk-KBNEZR7T.js → chunk-6ZS7TA6E.js} +2 -2
- package/dist/{chunk-O6U226AI.js → chunk-7FSH3ABG.js} +4 -4
- package/dist/{chunk-RPLBWENJ.js → chunk-7HGFEQSD.js} +5 -5
- package/dist/{chunk-XZYFB566.js → chunk-7RPHIJT3.js} +4 -4
- package/dist/{chunk-WRTA5G57.js → chunk-APY4TUR3.js} +188 -1
- package/dist/{chunk-YUO5V75X.js → chunk-BACYVEE6.js} +2 -2
- package/dist/{chunk-H2G55ZPG.js → chunk-BG2KGLIA.js} +2 -2
- package/dist/{chunk-7JQBECUL.js → chunk-BN5YDZUZ.js} +1205 -326
- package/dist/chunk-BUD4JHBZ.js +7017 -0
- package/dist/{chunk-TSV3PFU2.js → chunk-DDBE2VLT.js} +2 -2
- package/dist/{chunk-WJULIJOU.js → chunk-EF7ZZKA3.js} +3 -3
- package/dist/{chunk-HOCODVKL.js → chunk-EUT45AKW.js} +16 -16
- package/dist/{chunk-C6RO4LP3.js → chunk-FCAIYPDJ.js} +2 -2
- package/dist/{chunk-6FSDDGFZ.js → chunk-FZ557YWE.js} +47478 -52993
- package/dist/{chunk-VC6TX2Y2.js → chunk-HPINJGBO.js} +5 -5
- package/dist/{chunk-ANI6J75M.js → chunk-IRRR3PWN.js} +7 -7
- package/dist/{chunk-S62LLS4I.js → chunk-IVBMHEPK.js} +12 -12
- package/dist/{chunk-SU2USXTD.js → chunk-JBEWFFOK.js} +1 -1
- package/dist/{chunk-3VZR3ZUY.js → chunk-KEXKZKN4.js} +6 -6
- package/dist/{chunk-ODS5QROC.js → chunk-KUFIFCB4.js} +1 -1
- package/dist/{chunk-L2DHKP5C.js → chunk-L5WGVYXM.js} +2 -2
- package/dist/{chunk-WIN7KHMV.js → chunk-LGIIT2NF.js} +12 -12
- package/dist/{chunk-2BKMOJYJ.js → chunk-LP4APBBQ.js} +1 -1
- package/dist/{chunk-6PACEIUY.js → chunk-MI6L5CEA.js} +2 -2
- package/dist/{chunk-HDBDYGJQ.js → chunk-N4OXAS3A.js} +1 -1
- package/dist/{chunk-KSSM6LUI.js → chunk-N6BUYKF3.js} +5 -5
- package/dist/{chunk-MWIKZIAI.js → chunk-NVVW3MWJ.js} +9 -9
- package/dist/{chunk-VTDI5KP7.js → chunk-O5JHHRFN.js} +19 -19
- package/dist/{chunk-F3MHINI6.js → chunk-O6FDXE54.js} +16 -16
- package/dist/{chunk-E4JNHQGT.js → chunk-OMCM3MHS.js} +7 -7
- package/dist/{chunk-PST63OUS.js → chunk-OO2KD2L2.js} +18295 -4318
- package/dist/{chunk-7FLZA2BD.js → chunk-P72Y5ZBH.js} +7 -7
- package/dist/{chunk-O2652RWY.js → chunk-PVPJAGWR.js} +2 -2
- package/dist/{chunk-UDC7NPQJ.js → chunk-Q3C7TQ2M.js} +3 -3
- package/dist/{chunk-B4IE2GAM.js → chunk-Q5E4ZL2R.js} +1 -1
- package/dist/{chunk-5NN7JAJ2.js → chunk-QFK2SWD2.js} +7 -7
- package/dist/{chunk-SHEU5KLD.js → chunk-RJR7DJJK.js} +3 -3
- package/dist/{chunk-4H3WR7IT.js → chunk-RL52LSTV.js} +1 -1
- package/dist/{chunk-FGZX4Q7W.js → chunk-RTB6CF7F.js} +15 -15
- package/dist/{chunk-QBAIDKF6.js → chunk-TQURLRHD.js} +1 -1
- package/dist/{chunk-3SSNDIQT.js → chunk-TSAUBRRU.js} +1 -1
- package/dist/{chunk-ER2ES2RH.js → chunk-U3TEC52G.js} +1 -1
- package/dist/{chunk-XY53EFK3.js → chunk-U5KGV63C.js} +1 -1
- package/dist/{chunk-WYPVD3HW.js → chunk-UVRULOOP.js} +10 -10
- package/dist/{chunk-4VPX67B7.js → chunk-VOATSLRG.js} +3 -1
- package/dist/{chunk-TGKIV3F4.js → chunk-W7LEYYFH.js} +18 -18
- package/dist/{chunk-T6NRMNLQ.js → chunk-WC5HHPPM.js} +1 -1
- package/dist/{chunk-YQFENES6.js → chunk-WG62RHZ2.js} +3 -3
- package/dist/{chunk-XE2E2KBP.js → chunk-WIQEPAUG.js} +10 -10
- package/dist/{chunk-DTGL5P2V.js → chunk-XM27UVWN.js} +3 -3
- package/dist/{chunk-3JJN36GV.js → chunk-XTUSLUQ7.js} +16 -16
- package/dist/{chunk-OAEV22IW.js → chunk-Z6AY5VOZ.js} +6 -6
- package/dist/{chunk-FZ5N6WXF.js → chunk-ZGWXLG5X.js} +18 -18
- package/dist/{chunk-6TAN6WG6.js → chunk-ZUWBEV2O.js} +1 -1
- package/dist/{chunk-OANTMDXI.js → chunk-ZVH6EB7S.js} +1 -1
- package/dist/daemon.js +65 -31
- 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 -169
- 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-BvXKoCVr.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-C_7XZAFZ.js → FileCenterHost-Dlk53K5G.js} +1 -1
- package/dist/web/assets/FilesWorkbenchPanel-PeCu12oU.js +12 -0
- package/dist/web/assets/{GitDiffCenterHost-Cr7lqGI_.js → GitDiffCenterHost-3_Ea0RyG.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-BFbwUgIN.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-BqzJvsrj.js → LaunchesWorkbenchPanel-DP3yVfkO.js} +1 -1
- package/dist/web/assets/LogsCenterHost-BFP0doQf.js +1 -0
- package/dist/web/assets/{MermaidCenterHost-DVsZB8nB.js → MermaidCenterHost-Bjl6Dvrq.js} +1 -1
- package/dist/web/assets/MobileFilesBody-CDp21MGZ.js +1 -0
- package/dist/web/assets/{MobileFilesHost-D843vkDF.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-meLV39Yw.js → MobileNotesHost-CvDHzpAh.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsHost-A49Fdn54.js → MobileProjectSettingsHost-CjtPfyKT.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsPageHost-BXpUqS_N.js → MobileProjectSettingsPageHost-j_7N-B9L.js} +1 -1
- package/dist/web/assets/{MobileSettingsHost-DPKPajzI.js → MobileSettingsHost-DXIKNF01.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageHost-izNWGN0i.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-BYkWxXQe.js → PullRequestCenterHost-DY0yPDK2.js} +1 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-D07LE8vJ.js +1 -0
- package/dist/web/assets/{SearchWorkbenchPanel-DaC0smfe.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-B1hfsfAn.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 -14
- package/package.json +7 -7
- package/dist/guides/confluence/SKILL.md +0 -36
- package/dist/guides/jira/SKILL.md +0 -34
- package/dist/web/assets/ConversationListItem-Caz2KiJH.js +0 -3
- package/dist/web/assets/ConversationsWorkbenchPanel-CIfK_e3I.js +0 -1
- package/dist/web/assets/DiscoverCenterHost-Ep8EN9iJ.js +0 -1
- package/dist/web/assets/FilesWorkbenchPanel-CtXo7ywG.js +0 -12
- package/dist/web/assets/LaunchConfigurationNotice-CJjWkMhv.js +0 -1
- package/dist/web/assets/LogsCenterHost-BI1fSxFW.js +0 -1
- package/dist/web/assets/MobileFilesBody-BJMoaP9I.js +0 -1
- package/dist/web/assets/MobileLaunchOutputHost-vpltMcar.js +0 -1
- package/dist/web/assets/MobileLaunchesHost-CdDrKASg.js +0 -2
- package/dist/web/assets/MobileLogsHost-qK7N-C1y.js +0 -1
- package/dist/web/assets/MobileNoteEditorHost-Bg1N8o54.js +0 -1
- package/dist/web/assets/MobileSettingsPageScreen-DWMg4fDo.js +0 -1
- package/dist/web/assets/NotesWorkbenchPanel-Bf6rySTL.js +0 -1
- package/dist/web/assets/ProjectSettingsCenterHost-DHeb274m.js +0 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-ZvGbi1Cr.js +0 -1
- package/dist/web/assets/SettingsCenter-C_NLBsi6.js +0 -1
- package/dist/web/assets/SettingsCenterHost-jP8MULEj.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-B-aZ504j.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-TZ1KAAsX.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-D_ydJF8u.js +0 -30
- package/dist/web/assets/shell-DB5Db5-E.js +0 -4
- package/dist/web/assets/shell-layout.svelte-OoLFwzzJ.js +0 -2
- package/dist/web/assets/textarea-CeoFJ0-t.js +0 -1
- package/dist/web/assets/views-ByPCKDiZ.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-3VZR3ZUY.js.LEGAL.txt → chunk-KEXKZKN4.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-PST63OUS.js.LEGAL.txt → chunk-OO2KD2L2.js.LEGAL.txt} +0 -0
|
@@ -3,20 +3,20 @@ const require = __nerveCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
applyOpenRouterReportedCost,
|
|
5
5
|
isOpenRouterModel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N4OXAS3A.js";
|
|
7
7
|
import {
|
|
8
8
|
buildCopilotDynamicHeaders,
|
|
9
9
|
hasCopilotVisionInput
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TQURLRHD.js";
|
|
11
11
|
import {
|
|
12
12
|
clampOpenAIPromptCacheKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KUFIFCB4.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenAI
|
|
16
16
|
} from "./chunk-NW3DH7IK.js";
|
|
17
17
|
import {
|
|
18
18
|
shortHash
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LP4APBBQ.js";
|
|
20
20
|
import {
|
|
21
21
|
appendGrammarToolInputJsonDelta,
|
|
22
22
|
buildBaseOptions,
|
|
@@ -30,46 +30,46 @@ import {
|
|
|
30
30
|
resolveSamplingParams,
|
|
31
31
|
thinkingBudgetForLevel,
|
|
32
32
|
transformMessages
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-Z6AY5VOZ.js";
|
|
34
34
|
import {
|
|
35
35
|
sanitizeSurrogates
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TSAUBRRU.js";
|
|
37
37
|
import {
|
|
38
38
|
retryProviderRequest
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-3CZXUKLG.js";
|
|
40
40
|
import {
|
|
41
41
|
formatProviderError,
|
|
42
42
|
normalizeProviderError
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-PVPJAGWR.js";
|
|
44
44
|
import {
|
|
45
45
|
headersToRecord
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-6IHXVT5H.js";
|
|
47
47
|
import {
|
|
48
48
|
getProviderEnvValue
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-JBEWFFOK.js";
|
|
50
50
|
import {
|
|
51
51
|
ToolCallArgumentsStream
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-BG2KGLIA.js";
|
|
53
53
|
import {
|
|
54
54
|
calculateCost,
|
|
55
55
|
clampThinkingLevel,
|
|
56
56
|
getDeclaredTools,
|
|
57
57
|
resolveTranscript,
|
|
58
58
|
resolveTranscriptTools
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-W7LEYYFH.js";
|
|
60
60
|
import {
|
|
61
61
|
AssistantMessageEventStream
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-DDBE2VLT.js";
|
|
63
63
|
import {
|
|
64
64
|
getIdentityHeaders
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-Q3C7TQ2M.js";
|
|
66
66
|
import {
|
|
67
67
|
getSystemMessageText,
|
|
68
68
|
renderSystemMessageUpdate
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-U5KGV63C.js";
|
|
70
70
|
import "./chunk-CWESUMYQ.js";
|
|
71
71
|
|
|
72
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
72
|
+
// 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-completions.js
|
|
73
73
|
function hasHeader(headers, name) {
|
|
74
74
|
if (!headers)
|
|
75
75
|
return false;
|
|
@@ -2,12 +2,12 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
clampThinkingLevel
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W7LEYYFH.js";
|
|
6
6
|
import {
|
|
7
7
|
getSystemMessageText
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-U5KGV63C.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
10
|
+
// 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/constrained-sampling.js
|
|
11
11
|
var UnsupportedStrictJsonSchemaError = class extends Error {
|
|
12
12
|
};
|
|
13
13
|
var UNSUPPORTED_STRICT_SCHEMA_KEYS = [
|
|
@@ -239,7 +239,7 @@ function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) {
|
|
|
239
239
|
return properties;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
242
|
+
// 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/estimate.js
|
|
243
243
|
var CHARS_PER_TOKEN = 3.5;
|
|
244
244
|
var ESTIMATED_IMAGE_CHARS = 4800;
|
|
245
245
|
function calculateContextTokens(usage) {
|
|
@@ -324,7 +324,7 @@ function estimateToolsTokens(tools) {
|
|
|
324
324
|
return estimateTextTokens(safeJsonStringify(tools));
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
327
|
+
// 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/simple-options.js
|
|
328
328
|
var CONTEXT_SAFETY_TOKENS = 4096;
|
|
329
329
|
var CONTEXT_SAFETY_RATIO = 0.15;
|
|
330
330
|
var MIN_OUTPUT_WITH_RATIO_MARGIN = 32768;
|
|
@@ -399,7 +399,7 @@ function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLeve
|
|
|
399
399
|
return { maxTokens, thinkingBudget };
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
402
|
+
// 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/transform-messages.js
|
|
403
403
|
var NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)";
|
|
404
404
|
var NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)";
|
|
405
405
|
var ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)";
|
|
@@ -2,37 +2,37 @@ import { createRequire as __nerveCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __nerveCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
resolveHttpProxyUrlForTarget
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6ZS7TA6E.js";
|
|
6
6
|
import {
|
|
7
7
|
combineAbortSignals
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZUWBEV2O.js";
|
|
9
9
|
import {
|
|
10
10
|
convertResponsesMessages,
|
|
11
11
|
convertResponsesTools,
|
|
12
12
|
getResponsesToolSupport,
|
|
13
13
|
processResponsesStream
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IRRR3PWN.js";
|
|
15
15
|
import {
|
|
16
16
|
registerSessionResourceCleanup
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZVH6EB7S.js";
|
|
18
18
|
import {
|
|
19
19
|
clampOpenAIPromptCacheKey
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-KUFIFCB4.js";
|
|
21
|
+
import "./chunk-LP4APBBQ.js";
|
|
22
22
|
import {
|
|
23
23
|
buildBaseOptions,
|
|
24
24
|
createGrammarToolInputProperties
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-Z6AY5VOZ.js";
|
|
26
|
+
import "./chunk-TSAUBRRU.js";
|
|
27
27
|
import {
|
|
28
28
|
formatProviderError,
|
|
29
29
|
normalizeProviderError
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PVPJAGWR.js";
|
|
31
31
|
import {
|
|
32
32
|
headersToRecord
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-6IHXVT5H.js";
|
|
34
|
+
import "./chunk-JBEWFFOK.js";
|
|
35
|
+
import "./chunk-BG2KGLIA.js";
|
|
36
36
|
import {
|
|
37
37
|
clampThinkingLevel,
|
|
38
38
|
getDeclaredTools,
|
|
@@ -40,22 +40,22 @@ import {
|
|
|
40
40
|
normalizeContext,
|
|
41
41
|
resolveTranscript,
|
|
42
42
|
resolveTranscriptTools
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-W7LEYYFH.js";
|
|
44
44
|
import {
|
|
45
45
|
AssistantMessageEventStream,
|
|
46
46
|
appendAssistantMessageDiagnostic,
|
|
47
47
|
createAssistantMessageDiagnostic,
|
|
48
48
|
formatThrownValue
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-DDBE2VLT.js";
|
|
50
50
|
import {
|
|
51
51
|
getIdentityHeaders
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-Q3C7TQ2M.js";
|
|
53
53
|
import {
|
|
54
54
|
getSystemMessageText
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-U5KGV63C.js";
|
|
56
56
|
import "./chunk-CWESUMYQ.js";
|
|
57
57
|
|
|
58
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
58
|
+
// 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/uuid.js
|
|
59
59
|
var MAX_UUID_V7_TIMESTAMP = 281474976710655;
|
|
60
60
|
var MAX_SEQUENCE = (1n << 41n) - 1n;
|
|
61
61
|
var lastOrdinaryTimestamp = -1;
|
|
@@ -91,7 +91,7 @@ function uuidv7(timestampMs) {
|
|
|
91
91
|
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
// node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
94
|
+
// 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-codex-responses.js
|
|
95
95
|
var DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
96
96
|
var JWT_CLAIM_PATH = "https://api.openai.com/auth";
|
|
97
97
|
var DEFAULT_MAX_RETRIES = 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.5.
|
|
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/abort-signals.js
|
|
5
5
|
function combineAbortSignals(signals) {
|
|
6
6
|
const activeSignals = signals.filter((signal) => signal !== void 0);
|
|
7
7
|
if (activeSignals.length === 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.5.
|
|
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/session-resources.js
|
|
5
5
|
var sessionResourceCleanups = /* @__PURE__ */ new Set();
|
|
6
6
|
function registerSessionResourceCleanup(cleanup) {
|
|
7
7
|
sessionResourceCleanups.add(cleanup);
|
package/dist/daemon.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
writeCrashReportSync,
|
|
68
68
|
writeDevicesFile,
|
|
69
69
|
writeNodeDiagnosticReport
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-OO2KD2L2.js";
|
|
71
71
|
import {
|
|
72
72
|
firstEnvValue,
|
|
73
73
|
isLoopbackHost,
|
|
@@ -77,12 +77,13 @@ import {
|
|
|
77
77
|
mergeNoProxy,
|
|
78
78
|
mergeNoProxySources
|
|
79
79
|
} from "./chunk-QF5GNBAB.js";
|
|
80
|
+
import "./chunk-BUD4JHBZ.js";
|
|
80
81
|
import "./chunk-RLN3MFAK.js";
|
|
81
82
|
import {
|
|
82
83
|
discardFailedItems,
|
|
83
84
|
readMigrationFailureReport,
|
|
84
85
|
rollbackFailedMigration
|
|
85
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-BN5YDZUZ.js";
|
|
86
87
|
import {
|
|
87
88
|
MIGRATION_ROLLED_BACK,
|
|
88
89
|
MissingAssetError,
|
|
@@ -101,22 +102,22 @@ import {
|
|
|
101
102
|
storagePaths,
|
|
102
103
|
transferConversationEvent,
|
|
103
104
|
transferredConversationEventSchema
|
|
104
|
-
} from "./chunk-
|
|
105
|
-
import "./chunk-
|
|
106
|
-
import "./chunk-
|
|
107
|
-
import "./chunk-
|
|
108
|
-
import "./chunk-
|
|
109
|
-
import "./chunk-
|
|
105
|
+
} from "./chunk-FZ557YWE.js";
|
|
106
|
+
import "./chunk-62DQXVPO.js";
|
|
107
|
+
import "./chunk-RJR7DJJK.js";
|
|
108
|
+
import "./chunk-RL52LSTV.js";
|
|
109
|
+
import "./chunk-ZVH6EB7S.js";
|
|
110
|
+
import "./chunk-FCAIYPDJ.js";
|
|
110
111
|
import {
|
|
111
112
|
configureManagedProcessRuntime,
|
|
112
113
|
initializeManagedProcessHost
|
|
113
|
-
} from "./chunk-
|
|
114
|
-
import "./chunk-
|
|
115
|
-
import "./chunk-
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
-
import "./chunk-
|
|
119
|
-
import "./chunk-
|
|
114
|
+
} from "./chunk-APY4TUR3.js";
|
|
115
|
+
import "./chunk-JBEWFFOK.js";
|
|
116
|
+
import "./chunk-BG2KGLIA.js";
|
|
117
|
+
import "./chunk-W7LEYYFH.js";
|
|
118
|
+
import "./chunk-DDBE2VLT.js";
|
|
119
|
+
import "./chunk-Q3C7TQ2M.js";
|
|
120
|
+
import "./chunk-U5KGV63C.js";
|
|
120
121
|
import {
|
|
121
122
|
__toESM
|
|
122
123
|
} from "./chunk-CWESUMYQ.js";
|
|
@@ -127,10 +128,10 @@ import { createServer as createHttpsServer } from "node:https";
|
|
|
127
128
|
import { networkInterfaces } from "node:os";
|
|
128
129
|
import { dirname, join as join2 } from "node:path";
|
|
129
130
|
|
|
130
|
-
// node_modules/.pnpm/@hono+node-server@2.1.
|
|
131
|
+
// node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
|
|
131
132
|
var X_ALREADY_SENT = "x-hono-already-sent";
|
|
132
133
|
|
|
133
|
-
// node_modules/.pnpm/@hono+node-server@2.1.
|
|
134
|
+
// node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
|
|
134
135
|
import { STATUS_CODES, ServerResponse, createServer } from "node:http";
|
|
135
136
|
import { Http2ServerRequest, constants } from "node:http2";
|
|
136
137
|
import { Readable } from "node:stream";
|
|
@@ -156,7 +157,7 @@ var defineWebSocketHelper = (handler) => {
|
|
|
156
157
|
});
|
|
157
158
|
};
|
|
158
159
|
|
|
159
|
-
// node_modules/.pnpm/@hono+node-server@2.1.
|
|
160
|
+
// node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
|
|
160
161
|
var RequestError = class extends Error {
|
|
161
162
|
constructor(message, options) {
|
|
162
163
|
super(message, options);
|
|
@@ -314,16 +315,27 @@ var newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders
|
|
|
314
315
|
var reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
|
|
315
316
|
var reDotSegment = /\/\.\.?(?:[/?#]|$)/;
|
|
316
317
|
var reValidHost = /^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/;
|
|
318
|
+
var validateRequestTarget = (target) => {
|
|
319
|
+
const backslash = target.indexOf("\\");
|
|
320
|
+
if (backslash !== -1) {
|
|
321
|
+
const query = target.indexOf("?");
|
|
322
|
+
if (query === -1 || backslash < query) throw new RequestError("Backslash in request path");
|
|
323
|
+
}
|
|
324
|
+
};
|
|
317
325
|
var buildUrl = (scheme, host, incomingUrl) => {
|
|
318
326
|
const url = `${scheme}://${host}${incomingUrl}`;
|
|
319
327
|
if (!reValidHost.test(host)) {
|
|
328
|
+
validateRequestTarget(incomingUrl);
|
|
320
329
|
const urlObj = new URL(url);
|
|
321
330
|
if (urlObj.hostname.length !== host.length && urlObj.hostname !== (host.includes(":") ? host.replace(/:\d+$/, "") : host).toLowerCase()) throw new RequestError("Invalid host header");
|
|
322
331
|
return urlObj.href;
|
|
323
332
|
} else if (incomingUrl.length === 0) return url + "/";
|
|
324
333
|
else {
|
|
325
334
|
if (incomingUrl.charCodeAt(0) !== 47) throw new RequestError("Invalid URL");
|
|
326
|
-
if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl))
|
|
335
|
+
if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) {
|
|
336
|
+
validateRequestTarget(incomingUrl);
|
|
337
|
+
return new URL(url).href;
|
|
338
|
+
}
|
|
327
339
|
return url;
|
|
328
340
|
}
|
|
329
341
|
};
|
|
@@ -679,6 +691,7 @@ Object.defineProperty(requestPrototype, "signal", { get() {
|
|
|
679
691
|
"cache",
|
|
680
692
|
"credentials",
|
|
681
693
|
"destination",
|
|
694
|
+
"duplex",
|
|
682
695
|
"integrity",
|
|
683
696
|
"mode",
|
|
684
697
|
"redirect",
|
|
@@ -736,6 +749,7 @@ var newRequest = (incoming, defaultHostname) => {
|
|
|
736
749
|
if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
|
|
737
750
|
if (incoming instanceof Http2ServerRequest) throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
|
|
738
751
|
try {
|
|
752
|
+
validateRequestTarget(incomingUrl);
|
|
739
753
|
req[urlKey] = new URL(incomingUrl).href;
|
|
740
754
|
} catch (e) {
|
|
741
755
|
throw new RequestError("Invalid absolute URL", { cause: e });
|
|
@@ -899,6 +913,11 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
|
|
|
899
913
|
reader.cancel(error).catch(() => {
|
|
900
914
|
});
|
|
901
915
|
};
|
|
916
|
+
const stream = writable.stream;
|
|
917
|
+
if (writable.destroyed || stream?.closed || stream?.destroyed) {
|
|
918
|
+
cancel();
|
|
919
|
+
return reader.closed;
|
|
920
|
+
}
|
|
902
921
|
writable.on("close", cancel);
|
|
903
922
|
writable.on("error", cancel);
|
|
904
923
|
(currentReadPromise ?? reader.read()).then(flow, handleStreamError);
|
|
@@ -916,7 +935,7 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
|
|
|
916
935
|
try {
|
|
917
936
|
if (done) writable.end();
|
|
918
937
|
else if (!writable.write(value)) writable.once("drain", onDrain);
|
|
919
|
-
else
|
|
938
|
+
else reader.read().then(flow, handleStreamError);
|
|
920
939
|
} catch (e) {
|
|
921
940
|
handleStreamError(e);
|
|
922
941
|
}
|
|
@@ -924,7 +943,11 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
|
|
|
924
943
|
}
|
|
925
944
|
function writeFromReadableStream(stream, writable) {
|
|
926
945
|
if (stream.locked) throw new TypeError("ReadableStream is locked.");
|
|
927
|
-
else if (writable.destroyed)
|
|
946
|
+
else if (writable.destroyed) {
|
|
947
|
+
stream.cancel().catch(() => {
|
|
948
|
+
});
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
928
951
|
return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
|
|
929
952
|
}
|
|
930
953
|
var buildOutgoingHttpHeaders = (headers, defaultContentType2) => {
|
|
@@ -1116,10 +1139,7 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
1116
1139
|
let maxReadCount = 2;
|
|
1117
1140
|
for (let i = 0; i < maxReadCount; i++) {
|
|
1118
1141
|
currentReadPromise ||= reader.read();
|
|
1119
|
-
const chunk = await readWithoutBlocking(currentReadPromise)
|
|
1120
|
-
console.error(e);
|
|
1121
|
-
done = true;
|
|
1122
|
-
});
|
|
1142
|
+
const chunk = await readWithoutBlocking(currentReadPromise);
|
|
1123
1143
|
if (!chunk) {
|
|
1124
1144
|
if (i === 1) {
|
|
1125
1145
|
await new Promise((resolve) => setTimeout(resolve));
|
|
@@ -1272,6 +1292,7 @@ var appendResponseHeaders = (headers, responseHeaders) => {
|
|
|
1272
1292
|
});
|
|
1273
1293
|
};
|
|
1274
1294
|
var rejectUpgradeRequest = (socket, status, responseHeaders) => {
|
|
1295
|
+
if (socket.destroyed) return;
|
|
1275
1296
|
const responseLines = ["Connection: close", "Content-Length: 0"];
|
|
1276
1297
|
appendResponseHeaders(responseLines, responseHeaders);
|
|
1277
1298
|
socket.end(`HTTP/1.1 ${status.toString()} ${STATUS_CODES[status] ?? ""}\r
|
|
@@ -1281,7 +1302,12 @@ ${responseLines.join("\r\n")}\r
|
|
|
1281
1302
|
};
|
|
1282
1303
|
var createUpgradeRequest = (request) => {
|
|
1283
1304
|
const protocol = request.socket.encrypted ? "https" : "http";
|
|
1284
|
-
const
|
|
1305
|
+
const incomingUrl = request.url ?? "/";
|
|
1306
|
+
let url;
|
|
1307
|
+
if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
|
|
1308
|
+
validateRequestTarget(incomingUrl);
|
|
1309
|
+
url = new URL(incomingUrl).href;
|
|
1310
|
+
} else url = buildUrl(protocol, request.headers.host ?? "localhost", incomingUrl);
|
|
1285
1311
|
const headers = new Headers();
|
|
1286
1312
|
for (const key in request.headers) {
|
|
1287
1313
|
const value = request.headers[key];
|
|
@@ -1318,6 +1344,11 @@ var setupWebSocket = (options) => {
|
|
|
1318
1344
|
};
|
|
1319
1345
|
server.on("upgrade", async (request, socket, head) => {
|
|
1320
1346
|
if (request.headers.upgrade?.toLowerCase() !== "websocket") return;
|
|
1347
|
+
const ignoreSocketError = () => {
|
|
1348
|
+
};
|
|
1349
|
+
const reclaimWaiterOnClose = () => rejectWaiter(request);
|
|
1350
|
+
socket.on("error", ignoreSocketError);
|
|
1351
|
+
socket.once("close", reclaimWaiterOnClose);
|
|
1321
1352
|
const env = {
|
|
1322
1353
|
incoming: request,
|
|
1323
1354
|
outgoing: void 0,
|
|
@@ -1332,8 +1363,12 @@ var setupWebSocket = (options) => {
|
|
|
1332
1363
|
status = response.status;
|
|
1333
1364
|
responseHeaders = response.headers;
|
|
1334
1365
|
}
|
|
1335
|
-
} catch {
|
|
1336
|
-
if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, 500);
|
|
1366
|
+
} catch (error) {
|
|
1367
|
+
if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, error instanceof RequestError ? 400 : 500);
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
if (socket.destroyed) {
|
|
1371
|
+
rejectWaiter(request);
|
|
1337
1372
|
return;
|
|
1338
1373
|
}
|
|
1339
1374
|
const waiter = waiterMap.get(request);
|
|
@@ -1345,12 +1380,11 @@ var setupWebSocket = (options) => {
|
|
|
1345
1380
|
const addResponseHeaders = (headers) => {
|
|
1346
1381
|
appendResponseHeaders(headers, responseHeaders);
|
|
1347
1382
|
};
|
|
1348
|
-
const reclaimWaiterOnClose = () => rejectWaiter(request);
|
|
1349
|
-
socket.once("close", reclaimWaiterOnClose);
|
|
1350
1383
|
wss.on("headers", addResponseHeaders);
|
|
1351
1384
|
try {
|
|
1352
1385
|
wss.handleUpgrade(request, socket, head, (ws) => {
|
|
1353
1386
|
socket.off("close", reclaimWaiterOnClose);
|
|
1387
|
+
socket.off("error", ignoreSocketError);
|
|
1354
1388
|
wss.emit("connection", ws, request);
|
|
1355
1389
|
});
|
|
1356
1390
|
} finally {
|
|
@@ -3576,7 +3610,7 @@ function createConversationProtocolSession(ws, state, onDispose) {
|
|
|
3576
3610
|
agentBrowserSkills: platform.agentBrowserSkills.skills
|
|
3577
3611
|
});
|
|
3578
3612
|
},
|
|
3579
|
-
"tool.list": () => ({ tools: allToolDescriptors }),
|
|
3613
|
+
"tool.list": () => ({ tools: allToolDescriptors() }),
|
|
3580
3614
|
"completion.slash.list": () => ({ items: slashCommandCompletionItems })
|
|
3581
3615
|
};
|
|
3582
3616
|
const session = new ProtocolServerSession({
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Confluence requests for what has no method
|
|
2
|
+
|
|
3
|
+
`confluence.request(method, path, body?, query?)`: the path is the full REST path (`/wiki/api/v2/…` or `/wiki/rest/api/…`); `query` is `{ name: value | value[] }`, the 4th argument. Bodies: `{ representation: "storage", value: storageXhtml }`.
|
|
4
|
+
|
|
5
|
+
Typed methods cover pages, comments (footer and inline), labels and attachments; use raw only for the rest:
|
|
6
|
+
|
|
7
|
+
| Task | Request |
|
|
8
|
+
| -------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| Page restrictions | `GET /wiki/rest/api/content/{id}/restriction/byOperation` |
|
|
10
|
+
| Rename an attachment | `PUT /wiki/rest/api/content/{attachmentId}` `{ id, type: "attachment", title: newName, version: { number: n + 1 } }` |
|
|
11
|
+
| Page versions | `GET /wiki/api/v2/pages/{id}/versions` |
|
|
12
|
+
|
|
13
|
+
## Restrictions recipe
|
|
14
|
+
|
|
15
|
+
Operations are `read` and `update`; users are addressed by `accountId` (find it with `atlassian.users.search` or from a comment `author`).
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const id = "123";
|
|
19
|
+
const base = `/wiki/rest/api/content/${id}/restriction/byOperation`;
|
|
20
|
+
const current = await confluence.request("GET", base); // who is restricted now
|
|
21
|
+
await confluence.request("PUT", `${base}/update/user`, undefined, {
|
|
22
|
+
accountId: "…",
|
|
23
|
+
}); // add a user
|
|
24
|
+
await confluence.request("DELETE", `${base}/update/user`, undefined, {
|
|
25
|
+
accountId: "…",
|
|
26
|
+
}); // remove a user
|
|
27
|
+
await confluence.request("PUT", `${base}/read/byGroupId/${groupId}`); // add a group
|
|
28
|
+
await confluence.request("DELETE", `${base}/update`); // clear_operation: lift every `update` restriction
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
A restricted operation with no subjects left is unrestricted again.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Writing Confluence pages people can read
|
|
2
|
+
|
|
3
|
+
A page body is RichText (`sdk.docs("storage/builders")`): Markdown for prose, `storage.*` builders for structure, arrays to combine. Write with `confluence.pages.create/update`. Every write is linted.
|
|
4
|
+
|
|
5
|
+
## Editing an existing page
|
|
6
|
+
|
|
7
|
+
`const page = await confluence.pages.get({ id, body: "storage" })` (the default Markdown body is a read-only view), then pass `version: page.version` to `pages.update`.
|
|
8
|
+
|
|
9
|
+
| Change | How |
|
|
10
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| Append / prepend | `body: [page.body, "## New\n\ntext"]` |
|
|
12
|
+
| Rewrite one section | `body: storage.replaceSection(page.body, "Risks", "- new risk")` |
|
|
13
|
+
| Larger or surgical edits | `const d = await confluence.pages.download({ id })`, edit `d.file` with the Edit tool or `files.edit`, then `pages.update({ id, version: d.version, bodyFile: d.file })` |
|
|
14
|
+
|
|
15
|
+
`body` and `bodyFile` are exclusive. Rewrites that drop macros, layouts, images or mentions throw unless `allowRemoving: true`; add-on macros (drawio, gliffy, ...) survive only if their storage stays in the body. Never rebuild a page from the Markdown view; use an array, not `page.body + "..."`.
|
|
16
|
+
|
|
17
|
+
## Plan first
|
|
18
|
+
|
|
19
|
+
Outline first: one-line purpose, 3-7 sections, what goes in tables, Jira macros, diagrams. Gather data (and count empty lists) before assembling the parts array.
|
|
20
|
+
|
|
21
|
+
## Structure
|
|
22
|
+
|
|
23
|
+
- The page title is a separate field. Sections start at `#` (H1), subsections at `##`/`###`; never skip a level and do not repeat the title as a first heading.
|
|
24
|
+
- Open with a 2-4 line overview (or one `info` panel) on what the page is and its status, without an "Overview" heading.
|
|
25
|
+
- Only long pages (about 600+ words or 6+ sections) get `storage.toc()` right after the overview; short pages get none.
|
|
26
|
+
- Short paragraphs (1-3 sentences). Put raw output, reference material and long tails in `storage.expand`; code in `storage.code` with a language.
|
|
27
|
+
- Pluralise in code ("1 issue", "3 issues"), never "issue(s)". Keep inline items (dates, lozenges, links) in one `storage.p([...])` array: `storage.p(["Due ", storage.date(d), " ", storage.status("Open")])`.
|
|
28
|
+
|
|
29
|
+
## Tables
|
|
30
|
+
|
|
31
|
+
Use a table (Markdown for plain text cells, `storage.table` for lozenges, links, widths or merged cells) for lists with several attributes. Narrow columns for key, type, status and date, wide for text. Set `columns: [{ key, title, width }]` yourself (px; content width 760, `layout: "wide"` 960) or let the linter compute them; a `SCRUM-123` key needs about 100 px. Show statuses with `storage.status`.
|
|
32
|
+
|
|
33
|
+
## Panels
|
|
34
|
+
|
|
35
|
+
| Type | Colour | Use for |
|
|
36
|
+
| ----------------------- | ------ | ----------------------------------- |
|
|
37
|
+
| `info` | blue | context, the page overview |
|
|
38
|
+
| `success` (alias `tip`) | green | good news: done, on track |
|
|
39
|
+
| `warning` | yellow | risks, things to watch |
|
|
40
|
+
| `error` | red | blocking problems and failures only |
|
|
41
|
+
| `note` | purple | side remarks, definitions |
|
|
42
|
+
|
|
43
|
+
No neutral information in `warning`/`error`; none directly under a same-titled heading, stacked, or holding long content. An overview panel plus a few others is plenty.
|
|
44
|
+
|
|
45
|
+
## Jira content
|
|
46
|
+
|
|
47
|
+
For a list of issues use one `storage.jiraIssues(jql, { columns })` macro (`["key","summary","status","assignee"]`) instead of a `storage.jiraIssue` per row or a heading per issue. Use `storage.jiraIssue(key)` inline for a single reference. A macro whose JQL matches nothing renders a bare header row: count first (reuse search results) and write a sentence ("No open blockers.") for sections that may be empty.
|
|
48
|
+
|
|
49
|
+
## Images and diagrams
|
|
50
|
+
|
|
51
|
+
Attach PNG or JPEG files via `attachments` (GIF/WebP are converted to PNG, SVG is rejected), then reference them with `storage.image(filename)`; the linter sets the width from the real size, capped at 760 px, so aim for about 760 px natural width. Add `alt`/`caption` when the image carries information. An image scaled below 80% (a 1100 px diagram shown at 760) gets a warning because its text turns small: shrink or simplify the source instead (diagrams: `sdk.docs("diagram/render")`). Use `storage.layout` sparingly (two columns, never nested).
|
|
52
|
+
|
|
53
|
+
## The linter
|
|
54
|
+
|
|
55
|
+
`pages.create/update` return `fixes` (applied) and `warnings` (not applied); the result footer prints both. Fix the cause of warnings with `pages.update`.
|
|
56
|
+
|
|
57
|
+
- **Rejected before any request:** malformed XML, with line and element (`Closing tag </div> at line 2 does not match <p>`). Plain strings are Markdown or literal text; use `storage.escape` only inside `storage.raw`.
|
|
58
|
+
- **Fixed automatically:** headings promoted so the top level is H1; a leading H1 equal to the title removed; a TOC for long pages (`toc: false` opts out); computed column widths and image widths; loose inline content under a panel, expand, layout cell or the page root wrapped in `<p>`; Jira list macros given `data-layout="default"` (760 px).
|
|
59
|
+
- **Warnings:** an explicit column width too narrow for its longest word (`Column "Key" is 90px; "SCRUM-4" needs about 100px`: widen it or drop the width); images scaled below 80%; skipped heading levels; SVG/WebP images; images of unknown size; a panel repeating the heading above it; a heading that only repeats an embedded issue key; empty sections; a body referencing an attachment that is neither passed in `attachments` nor already on the page (existing attachments keep their real size).
|
|
60
|
+
|
|
61
|
+
## Worked example
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const issues = await jira.issues.search({
|
|
65
|
+
jql: 'project = APP AND fixVersion = "2.1" ORDER BY status',
|
|
66
|
+
fields: ["summary", "status", "assignee"],
|
|
67
|
+
});
|
|
68
|
+
const open = issues.filter((i) => i.statusCategory !== "Done");
|
|
69
|
+
const flow = await diagram.render({
|
|
70
|
+
type: "mermaid",
|
|
71
|
+
source: "flowchart TB\n A[Freeze] --> B[QA] --> C[Release]",
|
|
72
|
+
name: "release-flow.png",
|
|
73
|
+
});
|
|
74
|
+
const body = [
|
|
75
|
+
storage.panel(
|
|
76
|
+
"info",
|
|
77
|
+
`${issues.length} issues in 2.1; ${open.length} still open.`,
|
|
78
|
+
),
|
|
79
|
+
storage.toc(),
|
|
80
|
+
"# Release flow",
|
|
81
|
+
storage.image("release-flow.png", { alt: "Release flow" }),
|
|
82
|
+
"# Open work",
|
|
83
|
+
open.length
|
|
84
|
+
? storage.jiraIssues(
|
|
85
|
+
'project = APP AND fixVersion = "2.1" AND statusCategory != Done',
|
|
86
|
+
{
|
|
87
|
+
columns: ["type", "key", "summary", "status", "assignee"],
|
|
88
|
+
},
|
|
89
|
+
)
|
|
90
|
+
: "Nothing is open.",
|
|
91
|
+
"# Risks",
|
|
92
|
+
storage.panel("warning", "QA environment is shared until Friday."),
|
|
93
|
+
];
|
|
94
|
+
const page = await confluence.pages.create({
|
|
95
|
+
space: "ENG",
|
|
96
|
+
title: "Release 2.1 status",
|
|
97
|
+
body,
|
|
98
|
+
attachments: [flow],
|
|
99
|
+
});
|
|
100
|
+
return { url: page.url, warnings: page.warnings };
|
|
101
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Jira requests for what has no method
|
|
2
|
+
|
|
3
|
+
`jira.request(method, path, body?, query?)`: the path is the full REST path (`/rest/api/3/…` or `/rest/agile/1.0/…`); `query` is `{ name: value | value[] }`, the 4th argument, not part of the path (GET: `jira.request("GET", "/rest/api/3/issue/APP-1/changelog", undefined, { maxResults: 20 })`). Rich-text bodies are ADF: build them with `await jira.adf.fromMarkdown(md)`.
|
|
4
|
+
|
|
5
|
+
Typed methods cover issues, comments, worklogs, links, attachments, sprints and ranking; use raw requests only for the rest:
|
|
6
|
+
|
|
7
|
+
| Task | Request |
|
|
8
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| Changelog | `GET /rest/api/3/issue/{key}/changelog` |
|
|
10
|
+
| Editable fields of an issue | `GET /rest/api/3/issue/{key}/editmeta` |
|
|
11
|
+
| Remote links | `GET` / `POST` `/rest/api/3/issue/{key}/remotelink`, `DELETE …/remotelink/{linkId}` |
|
|
12
|
+
| Priorities / resolutions / link types | `GET /rest/api/3/priority`, `/rest/api/3/resolution`, `/rest/api/3/issueLinkType` |
|
|
13
|
+
| Find boards | `GET /rest/agile/1.0/board` with query `{ name, projectKeyOrId, type: "scrum" \| "kanban", startAt, maxResults }`; boards of one project: `projects.get({ include: ["boards"] })` |
|
|
14
|
+
| Board by id / its configuration | `GET /rest/agile/1.0/board/{boardId}`; `GET …/board/{boardId}/configuration` (columns, status mapping, estimation field, filter) |
|
|
15
|
+
| Board backlog | `GET /rest/agile/1.0/board/{boardId}/backlog` |
|
|
16
|
+
| Comment visibility | `PUT /rest/api/3/issue/{key}/comment/{id}` `{ body: adf, visibility: { type: "role", value: "Administrators" } }` |
|