@agimon-ai/po-cloudflare 0.0.2-alpha.7 → 0.0.2-alpha.71
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 +64 -241
- package/container/Dockerfile +27 -0
- package/dist/{BrowserWebSocketTransport-C2SC2VeJ.js → BrowserWebSocketTransport-B4heNdrp.js} +1 -1
- package/dist/{NodeWebSocketTransport-CKilJesa.js → NodeWebSocketTransport-BCiOXUEz.js} +2 -2
- package/dist/{abort-signals-Bkmp_euQ.js → abort-signals-C8CttjsR.js} +1 -1
- package/dist/agent-CEqvgRl6.js +3878 -0
- package/dist/{anthropic-messages-CkYm8M3V.js → anthropic-messages-DCLLLNuM.js} +292 -64
- package/dist/apiContracts-DaOpUHnu.js +1719 -0
- package/dist/{approval-CQ3ZuoTy.js → approval-DXPV7Vm5.js} +15 -2
- package/dist/{approvalPrompt-CylV3C84.js → approvalPrompt-CBaxjb_g.js} +1 -2
- package/dist/approvalSession-C9bg7tPo.js +132 -0
- package/dist/artifactFiles-5KwXIxYf.js +1 -0
- package/dist/artifactsApi-bg2wMYWg.js +200 -0
- package/dist/assets/assets/{CodeEditorView-D4q94XH-.js → CodeEditorView-CfrVwzvL.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-C85p4OYZ.js → abnfDiagram-WEYOIA3C-B80H4Cm4.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-Bt_NOdwE.js → architecture-WOLXFQ4H-Dr4hXaql.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DzH1GKMm.js → architectureDiagram-ZHVYKT53-DWyt7oXu.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-BmWU34j3.js → blockDiagram-RJAE7QA3-OxNTLdmi.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-BpGOdOuo.js → c4Diagram-XDPPPE54-B4YtcH0s.js} +2 -2
- package/dist/assets/assets/channel-bXj00dGj.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-AycP1cXU.js → chunk-2E7WHVMD-CD6FFMOX.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-DX-DrZzc.js → chunk-4EMNKR2T-CEIoX5oo.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-BdwnLWzI.js → chunk-55XCU76K-CD3t0IJi.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-D-RBAwAn.js → chunk-7S6XSTFO-Cyt75UCF.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB-CCxNNhKs.js → chunk-AQDTSKZB-DRtqYBj9.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-D2hGwWm1.js → chunk-DSNLSHJZ-C8Fx2F8s.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-BPi-cqGh.js → chunk-HAGFOTED-wOLWRRnd.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D-r1ChHT.js → chunk-HNE4Q36P-CurJg4Hf.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-RgmZCAdn.js → chunk-NQOKRVIF-Dzcc5nOG.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-B-Hul-rZ.js → chunk-UHW7PFBP-B_ULFf2h.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-D1zlXCt8.js → chunk-VQ5W62QI-DH0VY4_p.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-CtjIbVJn.js → chunk-WQQL4CDK-DNxfLyXM.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-B2bMWgN9.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-BQOgXG99.js → chunk-YZO67HFG-COuMUh9U.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-CsDDxmqv.js → chunk-ZAUX2LTX-BJrCnubF.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-deyEYMjx.js → chunk-ZCHMQSOR-D1lFKPtk.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-DVJHeFlq.js → classDiagram-v2-4MYWR3UA-DfZIbyVL.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-ipcN28Fw.js → cose-bilkent-JH36ORCC-CpGhv9_S.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-s9ZkPF55.js → cynefin-EF2NZ3EQ-Cxdc6nQl.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-Ksr2qjsS.js → cynefinDiagram-WF24UDRP-qoj0w3lp.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-2_Wl-XEW.js → dagre-NK4GIZVX-DL6QbNDS.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-C7PeyT7l.js → diagram-CBK3MWTC-CJB3jq1_.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-DPYzeKdj.js → diagram-I5XIIV2D-4cPOxCxF.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-DHw1cAmn.js → diagram-ODIL2UCW-BG3-jAxE.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-C2wA8i-1.js → diagram-PFBEJUXE-Bx8dFaXj.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-tM3moCIs.js → diagram-RJA3I4VV-CUUHND91.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-CInyJxF7.js → diagram-TYUNFSNR-BDMoN-kr.js} +2 -2
- package/dist/assets/assets/{dist-BDqjNLTC.js → dist-5AxNm-uy.js} +2 -2
- package/dist/assets/assets/{dist-hpZIQBl4.js → dist-9_Rmyj2I.js} +2 -2
- package/dist/assets/assets/{dist-DSLprmec.js → dist-BE3CLKv4.js} +2 -2
- package/dist/assets/assets/{dist-BASEd5LC.js → dist-BfNCu-7x.js} +2 -2
- package/dist/assets/assets/{dist-BuYBvf4F.js → dist-BjI0b36Z.js} +2 -2
- package/dist/assets/assets/{dist-DUS0U_ge.js → dist-CM7b5P9a.js} +2 -2
- package/dist/assets/assets/{dist-CeOy6PjJ.js → dist-Ccxb9U1G.js} +2 -2
- package/dist/assets/assets/{dist-ChXoRSS6.js → dist-CjCWP21A.js} +2 -2
- package/dist/assets/assets/{dist-07dRlnp1.js → dist-DSTAktnR.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-4nZgqaSt.js → ebnfDiagram-V4P3TTPT-BivOMXZb.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-nFh54c1Q.js → elk-QONTBCTQ-CrJ1Qpy_.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-CIQ0_IgZ.js → erDiagram-KYQIGQAA-w9Bqp4sV.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-Cw4BlbYP.js → eventmodeling-K75KTNOO-CBjFM3kV.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-C6Fnfgm0.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-C97qoUpX.js → ganttDiagram-R7GPNTJY-CsWtGaqD.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-B8HWVkEX.js → gitGraph-VSP46ZUC-DsBSV9_h.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-B4Js56_8.js → gitGraphDiagram-PDYL7XHY-D5GxuYHW.js} +2 -2
- package/dist/assets/assets/index-CNDyKUDF.css +1 -0
- package/dist/assets/assets/index-DWDYnZsq.js +256 -0
- package/dist/assets/assets/{info-OHQRW6UA-A4qythhA.js → info-OHQRW6UA-C7x5dSJu.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-BSNwG9yI.js → infoDiagram-MVDRKAX5-CwpI-uAa.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-D4gU-3RA.js → ishikawaDiagram-HPEHV2GE-DAa7J5G6.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CxxDrw7o.js → journeyDiagram-BOSHW7O7-BmiZnxE_.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DUxQv3v0.js → kanban-definition-FNSA4HC5-DUR_mA3L.js} +2 -2
- package/dist/assets/assets/{line-BKODXUmk.js → line-DHY49wSg.js} +2 -2
- package/dist/assets/assets/{linear-Cm5uyUun.js → linear-pTo-a9xT.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-CYst2kCg.js → mermaid-parser.core-DMg3hN3T.js} +4 -4
- package/dist/assets/assets/{mermaid.core-B4Qq8SMa.js → mermaid.core-DKtPCltA.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-CZFvUTIM.js → mindmap-definition-6OY57UG3-DwTkFbnV.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DZMlaiuy.js → packet-JDAUHWVQ-Tu9TrQ1x.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-BjM668dT.js → pegDiagram-ECIUJNBX-B7My4tsz.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-CmpJ6vb8.js → pie-XZMESJXO-QPQm5Gdx.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-BCA9DCDe.js → pieDiagram-GNMPY74T-Bv-zAD_z.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-CUnpC-Rl.js → quadrantDiagram-D57K4MC3-HTjoGQPd.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-C9x42-KP.js → radar-ABXABTNO-LDBlEoFo.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-CLvHKrsC.js → railroad-I3PHUGI6-Dy3_ymgZ.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-B0LGF3gx.js → railroad-abnf-LNEFI6M7-QLVvYs6e.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-SKnYapAj.js → railroad-ebnf-DWYD2UWJ-CFRlv9a8.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-wsUpPloN.js → railroad-peg-JR7BVNR7-BOlq3d9c.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-BYJtosKO.js → railroadDiagram-Y72NRBL7-Chg32HoU.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-YYdoWMnl.js → requirementDiagram-EQYSW5RA-VenIs_eg.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DtZyCTdM.js → sankeyDiagram-SY24JHO5-BdByqMKF.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-BPE8f413.js → sequenceDiagram-BLEHNHQU-D3Do4GJE.js} +2 -2
- package/dist/assets/assets/{src-BNTOLq2G.js → src-DmfN-DA-.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-9f8Ow4Fl.js → stateDiagram-v2-A6IESKWZ-CZkRbPlf.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-DdAEbxGp.js → swimlanes-B3ENRKFQ-DRTdF9AF.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-BYr_4JUb.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-DJNGd2mU.js → timeline-definition-JXYKGLGB-BVcuws_M.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-BHONoCCw.js → treeView-D4JQ5SDB-BLtOJGqO.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-pOaYkxq7.js → treemap-SAJKECNS-Dn3BWJ4v.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C3eDYL9v.js → usecaseDiagram-WPOLBNNX-CBExIKDY.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-CJi1xfsR.js → vennDiagram-Q3Y3IDCW-C6FIx2L4.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-CEy4w7Ir.js → wardley-7MLQ67FV-Cjj2xSBp.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-DfdLMMpN.js → wardleyDiagram-IVAIDKWA-sQPCBCFK.js} +2 -2
- package/dist/assets/assets/{webpack-v8XGbQTa.js → webpack-DDCA0aDL.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-Aw-Ix4uC.js → xychartDiagram-4URNHDU4-bZ4rifSw.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +8 -2
- package/dist/assets/mascot/cta-provider.png +0 -0
- package/dist/assets/mascot/cta-sign-in.png +0 -0
- package/dist/assets/plugins/assets/base-GzIOAd-t.css +2 -0
- package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
- package/dist/assets/plugins/assets/day-bottom-left-5um-x02r-5um-x02r.webp +0 -0
- package/dist/assets/plugins/assets/day-grain-CvEuNhlI-CvEuNhlI.webp +0 -0
- package/dist/assets/plugins/assets/day-right-C9W-XtjV-C9W-XtjV.webp +0 -0
- package/dist/assets/plugins/assets/day-top-left-B544Eq9J-B544Eq9J.webp +0 -0
- package/dist/assets/plugins/assets/night-bottom-left-N03ST5Uz-N03ST5Uz.webp +0 -0
- package/dist/assets/plugins/assets/night-grain-BY9q-tNN-BY9q-tNN.webp +0 -0
- package/dist/assets/plugins/assets/night-right-C6Denrqj-C6Denrqj.webp +0 -0
- package/dist/assets/plugins/assets/night-top-left-KOou6UxY-KOou6UxY.webp +0 -0
- package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
- package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
- package/dist/assets/plugins/chunks/po-web-runtime-D8FIos2q.js +1 -0
- package/dist/assets/plugins/chunks/schemas-DVQ8BvvP.js +55 -0
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/approval.09e72f36-DxS_uibk.js +2 -0
- package/dist/assets/plugins/slots/artifacts.50b639bb-Cp37TAkd.js +1 -0
- package/dist/assets/plugins/slots/author.ea449ace-Ds9Y-tjN.js +93 -0
- package/dist/assets/plugins/slots/autocompact.6f428144-CDZpN7I7.js +1 -0
- package/dist/assets/plugins/slots/backdrop-bamboo.6e4c928d-qbifuMc6.js +1 -0
- package/dist/assets/plugins/slots/browse.fa1f1a50-CVYvo1M5.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.75108f21-Cq1ljoL-.js +7 -0
- package/dist/assets/plugins/slots/calendar.d8b70190-BBjpOs1v.js +2 -0
- package/dist/assets/plugins/slots/codemode.c58fb583-DOR6OR7R.js +11 -0
- package/dist/assets/plugins/slots/domain.753f9f92-CJrXxig9.js +1 -0
- package/dist/assets/plugins/slots/edit.804fec90-BFF7_xN9.js +7 -0
- package/dist/assets/plugins/slots/files.66ffc636-CzOlZrRm.js +2 -0
- package/dist/assets/plugins/slots/goal.45dffa01-BtQBp3sw.js +1 -0
- package/dist/assets/plugins/slots/grep.98262cff-9bUDfjyT.js +1 -0
- package/dist/assets/plugins/slots/help.5fbd20f7-B4-y6gYK.js +3 -0
- package/dist/assets/plugins/slots/log.cb964209-BRPa3cVs.js +4 -0
- package/dist/assets/plugins/slots/mcp.82cc1ff5-CFtzPkPC.js +55 -0
- package/dist/assets/plugins/slots/plan.3852ba52-CH59Ff49.js +3 -0
- package/dist/assets/plugins/slots/profile.ab16dcec-0e9fWWyE.js +1 -0
- package/dist/assets/plugins/slots/prompts.ae48c07a-BTqYnBX5.js +38 -0
- package/dist/assets/plugins/slots/read.4560591a-C7fMXDEH.js +1 -0
- package/dist/assets/plugins/slots/runner.6e494d59-CqrpqhW9.js +9 -0
- package/dist/assets/plugins/slots/scaffold.d87a6ee0-9qY5gkYW.js +1 -0
- package/dist/assets/plugins/slots/session-mcp.2be84084-Cf0cqopp.js +2 -0
- package/dist/assets/plugins/slots/sessions.6f47cb4c-B1_eqPJQ.js +1 -0
- package/dist/assets/plugins/slots/skill.62a0a1b3-D-SKX8iw.js +4 -0
- package/dist/assets/plugins/slots/space.65a27e5a-fbLHc-DX.js +1 -0
- package/dist/assets/plugins/slots/subagents.8bb9992c-Cm_YMEnn.js +7 -0
- package/dist/assets/plugins/slots/template-advanced.59f3f98a-L0WOM4JT.js +1 -0
- package/dist/assets/plugins/slots/template-desktop.0f0b8491-By9BZlaL.js +7 -0
- package/dist/assets/plugins/slots/template-elegant.0e3b0acf-El05x7HK.js +1 -0
- package/dist/assets/plugins/slots/vault.3cbfcdc3-DpU_65Wy.js +1 -0
- package/dist/assets/plugins/slots/voice.a952113d-CvcuL__m.js +1 -0
- package/dist/assets/plugins/slots/web-search.65013836-NVh9fdvE.js +1 -0
- package/dist/assets/plugins/slots/workflows.cbc5c5c0-OLKSY9PE.js +16 -0
- package/dist/assets/pwa/pwa.js +12 -12
- package/dist/assets/pwa/sw.js +58 -4
- package/dist/{atomicJson-wczZBXQP.js → atomicJson-XYtxz032.js} +2 -3
- package/dist/{azure-openai-config-DHMgdIa-.js → azure-openai-config-S-quxzTC.js} +2 -2
- package/dist/{azure-openai-responses-CTgRdQ4m.js → azure-openai-responses-DdpV5zh7.js} +13 -13
- package/dist/backgroundWork-Bv0ib_lY.js +49 -0
- package/dist/{layeredConfig-xmTHGrw8.js → browser-DwY5dXHX.js} +21 -983
- package/dist/{browser-EJ5_ffnN.js → browser-IsHIcvFg.js} +1 -1
- package/dist/browser-ks_k-6KA.js +36 -0
- package/dist/calendarSetup-CI3AACVo.js +3892 -0
- package/dist/childProcess-Cv8rJuUf.js +32 -0
- package/dist/childSession-BrDCrNtL.js +25 -0
- package/dist/{classifier-shared-jXm-plIK.js → classifier-shared-DFprgrML.js} +5 -5
- package/dist/{cloudflare-workers-ai-system-one-B0wH6HU5.js → cloudflare-workers-ai-system-one-B0MD19yZ.js} +3 -3
- package/dist/{codemode-CFVDmyGm.js → codemode-LpcMFMYM.js} +1 -1
- package/dist/coerce-DM9YrILC.js +13 -0
- package/dist/config-DeWkdjj7.js +1372 -0
- package/dist/contextContributions-C1bsEJef.js +13 -0
- package/dist/contracts-CW8o6Xyi.js +19 -0
- package/dist/contracts-WRa9e98H.js +40 -0
- package/dist/cordisHost-_-jtkneB.js +25 -0
- package/dist/delegation-B2rBgv8A.js +100 -0
- package/dist/{diagnostics-DPTP-yrt.js → diagnostics-BY5LXbHJ.js} +2 -2
- package/dist/{dist-BVBi6VMV.js → dist-B2ArMqge.js} +1 -1
- package/dist/{server-Cg07O2W6.js → dist-C6IqjC-m.js} +1 -546
- package/dist/{dist-PDDFdqDX.js → dist-CDz5dYMj.js} +1 -1
- package/dist/{dist-Dvx5mlIR.js → dist-kgi2Ix1y.js} +16 -3
- package/dist/{emscripten-module.cloudflare-D4Bc9Ykz.js → emscripten-module.cloudflare-B4fhfquU.js} +1 -1
- package/dist/{env-api-keys-CAnjjnsR.js → env-api-keys-BgCPpU9t.js} +1 -1
- package/dist/{error-body-DQZRsyL5.js → error-body-CeumezyR.js} +26 -4
- package/dist/esm-BKJy3O9-.js +1553 -0
- package/dist/{remoteMcp-DqE2xFWS.js → exports-BEEgtkya.js} +1588 -714
- package/dist/{exports-LjvSY7Y6.js → exports-CBp_9dVk.js} +47 -28
- package/dist/exports-CRjRvvX0.js +34 -0
- package/dist/exports-Cg0wxflf.js +1 -0
- package/dist/exports-Ct56PRB9.js +46 -0
- package/dist/extensionFile-B940JOEn.js +121 -0
- package/dist/{factory-Cs8iaUtc.js → factory-BU0cZY0I.js} +1 -1
- package/dist/{github-copilot-headers-DpQQAh-s.js → github-copilot-headers-Cq9pnpl2.js} +1 -1
- package/dist/{google-generative-ai-BTTOo5RQ.js → google-generative-ai-DmbUlCGv.js} +9 -9
- package/dist/{google-shared-S7bqOccz.js → google-shared-Diz2uk39.js} +6 -6
- package/dist/{google-vertex-BcMU_DMb.js → google-vertex-CGCpI9Po.js} +10 -10
- package/dist/{domains-B6Ae4swm.js → harnessState-Df--jB5z.js} +162 -42
- package/dist/{harnessStore-Ccbia9_u.js → harnessStore-DInwiLYb.js} +4 -5
- package/dist/{hash-B3RRpLS2.js → hash-IQBoLxOB.js} +1 -1
- package/dist/{headers-BEuxFxDI.js → headers-Dkgiqogr.js} +1 -1
- package/dist/help-C9UGKetC.js +100 -0
- package/dist/home-kwZFHqOx.js +60 -0
- package/dist/http-BekstF5S.js +64 -0
- package/dist/hubChannel-Dldv3EEb.js +32 -0
- package/dist/hubRevisions-BPoC6quI.js +364 -0
- package/dist/{identity-BIeAyilV.js → identity-BzB1N-Sn.js} +3 -3
- package/dist/index.edge-BiVQ9LoZ.js +198 -0
- package/dist/index.edge-CSGx6QOL.js +56 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/index.edge-CzoLWbyl.js +238 -0
- package/dist/index.edge-D1biKw71.js +946 -0
- package/dist/index.edge-D2RirEwK.js +14 -0
- package/dist/iso-BGFmgtky.js +27 -0
- package/dist/{kysely-adapter-D51abb3q.js → kysely-adapter-D8KUrWxm.js} +1 -1
- package/dist/liquid.browser-1BcykmIN.js +4596 -0
- package/dist/manualTranscription-DN56fzgj.js +96 -0
- package/dist/{mcpProjection-BXiECnW0.js → mcpProjection-D2U50Pel.js} +1 -2
- package/dist/meta-CVgfTHQP.js +1030 -0
- package/dist/migrations-DJBPDwSR.js +32 -0
- package/dist/{mistral-conversations-DN8VSERk.js → mistral-conversations-Bv_m1MRF.js} +12 -12
- package/dist/modeDefinition-Di95_IiU.js +44 -0
- package/dist/{models-D6d73jcW.js → models-D50yN8Ag.js} +41 -46
- package/dist/{node-UuMT2C3q.js → node-B4kSjHeD.js} +2 -2
- package/dist/{node-DytJOfYf.js → node-CBLSc-YH.js} +1 -1
- package/dist/notification-DjxbNoMR.js +143 -0
- package/dist/{openai-bt3ZRBZv.js → openai-D6Q-l6hT.js} +187 -187
- package/dist/{openai-codex-responses-cL36x0ml.js → openai-codex-responses-BnoiTqYV.js} +21 -25
- package/dist/{openai-completions-BWsTNYyT.js → openai-completions-C68qs5rI.js} +26 -19
- package/dist/{openai-decisions-Dfn_KgQd.js → openai-decisions-BSxU_aoV.js} +3 -3
- package/dist/{openai-responses-aa0LoyCJ.js → openai-responses-D6hXen-k.js} +17 -15
- package/dist/{openai-responses-shared-H-jH5SlM.js → openai-responses-shared-BD8K7FAC.js} +7 -7
- package/dist/{openrouter-cost-D99Qqcs6.js → openrouter-cost-BPam8wyW.js} +1 -1
- package/dist/{openrouter-images-BpwVpALC.js → openrouter-images-DylXiHy7.js} +7 -7
- package/dist/{hubChannel-Dn5NMpvu.js → packageApi-DYkaxP59.js} +33 -42
- package/dist/photon_rs_bg.wasm +0 -0
- package/dist/{pi-messages-BHAIkYBj.js → pi-messages-DaIlYYlO.js} +6 -6
- package/dist/piConfig-5tRPD0ov.js +126 -0
- package/dist/piSettings-ekBG5OeF.js +1 -0
- package/dist/platform-CQahdzpG.js +138 -0
- package/dist/pluginCatalog-BAALyedS.js +30 -0
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/pluginProtocol-7_gVUeM9.js +1 -0
- package/dist/pluginProtocol-DVIfJnav.js +135 -0
- package/dist/portableConfig-0tnk9anb.js +49 -0
- package/dist/presetConfig-n-oiNd3h.js +541 -0
- package/dist/profileSources-D1rymC97.js +537 -0
- package/dist/{protocol-DUeE0Q8z.js → protocol-Cri0GpZR.js} +1 -2
- package/dist/{provider-env-DgfpjgTa.js → provider-env-DJb40UF7.js} +2 -2
- package/dist/{provider-retry-ChD-K2Gv.js → provider-retry-jpvs7ixx.js} +1 -1
- package/dist/{puppeteer-cloudflare-B-GHrPGO.js → puppeteer-cloudflare-D4l8smMS.js} +3 -3
- package/dist/{server-BWJmxCrm.js → readiness-Ydw5zrKy.js} +4 -169
- package/dist/{rolldown-runtime-B-lAHAz2.js → rolldown-runtime-DbVrKiKs.js} +1 -1
- package/dist/{sanitize-unicode-Dl4ROF7y.js → sanitize-unicode-B1ZFaEtf.js} +1 -1
- package/dist/scaffoldRegistry-CeFe3Pf0.js +1240 -0
- package/dist/{schemas-Vj8-rCR4.js → schemas-D2dRon18.js} +1901 -53
- package/dist/server-AKM07WcM.js +466 -0
- package/dist/server-B0tM5Ygf.js +1300 -0
- package/dist/server-B8-vStCx.js +1116 -0
- package/dist/server-BAbdiL38.js +15108 -0
- package/dist/server-BCZ_R3kX.js +3326 -0
- package/dist/server-BGKAeB3M.js +492 -0
- package/dist/server-BIQhg1jS.js +26985 -0
- package/dist/server-BcPD_6a2.js +1533 -0
- package/dist/server-BeoA0QB-.js +580 -0
- package/dist/server-BsgvOpBF.js +24 -0
- package/dist/server-BtnOqSB5.js +156 -0
- package/dist/server-C-HBjWRo.js +2800 -0
- package/dist/{server-CWg0m_wq.js → server-C0Lt6nTt.js} +269 -1062
- package/dist/server-C8NPfG1H.js +148 -0
- package/dist/server-CKkaxOc0.js +978 -0
- package/dist/server-CMaWF5UA.js +1379 -0
- package/dist/server-CQPI6jIa.js +295 -0
- package/dist/{server-BhYE7Vqk.js → server-CQmb0lYL.js} +114 -176
- package/dist/server-CWR34Vx6.js +1884 -0
- package/dist/server-CZiAy2v5.js +641 -0
- package/dist/server-Cjtr0oVJ.js +584 -0
- package/dist/server-CkJQJ3Oo.js +571 -0
- package/dist/server-ClQQGtsI.js +679 -0
- package/dist/server-Cy2FhGBm.js +1744 -0
- package/dist/server-D8yEblCB.js +24 -0
- package/dist/server-DF0YIUeI.js +9603 -0
- package/dist/server-DRFESCq1.js +1527 -0
- package/dist/{server-zkcrP99W.js → server-Df1defzp.js} +89 -87
- package/dist/server-DgZd_TuT.js +189 -0
- package/dist/server-Dkc9Kth2.js +1830 -0
- package/dist/server-DlRePYOB.js +343 -0
- package/dist/{server-BpPEzRes.js → server-_HZm8wEC.js} +654 -745
- package/dist/{server-yABhJa2K.js → server-_jWkMESg.js} +60 -39
- package/dist/server-lgV6liTt.js +140 -0
- package/dist/server-nHPXbRDA.js +742 -0
- package/dist/server-p7qANgrf.js +877 -0
- package/dist/server-vhmQi3co.js +112 -0
- package/dist/{server-SA0dsIJ2.js → server-w1aKMZOs.js} +3 -10
- package/dist/serverPlugin-4nI5J6Zt.js +39622 -0
- package/dist/session-resources-BvR3cwiH.js +10 -0
- package/dist/{sessionConfig-DgnPcGBu.js → sessionConfig-UMlgu98q.js} +926 -844
- package/dist/{simple-options-DWrW31_K.js → simple-options-Cp5p46f9.js} +13 -6
- package/dist/space-C3Wnli1l.js +92 -0
- package/dist/sse-XlzXs1es.js +151 -0
- package/dist/{streaming-json-t4rzNHEp.js → streaming-json-CZyrX_Ux.js} +6 -6
- package/dist/{system-one-shared-DLVLdzYL.js → system-one-shared-Du6bka0h.js} +3 -3
- package/dist/{notification-valMY1zH.js → telemetry-CrTcxeA5.js} +2 -93
- package/dist/{transform-messages-CjTSwW9q.js → transform-messages-CBj9g2mx.js} +3 -16
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/{server-BXjfQYeU.js → type-DppaYz6F.js} +955 -1187
- package/dist/type-yokaDI_F.js +7 -0
- package/dist/{typesafe-system-one-DBVcjcUQ.js → typesafe-system-one-C7YFgvrX.js} +3 -3
- package/dist/{uuid-mkNGilLv.js → uuid-BVI0BZsx.js} +1 -1
- package/dist/{validation-BLnxgJU_.js → validation-QWuk6kwJ.js} +79 -74
- package/dist/vaultSettings-Bq8wkbDv.js +292 -0
- package/dist/voiceTools-BdJyfzwB.js +246 -0
- package/dist/web-B2sdV-F2.js +4 -0
- package/dist/worker.js +97821 -72579
- package/dist/workflow-DTCt4n6k.js +171 -0
- package/dist/workflowServices-RlswfHWp.js +300 -0
- package/package.json +55 -25
- package/wrangler.jsonc +16 -3
- package/dist/apiContracts-sG5b90Qa.js +0 -4451
- package/dist/assets/assets/channel-BOT7In0s.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-Dp9-QbR6.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-B9D9uWwn.js +0 -1
- package/dist/assets/assets/index-BlPEYpuN.css +0 -1
- package/dist/assets/assets/index-DS9w_Q1B.js +0 -155
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-CyUKtW7v.js +0 -9
- package/dist/assets/plugins/assets/base-DyDpY0zD.css +0 -2
- package/dist/assets/plugins/chunks/po-web-runtime-4JiBsb_c.js +0 -1
- package/dist/assets/plugins/slots/approval.09e72f36-DwFz-UMh.js +0 -2
- package/dist/assets/plugins/slots/artifacts.50b639bb-CUtFC806.js +0 -1
- package/dist/assets/plugins/slots/builtin-tools.75108f21-B69GLfY_.js +0 -7
- package/dist/assets/plugins/slots/codemode.c58fb583-C0Gmb7_s.js +0 -9
- package/dist/assets/plugins/slots/domain.753f9f92-BTBYRLkE.js +0 -1
- package/dist/assets/plugins/slots/mcp.82cc1ff5-Ecacjn0a.js +0 -109
- package/dist/assets/plugins/slots/profile.ab16dcec-DIVXNHmh.js +0 -1
- package/dist/assets/plugins/slots/skill.62a0a1b3-BNr7DmPH.js +0 -4
- package/dist/backgroundWork-CSpsJ-Rg.js +0 -25
- package/dist/contextProjection-DDIQRgN4.js +0 -188
- package/dist/extensionFile-CacKVegY.js +0 -409
- package/dist/harnessState-gmzJcPGt.js +0 -88
- package/dist/harnessStore-Ch6hdYYe.js +0 -1
- package/dist/index.edge-BgSx_gRO.js +0 -45
- package/dist/majorModes-CCnwAjfF.js +0 -333
- package/dist/majorModes-DNQbxkpt.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/platform-Bs2_X_dK.js +0 -16
- package/dist/platformFiles-CCGujP9o.js +0 -39
- package/dist/server-5hLs7M43.js +0 -656
- package/dist/server-B3iqBHOP.js +0 -118
- package/dist/server-Dv0EKLwc.js +0 -108
- package/dist/server-Y5A21sJf.js +0 -591
- package/dist/server-a1K226XK.js +0 -279
- package/dist/serverPlugin-DUc4gGep.js +0 -7279
- package/dist/value-Bd477RDX.js +0 -2247
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { c as nodeHost, o as poHomeDirectory } from "./serverPlugin-DUc4gGep.js";
|
|
2
|
-
import { t as readTextIfExists } from "./platformFiles-CCGujP9o.js";
|
|
3
|
-
import "./platform-Bs2_X_dK.js";
|
|
4
|
-
import "./piSettings-B6fsgIBA.js";
|
|
5
|
-
import "node:crypto";
|
|
6
|
-
import path from "node:path";
|
|
7
1
|
//#region ../../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js
|
|
8
2
|
const ALIAS = Symbol.for("yaml.alias");
|
|
9
3
|
const DOC = Symbol.for("yaml.document");
|
|
@@ -1245,7 +1239,7 @@ function stringifyProps(node, tagObj, { anchors, doc }) {
|
|
|
1245
1239
|
if (tag) props.push(doc.directives.tagString(tag));
|
|
1246
1240
|
return props.join(" ");
|
|
1247
1241
|
}
|
|
1248
|
-
function stringify(item, ctx, onComment, onChompKeep) {
|
|
1242
|
+
function stringify$1(item, ctx, onComment, onChompKeep) {
|
|
1249
1243
|
if (isPair(item)) return item.toString(ctx, onComment, onChompKeep);
|
|
1250
1244
|
if (isAlias(item)) {
|
|
1251
1245
|
if (ctx.doc.directives) return item.toString(ctx);
|
|
@@ -1282,7 +1276,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
1282
1276
|
});
|
|
1283
1277
|
let keyCommentDone = false;
|
|
1284
1278
|
let chompKeep = false;
|
|
1285
|
-
let str = stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
1279
|
+
let str = stringify$1(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
1286
1280
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
1287
1281
|
if (simpleKeys) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1288
1282
|
explicitKey = true;
|
|
@@ -1322,7 +1316,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
1322
1316
|
chompKeep = false;
|
|
1323
1317
|
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value) && !value.flow && !value.tag && !value.anchor) ctx.indent = ctx.indent.substring(2);
|
|
1324
1318
|
let valueCommentDone = false;
|
|
1325
|
-
const valueStr = stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
1319
|
+
const valueStr = stringify$1(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
1326
1320
|
let ws = " ";
|
|
1327
1321
|
if (keyComment || vsb || vcb) {
|
|
1328
1322
|
ws = vsb ? "\n" : "";
|
|
@@ -1491,7 +1485,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
|
|
|
1491
1485
|
}
|
|
1492
1486
|
}
|
|
1493
1487
|
chompKeep = false;
|
|
1494
|
-
let str = stringify(item, itemCtx, () => comment = null, () => chompKeep = true);
|
|
1488
|
+
let str = stringify$1(item, itemCtx, () => comment = null, () => chompKeep = true);
|
|
1495
1489
|
if (comment) str += lineComment(str, itemIndent, commentString(comment));
|
|
1496
1490
|
if (chompKeep && comment) chompKeep = false;
|
|
1497
1491
|
lines.push(blockItemPrefix + str);
|
|
@@ -1543,7 +1537,7 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
|
|
|
1543
1537
|
} else if (item.value == null && ik?.comment) comment = ik.comment;
|
|
1544
1538
|
}
|
|
1545
1539
|
if (comment) reqNewline = true;
|
|
1546
|
-
let str = stringify(item, itemCtx, () => comment = null);
|
|
1540
|
+
let str = stringify$1(item, itemCtx, () => comment = null);
|
|
1547
1541
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
1548
1542
|
if (i < items.length - 1) str += ",";
|
|
1549
1543
|
else if (ctx.options.trailingComma) {
|
|
@@ -2562,11 +2556,11 @@ function stringifyDocument(doc, options) {
|
|
|
2562
2556
|
contentComment = doc.contents.comment;
|
|
2563
2557
|
}
|
|
2564
2558
|
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
|
|
2565
|
-
let body = stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
2559
|
+
let body = stringify$1(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
2566
2560
|
if (contentComment) body += lineComment(body, "", commentString(contentComment));
|
|
2567
2561
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`;
|
|
2568
2562
|
else lines.push(body);
|
|
2569
|
-
} else lines.push(stringify(doc.contents, ctx));
|
|
2563
|
+
} else lines.push(stringify$1(doc.contents, ctx));
|
|
2570
2564
|
if (doc.directives?.docEnd) {
|
|
2571
2565
|
if (doc.comment) {
|
|
2572
2566
|
const cs = commentString(doc.comment);
|
|
@@ -5736,977 +5730,21 @@ function parse(src, reviver, options) {
|
|
|
5736
5730
|
}
|
|
5737
5731
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
5738
5732
|
}
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
"desktopEnvironment",
|
|
5748
|
-
"profileMemory",
|
|
5749
|
-
"subagents",
|
|
5750
|
-
"projectTrust",
|
|
5751
|
-
"workspaces",
|
|
5752
|
-
"editor",
|
|
5753
|
-
"browse",
|
|
5754
|
-
"ios",
|
|
5755
|
-
"voice",
|
|
5756
|
-
"selection",
|
|
5757
|
-
"web",
|
|
5758
|
-
"native"
|
|
5759
|
-
];
|
|
5760
|
-
const WORKSPACE_KEYS = ["name", "instructions"];
|
|
5761
|
-
const BROWSE_KEYS = ["engine", "fallback"];
|
|
5762
|
-
const PO_BROWSE_ENGINES = ["cloak", "chrome-for-testing"];
|
|
5763
|
-
const PO_BROWSE_FALLBACKS = ["none", "chrome-for-testing"];
|
|
5764
|
-
const IOS_KEYS = [
|
|
5765
|
-
"pool",
|
|
5766
|
-
"helperPath",
|
|
5767
|
-
"device"
|
|
5768
|
-
];
|
|
5769
|
-
const IOS_POOL_KEYS = [
|
|
5770
|
-
"minBooted",
|
|
5771
|
-
"maxBooted",
|
|
5772
|
-
"maxDevices",
|
|
5773
|
-
"idleShutdownMinutes",
|
|
5774
|
-
"waitTimeoutSeconds",
|
|
5775
|
-
"deviceType",
|
|
5776
|
-
"runtime"
|
|
5777
|
-
];
|
|
5778
|
-
const IOS_DEVICE_KEYS = ["developmentTeam", "availability"];
|
|
5779
|
-
const SELECTION_KEYS = [
|
|
5780
|
-
"majorMode",
|
|
5781
|
-
"domains",
|
|
5782
|
-
"profile"
|
|
5783
|
-
];
|
|
5784
|
-
const MODE_KEYS = ["planning", "autocompact"];
|
|
5785
|
-
const PLANNING_KEYS = [
|
|
5786
|
-
"main",
|
|
5787
|
-
"subagents",
|
|
5788
|
-
"plansDirectory"
|
|
5789
|
-
];
|
|
5790
|
-
const AGENT_KEYS = ["model", "thinking"];
|
|
5791
|
-
const AUTOCOMPACT_KEYS = [
|
|
5792
|
-
"enabled",
|
|
5793
|
-
"model",
|
|
5794
|
-
"thinking",
|
|
5795
|
-
"thresholds",
|
|
5796
|
-
"overrides"
|
|
5797
|
-
];
|
|
5798
|
-
const AUTOCOMPACT_THRESHOLD_KEYS = [
|
|
5799
|
-
"pass1",
|
|
5800
|
-
"pass2",
|
|
5801
|
-
"pass3"
|
|
5802
|
-
];
|
|
5803
|
-
const AUTOCOMPACT_OVERRIDE_KEYS = ["model", "tokens"];
|
|
5804
|
-
const COMPUTER_USE_KEYS = ["enabled"];
|
|
5805
|
-
const DESKTOP_ENVIRONMENT_KEYS = [
|
|
5806
|
-
"inherit",
|
|
5807
|
-
"exclude",
|
|
5808
|
-
"includeOnly",
|
|
5809
|
-
"set"
|
|
5810
|
-
];
|
|
5811
|
-
const ENVIRONMENT_VARIABLE_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
5812
|
-
const PROFILE_MEMORY_KEYS = ["automatic"];
|
|
5813
|
-
const SUBAGENTS_KEYS = [
|
|
5814
|
-
"model",
|
|
5815
|
-
"thinking",
|
|
5816
|
-
"fallbackModels",
|
|
5817
|
-
"excludeTools"
|
|
5818
|
-
];
|
|
5819
|
-
/** A pass that fires below this is noise; one above it never fires before Pi compacts natively. */
|
|
5820
|
-
const MIN_AUTOCOMPACT_RATIO = .05;
|
|
5821
|
-
const MAX_AUTOCOMPACT_RATIO = .99;
|
|
5822
|
-
/**
|
|
5823
|
-
* A checkpoint at zero tokens fires before the session has said anything. There is
|
|
5824
|
-
* deliberately no ceiling: the package takes the lower of the ratio and the token
|
|
5825
|
-
* value, so one larger than the window is inert rather than dangerous.
|
|
5826
|
-
*/
|
|
5827
|
-
const MIN_AUTOCOMPACT_TOKENS = 1;
|
|
5828
|
-
const EDITOR_KEYS = ["command"];
|
|
5829
|
-
const VOICE_KEYS = [
|
|
5830
|
-
"mode",
|
|
5831
|
-
"engine",
|
|
5832
|
-
"language",
|
|
5833
|
-
"recorder",
|
|
5834
|
-
"adapters",
|
|
5835
|
-
"autoCapture",
|
|
5836
|
-
"live"
|
|
5837
|
-
];
|
|
5838
|
-
const VOICE_LIVE_KEYS = [
|
|
5839
|
-
"voice",
|
|
5840
|
-
"model",
|
|
5841
|
-
"orchestrator"
|
|
5842
|
-
];
|
|
5843
|
-
const LIVE_MODEL_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]*$/u;
|
|
5844
|
-
const MAX_LIVE_MODEL_LENGTH = 64;
|
|
5845
|
-
const RECORDER_KEYS = ["binary", "device"];
|
|
5846
|
-
const WHISPER_CPP_ENGINE = "whisper-cpp";
|
|
5847
|
-
const OPENAI_WHISPER_ENGINE = "openai-whisper";
|
|
5848
|
-
const MLX_WHISPER_ENGINE = "mlx-whisper";
|
|
5849
|
-
const MACOS_SAY_TTS_ENGINE = "macos-say";
|
|
5850
|
-
const ADAPTERS_KEYS = [
|
|
5851
|
-
WHISPER_CPP_ENGINE,
|
|
5852
|
-
OPENAI_WHISPER_ENGINE,
|
|
5853
|
-
MLX_WHISPER_ENGINE
|
|
5854
|
-
];
|
|
5855
|
-
const ADAPTER_KEYS = ["binary", "model"];
|
|
5856
|
-
const MODEL_KEYS = ["path", "id"];
|
|
5857
|
-
const AUTO_CAPTURE_KEYS = [
|
|
5858
|
-
"model",
|
|
5859
|
-
"startPhrases",
|
|
5860
|
-
"stopPhrases",
|
|
5861
|
-
"composeOpenPhrases",
|
|
5862
|
-
"composeSendPhrases",
|
|
5863
|
-
"composeCancelPhrases",
|
|
5864
|
-
"utteranceIdleMs",
|
|
5865
|
-
"composeUtteranceIdleMs",
|
|
5866
|
-
"composeNudgeMs",
|
|
5867
|
-
"transcriptionTimeoutMs",
|
|
5868
|
-
"tts"
|
|
5869
|
-
];
|
|
5870
|
-
const TTS_KEYS = [
|
|
5871
|
-
"engine",
|
|
5872
|
-
"voice",
|
|
5873
|
-
"rate"
|
|
5874
|
-
];
|
|
5875
|
-
const MIN_UTTERANCE_IDLE_MS = 1500;
|
|
5876
|
-
const MAX_UTTERANCE_IDLE_MS = 1e4;
|
|
5877
|
-
const MIN_COMPOSE_UTTERANCE_IDLE_MS = 800;
|
|
5878
|
-
const MAX_COMPOSE_UTTERANCE_IDLE_MS = 3e3;
|
|
5879
|
-
const MIN_COMPOSE_NUDGE_MS = 5e3;
|
|
5880
|
-
const MAX_COMPOSE_NUDGE_MS = 6e4;
|
|
5881
|
-
const MIN_TRANSCRIPTION_TIMEOUT_MS = 1e3;
|
|
5882
|
-
const MAX_TRANSCRIPTION_TIMEOUT_MS = 12e4;
|
|
5883
|
-
const MAX_CONTROL_PHRASES = 16;
|
|
5884
|
-
const MAX_CONTROL_PHRASE_LENGTH = 64;
|
|
5885
|
-
const MAX_TTS_VOICE_LENGTH = 64;
|
|
5886
|
-
const MIN_TTS_RATE = 80;
|
|
5887
|
-
const MAX_TTS_RATE = 500;
|
|
5888
|
-
const MODEL_REFERENCE_PATTERN = /^[^/\s]+\/[^/\s]+(?:\/[^/\s]+)*$/u;
|
|
5889
|
-
const PHRASE_PUNCTUATION_PATTERN = /[\p{P}\p{S}]+/gu;
|
|
5890
|
-
/**
|
|
5891
|
-
* The accepted values, in the order a picker should offer them.
|
|
5892
|
-
*
|
|
5893
|
-
* Exported because the config UI has to offer exactly what the parser accepts,
|
|
5894
|
-
* and a second hand-written list in the contributing package would drift. The
|
|
5895
|
-
* validating Sets below are built from these for the same reason.
|
|
5896
|
-
*/
|
|
5897
|
-
const PO_PLANNING_THINKING_LEVELS = [
|
|
5898
|
-
"off",
|
|
5899
|
-
"minimal",
|
|
5900
|
-
"low",
|
|
5901
|
-
"medium",
|
|
5902
|
-
"high",
|
|
5903
|
-
"xhigh",
|
|
5904
|
-
"max"
|
|
5905
|
-
];
|
|
5906
|
-
const PO_VOICE_MODES = [DEFAULT_VOICE_MODE, "live"];
|
|
5907
|
-
const PO_VOICE_ENGINES = [
|
|
5908
|
-
DEFAULT_VOICE_ENGINE,
|
|
5909
|
-
WHISPER_CPP_ENGINE,
|
|
5910
|
-
OPENAI_WHISPER_ENGINE,
|
|
5911
|
-
MLX_WHISPER_ENGINE
|
|
5912
|
-
];
|
|
5913
|
-
const PO_VOICE_TTS_ENGINES = [MACOS_SAY_TTS_ENGINE];
|
|
5914
|
-
/** Codex realtime V3 voices, from `codex-rs/protocol/src/protocol.rs` `RealtimeVoicesList::builtin()`. */
|
|
5915
|
-
const PO_VOICE_LIVE_VOICES = [
|
|
5916
|
-
"juniper",
|
|
5917
|
-
"maple",
|
|
5918
|
-
"spruce",
|
|
5919
|
-
"ember",
|
|
5920
|
-
"vale",
|
|
5921
|
-
"breeze",
|
|
5922
|
-
"arbor",
|
|
5923
|
-
"sol",
|
|
5924
|
-
"cove",
|
|
5925
|
-
"aube",
|
|
5926
|
-
"bubbie",
|
|
5927
|
-
"haetsal",
|
|
5928
|
-
"hanul",
|
|
5929
|
-
"himari",
|
|
5930
|
-
"leher",
|
|
5931
|
-
"miko",
|
|
5932
|
-
"neer",
|
|
5933
|
-
"porto",
|
|
5934
|
-
"rindo",
|
|
5935
|
-
"rio",
|
|
5936
|
-
"rivage",
|
|
5937
|
-
"selva",
|
|
5938
|
-
"sonna",
|
|
5939
|
-
"tinta",
|
|
5940
|
-
"viola"
|
|
5941
|
-
];
|
|
5942
|
-
const THINKING_VALUES = new Set(PO_PLANNING_THINKING_LEVELS);
|
|
5943
|
-
const TRUST_VALUES = /* @__PURE__ */ new Set([
|
|
5944
|
-
"ask",
|
|
5945
|
-
"always",
|
|
5946
|
-
"never"
|
|
5947
|
-
]);
|
|
5948
|
-
const VOICE_MODE_VALUES = new Set(PO_VOICE_MODES);
|
|
5949
|
-
const ENGINE_VALUES = new Set(PO_VOICE_ENGINES);
|
|
5950
|
-
const TTS_ENGINE_VALUES = new Set(PO_VOICE_TTS_ENGINES);
|
|
5951
|
-
function isObject(value) {
|
|
5952
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5953
|
-
}
|
|
5954
|
-
/**
|
|
5955
|
-
* Where a lenient parse collects unknown keys instead of throwing.
|
|
5956
|
-
*
|
|
5957
|
-
* Module scope rather than a parameter threaded through the twelve nested
|
|
5958
|
-
* parsers: `assertKeys` is the only reader, parsing is synchronous end to end,
|
|
5959
|
-
* and `parsePoConfig` owns the whole window in a try/finally. Threading would
|
|
5960
|
-
* touch every parser to change behaviour in one of them.
|
|
5961
|
-
*/
|
|
5962
|
-
let unknownKeySink;
|
|
5963
|
-
function assertKeys(value, allowed, location, filePath) {
|
|
5964
|
-
const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
5965
|
-
if (unknown.length === 0) return;
|
|
5966
|
-
if (unknownKeySink !== void 0) {
|
|
5967
|
-
for (const key of unknown) unknownKeySink.push({
|
|
5968
|
-
filePath,
|
|
5969
|
-
path: location === "root" ? key : `${location}.${key}`,
|
|
5970
|
-
message: `unsupported ${location} field`
|
|
5971
|
-
});
|
|
5972
|
-
return;
|
|
5973
|
-
}
|
|
5974
|
-
throw new Error(`Po config at ${filePath} has unsupported ${location} field(s): ${unknown.join(", ")}`);
|
|
5975
|
-
}
|
|
5976
|
-
function optionalString(value, location, filePath) {
|
|
5977
|
-
if (value === void 0) return void 0;
|
|
5978
|
-
if (typeof value !== "string" || value.trim().length === 0) throw new Error(`Po config at ${filePath} requires ${location} to be a non-empty string`);
|
|
5979
|
-
return value.trim();
|
|
5980
|
-
}
|
|
5981
|
-
function hasControlCharacters(value) {
|
|
5982
|
-
for (const character of value) {
|
|
5983
|
-
const codePoint = character.codePointAt(0);
|
|
5984
|
-
if (codePoint !== void 0 && (codePoint <= 31 || codePoint === 127)) return true;
|
|
5985
|
-
}
|
|
5986
|
-
return false;
|
|
5987
|
-
}
|
|
5988
|
-
function boundedOptionalString(value, location, filePath, maximumLength) {
|
|
5989
|
-
const text = optionalString(value, location, filePath);
|
|
5990
|
-
if (!text) return void 0;
|
|
5991
|
-
if (text.length > maximumLength) throw new Error(`Po config at ${filePath} requires ${location} to be at most ${maximumLength} characters`);
|
|
5992
|
-
if (hasControlCharacters(text)) throw new Error(`Po config at ${filePath} does not allow control characters in ${location}`);
|
|
5993
|
-
return text;
|
|
5994
|
-
}
|
|
5995
|
-
function parseModelReference(value, filePath) {
|
|
5996
|
-
const location = "voice.autoCapture.model";
|
|
5997
|
-
const model = optionalString(value, location, filePath);
|
|
5998
|
-
if (!model || !MODEL_REFERENCE_PATTERN.test(model)) throw new Error(`Po config at ${filePath} requires ${location} in provider/model-id form`);
|
|
5999
|
-
return model;
|
|
6000
|
-
}
|
|
6001
|
-
function normalizeControlPhrase(value) {
|
|
6002
|
-
return value.normalize("NFKC").toLocaleLowerCase("en-US").replace(PHRASE_PUNCTUATION_PATTERN, " ").replace(/\s+/gu, " ").trim();
|
|
6003
|
-
}
|
|
6004
|
-
function parseControlPhrases(value, location, filePath) {
|
|
6005
|
-
if (value === void 0) return void 0;
|
|
6006
|
-
if (!Array.isArray(value) || value.some((phrase) => typeof phrase !== "string")) throw new Error(`Po config at ${filePath} requires ${location} to be an array of strings`);
|
|
6007
|
-
if (value.length > MAX_CONTROL_PHRASES) throw new Error(`Po config at ${filePath} requires ${location} to contain at most ${MAX_CONTROL_PHRASES} phrases`);
|
|
6008
|
-
const phrases = value.map((phrase) => phrase.trim());
|
|
6009
|
-
const normalized = /* @__PURE__ */ new Set();
|
|
6010
|
-
for (const phrase of phrases) {
|
|
6011
|
-
if (phrase.length === 0) throw new Error(`Po config at ${filePath} requires ${location} to contain non-empty strings`);
|
|
6012
|
-
if (phrase.length > MAX_CONTROL_PHRASE_LENGTH) throw new Error(`Po config at ${filePath} requires ${location} phrases to be at most ${MAX_CONTROL_PHRASE_LENGTH} characters`);
|
|
6013
|
-
if (hasControlCharacters(phrase)) throw new Error(`Po config at ${filePath} does not allow control characters in ${location}`);
|
|
6014
|
-
const key = normalizeControlPhrase(phrase);
|
|
6015
|
-
if (!key) throw new Error(`Po config at ${filePath} requires ${location} to contain words`);
|
|
6016
|
-
if (normalized.has(key)) throw new Error(`Po config at ${filePath} does not allow normalized duplicates in ${location}`);
|
|
6017
|
-
normalized.add(key);
|
|
6018
|
-
}
|
|
6019
|
-
return phrases;
|
|
6020
|
-
}
|
|
6021
|
-
function parseBoundedInteger(value, location, filePath, minimum, maximum) {
|
|
6022
|
-
if (value === void 0) return void 0;
|
|
6023
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value < minimum || value > maximum) throw new Error(`Po config at ${filePath} requires ${location} to be an integer from ${minimum} to ${maximum}`);
|
|
6024
|
-
return value;
|
|
6025
|
-
}
|
|
6026
|
-
/**
|
|
6027
|
-
* Rejects a phrase claimed by two control roles at once.
|
|
6028
|
-
*
|
|
6029
|
-
* Composition commands are adjudicated before stop phrases and before leading
|
|
6030
|
-
* start-phrase removal, so a phrase shared with a later role is not ambiguous, it is
|
|
6031
|
-
* silently unreachable. Without a screen there is nothing to show which role won.
|
|
6032
|
-
*/
|
|
6033
|
-
function assertDisjointPhrases(left, right, leftName, rightName, filePath) {
|
|
6034
|
-
const keys = new Set((left ?? []).map(normalizeControlPhrase));
|
|
6035
|
-
if ((right ?? []).some((phrase) => keys.has(normalizeControlPhrase(phrase)))) throw new Error(`Po config at ${filePath} does not allow a phrase in both ${leftName} and ${rightName}`);
|
|
6036
|
-
}
|
|
6037
|
-
function parseTtsConfig(value, filePath) {
|
|
6038
|
-
const location = "voice.autoCapture.tts";
|
|
6039
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6040
|
-
assertKeys(value, TTS_KEYS, location, filePath);
|
|
6041
|
-
if (typeof value.engine !== "string" || !TTS_ENGINE_VALUES.has(value.engine)) throw new Error(`Po config at ${filePath} requires ${location}.engine to be one of: ${[...TTS_ENGINE_VALUES].join(", ")}`);
|
|
6042
|
-
const voice = boundedOptionalString(value.voice, `${location}.voice`, filePath, MAX_TTS_VOICE_LENGTH);
|
|
6043
|
-
const rate = value.rate;
|
|
6044
|
-
if (rate !== void 0 && (typeof rate !== "number" || !Number.isInteger(rate) || rate < MIN_TTS_RATE || rate > MAX_TTS_RATE)) throw new Error(`Po config at ${filePath} requires ${location}.rate to be an integer from ${MIN_TTS_RATE} to ${MAX_TTS_RATE}`);
|
|
6045
|
-
return {
|
|
6046
|
-
engine: value.engine,
|
|
6047
|
-
...voice ? { voice } : {},
|
|
6048
|
-
...rate === void 0 ? {} : { rate }
|
|
6049
|
-
};
|
|
6050
|
-
}
|
|
6051
|
-
function parseAutoCapture(value, filePath) {
|
|
6052
|
-
if (value === void 0) return void 0;
|
|
6053
|
-
const location = "voice.autoCapture";
|
|
6054
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6055
|
-
assertKeys(value, AUTO_CAPTURE_KEYS, location, filePath);
|
|
6056
|
-
const startPhrases = parseControlPhrases(value.startPhrases, `${location}.startPhrases`, filePath);
|
|
6057
|
-
const stopPhrases = parseControlPhrases(value.stopPhrases, `${location}.stopPhrases`, filePath);
|
|
6058
|
-
const composeOpenPhrases = parseControlPhrases(value.composeOpenPhrases, `${location}.composeOpenPhrases`, filePath);
|
|
6059
|
-
const composeSendPhrases = parseControlPhrases(value.composeSendPhrases, `${location}.composeSendPhrases`, filePath);
|
|
6060
|
-
const composeCancelPhrases = parseControlPhrases(value.composeCancelPhrases, `${location}.composeCancelPhrases`, filePath);
|
|
6061
|
-
const utteranceIdleMs = parseBoundedInteger(value.utteranceIdleMs, `${location}.utteranceIdleMs`, filePath, MIN_UTTERANCE_IDLE_MS, MAX_UTTERANCE_IDLE_MS);
|
|
6062
|
-
const composeUtteranceIdleMs = parseBoundedInteger(value.composeUtteranceIdleMs, `${location}.composeUtteranceIdleMs`, filePath, MIN_COMPOSE_UTTERANCE_IDLE_MS, MAX_COMPOSE_UTTERANCE_IDLE_MS);
|
|
6063
|
-
const composeNudgeMs = value.composeNudgeMs === 0 ? 0 : parseBoundedInteger(value.composeNudgeMs, `${location}.composeNudgeMs`, filePath, MIN_COMPOSE_NUDGE_MS, MAX_COMPOSE_NUDGE_MS);
|
|
6064
|
-
const transcriptionTimeoutMs = parseBoundedInteger(value.transcriptionTimeoutMs, `${location}.transcriptionTimeoutMs`, filePath, MIN_TRANSCRIPTION_TIMEOUT_MS, MAX_TRANSCRIPTION_TIMEOUT_MS);
|
|
6065
|
-
assertDisjointPhrases(startPhrases, stopPhrases, "startPhrases", "stopPhrases", filePath);
|
|
6066
|
-
assertDisjointPhrases(composeSendPhrases, composeCancelPhrases, "composeSendPhrases", "composeCancelPhrases", filePath);
|
|
6067
|
-
assertDisjointPhrases(composeOpenPhrases, composeSendPhrases, "composeOpenPhrases", "composeSendPhrases", filePath);
|
|
6068
|
-
assertDisjointPhrases(composeOpenPhrases, composeCancelPhrases, "composeOpenPhrases", "composeCancelPhrases", filePath);
|
|
6069
|
-
assertDisjointPhrases(stopPhrases, composeSendPhrases, "stopPhrases", "composeSendPhrases", filePath);
|
|
6070
|
-
assertDisjointPhrases(stopPhrases, composeCancelPhrases, "stopPhrases", "composeCancelPhrases", filePath);
|
|
6071
|
-
return {
|
|
6072
|
-
model: parseModelReference(value.model, filePath),
|
|
6073
|
-
...startPhrases ? { startPhrases } : {},
|
|
6074
|
-
...stopPhrases ? { stopPhrases } : {},
|
|
6075
|
-
...composeOpenPhrases ? { composeOpenPhrases } : {},
|
|
6076
|
-
...composeSendPhrases ? { composeSendPhrases } : {},
|
|
6077
|
-
...composeCancelPhrases ? { composeCancelPhrases } : {},
|
|
6078
|
-
...utteranceIdleMs === void 0 ? {} : { utteranceIdleMs },
|
|
6079
|
-
...composeUtteranceIdleMs === void 0 ? {} : { composeUtteranceIdleMs },
|
|
6080
|
-
...composeNudgeMs === void 0 ? {} : { composeNudgeMs },
|
|
6081
|
-
...transcriptionTimeoutMs === void 0 ? {} : { transcriptionTimeoutMs },
|
|
6082
|
-
tts: parseTtsConfig(value.tts, filePath)
|
|
6083
|
-
};
|
|
6084
|
-
}
|
|
6085
|
-
function parseThinking(value, location, filePath) {
|
|
6086
|
-
if (value === void 0) return void 0;
|
|
6087
|
-
if (typeof value !== "string" || !THINKING_VALUES.has(value)) throw new Error(`Po config at ${filePath} requires ${location}.thinking to be one of: ${[...THINKING_VALUES].join(", ")}`);
|
|
6088
|
-
return value;
|
|
6089
|
-
}
|
|
6090
|
-
function parseAgent(value, location, filePath) {
|
|
6091
|
-
if (value === void 0) return void 0;
|
|
6092
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6093
|
-
assertKeys(value, AGENT_KEYS, location, filePath);
|
|
6094
|
-
const thinking = parseThinking(value.thinking, location, filePath);
|
|
6095
|
-
const model = optionalString(value.model, `${location}.model`, filePath);
|
|
6096
|
-
return {
|
|
6097
|
-
...model ? { model } : {},
|
|
6098
|
-
...thinking ? { thinking } : {}
|
|
6099
|
-
};
|
|
6100
|
-
}
|
|
6101
|
-
/**
|
|
6102
|
-
* A flag the cockpit can write.
|
|
6103
|
-
*
|
|
6104
|
-
* The settings page writes strings and nothing else, so `'true'` has to mean
|
|
6105
|
-
* what a hand-edited `true` means. Anything else is rejected rather than
|
|
6106
|
-
* treated as false, because a typo that silently disables a feature is the
|
|
6107
|
-
* worst reading of it.
|
|
6108
|
-
*/
|
|
6109
|
-
function parseFlexibleBoolean(value, location, filePath) {
|
|
6110
|
-
if (value === void 0) return void 0;
|
|
6111
|
-
if (typeof value === "boolean") return value;
|
|
6112
|
-
if (value === "true") return true;
|
|
6113
|
-
if (value === "false") return false;
|
|
6114
|
-
throw new Error(`Po config at ${filePath} requires ${location} to be true or false`);
|
|
6115
|
-
}
|
|
6116
|
-
/** Same story as the flag: a number, or the string form the settings page writes. */
|
|
6117
|
-
function parseFlexibleRatio(value, location, filePath) {
|
|
6118
|
-
if (value === void 0) return void 0;
|
|
6119
|
-
const ratio = typeof value === "string" ? Number(value.trim()) : value;
|
|
6120
|
-
if (typeof ratio !== "number" || !Number.isFinite(ratio) || ratio < MIN_AUTOCOMPACT_RATIO || ratio > MAX_AUTOCOMPACT_RATIO) throw new Error(`Po config at ${filePath} requires ${location} to be a number from ${MIN_AUTOCOMPACT_RATIO} to ${MAX_AUTOCOMPACT_RATIO}`);
|
|
6121
|
-
return ratio;
|
|
6122
|
-
}
|
|
6123
|
-
function parseAutocompactThresholds(value, location, filePath) {
|
|
6124
|
-
if (value === void 0) return void 0;
|
|
6125
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6126
|
-
assertKeys(value, AUTOCOMPACT_THRESHOLD_KEYS, location, filePath);
|
|
6127
|
-
const pass1 = parseFlexibleRatio(value.pass1, `${location}.pass1`, filePath);
|
|
6128
|
-
const pass2 = parseFlexibleRatio(value.pass2, `${location}.pass2`, filePath);
|
|
6129
|
-
const pass3 = parseFlexibleRatio(value.pass3, `${location}.pass3`, filePath);
|
|
6130
|
-
return {
|
|
6131
|
-
...pass1 === void 0 ? {} : { pass1 },
|
|
6132
|
-
...pass2 === void 0 ? {} : { pass2 },
|
|
6133
|
-
...pass3 === void 0 ? {} : { pass3 }
|
|
6134
|
-
};
|
|
6135
|
-
}
|
|
6136
|
-
/** Absolute token counts, unlike the ratios, are only ever written by hand, so no string form is accepted. */
|
|
6137
|
-
function parseAutocompactTokenCount(value, location, filePath) {
|
|
6138
|
-
if (value === void 0) return void 0;
|
|
6139
|
-
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < MIN_AUTOCOMPACT_TOKENS) throw new Error(`Po config at ${filePath} requires ${location} to be an integer of at least ${MIN_AUTOCOMPACT_TOKENS}`);
|
|
6140
|
-
return value;
|
|
6141
|
-
}
|
|
6142
|
-
function parseAutocompactOverrideEntry(value, location, filePath) {
|
|
6143
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6144
|
-
assertKeys(value, AUTOCOMPACT_OVERRIDE_KEYS, location, filePath);
|
|
6145
|
-
const model = optionalString(value.model, `${location}.model`, filePath);
|
|
6146
|
-
if (!model) throw new Error(`Po config at ${filePath} requires ${location}.model`);
|
|
6147
|
-
if (!isObject(value.tokens)) throw new Error(`Po config at ${filePath} requires ${location}.tokens to be an object`);
|
|
6148
|
-
assertKeys(value.tokens, AUTOCOMPACT_THRESHOLD_KEYS, `${location}.tokens`, filePath);
|
|
6149
|
-
const pass1 = parseAutocompactTokenCount(value.tokens.pass1, `${location}.tokens.pass1`, filePath);
|
|
6150
|
-
const pass2 = parseAutocompactTokenCount(value.tokens.pass2, `${location}.tokens.pass2`, filePath);
|
|
6151
|
-
const pass3 = parseAutocompactTokenCount(value.tokens.pass3, `${location}.tokens.pass3`, filePath);
|
|
6152
|
-
if (pass1 === void 0 && pass2 === void 0 && pass3 === void 0) throw new Error(`Po config at ${filePath} requires one of ${location}.tokens.pass1, pass2, or pass3`);
|
|
6153
|
-
return {
|
|
6154
|
-
model,
|
|
6155
|
-
tokens: {
|
|
6156
|
-
...pass1 === void 0 ? {} : { pass1 },
|
|
6157
|
-
...pass2 === void 0 ? {} : { pass2 },
|
|
6158
|
-
...pass3 === void 0 ? {} : { pass3 }
|
|
6159
|
-
}
|
|
6160
|
-
};
|
|
6161
|
-
}
|
|
6162
|
-
function parseAutocompactOverrides(value, location, filePath) {
|
|
6163
|
-
if (value === void 0) return void 0;
|
|
6164
|
-
if (!Array.isArray(value)) throw new Error(`Po config at ${filePath} requires ${location} to be a list`);
|
|
6165
|
-
return value.map((entry, index) => parseAutocompactOverrideEntry(entry, `${location}[${index}]`, filePath));
|
|
6166
|
-
}
|
|
6167
|
-
function parseAutocompactModeConfig(value, filePath, location = "modes.autocompact") {
|
|
6168
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6169
|
-
assertKeys(value, AUTOCOMPACT_KEYS, location, filePath);
|
|
6170
|
-
const enabled = parseFlexibleBoolean(value.enabled, `${location}.enabled`, filePath);
|
|
6171
|
-
const model = optionalString(value.model, `${location}.model`, filePath);
|
|
6172
|
-
const thinking = parseThinking(value.thinking, location, filePath);
|
|
6173
|
-
const thresholds = parseAutocompactThresholds(value.thresholds, `${location}.thresholds`, filePath);
|
|
6174
|
-
const overrides = parseAutocompactOverrides(value.overrides, `${location}.overrides`, filePath);
|
|
6175
|
-
return {
|
|
6176
|
-
...enabled === void 0 ? {} : { enabled },
|
|
6177
|
-
...model ? { model } : {},
|
|
6178
|
-
...thinking ? { thinking } : {},
|
|
6179
|
-
...thresholds ? { thresholds } : {},
|
|
6180
|
-
...overrides ? { overrides } : {}
|
|
6181
|
-
};
|
|
6182
|
-
}
|
|
6183
|
-
function parsePlanningModeConfig(value, filePath, location = "modes.planning") {
|
|
6184
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6185
|
-
assertKeys(value, PLANNING_KEYS, location, filePath);
|
|
6186
|
-
return {
|
|
6187
|
-
main: parseAgent(value.main, `${location}.main`, filePath),
|
|
6188
|
-
subagents: parseAgent(value.subagents, `${location}.subagents`, filePath),
|
|
6189
|
-
plansDirectory: optionalString(value.plansDirectory, `${location}.plansDirectory`, filePath)
|
|
6190
|
-
};
|
|
6191
|
-
}
|
|
6192
|
-
function parseModel(value, location, filePath, allowId) {
|
|
6193
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6194
|
-
assertKeys(value, MODEL_KEYS, location, filePath);
|
|
6195
|
-
const modelPath = optionalString(value.path, `${location}.path`, filePath);
|
|
6196
|
-
const id = optionalString(value.id, `${location}.id`, filePath);
|
|
6197
|
-
if (Boolean(modelPath) === Boolean(id)) throw new Error(`Po config at ${filePath} requires exactly one of ${location}.path or ${location}.id`);
|
|
6198
|
-
if (id && !allowId) throw new Error(`Po config at ${filePath} does not support ${location}.id for whisper-cpp`);
|
|
6199
|
-
return {
|
|
6200
|
-
...modelPath ? { path: modelPath } : {},
|
|
6201
|
-
...id ? { id } : {}
|
|
6202
|
-
};
|
|
6203
|
-
}
|
|
6204
|
-
function parseAdapter(value, location, filePath, allowId) {
|
|
6205
|
-
if (value === void 0) return void 0;
|
|
6206
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6207
|
-
assertKeys(value, ADAPTER_KEYS, location, filePath);
|
|
6208
|
-
const binary = optionalString(value.binary, `${location}.binary`, filePath);
|
|
6209
|
-
return {
|
|
6210
|
-
...binary ? { binary } : {},
|
|
6211
|
-
model: parseModel(value.model, `${location}.model`, filePath, allowId)
|
|
6212
|
-
};
|
|
6213
|
-
}
|
|
6214
|
-
function parseVoice(value, filePath) {
|
|
6215
|
-
if (value === void 0) return void 0;
|
|
6216
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires voice to be an object`);
|
|
6217
|
-
assertKeys(value, VOICE_KEYS, "voice", filePath);
|
|
6218
|
-
const result = {};
|
|
6219
|
-
if (value.mode !== void 0) {
|
|
6220
|
-
if (typeof value.mode !== "string" || !VOICE_MODE_VALUES.has(value.mode)) throw new Error(`Po config at ${filePath} requires voice.mode to be one of: ${[...VOICE_MODE_VALUES].join(", ")}`);
|
|
6221
|
-
result.mode = value.mode;
|
|
6222
|
-
}
|
|
6223
|
-
if (value.engine !== void 0) {
|
|
6224
|
-
if (typeof value.engine !== "string" || !ENGINE_VALUES.has(value.engine)) throw new Error(`Po config at ${filePath} requires voice.engine to be one of: ${[...ENGINE_VALUES].join(", ")}`);
|
|
6225
|
-
result.engine = value.engine;
|
|
6226
|
-
}
|
|
6227
|
-
const language = optionalString(value.language, "voice.language", filePath);
|
|
6228
|
-
if (language) result.language = language;
|
|
6229
|
-
if (value.recorder !== void 0) {
|
|
6230
|
-
if (!isObject(value.recorder)) throw new Error(`Po config at ${filePath} requires voice.recorder to be an object`);
|
|
6231
|
-
assertKeys(value.recorder, RECORDER_KEYS, "voice.recorder", filePath);
|
|
6232
|
-
result.recorder = {};
|
|
6233
|
-
const binary = optionalString(value.recorder.binary, "voice.recorder.binary", filePath);
|
|
6234
|
-
const device = optionalString(value.recorder.device, "voice.recorder.device", filePath);
|
|
6235
|
-
if (binary) result.recorder.binary = binary;
|
|
6236
|
-
if (device) result.recorder.device = device;
|
|
6237
|
-
}
|
|
6238
|
-
if (value.adapters !== void 0) {
|
|
6239
|
-
if (!isObject(value.adapters)) throw new Error(`Po config at ${filePath} requires voice.adapters to be an object`);
|
|
6240
|
-
assertKeys(value.adapters, ADAPTERS_KEYS, "voice.adapters", filePath);
|
|
6241
|
-
result.adapters = {
|
|
6242
|
-
[WHISPER_CPP_ENGINE]: parseAdapter(value.adapters[WHISPER_CPP_ENGINE], `voice.adapters.${WHISPER_CPP_ENGINE}`, filePath, false),
|
|
6243
|
-
[OPENAI_WHISPER_ENGINE]: parseAdapter(value.adapters[OPENAI_WHISPER_ENGINE], `voice.adapters.${OPENAI_WHISPER_ENGINE}`, filePath, true),
|
|
6244
|
-
[MLX_WHISPER_ENGINE]: parseAdapter(value.adapters[MLX_WHISPER_ENGINE], `voice.adapters.${MLX_WHISPER_ENGINE}`, filePath, true)
|
|
6245
|
-
};
|
|
6246
|
-
}
|
|
6247
|
-
const autoCapture = parseAutoCapture(value.autoCapture, filePath);
|
|
6248
|
-
if (autoCapture) result.autoCapture = autoCapture;
|
|
6249
|
-
const live = parseVoiceLive(value.live, filePath);
|
|
6250
|
-
if (live) result.live = live;
|
|
6251
|
-
return result;
|
|
6252
|
-
}
|
|
6253
|
-
function parseVoiceLive(value, filePath) {
|
|
6254
|
-
if (value === void 0) return void 0;
|
|
6255
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires voice.live to be an object`);
|
|
6256
|
-
assertKeys(value, VOICE_LIVE_KEYS, "voice.live", filePath);
|
|
6257
|
-
const result = {};
|
|
6258
|
-
if (value.voice !== void 0) {
|
|
6259
|
-
if (typeof value.voice !== "string" || !PO_VOICE_LIVE_VOICES.includes(value.voice)) throw new Error(`Po config at ${filePath} requires voice.live.voice to be one of: ${PO_VOICE_LIVE_VOICES.join(", ")}`);
|
|
6260
|
-
result.voice = value.voice;
|
|
6261
|
-
}
|
|
6262
|
-
if (value.model !== void 0) {
|
|
6263
|
-
if (typeof value.model !== "string" || value.model.length > MAX_LIVE_MODEL_LENGTH || !LIVE_MODEL_PATTERN.test(value.model)) throw new Error(`Po config at ${filePath} requires voice.live.model to be a model id of at most ${MAX_LIVE_MODEL_LENGTH} letters, digits, dots, colons, underscores or dashes`);
|
|
6264
|
-
result.model = value.model;
|
|
6265
|
-
}
|
|
6266
|
-
const orchestrator = parseAgent(value.orchestrator, "voice.live.orchestrator", filePath);
|
|
6267
|
-
if (orchestrator) result.orchestrator = orchestrator;
|
|
6268
|
-
return result;
|
|
6269
|
-
}
|
|
6270
|
-
function parseSelection(value, filePath) {
|
|
6271
|
-
if (value === void 0) return void 0;
|
|
6272
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires selection to be an object`);
|
|
6273
|
-
assertKeys(value, SELECTION_KEYS, "selection", filePath);
|
|
6274
|
-
const domains = value.domains;
|
|
6275
|
-
if (domains !== void 0 && (!Array.isArray(domains) || domains.some((name) => typeof name !== "string"))) throw new Error(`Po config at ${filePath} requires selection.domains to be an array of strings`);
|
|
6276
|
-
return {
|
|
6277
|
-
majorMode: optionalString(value.majorMode, "selection.majorMode", filePath),
|
|
6278
|
-
domains,
|
|
6279
|
-
profile: optionalString(value.profile, "selection.profile", filePath)
|
|
6280
|
-
};
|
|
6281
|
-
}
|
|
6282
|
-
function parseEditor(value, filePath) {
|
|
6283
|
-
if (value === void 0) return void 0;
|
|
6284
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires editor to be an object`);
|
|
6285
|
-
assertKeys(value, EDITOR_KEYS, "editor", filePath);
|
|
6286
|
-
return { command: optionalString(value.command, "editor.command", filePath) };
|
|
6287
|
-
}
|
|
6288
|
-
function parseBrowse(value, filePath) {
|
|
6289
|
-
if (value === void 0) return void 0;
|
|
6290
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires browse to be an object`);
|
|
6291
|
-
assertKeys(value, BROWSE_KEYS, "browse", filePath);
|
|
6292
|
-
const pick = (key, allowed) => {
|
|
6293
|
-
const raw = value[key];
|
|
6294
|
-
if (raw === void 0) return void 0;
|
|
6295
|
-
if (typeof raw !== "string" || !allowed.includes(raw)) throw new Error(`Po config at ${filePath} requires browse.${key} to be one of: ${allowed.join(", ")}`);
|
|
6296
|
-
return raw;
|
|
6297
|
-
};
|
|
6298
|
-
const engine = pick("engine", PO_BROWSE_ENGINES);
|
|
6299
|
-
const fallback = pick("fallback", PO_BROWSE_FALLBACKS);
|
|
6300
|
-
return {
|
|
6301
|
-
...engine ? { engine } : {},
|
|
6302
|
-
...fallback ? { fallback } : {}
|
|
6303
|
-
};
|
|
6304
|
-
}
|
|
6305
|
-
function parseMinimumInteger(value, location, filePath, minimum) {
|
|
6306
|
-
if (value === void 0) return void 0;
|
|
6307
|
-
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum) throw new Error(`Po config at ${filePath} requires ${location} to be an integer of at least ${minimum}`);
|
|
6308
|
-
return value;
|
|
6309
|
-
}
|
|
6310
|
-
function parseIosPool(value, filePath) {
|
|
6311
|
-
if (value === void 0) return void 0;
|
|
6312
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios.pool to be an object`);
|
|
6313
|
-
assertKeys(value, IOS_POOL_KEYS, "ios.pool", filePath);
|
|
6314
|
-
const pool = {};
|
|
6315
|
-
const integer = (key, minimum) => {
|
|
6316
|
-
const parsed = parseMinimumInteger(value[key], `ios.pool.${key}`, filePath, minimum);
|
|
6317
|
-
if (parsed !== void 0) pool[key] = parsed;
|
|
6318
|
-
};
|
|
6319
|
-
integer("minBooted", 0);
|
|
6320
|
-
integer("maxBooted", 1);
|
|
6321
|
-
integer("maxDevices", 1);
|
|
6322
|
-
integer("idleShutdownMinutes", 1);
|
|
6323
|
-
integer("waitTimeoutSeconds", 0);
|
|
6324
|
-
const deviceType = optionalString(value.deviceType, "ios.pool.deviceType", filePath);
|
|
6325
|
-
if (deviceType !== void 0) pool.deviceType = deviceType;
|
|
6326
|
-
const runtime = optionalString(value.runtime, "ios.pool.runtime", filePath);
|
|
6327
|
-
if (runtime !== void 0) pool.runtime = runtime;
|
|
6328
|
-
if (pool.minBooted !== void 0 && pool.maxBooted !== void 0 && pool.minBooted > pool.maxBooted) throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxBooted`);
|
|
6329
|
-
if (pool.maxBooted !== void 0 && pool.maxDevices !== void 0 && pool.maxBooted > pool.maxDevices) throw new Error(`Po config at ${filePath} requires ios.pool.maxBooted to be at most ios.pool.maxDevices`);
|
|
6330
|
-
if (pool.minBooted !== void 0 && pool.maxDevices !== void 0 && pool.minBooted > pool.maxDevices) throw new Error(`Po config at ${filePath} requires ios.pool.minBooted to be at most ios.pool.maxDevices`);
|
|
6331
|
-
return pool;
|
|
6332
|
-
}
|
|
6333
|
-
function parseIos(value, filePath) {
|
|
6334
|
-
if (value === void 0) return void 0;
|
|
6335
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ios to be an object`);
|
|
6336
|
-
assertKeys(value, IOS_KEYS, "ios", filePath);
|
|
6337
|
-
const result = {};
|
|
6338
|
-
const pool = parseIosPool(value.pool, filePath);
|
|
6339
|
-
if (pool) result.pool = pool;
|
|
6340
|
-
const helperPath = optionalString(value.helperPath, "ios.helperPath", filePath);
|
|
6341
|
-
if (helperPath !== void 0) result.helperPath = helperPath;
|
|
6342
|
-
if (value.device !== void 0) {
|
|
6343
|
-
if (!isObject(value.device)) throw new Error(`Po config at ${filePath} requires ios.device to be an object`);
|
|
6344
|
-
assertKeys(value.device, IOS_DEVICE_KEYS, "ios.device", filePath);
|
|
6345
|
-
const developmentTeam = optionalString(value.device.developmentTeam, "ios.device.developmentTeam", filePath);
|
|
6346
|
-
if (developmentTeam !== void 0 && !/^[A-Z0-9]{10}$/.test(developmentTeam)) throw new Error(`Po config at ${filePath} requires ios.device.developmentTeam to be 10 uppercase letters or digits`);
|
|
6347
|
-
result.device = developmentTeam === void 0 ? {} : { developmentTeam };
|
|
6348
|
-
if (value.device.availability !== void 0) {
|
|
6349
|
-
const availability = value.device.availability;
|
|
6350
|
-
if (!isObject(availability) || Object.entries(availability).some(([udid, state]) => !/^[a-fA-F0-9]{8}-[a-fA-F0-9]{16}$|^[a-fA-F0-9]{40}$/.test(udid) || state !== "available" && state !== "excluded")) throw new Error(`Po config at ${filePath} requires ios.device.availability to map hardware UDIDs to available or excluded`);
|
|
6351
|
-
result.device.availability = { ...availability };
|
|
6352
|
-
}
|
|
6353
|
-
}
|
|
6354
|
-
return result;
|
|
6355
|
-
}
|
|
6356
|
-
/** `web` and `native` each choose a template, so both read the same `{ template }` shape. */
|
|
6357
|
-
function parseTemplateChoice(value, root, filePath) {
|
|
6358
|
-
if (value === void 0) return void 0;
|
|
6359
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires ${root} to be an object`);
|
|
6360
|
-
assertKeys(value, ["template"], root, filePath);
|
|
6361
|
-
if (value.template === void 0) return {};
|
|
6362
|
-
const template = optionalString(value.template, `${root}.template`, filePath);
|
|
6363
|
-
if (!template || template.length > 160 || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(template)) throw new Error(`Po config at ${filePath} requires ${root}.template to be a kebab-case template identifier`);
|
|
6364
|
-
return { template };
|
|
6365
|
-
}
|
|
6366
|
-
function parseComputerUse(value, filePath) {
|
|
6367
|
-
if (value === void 0) return void 0;
|
|
6368
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires computerUse to be an object`);
|
|
6369
|
-
assertKeys(value, COMPUTER_USE_KEYS, "computerUse", filePath);
|
|
6370
|
-
const enabled = parseFlexibleBoolean(value.enabled, "computerUse.enabled", filePath);
|
|
6371
|
-
return enabled === void 0 ? {} : { enabled };
|
|
6372
|
-
}
|
|
6373
|
-
function parseProfileMemory(value, filePath) {
|
|
6374
|
-
if (value === void 0) return void 0;
|
|
6375
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires profileMemory to be an object`);
|
|
6376
|
-
assertKeys(value, PROFILE_MEMORY_KEYS, "profileMemory", filePath);
|
|
6377
|
-
const automatic = parseFlexibleBoolean(value.automatic, "profileMemory.automatic", filePath);
|
|
6378
|
-
return automatic === void 0 ? {} : { automatic };
|
|
6379
|
-
}
|
|
6380
|
-
/** A list, or the comma-separated text the settings page writes for one. */
|
|
6381
|
-
function parseFlexibleList(value, location, filePath) {
|
|
6382
|
-
if (value === void 0) return void 0;
|
|
6383
|
-
const entries = typeof value === "string" ? value.split(",") : value;
|
|
6384
|
-
if (!Array.isArray(entries) || entries.some((entry) => typeof entry !== "string")) throw new Error(`Po config at ${filePath} requires ${location} to be a list of strings`);
|
|
6385
|
-
return [...new Set(entries.map((entry) => entry.trim()).filter(Boolean))];
|
|
6386
|
-
}
|
|
6387
|
-
function parseSubagents(value, filePath) {
|
|
6388
|
-
if (value === void 0) return void 0;
|
|
6389
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires subagents to be an object`);
|
|
6390
|
-
assertKeys(value, SUBAGENTS_KEYS, "subagents", filePath);
|
|
6391
|
-
const model = optionalString(value.model, "subagents.model", filePath);
|
|
6392
|
-
const thinking = parseThinking(value.thinking, "subagents", filePath);
|
|
6393
|
-
const fallbackModels = parseFlexibleList(value.fallbackModels, "subagents.fallbackModels", filePath);
|
|
6394
|
-
const excludeTools = parseFlexibleList(value.excludeTools, "subagents.excludeTools", filePath);
|
|
6395
|
-
return {
|
|
6396
|
-
...model ? { model } : {},
|
|
6397
|
-
...thinking ? { thinking } : {},
|
|
6398
|
-
...fallbackModels ? { fallbackModels } : {},
|
|
6399
|
-
...excludeTools ? { excludeTools } : {}
|
|
6400
|
-
};
|
|
6401
|
-
}
|
|
6402
|
-
function parseDesktopEnvironment(value, filePath) {
|
|
6403
|
-
if (value === void 0) return void 0;
|
|
6404
|
-
if (!isObject(value)) throw new Error(`Po config at ${filePath} requires desktopEnvironment to be an object`);
|
|
6405
|
-
assertKeys(value, DESKTOP_ENVIRONMENT_KEYS, "desktopEnvironment", filePath);
|
|
6406
|
-
if (value.inherit !== void 0 && value.inherit !== "all" && value.inherit !== "core") throw new Error(`Po config at ${filePath} desktopEnvironment.inherit must be all or core`);
|
|
6407
|
-
const exclude = parseFlexibleList(value.exclude, "desktopEnvironment.exclude", filePath);
|
|
6408
|
-
const includeOnly = parseFlexibleList(value.includeOnly, "desktopEnvironment.includeOnly", filePath);
|
|
6409
|
-
if (value.set !== void 0 && (!isObject(value.set) || Object.entries(value.set).some(([name, entry]) => !ENVIRONMENT_VARIABLE_NAME.test(name) || typeof entry !== "string"))) throw new Error(`Po config at ${filePath} requires desktopEnvironment.set to map variable names to strings`);
|
|
6410
|
-
return {
|
|
6411
|
-
...value.inherit === void 0 ? {} : { inherit: value.inherit },
|
|
6412
|
-
...exclude ? { exclude } : {},
|
|
6413
|
-
...includeOnly ? { includeOnly } : {},
|
|
6414
|
-
...value.set === void 0 ? {} : { set: { ...value.set } }
|
|
6415
|
-
};
|
|
6416
|
-
}
|
|
6417
|
-
function parsePoConfig(content, filePath, options) {
|
|
6418
|
-
if (options?.lenient !== true) return parseStrict(content, filePath);
|
|
6419
|
-
const diagnostics = [];
|
|
6420
|
-
const previous = unknownKeySink;
|
|
6421
|
-
unknownKeySink = diagnostics;
|
|
6422
|
-
try {
|
|
6423
|
-
return {
|
|
6424
|
-
config: parseStrict(content, filePath),
|
|
6425
|
-
diagnostics
|
|
6426
|
-
};
|
|
6427
|
-
} finally {
|
|
6428
|
-
unknownKeySink = previous;
|
|
5733
|
+
function stringify(value, replacer, options) {
|
|
5734
|
+
let _replacer = null;
|
|
5735
|
+
if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer;
|
|
5736
|
+
else if (options === void 0 && replacer) options = replacer;
|
|
5737
|
+
if (typeof options === "string") options = options.length;
|
|
5738
|
+
if (typeof options === "number") {
|
|
5739
|
+
const indent = Math.round(options);
|
|
5740
|
+
options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };
|
|
6429
5741
|
}
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
if (!Array.isArray(value)) throw new Error(`Po config at ${filePath} requires workspaces to be a list`);
|
|
6434
|
-
const names = /* @__PURE__ */ new Set();
|
|
6435
|
-
return value.map((entry, index) => {
|
|
6436
|
-
const location = `workspaces[${index}]`;
|
|
6437
|
-
if (!isObject(entry)) throw new Error(`Po config at ${filePath} requires ${location} to be an object`);
|
|
6438
|
-
assertKeys(entry, WORKSPACE_KEYS, location, filePath);
|
|
6439
|
-
const name = optionalString(entry.name, `${location}.name`, filePath);
|
|
6440
|
-
if (!name) throw new Error(`Po config at ${filePath} requires ${location}.name to be a non-empty string`);
|
|
6441
|
-
if (entry.instructions !== void 0 && typeof entry.instructions !== "string") throw new Error(`Po config at ${filePath} requires ${location}.instructions to be a string`);
|
|
6442
|
-
const key = name.toLowerCase();
|
|
6443
|
-
if (names.has(key)) throw new Error(`Po config at ${filePath} has duplicate ${location}.name: ${name}`);
|
|
6444
|
-
names.add(key);
|
|
6445
|
-
return {
|
|
6446
|
-
name,
|
|
6447
|
-
...entry.instructions === void 0 ? {} : { instructions: entry.instructions }
|
|
6448
|
-
};
|
|
6449
|
-
});
|
|
6450
|
-
}
|
|
6451
|
-
function parseStrict(content, filePath) {
|
|
6452
|
-
let parsed;
|
|
6453
|
-
try {
|
|
6454
|
-
parsed = parse(content) ?? {};
|
|
6455
|
-
} catch (error) {
|
|
6456
|
-
throw new Error(`Could not parse Po config at ${filePath}`, { cause: error });
|
|
6457
|
-
}
|
|
6458
|
-
if (!isObject(parsed)) throw new Error(`Po config at ${filePath} must be a YAML object`);
|
|
6459
|
-
assertKeys(parsed, ROOT_KEYS, "root", filePath);
|
|
6460
|
-
let modes;
|
|
6461
|
-
if (parsed.modes !== void 0) {
|
|
6462
|
-
if (!isObject(parsed.modes)) throw new Error(`Po config at ${filePath} requires modes to be an object`);
|
|
6463
|
-
assertKeys(parsed.modes, MODE_KEYS, "modes", filePath);
|
|
6464
|
-
modes = {
|
|
6465
|
-
...parsed.modes.planning === void 0 ? {} : { planning: parsePlanningModeConfig(parsed.modes.planning, filePath) },
|
|
6466
|
-
...parsed.modes.autocompact === void 0 ? {} : { autocompact: parseAutocompactModeConfig(parsed.modes.autocompact, filePath) }
|
|
6467
|
-
};
|
|
6468
|
-
}
|
|
6469
|
-
const trust = parsed.projectTrust === void 0 ? DEFAULT_PROJECT_TRUST : parsed.projectTrust;
|
|
6470
|
-
if (typeof trust !== "string" || !TRUST_VALUES.has(trust)) throw new Error(`Po config at ${filePath} projectTrust must be ask, always, or never`);
|
|
6471
|
-
return {
|
|
6472
|
-
modes,
|
|
6473
|
-
computerUse: parseComputerUse(parsed.computerUse, filePath),
|
|
6474
|
-
desktopEnvironment: parseDesktopEnvironment(parsed.desktopEnvironment, filePath),
|
|
6475
|
-
profileMemory: parseProfileMemory(parsed.profileMemory, filePath),
|
|
6476
|
-
subagents: parseSubagents(parsed.subagents, filePath),
|
|
6477
|
-
projectTrust: trust,
|
|
6478
|
-
workspaces: parseWorkspaces(parsed.workspaces, filePath),
|
|
6479
|
-
editor: parseEditor(parsed.editor, filePath),
|
|
6480
|
-
browse: parseBrowse(parsed.browse, filePath),
|
|
6481
|
-
ios: parseIos(parsed.ios, filePath),
|
|
6482
|
-
voice: parseVoice(parsed.voice, filePath),
|
|
6483
|
-
selection: parseSelection(parsed.selection, filePath),
|
|
6484
|
-
web: parseTemplateChoice(parsed.web, "web", filePath),
|
|
6485
|
-
native: parseTemplateChoice(parsed.native, "native", filePath)
|
|
6486
|
-
};
|
|
6487
|
-
}
|
|
6488
|
-
function mergeAgent(globalValue, repositoryValue) {
|
|
6489
|
-
return globalValue || repositoryValue ? {
|
|
6490
|
-
...globalValue,
|
|
6491
|
-
...repositoryValue
|
|
6492
|
-
} : void 0;
|
|
6493
|
-
}
|
|
6494
|
-
function mergePoConfigs(globalConfig, repositoryConfig) {
|
|
6495
|
-
if (repositoryConfig.voice?.mode) throw new Error("Repository Po config voice.mode is global-only; configure it in ~/.po/config.yaml");
|
|
6496
|
-
if (repositoryConfig.voice?.autoCapture) throw new Error("Repository Po config voice.autoCapture is global-only; configure it in ~/.po/config.yaml");
|
|
6497
|
-
if (repositoryConfig.voice?.live) throw new Error("Repository Po config voice.live is global-only; configure it in ~/.po/config.yaml");
|
|
6498
|
-
if (repositoryConfig.computerUse) throw new Error("Repository Po config computerUse is global-only; configure it in ~/.po/config.yaml");
|
|
6499
|
-
if (repositoryConfig.desktopEnvironment) throw new Error("Repository Po config desktopEnvironment is global-only; configure it in ~/.po/config.yaml");
|
|
6500
|
-
if (repositoryConfig.browse) throw new Error("Repository Po config browse is global-only; configure it in ~/.po/config.yaml");
|
|
6501
|
-
if (repositoryConfig.ios) throw new Error("Repository Po config ios is global-only; configure it in ~/.po/config.yaml");
|
|
6502
|
-
if (repositoryConfig.profileMemory) throw new Error("Repository Po config profileMemory is global-only; configure it in ~/.po/config.yaml");
|
|
6503
|
-
const globalPlanning = globalConfig.modes?.planning;
|
|
6504
|
-
const repositoryPlanning = repositoryConfig.modes?.planning;
|
|
6505
|
-
const planning = globalPlanning || repositoryPlanning ? {
|
|
6506
|
-
main: mergeAgent(globalPlanning?.main, repositoryPlanning?.main),
|
|
6507
|
-
subagents: mergeAgent(globalPlanning?.subagents, repositoryPlanning?.subagents),
|
|
6508
|
-
plansDirectory: repositoryPlanning?.plansDirectory ?? globalPlanning?.plansDirectory
|
|
6509
|
-
} : void 0;
|
|
6510
|
-
const globalAutocompact = globalConfig.modes?.autocompact;
|
|
6511
|
-
const repositoryAutocompact = repositoryConfig.modes?.autocompact;
|
|
6512
|
-
const autocompact = globalAutocompact || repositoryAutocompact ? {
|
|
6513
|
-
...globalAutocompact,
|
|
6514
|
-
...repositoryAutocompact,
|
|
6515
|
-
...globalAutocompact?.thresholds || repositoryAutocompact?.thresholds ? { thresholds: {
|
|
6516
|
-
...globalAutocompact?.thresholds,
|
|
6517
|
-
...repositoryAutocompact?.thresholds
|
|
6518
|
-
} } : {}
|
|
6519
|
-
} : void 0;
|
|
6520
|
-
const voice = mergeVoice(globalConfig.voice, repositoryConfig.voice);
|
|
6521
|
-
return {
|
|
6522
|
-
modes: planning || autocompact ? {
|
|
6523
|
-
...planning ? { planning } : {},
|
|
6524
|
-
...autocompact ? { autocompact } : {}
|
|
6525
|
-
} : void 0,
|
|
6526
|
-
computerUse: globalConfig.computerUse,
|
|
6527
|
-
desktopEnvironment: globalConfig.desktopEnvironment,
|
|
6528
|
-
profileMemory: globalConfig.profileMemory,
|
|
6529
|
-
subagents: globalConfig.subagents || repositoryConfig.subagents ? {
|
|
6530
|
-
...globalConfig.subagents,
|
|
6531
|
-
...repositoryConfig.subagents
|
|
6532
|
-
} : void 0,
|
|
6533
|
-
projectTrust: repositoryConfig.projectTrust,
|
|
6534
|
-
workspaces: repositoryConfig.workspaces,
|
|
6535
|
-
editor: globalConfig.editor,
|
|
6536
|
-
browse: globalConfig.browse,
|
|
6537
|
-
ios: globalConfig.ios,
|
|
6538
|
-
voice,
|
|
6539
|
-
web: globalConfig.web || repositoryConfig.web ? { template: repositoryConfig.web?.template ?? globalConfig.web?.template } : void 0,
|
|
6540
|
-
native: globalConfig.native || repositoryConfig.native ? { template: repositoryConfig.native?.template ?? globalConfig.native?.template } : void 0,
|
|
6541
|
-
selection: globalConfig.selection || repositoryConfig.selection ? {
|
|
6542
|
-
...globalConfig.selection,
|
|
6543
|
-
...repositoryConfig.selection
|
|
6544
|
-
} : void 0
|
|
6545
|
-
};
|
|
6546
|
-
}
|
|
6547
|
-
function mergeAdapter(globalValue, repositoryValue) {
|
|
6548
|
-
if (!globalValue && !repositoryValue) return void 0;
|
|
6549
|
-
return {
|
|
6550
|
-
...globalValue,
|
|
6551
|
-
...repositoryValue,
|
|
6552
|
-
model: repositoryValue?.model ?? globalValue.model
|
|
6553
|
-
};
|
|
6554
|
-
}
|
|
6555
|
-
function mergeVoice(globalValue, repositoryValue) {
|
|
6556
|
-
if (!globalValue && !repositoryValue) return void 0;
|
|
6557
|
-
return {
|
|
6558
|
-
...globalValue,
|
|
6559
|
-
...repositoryValue,
|
|
6560
|
-
...globalValue?.mode ? { mode: globalValue.mode } : {},
|
|
6561
|
-
recorder: globalValue?.recorder || repositoryValue?.recorder ? {
|
|
6562
|
-
...globalValue?.recorder,
|
|
6563
|
-
...repositoryValue?.recorder
|
|
6564
|
-
} : void 0,
|
|
6565
|
-
adapters: globalValue?.adapters || repositoryValue?.adapters ? {
|
|
6566
|
-
[WHISPER_CPP_ENGINE]: mergeAdapter(globalValue?.adapters?.[WHISPER_CPP_ENGINE], repositoryValue?.adapters?.[WHISPER_CPP_ENGINE]),
|
|
6567
|
-
[OPENAI_WHISPER_ENGINE]: mergeAdapter(globalValue?.adapters?.[OPENAI_WHISPER_ENGINE], repositoryValue?.adapters?.[OPENAI_WHISPER_ENGINE]),
|
|
6568
|
-
[MLX_WHISPER_ENGINE]: mergeAdapter(globalValue?.adapters?.[MLX_WHISPER_ENGINE], repositoryValue?.adapters?.[MLX_WHISPER_ENGINE])
|
|
6569
|
-
} : void 0,
|
|
6570
|
-
...globalValue?.autoCapture ? { autoCapture: globalValue.autoCapture } : {}
|
|
6571
|
-
};
|
|
6572
|
-
}
|
|
6573
|
-
/** Root keys the merge reads from one side only. */
|
|
6574
|
-
const GLOBAL_ONLY_ROOTS = [
|
|
6575
|
-
"computerUse",
|
|
6576
|
-
"desktopEnvironment",
|
|
6577
|
-
"profileMemory",
|
|
6578
|
-
"editor",
|
|
6579
|
-
"browse",
|
|
6580
|
-
"ios"
|
|
6581
|
-
];
|
|
6582
|
-
const REPOSITORY_ONLY_ROOTS = ["projectTrust", "workspaces"];
|
|
6583
|
-
/** Nested exceptions; a repository declaration of any of them throws in the merge. */
|
|
6584
|
-
const GLOBAL_ONLY_PATHS = [
|
|
6585
|
-
["voice", "mode"],
|
|
6586
|
-
["voice", "autoCapture"],
|
|
6587
|
-
["voice", "live"]
|
|
6588
|
-
];
|
|
6589
|
-
function startsWith(keyPath, prefix) {
|
|
6590
|
-
return prefix.length <= keyPath.length && prefix.every((segment, index) => keyPath[index] === segment);
|
|
6591
|
-
}
|
|
6592
|
-
/**
|
|
6593
|
-
* The scopes a key path accepts. An unknown root answers `both` rather than
|
|
6594
|
-
* throwing: the parser is what rejects unsupported keys, and it reports them
|
|
6595
|
-
* far better than a scope lookup could.
|
|
6596
|
-
*/
|
|
6597
|
-
function configScopeOf(keyPath) {
|
|
6598
|
-
if (keyPath.length === 0) return "both";
|
|
6599
|
-
if (GLOBAL_ONLY_PATHS.some((prefix) => startsWith(keyPath, prefix))) return "global";
|
|
6600
|
-
const root = keyPath[0];
|
|
6601
|
-
if (GLOBAL_ONLY_ROOTS.includes(root)) return "global";
|
|
6602
|
-
if (REPOSITORY_ONLY_ROOTS.includes(root)) return "repository";
|
|
6603
|
-
return "both";
|
|
6604
|
-
}
|
|
6605
|
-
//#endregion
|
|
6606
|
-
//#region ../../foundations/po-config/src/services/config/core.ts
|
|
6607
|
-
/**
|
|
6608
|
-
* Paths and pure parse/merge steps for the two Po config files. The readers
|
|
6609
|
-
* in `read.ts` (async, over a FileSystem) and `sync.ts` (Node-only shims) only
|
|
6610
|
-
* fetch file text and hand it here, so both produce identical results.
|
|
6611
|
-
*/
|
|
6612
|
-
const PO_DIR$1 = ".po";
|
|
6613
|
-
const CONFIG_FILE = "config.yaml";
|
|
6614
|
-
/** Runtime callers pass admitted environment; omission retains the legacy host lookup. */
|
|
6615
|
-
function globalPoConfigDirectory(homeDirectory = nodeHost.homeDirectory(), environment) {
|
|
6616
|
-
return poHomeDirectory(homeDirectory, environment);
|
|
6617
|
-
}
|
|
6618
|
-
function globalPoConfigPath(homeDirectory = nodeHost.homeDirectory(), environment) {
|
|
6619
|
-
return path.join(globalPoConfigDirectory(homeDirectory, environment), CONFIG_FILE);
|
|
6620
|
-
}
|
|
6621
|
-
function repositoryPoConfigPath(repoRoot) {
|
|
6622
|
-
return path.join(repoRoot, PO_DIR$1, CONFIG_FILE);
|
|
6623
|
-
}
|
|
6624
|
-
/**
|
|
6625
|
-
* True when a repository's `.po` folder is Po's home itself, as it is for a
|
|
6626
|
-
* session rooted at home. That folder is already the global layer; reading it
|
|
6627
|
-
* again as the repository layer would apply global-only keys at repository scope.
|
|
6628
|
-
*/
|
|
6629
|
-
function isGlobalPoConfigRoot(repoRoot, homeDirectory = nodeHost.homeDirectory(), environment) {
|
|
6630
|
-
return path.resolve(repoRoot, PO_DIR$1) === path.resolve(globalPoConfigDirectory(homeDirectory, environment));
|
|
6631
|
-
}
|
|
6632
|
-
function repositoryConfigFor(repoRoot, homeDirectory, environment) {
|
|
6633
|
-
return isGlobalPoConfigRoot(repoRoot, homeDirectory, environment) ? void 0 : repositoryPoConfigPath(repoRoot);
|
|
6634
|
-
}
|
|
6635
|
-
/** The config a missing file stands for. */
|
|
6636
|
-
function defaultPoConfig() {
|
|
6637
|
-
return { projectTrust: "ask" };
|
|
6638
|
-
}
|
|
6639
|
-
/** Parses one file's text strictly; `undefined` text means the file is absent. */
|
|
6640
|
-
function configFromText(text, filePath) {
|
|
6641
|
-
return text === void 0 ? defaultPoConfig() : parsePoConfig(text, filePath);
|
|
6642
|
-
}
|
|
6643
|
-
/** Process-local distribution defaults never grant native authority or modify user files. */
|
|
6644
|
-
function distributionDefaults(config, environment) {
|
|
6645
|
-
if (environment.PO_DISTRIBUTION !== "desktop") return config;
|
|
6646
|
-
return {
|
|
6647
|
-
...config,
|
|
6648
|
-
computerUse: {
|
|
6649
|
-
...config.computerUse,
|
|
6650
|
-
enabled: config.computerUse?.enabled ?? true
|
|
6651
|
-
}
|
|
6652
|
-
};
|
|
6653
|
-
}
|
|
6654
|
-
/** Merges the global and repository files, then applies distribution defaults. */
|
|
6655
|
-
function mergeConfigLayers(globalConfig, repositoryConfig, environment) {
|
|
6656
|
-
return distributionDefaults(mergePoConfigs(globalConfig, repositoryConfig), environment);
|
|
6657
|
-
}
|
|
6658
|
-
/**
|
|
6659
|
-
* The global and repository locations of one named `.po` document, lowest
|
|
6660
|
-
* precedence first.
|
|
6661
|
-
*/
|
|
6662
|
-
function poConfigCandidates(fileName, repoRoot, homeDirectory) {
|
|
6663
|
-
const globalDirectory = globalPoConfigDirectory(homeDirectory);
|
|
6664
|
-
const globalCandidate = {
|
|
6665
|
-
filePath: path.join(globalDirectory, fileName),
|
|
6666
|
-
baseDirectory: globalDirectory
|
|
6667
|
-
};
|
|
6668
|
-
if (isGlobalPoConfigRoot(repoRoot, homeDirectory)) return [globalCandidate];
|
|
6669
|
-
return [globalCandidate, {
|
|
6670
|
-
filePath: path.join(repoRoot, ".po", fileName),
|
|
6671
|
-
baseDirectory: repoRoot
|
|
6672
|
-
}];
|
|
6673
|
-
}
|
|
6674
|
-
/**
|
|
6675
|
-
* Parses one candidate's text into a source, or undefined when the file is
|
|
6676
|
-
* absent (`undefined` text) or empty. An empty file parses to null and is
|
|
6677
|
-
* treated as an absent one, so a seeded placeholder never has to be deleted to
|
|
6678
|
-
* get out of the way.
|
|
6679
|
-
*/
|
|
6680
|
-
function sourceFromText(candidate, text) {
|
|
6681
|
-
if (text === void 0) return void 0;
|
|
6682
|
-
const document = parse(text);
|
|
6683
|
-
if (document === null || document === void 0) return void 0;
|
|
6684
|
-
return {
|
|
6685
|
-
...candidate,
|
|
6686
|
-
text,
|
|
6687
|
-
document
|
|
6688
|
-
};
|
|
6689
|
-
}
|
|
6690
|
-
//#endregion
|
|
6691
|
-
//#region ../../foundations/po-config/src/services/layeredConfig/index.ts
|
|
6692
|
-
/**
|
|
6693
|
-
* Reads one named `.po` document from the global and repository config
|
|
6694
|
-
* directories over a FileSystem, lowest precedence first.
|
|
6695
|
-
*
|
|
6696
|
-
* A missing or empty file contributes nothing, so either location on its own is
|
|
6697
|
-
* a complete configuration, and a host with neither (a fresh edge filesystem)
|
|
6698
|
-
* reads no sources, as an empty Node home does. Documents are deliberately
|
|
6699
|
-
* returned unmerged: merging is by name, and only the caller knows what a name
|
|
6700
|
-
* means in its own document, so each one folds the sources itself with the
|
|
6701
|
-
* repository last.
|
|
6702
|
-
*/
|
|
6703
|
-
async function readPoConfigSourcesAsync(fs, fileName, repoRoot, context, homeDirectory) {
|
|
6704
|
-
const sources = [];
|
|
6705
|
-
for (const candidate of poConfigCandidates(fileName, repoRoot, homeDirectory)) {
|
|
6706
|
-
const source = sourceFromText(candidate, await readTextIfExists(fs, candidate.filePath, context));
|
|
6707
|
-
if (source) sources.push(source);
|
|
5742
|
+
if (value === void 0) {
|
|
5743
|
+
const { keepUndefined } = options ?? replacer ?? {};
|
|
5744
|
+
if (!keepUndefined) return void 0;
|
|
6708
5745
|
}
|
|
6709
|
-
return
|
|
5746
|
+
if (isDocument(value) && !_replacer) return value.toString(options);
|
|
5747
|
+
return new Document(value, _replacer, options).toString(options);
|
|
6710
5748
|
}
|
|
6711
5749
|
//#endregion
|
|
6712
|
-
export {
|
|
5750
|
+
export { YAMLMap as a, isSeq as c, Document as i, parseDocument as n, isMap as o, stringify as r, isScalar as s, parse as t };
|