@qwen-code/qwen-code 0.23.1-preview.2 → 0.23.2-nightly.20260909.2e212144d3
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 +35 -15
- package/bundled/computer-use/SKILL.md +189 -116
- package/bundled/goal-draft/SKILL.md +23 -13
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/auth.md +1 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +66 -16
- package/bundled/qc-helper/docs/configuration/settings.md +50 -0
- package/bundled/qc-helper/docs/conversations-recovery.md +102 -0
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
- package/bundled/qc-helper/docs/features/channels/github.md +1 -9
- package/bundled/qc-helper/docs/features/channels/overview.md +27 -52
- package/bundled/qc-helper/docs/features/channels/qqbot.md +1 -2
- package/bundled/qc-helper/docs/features/commands.md +79 -17
- package/bundled/qc-helper/docs/features/computer-use.md +9 -7
- package/bundled/qc-helper/docs/features/cross-session-protocol.md +291 -0
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/goals.md +17 -3
- package/bundled/qc-helper/docs/features/sub-agents.md +8 -0
- package/bundled/qc-helper/docs/qwen-serve.md +80 -48
- package/chunks/{MaxSizedBox-IYIQ43IZ.js → MaxSizedBox-ZBGWYJZW.js} +29 -28
- package/chunks/{StandaloneSessionPicker-AWB2OHX6.js → StandaloneSessionPicker-NR5ACIJZ.js} +48 -47
- package/chunks/{acp-startup-profiler-BAL4LJTN.js → acp-startup-profiler-KEU6VAYR.js} +2 -2
- package/chunks/{acpAgent-ZC57OLS4.js → acpAgent-DM6XRCDQ.js} +361 -210
- package/chunks/{agent-GEBPAEJS.js → agent-EF3IIYE3.js} +20 -20
- package/chunks/{agent-headless-63ZEYAJK.js → agent-headless-5J2KFYR4.js} +20 -20
- package/chunks/{anthropicContentGenerator-6XDHXIII.js → anthropicContentGenerator-VIW2FG7G.js} +32 -9
- package/chunks/{artifact-tool-P52OKKEF.js → artifact-tool-G5LHNECG.js} +1 -1
- package/chunks/{askUserQuestion-3KAYLLMM.js → askUserQuestion-R3TXY77M.js} +1 -1
- package/chunks/{bridge-MHWO5I5T.js → bridge-LEMQM6QE.js} +32 -31
- package/chunks/{channel-management-service-NFRZXQFO.js → channel-management-service-TGF6XFXT.js} +4 -4
- package/chunks/{channel-settings-store-T7PMIHKC.js → channel-settings-store-FV365JSF.js} +40 -39
- package/chunks/{channel-worker-group-O2BWK5F7.js → channel-worker-group-SQ5FRWOH.js} +7 -7
- package/chunks/{channel-worker-manager-4WP7VJOD.js → channel-worker-manager-TU4ZNWOE.js} +7 -7
- package/chunks/{channel-worker-supervisor-CCUXD6J5.js → channel-worker-supervisor-EMITFMCP.js} +4 -4
- package/chunks/{chunk-3SH53ANB.js → chunk-22GORRNY.js} +12 -0
- package/chunks/{chunk-OFB36ZBA.js → chunk-2HYOOFDS.js} +10 -7
- package/chunks/chunk-2Z3T52OC.js +82 -0
- package/chunks/{chunk-LYHYXJJ3.js → chunk-34VPADLG.js} +3 -3
- package/chunks/{chunk-C7M445SS.js → chunk-3A2IMUDH.js} +14 -2
- package/chunks/{chunk-P5Z7VD23.js → chunk-3O77M472.js} +294 -87
- package/chunks/{chunk-4OCYWXKF.js → chunk-43EUMPKQ.js} +3 -3
- package/chunks/{chunk-W4LL5RZO.js → chunk-4ALNJDHL.js} +52 -13
- package/chunks/{chunk-VMFPZXRT.js → chunk-4DIMJKWU.js} +64 -43
- package/chunks/{chunk-ZRVFHLLK.js → chunk-5DQ4YTIZ.js} +1 -1
- package/chunks/{chunk-VYCJITND.js → chunk-5HV2HPO7.js} +1 -1
- package/chunks/{chunk-22QOQKG4.js → chunk-5WBA3DEF.js} +1 -1
- package/chunks/{chunk-3K65MUKD.js → chunk-65I7S4Z3.js} +2 -1
- package/chunks/{chunk-I7UNCY24.js → chunk-6GAYNM3F.js} +3 -3
- package/chunks/{chunk-2C3XDBGL.js → chunk-6S7YYUUH.js} +4 -4
- package/chunks/{chunk-Y3C5COGI.js → chunk-6VIATHL7.js} +1 -1
- package/chunks/{chunk-XNC2TCUO.js → chunk-76I36BEM.js} +4 -4
- package/chunks/{chunk-B54PFQS5.js → chunk-7CLLH5TI.js} +1 -1
- package/chunks/{chunk-RGAQDQ3Z.js → chunk-7IDZFJAV.js} +18 -9
- package/chunks/{chunk-5Z4FCEPY.js → chunk-7K4GGN3D.js} +606 -109
- package/chunks/{chunk-WLZRMF3C.js → chunk-7KZVXJ4U.js} +353 -11
- package/chunks/{chunk-REDVV5NC.js → chunk-7WCJEY3A.js} +7 -7
- package/chunks/{chunk-I67KJGM6.js → chunk-A7QZIGRB.js} +3 -3
- package/chunks/{chunk-SHX2HIE7.js → chunk-ATBLEXXV.js} +7 -2
- package/chunks/{chunk-RH344FKI.js → chunk-AUTUFD5X.js} +1 -1
- package/chunks/chunk-AXMWHKXA.js +42 -0
- package/chunks/{chunk-WFXD5OZH.js → chunk-AXWTG6R7.js} +2 -5
- package/chunks/{chunk-TSLRORQR.js → chunk-BDAVT6K2.js} +1809 -1588
- package/chunks/{chunk-HWZOOSEB.js → chunk-BDP3NTWD.js} +3 -3
- package/chunks/{chunk-RD3VPM4E.js → chunk-BZUHZCUO.js} +2 -2
- package/chunks/{chunk-HPE4LEWX.js → chunk-C24ZDDNY.js} +1 -1
- package/chunks/{chunk-R7TKFIQO.js → chunk-CALNF3Z3.js} +1 -1
- package/chunks/{chunk-RPFJJ33Z.js → chunk-CALTQWTZ.js} +1 -1
- package/chunks/{chunk-BF3RUIVP.js → chunk-CH2YDT6X.js} +36 -38
- package/chunks/{chunk-LD53HMPV.js → chunk-CRZBDVP2.js} +1 -0
- package/chunks/{chunk-GEV66YGE.js → chunk-D6AGS266.js} +1 -1
- package/chunks/{chunk-EPZWBYQI.js → chunk-D7DFZAK2.js} +19 -11
- package/chunks/{chunk-5V4B3EWA.js → chunk-DARWOZY6.js} +1 -1
- package/chunks/{chunk-XX4MBBFW.js → chunk-DGNRLJ6S.js} +4 -4
- package/chunks/{chunk-UTVIIA7N.js → chunk-DVOCOIS5.js} +1 -1
- package/chunks/{chunk-RQNAO42A.js → chunk-E4LXNQAK.js} +1 -1
- package/chunks/{chunk-EGRFCIXD.js → chunk-EATP5QCN.js} +84 -25
- package/chunks/{chunk-3RMVM33U.js → chunk-EDSU3VUG.js} +12 -5
- package/chunks/{chunk-733KQL63.js → chunk-EE5ZD4XU.js} +3 -3
- package/chunks/{chunk-QQGAR64U.js → chunk-EN3Q2S3J.js} +4 -4
- package/chunks/{chunk-PLUAIHZO.js → chunk-EOLGAQ25.js} +17 -16
- package/chunks/{chunk-37SOBIA3.js → chunk-ERXNTINK.js} +1 -1
- package/chunks/{chunk-L36LLVA5.js → chunk-EYCW6UF2.js} +7 -7
- package/chunks/{chunk-ZELCTN6Y.js → chunk-F23YN37B.js} +10 -0
- package/chunks/{chunk-FPGTNKCP.js → chunk-F3M6P6IQ.js} +199 -1
- package/chunks/{chunk-B44JBZBB.js → chunk-F4SAL7WM.js} +91 -3
- package/chunks/{chunk-F47DITLZ.js → chunk-FAWTMDX7.js} +14 -0
- package/chunks/{chunk-SI6Q52UI.js → chunk-FEEVHJOR.js} +3 -3
- package/chunks/{chunk-75UQFGFE.js → chunk-FN4KHWCL.js} +1 -1
- package/chunks/{chunk-WQBR7LN5.js → chunk-FRS3P7MQ.js} +15 -2
- package/chunks/{chunk-5JLQWQK6.js → chunk-FV4DM2M4.js} +2 -2
- package/chunks/{chunk-Z6DDPSGJ.js → chunk-GNY7B3CA.js} +1 -1
- package/chunks/{chunk-FDOGGKAA.js → chunk-GSFV5RQW.js} +2 -0
- package/chunks/{chunk-XBVNNDPK.js → chunk-GSYD7MYP.js} +8 -3
- package/chunks/{chunk-ERMAXPXA.js → chunk-HIXUUCGY.js} +187 -12
- package/chunks/{chunk-EJNYBDYC.js → chunk-HNLMYDQE.js} +1 -1
- package/chunks/{chunk-3K456UJF.js → chunk-HSO6D4KX.js} +93 -28
- package/chunks/{chunk-ANVC5CSK.js → chunk-HUJJFSMO.js} +10 -10
- package/chunks/{chunk-C4NXRR7T.js → chunk-HW4MRP4V.js} +2 -2
- package/chunks/{chunk-PMGWY6ZP.js → chunk-HWLLUDIA.js} +113 -18
- package/chunks/{chunk-RCUWMVN3.js → chunk-HZ2HUXX7.js} +1 -1
- package/chunks/{chunk-7PMKXGRP.js → chunk-IKK6NNS6.js} +91 -31
- package/chunks/{chunk-IMWCUWQT.js → chunk-J3TJH52D.js} +1 -1
- package/chunks/{chunk-BNWIX6BM.js → chunk-JFAGT5YG.js} +3 -3
- package/chunks/{chunk-RSU3I6UL.js → chunk-JGTMTJSQ.js} +1 -1
- package/chunks/{chunk-LTCI6ZOJ.js → chunk-JYGIJA4W.js} +1 -1
- package/chunks/{chunk-537SQ2AI.js → chunk-KECCLCXM.js} +146 -24
- package/chunks/{chunk-KAZWXVI3.js → chunk-KEPC5BOL.js} +5 -5
- package/chunks/{chunk-HZS3JRQW.js → chunk-L5VHJYHH.js} +40 -2
- package/chunks/{chunk-KTLT7VCX.js → chunk-LKBOBUA2.js} +2 -2
- package/chunks/{chunk-TDHVOZ65.js → chunk-LOBKNYPR.js} +2 -2
- package/chunks/{chunk-QW7BUOSI.js → chunk-LOVGQ3HZ.js} +26 -9
- package/chunks/{chunk-5FYGZ7E3.js → chunk-MUF4UGPB.js} +2 -2
- package/chunks/chunk-N3Z6Q7KC.js +384 -0
- package/chunks/{chunk-JOV46WGX.js → chunk-NB3NDQQK.js} +1 -1
- package/chunks/chunk-NFXXBWSE.js +463 -0
- package/chunks/chunk-NOO4QFXM.js +171 -0
- package/chunks/{chunk-PQSCGZT2.js → chunk-NPKCVSXX.js} +26 -2
- package/chunks/{chunk-FXYNIZPW.js → chunk-NV4YYXFT.js} +51 -10
- package/chunks/{chunk-FWH4736Q.js → chunk-O6BFERWN.js} +3 -3
- package/chunks/{chunk-UKADFFL2.js → chunk-OFVAS4AR.js} +1 -1
- package/chunks/{chunk-C55CR5I4.js → chunk-OVTPETDL.js} +6 -6
- package/chunks/chunk-PLEBBGHL.js +1401 -0
- package/chunks/{chunk-Z6KFLEG7.js → chunk-PSPAM24S.js} +1 -0
- package/chunks/{chunk-RRCNEW2A.js → chunk-PWR6BQ3U.js} +58 -4
- package/chunks/{chunk-SHK2SIR5.js → chunk-QA2B26PL.js} +4 -4
- package/chunks/{chunk-NFIDVZND.js → chunk-QB3KS3N3.js} +2 -21
- package/chunks/{chunk-NUQFUXOG.js → chunk-QTNCGZHQ.js} +2 -0
- package/chunks/{chunk-QJVZLILI.js → chunk-R7OO56VZ.js} +1 -1
- package/chunks/{chunk-MFCWL4LI.js → chunk-SK6VACCM.js} +936 -481
- package/chunks/{chunk-SD7Y2PMC.js → chunk-SM66GFKJ.js} +2 -2
- package/chunks/{chunk-ADJD4LZF.js → chunk-SNMUO5Z7.js} +1 -1
- package/chunks/{chunk-NXWYCSPL.js → chunk-SOA4HKRJ.js} +1 -1
- package/chunks/{chunk-IRKQ4YYX.js → chunk-SVWWF5TZ.js} +29 -1
- package/chunks/{chunk-YLFICBYK.js → chunk-SYKPMH2X.js} +3 -3
- package/chunks/{chunk-5HBA2Z7V.js → chunk-TGNNLRC3.js} +2 -3
- package/chunks/{chunk-AX23QSX3.js → chunk-TRQNRP2H.js} +4 -4
- package/chunks/{chunk-AUJOWIT5.js → chunk-UQOP2APG.js} +4 -24
- package/chunks/{chunk-HY3DXYZK.js → chunk-UYDQYDW2.js} +1 -1
- package/chunks/{chunk-IGOIYZBG.js → chunk-VAWM3A5N.js} +2 -2
- package/chunks/{chunk-6KYWU726.js → chunk-VJJXG73H.js} +417 -292
- package/chunks/{chunk-ZNI3V2XA.js → chunk-VJWJOKOQ.js} +2 -2
- package/chunks/{chunk-AWDF462I.js → chunk-VR6Y23FW.js} +2 -2
- package/chunks/{chunk-T7TP5UQL.js → chunk-VX2NR3SD.js} +21 -6
- package/chunks/{chunk-65GHQ4FX.js → chunk-WDVV3LRM.js} +707 -216
- package/chunks/{chunk-KP5QK3FB.js → chunk-WEU6O6VN.js} +397 -54
- package/chunks/{chunk-OHOO527W.js → chunk-WG7BL3FY.js} +52 -2
- package/chunks/{chunk-VU7O7CGQ.js → chunk-XDNFODER.js} +1 -1
- package/chunks/{chunk-YHDGABDC.js → chunk-XKBFYTCD.js} +1 -1
- package/chunks/{chunk-RUMSY4ES.js → chunk-Y7YHAY32.js} +28 -10
- package/chunks/{chunk-7IKXTGZT.js → chunk-YI2YCNSP.js} +1 -1
- package/chunks/{chunk-B5FF3LRF.js → chunk-YIE6REQ5.js} +29 -17
- package/chunks/{chunk-E4VX6LXB.js → chunk-YZTGGCEE.js} +10 -2
- package/chunks/{chunk-TXAEXF2B.js → chunk-ZEFWBG2C.js} +737 -1136
- package/chunks/{chunk-AIMZIXZM.js → chunk-ZM2TCZZ7.js} +5 -7
- package/chunks/{chunk-ZT3XUGSU.js → chunk-ZZ7RVOTU.js} +135 -26
- package/chunks/{config-utils-F4CFJ4MW.js → config-utils-SXFK3G4X.js} +33 -32
- package/chunks/{contextCommand-OIIGGOMU.js → contextCommand-QFPD26QO.js} +31 -30
- package/chunks/{core-runtime-JEHLOGMB.js → core-runtime-VXKNBODM.js} +35 -33
- package/chunks/{create-sub-session-MVFBE5RA.js → create-sub-session-7WSQETFR.js} +30 -29
- package/chunks/{daemon-LCUELM6E.js → daemon-U2456K5H.js} +2 -2
- package/chunks/{daemon-git-worktree-guard-5FTKLJOU.js → daemon-git-worktree-guard-I4DCSDUS.js} +29 -28
- package/chunks/{daemon-status-provider-P6A5MPMW.js → daemon-status-provider-5UV56RI4.js} +36 -35
- package/chunks/{daemon-trust-policy-ZJ3NFYUO.js → daemon-trust-policy-DKIBWTKU.js} +36 -35
- package/chunks/{daemon-trust-policy-monitor-6SDLEW7S.js → daemon-trust-policy-monitor-CPSD7UKT.js} +36 -35
- package/chunks/{deferred-core-runtime-DWOXIU5S.js → deferred-core-runtime-D2RF35BL.js} +29 -28
- package/chunks/{discovery-TUM3ZQ6U.js → discovery-XP4RMDUM.js} +4 -2
- package/chunks/{dist-P6YWBITG.js → dist-6YDUH3BB.js} +817 -152
- package/chunks/{dist-T4PRA5EZ.js → dist-BNQVF565.js} +2 -8
- package/chunks/{dist-AI25RVRA.js → dist-F34J4FZX.js} +1 -1
- package/chunks/{dist-3H3WODVS.js → dist-F6JLAJLE.js} +1 -1
- package/chunks/{dist-NXW4DUUX.js → dist-K5GHMXIG.js} +2 -2
- package/chunks/{dist-YNQU4CKC.js → dist-NP7QKLVG.js} +2 -2
- package/chunks/{dist-VCAS67N5.js → dist-UFTFGI6I.js} +1 -1
- package/chunks/{dist-I74QLLQS.js → dist-XLV33CLY.js} +1 -2
- package/chunks/{dist-XINEKB5A.js → dist-ZDNJK74R.js} +3 -7
- package/chunks/{edit-WPVXLL3T.js → edit-4IBADZ3O.js} +20 -20
- package/chunks/{enter-worktree-5A6VW6BN.js → enter-worktree-YFTKHXHZ.js} +2 -2
- package/chunks/{enterPlanMode-JSODW7E2.js → enterPlanMode-YN3GPQU5.js} +20 -20
- package/chunks/{environment-5LLJ3I3W.js → environment-E272IJMF.js} +32 -31
- package/chunks/{errors-IQT3YZEP.js → errors-CVAH3RWQ.js} +31 -30
- package/chunks/{exit-worktree-QV7E7KP6.js → exit-worktree-NF2XEMES.js} +3 -3
- package/chunks/{exitPlanMode-DDVFYNW4.js → exitPlanMode-24J5IHGC.js} +20 -20
- package/chunks/{fast-path-PAUQQEVU.js → fast-path-M5IDBMXF.js} +4 -4
- package/chunks/{fast-path-settings-ISEJPRYE.js → fast-path-settings-SATXY3PD.js} +3 -3
- package/chunks/{glob-SQ7CTZ7F.js → glob-ERBD7JYP.js} +20 -20
- package/chunks/{goal-tools-UWZRCLQB.js → goal-tools-245ULLQT.js} +20 -20
- package/chunks/{handleAutoUpdate-RUPZZTSG.js → handleAutoUpdate-JDZHHZKK.js} +32 -31
- package/chunks/{i18n-SF5MPWEB.js → i18n-LA4D5IXM.js} +32 -29
- package/chunks/{image-gen-Q3RUTVKR.js → image-gen-XP4NNIYG.js} +4 -4
- package/chunks/{initializer-CK4WPYZG.js → initializer-SHPTSWUZ.js} +36 -35
- package/chunks/{installationInfo-IRPQEYRF.js → installationInfo-QEQEPB3G.js} +29 -28
- package/chunks/{list-E3PS3EBJ.js → list-IBHCQWTF.js} +39 -38
- package/chunks/{list-agents-I5TRH3J7.js → list-agents-EDPZCGKN.js} +5 -4
- package/chunks/{llm-JQKBOYAF.js → llm-JAWCQLA4.js} +81 -75
- package/chunks/{llm-content-generator-2QWGBW42.js → llm-content-generator-GOV3A23T.js} +23 -8
- package/chunks/{loadedSettingsAdapter-DGXGVYZS.js → loadedSettingsAdapter-RVE2GNVU.js} +36 -35
- package/chunks/{loggingContentGenerator-ZYURLJKK.js → loggingContentGenerator-SSHNN5YW.js} +22 -22
- package/chunks/{managed-npm-update-HTHR63EA.js → managed-npm-update-BHSTITQO.js} +29 -28
- package/chunks/{mcp-I7G2AEWS.js → mcp-6ZZ7P2HU.js} +36 -35
- package/chunks/{monitor-4R76BCRZ.js → monitor-RKK6GSHG.js} +20 -20
- package/chunks/{nonInteractiveCli-24OQ3VP2.js → nonInteractiveCli-UQHP3G6P.js} +76 -72
- package/chunks/{notebook-edit-PPSH7FEX.js → notebook-edit-YM47A7WO.js} +20 -20
- package/chunks/{open-with-auth-D6JD6LDS.js → open-with-auth-6MVIHMXB.js} +1 -1
- package/chunks/{openaiContentGenerator-K7V5EO7F.js → openaiContentGenerator-FHKDWNI2.js} +11 -11
- package/chunks/{pidfile-TGIUY2GG.js → pidfile-SIIEJEEH.js} +32 -29
- package/chunks/{processUtils-3USXUQWX.js → processUtils-JF7CWBJC.js} +2 -2
- package/chunks/{prompt-terminal-ledger-XHVZRXJI.js → prompt-terminal-ledger-FXXHAEQU.js} +30 -29
- package/chunks/{qwenContentGenerator-MPBOQB64.js → qwenContentGenerator-KFJ77JP6.js} +24 -24
- package/chunks/{qwenOAuth2-BS5D2LYV.js → qwenOAuth2-KX6LVYQ3.js} +4 -4
- package/chunks/{read-file-R256LDWQ.js → read-file-S2NOCBIL.js} +4 -4
- package/chunks/{resumeHistoryUtils-S43LTFHD.js → resumeHistoryUtils-QHHPSQWU.js} +33 -32
- package/chunks/{ripGrep-L7HPZ75Y.js → ripGrep-F6TNOJUO.js} +5 -5
- package/chunks/{run-qwen-serve-CTFL5R6U.js → run-qwen-serve-KYBDQRDD.js} +229 -79
- package/chunks/{runtime-FS5TL6P7.js → runtime-3WNOFLCR.js} +43 -40
- package/chunks/{scheduled-tasks-QXPV3Q35.js → scheduled-tasks-RNBH56DJ.js} +34 -33
- package/chunks/{scheduler-EXU5HMVK.js → scheduler-ERMW7Q7B.js} +31 -30
- package/chunks/{send-message-GQKXGMPI.js → send-message-V5T3NMFM.js} +4 -4
- package/chunks/{serve-ITJC7WNN.js → serve-7NV46RMP.js} +36 -35
- package/chunks/{server-6JQY3PTU.js → server-6RZJR5QF.js} +1358 -932
- package/chunks/{session-PJDEKXD4.js → session-Z4EV7NVV.js} +107 -78
- package/chunks/{session-attachments-root-L37ORSST.js → session-attachments-root-SG5FC52X.js} +29 -28
- package/chunks/{session-pr-refresh-WIFD52YL.js → session-pr-refresh-ILC4Z3ZM.js} +33 -32
- package/chunks/{settings-LO6J5SAZ.js → settings-Y47SPE3X.js} +35 -34
- package/chunks/{shell-ANAFVYGR.js → shell-YBVCOPVO.js} +20 -20
- package/chunks/{skill-SHJWKSPH.js → skill-AXC63EBA.js} +4 -4
- package/chunks/{skill-settings-GX3XHZ5Q.js → skill-settings-AFPAYGLO.js} +35 -34
- package/chunks/{spawnChannel-WE42VBKM.js → spawnChannel-ZFL4J2V3.js} +29 -28
- package/chunks/{standalone-update-CWDIKJRP.js → standalone-update-Y2OZPLNJ.js} +31 -30
- package/chunks/{start-opentui-ui-BBHGFOTF.js → start-opentui-ui-G6TKT4LI.js} +2270 -1026
- package/chunks/{startInteractiveUI-FQX7LUYP.js → startInteractiveUI-YTNDPW7J.js} +1789 -2211
- package/chunks/{task-create-PMAFST2T.js → task-create-MWXJFRRM.js} +3 -3
- package/chunks/{task-list-R2HSY2NC.js → task-list-EYO3FE57.js} +2 -2
- package/chunks/{task-update-JYC57USF.js → task-update-2JJJRHMT.js} +3 -3
- package/chunks/{team-create-WKTPCH6D.js → team-create-BUFLGGSH.js} +20 -20
- package/chunks/{team-delete-CBHVBTPB.js → team-delete-IQZ6XGFI.js} +2 -2
- package/chunks/{team-plan-approval-Y23DL7WR.js → team-plan-approval-OUWWM42U.js} +20 -20
- package/chunks/{terminal-image-renderer-B646HBDW.js → terminal-image-renderer-WH2WV5ES.js} +29 -28
- package/chunks/{theme-manager-BNWESY26.js → theme-manager-5UDRARM2.js} +29 -28
- package/chunks/{tool-search-PVQ5O5Y2.js → tool-search-MCDIRPHN.js} +4 -4
- package/chunks/{total-session-admission-P5Z43KNW.js → total-session-admission-VL27U74Z.js} +33 -32
- package/chunks/{trustedFolders-FH2LT2MZ.js → trustedFolders-MSXT4VDD.js} +30 -29
- package/chunks/{update-relaunch-WOWTKJSN.js → update-relaunch-JKLEWVCB.js} +5 -5
- package/chunks/{updateCheck-3MYFMM35.js → updateCheck-ARTHAJT2.js} +31 -30
- package/chunks/{useAutoAcceptIndicator-Q7ZRRRKO.js → useAutoAcceptIndicator-YEAAGYVU.js} +38 -37
- package/chunks/{validateNonInterActiveAuth-MYEWJX3G.js → validateNonInterActiveAuth-EMRQKH5S.js} +71 -69
- package/chunks/{version-RO2FPO76.js → version-HFQU35WD.js} +3 -1
- package/chunks/{web-fetch-QAKY2LUA.js → web-fetch-QBXAO6VF.js} +7 -7
- package/chunks/{web-search-XA5Z4ZCD.js → web-search-2URQXA3A.js} +201 -13
- package/chunks/{web-shell-static-POZHGGXE.js → web-shell-static-BFDESDD4.js} +5 -4
- package/chunks/{workflow-QFIOCMDM.js → workflow-JDD6WDAH.js} +211 -75
- package/chunks/{workspace-providers-status-B2UD7RAG.js → workspace-providers-status-B4IKR6YJ.js} +38 -37
- package/chunks/{workspace-registration-store-VZLRTI3Q.js → workspace-registration-store-PJ3YHR45.js} +1 -2
- package/chunks/{workspace-registry-GYOGG6TM.js → workspace-registry-WVYJ5UGB.js} +33 -32
- package/chunks/{workspace-runtime-coordinator-7KRXGQ4V.js → workspace-runtime-coordinator-DXL5YVAG.js} +33 -32
- package/chunks/{workspace-service-DJEYGJE4.js → workspace-service-QNGAMVH7.js} +40 -39
- package/chunks/{workspace-skills-status-MOKNESUC.js → workspace-skills-status-BEISJIII.js} +36 -35
- package/chunks/{workspace-trust-reconciler-AXOSUTQW.js → workspace-trust-reconciler-ORYJF5L4.js} +40 -39
- package/chunks/{write-file-QOYVHAKK.js → write-file-DWLKFBTJ.js} +21 -21
- package/chunks/{zoom-image-UCCLGFNC.js → zoom-image-BYVIXSNQ.js} +4 -4
- package/cli.js +13 -13
- package/export-transcript-document.js +123 -119
- package/package.json +4 -4
- package/web-shell/assets/{abnfDiagram-VCTEODGH-CTstZpXw.js → abnfDiagram-VCTEODGH-C_8kzsly.js} +1 -1
- package/web-shell/assets/{arc-DKW0mbPo.js → arc-CDg7Zfpm.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-DkMpJ42t.js → architectureDiagram-5GKGNRK7-DZzdCWyF.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-7Cp1_4i3.js → blockDiagram-NRAW4CY4-DI3B4gyR.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BfaoSlBK.js → c4Diagram-UCG6FXSJ-CfOgwHZW.js} +1 -1
- package/web-shell/assets/channel-e4xwS72w.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-_n1qzAio.js → chunk-2Q5K7J3B-B_PUth0g.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-0cira5ZV.js → chunk-5VM5RSS4-CrKtvBIL.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-DseRXSHC.js → chunk-F27PBJKO-B4z2n8Py.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-BehQWin0.js → chunk-G27WJ6UU-BUtrFEO8.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-B5ftg1Bb.js → chunk-JWPE2WC7-Cqw3aXW0.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-D7rnbVdk.js → chunk-LCL6LL3I-CZolnvls.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-2Bp-Orju.js → chunk-POPQ4Y6H-DivgasCa.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-CD2goGva.js → chunk-SVP7TREG--seyb1B6.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DzQt-Rji.js → chunk-XXDRQBXY-D7pHtuVM.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CzXfUUOt.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CzXfUUOt.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-C-BZXSUn.js → cose-bilkent-JH36ORCC-4MWaRF_3.js} +1 -1
- package/web-shell/assets/csv-CX7rUNeC.svg +1 -0
- package/web-shell/assets/{cynefin-OW5HDTMX-BTcvowe1.js → cynefin-OW5HDTMX-nhJhAjgD.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BoUE6K81.js → cynefinDiagram-5FMLGOSQ-NF-PwXlq.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-BHxy9xeB.js → dagre-3AP2YEHR-Bu0ncdWP.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DMiJIvDT.js → diagram-S7CK7UJ4-CsvhFHZC.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-DXV09Aes.js → diagram-UQ7AKVKN-Ck61sIB3.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-CocpRomV.js → diagram-VSXAHHWV-D0171zrb.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DL7nqtb4.js → diagram-VX7I27RA-DvdxY4UL.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-CPZ2Jux_.js → diagram-Z3DM3KII-CGGpseiB.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-BX-eVNsX.js → ebnfDiagram-PWID7BFC-K8-QMvY8.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CPy_Ir6y.js → erDiagram-SSCWMZ5O-D316nAem.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-eknAOte9.js → flowDiagram-A5DVABFB-B7siy_mn.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-crAxw_t7.js → ganttDiagram-EL5Y4UJY-BZQDxzTu.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-M29pa3Tc.js → gitGraphDiagram-WWUBYQGX-DZynLCSV.js} +1 -1
- package/web-shell/assets/{index-C9R-iojE.js → index-9ie6xLTM.js} +1 -1
- package/web-shell/assets/index-DirkXQEg.js +2164 -0
- package/web-shell/assets/index-DzdST_7L.css +36 -0
- package/web-shell/assets/{infoDiagram-RXCK75RN-XqspXdOU.js → infoDiagram-RXCK75RN-B0gr769A.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-C5KFS-7j.js → ishikawaDiagram-5VMMS53U-0pQFfjvX.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-Cc57LVRo.js → journeyDiagram-EYS64GPL-DEGtClWb.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-C81OG-AI.js → kanban-definition-3QL26DDD-CnN8gPzw.js} +1 -1
- package/web-shell/assets/{layout-CFVu37BB.js → layout-C_70RhaT.js} +1 -1
- package/web-shell/assets/{linear-ChBxdtWf.js → linear-BJ2ZLmcq.js} +1 -1
- package/web-shell/assets/{mermaid.core-CMLfue0w.js → mermaid.core-RlY0zPNC.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-DFsvJThp.js → mindmap-definition-FBJOCRG2-CpVAxTNl.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-BzpRzM4F.js → pegDiagram-XKGWAZYB-DmrSv3hD.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-Cv0Kankl.js → pieDiagram-E7YTZNPT-CJmgp8KJ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-Bh2BJ3Ay.js → quadrantDiagram-AXDQQJYC-UsgOyNco.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-y8rNDdDS.js → railroadDiagram-O6MQD6OU-DQ6gMs_W.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C0m2DKJ_.js → requirementDiagram-EFPCY7ZU-DhqadamF.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BzdGnSF4.js → sankeyDiagram-P5KCCOFB-R4WnURaE.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DPzAVmzz.js → sequenceDiagram-WJ2MYXX4-D7BwMi_D.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-LcHG28Zh.js → sizeCapture-X5ZJPWSS-Bqngz088.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-C1Bzy3IT.js → stateDiagram-HBIQ2CUA-DwaXPGqn.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-8GCQZAvv.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Bftk8V64.js → swimlanes-XN3QIQJK-BsaLeRDY.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-BoRBF2Yw.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-BfXHcN1A.js → timeline-definition-24CTP7MA-NJ9G-NUU.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-DRSlI9-V.js → vennDiagram-4TSXK5OY-Ca3W4rSq.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CaLmqGau.js → wardleyDiagram-VM6X3IG4-OabvjC-6.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-8lgUT6e8.js → xychartDiagram-S5SC5T6Z-C7rbjvpc.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-2LD5U7Q3.js +0 -114
- package/chunks/chunk-3UMWOKJC.js +0 -78
- package/chunks/chunk-IQAFKVXS.js +0 -22
- package/chunks/chunk-X35VIWWJ.js +0 -276
- package/chunks/chunk-ZJ2LM2SI.js +0 -198
- package/web-shell/assets/channel-CQx7VSAp.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-C-Uz8hHk.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-C-Uz8hHk.js +0 -1
- package/web-shell/assets/index-B4TLaxWs.js +0 -2142
- package/web-shell/assets/index-CCrkEbzz.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-LuuL5byY.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-COmnNq8s.js +0 -8
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
isSameProcess,
|
|
5
|
+
readLocalBootId,
|
|
6
|
+
readPidNamespaceId,
|
|
7
|
+
readProcStartToken
|
|
8
|
+
} from "./chunk-CH2YDT6X.js";
|
|
9
|
+
import {
|
|
10
|
+
require_proper_lockfile
|
|
11
|
+
} from "./chunk-MLXTMF7H.js";
|
|
12
|
+
import {
|
|
13
|
+
Storage
|
|
14
|
+
} from "./chunk-ZAFYHRVY.js";
|
|
15
|
+
import {
|
|
16
|
+
init_esbuild_shims
|
|
17
|
+
} from "./chunk-5O2XNYP6.js";
|
|
18
|
+
import {
|
|
19
|
+
__name,
|
|
20
|
+
__toESM
|
|
21
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
22
|
+
|
|
23
|
+
// packages/cli/src/commands/channel/pidfile.ts
|
|
24
|
+
init_esbuild_shims();
|
|
25
|
+
import {
|
|
26
|
+
existsSync,
|
|
27
|
+
readFileSync,
|
|
28
|
+
writeFileSync,
|
|
29
|
+
mkdirSync,
|
|
30
|
+
unlinkSync,
|
|
31
|
+
openSync,
|
|
32
|
+
closeSync,
|
|
33
|
+
constants,
|
|
34
|
+
ftruncateSync,
|
|
35
|
+
writeSync
|
|
36
|
+
} from "node:fs";
|
|
37
|
+
import * as path2 from "node:path";
|
|
38
|
+
|
|
39
|
+
// packages/cli/src/commands/channel/pidfile-lock.ts
|
|
40
|
+
init_esbuild_shims();
|
|
41
|
+
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
42
|
+
import fs from "node:fs";
|
|
43
|
+
import path from "node:path";
|
|
44
|
+
var RETRY_DELAYS_MS = [10, 20, 30, 40, 50];
|
|
45
|
+
var STALE_LOCK_MS = 1e4;
|
|
46
|
+
var sleepState = new Int32Array(new SharedArrayBuffer(4));
|
|
47
|
+
function sleepSync(ms) {
|
|
48
|
+
Atomics.wait(sleepState, 0, 0, ms);
|
|
49
|
+
}
|
|
50
|
+
__name(sleepSync, "sleepSync");
|
|
51
|
+
function withChannelPidfileLock(filePath, operation) {
|
|
52
|
+
const dir = path.dirname(filePath);
|
|
53
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
54
|
+
let release;
|
|
55
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
56
|
+
try {
|
|
57
|
+
release = import_proper_lockfile.default.lockSync(filePath, {
|
|
58
|
+
realpath: false,
|
|
59
|
+
stale: STALE_LOCK_MS
|
|
60
|
+
});
|
|
61
|
+
break;
|
|
62
|
+
} catch (error) {
|
|
63
|
+
const lockError = error;
|
|
64
|
+
if (lockError.code !== "ELOCKED") {
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
if (attempt >= RETRY_DELAYS_MS.length) {
|
|
68
|
+
throw Object.assign(
|
|
69
|
+
new Error(
|
|
70
|
+
`Channel pidfile lock ${filePath}.lock is held; an abandoned lock recovers automatically after ${STALE_LOCK_MS / 1e3} seconds.`,
|
|
71
|
+
{ cause: error }
|
|
72
|
+
),
|
|
73
|
+
{ code: "ELOCKED" }
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
sleepSync(RETRY_DELAYS_MS[attempt]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
return operation();
|
|
81
|
+
} finally {
|
|
82
|
+
release();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
__name(withChannelPidfileLock, "withChannelPidfileLock");
|
|
86
|
+
|
|
87
|
+
// packages/cli/src/commands/channel/pidfile.ts
|
|
88
|
+
function pidFilePath() {
|
|
89
|
+
return path2.join(Storage.getGlobalQwenDir(), "channels", "service.pid");
|
|
90
|
+
}
|
|
91
|
+
__name(pidFilePath, "pidFilePath");
|
|
92
|
+
function isValidPid(pid) {
|
|
93
|
+
return typeof pid === "number" && Number.isSafeInteger(pid) && pid > 0;
|
|
94
|
+
}
|
|
95
|
+
__name(isValidPid, "isValidPid");
|
|
96
|
+
function parseServiceInfo(value) {
|
|
97
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const info = value;
|
|
101
|
+
const owner = info.owner ?? "channel";
|
|
102
|
+
if (owner !== "channel" && owner !== "serve") return null;
|
|
103
|
+
if (!isValidPid(info.pid) || typeof info.startedAt !== "string" || Number.isNaN(Date.parse(info.startedAt)) || !Array.isArray(info.channels) || !info.channels.every((channel) => typeof channel === "string")) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (info.servePid !== void 0 && !isValidPid(info.servePid)) return null;
|
|
107
|
+
if (info.workerPid !== void 0 && !isValidPid(info.workerPid)) return null;
|
|
108
|
+
if (info.procStart !== void 0 && info.procStart !== null && typeof info.procStart !== "string") {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
if (info.pidNs !== void 0 && info.pidNs !== null && typeof info.pidNs !== "number") {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
const workers = parseServiceInfoWorkers(info.workers);
|
|
115
|
+
if (workers === null) return null;
|
|
116
|
+
return {
|
|
117
|
+
owner,
|
|
118
|
+
pid: info.pid,
|
|
119
|
+
...info.procStart !== void 0 ? { procStart: info.procStart } : {},
|
|
120
|
+
...info.pidNs !== void 0 ? { pidNs: info.pidNs } : {},
|
|
121
|
+
startedAt: info.startedAt,
|
|
122
|
+
channels: info.channels,
|
|
123
|
+
...info.servePid !== void 0 ? { servePid: info.servePid } : {},
|
|
124
|
+
...info.workerPid !== void 0 ? { workerPid: info.workerPid } : {},
|
|
125
|
+
...workers !== void 0 ? { workers } : {}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
__name(parseServiceInfo, "parseServiceInfo");
|
|
129
|
+
function parseServiceInfoWorkers(value) {
|
|
130
|
+
if (value === void 0) return void 0;
|
|
131
|
+
if (!Array.isArray(value)) return null;
|
|
132
|
+
const workers = [];
|
|
133
|
+
for (const raw of value) {
|
|
134
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const worker = raw;
|
|
138
|
+
if (!Array.isArray(worker.channels) || !worker.channels.every((channel) => typeof channel === "string")) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (worker.workspaceId !== void 0 && typeof worker.workspaceId !== "string") {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (worker.workspaceCwd !== void 0 && typeof worker.workspaceCwd !== "string") {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
if (worker.workerPid !== void 0 && !isValidPid(worker.workerPid)) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
workers.push({
|
|
151
|
+
channels: worker.channels,
|
|
152
|
+
...worker.workspaceId !== void 0 ? { workspaceId: worker.workspaceId } : {},
|
|
153
|
+
...worker.workspaceCwd !== void 0 ? { workspaceCwd: worker.workspaceCwd } : {},
|
|
154
|
+
...worker.workerPid !== void 0 ? { workerPid: worker.workerPid } : {}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return workers;
|
|
158
|
+
}
|
|
159
|
+
__name(parseServiceInfoWorkers, "parseServiceInfoWorkers");
|
|
160
|
+
function unlinkPidFile(filePath) {
|
|
161
|
+
try {
|
|
162
|
+
unlinkSync(filePath);
|
|
163
|
+
return true;
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
__name(unlinkPidFile, "unlinkPidFile");
|
|
169
|
+
function bootIdOf(procStart) {
|
|
170
|
+
if (procStart == null) return null;
|
|
171
|
+
const separator = procStart.indexOf(":");
|
|
172
|
+
return separator === -1 ? null : procStart.slice(0, separator);
|
|
173
|
+
}
|
|
174
|
+
__name(bootIdOf, "bootIdOf");
|
|
175
|
+
function isLocalIdentity(info) {
|
|
176
|
+
if (info.pidNs !== void 0 && info.pidNs !== readPidNamespaceId()) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const recordBootId = bootIdOf(info.procStart);
|
|
180
|
+
return recordBootId === null || recordBootId === readLocalBootId();
|
|
181
|
+
}
|
|
182
|
+
__name(isLocalIdentity, "isLocalIdentity");
|
|
183
|
+
function isOwnServeReservation(info, servePid) {
|
|
184
|
+
return info !== null && info.owner === "serve" && info.pid === servePid && info.servePid === servePid && isLocalIdentity(info);
|
|
185
|
+
}
|
|
186
|
+
__name(isOwnServeReservation, "isOwnServeReservation");
|
|
187
|
+
function withPidFileLock(operation) {
|
|
188
|
+
const filePath = pidFilePath();
|
|
189
|
+
return withChannelPidfileLock(filePath, () => operation(filePath));
|
|
190
|
+
}
|
|
191
|
+
__name(withPidFileLock, "withPidFileLock");
|
|
192
|
+
function readServiceInfo() {
|
|
193
|
+
const filePath = pidFilePath();
|
|
194
|
+
if (!existsSync(filePath)) return null;
|
|
195
|
+
try {
|
|
196
|
+
return withChannelPidfileLock(
|
|
197
|
+
filePath,
|
|
198
|
+
() => readServiceInfoRecord(filePath, true)
|
|
199
|
+
);
|
|
200
|
+
} catch {
|
|
201
|
+
return readServiceInfoRecord(filePath, false);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
__name(readServiceInfo, "readServiceInfo");
|
|
205
|
+
function readServiceInfoRecord(filePath, sweep) {
|
|
206
|
+
if (!existsSync(filePath)) return null;
|
|
207
|
+
let raw;
|
|
208
|
+
try {
|
|
209
|
+
raw = readFileSync(filePath, "utf-8");
|
|
210
|
+
} catch {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
let parsed;
|
|
214
|
+
try {
|
|
215
|
+
parsed = JSON.parse(raw);
|
|
216
|
+
} catch {
|
|
217
|
+
if (sweep) unlinkPidFile(filePath);
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
const info = parseServiceInfo(parsed);
|
|
221
|
+
if (!info) {
|
|
222
|
+
if (sweep) unlinkPidFile(filePath);
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
if (!isLocalIdentity(info)) {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
if (!isSameProcess(info.pid, info.procStart)) {
|
|
229
|
+
if (sweep) unlinkPidFile(filePath);
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
return info;
|
|
233
|
+
}
|
|
234
|
+
__name(readServiceInfoRecord, "readServiceInfoRecord");
|
|
235
|
+
function writeInfo(info, flag = "w") {
|
|
236
|
+
const filePath = pidFilePath();
|
|
237
|
+
const dir = path2.dirname(filePath);
|
|
238
|
+
if (!existsSync(dir)) {
|
|
239
|
+
mkdirSync(dir, { recursive: true });
|
|
240
|
+
}
|
|
241
|
+
writeFileSync(filePath, JSON.stringify(info, null, 2), {
|
|
242
|
+
encoding: "utf-8",
|
|
243
|
+
flag
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
__name(writeInfo, "writeInfo");
|
|
247
|
+
function fileExistsError(message) {
|
|
248
|
+
const err = new Error(message);
|
|
249
|
+
err.code = "EEXIST";
|
|
250
|
+
return err;
|
|
251
|
+
}
|
|
252
|
+
__name(fileExistsError, "fileExistsError");
|
|
253
|
+
function writeInfoExclusive(info) {
|
|
254
|
+
const filePath = pidFilePath();
|
|
255
|
+
try {
|
|
256
|
+
writeInfo(info, "wx");
|
|
257
|
+
} catch (err) {
|
|
258
|
+
if (err.code !== "EEXIST") throw err;
|
|
259
|
+
let existing = null;
|
|
260
|
+
try {
|
|
261
|
+
existing = parseServiceInfo(JSON.parse(readFileSync(filePath, "utf-8")));
|
|
262
|
+
} catch {
|
|
263
|
+
throw err;
|
|
264
|
+
}
|
|
265
|
+
if (existing && !isLocalIdentity(existing)) {
|
|
266
|
+
const conflict = new Error(
|
|
267
|
+
`Channel service pidfile ${filePath} holds a record this machine cannot verify, written before a reboot or by another machine or PID namespace sharing this home. Confirm no channel service is running, then delete that file to start again.`
|
|
268
|
+
);
|
|
269
|
+
conflict.code = "channel_service_conflict";
|
|
270
|
+
throw conflict;
|
|
271
|
+
}
|
|
272
|
+
if (existing && isSameProcess(existing.pid, existing.procStart)) {
|
|
273
|
+
throw err;
|
|
274
|
+
}
|
|
275
|
+
unlinkPidFile(filePath);
|
|
276
|
+
writeInfo(info, "wx");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
__name(writeInfoExclusive, "writeInfoExclusive");
|
|
280
|
+
function readPidfileProcessToken(pid) {
|
|
281
|
+
let procStart = readProcStartToken(pid);
|
|
282
|
+
if (process.platform !== "linux" || procStart !== null) return procStart;
|
|
283
|
+
procStart = readProcStartToken(pid);
|
|
284
|
+
if (procStart !== null) return procStart;
|
|
285
|
+
throw new Error(
|
|
286
|
+
`Unable to read the process start token for PID ${pid}; refusing to write an impersonable Channel pidfile.`
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
__name(readPidfileProcessToken, "readPidfileProcessToken");
|
|
290
|
+
function readPidfileNamespaceId() {
|
|
291
|
+
let pidNs = readPidNamespaceId();
|
|
292
|
+
if (process.platform !== "linux" || pidNs !== null) return pidNs;
|
|
293
|
+
pidNs = readPidNamespaceId();
|
|
294
|
+
if (pidNs !== null) return pidNs;
|
|
295
|
+
throw new Error(
|
|
296
|
+
"Unable to read the PID namespace id; refusing to write an unreclaimable Channel pidfile."
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
__name(readPidfileNamespaceId, "readPidfileNamespaceId");
|
|
300
|
+
function writeServiceInfo(channels) {
|
|
301
|
+
const info = {
|
|
302
|
+
owner: "channel",
|
|
303
|
+
pid: process.pid,
|
|
304
|
+
procStart: readPidfileProcessToken(process.pid),
|
|
305
|
+
pidNs: readPidfileNamespaceId(),
|
|
306
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
307
|
+
channels
|
|
308
|
+
};
|
|
309
|
+
withPidFileLock(() => writeInfoExclusive(info));
|
|
310
|
+
}
|
|
311
|
+
__name(writeServiceInfo, "writeServiceInfo");
|
|
312
|
+
function writeServeServiceInfo({
|
|
313
|
+
channels,
|
|
314
|
+
servePid = process.pid,
|
|
315
|
+
workerPid,
|
|
316
|
+
workers
|
|
317
|
+
}) {
|
|
318
|
+
const buildInfo = /* @__PURE__ */ __name((startedAt, procStart) => ({
|
|
319
|
+
owner: "serve",
|
|
320
|
+
pid: servePid,
|
|
321
|
+
procStart,
|
|
322
|
+
pidNs: readPidfileNamespaceId(),
|
|
323
|
+
startedAt,
|
|
324
|
+
channels,
|
|
325
|
+
servePid,
|
|
326
|
+
...workerPid !== void 0 ? { workerPid } : {},
|
|
327
|
+
...workers !== void 0 ? { workers } : {}
|
|
328
|
+
}), "buildInfo");
|
|
329
|
+
withPidFileLock((filePath) => {
|
|
330
|
+
let fd;
|
|
331
|
+
try {
|
|
332
|
+
fd = openSync(filePath, constants.O_RDWR | constants.O_NOFOLLOW);
|
|
333
|
+
} catch (err) {
|
|
334
|
+
if (err.code === "ENOENT") {
|
|
335
|
+
writeInfo(
|
|
336
|
+
buildInfo(
|
|
337
|
+
(/* @__PURE__ */ new Date()).toISOString(),
|
|
338
|
+
readPidfileProcessToken(servePid)
|
|
339
|
+
),
|
|
340
|
+
"wx"
|
|
341
|
+
);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
throw err;
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
let existing = null;
|
|
348
|
+
try {
|
|
349
|
+
existing = parseServiceInfo(JSON.parse(readFileSync(fd, "utf-8")));
|
|
350
|
+
} catch {
|
|
351
|
+
}
|
|
352
|
+
if (!isOwnServeReservation(existing, servePid)) {
|
|
353
|
+
throw fileExistsError(
|
|
354
|
+
"Channel service pidfile is owned by another process."
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
const info = buildInfo(
|
|
358
|
+
existing.startedAt,
|
|
359
|
+
existing.procStart ?? readPidfileProcessToken(servePid)
|
|
360
|
+
);
|
|
361
|
+
ftruncateSync(fd, 0);
|
|
362
|
+
writeSync(fd, JSON.stringify(info, null, 2), 0, "utf-8");
|
|
363
|
+
} finally {
|
|
364
|
+
closeSync(fd);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
__name(writeServeServiceInfo, "writeServeServiceInfo");
|
|
369
|
+
function reserveServeServiceInfo({
|
|
370
|
+
channels,
|
|
371
|
+
servePid = process.pid
|
|
372
|
+
}) {
|
|
373
|
+
const info = {
|
|
374
|
+
owner: "serve",
|
|
375
|
+
pid: servePid,
|
|
376
|
+
procStart: readPidfileProcessToken(servePid),
|
|
377
|
+
pidNs: readPidfileNamespaceId(),
|
|
378
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
379
|
+
channels,
|
|
380
|
+
servePid
|
|
381
|
+
};
|
|
382
|
+
withPidFileLock(() => writeInfoExclusive(info));
|
|
383
|
+
}
|
|
384
|
+
__name(reserveServeServiceInfo, "reserveServeServiceInfo");
|
|
385
|
+
function removeServiceInfo(expected) {
|
|
386
|
+
try {
|
|
387
|
+
withPidFileLock((filePath) => {
|
|
388
|
+
if (!expected) {
|
|
389
|
+
if (existsSync(filePath)) unlinkPidFile(filePath);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
try {
|
|
393
|
+
const current = parseServiceInfo(
|
|
394
|
+
JSON.parse(readFileSync(filePath, "utf-8"))
|
|
395
|
+
);
|
|
396
|
+
if (current?.owner === expected.owner && current.pid === expected.pid && current.procStart === expected.procStart && current.startedAt === expected.startedAt) {
|
|
397
|
+
unlinkPidFile(filePath);
|
|
398
|
+
}
|
|
399
|
+
} catch {
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
} catch {
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
__name(removeServiceInfo, "removeServiceInfo");
|
|
406
|
+
function removeServeServiceInfo(servePid = process.pid) {
|
|
407
|
+
try {
|
|
408
|
+
return withPidFileLock((filePath) => {
|
|
409
|
+
if (!existsSync(filePath)) return false;
|
|
410
|
+
let parsed;
|
|
411
|
+
try {
|
|
412
|
+
parsed = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
413
|
+
} catch {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
if (!isOwnServeReservation(parseServiceInfo(parsed), servePid)) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
return unlinkPidFile(filePath);
|
|
420
|
+
});
|
|
421
|
+
} catch {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
__name(removeServeServiceInfo, "removeServeServiceInfo");
|
|
426
|
+
function signalService(pid, signal = "SIGTERM", procStart) {
|
|
427
|
+
if (!isValidPid(pid)) {
|
|
428
|
+
return "refused";
|
|
429
|
+
}
|
|
430
|
+
if (procStart != null) {
|
|
431
|
+
const current = readProcStartToken(pid) ?? readProcStartToken(pid);
|
|
432
|
+
if (current !== procStart) return "refused";
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
process.kill(pid, signal);
|
|
436
|
+
return "sent";
|
|
437
|
+
} catch (err) {
|
|
438
|
+
return err.code === "EPERM" ? "not-permitted" : "refused";
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
__name(signalService, "signalService");
|
|
442
|
+
async function waitForExit(pid, timeoutMs = 5e3, pollMs = 200, procStart) {
|
|
443
|
+
const isOriginalProcessAlive = /* @__PURE__ */ __name(() => isSameProcess(pid, procStart), "isOriginalProcessAlive");
|
|
444
|
+
const start = Date.now();
|
|
445
|
+
while (Date.now() - start < timeoutMs) {
|
|
446
|
+
if (!isOriginalProcessAlive()) return true;
|
|
447
|
+
await new Promise((r) => setTimeout(r, pollMs));
|
|
448
|
+
}
|
|
449
|
+
return !isOriginalProcessAlive();
|
|
450
|
+
}
|
|
451
|
+
__name(waitForExit, "waitForExit");
|
|
452
|
+
|
|
453
|
+
export {
|
|
454
|
+
pidFilePath,
|
|
455
|
+
readServiceInfo,
|
|
456
|
+
writeServiceInfo,
|
|
457
|
+
writeServeServiceInfo,
|
|
458
|
+
reserveServeServiceInfo,
|
|
459
|
+
removeServiceInfo,
|
|
460
|
+
removeServeServiceInfo,
|
|
461
|
+
signalService,
|
|
462
|
+
waitForExit
|
|
463
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
createDebugLogger
|
|
5
|
+
} from "./chunk-ZAFYHRVY.js";
|
|
6
|
+
import {
|
|
7
|
+
init_esbuild_shims
|
|
8
|
+
} from "./chunk-5O2XNYP6.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
12
|
+
|
|
13
|
+
// packages/core/src/core/outbound-session-id.ts
|
|
14
|
+
init_esbuild_shims();
|
|
15
|
+
|
|
16
|
+
// packages/core/src/core/outbound-dynamic-headers.ts
|
|
17
|
+
init_esbuild_shims();
|
|
18
|
+
var debugLogger = createDebugLogger("OUTBOUND_CORRELATION");
|
|
19
|
+
var PLACEHOLDERS = [{ token: "${session_id}", resolve: /* @__PURE__ */ __name((config) => config.getSessionId(), "resolve") }];
|
|
20
|
+
var SESSION_ID_PLACEHOLDER_PATTERN = /\$(?:session_id|QWEN_CODE_SESSION_ID)(?!\w)|\$\{(?:session_id|QWEN_CODE_SESSION_ID)\}/gi;
|
|
21
|
+
var warnedGateOff = /* @__PURE__ */ new Set();
|
|
22
|
+
function warnIfDynamicHeadersDisabled(customHeaders, config) {
|
|
23
|
+
try {
|
|
24
|
+
const names = Object.entries(customHeaders ?? {}).filter(
|
|
25
|
+
([, value]) => typeof value === "string" && hasDynamicPlaceholder(value)
|
|
26
|
+
).map(([name]) => name);
|
|
27
|
+
if (names.length === 0) return;
|
|
28
|
+
if (config.getOutboundAllowDynamicHeaderValues()) return;
|
|
29
|
+
const key = names.slice().sort().join(",");
|
|
30
|
+
if (warnedGateOff.has(key)) return;
|
|
31
|
+
warnedGateOff.add(key);
|
|
32
|
+
console.warn(
|
|
33
|
+
`customHeaders ${names.join(", ")} contain a runtime placeholder, but outboundCorrelation.allowDynamicHeaderValues is not enabled \u2014 the header(s) will not be sent. Set it to true in settings.json to allow the value to be filled in per request.`
|
|
34
|
+
);
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
__name(warnIfDynamicHeadersDisabled, "warnIfDynamicHeadersDisabled");
|
|
39
|
+
function hasDynamicPlaceholder(value) {
|
|
40
|
+
return value.search(SESSION_ID_PLACEHOLDER_PATTERN) !== -1;
|
|
41
|
+
}
|
|
42
|
+
__name(hasDynamicPlaceholder, "hasDynamicPlaceholder");
|
|
43
|
+
function resolveDynamicHeaderValue(value, config) {
|
|
44
|
+
if (typeof value !== "string") return void 0;
|
|
45
|
+
if (!hasDynamicPlaceholder(value)) return value;
|
|
46
|
+
try {
|
|
47
|
+
if (!config.getOutboundAllowDynamicHeaderValues()) {
|
|
48
|
+
debugLogger.warn(
|
|
49
|
+
`Dropping a customHeaders value containing a runtime placeholder: outboundCorrelation.allowDynamicHeaderValues is not enabled.`
|
|
50
|
+
);
|
|
51
|
+
return void 0;
|
|
52
|
+
}
|
|
53
|
+
let expanded = value.replace(
|
|
54
|
+
SESSION_ID_PLACEHOLDER_PATTERN,
|
|
55
|
+
"${session_id}"
|
|
56
|
+
);
|
|
57
|
+
for (const { token, resolve } of PLACEHOLDERS) {
|
|
58
|
+
if (!expanded.includes(token)) continue;
|
|
59
|
+
const resolved = resolve(config);
|
|
60
|
+
if (!resolved) return void 0;
|
|
61
|
+
expanded = expanded.split(token).join(resolved);
|
|
62
|
+
}
|
|
63
|
+
return expanded;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
debugLogger.warn(
|
|
66
|
+
`Unable to expand a customHeaders placeholder: ${error instanceof Error ? error.message : String(error)}`
|
|
67
|
+
);
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
__name(resolveDynamicHeaderValue, "resolveDynamicHeaderValue");
|
|
72
|
+
function applyDynamicHeaderValues(headers, config) {
|
|
73
|
+
const pending = [];
|
|
74
|
+
headers.forEach((value, key) => {
|
|
75
|
+
if (hasDynamicPlaceholder(value)) pending.push([key, value]);
|
|
76
|
+
});
|
|
77
|
+
for (const [key, value] of pending) {
|
|
78
|
+
const resolved = resolveDynamicHeaderValue(value, config);
|
|
79
|
+
if (resolved === void 0) {
|
|
80
|
+
headers.delete(key);
|
|
81
|
+
} else {
|
|
82
|
+
headers.set(key, resolved);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
__name(applyDynamicHeaderValues, "applyDynamicHeaderValues");
|
|
87
|
+
function expandDynamicHeaders(customHeaders, config) {
|
|
88
|
+
if (!customHeaders) return {};
|
|
89
|
+
const expanded = {};
|
|
90
|
+
for (const [key, value] of Object.entries(customHeaders)) {
|
|
91
|
+
if (typeof value !== "string" || !hasDynamicPlaceholder(value)) continue;
|
|
92
|
+
const resolved = resolveDynamicHeaderValue(value, config);
|
|
93
|
+
if (resolved !== void 0) expanded[key] = resolved;
|
|
94
|
+
}
|
|
95
|
+
return expanded;
|
|
96
|
+
}
|
|
97
|
+
__name(expandDynamicHeaders, "expandDynamicHeaders");
|
|
98
|
+
|
|
99
|
+
// packages/core/src/core/outbound-session-id.ts
|
|
100
|
+
var debugLogger2 = createDebugLogger("OUTBOUND_CORRELATION");
|
|
101
|
+
var SESSION_ID_HEADER = "session_id";
|
|
102
|
+
var SESSION_ID_HEADER_HOSTS = [
|
|
103
|
+
"routify.alibaba-inc.com",
|
|
104
|
+
"routify-online.alibaba-inc.com",
|
|
105
|
+
"routify-pub.alibaba-inc.com"
|
|
106
|
+
];
|
|
107
|
+
function requestUrl(input) {
|
|
108
|
+
try {
|
|
109
|
+
if (typeof input === "string") return new URL(input);
|
|
110
|
+
if (input instanceof URL) return input;
|
|
111
|
+
return new URL(input.url);
|
|
112
|
+
} catch {
|
|
113
|
+
return void 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
__name(requestUrl, "requestUrl");
|
|
117
|
+
function buildSessionIdHeaders(config, destination) {
|
|
118
|
+
try {
|
|
119
|
+
const url = requestUrl(destination);
|
|
120
|
+
if (url?.protocol !== "https:" || !SESSION_ID_HEADER_HOSTS.includes(url.hostname.toLowerCase())) {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
const sessionId = config.getSessionId();
|
|
124
|
+
return sessionId ? { [SESSION_ID_HEADER]: sessionId } : {};
|
|
125
|
+
} catch (error) {
|
|
126
|
+
debugLogger2.warn(
|
|
127
|
+
`Unable to add ${SESSION_ID_HEADER} to outbound request: ${error instanceof Error ? error.message : String(error)}`
|
|
128
|
+
);
|
|
129
|
+
return {};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
__name(buildSessionIdHeaders, "buildSessionIdHeaders");
|
|
133
|
+
function wrapFetchWithSessionId(baseFetch, config, customHeaders) {
|
|
134
|
+
const fetchLike = baseFetch;
|
|
135
|
+
const expandsHeaders = Object.values(customHeaders ?? {}).some(
|
|
136
|
+
(value) => typeof value === "string" && hasDynamicPlaceholder(value)
|
|
137
|
+
);
|
|
138
|
+
if (expandsHeaders) warnIfDynamicHeadersDisabled(customHeaders, config);
|
|
139
|
+
const wrapped = /* @__PURE__ */ __name(async (input, init) => {
|
|
140
|
+
const sessionHeaders = buildSessionIdHeaders(config, input);
|
|
141
|
+
const sessionId = sessionHeaders[SESSION_ID_HEADER];
|
|
142
|
+
if (!sessionId && !expandsHeaders) return fetchLike(input, init);
|
|
143
|
+
const headers = new Headers(
|
|
144
|
+
input instanceof Request ? input.headers : void 0
|
|
145
|
+
);
|
|
146
|
+
new Headers(init?.headers).forEach((value, key) => headers.set(key, value));
|
|
147
|
+
if (expandsHeaders) applyDynamicHeaderValues(headers, config);
|
|
148
|
+
if (sessionId) headers.set(SESSION_ID_HEADER, sessionId);
|
|
149
|
+
return fetchLike(input, { ...init, headers });
|
|
150
|
+
}, "wrapped");
|
|
151
|
+
return wrapped;
|
|
152
|
+
}
|
|
153
|
+
__name(wrapFetchWithSessionId, "wrapFetchWithSessionId");
|
|
154
|
+
function buildSessionAwareFetch(runtimeFetch, config, customHeaders) {
|
|
155
|
+
const baseFetch = runtimeFetch ?? globalThis.fetch;
|
|
156
|
+
return wrapFetchWithSessionId(baseFetch, config, customHeaders);
|
|
157
|
+
}
|
|
158
|
+
__name(buildSessionAwareFetch, "buildSessionAwareFetch");
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
warnIfDynamicHeadersDisabled,
|
|
162
|
+
hasDynamicPlaceholder,
|
|
163
|
+
expandDynamicHeaders,
|
|
164
|
+
buildSessionIdHeaders,
|
|
165
|
+
buildSessionAwareFetch
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* @license
|
|
169
|
+
* Copyright 2025 Qwen
|
|
170
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
171
|
+
*/
|
|
@@ -244,6 +244,19 @@ function convertLlmToolParametersToOpenAI(parameters) {
|
|
|
244
244
|
}
|
|
245
245
|
__name(convertLlmToolParametersToOpenAI, "convertLlmToolParametersToOpenAI");
|
|
246
246
|
var grammarSchemaValidationCache = /* @__PURE__ */ new WeakMap();
|
|
247
|
+
var PARAMETERLESS_SCHEMA_KEYS = /* @__PURE__ */ new Set([
|
|
248
|
+
"$comment",
|
|
249
|
+
"$schema",
|
|
250
|
+
"additionalProperties",
|
|
251
|
+
"deprecated",
|
|
252
|
+
"description",
|
|
253
|
+
"examples",
|
|
254
|
+
"properties",
|
|
255
|
+
"readOnly",
|
|
256
|
+
"title",
|
|
257
|
+
"type",
|
|
258
|
+
"writeOnly"
|
|
259
|
+
]);
|
|
247
260
|
function isStrictlyValidSchema(schema) {
|
|
248
261
|
const cached = grammarSchemaValidationCache.get(schema);
|
|
249
262
|
if (cached !== void 0) {
|
|
@@ -278,13 +291,24 @@ async function convertLlmToolsToOpenAI(llmTools, schemaCompliance = "auto") {
|
|
|
278
291
|
);
|
|
279
292
|
}
|
|
280
293
|
if (parameters) {
|
|
281
|
-
const sourceSchema = func.parametersJsonSchema;
|
|
282
|
-
const canValidateLocally =
|
|
294
|
+
const sourceSchema = typeof func.parametersJsonSchema === "object" && func.parametersJsonSchema !== null && !Array.isArray(func.parametersJsonSchema) ? func.parametersJsonSchema : void 0;
|
|
295
|
+
const canValidateLocally = sourceSchema !== void 0 && !("$id" in sourceSchema) && isStrictlyValidSchema(sourceSchema);
|
|
296
|
+
const sourceProperties = sourceSchema?.["properties"];
|
|
297
|
+
const sourceAdditionalProperties = sourceSchema?.["additionalProperties"];
|
|
298
|
+
const hasEmptyProperties = typeof sourceProperties === "object" && sourceProperties !== null && !Array.isArray(sourceProperties) && Object.keys(sourceProperties).length === 0;
|
|
299
|
+
const declaresEmptyArgumentList = sourceSchema !== void 0 && (hasEmptyProperties && (sourceAdditionalProperties === false || sourceAdditionalProperties === void 0) || sourceProperties === void 0 && sourceAdditionalProperties === false) && Object.keys(sourceSchema).every(
|
|
300
|
+
(key) => PARAMETERLESS_SCHEMA_KEYS.has(key)
|
|
301
|
+
);
|
|
283
302
|
parameters = convertSchema(parameters, schemaCompliance);
|
|
284
303
|
parameters = relaxSchemaForFunctionCalling(
|
|
285
304
|
parameters,
|
|
286
305
|
canValidateLocally
|
|
287
306
|
);
|
|
307
|
+
if (canValidateLocally && declaresEmptyArgumentList && parameters["type"] === "object" && Object.keys(parameters).every(
|
|
308
|
+
(key) => PARAMETERLESS_SCHEMA_KEYS.has(key)
|
|
309
|
+
)) {
|
|
310
|
+
parameters = void 0;
|
|
311
|
+
}
|
|
288
312
|
}
|
|
289
313
|
openAITools.push({
|
|
290
314
|
type: "function",
|