@organizaone/o1-code 0.20.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/common-workflow.md +2 -2
- package/bundled/qc-helper/docs/extension/getting-started-extensions.md +1 -1
- package/bundled/qc-helper/docs/features/commands.md +15 -1
- package/chunks/{MaxSizedBox-EZERR2VP.js → MaxSizedBox-UVDDWU7T.js} +21 -20
- package/chunks/{StandaloneSessionPicker-JNWXQZWK.js → StandaloneSessionPicker-BMP4CROY.js} +42 -41
- package/chunks/{acp-subagent-executor-SWU2HEK2.js → acp-subagent-executor-FV3XBATE.js} +19 -19
- package/chunks/{acpAgent-KBGZCBFV.js → acpAgent-6QL2DRXT.js} +114 -112
- package/chunks/{agent-IXG5INIW.js → agent-7RIITHH6.js} +9 -9
- package/chunks/{agent-headless-SY563G4Y.js → agent-headless-V7G74ZRT.js} +9 -9
- package/chunks/{all-providers-GEEOO5NG.js → all-providers-NUAV373L.js} +2 -2
- package/chunks/{anthropicContentGenerator-QPZOYWP7.js → anthropicContentGenerator-IMMO2JES.js} +5 -5
- package/chunks/{bridge-RCKHVFJ3.js → bridge-NOBAHBIW.js} +19 -19
- package/chunks/{ca-6DKW436A.js → ca-EMDHXMDN.js} +6 -2
- package/chunks/{chunk-VWOLZXSN.js → chunk-2327FMUY.js} +4 -4
- package/chunks/{chunk-FRXXYR4K.js → chunk-24LWP4WE.js} +2 -2
- package/chunks/chunk-2EFFEOP5.js +5043 -0
- package/chunks/{chunk-HDVWETU2.js → chunk-3QWBMA3B.js} +12 -12
- package/chunks/{chunk-CH4NSUSE.js → chunk-3ZEBS4OE.js} +9 -9
- package/chunks/{chunk-UCXFJKY7.js → chunk-4NXPUJJK.js} +2 -2
- package/chunks/{chunk-PRHAZ5WA.js → chunk-4VB7VM7K.js} +1 -1
- package/chunks/{chunk-SKAH52QV.js → chunk-4XTPBUUX.js} +1 -1
- package/chunks/{chunk-5KLLG2CZ.js → chunk-5ZH7V5XA.js} +1 -1
- package/chunks/{chunk-KV5NXG3S.js → chunk-6LZG7Y6K.js} +2 -2
- package/chunks/{chunk-URHRCX4D.js → chunk-6YVU3VTW.js} +2 -2
- package/chunks/{chunk-RBNHPCLB.js → chunk-A3Z6ZU7I.js} +2 -2
- package/chunks/{chunk-MBJJLPMX.js → chunk-AFFISWZB.js} +32 -30
- package/chunks/{chunk-VQYBOX6T.js → chunk-B4XD2AVP.js} +2 -2
- package/chunks/{chunk-XVYLALS6.js → chunk-B5BMQDN6.js} +2 -2
- package/chunks/{chunk-6YH4HZFZ.js → chunk-BCCQP2PA.js} +3 -3
- package/chunks/{chunk-K6XWNSG7.js → chunk-BDXSHKWM.js} +1 -1
- package/chunks/{chunk-PFOXLZCP.js → chunk-BG5FFE5T.js} +9 -9
- package/chunks/{chunk-RATJ5RDQ.js → chunk-BJIFDJVV.js} +2 -2
- package/chunks/{chunk-L5MVOG3F.js → chunk-BYQ4WWVG.js} +1 -1
- package/chunks/{chunk-3DMPE7V6.js → chunk-BZXX2MRG.js} +1 -1
- package/chunks/{chunk-OMBM5PM7.js → chunk-COZEN7HG.js} +6 -6
- package/chunks/{chunk-ZKBTWORX.js → chunk-CUGVJRCO.js} +2 -2
- package/chunks/{chunk-7EXAMT2I.js → chunk-DAZ4E2KL.js} +2 -2
- package/chunks/{chunk-6F6GDT4W.js → chunk-DEEUE6NL.js} +9 -9
- package/chunks/{chunk-23MB6DC2.js → chunk-EDYCC6T6.js} +5 -5
- package/chunks/{chunk-KMIBUJJV.js → chunk-FJVTBMTU.js} +3 -3
- package/chunks/{chunk-4WQOE2IB.js → chunk-FSM6MGRH.js} +2 -2
- package/chunks/{chunk-R3QWLJJF.js → chunk-G2GNLDQS.js} +13 -13
- package/chunks/{chunk-QTKR2GD7.js → chunk-GB6XUAYL.js} +1 -1
- package/chunks/{chunk-CX4XYMNF.js → chunk-GWAPD4WA.js} +7 -7
- package/chunks/{chunk-E6FTSEFU.js → chunk-HG2CPZUM.js} +3 -3
- package/chunks/{chunk-4B3VOPKW.js → chunk-HJRDPASY.js} +5 -5
- package/chunks/{chunk-CN7MCAV5.js → chunk-HVCQOHA6.js} +4 -4
- package/chunks/{chunk-2DFFYJGZ.js → chunk-HXOUCS5U.js} +4 -4
- package/chunks/{chunk-LPP5I5D7.js → chunk-IAW6OPW2.js} +3 -3
- package/chunks/{chunk-SAA7VWPH.js → chunk-IOUCJCNS.js} +1 -1
- package/chunks/{chunk-EW76FWYR.js → chunk-ISDTLMDF.js} +1 -1
- package/chunks/{chunk-P6YI66SA.js → chunk-J3I2P6J4.js} +1 -1
- package/chunks/{chunk-2FDD7R4M.js → chunk-J4JE4YP3.js} +6 -6
- package/chunks/{chunk-VJWTK75T.js → chunk-J5RKE7HJ.js} +8 -8
- package/chunks/{chunk-2HLFWCUP.js → chunk-JEI2AYFD.js} +1 -1
- package/chunks/{chunk-Q6RYNLZS.js → chunk-JJNBSJTF.js} +2 -2
- package/chunks/{chunk-4ABEICOS.js → chunk-JYBDW4YQ.js} +1 -1
- package/chunks/{chunk-TR4DEKSP.js → chunk-KK2WC2WS.js} +2 -2
- package/chunks/{chunk-SLIL7BEZ.js → chunk-KRPFK75A.js} +2 -2
- package/chunks/{chunk-QKL4LXBU.js → chunk-KZ6OFUYM.js} +8 -8
- package/chunks/chunk-LRHUT6ZW.js +880 -0
- package/chunks/{chunk-Q6OW4P7O.js → chunk-LU3L67JW.js} +1 -1
- package/chunks/{chunk-EZ3OQPXV.js → chunk-MJFHIUKG.js} +2 -2
- package/chunks/{chunk-QAWZUGTG.js → chunk-NXQOTJAA.js} +2 -2
- package/chunks/{chunk-GDRFBPU5.js → chunk-NZYHDUMN.js} +1 -1
- package/chunks/{chunk-AY7TZ56V.js → chunk-O7V7JWOM.js} +86 -43
- package/chunks/{chunk-FG53SLIP.js → chunk-OK7GPGMS.js} +2 -2
- package/chunks/{chunk-RHZORPOC.js → chunk-ONTIVYTW.js} +3 -3
- package/chunks/{chunk-GFSDXCA6.js → chunk-P4OBMVRT.js} +3 -3
- package/chunks/{chunk-VFSP4ZUZ.js → chunk-P7RO4QSF.js} +28 -938
- package/chunks/{chunk-GVELMYCX.js → chunk-PK3MLBOH.js} +1 -1
- package/chunks/{chunk-ZJ3GFM2U.js → chunk-PP3G5KXH.js} +1 -1
- package/chunks/{chunk-CIQ2CLQ2.js → chunk-QAJ7AQSA.js} +1 -1
- package/chunks/{chunk-AP5DFANZ.js → chunk-QKZVYY6J.js} +5 -5
- package/chunks/{chunk-NTUVIB2G.js → chunk-R5HO4EJV.js} +1 -1
- package/chunks/{chunk-IUFEZVEZ.js → chunk-RMYDHM23.js} +3 -3
- package/chunks/{chunk-LNWFWFJ4.js → chunk-SL3PHYCR.js} +3 -3
- package/chunks/{chunk-2GPRQW4P.js → chunk-SYZ5WTE6.js} +2 -2
- package/chunks/{chunk-CEQQIJ45.js → chunk-T7MXEOXM.js} +2 -2
- package/chunks/{chunk-DSAFH5CY.js → chunk-TJQTTY4F.js} +1 -1
- package/chunks/{chunk-RI3VQTAX.js → chunk-TMYTIDVN.js} +3 -3
- package/chunks/{chunk-TBVRYAVY.js → chunk-TZRF4LY7.js} +3 -3
- package/chunks/{chunk-YPR43UHE.js → chunk-UKCKAG2F.js} +39 -39
- package/chunks/{chunk-FBHAG372.js → chunk-UUT7HQPM.js} +3 -3
- package/chunks/{chunk-7UME3BB3.js → chunk-UWSO6VOM.js} +1 -1
- package/chunks/{chunk-N2JEPFUF.js → chunk-UXJP6322.js} +3 -3
- package/chunks/{chunk-MDJ4DEEJ.js → chunk-V5QHABRY.js} +1 -1
- package/chunks/chunk-VDSY3ODQ.js +2405 -0
- package/chunks/{chunk-3TLBRQSX.js → chunk-VT5GZKMO.js} +1 -1
- package/chunks/{chunk-FDKCSPGD.js → chunk-W3XJPDIO.js} +13 -13
- package/chunks/{chunk-GNZQPESW.js → chunk-WKGMAUE7.js} +1 -1
- package/chunks/{chunk-LYYJBCAH.js → chunk-WOAI6G73.js} +3 -3
- package/chunks/{chunk-TQ65TNCT.js → chunk-WQYJ72JS.js} +1 -1
- package/chunks/{chunk-RTTJOKFS.js → chunk-WTC5HDJJ.js} +10 -10
- package/chunks/{chunk-VLAUXCTV.js → chunk-WU7DQB4Q.js} +4 -4
- package/chunks/{chunk-LFMK5B3W.js → chunk-X7Q5L62S.js} +1 -1
- package/chunks/{chunk-WILZABQC.js → chunk-XCWRCCIS.js} +1 -1
- package/chunks/{chunk-KSXF26WD.js → chunk-XHHPCZOZ.js} +2 -2
- package/chunks/{chunk-GLHPVNIZ.js → chunk-XIYHMMHO.js} +4 -4
- package/chunks/{chunk-ME6C5KAY.js → chunk-XMEAEIT7.js} +1 -1
- package/chunks/{chunk-LKRP2YCP.js → chunk-XXPXFR7S.js} +48 -48
- package/chunks/chunk-YQQ7QFC5.js +945 -0
- package/chunks/{chunk-A5JZKZ6Q.js → chunk-YXRFXEIU.js} +5 -5
- package/chunks/{chunk-F5OH2PNI.js → chunk-ZGHZRHUW.js} +1 -1
- package/chunks/{codex-subagent-executor-WNFU67G7.js → codex-subagent-executor-3MIEB3VJ.js} +19 -19
- package/chunks/{contextCommand-6LFH2YPP.js → contextCommand-H6YVYBS3.js} +19 -19
- package/chunks/{core-runtime-MFXIMNSH.js → core-runtime-2HHFL26H.js} +17 -17
- package/chunks/{create-sub-session-NUE3R5WZ.js → create-sub-session-ALKLKZWI.js} +18 -18
- package/chunks/{daemon-git-worktree-guard-PQ3SE2KI.js → daemon-git-worktree-guard-FKKXZKOZ.js} +17 -17
- package/chunks/{daemon-status-provider-Z5OUOPTR.js → daemon-status-provider-L3JVFUFB.js} +24 -24
- package/chunks/{daemon-trust-policy-TX4QULOJ.js → daemon-trust-policy-UKZ4URR5.js} +24 -24
- package/chunks/{daemon-trust-policy-monitor-CNBHLZT7.js → daemon-trust-policy-monitor-O3BAF5WQ.js} +24 -24
- package/chunks/{de-E75VCQRZ.js → de-OMV463ND.js} +6 -2
- package/chunks/{deferred-core-runtime-XDE6DRBZ.js → deferred-core-runtime-TX4M62JC.js} +17 -17
- package/chunks/{edit-QONTKKDS.js → edit-URCTP3DW.js} +11 -11
- package/chunks/{en-TS3SF6KR.js → en-EEVIOXSR.js} +6 -2
- package/chunks/{enterPlanMode-A3NZ5LMR.js → enterPlanMode-JGAWYT7U.js} +9 -9
- package/chunks/{environment-6FE7XGAC.js → environment-5NRP4NYH.js} +19 -19
- package/chunks/{errors-R5Y7H2GW.js → errors-7BX5N6WH.js} +19 -19
- package/chunks/{execution-tool-BTPXNHGK.js → execution-tool-4MAOTD33.js} +11 -11
- package/chunks/{execution-worker-Q2WOKDYJ.js → execution-worker-FE64M6YB.js} +14 -14
- package/chunks/{exitPlanMode-FWVAIF2G.js → exitPlanMode-MRIMIR7S.js} +9 -9
- package/chunks/{fast-path-ADV46XXY.js → fast-path-PI7IUZO5.js} +5 -5
- package/chunks/foreground-runner-ODCBQ62T.js +1496 -0
- package/chunks/{fr-KWQ6T7MX.js → fr-ZHVJMULM.js} +6 -2
- package/chunks/{glob-7C5LFIFY.js → glob-VVMTH2FZ.js} +9 -9
- package/chunks/{goal-tools-ZBOA3S6T.js → goal-tools-PIZJOC5V.js} +9 -9
- package/chunks/{handleAutoUpdate-OZFXXZGE.js → handleAutoUpdate-7CYUYIFT.js} +20 -20
- package/chunks/{i18n-ETDHGUAS.js → i18n-DZGPXZHL.js} +18 -18
- package/chunks/{initializer-3TGPNDS6.js → initializer-6MWLCO6O.js} +26 -25
- package/chunks/{installationInfo-53FUD2SP.js → installationInfo-2YFHIA4G.js} +17 -17
- package/chunks/{ja-NLAMHYSV.js → ja-MQ3LTDXD.js} +6 -2
- package/chunks/{list-D2SFACP2.js → list-2PCYJ5KG.js} +26 -26
- package/chunks/{llm-6JBUAXKT.js → llm-QVOVDL2Q.js} +70 -70
- package/chunks/{llm-content-generator-X2YXGOCB.js → llm-content-generator-P4MM2G4V.js} +4 -4
- package/chunks/{loadedSettingsAdapter-S2OW76SD.js → loadedSettingsAdapter-6DG3R23U.js} +24 -24
- package/chunks/{local-execution-environment-TCIIK3JA.js → local-execution-environment-RQZE5ZPQ.js} +14 -14
- package/chunks/{loggingContentGenerator-GDJB7R3H.js → loggingContentGenerator-T5HYYF2G.js} +9 -9
- package/chunks/{managed-npm-update-I3YZBNY7.js → managed-npm-update-FKD3RX22.js} +17 -17
- package/chunks/{mcp-6GZRGYAG.js → mcp-CONKBRY3.js} +24 -24
- package/chunks/{model-call-collection-YAUSBU5N.js → model-call-collection-L6GU4PEV.js} +1 -1
- package/chunks/{model-configuration-SMKT6PVP.js → model-configuration-TBFXQOP6.js} +25 -25
- package/chunks/{modelConfigUtils-FEON5T3Z.js → modelConfigUtils-ID2MFVCP.js} +19 -19
- package/chunks/{monitor-RNGWRP7C.js → monitor-ETBC2KHX.js} +9 -9
- package/chunks/{nonInteractiveCli-5N55OFDF.js → nonInteractiveCli-QPKDUFGH.js} +62 -60
- package/chunks/{nonInteractiveToolExecutor-EURXYN6L.js → nonInteractiveToolExecutor-7ZDYEIOV.js} +10 -10
- package/chunks/{notebook-edit-DMEOTACP.js → notebook-edit-PBP4CLHC.js} +10 -10
- package/chunks/{omni-A6J5PKS7.js → omni-EBPCPKLP.js} +9 -9
- package/chunks/{openaiContentGenerator-2ZU6S23B.js → openaiContentGenerator-FJJDGKFI.js} +6 -6
- package/chunks/{openaiResponsesContentGenerator-4RE34Y4W.js → openaiResponsesContentGenerator-Y27KA4YJ.js} +4 -4
- package/chunks/{processUtils-VBBXC2KT.js → processUtils-EUHGQHUQ.js} +2 -2
- package/chunks/{prompt-terminal-ledger-6DE5MRV3.js → prompt-terminal-ledger-XV4MIV4H.js} +18 -18
- package/chunks/{pt-F6OOJLH6.js → pt-AVWESYKZ.js} +6 -2
- package/chunks/pty-host-process-PKCVFICX.js +29 -0
- package/chunks/{reactive-degrade-S3SQRQ4D.js → reactive-degrade-LL5MSPMK.js} +8 -8
- package/chunks/{read-file-HDY4MSJE.js → read-file-HQVTDGX5.js} +1 -1
- package/chunks/{resumeHistoryUtils-BX3CLUM7.js → resumeHistoryUtils-DKTD3ZG2.js} +26 -25
- package/chunks/{ripGrep-4E63BMST.js → ripGrep-WA7AGEV7.js} +1 -1
- package/chunks/{ru-QXDK3EHQ.js → ru-CSBDIXDS.js} +6 -2
- package/chunks/{run-o1-code-serve-FR3YWC7D.js → run-o1-code-serve-27EWAN7V.js} +49 -49
- package/chunks/{sandboxConfig-7D6ZZBBU.js → sandboxConfig-B4Z7RRB6.js} +17 -17
- package/chunks/{scheduled-tasks-FEV7YG7C.js → scheduled-tasks-KBBSAL7T.js} +22 -22
- package/chunks/{scheduler-OOZEZWGT.js → scheduler-WUFLFLZX.js} +19 -19
- package/chunks/{serve-5CZRH2NI.js → serve-GHD5P7VM.js} +24 -24
- package/chunks/{server-AIIM3MRX.js → server-O7S2DL3A.js} +141 -141
- package/chunks/{session-5IHMC2GA.js → session-4COCQNXM.js} +63 -61
- package/chunks/{session-FZ3NBZYB.js → session-74Z72LNM.js} +1 -1
- package/chunks/{session-attachments-root-ANZOYK7U.js → session-attachments-root-QTVKHZO3.js} +17 -17
- package/chunks/{session-pr-refresh-CJLDHDTN.js → session-pr-refresh-4XWL7OWU.js} +22 -22
- package/chunks/{settings-35ADR3M3.js → settings-LKHHDZ22.js} +23 -23
- package/chunks/{shell-T7WI2AB4.js → shell-MBJWYI6H.js} +9 -9
- package/chunks/{skill-3J334MPG.js → skill-P47GW76V.js} +1 -1
- package/chunks/{skill-settings-VGNIJ4ZG.js → skill-settings-OOKHO2VX.js} +23 -23
- package/chunks/{spawnChannel-4GZBVZWY.js → spawnChannel-BCCGOYBS.js} +18 -18
- package/chunks/{standalone-update-3MMGTOKU.js → standalone-update-GFWLCIJA.js} +19 -19
- package/chunks/{startInteractiveUI-ACAXKMOW.js → startInteractiveUI-4U37J3U3.js} +227 -133
- package/chunks/supervisor-runner-JHRQ2FCR.js +24 -0
- package/chunks/{team-create-OL5P2TT3.js → team-create-V7TS7YKU.js} +9 -9
- package/chunks/{team-plan-approval-AVOMP63W.js → team-plan-approval-AZFDDNWX.js} +9 -9
- package/chunks/{terminal-image-renderer-YIP3F3SW.js → terminal-image-renderer-VKFNJYLX.js} +17 -17
- package/chunks/{theme-manager-WGBSECIC.js → theme-manager-NJUI6CSB.js} +19 -18
- package/chunks/{tool-result-media-43B2V5GK.js → tool-result-media-PNMKSY4I.js} +9 -9
- package/chunks/{tool-search-D4CTJZQZ.js → tool-search-G775WYWX.js} +1 -1
- package/chunks/{total-session-admission-5AVX4GWU.js → total-session-admission-EU3OANCQ.js} +19 -19
- package/chunks/{trustedFolders-A3EQT2KU.js → trustedFolders-SHDE6P4A.js} +18 -18
- package/chunks/{update-relaunch-ZFQ3KKWC.js → update-relaunch-WO4XSFPM.js} +5 -5
- package/chunks/{updateCheck-6WIKLTOC.js → updateCheck-VXMUIJQI.js} +19 -19
- package/chunks/{upload-config-CYAXYVA5.js → upload-config-W3I5KJ6Z.js} +6 -6
- package/chunks/{useAutoAcceptIndicator-WQCDJ3GF.js → useAutoAcceptIndicator-RVZ7NA4T.js} +27 -27
- package/chunks/{validateNonInterActiveAuth-YAKY5TIW.js → validateNonInterActiveAuth-Z6VWDBAU.js} +59 -57
- package/chunks/{version-2JL37LTE.js → version-BAIHAZMG.js} +1 -1
- package/chunks/{web-fetch-3RS7AC6O.js → web-fetch-UVYCFIDA.js} +1 -1
- package/chunks/{web-search-32AOEQHL.js → web-search-2HZLV7U7.js} +7 -7
- package/chunks/{workflow-N6HB4M7K.js → workflow-MH5F52EN.js} +10 -10
- package/chunks/{workspace-providers-status-ZWERGC3Q.js → workspace-providers-status-QGZHLTTK.js} +28 -28
- package/chunks/{workspace-registration-store-CCUU3WMT.js → workspace-registration-store-ZOS5W3KI.js} +1 -1
- package/chunks/{workspace-registry-HWKUKITM.js → workspace-registry-S5UI2GMP.js} +19 -19
- package/chunks/{workspace-runtime-coordinator-7I7MNHER.js → workspace-runtime-coordinator-3VT4F7QU.js} +19 -19
- package/chunks/{workspace-service-YYLFPQLW.js → workspace-service-FPIDJZQX.js} +27 -27
- package/chunks/{workspace-skills-status-ZW3EQWQ6.js → workspace-skills-status-3NDFOQ7X.js} +24 -24
- package/chunks/{workspace-trust-reconciler-G777OJEA.js → workspace-trust-reconciler-MIYMY5WA.js} +28 -28
- package/chunks/{write-file-IL2RFUQS.js → write-file-RLFFQHIF.js} +11 -11
- package/chunks/{zh-5CH77RQJ.js → zh-6TC2VRKR.js} +6 -2
- package/chunks/{zh-TW-7ASXOAM2.js → zh-TW-O23FCREL.js} +6 -2
- package/chunks/{zoom-image-K4VOMJ5H.js → zoom-image-TGJMTGFW.js} +1 -1
- package/cli.js +67 -14
- package/examples/starter/README.md +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/locales/ca.js +9 -2
- package/locales/de.js +9 -2
- package/locales/en.js +8 -2
- package/locales/fr.js +9 -2
- package/locales/ja.js +9 -2
- package/locales/pt.js +9 -2
- package/locales/ru.js +8 -2
- package/locales/zh-TW.js +6 -2
- package/locales/zh.js +6 -2
- package/package.json +2 -2
- package/release-notes.json +6 -0
- package/web-shell/assets/{abnfDiagram-VCTEODGH-BvS-3VoN.js → abnfDiagram-VCTEODGH-DvRQo4_D.js} +1 -1
- package/web-shell/assets/{arc-oqBoN1VH.js → arc-BdiXk54-.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BM3vyqvf.js → architectureDiagram-5GKGNRK7-ghhLp2fv.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-S94Kz5ys.js → blockDiagram-NRAW4CY4-D1Mnhplm.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-wFyXR3PR.js → c4Diagram-UCG6FXSJ-DUXySExV.js} +1 -1
- package/web-shell/assets/channel-Dh8nmHXD.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-BXpOLBvy.js → chunk-2Q5K7J3B-emXgDXOn.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-BWnRV7wD.js → chunk-5VM5RSS4-BAe_FRUg.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-NJG1XfCH.js → chunk-F27PBJKO-BFNyq3ws.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-D1MDovk_.js → chunk-G27WJ6UU-CsbX0ea1.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-Biw0OjWW.js → chunk-JWPE2WC7-BJsqlFOz.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-CWoypbS8.js → chunk-LCL6LL3I-BhkoNwBC.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-ZHBPGpI1.js → chunk-POPQ4Y6H-DDHhZe1n.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-BmhiTHIA.js → chunk-SVP7TREG-EMrfHdyh.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-Ctjd24gG.js → chunk-XXDRQBXY-B7vzOyPt.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CBwKEPG_.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CBwKEPG_.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-CEq9XMDz.js → cose-bilkent-JH36ORCC-C12GhrmQ.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-3oDMxKvV.js → cynefin-OW5HDTMX-B1PlOkHW.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-yGJvzOyq.js → cynefinDiagram-5FMLGOSQ-DqlIu1-5.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-aeyZyzOG.js → dagre-3AP2YEHR-jwha3DyI.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-BAAcB3gC.js → diagram-S7CK7UJ4-WJo7RwdL.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-B1_QGLRY.js → diagram-UQ7AKVKN-HNgwz504.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-BiBpaCap.js → diagram-VSXAHHWV-CnSKwatX.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-BUzzHihe.js → diagram-VX7I27RA-Bl2_wm4a.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-6JxaEF1R.js → diagram-Z3DM3KII-C-h8dvnx.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-D1-6Yjiz.js → ebnfDiagram-PWID7BFC-xPu9lOPC.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-DpcEbarm.js → erDiagram-SSCWMZ5O-lL-N4ln4.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-DlRnvlQ3.js → flowDiagram-A5DVABFB-DzBl_JGY.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-DABNtKOf.js → ganttDiagram-EL5Y4UJY-CaDwMjwZ.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-Bpq0tIqs.js → gitGraphDiagram-WWUBYQGX-DieKNHv6.js} +1 -1
- package/web-shell/assets/{index-Bm3BviDi.js → index-B8kdqIl5.js} +1 -1
- package/web-shell/assets/{index-Bjv2-WpQ.js → index-Dh9PvEFA.js} +3 -3
- package/web-shell/assets/{infoDiagram-RXCK75RN-D7e7VPRa.js → infoDiagram-RXCK75RN-DAavpH0B.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-BlOJr8s3.js → ishikawaDiagram-5VMMS53U-UPSFQgsr.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-BJOqE-Ku.js → journeyDiagram-EYS64GPL-tatKO6kZ.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-9Jp1HpGG.js → kanban-definition-3QL26DDD-DQVeuSX5.js} +1 -1
- package/web-shell/assets/{layout-BXGcWPmh.js → layout-CRt7C8gi.js} +1 -1
- package/web-shell/assets/{linear-Bb-3dQRR.js → linear-CtupaiXZ.js} +1 -1
- package/web-shell/assets/{mermaid.core-BQ9PYOoO.js → mermaid.core-Pq6FiKYN.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-BbRVue0a.js → mindmap-definition-FBJOCRG2-C3aBV9q4.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-CLALfcXo.js → pegDiagram-XKGWAZYB-DPC6gXxQ.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-BPa_8owh.js → pieDiagram-E7YTZNPT-Bnulswji.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-DTMPh3lk.js → quadrantDiagram-AXDQQJYC-CgN1vgtM.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-CTqUx3sg.js → railroadDiagram-O6MQD6OU-XdwHEwkM.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BMfxMhwk.js → requirementDiagram-EFPCY7ZU-BrptICwx.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-ciGAnluT.js → sankeyDiagram-P5KCCOFB-UVmNE7OK.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-D6eZeHbE.js → sequenceDiagram-WJ2MYXX4-CbLJdOim.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-DQPYzdVi.js → sizeCapture-X5ZJPWSS-DHeZCcKI.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-DkqKm2SL.js → stateDiagram-HBIQ2CUA-oYkdhZ_G.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DbneQiPu.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-C6XGW_tM.js → swimlanes-XN3QIQJK-CFK29lSu.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DxcqGRuT.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-CExT5Nqx.js → timeline-definition-24CTP7MA-BfAZG1ah.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-DYNNQGHI.js → vennDiagram-4TSXK5OY-x129VjoM.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-py3CuGuQ.js → wardleyDiagram-VM6X3IG4-B5aBvbvt.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-CI5rcSdT.js → xychartDiagram-S5SC5T6Z-DLbk6hf2.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/web-shell/assets/channel-QDRh2gO3.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-CjY5Knq0.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-CjY5Knq0.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BDHScdF2.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-CftAjGJO.js +0 -8
|
@@ -0,0 +1,880 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-S2467S6L.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
+
|
|
10
|
+
// packages/cli/src/agent-view/protocol.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var AGENT_VIEW_PROTOCOL_VERSION = 1;
|
|
13
|
+
|
|
14
|
+
// packages/cli/src/agent-view/terminal-bridge.ts
|
|
15
|
+
init_esbuild_shims();
|
|
16
|
+
async function bridgeAgentViewTerminal(options) {
|
|
17
|
+
const disposables = [];
|
|
18
|
+
const bridgeAbort = new AbortController();
|
|
19
|
+
const onDetach = /* @__PURE__ */ __name(() => bridgeAbort.abort(), "onDetach");
|
|
20
|
+
const onStdoutError = /* @__PURE__ */ __name(() => bridgeAbort.abort(), "onStdoutError");
|
|
21
|
+
let outputWrites = Promise.resolve();
|
|
22
|
+
try {
|
|
23
|
+
if (options.detachSignal?.aborted) {
|
|
24
|
+
bridgeAbort.abort();
|
|
25
|
+
} else {
|
|
26
|
+
options.detachSignal?.addEventListener("abort", onDetach, { once: true });
|
|
27
|
+
}
|
|
28
|
+
options.stdout.on("error", onStdoutError);
|
|
29
|
+
const dataDisposable = options.pty.onData((data) => {
|
|
30
|
+
if (bridgeAbort.signal.aborted) return;
|
|
31
|
+
outputWrites = outputWrites.then(
|
|
32
|
+
() => writeWithBackpressure(
|
|
33
|
+
options.stdout,
|
|
34
|
+
options.pty,
|
|
35
|
+
toBuffer(data),
|
|
36
|
+
bridgeAbort.signal
|
|
37
|
+
)
|
|
38
|
+
).catch(() => {
|
|
39
|
+
bridgeAbort.abort();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
if (dataDisposable) {
|
|
43
|
+
disposables.push(dataDisposable);
|
|
44
|
+
}
|
|
45
|
+
const resizeDisposable = options.onResize?.((size) => {
|
|
46
|
+
if (bridgeAbort.signal.aborted) return;
|
|
47
|
+
void Promise.resolve(options.pty.resize?.(size)).catch(() => {
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
if (resizeDisposable) {
|
|
51
|
+
disposables.push(resizeDisposable);
|
|
52
|
+
}
|
|
53
|
+
const reason = await pumpInputToPty(
|
|
54
|
+
options.stdin,
|
|
55
|
+
options.pty,
|
|
56
|
+
bridgeAbort.signal
|
|
57
|
+
);
|
|
58
|
+
await outputWrites;
|
|
59
|
+
return { reason };
|
|
60
|
+
} finally {
|
|
61
|
+
bridgeAbort.abort();
|
|
62
|
+
await outputWrites;
|
|
63
|
+
options.detachSignal?.removeEventListener("abort", onDetach);
|
|
64
|
+
options.stdout.removeListener("error", onStdoutError);
|
|
65
|
+
for (const disposable of disposables.splice(0)) {
|
|
66
|
+
try {
|
|
67
|
+
disposable.dispose();
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
__name(bridgeAgentViewTerminal, "bridgeAgentViewTerminal");
|
|
74
|
+
async function pumpInputToPty(stdin, pty, detachSignal) {
|
|
75
|
+
const iterator = createInputIterator(stdin);
|
|
76
|
+
let detached = false;
|
|
77
|
+
try {
|
|
78
|
+
while (!detachSignal?.aborted) {
|
|
79
|
+
const next = await nextInputChunk(iterator, detachSignal);
|
|
80
|
+
if (next === "detached") {
|
|
81
|
+
detached = true;
|
|
82
|
+
return "detached";
|
|
83
|
+
}
|
|
84
|
+
if (next.done) {
|
|
85
|
+
return "stdin-ended";
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
await pty.write(toBuffer(next.value));
|
|
89
|
+
} catch {
|
|
90
|
+
detached = true;
|
|
91
|
+
return "detached";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
detached = true;
|
|
95
|
+
return "detached";
|
|
96
|
+
} finally {
|
|
97
|
+
const returned = iterator.return?.();
|
|
98
|
+
if (detached) {
|
|
99
|
+
void returned?.catch(() => {
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
await returned;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
__name(pumpInputToPty, "pumpInputToPty");
|
|
107
|
+
function createInputIterator(stdin) {
|
|
108
|
+
const readableIterator = stdin.iterator;
|
|
109
|
+
if (typeof readableIterator === "function") {
|
|
110
|
+
return readableIterator.call(stdin, { destroyOnReturn: false });
|
|
111
|
+
}
|
|
112
|
+
return stdin[Symbol.asyncIterator]();
|
|
113
|
+
}
|
|
114
|
+
__name(createInputIterator, "createInputIterator");
|
|
115
|
+
async function nextInputChunk(iterator, detachSignal) {
|
|
116
|
+
const next = iterator.next();
|
|
117
|
+
if (!detachSignal) return next;
|
|
118
|
+
if (detachSignal.aborted) return "detached";
|
|
119
|
+
return new Promise((resolve, reject) => {
|
|
120
|
+
const onAbort = /* @__PURE__ */ __name(() => {
|
|
121
|
+
resolve("detached");
|
|
122
|
+
}, "onAbort");
|
|
123
|
+
detachSignal.addEventListener("abort", onAbort, {
|
|
124
|
+
once: true
|
|
125
|
+
});
|
|
126
|
+
void next.then(
|
|
127
|
+
(value) => {
|
|
128
|
+
detachSignal.removeEventListener("abort", onAbort);
|
|
129
|
+
resolve(value);
|
|
130
|
+
},
|
|
131
|
+
(error) => {
|
|
132
|
+
detachSignal.removeEventListener("abort", onAbort);
|
|
133
|
+
reject(error);
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
__name(nextInputChunk, "nextInputChunk");
|
|
139
|
+
function toBuffer(data) {
|
|
140
|
+
if (Buffer.isBuffer(data)) return data;
|
|
141
|
+
if (typeof data === "string") return Buffer.from(data, "utf8");
|
|
142
|
+
return Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
143
|
+
}
|
|
144
|
+
__name(toBuffer, "toBuffer");
|
|
145
|
+
function writeWithBackpressure(stdout, pty, data, signal) {
|
|
146
|
+
return new Promise((resolve, reject) => {
|
|
147
|
+
let paused = false;
|
|
148
|
+
let settled = false;
|
|
149
|
+
const finish = /* @__PURE__ */ __name((error) => {
|
|
150
|
+
if (settled) return;
|
|
151
|
+
settled = true;
|
|
152
|
+
if (paused) pty.resume?.();
|
|
153
|
+
if (error) reject(error);
|
|
154
|
+
else resolve();
|
|
155
|
+
}, "finish");
|
|
156
|
+
const canContinue = stdout.write(data, (error) => {
|
|
157
|
+
if (error) {
|
|
158
|
+
finish(error);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (paused && stdout.writableNeedDrain && !signal.aborted) {
|
|
162
|
+
const onDrain = /* @__PURE__ */ __name(() => {
|
|
163
|
+
stdout.removeListener("drain", onDrain);
|
|
164
|
+
signal.removeEventListener("abort", onAbort);
|
|
165
|
+
finish();
|
|
166
|
+
}, "onDrain");
|
|
167
|
+
const onAbort = /* @__PURE__ */ __name(() => {
|
|
168
|
+
stdout.removeListener("drain", onDrain);
|
|
169
|
+
finish();
|
|
170
|
+
}, "onAbort");
|
|
171
|
+
stdout.once("drain", onDrain);
|
|
172
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
173
|
+
} else {
|
|
174
|
+
finish();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
if (!canContinue && !signal.aborted) {
|
|
178
|
+
paused = true;
|
|
179
|
+
pty.pause?.();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
__name(writeWithBackpressure, "writeWithBackpressure");
|
|
184
|
+
|
|
185
|
+
// packages/cli/src/agent-view/supervisor-client.ts
|
|
186
|
+
init_esbuild_shims();
|
|
187
|
+
import * as net from "node:net";
|
|
188
|
+
var AgentViewSupervisorClientError = class extends Error {
|
|
189
|
+
constructor(message, code) {
|
|
190
|
+
super(message);
|
|
191
|
+
this.code = code;
|
|
192
|
+
this.name = "AgentViewSupervisorClientError";
|
|
193
|
+
}
|
|
194
|
+
static {
|
|
195
|
+
__name(this, "AgentViewSupervisorClientError");
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
async function requestAgentViewSupervisor(socketPath, request, options = {}) {
|
|
199
|
+
const timeoutMs = options.timeoutMs ?? 5e3;
|
|
200
|
+
const requestWithProtocol = {
|
|
201
|
+
...request,
|
|
202
|
+
protocolVersion: request.protocolVersion ?? AGENT_VIEW_PROTOCOL_VERSION
|
|
203
|
+
};
|
|
204
|
+
if (options.authToken && requestWithProtocol.authToken === void 0) {
|
|
205
|
+
requestWithProtocol.authToken = options.authToken;
|
|
206
|
+
}
|
|
207
|
+
return new Promise((resolve, reject) => {
|
|
208
|
+
const socket = net.createConnection(socketPath);
|
|
209
|
+
let buffer = "";
|
|
210
|
+
let settled = false;
|
|
211
|
+
const timeout = setTimeout(() => {
|
|
212
|
+
finish(
|
|
213
|
+
void 0,
|
|
214
|
+
new AgentViewSupervisorClientError(
|
|
215
|
+
"Timed out waiting for Agent View supervisor response.",
|
|
216
|
+
"timeout"
|
|
217
|
+
)
|
|
218
|
+
);
|
|
219
|
+
socket.destroy();
|
|
220
|
+
}, timeoutMs);
|
|
221
|
+
const finish = /* @__PURE__ */ __name((response, error) => {
|
|
222
|
+
if (settled) return;
|
|
223
|
+
settled = true;
|
|
224
|
+
clearTimeout(timeout);
|
|
225
|
+
socket.removeAllListeners();
|
|
226
|
+
if (error) {
|
|
227
|
+
reject(error);
|
|
228
|
+
} else {
|
|
229
|
+
resolve(response);
|
|
230
|
+
}
|
|
231
|
+
}, "finish");
|
|
232
|
+
socket.setEncoding("utf8");
|
|
233
|
+
socket.on("connect", () => {
|
|
234
|
+
socket.write(`${JSON.stringify(requestWithProtocol)}
|
|
235
|
+
`);
|
|
236
|
+
});
|
|
237
|
+
socket.on("data", (chunk) => {
|
|
238
|
+
buffer += chunk;
|
|
239
|
+
const newline = buffer.indexOf("\n");
|
|
240
|
+
if (newline === -1) return;
|
|
241
|
+
const line = buffer.slice(0, newline);
|
|
242
|
+
try {
|
|
243
|
+
finish(parseSupervisorResponse(line));
|
|
244
|
+
} catch (error) {
|
|
245
|
+
finish(void 0, error);
|
|
246
|
+
} finally {
|
|
247
|
+
socket.end();
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
socket.on("error", (error) => finish(void 0, error));
|
|
251
|
+
socket.on("end", () => {
|
|
252
|
+
finish(
|
|
253
|
+
void 0,
|
|
254
|
+
new AgentViewSupervisorClientError(
|
|
255
|
+
"Agent View supervisor closed before sending a response.",
|
|
256
|
+
"closed"
|
|
257
|
+
)
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
__name(requestAgentViewSupervisor, "requestAgentViewSupervisor");
|
|
263
|
+
async function callAgentViewSupervisor(socketPath, op, ...args) {
|
|
264
|
+
const params = args[0];
|
|
265
|
+
const options = args[1];
|
|
266
|
+
const response = await requestAgentViewSupervisor(
|
|
267
|
+
socketPath,
|
|
268
|
+
{
|
|
269
|
+
id: createRequestId(),
|
|
270
|
+
op,
|
|
271
|
+
...params ? { params } : {}
|
|
272
|
+
},
|
|
273
|
+
options
|
|
274
|
+
);
|
|
275
|
+
if (response.ok) return response.result;
|
|
276
|
+
throw new AgentViewSupervisorClientError(
|
|
277
|
+
response.error.message,
|
|
278
|
+
response.error.code
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
__name(callAgentViewSupervisor, "callAgentViewSupervisor");
|
|
282
|
+
async function watchAgentViewOwner(socketPath, ownerId, options = {}) {
|
|
283
|
+
const socket = net.createConnection(socketPath);
|
|
284
|
+
const request = {
|
|
285
|
+
id: createRequestId(),
|
|
286
|
+
protocolVersion: AGENT_VIEW_PROTOCOL_VERSION,
|
|
287
|
+
...options.authToken ? { authToken: options.authToken } : {},
|
|
288
|
+
op: "watchOwner",
|
|
289
|
+
params: { ownerId }
|
|
290
|
+
};
|
|
291
|
+
try {
|
|
292
|
+
const { response } = await openAttachStream(socket, request, options);
|
|
293
|
+
if (!response.ok) {
|
|
294
|
+
throw new AgentViewSupervisorClientError(
|
|
295
|
+
response.error.message,
|
|
296
|
+
response.error.code
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
socket.on("error", () => {
|
|
300
|
+
});
|
|
301
|
+
return { dispose: /* @__PURE__ */ __name(() => socket.destroy(), "dispose") };
|
|
302
|
+
} catch (error) {
|
|
303
|
+
socket.destroy();
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
__name(watchAgentViewOwner, "watchAgentViewOwner");
|
|
308
|
+
async function attachAgentViewSupervisorTerminal(socketPath, sessionId, options = {}) {
|
|
309
|
+
const socket = net.createConnection(socketPath);
|
|
310
|
+
const stdin = options.stdin ?? process.stdin;
|
|
311
|
+
const stdout = options.stdout ?? process.stdout;
|
|
312
|
+
const request = {
|
|
313
|
+
id: createRequestId(),
|
|
314
|
+
protocolVersion: AGENT_VIEW_PROTOCOL_VERSION,
|
|
315
|
+
...options.authToken ? { authToken: options.authToken } : {},
|
|
316
|
+
op: "attachStream",
|
|
317
|
+
params: { sessionId }
|
|
318
|
+
};
|
|
319
|
+
const onDetach = /* @__PURE__ */ __name(() => socket.destroy(), "onDetach");
|
|
320
|
+
if (options.detachSignal?.aborted) {
|
|
321
|
+
socket.destroy();
|
|
322
|
+
return { reason: "detached" };
|
|
323
|
+
}
|
|
324
|
+
options.detachSignal?.addEventListener("abort", onDetach, { once: true });
|
|
325
|
+
try {
|
|
326
|
+
const { response, leftover } = await openAttachStream(socket, request, {
|
|
327
|
+
timeoutMs: options.timeoutMs ?? 3e4
|
|
328
|
+
});
|
|
329
|
+
if (!response.ok) {
|
|
330
|
+
throw new AgentViewSupervisorClientError(
|
|
331
|
+
response.error.message,
|
|
332
|
+
response.error.code
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
const controller = new AbortController();
|
|
336
|
+
socket.once("close", () => controller.abort());
|
|
337
|
+
socket.on("error", () => {
|
|
338
|
+
});
|
|
339
|
+
if (leftover.length > 0) {
|
|
340
|
+
socket.pause();
|
|
341
|
+
await writeToWritable(stdout, leftover);
|
|
342
|
+
}
|
|
343
|
+
options.onAttached?.();
|
|
344
|
+
const restoreRawMode = setRawMode(stdin, options.rawMode ?? true);
|
|
345
|
+
try {
|
|
346
|
+
return await bridgeAgentViewTerminal({
|
|
347
|
+
stdin,
|
|
348
|
+
stdout,
|
|
349
|
+
pty: {
|
|
350
|
+
write(data) {
|
|
351
|
+
socket.write(data);
|
|
352
|
+
},
|
|
353
|
+
onData(callback) {
|
|
354
|
+
socket.on("data", callback);
|
|
355
|
+
socket.resume();
|
|
356
|
+
return {
|
|
357
|
+
dispose: /* @__PURE__ */ __name(() => {
|
|
358
|
+
socket.off("data", callback);
|
|
359
|
+
}, "dispose")
|
|
360
|
+
};
|
|
361
|
+
},
|
|
362
|
+
pause() {
|
|
363
|
+
socket.pause();
|
|
364
|
+
},
|
|
365
|
+
resume() {
|
|
366
|
+
socket.resume();
|
|
367
|
+
},
|
|
368
|
+
resize: /* @__PURE__ */ __name((size) => {
|
|
369
|
+
void callAgentViewSupervisor(
|
|
370
|
+
socketPath,
|
|
371
|
+
"resize",
|
|
372
|
+
{
|
|
373
|
+
sessionId,
|
|
374
|
+
columns: size.columns,
|
|
375
|
+
rows: size.rows
|
|
376
|
+
},
|
|
377
|
+
options.authToken ? { authToken: options.authToken } : void 0
|
|
378
|
+
).catch(() => {
|
|
379
|
+
});
|
|
380
|
+
}, "resize")
|
|
381
|
+
},
|
|
382
|
+
detachSignal: controller.signal,
|
|
383
|
+
onResize: createResizeSource(stdout)
|
|
384
|
+
});
|
|
385
|
+
} finally {
|
|
386
|
+
restoreRawMode();
|
|
387
|
+
}
|
|
388
|
+
} finally {
|
|
389
|
+
options.detachSignal?.removeEventListener("abort", onDetach);
|
|
390
|
+
socket.destroy();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
__name(attachAgentViewSupervisorTerminal, "attachAgentViewSupervisorTerminal");
|
|
394
|
+
function subscribeAgentViewSupervisor(socketPath, onEvent, options = {}) {
|
|
395
|
+
const socket = net.createConnection(socketPath);
|
|
396
|
+
let buffer = "";
|
|
397
|
+
let subscribed = false;
|
|
398
|
+
let disposed = false;
|
|
399
|
+
let errorNotified = false;
|
|
400
|
+
const request = {
|
|
401
|
+
id: createRequestId(),
|
|
402
|
+
protocolVersion: AGENT_VIEW_PROTOCOL_VERSION,
|
|
403
|
+
...options.authToken ? { authToken: options.authToken } : {},
|
|
404
|
+
op: "subscribe"
|
|
405
|
+
};
|
|
406
|
+
const handshakeTimeout = setTimeout(() => {
|
|
407
|
+
notifySubscriptionError(
|
|
408
|
+
new AgentViewSupervisorClientError(
|
|
409
|
+
"Timed out waiting for Agent View subscription handshake.",
|
|
410
|
+
"timeout"
|
|
411
|
+
)
|
|
412
|
+
);
|
|
413
|
+
socket.destroy();
|
|
414
|
+
}, options.timeoutMs ?? 5e3);
|
|
415
|
+
socket.setEncoding("utf8");
|
|
416
|
+
socket.on("connect", () => {
|
|
417
|
+
socket.write(`${JSON.stringify(request)}
|
|
418
|
+
`);
|
|
419
|
+
});
|
|
420
|
+
socket.on("data", (chunk) => {
|
|
421
|
+
buffer += chunk;
|
|
422
|
+
while (true) {
|
|
423
|
+
const newline = buffer.indexOf("\n");
|
|
424
|
+
if (newline === -1) return;
|
|
425
|
+
const line = buffer.slice(0, newline);
|
|
426
|
+
buffer = buffer.slice(newline + 1);
|
|
427
|
+
if (!line) continue;
|
|
428
|
+
if (!subscribed) {
|
|
429
|
+
let response;
|
|
430
|
+
try {
|
|
431
|
+
response = parseSupervisorResponse(line);
|
|
432
|
+
} catch (parseError) {
|
|
433
|
+
notifySubscriptionError(
|
|
434
|
+
new AgentViewSupervisorClientError(
|
|
435
|
+
`Invalid subscription response: ${parseError instanceof Error ? parseError.message : String(parseError)}`,
|
|
436
|
+
"invalid_response"
|
|
437
|
+
)
|
|
438
|
+
);
|
|
439
|
+
socket.destroy();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (!response.ok) {
|
|
443
|
+
notifySubscriptionError(
|
|
444
|
+
new AgentViewSupervisorClientError(
|
|
445
|
+
response.error.message,
|
|
446
|
+
response.error.code
|
|
447
|
+
)
|
|
448
|
+
);
|
|
449
|
+
socket.destroy();
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
subscribed = true;
|
|
453
|
+
clearTimeout(handshakeTimeout);
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
let event;
|
|
457
|
+
try {
|
|
458
|
+
event = parseSupervisorEvent(line);
|
|
459
|
+
} catch {
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
if (event) {
|
|
463
|
+
try {
|
|
464
|
+
onEvent(event);
|
|
465
|
+
} catch {
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
socket.on("error", (error) => notifySubscriptionError(error));
|
|
471
|
+
socket.on("close", () => {
|
|
472
|
+
clearTimeout(handshakeTimeout);
|
|
473
|
+
notifySubscriptionError(
|
|
474
|
+
new AgentViewSupervisorClientError(
|
|
475
|
+
"Agent View supervisor subscription closed.",
|
|
476
|
+
"closed"
|
|
477
|
+
)
|
|
478
|
+
);
|
|
479
|
+
});
|
|
480
|
+
return {
|
|
481
|
+
dispose() {
|
|
482
|
+
disposed = true;
|
|
483
|
+
clearTimeout(handshakeTimeout);
|
|
484
|
+
socket.destroy();
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
function notifySubscriptionError(error) {
|
|
488
|
+
if (disposed || errorNotified) return;
|
|
489
|
+
errorNotified = true;
|
|
490
|
+
options.onError?.(error);
|
|
491
|
+
}
|
|
492
|
+
__name(notifySubscriptionError, "notifySubscriptionError");
|
|
493
|
+
}
|
|
494
|
+
__name(subscribeAgentViewSupervisor, "subscribeAgentViewSupervisor");
|
|
495
|
+
function createRequestId() {
|
|
496
|
+
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
497
|
+
}
|
|
498
|
+
__name(createRequestId, "createRequestId");
|
|
499
|
+
function openAttachStream(socket, request, options = {}) {
|
|
500
|
+
return new Promise((resolve, reject) => {
|
|
501
|
+
const chunks = [];
|
|
502
|
+
let settled = false;
|
|
503
|
+
const timeout = setTimeout(() => {
|
|
504
|
+
finishWithError(
|
|
505
|
+
new AgentViewSupervisorClientError(
|
|
506
|
+
"Timed out waiting for Agent View attach response.",
|
|
507
|
+
"timeout"
|
|
508
|
+
)
|
|
509
|
+
);
|
|
510
|
+
socket.destroy();
|
|
511
|
+
}, options.timeoutMs ?? 3e4);
|
|
512
|
+
timeout.unref?.();
|
|
513
|
+
const finish = /* @__PURE__ */ __name((result, error) => {
|
|
514
|
+
if (settled) return;
|
|
515
|
+
settled = true;
|
|
516
|
+
socket.off("connect", onConnect);
|
|
517
|
+
socket.off("data", onData);
|
|
518
|
+
socket.off("error", onError);
|
|
519
|
+
socket.off("end", onEnd);
|
|
520
|
+
clearTimeout(timeout);
|
|
521
|
+
if (error) {
|
|
522
|
+
reject(error);
|
|
523
|
+
} else {
|
|
524
|
+
resolve(result);
|
|
525
|
+
}
|
|
526
|
+
}, "finish");
|
|
527
|
+
const onConnect = /* @__PURE__ */ __name(() => {
|
|
528
|
+
socket.write(`${JSON.stringify(request)}
|
|
529
|
+
`);
|
|
530
|
+
}, "onConnect");
|
|
531
|
+
const onData = /* @__PURE__ */ __name((chunk) => {
|
|
532
|
+
chunks.push(chunk);
|
|
533
|
+
const buffer = Buffer.concat(chunks);
|
|
534
|
+
const newline = buffer.indexOf(10);
|
|
535
|
+
if (newline === -1) return;
|
|
536
|
+
try {
|
|
537
|
+
finish({
|
|
538
|
+
response: parseSupervisorResponse(
|
|
539
|
+
buffer.subarray(0, newline).toString("utf8")
|
|
540
|
+
),
|
|
541
|
+
leftover: buffer.subarray(newline + 1)
|
|
542
|
+
});
|
|
543
|
+
} catch (error) {
|
|
544
|
+
finishWithError(error);
|
|
545
|
+
}
|
|
546
|
+
}, "onData");
|
|
547
|
+
const onError = /* @__PURE__ */ __name((error) => {
|
|
548
|
+
finishWithError(error);
|
|
549
|
+
}, "onError");
|
|
550
|
+
const onEnd = /* @__PURE__ */ __name(() => {
|
|
551
|
+
finishWithError(
|
|
552
|
+
new AgentViewSupervisorClientError(
|
|
553
|
+
"Agent View supervisor closed before attach handshake.",
|
|
554
|
+
"closed"
|
|
555
|
+
)
|
|
556
|
+
);
|
|
557
|
+
}, "onEnd");
|
|
558
|
+
const finishWithError = /* @__PURE__ */ __name((error) => {
|
|
559
|
+
finish(
|
|
560
|
+
{
|
|
561
|
+
response: {
|
|
562
|
+
id: request.id,
|
|
563
|
+
ok: false,
|
|
564
|
+
error: { code: "error", message: error.message }
|
|
565
|
+
},
|
|
566
|
+
leftover: Buffer.alloc(0)
|
|
567
|
+
},
|
|
568
|
+
error
|
|
569
|
+
);
|
|
570
|
+
}, "finishWithError");
|
|
571
|
+
socket.on("connect", onConnect);
|
|
572
|
+
socket.on("data", onData);
|
|
573
|
+
socket.on("error", onError);
|
|
574
|
+
socket.on("end", onEnd);
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
__name(openAttachStream, "openAttachStream");
|
|
578
|
+
function setRawMode(stdin, enabled) {
|
|
579
|
+
const maybeTty = stdin;
|
|
580
|
+
if (!enabled || !maybeTty.isTTY || typeof maybeTty.setRawMode !== "function") {
|
|
581
|
+
return () => {
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
maybeTty.setRawMode(true);
|
|
585
|
+
return () => maybeTty.setRawMode?.(false);
|
|
586
|
+
}
|
|
587
|
+
__name(setRawMode, "setRawMode");
|
|
588
|
+
function createResizeSource(stdout) {
|
|
589
|
+
const maybeTty = stdout;
|
|
590
|
+
if (typeof maybeTty.on !== "function" || typeof maybeTty.off !== "function") {
|
|
591
|
+
return void 0;
|
|
592
|
+
}
|
|
593
|
+
return (callback) => {
|
|
594
|
+
const emitSize = /* @__PURE__ */ __name(() => {
|
|
595
|
+
const columns = maybeTty.columns;
|
|
596
|
+
const rows = maybeTty.rows;
|
|
597
|
+
if (Number.isInteger(columns) && Number.isInteger(rows)) {
|
|
598
|
+
callback({ columns, rows });
|
|
599
|
+
}
|
|
600
|
+
}, "emitSize");
|
|
601
|
+
maybeTty.on?.("resize", emitSize);
|
|
602
|
+
emitSize();
|
|
603
|
+
return {
|
|
604
|
+
dispose: /* @__PURE__ */ __name(() => {
|
|
605
|
+
maybeTty.off?.("resize", emitSize);
|
|
606
|
+
}, "dispose")
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
__name(createResizeSource, "createResizeSource");
|
|
611
|
+
function writeToWritable(stdout, data) {
|
|
612
|
+
return new Promise((resolve, reject) => {
|
|
613
|
+
stdout.write(data, (error) => {
|
|
614
|
+
if (error) {
|
|
615
|
+
reject(error);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
resolve();
|
|
619
|
+
});
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
__name(writeToWritable, "writeToWritable");
|
|
623
|
+
function parseSupervisorResponse(line) {
|
|
624
|
+
const parsed = JSON.parse(line);
|
|
625
|
+
if (!isRecord(parsed) || typeof parsed["id"] !== "string") {
|
|
626
|
+
throw new AgentViewSupervisorClientError(
|
|
627
|
+
"Invalid Agent View supervisor response.",
|
|
628
|
+
"invalid_response"
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
if (parsed["ok"] === true) {
|
|
632
|
+
return {
|
|
633
|
+
id: parsed["id"],
|
|
634
|
+
ok: true,
|
|
635
|
+
result: parsed["result"]
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
if (parsed["ok"] === false && isRecord(parsed["error"]) && typeof parsed["error"]["code"] === "string" && typeof parsed["error"]["message"] === "string") {
|
|
639
|
+
return {
|
|
640
|
+
id: parsed["id"],
|
|
641
|
+
ok: false,
|
|
642
|
+
error: {
|
|
643
|
+
code: parsed["error"]["code"],
|
|
644
|
+
message: parsed["error"]["message"]
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
throw new AgentViewSupervisorClientError(
|
|
649
|
+
"Invalid Agent View supervisor response.",
|
|
650
|
+
"invalid_response"
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
__name(parseSupervisorResponse, "parseSupervisorResponse");
|
|
654
|
+
function parseSupervisorEvent(line) {
|
|
655
|
+
const parsed = JSON.parse(line);
|
|
656
|
+
if (!isRecord(parsed) || parsed["type"] !== "changed") return void 0;
|
|
657
|
+
const at = typeof parsed["at"] === "string" ? parsed["at"] : void 0;
|
|
658
|
+
if (!at) return void 0;
|
|
659
|
+
return { type: "changed", at };
|
|
660
|
+
}
|
|
661
|
+
__name(parseSupervisorEvent, "parseSupervisorEvent");
|
|
662
|
+
function isRecord(value) {
|
|
663
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
664
|
+
}
|
|
665
|
+
__name(isRecord, "isRecord");
|
|
666
|
+
|
|
667
|
+
// packages/cli/src/agent-view/worker-sideband.ts
|
|
668
|
+
init_esbuild_shims();
|
|
669
|
+
import { randomUUID } from "node:crypto";
|
|
670
|
+
var O1CODE_AGENT_VIEW_WORKER = "O1CODE_AGENT_VIEW_WORKER";
|
|
671
|
+
var O1CODE_AGENT_VIEW_SESSION_ID = "O1CODE_AGENT_VIEW_SESSION_ID";
|
|
672
|
+
var O1CODE_AGENT_VIEW_SIDEBAND = "O1CODE_AGENT_VIEW_SIDEBAND";
|
|
673
|
+
var O1CODE_AGENT_VIEW_TOKEN = "O1CODE_AGENT_VIEW_TOKEN";
|
|
674
|
+
var O1CODE_AGENT_VIEW_ACTIVE_CWD = "O1CODE_AGENT_VIEW_ACTIVE_CWD";
|
|
675
|
+
var AGENT_VIEW_WORKER_ENV_KEYS = [
|
|
676
|
+
O1CODE_AGENT_VIEW_WORKER,
|
|
677
|
+
O1CODE_AGENT_VIEW_SESSION_ID,
|
|
678
|
+
O1CODE_AGENT_VIEW_SIDEBAND,
|
|
679
|
+
O1CODE_AGENT_VIEW_TOKEN,
|
|
680
|
+
O1CODE_AGENT_VIEW_ACTIVE_CWD
|
|
681
|
+
];
|
|
682
|
+
async function requestAgentSessionDashboard(env = process.env) {
|
|
683
|
+
if (!readAgentViewWorkerSidebandEnv(env)) return false;
|
|
684
|
+
await sendAgentViewWorkerEvent(
|
|
685
|
+
{ type: "dashboard", requestId: randomUUID() },
|
|
686
|
+
env
|
|
687
|
+
);
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
__name(requestAgentSessionDashboard, "requestAgentSessionDashboard");
|
|
691
|
+
var lastStateReportKeys = /* @__PURE__ */ new Map();
|
|
692
|
+
var stateReportChains = /* @__PURE__ */ new Map();
|
|
693
|
+
var pendingStateReports = /* @__PURE__ */ new Map();
|
|
694
|
+
var activePrompts = /* @__PURE__ */ new Map();
|
|
695
|
+
function createAgentViewWorkerSidebandEnv(config) {
|
|
696
|
+
return {
|
|
697
|
+
[O1CODE_AGENT_VIEW_WORKER]: "1",
|
|
698
|
+
[O1CODE_AGENT_VIEW_SESSION_ID]: config.sessionId,
|
|
699
|
+
[O1CODE_AGENT_VIEW_SIDEBAND]: config.sidebandEndpoint,
|
|
700
|
+
[O1CODE_AGENT_VIEW_TOKEN]: config.token,
|
|
701
|
+
[O1CODE_AGENT_VIEW_ACTIVE_CWD]: config.activeCwd
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
__name(createAgentViewWorkerSidebandEnv, "createAgentViewWorkerSidebandEnv");
|
|
705
|
+
function isAgentViewWorkerEnv(env = process.env) {
|
|
706
|
+
return env[O1CODE_AGENT_VIEW_WORKER] === "1";
|
|
707
|
+
}
|
|
708
|
+
__name(isAgentViewWorkerEnv, "isAgentViewWorkerEnv");
|
|
709
|
+
function readAgentViewWorkerSidebandEnv(env = process.env) {
|
|
710
|
+
if (!isAgentViewWorkerEnv(env)) {
|
|
711
|
+
return void 0;
|
|
712
|
+
}
|
|
713
|
+
const sessionId = env[O1CODE_AGENT_VIEW_SESSION_ID];
|
|
714
|
+
const sidebandEndpoint = env[O1CODE_AGENT_VIEW_SIDEBAND];
|
|
715
|
+
const token = env[O1CODE_AGENT_VIEW_TOKEN];
|
|
716
|
+
const activeCwd = env[O1CODE_AGENT_VIEW_ACTIVE_CWD];
|
|
717
|
+
if (!sessionId || !sidebandEndpoint || !token || !activeCwd) {
|
|
718
|
+
return void 0;
|
|
719
|
+
}
|
|
720
|
+
return {
|
|
721
|
+
sessionId,
|
|
722
|
+
sidebandEndpoint,
|
|
723
|
+
token,
|
|
724
|
+
activeCwd
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
__name(readAgentViewWorkerSidebandEnv, "readAgentViewWorkerSidebandEnv");
|
|
728
|
+
async function sendAgentViewWorkerEvent(event, env = process.env) {
|
|
729
|
+
const sideband = readAgentViewWorkerSidebandEnv(env);
|
|
730
|
+
if (!sideband) return void 0;
|
|
731
|
+
return callAgentViewSupervisor(sideband.sidebandEndpoint, "workerEvent", {
|
|
732
|
+
...event,
|
|
733
|
+
// Stamp at emit time so the dequeue ordering guard (event.at vs
|
|
734
|
+
// lastQueuedPromptAt) protects in production — worker events are
|
|
735
|
+
// otherwise built without an `at` field.
|
|
736
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
737
|
+
sessionId: sideband.sessionId,
|
|
738
|
+
token: sideband.token
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
__name(sendAgentViewWorkerEvent, "sendAgentViewWorkerEvent");
|
|
742
|
+
async function readAgentViewWorkerRedrawEvents(env = process.env) {
|
|
743
|
+
const sideband = readAgentViewWorkerSidebandEnv(env);
|
|
744
|
+
if (!sideband) return [];
|
|
745
|
+
const result = await callAgentViewSupervisor(
|
|
746
|
+
sideband.sidebandEndpoint,
|
|
747
|
+
"workerControl",
|
|
748
|
+
{
|
|
749
|
+
sessionId: sideband.sessionId,
|
|
750
|
+
token: sideband.token,
|
|
751
|
+
redrawOnly: true
|
|
752
|
+
},
|
|
753
|
+
{ timeoutMs: 1e3 }
|
|
754
|
+
);
|
|
755
|
+
if (!isRecord2(result) || !Array.isArray(result["events"])) return [];
|
|
756
|
+
return result["events"].filter(isAgentViewWorkerControlEvent).filter(
|
|
757
|
+
(event) => event.type === "redraw"
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
__name(readAgentViewWorkerRedrawEvents, "readAgentViewWorkerRedrawEvents");
|
|
761
|
+
async function reportAgentViewWorkerState(report, env = process.env) {
|
|
762
|
+
const sideband = readAgentViewWorkerSidebandEnv(env);
|
|
763
|
+
if (!sideband) return;
|
|
764
|
+
const activePrompt = activePrompts.get(sideband.sessionId);
|
|
765
|
+
if (activePrompt && activePrompt.phase === "received" && report.sessionState === "idle") {
|
|
766
|
+
activePrompt.phase = "ready";
|
|
767
|
+
}
|
|
768
|
+
const promptId = activePrompt && (activePrompt.phase === "accepted" || activePrompt.phase === "ready" && report.sessionState === "working") ? activePrompt.promptId : void 0;
|
|
769
|
+
if (promptId && activePrompt?.phase === "ready") {
|
|
770
|
+
activePrompt.phase = "accepted";
|
|
771
|
+
}
|
|
772
|
+
if (promptId) {
|
|
773
|
+
pendingStateReports.set(sideband.sessionId, report);
|
|
774
|
+
}
|
|
775
|
+
const event = {
|
|
776
|
+
type: "state",
|
|
777
|
+
...report,
|
|
778
|
+
...promptId ? { promptId } : {},
|
|
779
|
+
// activeCwd is guaranteed by readAgentViewWorkerSidebandEnv and survives
|
|
780
|
+
// a deleted cwd, unlike process.cwd(), which throws ENOENT.
|
|
781
|
+
cwd: report.cwd ?? sideband.activeCwd
|
|
782
|
+
};
|
|
783
|
+
const key = JSON.stringify(event);
|
|
784
|
+
const sendAndRecord = /* @__PURE__ */ __name(async () => {
|
|
785
|
+
if (key === lastStateReportKeys.get(sideband.sessionId)) {
|
|
786
|
+
if (pendingStateReports.get(sideband.sessionId) === report) {
|
|
787
|
+
pendingStateReports.delete(sideband.sessionId);
|
|
788
|
+
}
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
try {
|
|
792
|
+
await sendAgentViewWorkerEvent(event, env);
|
|
793
|
+
lastStateReportKeys.set(sideband.sessionId, key);
|
|
794
|
+
if (pendingStateReports.get(sideband.sessionId) === report) {
|
|
795
|
+
pendingStateReports.delete(sideband.sessionId);
|
|
796
|
+
}
|
|
797
|
+
const currentPrompt = activePrompts.get(sideband.sessionId);
|
|
798
|
+
if (event.promptId && currentPrompt?.phase === "accepted" && (event.sessionState === "idle" || event.sessionState === "completed" || event.sessionState === "stopped" || event.sessionState === "failed")) {
|
|
799
|
+
activePrompts.delete(sideband.sessionId);
|
|
800
|
+
}
|
|
801
|
+
} catch {
|
|
802
|
+
lastStateReportKeys.delete(sideband.sessionId);
|
|
803
|
+
}
|
|
804
|
+
}, "sendAndRecord");
|
|
805
|
+
const previous = stateReportChains.get(sideband.sessionId);
|
|
806
|
+
const run = previous ? previous.catch(() => {
|
|
807
|
+
}).then(sendAndRecord) : sendAndRecord();
|
|
808
|
+
stateReportChains.set(sideband.sessionId, run);
|
|
809
|
+
try {
|
|
810
|
+
await run;
|
|
811
|
+
} finally {
|
|
812
|
+
if (stateReportChains.get(sideband.sessionId) === run) {
|
|
813
|
+
stateReportChains.delete(sideband.sessionId);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
__name(reportAgentViewWorkerState, "reportAgentViewWorkerState");
|
|
818
|
+
function startAgentViewWorkerHeartbeat(env = process.env, intervalMs = 15e3) {
|
|
819
|
+
if (!readAgentViewWorkerSidebandEnv(env)) return void 0;
|
|
820
|
+
const interval = setInterval(() => {
|
|
821
|
+
void sendAgentViewWorkerEvent({ type: "heartbeat" }, env).catch(() => {
|
|
822
|
+
});
|
|
823
|
+
}, intervalMs);
|
|
824
|
+
interval.unref?.();
|
|
825
|
+
return {
|
|
826
|
+
dispose() {
|
|
827
|
+
clearInterval(interval);
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
__name(startAgentViewWorkerHeartbeat, "startAgentViewWorkerHeartbeat");
|
|
832
|
+
function isAgentViewWorkerControlEvent(value) {
|
|
833
|
+
if (!isRecord2(value) || !Number.isInteger(value["sequence"]) || typeof value["at"] !== "string") {
|
|
834
|
+
return false;
|
|
835
|
+
}
|
|
836
|
+
if (value["type"] === "redraw") {
|
|
837
|
+
return true;
|
|
838
|
+
}
|
|
839
|
+
if (value["type"] === "stop") {
|
|
840
|
+
return true;
|
|
841
|
+
}
|
|
842
|
+
if (value["type"] === "prompt") {
|
|
843
|
+
return typeof value["promptId"] === "string" && typeof value["text"] === "string";
|
|
844
|
+
}
|
|
845
|
+
return value["type"] === "answer" && (value["text"] === void 0 || typeof value["text"] === "string") && (value["callId"] === void 0 || typeof value["callId"] === "string") && (value["outcome"] === void 0 || isAgentViewWorkerAnswerOutcome(value["outcome"])) && (value["payload"] === void 0 || isRecord2(value["payload"]));
|
|
846
|
+
}
|
|
847
|
+
__name(isAgentViewWorkerControlEvent, "isAgentViewWorkerControlEvent");
|
|
848
|
+
function isRecord2(value) {
|
|
849
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
850
|
+
}
|
|
851
|
+
__name(isRecord2, "isRecord");
|
|
852
|
+
function isAgentViewWorkerAnswerOutcome(value) {
|
|
853
|
+
return value === "proceed_once" || value === "proceed_always" || value === "proceed_always_project" || value === "proceed_always_user" || value === "modify_with_editor" || value === "restore_previous" || value === "cancel";
|
|
854
|
+
}
|
|
855
|
+
__name(isAgentViewWorkerAnswerOutcome, "isAgentViewWorkerAnswerOutcome");
|
|
856
|
+
|
|
857
|
+
export {
|
|
858
|
+
AGENT_VIEW_PROTOCOL_VERSION,
|
|
859
|
+
bridgeAgentViewTerminal,
|
|
860
|
+
requestAgentViewSupervisor,
|
|
861
|
+
callAgentViewSupervisor,
|
|
862
|
+
watchAgentViewOwner,
|
|
863
|
+
attachAgentViewSupervisorTerminal,
|
|
864
|
+
subscribeAgentViewSupervisor,
|
|
865
|
+
O1CODE_AGENT_VIEW_TOKEN,
|
|
866
|
+
AGENT_VIEW_WORKER_ENV_KEYS,
|
|
867
|
+
requestAgentSessionDashboard,
|
|
868
|
+
createAgentViewWorkerSidebandEnv,
|
|
869
|
+
isAgentViewWorkerEnv,
|
|
870
|
+
readAgentViewWorkerSidebandEnv,
|
|
871
|
+
sendAgentViewWorkerEvent,
|
|
872
|
+
readAgentViewWorkerRedrawEvents,
|
|
873
|
+
reportAgentViewWorkerState,
|
|
874
|
+
startAgentViewWorkerHeartbeat
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* @license
|
|
878
|
+
* Copyright 2026 Qwen Team
|
|
879
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
880
|
+
*/
|