@agimon-ai/po-cloudflare 0.0.2-alpha.50 → 0.0.2-alpha.51
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/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/log.cb964209-fNzkDPt3.js +4 -0
- package/dist/assets/plugins/slots/runner.6e494d59-BLvGGDH3.js +9 -0
- package/dist/{dist-B-vqs6tA.js → dist-C6IqjC-m.js} +1 -1
- package/dist/{edge-DFU343Be.js → edge-Cfb0Cf0P.js} +99 -2
- package/dist/{http-BjbClq7Q.js → http-Y7RgksEk.js} +6 -1
- package/dist/index.edge-BeOSOpbm.js +234 -0
- package/dist/{server-C3lGe-sy.js → server-B1rart8N.js} +1 -1
- package/dist/{server-EjgeojQz.js → server-BeQGmWqX.js} +1 -1
- package/dist/{server-C-NEhHuy.js → server-C2MrXBJb.js} +30 -34
- package/dist/{server-Jin4SYAk.js → server-CZGElu5H.js} +2 -3
- package/dist/{server-BwztYUCh.js → server-CbgKPeql.js} +1 -1
- package/dist/server-CbvQKpeA.js +816 -0
- package/dist/{server-BtK7Ja-V.js → server-D9-EbgdR.js} +20 -5
- package/dist/{server-Bzb_ZL02.js → server-DhZ_GJaA.js} +2 -2
- package/dist/worker.js +351 -68
- package/package.json +39 -39
- package/wrangler.jsonc +3 -0
- package/dist/artifactFiles-YozWvMHZ.js +0 -1
- package/dist/assets/plugins/slots/log.19bda339-BAzKHYY8.js +0 -4
- package/dist/assets/plugins/slots/runner.962030e5-C3VAYDKl.js +0 -8
- package/dist/index.edge-CyGkGu9u.js +0 -82
- package/dist/server-Bf-pCwOK.js +0 -288
- /package/dist/assets/plugins/slots/{approval.dd60ec90-CR2OaKdj.js → approval.09e72f36-CR2OaKdj.js} +0 -0
- /package/dist/assets/plugins/slots/{artifacts.a078f1a5-DXOy-Db5.js → artifacts.50b639bb-DXOy-Db5.js} +0 -0
- /package/dist/assets/plugins/slots/{author.497633d0-DjkOdKb_.js → author.7eb49c21-DjkOdKb_.js} +0 -0
- /package/dist/assets/plugins/slots/{autocompact.86aeccf4-CCAkxpcf.js → autocompact.6f428144-CCAkxpcf.js} +0 -0
- /package/dist/assets/plugins/slots/{browse.5fcf164c-D2F6in0q.js → browse.28bf5167-D2F6in0q.js} +0 -0
- /package/dist/assets/plugins/slots/{builtin-tools.0a7f0b8e-KLaHCXJX.js → builtin-tools.75108f21-KLaHCXJX.js} +0 -0
- /package/dist/assets/plugins/slots/{codemode.ff16ac06-ctjp1saw.js → codemode.c58fb583-ctjp1saw.js} +0 -0
- /package/dist/assets/plugins/slots/{domain.3ddea842-D4VgRtoX.js → domain.753f9f92-D4VgRtoX.js} +0 -0
- /package/dist/assets/plugins/slots/{edit.c5b0b072-CYrIo7XF.js → edit.804fec90-CYrIo7XF.js} +0 -0
- /package/dist/assets/plugins/slots/{files.8ffcdcc0-DBjHUcji.js → files.66ffc636-DBjHUcji.js} +0 -0
- /package/dist/assets/plugins/slots/{goal.423c7a26-Ds3wyEeZ.js → goal.eb0b7cc4-Ds3wyEeZ.js} +0 -0
- /package/dist/assets/plugins/slots/{grep.95f470b3-3TszNGfJ.js → grep.98262cff-3TszNGfJ.js} +0 -0
- /package/dist/assets/plugins/slots/{help.03b9ba99-BHoaVx3j.js → help.a9c62f11-BHoaVx3j.js} +0 -0
- /package/dist/assets/plugins/slots/{mcp.ffbe405a-BHFKcU6F.js → mcp.82cc1ff5-BHFKcU6F.js} +0 -0
- /package/dist/assets/plugins/slots/{plan.5eac6563-B5nViq3a.js → plan.4d282d5b-B5nViq3a.js} +0 -0
- /package/dist/assets/plugins/slots/{profile.176710dd-Cf1v3fyE.js → profile.ab16dcec-Cf1v3fyE.js} +0 -0
- /package/dist/assets/plugins/slots/{prompts.2c187969-BiyzyQgT.js → prompts.ae48c07a-BiyzyQgT.js} +0 -0
- /package/dist/assets/plugins/slots/{read.1629d556-kJqaLIcB.js → read.4560591a-kJqaLIcB.js} +0 -0
- /package/dist/assets/plugins/slots/{sessions.fc763f42-IDfQ1Gsb.js → sessions.6f47cb4c-IDfQ1Gsb.js} +0 -0
- /package/dist/assets/plugins/slots/{skill.f5396fde-CzGijuLN.js → skill.62a0a1b3-CzGijuLN.js} +0 -0
- /package/dist/assets/plugins/slots/{subagents.d815a296-B4OPMPsa.js → subagents.66369ef5-B4OPMPsa.js} +0 -0
- /package/dist/assets/plugins/slots/{vault.57fd9047-CV5AIlOK.js → vault.3cbfcdc3-CV5AIlOK.js} +0 -0
- /package/dist/assets/plugins/slots/{voice.b709d05c-BXO76eLb.js → voice.bbb514bc-BXO76eLb.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"host":{"id":"606645aa94884c3ca9c5406d1a52215cac8b8b2ac2c9dcbb4dbe01816450733b","scope":"host","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.dd60ec90","/slots/approval.dd60ec90-CR2OaKdj.js"],["artifacts.a078f1a5","/slots/artifacts.a078f1a5-DXOy-Db5.js"],["author.497633d0","/slots/author.497633d0-DjkOdKb_.js"],["autocompact.86aeccf4","/slots/autocompact.86aeccf4-CCAkxpcf.js"],["browse.5fcf164c","/slots/browse.5fcf164c-D2F6in0q.js"],["builtin-tools.0a7f0b8e","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js"],["codemode.ff16ac06","/slots/codemode.ff16ac06-ctjp1saw.js"],["domain.3ddea842","/slots/domain.3ddea842-D4VgRtoX.js"],["edit.c5b0b072","/slots/edit.c5b0b072-CYrIo7XF.js"],["files.8ffcdcc0","/slots/files.8ffcdcc0-DBjHUcji.js"],["goal.423c7a26","/slots/goal.423c7a26-Ds3wyEeZ.js"],["grep.95f470b3","/slots/grep.95f470b3-3TszNGfJ.js"],["help.03b9ba99","/slots/help.03b9ba99-BHoaVx3j.js"],["log.19bda339","/slots/log.19bda339-BAzKHYY8.js"],["mcp.ffbe405a","/slots/mcp.ffbe405a-BHFKcU6F.js"],["plan.5eac6563","/slots/plan.5eac6563-B5nViq3a.js"],["profile.176710dd","/slots/profile.176710dd-Cf1v3fyE.js"],["prompts.2c187969","/slots/prompts.2c187969-BiyzyQgT.js"],["read.1629d556","/slots/read.1629d556-kJqaLIcB.js"],["runner.962030e5","/slots/runner.962030e5-C3VAYDKl.js"],["sessions.fc763f42","/slots/sessions.fc763f42-IDfQ1Gsb.js"],["skill.f5396fde","/slots/skill.f5396fde-CzGijuLN.js"],["subagents.d815a296","/slots/subagents.d815a296-B4OPMPsa.js"],["vault.57fd9047","/slots/vault.57fd9047-CV5AIlOK.js"],["voice.b709d05c","/slots/voice.b709d05c-BXO76eLb.js"]],"assetPaths":["/slots/approval.dd60ec90-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.a078f1a5-DXOy-Db5.js","/slots/author.497633d0-DjkOdKb_.js","/slots/autocompact.86aeccf4-CCAkxpcf.js","/slots/browse.5fcf164c-D2F6in0q.js","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js","/slots/codemode.ff16ac06-ctjp1saw.js","/slots/domain.3ddea842-D4VgRtoX.js","/slots/edit.c5b0b072-CYrIo7XF.js","/slots/files.8ffcdcc0-DBjHUcji.js","/slots/goal.423c7a26-Ds3wyEeZ.js","/slots/grep.95f470b3-3TszNGfJ.js","/slots/help.03b9ba99-BHoaVx3j.js","/slots/log.19bda339-BAzKHYY8.js","/slots/mcp.ffbe405a-BHFKcU6F.js","/slots/plan.5eac6563-B5nViq3a.js","/slots/profile.176710dd-Cf1v3fyE.js","/slots/prompts.2c187969-BiyzyQgT.js","/slots/read.1629d556-kJqaLIcB.js","/slots/runner.962030e5-C3VAYDKl.js","/slots/sessions.fc763f42-IDfQ1Gsb.js","/slots/skill.f5396fde-CzGijuLN.js","/slots/subagents.d815a296-B4OPMPsa.js","/slots/vault.57fd9047-CV5AIlOK.js","/slots/voice.b709d05c-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.dd60ec90","artifacts.a078f1a5","author.497633d0","autocompact.86aeccf4","browse.5fcf164c","builtin-tools.0a7f0b8e","codemode.ff16ac06","domain.3ddea842","edit.c5b0b072","files.8ffcdcc0","goal.423c7a26","grep.95f470b3","help.03b9ba99","log.19bda339","mcp.ffbe405a","plan.5eac6563","profile.176710dd","prompts.2c187969","read.1629d556","runner.962030e5","sessions.fc763f42","skill.f5396fde","subagents.d815a296","vault.57fd9047","voice.b709d05c"]},"workspace":{"id":"606645aa94884c3ca9c5406d1a52215cac8b8b2ac2c9dcbb4dbe01816450733b","scope":"workspace","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.dd60ec90","/slots/approval.dd60ec90-CR2OaKdj.js"],["artifacts.a078f1a5","/slots/artifacts.a078f1a5-DXOy-Db5.js"],["author.497633d0","/slots/author.497633d0-DjkOdKb_.js"],["autocompact.86aeccf4","/slots/autocompact.86aeccf4-CCAkxpcf.js"],["browse.5fcf164c","/slots/browse.5fcf164c-D2F6in0q.js"],["builtin-tools.0a7f0b8e","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js"],["codemode.ff16ac06","/slots/codemode.ff16ac06-ctjp1saw.js"],["domain.3ddea842","/slots/domain.3ddea842-D4VgRtoX.js"],["edit.c5b0b072","/slots/edit.c5b0b072-CYrIo7XF.js"],["files.8ffcdcc0","/slots/files.8ffcdcc0-DBjHUcji.js"],["goal.423c7a26","/slots/goal.423c7a26-Ds3wyEeZ.js"],["grep.95f470b3","/slots/grep.95f470b3-3TszNGfJ.js"],["help.03b9ba99","/slots/help.03b9ba99-BHoaVx3j.js"],["log.19bda339","/slots/log.19bda339-BAzKHYY8.js"],["mcp.ffbe405a","/slots/mcp.ffbe405a-BHFKcU6F.js"],["plan.5eac6563","/slots/plan.5eac6563-B5nViq3a.js"],["profile.176710dd","/slots/profile.176710dd-Cf1v3fyE.js"],["prompts.2c187969","/slots/prompts.2c187969-BiyzyQgT.js"],["read.1629d556","/slots/read.1629d556-kJqaLIcB.js"],["runner.962030e5","/slots/runner.962030e5-C3VAYDKl.js"],["sessions.fc763f42","/slots/sessions.fc763f42-IDfQ1Gsb.js"],["skill.f5396fde","/slots/skill.f5396fde-CzGijuLN.js"],["subagents.d815a296","/slots/subagents.d815a296-B4OPMPsa.js"],["vault.57fd9047","/slots/vault.57fd9047-CV5AIlOK.js"],["voice.b709d05c","/slots/voice.b709d05c-BXO76eLb.js"]],"assetPaths":["/slots/approval.dd60ec90-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.a078f1a5-DXOy-Db5.js","/slots/author.497633d0-DjkOdKb_.js","/slots/autocompact.86aeccf4-CCAkxpcf.js","/slots/browse.5fcf164c-D2F6in0q.js","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js","/slots/codemode.ff16ac06-ctjp1saw.js","/slots/domain.3ddea842-D4VgRtoX.js","/slots/edit.c5b0b072-CYrIo7XF.js","/slots/files.8ffcdcc0-DBjHUcji.js","/slots/goal.423c7a26-Ds3wyEeZ.js","/slots/grep.95f470b3-3TszNGfJ.js","/slots/help.03b9ba99-BHoaVx3j.js","/slots/log.19bda339-BAzKHYY8.js","/slots/mcp.ffbe405a-BHFKcU6F.js","/slots/plan.5eac6563-B5nViq3a.js","/slots/profile.176710dd-Cf1v3fyE.js","/slots/prompts.2c187969-BiyzyQgT.js","/slots/read.1629d556-kJqaLIcB.js","/slots/runner.962030e5-C3VAYDKl.js","/slots/sessions.fc763f42-IDfQ1Gsb.js","/slots/skill.f5396fde-CzGijuLN.js","/slots/subagents.d815a296-B4OPMPsa.js","/slots/vault.57fd9047-CV5AIlOK.js","/slots/voice.b709d05c-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.dd60ec90","artifacts.a078f1a5","author.497633d0","autocompact.86aeccf4","browse.5fcf164c","builtin-tools.0a7f0b8e","codemode.ff16ac06","domain.3ddea842","edit.c5b0b072","files.8ffcdcc0","goal.423c7a26","grep.95f470b3","help.03b9ba99","log.19bda339","mcp.ffbe405a","plan.5eac6563","profile.176710dd","prompts.2c187969","read.1629d556","runner.962030e5","sessions.fc763f42","skill.f5396fde","subagents.d815a296","vault.57fd9047","voice.b709d05c"]},"session":{"id":"606645aa94884c3ca9c5406d1a52215cac8b8b2ac2c9dcbb4dbe01816450733b","scope":"session","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.dd60ec90","/slots/approval.dd60ec90-CR2OaKdj.js"],["artifacts.a078f1a5","/slots/artifacts.a078f1a5-DXOy-Db5.js"],["author.497633d0","/slots/author.497633d0-DjkOdKb_.js"],["autocompact.86aeccf4","/slots/autocompact.86aeccf4-CCAkxpcf.js"],["browse.5fcf164c","/slots/browse.5fcf164c-D2F6in0q.js"],["builtin-tools.0a7f0b8e","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js"],["codemode.ff16ac06","/slots/codemode.ff16ac06-ctjp1saw.js"],["domain.3ddea842","/slots/domain.3ddea842-D4VgRtoX.js"],["edit.c5b0b072","/slots/edit.c5b0b072-CYrIo7XF.js"],["files.8ffcdcc0","/slots/files.8ffcdcc0-DBjHUcji.js"],["goal.423c7a26","/slots/goal.423c7a26-Ds3wyEeZ.js"],["grep.95f470b3","/slots/grep.95f470b3-3TszNGfJ.js"],["help.03b9ba99","/slots/help.03b9ba99-BHoaVx3j.js"],["log.19bda339","/slots/log.19bda339-BAzKHYY8.js"],["mcp.ffbe405a","/slots/mcp.ffbe405a-BHFKcU6F.js"],["plan.5eac6563","/slots/plan.5eac6563-B5nViq3a.js"],["profile.176710dd","/slots/profile.176710dd-Cf1v3fyE.js"],["prompts.2c187969","/slots/prompts.2c187969-BiyzyQgT.js"],["read.1629d556","/slots/read.1629d556-kJqaLIcB.js"],["runner.962030e5","/slots/runner.962030e5-C3VAYDKl.js"],["sessions.fc763f42","/slots/sessions.fc763f42-IDfQ1Gsb.js"],["skill.f5396fde","/slots/skill.f5396fde-CzGijuLN.js"],["subagents.d815a296","/slots/subagents.d815a296-B4OPMPsa.js"],["vault.57fd9047","/slots/vault.57fd9047-CV5AIlOK.js"],["voice.b709d05c","/slots/voice.b709d05c-BXO76eLb.js"]],"assetPaths":["/slots/approval.dd60ec90-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.a078f1a5-DXOy-Db5.js","/slots/author.497633d0-DjkOdKb_.js","/slots/autocompact.86aeccf4-CCAkxpcf.js","/slots/browse.5fcf164c-D2F6in0q.js","/slots/builtin-tools.0a7f0b8e-KLaHCXJX.js","/slots/codemode.ff16ac06-ctjp1saw.js","/slots/domain.3ddea842-D4VgRtoX.js","/slots/edit.c5b0b072-CYrIo7XF.js","/slots/files.8ffcdcc0-DBjHUcji.js","/slots/goal.423c7a26-Ds3wyEeZ.js","/slots/grep.95f470b3-3TszNGfJ.js","/slots/help.03b9ba99-BHoaVx3j.js","/slots/log.19bda339-BAzKHYY8.js","/slots/mcp.ffbe405a-BHFKcU6F.js","/slots/plan.5eac6563-B5nViq3a.js","/slots/profile.176710dd-Cf1v3fyE.js","/slots/prompts.2c187969-BiyzyQgT.js","/slots/read.1629d556-kJqaLIcB.js","/slots/runner.962030e5-C3VAYDKl.js","/slots/sessions.fc763f42-IDfQ1Gsb.js","/slots/skill.f5396fde-CzGijuLN.js","/slots/subagents.d815a296-B4OPMPsa.js","/slots/vault.57fd9047-CV5AIlOK.js","/slots/voice.b709d05c-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.dd60ec90","artifacts.a078f1a5","author.497633d0","autocompact.86aeccf4","browse.5fcf164c","builtin-tools.0a7f0b8e","codemode.ff16ac06","domain.3ddea842","edit.c5b0b072","files.8ffcdcc0","goal.423c7a26","grep.95f470b3","help.03b9ba99","log.19bda339","mcp.ffbe405a","plan.5eac6563","profile.176710dd","prompts.2c187969","read.1629d556","runner.962030e5","sessions.fc763f42","skill.f5396fde","subagents.d815a296","vault.57fd9047","voice.b709d05c"]}}
|
|
1
|
+
{"host":{"id":"fc837f3cf8ecfbcaad2962fa6e9f688aae1d0b43e87001816ee12891ca0ae6dd","scope":"host","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CR2OaKdj.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DXOy-Db5.js"],["author.7eb49c21","/slots/author.7eb49c21-DjkOdKb_.js"],["autocompact.6f428144","/slots/autocompact.6f428144-CCAkxpcf.js"],["browse.28bf5167","/slots/browse.28bf5167-D2F6in0q.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-KLaHCXJX.js"],["codemode.c58fb583","/slots/codemode.c58fb583-ctjp1saw.js"],["domain.753f9f92","/slots/domain.753f9f92-D4VgRtoX.js"],["edit.804fec90","/slots/edit.804fec90-CYrIo7XF.js"],["files.66ffc636","/slots/files.66ffc636-DBjHUcji.js"],["goal.eb0b7cc4","/slots/goal.eb0b7cc4-Ds3wyEeZ.js"],["grep.98262cff","/slots/grep.98262cff-3TszNGfJ.js"],["help.a9c62f11","/slots/help.a9c62f11-BHoaVx3j.js"],["log.cb964209","/slots/log.cb964209-fNzkDPt3.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-BHFKcU6F.js"],["plan.4d282d5b","/slots/plan.4d282d5b-B5nViq3a.js"],["profile.ab16dcec","/slots/profile.ab16dcec-Cf1v3fyE.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-BiyzyQgT.js"],["read.4560591a","/slots/read.4560591a-kJqaLIcB.js"],["runner.6e494d59","/slots/runner.6e494d59-BLvGGDH3.js"],["sessions.6f47cb4c","/slots/sessions.6f47cb4c-IDfQ1Gsb.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CzGijuLN.js"],["subagents.66369ef5","/slots/subagents.66369ef5-B4OPMPsa.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-CV5AIlOK.js"],["voice.bbb514bc","/slots/voice.bbb514bc-BXO76eLb.js"]],"assetPaths":["/slots/approval.09e72f36-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DXOy-Db5.js","/slots/author.7eb49c21-DjkOdKb_.js","/slots/autocompact.6f428144-CCAkxpcf.js","/slots/browse.28bf5167-D2F6in0q.js","/slots/builtin-tools.75108f21-KLaHCXJX.js","/slots/codemode.c58fb583-ctjp1saw.js","/slots/domain.753f9f92-D4VgRtoX.js","/slots/edit.804fec90-CYrIo7XF.js","/slots/files.66ffc636-DBjHUcji.js","/slots/goal.eb0b7cc4-Ds3wyEeZ.js","/slots/grep.98262cff-3TszNGfJ.js","/slots/help.a9c62f11-BHoaVx3j.js","/slots/log.cb964209-fNzkDPt3.js","/slots/mcp.82cc1ff5-BHFKcU6F.js","/slots/plan.4d282d5b-B5nViq3a.js","/slots/profile.ab16dcec-Cf1v3fyE.js","/slots/prompts.ae48c07a-BiyzyQgT.js","/slots/read.4560591a-kJqaLIcB.js","/slots/runner.6e494d59-BLvGGDH3.js","/slots/sessions.6f47cb4c-IDfQ1Gsb.js","/slots/skill.62a0a1b3-CzGijuLN.js","/slots/subagents.66369ef5-B4OPMPsa.js","/slots/vault.3cbfcdc3-CV5AIlOK.js","/slots/voice.bbb514bc-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.09e72f36","artifacts.50b639bb","author.7eb49c21","autocompact.6f428144","browse.28bf5167","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","goal.eb0b7cc4","grep.98262cff","help.a9c62f11","log.cb964209","mcp.82cc1ff5","plan.4d282d5b","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","sessions.6f47cb4c","skill.62a0a1b3","subagents.66369ef5","vault.3cbfcdc3","voice.bbb514bc"]},"workspace":{"id":"fc837f3cf8ecfbcaad2962fa6e9f688aae1d0b43e87001816ee12891ca0ae6dd","scope":"workspace","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CR2OaKdj.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DXOy-Db5.js"],["author.7eb49c21","/slots/author.7eb49c21-DjkOdKb_.js"],["autocompact.6f428144","/slots/autocompact.6f428144-CCAkxpcf.js"],["browse.28bf5167","/slots/browse.28bf5167-D2F6in0q.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-KLaHCXJX.js"],["codemode.c58fb583","/slots/codemode.c58fb583-ctjp1saw.js"],["domain.753f9f92","/slots/domain.753f9f92-D4VgRtoX.js"],["edit.804fec90","/slots/edit.804fec90-CYrIo7XF.js"],["files.66ffc636","/slots/files.66ffc636-DBjHUcji.js"],["goal.eb0b7cc4","/slots/goal.eb0b7cc4-Ds3wyEeZ.js"],["grep.98262cff","/slots/grep.98262cff-3TszNGfJ.js"],["help.a9c62f11","/slots/help.a9c62f11-BHoaVx3j.js"],["log.cb964209","/slots/log.cb964209-fNzkDPt3.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-BHFKcU6F.js"],["plan.4d282d5b","/slots/plan.4d282d5b-B5nViq3a.js"],["profile.ab16dcec","/slots/profile.ab16dcec-Cf1v3fyE.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-BiyzyQgT.js"],["read.4560591a","/slots/read.4560591a-kJqaLIcB.js"],["runner.6e494d59","/slots/runner.6e494d59-BLvGGDH3.js"],["sessions.6f47cb4c","/slots/sessions.6f47cb4c-IDfQ1Gsb.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CzGijuLN.js"],["subagents.66369ef5","/slots/subagents.66369ef5-B4OPMPsa.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-CV5AIlOK.js"],["voice.bbb514bc","/slots/voice.bbb514bc-BXO76eLb.js"]],"assetPaths":["/slots/approval.09e72f36-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DXOy-Db5.js","/slots/author.7eb49c21-DjkOdKb_.js","/slots/autocompact.6f428144-CCAkxpcf.js","/slots/browse.28bf5167-D2F6in0q.js","/slots/builtin-tools.75108f21-KLaHCXJX.js","/slots/codemode.c58fb583-ctjp1saw.js","/slots/domain.753f9f92-D4VgRtoX.js","/slots/edit.804fec90-CYrIo7XF.js","/slots/files.66ffc636-DBjHUcji.js","/slots/goal.eb0b7cc4-Ds3wyEeZ.js","/slots/grep.98262cff-3TszNGfJ.js","/slots/help.a9c62f11-BHoaVx3j.js","/slots/log.cb964209-fNzkDPt3.js","/slots/mcp.82cc1ff5-BHFKcU6F.js","/slots/plan.4d282d5b-B5nViq3a.js","/slots/profile.ab16dcec-Cf1v3fyE.js","/slots/prompts.ae48c07a-BiyzyQgT.js","/slots/read.4560591a-kJqaLIcB.js","/slots/runner.6e494d59-BLvGGDH3.js","/slots/sessions.6f47cb4c-IDfQ1Gsb.js","/slots/skill.62a0a1b3-CzGijuLN.js","/slots/subagents.66369ef5-B4OPMPsa.js","/slots/vault.3cbfcdc3-CV5AIlOK.js","/slots/voice.bbb514bc-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.09e72f36","artifacts.50b639bb","author.7eb49c21","autocompact.6f428144","browse.28bf5167","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","goal.eb0b7cc4","grep.98262cff","help.a9c62f11","log.cb964209","mcp.82cc1ff5","plan.4d282d5b","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","sessions.6f47cb4c","skill.62a0a1b3","subagents.66369ef5","vault.3cbfcdc3","voice.bbb514bc"]},"session":{"id":"fc837f3cf8ecfbcaad2962fa6e9f688aae1d0b43e87001816ee12891ca0ae6dd","scope":"session","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CR2OaKdj.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DXOy-Db5.js"],["author.7eb49c21","/slots/author.7eb49c21-DjkOdKb_.js"],["autocompact.6f428144","/slots/autocompact.6f428144-CCAkxpcf.js"],["browse.28bf5167","/slots/browse.28bf5167-D2F6in0q.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-KLaHCXJX.js"],["codemode.c58fb583","/slots/codemode.c58fb583-ctjp1saw.js"],["domain.753f9f92","/slots/domain.753f9f92-D4VgRtoX.js"],["edit.804fec90","/slots/edit.804fec90-CYrIo7XF.js"],["files.66ffc636","/slots/files.66ffc636-DBjHUcji.js"],["goal.eb0b7cc4","/slots/goal.eb0b7cc4-Ds3wyEeZ.js"],["grep.98262cff","/slots/grep.98262cff-3TszNGfJ.js"],["help.a9c62f11","/slots/help.a9c62f11-BHoaVx3j.js"],["log.cb964209","/slots/log.cb964209-fNzkDPt3.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-BHFKcU6F.js"],["plan.4d282d5b","/slots/plan.4d282d5b-B5nViq3a.js"],["profile.ab16dcec","/slots/profile.ab16dcec-Cf1v3fyE.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-BiyzyQgT.js"],["read.4560591a","/slots/read.4560591a-kJqaLIcB.js"],["runner.6e494d59","/slots/runner.6e494d59-BLvGGDH3.js"],["sessions.6f47cb4c","/slots/sessions.6f47cb4c-IDfQ1Gsb.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CzGijuLN.js"],["subagents.66369ef5","/slots/subagents.66369ef5-B4OPMPsa.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-CV5AIlOK.js"],["voice.bbb514bc","/slots/voice.bbb514bc-BXO76eLb.js"]],"assetPaths":["/slots/approval.09e72f36-CR2OaKdj.js","/chunks/po-web-runtime-DLnDPODx.js","/assets/base-B0t0AVu8.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DXOy-Db5.js","/slots/author.7eb49c21-DjkOdKb_.js","/slots/autocompact.6f428144-CCAkxpcf.js","/slots/browse.28bf5167-D2F6in0q.js","/slots/builtin-tools.75108f21-KLaHCXJX.js","/slots/codemode.c58fb583-ctjp1saw.js","/slots/domain.753f9f92-D4VgRtoX.js","/slots/edit.804fec90-CYrIo7XF.js","/slots/files.66ffc636-DBjHUcji.js","/slots/goal.eb0b7cc4-Ds3wyEeZ.js","/slots/grep.98262cff-3TszNGfJ.js","/slots/help.a9c62f11-BHoaVx3j.js","/slots/log.cb964209-fNzkDPt3.js","/slots/mcp.82cc1ff5-BHFKcU6F.js","/slots/plan.4d282d5b-B5nViq3a.js","/slots/profile.ab16dcec-Cf1v3fyE.js","/slots/prompts.ae48c07a-BiyzyQgT.js","/slots/read.4560591a-kJqaLIcB.js","/slots/runner.6e494d59-BLvGGDH3.js","/slots/sessions.6f47cb4c-IDfQ1Gsb.js","/slots/skill.62a0a1b3-CzGijuLN.js","/slots/subagents.66369ef5-B4OPMPsa.js","/slots/vault.3cbfcdc3-CV5AIlOK.js","/slots/voice.bbb514bc-BXO76eLb.js","/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js","/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx","/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs"],"stylePaths":["/assets/base-B0t0AVu8.css"],"channels":["approval_activity","artifacts","browse_activity","codemode_background","file_edits","runner_runs","subagent_catalog","subagent_runs","author_webmcp","voice_media_wake","voice_ownership"],"plugins":["approval.09e72f36","artifacts.50b639bb","author.7eb49c21","autocompact.6f428144","browse.28bf5167","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","goal.eb0b7cc4","grep.98262cff","help.a9c62f11","log.cb964209","mcp.82cc1ff5","plan.4d282d5b","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","sessions.6f47cb4c","skill.62a0a1b3","subagents.66369ef5","vault.3cbfcdc3","voice.bbb514bc"]}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$t as e,Ar as t,Br as n,Cn as r,F as i,It as a,Lr as o,Lt as s,M as c,N as l,Nn as u,P as d,Pr as f,a as p,at as m,ct as h,d as g,f as _,ft as v,g as y,gr as b,h as x,hr as S,it as C,j as w,n as T,o as E,ot as D,rr as ee,rt as O,s as k,sn as te,st as A,vr as ne}from"../chunks/po-web-runtime-DLnDPODx.js";var re=[`session`,`agent`,`model`,`provider`],ie=[`day`,`week`,`month`,`all`],j={dimension:`dimension`,period:`period`,focus:`focus`};function M(e){return`unavailable`in e}function ae(e){return`unavailable`in e}var oe=ne({metrics:{method:`GET`,path:`/metrics`,query:[j.dimension,j.period,j.focus],response:S()},issues:{method:`GET`,path:`/issues`,query:[j.focus],response:S()},usage:{method:`GET`,path:`/usage`,response:S()},ingestLogs:{method:`POST`,path:`/v1/logs`,response:S()}}),N=b(oe,{scopes:[`host`,`workspace`,`session`],basePath:`log`,transport:(e,t)=>T.fetch(e,t),sessionAddress:n}),se=`The cockpit hub is unreachable.`,ce=`This cockpit is running a bundle without the log package API, so there are no metrics to read.`,le={unavailable:`no-api`,detail:ce};function ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function P(e,t){if(e.status===0)return{error:t?.aborted===!0?``:se};let n=`The hub answered ${String(e.status)}.`;return e.data===void 0?e.ok?{noApi:!0}:{error:n}:ue(e.data)?e.ok?{body:e.data}:{error:e.error===``?n:e.error}:{error:`The hub returned a response the cockpit could not read.`}}async function de(e,t,n,r){let i=P(await N.host.metrics({query:{[j.dimension]:e,[j.period]:t,[j.focus]:n===``?void 0:n},...r===void 0?{}:{signal:r}}),r);if(`error`in i)return{error:i.error};if(`noApi`in i)return{report:le};let a=i.body;return!M(a)&&!Array.isArray(a.groups)?{error:`The hub returned a report the cockpit could not read.`}:{report:a}}async function fe(e,t,n={}){let r=P(await N.host.issues({query:{[j.focus]:e===``?void 0:e,...n},...t===void 0?{}:{signal:t}}),t);return`error`in r?{error:r.error}:`noApi`in r?{issues:{unavailable:`no-api`,detail:ce}}:{issues:r.body}}async function pe(e){let t=P(await N.host.usage(e===void 0?{}:{signal:e}),e);if(!(`body`in t))return[];let n=t.body.rows;return Array.isArray(n)?n:[]}function F(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:Math.min(1,e/t)}function I(e){return e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,0)}function L(e){return Number.isFinite(e)?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e)):`Not reported`}function R(e,t){if(!Number.isFinite(e)||e<0)return`Not reported`;if(t===`seconds`){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t>0?n>0?`${t}h ${n}m`:`${t}h`:n>0?`${n}m`:`${Math.round(e)}s`}return e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${Math.round(e)} B`}function me({rows:e}){return e.length===0?null:E(`dl`,{className:`grid grid-cols-2 gap-3 @3xl:grid-cols-4`,"data-testid":`host-usage`,children:e.map(e=>k(`div`,{className:`min-w-0 rounded-lg border border-po-border bg-po-panel p-4`,children:[E(`dt`,{className:`text-sm text-po-dim`,children:e.label}),k(`dd`,{className:`mt-2 text-lg font-semibold tabular-nums text-po-text`,children:[R(e.used,e.unit),e.limit===void 0?``:` of ${R(e.limit,e.unit)}`]}),E(`dd`,{className:`mt-1 text-sm text-po-dim`,children:e.detail})]},e.key))})}var z=5;function he({groups:t,totalTokens:n,focus:r,onFocus:i}){let[a,o]=y(!1),s=[...t].sort((e,t)=>t.totalTokens-e.totalTokens||e.key.localeCompare(t.key)),c=a?s:s.slice(0,z),l=n??I(t.map(e=>e.totalTokens));return k(`div`,{className:`flex flex-col gap-3`,children:[t.length===0?E(`p`,{className:`rounded-md border border-dashed border-po-border p-5 text-sm text-po-dim`,children:`No grouped usage was recorded for this selection.`}):null,E(`ul`,{className:`flex flex-col gap-1`,"data-testid":`metrics-group-bars`,children:c.map(e=>{let t=r===e.key,a=e.key===`unknown`||e.key===``,o=i!==void 0&&!a,s=F(e.totalTokens,l)*100,c=k(p,{children:[k(`span`,{className:`flex items-start justify-between gap-3`,children:[E(`span`,{className:`min-w-0 break-all text-left font-medium text-po-hi`,title:e.key,children:a?`Unattributed`:e.key}),E(`span`,{className:`shrink-0 text-right font-semibold tabular-nums text-po-hi`,title:String(e.totalTokens),children:L(e.totalTokens)})]}),E(`span`,{"aria-hidden":`true`,className:`mt-2 block h-1.5 overflow-hidden rounded-full bg-po-border`,children:E(`span`,{className:`block h-full rounded-full ${a?`bg-po-yellow`:`bg-po-blue`}`,style:{width:`${s}%`}})}),k(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2 text-sm text-po-dim`,children:[E(`span`,{children:n!==void 0&&l>0?`${s.toFixed(1)}% of total`:`Relative token volume`}),k(`span`,{className:e.issueCount>0||e.failed?`text-po-yellow`:`text-po-dim`,children:[e.failed?`Failed · `:``,L(e.issueCount),` `,e.issueCount===1?`issue`:`issues`]})]})]});return E(`li`,{children:o?E(`button`,{type:`button`,onClick:()=>i?.(t?``:e.key),"aria-pressed":t,"aria-label":`Filter to ${e.key}`,"data-testid":`metrics-group-${e.key}`,className:`block w-full rounded-md p-3 text-base hover:bg-po-tint-blue focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-blue ${t?`bg-po-tint-blue`:``}`,children:c}):E(`div`,{className:`rounded-md p-3 text-base`,children:c})},e.key)})}),t.length>z?E(e,{variant:`ghost`,size:`sm`,onClick:()=>o(!a),"aria-expanded":a,children:a?`Show top 5`:`Show all ${t.length} returned groups`}):null]})}var B=[{key:`totalTokens`,label:`Total`},{key:`inputTokens`,label:`Input`},{key:`outputTokens`,label:`Output`}],V=600,H=160,ge=48;function _e({buckets:t,bucketUnit:n,onShorterPeriod:r}){let[i,a]=y(`totalTokens`),[o,s]=y(``),c=t.find(e=>e.label===o)??t.at(-1),l=I(t.map(e=>e[i])),u=n?`${n} `:``,d=V/Math.max(1,t.length),f=Math.min(ge,d*.65);return t.length===0?E(`p`,{className:`rounded-md border border-dashed border-po-border p-5 text-sm text-po-dim`,"data-testid":`metrics-timeline-chart`,children:`No timeline buckets were recorded for this selection.`}):t.length===1&&c!==void 0?E(`div`,{className:`flex flex-col gap-4`,"data-testid":`metrics-timeline-chart`,children:k(`div`,{className:`rounded-md border border-po-border bg-po-deep p-5`,children:[E(`p`,{className:`text-sm text-po-dim`,children:c.label}),k(`p`,{className:`mt-2 text-lg font-semibold tabular-nums text-po-blue`,title:String(c.totalTokens),children:[L(c.totalTokens),` tokens`]}),k(`p`,{className:`mt-3 text-sm leading-relaxed text-po-dim`,children:[`Only one `,u,`bucket was recorded. There is not enough history to show a trend.`]}),E(`p`,{className:`mt-2 text-sm text-po-dim`,children:`For more detail, pick a shorter period when one is available.`}),r===void 0?null:E(e,{variant:`ghost`,size:`sm`,className:`mt-3`,onClick:r,children:`View hourly detail`})]})}):k(`div`,{className:`flex flex-col gap-3`,"data-testid":`metrics-timeline-chart`,children:[k(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[E(`div`,{className:`flex gap-1`,role:`group`,"aria-label":`Timeline token counter`,children:B.map(t=>E(e,{size:`sm`,variant:i===t.key?`primary`:`ghost`,"aria-pressed":i===t.key,onClick:()=>a(t.key),children:t.label},t.key))}),k(`span`,{className:`text-sm text-po-dim`,children:[t.length,` recorded `,u,`buckets`]})]}),k(`div`,{className:`flex gap-3`,children:[k(`div`,{"aria-hidden":`true`,className:`flex w-12 shrink-0 flex-col justify-between text-right text-sm tabular-nums text-po-dim`,children:[E(`span`,{children:L(l)}),E(`span`,{children:L(l/2)}),E(`span`,{children:`0`})]}),k(`svg`,{viewBox:`0 0 ${V} ${H}`,preserveAspectRatio:`none`,className:`h-40 min-w-0 flex-1 overflow-visible`,role:`group`,"aria-label":`tokens per bucket, peak ${L(l)}`,children:[[0,H/2,H].map(e=>E(`line`,{x1:`0`,x2:V,y1:e,y2:e,className:`text-po-border`,stroke:`currentColor`,vectorEffect:`non-scaling-stroke`},e)),t.map((e,t)=>{let n=F(e[i],l)*H,r=`${e.label}: ${L(e[i])} ${B.find(e=>e.key===i)?.label.toLowerCase()} tokens`;return k(`g`,{children:[E(`rect`,{x:t*d+(d-f)/2,y:H-n,width:f,height:n,rx:`2`,fill:`currentColor`,className:c?.label===e.label?`text-po-cyan`:`text-po-blue`}),E(`rect`,{x:t*d,y:`0`,width:d,height:H,fill:`transparent`,tabIndex:0,role:`button`,"aria-label":r,"aria-pressed":c?.label===e.label,onMouseEnter:()=>s(e.label),onFocus:()=>s(e.label),onClick:()=>s(e.label),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s(e.label))},className:`cursor-pointer focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-cyan`,children:E(`title`,{children:r})})]},e.label)})]})]}),k(`div`,{className:`ml-15 flex justify-between gap-3 text-sm text-po-dim`,children:[E(`span`,{children:t[0]?.label}),E(`span`,{className:`text-right`,children:t.at(-1)?.label})]}),k(`div`,{className:`flex flex-wrap justify-between gap-2 rounded-md bg-po-deep px-3 py-2 text-sm tabular-nums`,"aria-live":`polite`,"aria-atomic":`true`,children:[E(`span`,{className:`text-po-dim`,children:c?.label}),k(`span`,{className:`text-po-hi`,children:[L(c?.[i]??NaN),` `,B.find(e=>e.key===i)?.label.toLowerCase(),` tokens`]})]}),l===0?k(`p`,{className:`text-sm text-po-dim`,children:[`Recorded buckets contain zero `,B.find(e=>e.key===i)?.label.toLowerCase(),` tokens.`]}):null,k(`details`,{className:`text-sm text-po-dim`,children:[E(`summary`,{className:`cursor-pointer rounded-sm focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-blue`,children:`View exact bucket values`}),E(`div`,{className:`mt-3 overflow-x-auto`,children:k(`table`,{className:`w-full text-right tabular-nums`,children:[E(`caption`,{className:`sr-only`,children:`Independent token counters by recorded bucket`}),E(`thead`,{children:k(`tr`,{children:[E(`th`,{scope:`col`,className:`py-2 text-left`,children:`Bucket`}),E(`th`,{scope:`col`,className:`pl-3`,children:`Total`}),E(`th`,{scope:`col`,className:`pl-3`,children:`Input`}),E(`th`,{scope:`col`,className:`pl-3`,children:`Output`})]})}),E(`tbody`,{children:t.map(e=>k(`tr`,{className:`border-t border-po-border`,children:[E(`th`,{scope:`row`,className:`py-2 text-left font-normal`,children:e.label}),B.map(t=>E(`td`,{className:`pl-3`,children:Number.isFinite(e[t.key])?e[t.key].toLocaleString(`en-US`):`Not reported`},t.key))]},e.label))})]})})]})]})}function ve(e){return`${e.fingerprint===``?`${e.category}|${e.message}`:e.fingerprint}|${e.detail}`}function ye(e){let t=new Map;for(let n of e){let e=ve(n),r=t.get(e);r===void 0?t.set(e,{key:e,occurrences:n.occurrenceCount,category:n.category,detail:n.detail,tool:n.tool,errorType:n.errorType,agentName:n.agentName,model:n.model,statusCode:n.statusCode,lastSeen:n.timestamp,members:[n]}):(r.occurrences+=n.occurrenceCount,r.members.push(n),n.timestamp>r.lastSeen&&(r.lastSeen=n.timestamp),r.tool??=n.tool,r.errorType??=n.errorType,r.agentName??=n.agentName,r.model??=n.model,r.statusCode??=n.statusCode)}return[...t.values()].sort((e,t)=>t.occurrences-e.occurrences||e.detail.localeCompare(t.detail))}function U(e){return Object.entries(e).sort(([,e],[,t])=>t-e)}function be(e){return e.errorType===null?e.tool===null?e.category:`${e.tool} failed`:e.errorType}function xe({group:e,max:t,tools:n}){let[r,i]=y(!1),a=`${(F(e.occurrences,t)*100).toFixed(2)}%`,o=n.find(t=>t.name===e.tool)?.calls;return k(`li`,{className:`flex flex-col rounded-md border border-po-border`,children:[k(`div`,{className:`relative`,children:[E(`span`,{"aria-hidden":`true`,className:`absolute bottom-0 left-0 h-1 rounded-xs bg-po-yellow/40`,style:{width:a}}),k(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,"data-testid":`metrics-issue-${e.key}`,className:`relative flex min-h-10 w-full flex-wrap items-start gap-3 rounded-md p-3 text-left text-base hover:bg-po-tint-blue focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-blue`,children:[E(`span`,{className:`w-8 shrink-0 text-right font-semibold text-po-yellow`,children:e.occurrences}),E(`span`,{className:`w-24 shrink-0 break-words font-medium text-po-hi`,children:be(e)}),E(`span`,{className:`min-w-40 flex-1 break-words text-po-dim`,children:e.detail}),o===void 0?null:k(`span`,{className:`shrink-0 text-po-dim`,children:[o,` token samples`]})]})]}),r?k(`div`,{className:`flex flex-col gap-1 px-3 py-3 text-base`,"data-testid":`metrics-issue-body-${e.key}`,children:[k(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-sm text-po-dim`,children:[k(`span`,{children:[`category `,e.category]}),e.tool===null?null:k(`span`,{children:[`tool `,e.tool]}),e.errorType===null?null:k(`span`,{children:[`error `,e.errorType]}),e.statusCode===null?null:k(`span`,{children:[`status `,e.statusCode]}),e.agentName===null?null:k(`span`,{children:[`agent `,e.agentName]}),e.model===null?null:k(`span`,{children:[`model `,e.model]}),k(`span`,{children:[`last seen `,e.lastSeen]})]}),E(`span`,{className:`break-words text-po-dim`,children:e.detail}),E(`ul`,{className:`flex flex-col gap-1 text-sm text-po-dim`,children:e.members.map((e,t)=>k(`li`,{className:`flex flex-wrap gap-x-2`,children:[E(`span`,{children:e.timestamp}),E(`span`,{children:e.level}),k(`span`,{children:[e.occurrenceCount,`×`]}),E(`span`,{className:`min-w-0 truncate`,children:e.message})]},`${e.timestamp}-${String(t)}`))})]}):null]})}function Se({view:e,tools:t,summaryCount:n}){let r=ye(e.samples),i=r[0]?.occurrences??0,a=new Map(t.map(e=>[e.name,e.calls]));return k(`div`,{className:`flex flex-col gap-3`,children:[n!==void 0&&n!==e.totalIssues?k(`p`,{className:`rounded-md border border-po-edge-yellow bg-po-tint-yellow p-3 text-sm leading-relaxed text-po-yellow`,role:`status`,"data-testid":`metrics-issue-count-mismatch`,children:[`The summary reports `,n,` `,n===1?`issue`:`issues`,`; incident analysis returned`,` `,e.totalIssues,`. The counts differ, so these details should not be treated as a complete explanation of the summary.`]}):null,k(`span`,{className:`text-sm text-po-dim`,children:[E(`span`,{className:`text-po-hi`,children:e.totalIssues}),` occurrences of`,` `,E(`span`,{className:`text-po-hi`,children:r.length}),` distinct problems in the returned samples, most frequent first`]}),r.length===0?E(`p`,{className:`rounded-md border border-dashed border-po-border p-4 text-sm text-po-dim`,children:e.totalIssues===0?`No issues were detected in the returned analysis. This does not establish coverage of unrecorded activity.`:`The analysis counted issues but returned no incident samples.`}):E(`ul`,{className:`flex flex-col gap-2`,"data-testid":`metrics-issue-groups`,children:r.map(e=>E(xe,{group:e,max:i,tools:t},e.key))}),Object.keys(e.byTool).length===0?null:k(`div`,{className:`flex flex-col gap-2 overflow-x-auto`,children:[E(`h4`,{className:`text-base font-semibold text-po-hi`,children:`Failures by tool`}),k(`table`,{className:`w-full text-sm`,"data-testid":`metrics-issues-tools`,children:[E(`thead`,{children:k(`tr`,{className:`text-sm text-po-dim`,children:[E(`th`,{scope:`col`,className:`py-2 text-left font-normal`,children:`Tool`}),E(`th`,{scope:`col`,className:`text-right font-normal`,children:`Failures`}),E(`th`,{scope:`col`,className:`text-right font-normal`,children:`Attribution context`})]})}),E(`tbody`,{children:U(e.byTool).map(([e,t])=>{let n=a.get(e);return k(`tr`,{className:`border-b border-po-border/40`,children:[E(`td`,{className:`min-w-0 break-all py-2 text-po-dim`,children:e}),E(`td`,{className:`w-16 py-2 text-right text-po-red`,children:t}),E(`td`,{className:`w-28 py-2 text-right text-po-dim`,children:n===void 0?`no token samples`:`${String(n)} token samples`})]},e)})})]})]}),k(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-sm text-po-dim`,children:[E(`span`,{className:`text-sm font-semibold text-po-dim`,children:`by category`}),U(e.byCategory).map(([e,t])=>k(`span`,{children:[e,` `,E(`span`,{className:`text-po-hi`,children:t})]},e))]})]})}function Ce({tools:t,focus:n,count:r,startTime:i,endTime:o,broaderScope:s=!1}){let[c,l]=y(),[u,d]=y(``),[f,p]=y(!1),[m,h]=y(!1),v=x(void 0),b=_();return g(()=>(v.current?.abort(),l(void 0),d(``),p(!1),h(!1),()=>v.current?.abort()),[n,i,o]),k(`section`,{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-po-border bg-po-panel p-4`,"data-testid":`metrics-issues`,children:[k(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[k(`div`,{children:[k(`h3`,{className:`text-lg font-semibold text-po-hi`,children:[`Issues to investigate`,r===void 0?``:` · ${r} ${r===1?`issue`:`issues`}`]}),E(`p`,{className:`mt-1 text-sm text-po-dim`,children:`Inspect recurring failures and the evidence behind them.`})]}),k(`div`,{className:`flex items-center gap-2`,children:[f?E(a,{label:`Reading issue details`}):null,E(e,{variant:`outline`,size:`md`,disabled:f,onClick:()=>{v.current?.abort();let e=new AbortController;v.current=e,h(!0),p(!0),d(``),l(void 0),fe(n,e.signal,{startTime:i,endTime:o}).then(t=>{e.signal.aborted||(p(!1),`error`in t?d(t.error||`Issue details could not be loaded.`):ae(t.issues)?d(t.issues.detail):l(t.issues))}).catch(t=>{e.signal.aborted||(p(!1),d(t instanceof Error?t.message:`Issue details could not be loaded.`))})},"aria-expanded":m,"aria-controls":b,"data-testid":m?`metrics-issues-reload`:`metrics-issues-open`,children:m?`Reload details`:`Inspect issues`}),m?E(e,{variant:`ghost`,size:`md`,onClick:()=>{v.current?.abort(),p(!1),h(!1)},"aria-controls":b,children:`Hide`}):null]})]}),k(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:[`Details are loaded on demand.`,` `,i===void 0?o===void 0?`This hub did not report a time window; details cover all available history.`:`Details cover available history up to report time; no start bound was supplied.`:`Details use the report’s recorded time window.`,` `,s?`LogSink cannot filter issue details by model, provider or agent, so this analysis covers all groups in that window.`:n===void 0?`Analysis covers all groups.`:`Filtered to this session.`]}),k(`div`,{id:b,hidden:!m,"aria-busy":f,children:[u===``?null:E(`p`,{role:`alert`,className:`rounded-md border border-po-edge-yellow bg-po-tint-yellow p-3 text-sm text-po-yellow`,"data-testid":`metrics-issues-message`,children:u}),f?E(`p`,{role:`status`,className:`py-3 text-sm text-po-dim`,children:`Reading recorded incidents...`}):null,c===void 0?null:E(Se,{view:c,tools:s?[]:t,summaryCount:s?void 0:r})]})]})}function we({totals:e}){let t=[{label:`Total tokens`,value:e.totalTokens,detail:`Provider-reported total`,color:`text-po-blue`},{label:`Input tokens`,value:e.inputTokens,detail:`Reported input counter`,color:`text-po-hi`},{label:`Output tokens`,value:e.outputTokens,detail:`Reported output counter`,color:`text-po-hi`},{label:`Recorded issues`,value:e.issueCount,detail:`Detected in this selection`,color:e.issueCount>0?`text-po-yellow`:`text-po-hi`}];return E(`dl`,{className:`grid grid-cols-2 gap-3 @3xl:grid-cols-4`,"data-testid":`metrics-summary`,children:t.map(e=>k(`div`,{className:`min-w-0 rounded-lg border border-po-border bg-po-panel p-4`,children:[E(`dt`,{className:`text-sm text-po-dim`,children:e.label}),E(`dd`,{className:`mt-2 text-lg font-semibold tabular-nums ${e.color}`,title:Number.isFinite(e.value)?e.value.toLocaleString(`en-US`):`Not reported`,children:L(e.value)}),E(`dd`,{className:`mt-1 text-sm text-po-dim`,children:e.detail})]},e.label))})}function Te({tools:t}){let[n,r]=y(`p90TotalTokens`),i=[...t].sort((e,t)=>t[n]-e[n]||e.name.localeCompare(t.name));return k(`section`,{className:`flex min-w-0 flex-col gap-4 rounded-lg border border-po-border bg-po-panel p-4`,"aria-label":`Tool token samples`,children:[k(`div`,{children:[E(`h3`,{className:`text-lg font-semibold text-po-hi`,children:`Tool token samples`}),E(`p`,{className:`mt-1 text-sm text-po-dim`,children:`Which tools participate in token-heavy turns?`})]}),i.length===0?k(`div`,{className:`flex flex-1 flex-col justify-center gap-2 rounded-md border border-dashed border-po-border p-5`,"data-testid":`metrics-tools-empty`,children:[E(`p`,{className:`text-base font-semibold text-po-hi`,children:`No token-attributed tool calls`}),E(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:`Tool execution logs may exist, but this selection has no samples that connect tools to model usage. This does not mean no tools ran.`})]}):k(p,{children:[k(`div`,{className:`flex flex-wrap gap-1`,role:`group`,"aria-label":`Rank tool samples by`,children:[E(e,{size:`sm`,variant:n===`p90TotalTokens`?`primary`:`ghost`,"aria-pressed":n===`p90TotalTokens`,onClick:()=>r(`p90TotalTokens`),children:`P90 turn tokens`}),E(e,{size:`sm`,variant:n===`calls`?`primary`:`ghost`,"aria-pressed":n===`calls`,onClick:()=>r(`calls`),children:`Sampled calls`})]}),E(`div`,{className:`overflow-x-auto`,children:k(`table`,{className:`w-full text-base tabular-nums`,"data-testid":`metrics-tools`,children:[k(`caption`,{className:`sr-only`,children:[`Tools ranked by `,n===`calls`?`sampled calls`:`90th percentile whole-turn tokens`]}),E(`thead`,{children:k(`tr`,{className:`border-b border-po-border text-sm text-po-dim`,children:[E(`th`,{scope:`col`,className:`pb-2 text-left font-normal`,children:`Tool`}),E(`th`,{scope:`col`,className:`pb-2 pl-3 text-right font-normal`,children:`Sampled calls`}),E(`th`,{scope:`col`,className:`pb-2 pl-3 text-right font-normal`,children:`P90 turn tokens`})]})}),E(`tbody`,{children:i.map(e=>k(`tr`,{className:`border-b border-po-border/40`,children:[E(`th`,{scope:`row`,className:`max-w-48 break-all py-3 text-left font-normal text-po-hi`,children:e.name}),E(`td`,{className:`py-3 pl-3 text-right text-po-dim`,children:L(e.calls)}),E(`td`,{className:`py-3 pl-3 text-right text-po-blue`,title:String(e.p90TotalTokens),children:L(e.p90TotalTokens)})]},e.name))})]})})]}),k(`details`,{className:`text-sm leading-relaxed text-po-dim`,children:[E(`summary`,{className:`cursor-pointer rounded-sm focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-blue`,children:`How these samples are counted`}),E(`p`,{className:`mt-2`,children:`This view includes only calls with recorded token attribution; external MCP calls remain in the logs. P90 is the 90th percentile of the whole turn, not each tool's own consumption. Several tools may share a turn, so do not add these values together.`})]})]})}var W={session:`session`,agent:`agent`,model:`model`,provider:`provider`},G={session:`Session ids are hashed before export. Select a row to filter usage, not to open a session.`};function Ee({report:e,onFocus:t,onPeriodChange:n}){let r=W[e.dimension],i=e.groups.filter(e=>e.key===`unknown`||e.key===``).reduce((e,t)=>e+t.totalTokens,0),a=[{name:`Cache reads`,value:e.totals.cachedTokens},{name:`Reasoning tokens`,value:e.totals.reasoningTokens},{name:`Usage events`,value:e.totals.usageEventCount},{name:`Log and span records`,value:e.totals.totalRecords}],o=new Date(e.generatedAt);return k(`div`,{className:`@container flex w-full min-w-0 flex-col gap-4`,"data-testid":`metrics-report`,children:[E(we,{totals:e.totals}),k(`div`,{className:`grid min-w-0 grid-cols-1 gap-4 @3xl:grid-cols-3`,children:[k(`section`,{className:`flex min-w-0 flex-col gap-4 rounded-lg border border-po-border bg-po-panel p-4 @3xl:col-span-2`,"aria-label":`Usage over time`,children:[k(`div`,{children:[E(`h3`,{className:`text-lg font-semibold text-po-hi`,children:`Usage over time`}),E(`p`,{className:`mt-1 text-sm text-po-dim`,children:`Recorded tokens, not estimated spend.`})]}),E(_e,{buckets:e.timeline,bucketUnit:e.bucketUnit,onShorterPeriod:e.period===`day`||n===void 0?void 0:()=>n(`day`)})]}),k(`section`,{className:`flex min-w-0 flex-col gap-4 rounded-lg border border-po-border bg-po-panel p-4`,"aria-label":`Reported counters`,children:[E(`h3`,{className:`text-lg font-semibold text-po-hi`,children:`Reported counters`}),E(`dl`,{className:`flex flex-col gap-3`,children:a.map(e=>k(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 border-b border-po-border/40 pb-3`,children:[E(`dt`,{className:`text-sm text-po-dim`,children:e.name}),E(`dd`,{className:`text-base font-semibold tabular-nums text-po-hi`,title:e.value===void 0?`Not reported`:String(e.value),children:L(e.value??NaN)})]},e.name))}),E(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:`Monetary cost is not included in this metrics report.`}),k(`details`,{className:`text-sm leading-relaxed text-po-dim`,children:[E(`summary`,{className:`cursor-pointer rounded-sm focus-visible:outline focus-visible:outline-1 focus-visible:outline-po-blue`,children:`Why the counters may not add up`}),E(`p`,{className:`mt-2`,children:`The total is reported by providers. Input, output, cache reads and reasoning are independent counters and may overlap or be incomplete. They are not a breakdown and may not sum to the total. A gap is not evidence of cache traffic. Missing fields say Not reported; a recorded zero stays zero.`})]})]})]}),k(`div`,{className:`grid min-w-0 grid-cols-1 items-start gap-4 @3xl:grid-cols-2`,children:[k(`section`,{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-po-border bg-po-panel p-4`,"aria-label":`Tokens by ${r}`,children:[k(`div`,{children:[k(`h3`,{className:`text-lg font-semibold text-po-hi`,children:[`Tokens by `,r]}),E(`p`,{className:`mt-1 text-sm text-po-dim`,children:`Largest recorded consumers. Select a named row to filter.`})]}),i>0?k(`div`,{className:`rounded-md border border-po-edge-yellow bg-po-tint-yellow p-3`,"data-testid":`metrics-attribution-notice`,children:[k(`p`,{className:`text-sm font-semibold text-po-yellow`,children:[r.charAt(0).toUpperCase()+r.slice(1),` attribution missing`]}),k(`p`,{className:`mt-1 text-sm leading-relaxed text-po-dim`,children:[L(i),` tokens have no `,r,` recorded. They are included in the total, but cannot be assigned to a named `,r,`.`]})]}):null,G[e.dimension]===void 0?null:E(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:G[e.dimension]}),E(he,{groups:e.groups,totalTokens:e.totals.totalTokens,focus:e.focus,onFocus:t},`${e.dimension}:${e.focus??``}`),k(`p`,{className:`text-sm text-po-dim`,children:[`Showing `,e.groups.length,` of `,L(e.totals.groupCount),` `,r,` groups. Bars show share of the reported total.`]}),e.totals.failedGroups>0?k(`p`,{className:`text-sm text-po-yellow`,children:[e.totals.failedGroups,` of `,e.totals.groupCount,` `,r,`s failed`]}):null]}),E(Te,{tools:e.tools})]}),E(Ce,{tools:e.tools,focus:e.dimension===`session`?e.focus:void 0,count:e.totals.issueCount,startTime:e.startTime,endTime:e.endTime,broaderScope:e.focus!==void 0&&e.dimension!==`session`},`${e.generatedAt}:${e.dimension}:${e.focus??``}`),k(`footer`,{className:`flex flex-wrap justify-between gap-2 border-t border-po-border pt-3 text-sm text-po-dim`,"data-testid":`metrics-provenance`,children:[k(`span`,{children:[`Source: LogSink ·`,` `,e.transport===`http`?`HTTP`:e.transport===`worker`?`database worker`:`transport not reported`]}),k(`span`,{title:e.generatedAt,children:[`Report generated `,Number.isNaN(o.getTime())?e.generatedAt:o.toLocaleString()]})]})]})}var De={"no-sink":`no log sink`,"no-data":`nothing recorded yet`,"no-api":`metrics not installed`,"query-error":`metrics could not be loaded`};function Oe({response:e}){return E(ee,{title:De[e.unavailable],description:e.detail,"data-testid":`metrics-empty`})}function ke({requested:t,applied:n,dimension:r,onClear:i}){return t===``?null:n===void 0?k(`span`,{className:`rounded-md border border-po-edge-yellow bg-po-tint-yellow p-3 text-sm text-po-yellow`,"data-testid":`metrics-focus-refused`,children:[`this log sink does not support narrowing by `,W[r],`, so the numbers below are still everything`,E(e,{variant:`ghost`,size:`md`,className:`ml-2`,onClick:i,children:`clear`})]}):k(`span`,{className:`flex flex-wrap items-center gap-2 rounded-md border border-po-border bg-po-panel p-3 text-sm text-po-dim`,"data-testid":`metrics-focus`,children:[`narrowed to `,E(`span`,{className:`min-w-0 break-all text-po-hi`,children:n}),E(e,{variant:`ghost`,size:`md`,className:`ml-2`,onClick:i,children:`clear`})]})}function Ae(){return k(`div`,{className:`flex flex-col gap-4`,role:`status`,"aria-live":`polite`,"data-testid":`metrics-loading`,children:[E(`span`,{className:`text-sm text-po-dim`,children:`Loading recorded metrics...`}),E(`div`,{"aria-hidden":`true`,className:`grid grid-cols-2 gap-3 @3xl:grid-cols-4`,children:[0,1,2,3].map(e=>E(`div`,{className:`h-24 animate-pulse rounded-lg border border-po-border bg-po-panel motion-reduce:animate-none`},e))}),E(`div`,{"aria-hidden":`true`,className:`h-48 animate-pulse rounded-lg border border-po-border bg-po-panel motion-reduce:animate-none`})]})}var je={day:`Past day`,week:`Past week`,month:`Past month`,all:`All history`};function Me(t){let[n,r]=y(`model`),[i,a]=y(`week`),[o,s]=y(``),[c,l]=y(0),[u,d]=y(),f=JSON.stringify([n,i,o,c]),[_,v]=y([]);g(()=>{let e=new AbortController;return pe(e.signal).then(t=>{e.signal.aborted||v(t)}).catch(()=>void 0),()=>e.abort()},[c]),g(()=>{let e=new AbortController;return de(n,i,o,e.signal).then(t=>{e.signal.aborted||d({key:f,result:t})}).catch(t=>{e.signal.aborted||d({key:f,result:{error:t instanceof Error?t.message:`Metrics could not be loaded.`}})}),()=>e.abort()},[n,i,o,f]);let b=u?.key===f?u.result:void 0,x=b===void 0,S=b!==void 0&&`report`in b?b.report:void 0,w=S===void 0||M(S)?void 0:S,T=b!==void 0&&`error`in b?b.error:``;return k(`div`,{className:`@container flex w-full min-w-0 flex-col gap-4`,"data-testid":`metrics-panel`,"aria-busy":x,children:[E(me,{rows:_}),k(`div`,{className:`flex min-w-0 flex-wrap items-end gap-3 rounded-lg border border-po-border bg-po-panel p-3`,children:[k(`div`,{className:`flex flex-col gap-2`,children:[E(`span`,{className:`text-base font-medium text-po-text`,children:`Group by`}),k(C,{value:n,onValueChange:e=>{s(``),r(e)},children:[E(A,{"aria-label":`Group metrics by`,"data-testid":`metrics-dimension`,className:`w-40 `,children:E(h,{})}),E(m,{children:re.map(e=>E(D,{value:e,children:W[e]},e))})]})]}),k(`div`,{className:`flex flex-col gap-2`,children:[E(`span`,{className:`text-base font-medium text-po-text`,children:`Period`}),k(C,{value:i,onValueChange:e=>a(e),children:[E(A,{"aria-label":`Metrics period`,"data-testid":`metrics-period`,className:`w-40 `,children:E(h,{})}),E(m,{children:ie.map(e=>E(D,{value:e,children:je[e]},e))})]})]}),E(e,{variant:`outline`,size:`md`,className:`ml-auto`,onClick:()=>l(e=>e+1),disabled:x,"data-testid":`metrics-refresh`,children:x?`Loading...`:`Refresh`})]}),x?E(Ae,{}):null,T===``?null:k(`p`,{role:`alert`,className:`rounded-lg border border-po-edge-red bg-po-tint-red p-4 text-sm text-po-red`,"data-testid":`metrics-error`,children:[T,` Use Refresh to try again.`]}),S!==void 0&&M(S)?E(Oe,{response:S}):null,w===void 0?null:k(p,{children:[E(ke,{requested:o,applied:w.focus,dimension:w.dimension,onClear:()=>s(``)}),E(Ee,{report:w,onFocus:s,onPeriodChange:a})]})]})}var Ne=t({label:`metrics`,detail:`recorded usage, token attribution and issues`,icon:u,component:Me});function Pe(e){return e.split(`
|
|
2
|
+
`).filter(Boolean)}var Fe=new Set([`tool_failure`,`infrastructure_failure`,`api_error`,`api_retries_exhausted`,`log_error`]),Ie=/[^.]*empty data[^.]*\.?/i,K=e=>typeof e==`object`&&!!e&&!Array.isArray(e),q=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0,J=e=>typeof e==`string`&&e.trim()!==``?e.trim():void 0;function Le(e){return K(e)?Object.entries(e).flatMap(([e,t])=>{let n=q(t);return n!==void 0&&n>0&&e.trim()!==``?[{key:e,label:e.replaceAll(`_`,` `),count:n,failure:Fe.has(e)}]:[]}).sort((e,t)=>t.count-e.count):[]}function Re(e){return Array.isArray(e)?e.flatMap(e=>{if(!K(e))return[];let t=J(e.name);return t===void 0?[]:[{name:t,invocations:q(e.invocations),p90TurnTokens:q(e.p90TurnTokens)}]}):[]}function ze(e){let t;try{t=JSON.parse(e)}catch{return null}if(!K(t))return null;let n=K(t.usage)?t.usage:{},r={scope:J(t.scope),period:J(t.period),evidence:J(t.evidence),code:J(t.code),capturedRecords:q(t.capturedRecords),capturedIssues:q(t.capturedIssues),categories:Le(t.issuesByCategory),inputTokens:q(n.inputTokens),outputTokens:q(n.outputTokens),tokenCoveragePercent:q(n.tokenCoveragePercent),tools:Re(t.tools),limitReached:typeof t.limitReached==`boolean`?t.limitReached:void 0,captureCompleteness:J(t.captureCompleteness),limitations:J(t.limitations)};return Object.values(r).some(e=>Array.isArray(e)?e.length>0:e!==void 0)?r:null}function Y(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}var Be=e=>e.replaceAll(/[-_]/g,` `);function Ve(e){let t=[e.scope,e.period].flatMap(e=>e?[Be(e)]:[]).join(` · `),n=e.capturedIssues,r=e.evidence===`unavailable`?`Telemetry unavailable`:e.evidence===`empty`?`Nothing captured`:n===void 0?`Captured agent evidence`:n===0?`No issues`:`${String(n)} ${n===1?`issue`:`issues`}`;return t===``?{primary:r}:{primary:r,context:t}}function He(e){let t=[];if(e.capturedRecords!==void 0&&t.push({label:`Records`,value:e.capturedRecords.toLocaleString(`en-US`),failure:!1}),e.capturedIssues!==void 0){let n=e.capturedIssues>0&&e.categories.some(e=>e.failure);t.push({label:`Issues`,value:e.capturedIssues.toLocaleString(`en-US`),failure:n})}if(e.inputTokens!==void 0||e.outputTokens!==void 0){let n=e=>e===void 0?`?`:Y(e);t.push({label:`Tokens in / out`,value:`${n(e.inputTokens)} / ${n(e.outputTokens)}`,failure:!1})}return e.tokenCoveragePercent!==void 0&&t.push({label:`Token coverage`,value:`${String(e.tokenCoveragePercent)}%`,failure:!1}),t}function Ue(e){let t=[e.captureCompleteness?`Capture completeness: ${Be(e.captureCompleteness)}.`:void 0,e.limitations].filter(e=>e!==void 0);return t.length>0?t.join(` `):void 0}function We(e){return e.limitations?.match(Ie)?.[0].trim()??`Empty data is not proof of a healthy run.`}var Ge=`Captured agent evidence`;function Ke({toolName:e,output:t,running:n,isError:a}){let o=r({running:n,isError:a}),s=n||a?null:ze(t);if(s)return E(qe,{toolName:e,tone:o,report:s});let u=Pe(t);if(a)return k(w,{tone:o,children:[E(l,{title:e,children:E(`span`,{className:`min-w-0 truncate text-po-faint`,children:Ge})}),u.length>0?E(c,{children:E(`p`,{className:`whitespace-pre-wrap break-words text-po-red`,children:u.join(`
|
|
3
|
+
`)})}):null]});let f=u.map(e=>({text:e,tone:`text`}));return E(w,{tone:o,expandable:f.length>12,children:({expanded:t})=>{let r=te(f,12,t);return k(p,{children:[E(l,{title:e,children:E(`span`,{className:`min-w-0 truncate text-po-faint`,children:Ge})}),r.shown.length>0||n?k(c,{children:[E(i,{lines:r.shown}),r.hidden>0?k(d,{expands:!0,children:[r.hidden,` more lines`]}):null,n?E(d,{tone:`running`,children:`Reading session telemetry`}):null]}):null]})}})}function qe({toolName:e,tone:t,report:n}){let r=Ve(n),i=He(n),a=Ue(n),o=n.evidence===`empty`,u=n.evidence===`unavailable`,d=We(n),f=o&&a===d?void 0:a,m=o||u?f!==void 0:n.categories.length>0||n.tools.length>0||a!==void 0;return E(w,{tone:u?`neutral`:t,expandable:m,children:({expanded:t})=>k(p,{children:[k(l,{title:e,children:[E(`span`,{className:`max-w-[60%] shrink-0 truncate text-po-text`,children:r.primary}),r.context?k(`span`,{className:`min-w-0 truncate text-po-faint`,children:[`· `,r.context]}):null]}),k(c,{className:`flex flex-col gap-4`,children:[u?k(`div`,{className:`flex flex-wrap items-center gap-2`,children:[E(`span`,{className:`text-po-dim`,children:`The session's telemetry could not be read.`}),n.code?E(s,{size:`xs`,className:`font-mono`,children:n.code}):null]}):o?k(`div`,{className:`flex flex-col gap-1`,children:[E(`p`,{className:`text-po-text`,children:`No records were captured in this window.`}),E(`p`,{className:`text-sm text-po-dim`,children:d})]}):i.length>0?E(`dl`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:i.map(e=>k(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[E(`dt`,{className:`truncate text-sm text-po-dim`,children:e.label}),E(`dd`,{className:e.failure?`truncate text-lg font-semibold tabular-nums text-po-red`:`truncate text-lg font-semibold tabular-nums text-po-hi`,children:e.value})]},e.label))}):null,t&&!o&&!u&&n.categories.length>0?k(`section`,{className:`flex flex-col gap-2`,children:[E(O,{children:`Issues by category`}),E(`div`,{className:`flex flex-wrap gap-2`,children:n.categories.map(e=>k(v,{tone:e.failure?`red`:`neutral`,children:[E(`span`,{children:e.label}),E(`span`,{className:`font-semibold tabular-nums`,children:e.count})]},e.key))})]}):null,t&&!o&&!u&&n.tools.length>0?k(`section`,{className:`flex flex-col gap-2`,children:[E(O,{children:`Tools`}),k(`table`,{className:`w-full text-base`,children:[E(`thead`,{children:k(`tr`,{className:`text-sm text-po-dim`,children:[E(`th`,{className:`w-full pb-1 text-left font-normal`,children:`Name`}),E(`th`,{className:`whitespace-nowrap pb-1 pl-4 text-right font-normal`,children:`Calls`}),E(`th`,{className:`whitespace-nowrap pb-1 pl-4 text-right font-normal`,children:`p90 turn tokens`})]})}),E(`tbody`,{children:n.tools.map(e=>k(`tr`,{className:`border-t border-po-border-soft`,children:[E(`td`,{className:`max-w-0 truncate py-1 font-mono text-po-text`,children:e.name}),E(`td`,{className:`whitespace-nowrap py-1 pl-4 text-right tabular-nums text-po-text`,children:e.invocations===void 0?`?`:e.invocations.toLocaleString(`en-US`)}),E(`td`,{className:`whitespace-nowrap py-1 pl-4 text-right tabular-nums text-po-text`,children:e.p90TurnTokens===void 0?`?`:Y(e.p90TurnTokens)})]},e.name))})]}),n.limitReached?k(`p`,{className:`text-sm text-po-dim`,children:[`Showing the first `,n.tools.length,` tools.`]}):null]}):null,t&&f?E(`p`,{className:`text-sm text-po-faint`,children:f}):null]})]})})}var Je=f({tools:[`diagnose_agent`],message:Ke}),Ye=[`logsink_status`,`logsink_search`,`logsink_agent_issues`,`logsink_trace`,`logsink_stats`,`logsink_services`,`logsink_metrics`];function X(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Z(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Xe(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=100}function Q(e){return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}T/.test(e)&&Number.isFinite(Date.parse(e))}function Ze(e){let t=X(e);if(!(!t||t.kind!==`session`&&t.kind!==`history`)&&(t.sessionId===void 0||typeof t.sessionId==`string`)&&(t.startTime===void 0||Q(t.startTime))&&(t.endTime===void 0||Q(t.endTime))&&(t.kind!==`history`||Q(t.startTime)&&Q(t.endTime))&&!(Q(t.startTime)&&Q(t.endTime)&&Date.parse(t.startTime)>Date.parse(t.endTime)))return[t.kind===`session`?`This session`:`History`,t.startTime,t.endTime,t.kind===`history`?t.sessionId:void 0].filter(Boolean).join(` · `)}function Qe(e){return Ye.some(t=>t===e)}function $e({toolName:e,args:t,result:n,output:r,running:i,isError:a}){let o=n?.details;if(o==null)try{o=JSON.parse(r)}catch{o=void 0}let s=X(o),c=Ze(s?.scope),l=t.scope===`history`?[`Requested history`,t.startTime,t.endTime,t.sessionId].filter(e=>typeof e==`string`).join(` · `):`This session`,u=o===void 0?r:JSON.stringify(o,null,2),d={scope:c??l,evidence:u};if(i)return{...d,scope:l,state:`running`,heading:`Reading captured agent evidence`,note:`Only retained records are inspected.`};if(a)return{...d,state:`query-error`,heading:`Log query could not be completed.`,note:`No collector changes were made.`};let f={...d,state:`unavailable`,heading:`Log summary is unavailable.`,note:`Inspect the retained evidence for details.`},p=X(s?.data);if(!c||!p)return f;let m={...d,state:`populated`,heading:``},h={...d,state:`empty`,heading:`No captured records in this window.`,note:`This does not establish that the run was healthy.`};switch(e){case`logsink_status`:return p.available===!1&&p.reason===`missing-database`?{...d,state:`missing`,heading:`No retained log database is available.`,note:`No collector changes were made.`}:p.available===!0?{...m,heading:`Retained log database is available.`,note:`This does not establish that the collector is capturing now.`}:f;case`logsink_search`:return!Z(p.count)||!Z(p.total)||typeof p.truncated!=`boolean`||!Array.isArray(p.results)?f:{...p.total===0?h:m,heading:p.total===0?h.heading:`Captured log records`,summary:`${p.count} returned · ${p.total} records`,note:p.truncated?`Results are truncated.`:p.total===0?h.note:void 0};case`logsink_agent_issues`:{if(!Z(p.matchingLogs)||!Z(p.uniqueIncidents)||!Z(p.scanned)||!Xe(p.coveragePercent)||typeof p.truncated!=`boolean`||!Array.isArray(p.issues))return f;let e=X(p.byTool);return!e||!Object.values(e).every(Z)?f:{...p.matchingLogs===0?h:m,heading:p.matchingLogs===0?`No captured agent issues in this window.`:`Captured agent issues`,summary:`${p.matchingLogs} records · ${p.uniqueIncidents} incidents`,coverage:`Coverage ${p.coveragePercent}% · ${p.scanned} scanned${p.truncated?` · Scan truncated`:``}`,tools:Object.entries(e).map(([e,t])=>({name:e,count:t})),note:p.matchingLogs===0?h.note:`Repeated events may describe one incident.`}}case`logsink_trace`:return!Z(p.count)||typeof p.truncated!=`boolean`||!Array.isArray(p.timeline)?f:{...p.count===0?h:m,heading:p.count===0?h.heading:`Captured trace timeline`,summary:`${p.count} entries`,note:p.truncated?`Timeline is truncated.`:p.count===0?h.note:void 0};case`logsink_stats`:return!Z(p.totalEntries)||!Array.isArray(p.statistics)||!p.statistics.every(e=>{let t=X(e);return Z(t?.count)&&typeof t?.service==`string`&&typeof t?.level==`string`})?f:{...p.totalEntries===0?h:m,heading:p.totalEntries===0?h.heading:`Retained entry statistics`,summary:`${p.totalEntries} entries · ${p.statistics.length} group${p.statistics.length===1?``:`s`}`,tools:p.statistics.map(e=>{let t=e;return{name:[t.service,t.level].filter(Boolean).join(` · `),count:t.count}})};case`logsink_services`:return!Z(p.count)||typeof p.truncated!=`boolean`||!Array.isArray(p.services)||!p.services.every(e=>typeof e==`string`)?f:{...p.count===0?h:m,heading:p.count===0?h.heading:`Services with retained records`,summary:`${p.count} service${p.count===1?``:`s`}`,note:p.truncated?`Service list is truncated.`:p.count===0?h.note:void 0};case`logsink_metrics`:{let e=X(p.totals);return!e||!Z(e.totalRecords)||!Z(e.totalTokens)||!Z(e.issueCount)||!Xe(e.tokenCoveragePercent)?f:{...e.totalRecords===0?h:m,heading:e.totalRecords===0?h.heading:`Captured usage and issues`,summary:`${e.totalRecords} records · ${e.totalTokens} tokens · ${e.issueCount} issues`,coverage:`Token coverage ${e.tokenCoveragePercent}%`,note:`${e.totalRecords===0?`${h.note} `:``}Tool turn costs are not exclusive per-tool token shares.`}}default:return f}}function et({toolName:e,running:t,isError:n,fixture:a,defaultExpanded:o=!1}){let s=a.state===`missing`,u=a.state===`unavailable`,f=a.evidence.split(`
|
|
4
|
+
`).map(e=>({text:e,tone:`text`}));return E(w,{tone:s||u?`neutral`:r({running:t,isError:n}),expandable:a.evidence.length>0,defaultExpanded:o,children:({expanded:r})=>k(p,{children:[E(l,{title:e,badge:n?`Query failed`:s?`No data`:void 0,children:E(`span`,{className:`truncate text-po-dim max-sm:hidden`,children:a.scope})}),k(c,{className:`flex flex-col gap-3`,children:[E(`p`,{className:`break-words text-sm text-po-dim sm:hidden`,children:a.scope}),k(`div`,{className:`flex flex-col gap-1`,children:[E(`p`,{className:`text-base font-semibold text-po-hi`,children:a.heading}),a.summary?E(`p`,{className:`text-base text-po-text`,children:a.summary}):null,a.coverage?E(`p`,{className:`text-sm text-po-dim`,children:a.coverage}):null]}),a.tools?E(`div`,{className:`flex flex-col gap-2 border-t border-po-border-soft pt-3`,children:a.tools.map(e=>k(`p`,{className:`flex flex-wrap items-center gap-4 text-base`,children:[E(`span`,{className:`font-mono text-po-text`,children:e.name}),k(`span`,{className:`text-po-dim`,children:[e.count,` occurrences`]})]},e.name))}):null,a.note?E(`p`,{className:`text-sm text-po-dim`,children:a.note}):null,t?E(d,{tone:`running`,children:`Reading telemetry`}):null,a.evidence?k(`div`,{className:`flex flex-col gap-3 border-t border-po-border-soft pt-3`,children:[E(d,{expands:!0,glyph:r?`⌄`:`›`,className:`text-sm text-po-dim`,children:r?`Hide evidence`:`Show evidence`}),r?E(i,{lines:f}):null]}):null]})]})})}function tt(e){return E(et,{...e,fixture:$e(e)})}var nt=f({tools:[`logsink_status`,`logsink_search`,`logsink_agent_issues`,`logsink_trace`,`logsink_stats`,`logsink_services`,`logsink_metrics`],matches:Qe,message:tt}),$=(e,t)=>t===void 0?void 0:{...e,...t},rt=o({id:`log`,packageName:`@agimon-ai/po-log`,host:{get settingsPanels(){return[$({id:`metrics`},Ne)]}},session:{get toolRenderers(){return[$({tools:[`diagnose_agent`]},Je),$({tools:[`logsink`]},nt)]}}});export{rt as webPlugin};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{$t as e,A as t,Br as n,Cn as r,Cr as i,G as a,Jn as o,Jt as s,Lr as c,Lt as l,M as u,N as d,P as f,Pr as p,U as m,V as h,Vt as g,Wn as _,Y as v,_ as y,_r as b,a as x,ar as S,d as C,g as w,gr as T,h as E,i as D,in as O,j as k,kr as ee,l as te,m as ne,n as re,nr as ie,nt as ae,o as A,or as j,pr as M,rr as N,s as P,sr as oe,u as se,xn as ce,yr as F}from"../chunks/po-web-runtime-DLnDPODx.js";var le=`/runners start`,I={command:'exec "${SHELL:-/bin/bash}" -l',name:`shell`,interactive:!0};function L(e,t){let n=t.trim()===``?{}:{cwd:t};return e.trim()===``?{...I,...n}:{command:e,...n,preferInteractive:!0}}function R(e){return/\s/u.test(e)?`"${e}"`:e}function z(e){let t=e.cwd?.trim()??``,n=e.name?.trim()??``;return[le,...n===``?[]:[`name=${R(n)}`],...t===``?[]:[`cwd=${R(t)}`],...e.interactive===!0?[`interactive=true`]:e.preferInteractive===!0?[`interactive=prefer`]:[],`--`,e.command.trim()].join(` `)}var ue=`runner_runs`,B=`/runners stop`,V=ee({runs:[],stopRequested:[]});function H(e,t=Date.now()){return e.state===`running`&&t-Date.parse(e.startedAt)>3e3}var U={subscribe(e){let t,n=()=>{clearTimeout(t);let r=Date.now(),i=1/0;for(let e of Object.values(V.store.state))if(e)for(let t of e.runs){if(t.state!==`running`)continue;let e=Date.parse(t.startedAt)+3001;e>r&&(i=Math.min(i,e))}Number.isFinite(i)&&(t=setTimeout(()=>{e(),n()},Math.min(i-r,2147483647)))},r=V.store.subscribe(()=>{e(),n()});return n(),()=>{r.unsubscribe(),clearTimeout(t)}},isActive(e){return V.select(V.store.state,e).runs.some(e=>H(e))}};function W(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G(e,t,n){e(t,{type:`prompt`,message:`${B} ${n}`}),V.update(t,e=>({...e,stopRequested:[...e.stopRequested.filter(e=>e!==n),n]}))}function K(e,t,n){e(t,{type:`prompt`,message:z(n)})}var q=V.channel({channel:ue,parse(e){if(!W(e)||!Array.isArray(e.runs))return null;let t=e.startFailure;return{runs:e.runs.filter(W),...typeof e.sessionDirectory==`string`?{sessionDirectory:e.sessionDirectory}:{},...W(t)&&typeof t.id==`string`&&typeof t.message==`string`?{startFailure:{id:t.id,message:t.message}}:{}}},reduce(e,t){let n=new Set(t.runs.filter(e=>e.state===`running`).map(e=>e.id));return{...t,stopRequested:e.stopRequested.filter(e=>n.has(e))}}});function de(e,t){let n=Date.parse(e);if(Number.isNaN(n))return`unknown`;let r=Math.max(0,Math.floor((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.floor(r/60);if(i<60)return`${i}m`;let a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function fe(e,t,n,r={}){let i=e.split(`
|
|
2
|
+
`);i.length>0&&i[i.length-1]===``&&i.pop(),r.dropPartialTail===!0&&i.length>0&&i.pop();let a=[...i,...t],o=a.slice(-n);return{lines:o,hidden:a.length-o.length}}function pe(e,t){let n=Math.max(1,e-t+1);return Array.from({length:t},(e,t)=>n+t)}function me(e,t,n){return e&&!t&&n}function he(e,t){return e===``||e===t?t===void 0?`session directory`:t.split(`/`).pop()??t:t!==void 0&&e.startsWith(`${t}/`)?e.slice(t.length+1):e}function ge(e,t,n){let r=new Set([...e,t]);return r.delete(``),n!==void 0&&r.delete(n),[...r]}function _e(e){return e===void 0?{tone:`neutral`,label:`gone`}:e.state===`running`?{tone:`running`,label:`running`}:e.exit===void 0||e.exit.reason===`stopped`?{tone:`neutral`,label:`stopped`}:e.exit.reason===`completed`&&(e.exit.code===0||e.exit.code===null)?{tone:`ok`,label:`done`}:{tone:`error`,label:e.exit.reason.replace(`_`,` `)}}function ve({command:t,onCommandChange:n,cwd:r,onCwdChange:i,sessionDirectory:s,folders:c,problem:l,onLaunch:u,defaultFolderOpen:d=!1}){let[f,p]=w(d),[m,g]=w(``),_=he(r,s),y=e=>{i(e),g(``),p(!1)},b=[{value:``,title:`Session directory`,subtitle:s??`Where this session started`},...ge(c,r,s).map(e=>({value:e,title:he(e,s),subtitle:e}))];return P(`div`,{className:`flex shrink-0 flex-col gap-1.5 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:[P(`div`,{className:`flex flex-wrap items-center gap-2 sm:flex-nowrap`,children:[P(`span`,{className:`relative flex min-w-0 flex-1 basis-full items-center sm:basis-auto`,children:[A(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute left-3 font-mono text-base text-po-faint`,children:`$`}),A(M,{size:`lg`,"data-testid":`runners-panel-command`,"aria-label":`Command to run`,value:t,placeholder:`a command, like pnpm dev`,autoComplete:`off`,spellCheck:!1,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u()},className:`w-full pl-7 font-mono`})]}),P(a,{open:f,onOpenChange:p,children:[A(v,{asChild:!0,children:P(e,{variant:`outline`,size:`lg`,"data-testid":`runners-panel-cwd`,"aria-label":`Runs in ${_}`,"aria-invalid":l!==void 0||void 0,title:r===``?s:r,className:`max-w-56 gap-1.5 px-3 font-mono ${l===void 0?``:`border-po-red`}`,children:[A(j,{className:`h-3.5 w-3.5 shrink-0 text-po-faint`}),A(`span`,{className:`truncate`,children:_}),A(ce,{className:`size-3.5 shrink-0 opacity-60`})]})}),A(h,{side:`bottom`,align:`start`,title:`Runs in`,items:b,value:[r],onSelect:y,footer:P(`span`,{className:`relative flex items-center px-3 py-2`,children:[A(j,{className:`pointer-events-none absolute left-5.5 h-3.5 w-3.5 text-po-faint`}),A(M,{"data-testid":`runners-panel-cwd-path`,"aria-label":`Another folder`,value:m,placeholder:`another folder, like packages/web`,spellCheck:!1,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m.trim()!==``&&y(m.trim())},className:`w-full pl-8 font-mono`})]})})]}),A(e,{variant:`primary`,size:`lg`,"data-testid":`runners-panel-run`,onClick:u,children:t.trim()===``?`Open shell`:`Run`})]}),l===void 0?A(`span`,{className:`text-sm text-po-dim`,children:`Runs in its own terminal and keeps going after Po's turn ends. Leave it empty for a plain shell.`}):P(`span`,{role:`alert`,"data-testid":`runners-panel-problem`,className:`flex items-center gap-1.5 text-sm text-po-red`,children:[A(o,{className:`size-3.5 shrink-0`}),l]})]})}var J=`runId`,ye=`screen`,be=`append`,Y={lines:`lines`,grep:`grep`,ignoreCase:`ignoreCase`,contextLines:`contextLines`,from:`from`,generation:`generation`},xe={log:{method:`GET`,path:`/runners/:${J}/log`,query:[Y.lines,Y.grep,Y.ignoreCase,Y.contextLines],response:void 0},logStream:{method:`GET`,path:`/runners/:${J}/log/stream`,query:[Y.from],stream:!0},screenStream:{method:`GET`,path:`/runners/:${J}/screen/stream`,query:[Y.from],stream:!0},logRead:{method:`GET`,path:`/runners/:${J}/log/read`,query:[Y.from],response:void 0},screenRead:{method:`GET`,path:`/runners/:${J}/screen/read`,query:[Y.from,Y.generation],response:void 0},input:{method:`POST`,path:`/runners/:${J}/screen/input`}},X=T(xe,{scopes:[`session`],basePath:`runner`,transport:(e,t)=>re.fetch(e,t),sessionAddress:n});function Se(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}var Ce=5,we=500;function Te(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ee(e,t,n,r){let i=n,a=0,o=!1,s,c,l=()=>{if(o)return;let n=new EventSource(X.session(e).screenStream.url({params:{[J]:t},query:{[Y.from]:i}}));s=n,n.addEventListener(ye,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!Te(t)||typeof t.chunk!=`string`)return;let s=t;typeof s.offset==`number`&&(i=s.offset),a=0,s.ended===!0&&(o=!0,n.close()),r.onEvent(s)}),n.addEventListener(`error`,()=>{n.close(),!o&&(a+=1,a>Ce?r.onLost():c=setTimeout(l,we*2**(a-1)))})};return l(),{close:()=>{o=!0,c!==void 0&&clearTimeout(c),s?.close()}}}async function De(e,t,n){let r={text:n};return(await X.session(e).input({params:{[J]:t},body:r})).ok}var Oe=`The cockpit hub is unreachable.`;function ke(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Ae(e,t,n={},r){let i=await X.session(e).log({params:{[J]:t},query:{[Y.lines]:n.lines,[Y.grep]:n.grep===``?void 0:n.grep,[Y.ignoreCase]:n.ignoreCase===!0||void 0,[Y.contextLines]:n.contextLines},...r===void 0?{}:{signal:r}});return i.ok?!ke(i.data)||typeof i.data.text!=`string`?{error:`The hub answered ${String(i.status)}.`}:{slice:i.data}:i.status===0?{error:r?.aborted===!0?``:Oe}:{error:i.error===``?`The hub answered ${String(i.status)}.`:i.error}}var je=5,Me=500,Ne=2e3;function Pe(e,t,n,r){let i=n,a=0,o=!1,s=!1,c,l,u=new AbortController,d=new TextDecoder,f=``,p=e=>{o||(typeof e.offset==`number`&&(i=e.offset),e.ended===!0&&(o=!0,c?.close()),r.onEvent(e))},m=async()=>{if(o)return;let n=Ne;try{let r=await X.session(e).logRead({params:{[J]:t},query:{[Y.from]:i},signal:u.signal});if(o||!r.ok)return;let a=r.data;a.reset&&(d=new TextDecoder,f=``),f+=d.decode(Se(a.chunk),{stream:!a.ended});let s=f.split(`
|
|
3
|
+
`);f=s.pop()??``,a.ended&&f!==``&&(s.push(f),f=``),p({lines:s,offset:a.offset,ended:a.ended}),a.hasMore&&(n=0)}catch{}finally{o||(l=setTimeout(()=>void m(),n))}},h=()=>{if(o)return;let n;try{n=new EventSource(X.session(e).logStream.url({params:{[J]:t},query:{[Y.from]:i}}))}catch{m();return}c=n,n.addEventListener(`open`,()=>{s=!0}),n.addEventListener(be,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!ke(t)||!Array.isArray(t.lines))return;let n=t;s=!0,a=0,p(n)}),n.addEventListener(`error`,()=>{n.close(),!o&&(a+=1,!s||a>je?m():l=setTimeout(h,Me*2**(a-1)))})};return h(),{close:()=>{o=!0,l!==void 0&&clearTimeout(l),c?.close(),u.abort()}}}var Fe=`runner-log-`,Ie=2e3,Le=2,Re=200,ze=24,Z=1024,Be=Z*Z;function Ve(e){let t=e.id;return{id:`${Fe}${t}`,label:`log · ${e.name}`,panel:e=>A(Ge,{...e,runId:t})}}function He(e){return e<Z?`${e} B`:e<Be?`${(e/Z).toFixed(1)} KB`:`${(e/Be).toFixed(1)} MB`}function Ue(e,t,n){return t===``?!1:n?e.toLowerCase().includes(t.toLowerCase()):e.includes(t)}function We({number:e,line:t,matched:n,dimmed:r}){return P(`div`,{"data-testid":`runner-log-row`,"data-matched":n,className:`flex min-w-0 gap-2`,children:[e===void 0?null:A(`span`,{className:`w-12 shrink-0 select-none text-right font-mono text-sm leading-relaxed text-po-faint`,children:e}),A(`span`,{"aria-hidden":!0,className:`w-4 shrink-0 select-none font-mono text-sm leading-relaxed ${n?`text-po-yellow`:`text-po-faint`}`,children:n?`>>`:``}),A(ie,{line:t,className:`min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-sm leading-relaxed ${r?`text-po-dim`:`text-po-text`}`})]})}function Ge({sessionId:t,runId:n,sendSessionFrame:r,onTerminal:i}){let{runs:a,stopRequested:o}=D(V.store,e=>V.select(e,t)),s=a.find(e=>e.id===n),[c,u]=w(``),[d,f]=w(``),[p,m]=w(!1),[h,g]=w(Le),[_,v]=w(!0),[y,b]=w(void 0),[S,T]=w(void 0),[O,k]=w([]),[ee,re]=w(0),[ie,j]=w(void 0),[N,oe]=w(!0),[F,le]=w(!1),I=E(null),L=E(null),R=d!==``,z=me(_,R,y?.running===!0);C(()=>{let e=setTimeout(()=>f(c),Re);return()=>clearTimeout(e)},[c]);let ue=te(e=>{t!==null&&Ae(t,n,R?{grep:d,ignoreCase:p,contextLines:h}:{},e).then(t=>{e.aborted||(`error`in t?t.error!==``&&j(t.error):(j(void 0),k([]),re(0),b(t.slice),T(t.slice.completeBytes)))})},[t,n,R,d,p,h]);C(()=>{let e=new AbortController;return ue(e.signal),()=>e.abort()},[ue]),C(()=>{if(!z||t===null||S===void 0)return;let e=Pe(t,n,S,{onEvent:e=>{e.lines.length>0&&k(t=>[...t,...e.lines].slice(-2e3)),typeof e.offset==`number`&&re(e.offset),e.ended===!0&&v(!1)}});return()=>e.close()},[z,t,n,S]);let B=y!==void 0&&y.exists&&y.completeBytes<y.fileSize,H=fe(y?.text??``,O,Ie,{dropPartialTail:z&&B}),U=ne(()=>y===void 0?[]:R?y.lineNumbers??[]:pe(y.totalLines+O.length-(z&&B?1:0),H.lines.length),[y,R,O.length,z,B,H.lines.length]);C(()=>{z&&N&&I.current?.scrollIntoView({block:`end`})},[z,N,H.lines.length]);let W=()=>{let e=L.current;e!==null&&oe(e.scrollHeight-e.scrollTop-e.clientHeight<=ze)},K=_e(s),q=s!==void 0&&o.includes(s.id);return P(`div`,{"data-testid":`runner-log-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[P(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:h-11 sm:flex-nowrap sm:gap-2.5 sm:px-[26px] sm:py-0`,children:[A(`span`,{"data-testid":`runner-log-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:s?.name??n}),A(l,{tone:K.tone,size:`md`,"data-testid":`runner-log-state`,children:K.label}),s?P(x,{children:[A(Ke,{run:s}),A(`span`,{className:`shrink-0 text-sm text-po-dim`,children:`pid ${String(s.pid)} · ${s.backend}${s.interactive?` · tty`:``}`})]}):A(`span`,{"data-testid":`runner-log-gone`,className:`text-sm text-po-dim`,children:`no longer listed; its log stays readable`}),A(`span`,{className:`min-w-0 flex-1`}),i?A(e,{variant:`outline`,size:`sm`,"data-testid":`runner-log-terminal`,onClick:i,children:`Back to terminal`}):null,s!==void 0&&s.state===`running`&&t!==null?A(e,{variant:q?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-log-stop`,disabled:q,title:q?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(r,t,s.id),children:q?`Stopping…`:`Stop`}):null]}),s?A(`div`,{className:`shrink-0 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:P(`div`,{className:`flex items-start gap-2 rounded-md bg-po-deep px-3 py-2`,children:[P(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[P(`span`,{"data-testid":`runner-log-command`,title:F?void 0:`${s.command}\nin ${s.cwd}`,className:`font-mono text-base text-po-hi ${F?`break-all`:`truncate`}`,children:[P(`span`,{"aria-hidden":!0,className:`select-none text-po-faint`,children:[`$`,` `]}),s.command]}),F?P(`span`,{className:`break-all font-mono text-sm text-po-dim`,children:[`in `,s.cwd]}):null]}),A(`button`,{type:`button`,"data-testid":`runner-log-command-toggle`,"aria-expanded":F,"aria-label":F?`Collapse command`:`Expand command`,className:`flex size-6 shrink-0 items-center justify-center rounded text-po-faint hover:text-po-hi`,onClick:()=>le(e=>!e),children:A(ce,{className:`size-4 transition-transform ${F?`rotate-180`:``}`})})]})}):null,P(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:flex-nowrap sm:gap-2.5 sm:px-[26px]`,children:[P(`span`,{className:`relative flex min-w-0 flex-1 items-center sm:w-72 sm:flex-none`,children:[A(ae,{className:`pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-po-faint`}),A(M,{size:`md`,"data-testid":`runner-log-search`,value:c,placeholder:`Search output`,onChange:e=>u(e.target.value),className:`w-full pl-8`})]}),A(e,{variant:p?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-ignore-case`,"aria-pressed":p,title:`match regardless of case`,onClick:()=>m(e=>!e),children:p?`Any case`:`Match case`}),A(e,{variant:h>0&&R?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-context`,disabled:!R,title:`lines of context kept either side of a match`,onClick:()=>g(e=>e===0?Le:0),children:`± ${String(h)} lines`}),A(`span`,{className:`min-w-0 flex-1`}),P(`span`,{"data-testid":`runner-log-stats`,className:`min-w-0 basis-full truncate text-sm text-po-dim sm:basis-auto`,children:[y===void 0?`reading…`:R?`${String(y.lineCount)} matching of ${y.totalLines.toLocaleString(`en-US`)} lines`:`${z?`tailing`:`showing`} last ${String(H.lines.length)} of ${(y.totalLines+(z?O.length:0)).toLocaleString(`en-US`)} lines`,H.hidden>0?` · ${H.hidden.toLocaleString(`en-US`)} older hidden`:``]}),A(e,{variant:z?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-follow`,"aria-pressed":z,disabled:R||y?.running!==!0,title:R?`a filtered view is a snapshot; clear the query to follow`:`follow the log as it grows`,onClick:()=>v(e=>!e),children:R?`Paused while searching`:z?`Following`:`Follow`})]}),P(`div`,{className:`relative min-h-0 flex-1`,children:[P(`div`,{ref:L,onScroll:W,"data-testid":`runner-log-body`,className:`h-full overflow-auto bg-po-deep px-3 py-3 sm:px-[26px]`,children:[ie===void 0?y===void 0?A(`p`,{"data-testid":`runner-log-reading`,className:`text-sm text-po-dim`,children:`reading…`}):y.exists===!1?A(`p`,{className:`text-sm text-po-dim`,children:`This runner has not printed anything yet.`}):H.lines.length===0?A(`p`,{className:`text-sm text-po-dim`,children:R?`Nothing matched.`:`The log is empty.`}):H.lines.map((e,t)=>{let n=U[t],r=U[t-1],i=r!==void 0&&n!==void 0&&n-r>1;return P(se,{children:[i?A(`div`,{"data-testid":`runner-log-gap`,"aria-hidden":!0,className:`select-none py-0.5 pl-14 text-sm leading-relaxed text-po-faint`,children:`⋯`}):null,A(We,{number:n,line:e,matched:R&&Ue(e,d,p),dimmed:R&&!Ue(e,d,p)})]},n??`row-${String(t)}`)}):A(`p`,{"data-testid":`runner-log-error`,className:`text-sm text-po-red`,children:ie}),A(`div`,{ref:I})]}),z&&!N?A(e,{variant:`subtle`,size:`sm`,"data-testid":`runner-log-jump`,title:`scroll back to the newest lines and keep following`,onClick:()=>{oe(!0),I.current?.scrollIntoView({block:`end`})},className:`absolute bottom-3 right-3`,children:`Jump to latest`}):null]}),P(`div`,{className:`flex h-8 shrink-0 items-center gap-2.5 border-t border-po-border-soft px-3 sm:px-[26px]`,children:[A(`span`,{"data-testid":`runner-log-path`,className:`min-w-0 flex-1 truncate font-mono text-sm text-po-dim`,children:s?.logPath??y?.path??``}),y===void 0?null:A(`span`,{className:`shrink-0 text-sm text-po-dim`,children:He(Math.max(y.fileSize,ee))})]})]})}function Ke({run:e}){let t=E(null),[n]=w(Date.now);return C(()=>{if(e.exit||e.state!==`running`)return;let n=()=>{let n=t.current?.firstChild;n&&(n.nodeValue=de(e.startedAt,Date.now()))};n();let r=setInterval(n,1e3);return()=>clearInterval(r)},[e.startedAt,e.state,e.exit]),A(`span`,{ref:t,className:`shrink-0 text-sm text-po-dim`,children:de(e.startedAt,e.exit?Date.parse(e.exit.finishedAt):n)})}var qe=30;function Je({sessionId:t,runId:n,sendSessionFrame:r,openTransientTab:i,onSearch:a}){let{runs:o,stopRequested:c}=D(V.store,e=>V.select(e,t)),u=o.find(e=>e.id===n),[d,f]=w(!1),[p,m]=w(!1),[h,g]=w(!1),_=E(null),v=E([]),y=E(void 0);C(()=>{if(t===null||!h)return;let e=Ee(t,n,0,{onEvent:e=>{e.chunk!==``&&_.current?.write(Se(e.chunk)),e.ended===!0&&f(!0)},onLost:()=>m(!0)});return()=>e.close()},[t,n,h]),C(()=>()=>{y.current!==void 0&&clearTimeout(y.current)},[]);let b=e=>{t!==null&&(v.current.push(e),y.current===void 0&&(y.current=setTimeout(()=>{let e=v.current.join(``);v.current=[],y.current=void 0,e!==``&&De(t,n,e)},qe)))},x=u?.state===`running`&&!d,S=c.includes(n);return P(`div`,{"data-testid":`runner-shell-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[P(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:flex-nowrap sm:gap-2.5 sm:px-[26px] sm:py-1.5`,children:[A(`span`,{"data-testid":`runner-shell-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:u?.name??n}),A(l,{tone:x?`running`:`neutral`,size:`md`,"data-testid":`runner-shell-state`,children:x?`Running`:`Ended`}),u?A(`span`,{className:`min-w-0 truncate font-mono text-sm text-po-dim`,children:u.command}):null,A(`span`,{className:`min-w-0 flex-1`}),p?A(`span`,{"data-testid":`runner-shell-lost`,className:`shrink-0 text-sm text-po-red`,children:`The connection to this terminal dropped. Reopen the runner to attach again.`}):null,u?P(e,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-search`,title:`search everything this runner has printed`,onClick:()=>a?a():i(Ve(u)),className:`gap-1.5`,children:[A(ae,{className:`h-3.5 w-3.5`}),`Search output`]}):null,x?A(e,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-interrupt`,title:`send ctrl-c`,onClick:()=>b(``),children:`Ctrl-C`}):null,x&&t!==null?A(e,{variant:S?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-shell-stop`,disabled:S,title:S?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(r,t,n),children:S?`Stopping…`:`Stop`}):null]}),P(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-po-deep px-3 py-2 sm:px-[26px]`,children:[A(s,{ref:_,"data-testid":`runner-shell-terminal`,onData:e=>b(e),onReady:()=>g(!0)}),h?null:A(`p`,{"data-testid":`runner-shell-reading`,className:`text-sm text-po-dim`,children:`attaching…`})]}),A(`div`,{className:`flex h-8 shrink-0 items-center border-t border-po-border-soft px-3 sm:px-[26px]`,children:A(`span`,{className:`min-w-0 flex-1 truncate text-sm text-po-dim`,children:x?`Typing goes straight to ${u?.name??`the runner`}. Ctrl-C stops what is running.`:`This runner has ended. Its output stays searchable.`})})]})}var Ye=3e4,Xe=`runner-runs`;function Ze(){return{id:Xe,label:`runners`,panel:Qe}}function Qe(t){let{sessionId:n,sendSessionFrame:r}=t,i=D(V.store,e=>V.select(e,n)),a=i.runs.filter(e=>e.state===`running`),[o,s]=w(``),[c,l]=w(``),[u,d]=w(void 0),[f,p]=w(void 0),m=E(null),h=E(``),g=E(void 0),v=a.find(e=>e.id===u)??a[0],y=()=>{n!==null&&(m.current=new Set(i.runs.map(e=>e.id)),clearTimeout(g.current),g.current=setTimeout(()=>{m.current=null},Ye),K(r,n,L(o,c)),h.current=o,s(``))};C(()=>{let e=m.current;if(e===null)return;let t=i.runs.find(t=>t.state===`running`&&!e.has(t.id));t&&(m.current=null,clearTimeout(g.current),d(t.id))},[i.runs]);let b=i.startFailure?.id;return C(()=>{b!==void 0&&m.current!==null&&(m.current=null,clearTimeout(g.current),s(h.current))},[b]),C(()=>()=>clearTimeout(g.current),[]),P(`div`,{"data-testid":`runners-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[P(`div`,{className:`flex h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft px-3 sm:px-[26px]`,children:[A(`span`,{className:`text-lg font-semibold text-po-hi`,children:`Runners`}),A(`span`,{"data-testid":`runners-panel-count`,className:`text-sm text-po-dim`,children:a.length===0?`Nothing running`:`${String(a.length)} running`})]}),n===null?null:A(ve,{command:o,onCommandChange:s,cwd:c,onCwdChange:l,folders:a.map(e=>e.cwd),...i.sessionDirectory===void 0?{}:{sessionDirectory:i.sessionDirectory},...i.startFailure===void 0?{}:{problem:i.startFailure.message},onLaunch:y}),v===void 0?A(N,{"data-testid":`runners-panel-empty`,className:`px-4 py-8`,title:`Nothing running yet`,description:n===null?`Open a session to start a runner.`:`Type a command above, like pnpm dev, and it opens here as a live terminal.`}):P(x,{children:[A(`div`,{"data-testid":`runners-panel-picker`,className:`flex shrink-0 flex-wrap gap-1.5 px-3 pt-3 sm:px-[26px]`,children:a.map(t=>P(e,{variant:t===v?`subtle`:`ghost`,size:`sm`,"data-testid":`runners-panel-pick-${t.id}`,"aria-pressed":t===v,title:t.command,onClick:()=>d(t.id),className:`gap-1.5 ${t===v?`text-po-hi`:``}`,children:[A(_,{tone:`yellow`,pulse:!0}),t.name]},t.id))}),A(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col border-t border-po-border-soft`,children:v.interactive&&f!==v.id?A(Je,{...t,runId:v.id,onSearch:()=>p(v.id)},v.id):A(Ge,{...t,runId:v.id,...v.interactive?{onTerminal:()=>p(void 0)}:{}},v.id)})]})]})}var $e=b({keys:`r l`,icon:m,activeSource:U,transientTab:Ze,order:20}),et=F(q),tt=5;function nt(e){for(let t=e.length-1;t>=0;--t){let n=O(e[t]??``).map(e=>e.text).join(``).trim();if(n.length>0)return n}}function rt(e,t,n){let[r,i]=w(void 0);return C(()=>{if(!n||e===null)return;let r=!0,a,o=new AbortController;return Ae(e,t,{lines:tt},o.signal).then(n=>{if(!r||`error`in n)return;let o=nt(n.slice.text.split(`
|
|
4
|
+
`));o!==void 0&&i({runId:t,text:o}),n.slice.running&&(a=Pe(e,t,n.slice.completeBytes,{onEvent:e=>{let n=nt(e.lines);r&&n!==void 0&&i({runId:t,text:n})}}))}),()=>{r=!1,o.abort(),a?.close()}},[e,t,n]),n&&r?.runId===t?r.text:void 0}function it({sessionId:n,sendSessionFrame:r,openTransientTab:i}){let a=D(V.store,e=>V.select(e,n)),o=()=>a.runs.filter(e=>H(e)).length;y(U.subscribe,o,o);let s=a.runs.filter(e=>H(e));return s.length===0?P(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[A(`p`,{"data-testid":`activity-summary-runners`,className:`text-sm text-po-dim`,children:`Idle`}),n===null?null:P(e,{variant:`link`,size:`sm`,"data-testid":`activity-runner-launch`,className:`h-auto gap-1 px-0 text-po-green`,onClick:()=>i(Ze()),children:[`Launch a runner`,A(t,{"aria-hidden":!0,className:`size-3.5`})]})]}):A(`div`,{"data-testid":`activity-runner-runs`,className:`flex flex-col gap-0.5`,children:s.map(e=>A(at,{run:e,stopRequested:a.stopRequested.includes(e.id),sessionId:n,sendSessionFrame:r,openTransientTab:i},e.id))})}function at({run:t,stopRequested:n,sessionId:r,sendSessionFrame:i,openTransientTab:a}){let o=rt(r,t.id,t.state===`running`);return P(e,{variant:`ghost`,size:`card`,"data-testid":`activity-runner-${t.id}`,"data-runner-tone":`running`,title:`open this runner's log`,onClick:()=>{r!==null&&a(Ve(t))},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:[P(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[A(_,{tone:`yellow`,pulse:!0}),A(`span`,{className:`min-w-0 flex-1 truncate text-left text-base font-semibold text-po-hi`,children:t.name}),P(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[A(Ke,{run:t}),t.interactive?` · tty`:``]}),r===null?null:A(e,{asChild:!0,variant:n?`outline`:`danger-outline`,size:`xs`,"data-testid":`activity-runner-stop-${t.id}`,"data-stopping":n,title:n?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,className:`px-1.5`,children:A(`span`,{role:`button`,tabIndex:n?-1:0,"aria-disabled":n,onClick:e=>{e.stopPropagation(),n||G(i,r,t.id)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),n||G(i,r,t.id))},children:n?`stopping…`:`stop`})})]}),A(`span`,{"data-testid":`activity-runner-detail-${t.id}`,"data-detail":o===void 0?`command`:`tail`,className:`truncate pl-3 text-left text-sm text-po-dim`,children:o??t.command})]})}var ot=i({component:it}),st=`…`,ct=` … `,lt=160,ut=12,Q=1024,dt=Q*Q,ft=/(?<![\w.-])(?:\/Users|\/home)\/[^/\s]+(?=\/|\s|$)/g;function pt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mt(e){if(!pt(e))return{};let t={};return typeof e.id==`string`&&(t.id=e.id),typeof e.runner==`string`&&(t.runner=e.runner),(typeof e.exitCode==`number`||e.exitCode===null)&&(t.exitCode=e.exitCode),typeof e.logPath==`string`&&(t.logPath=e.logPath),typeof e.fileSize==`number`&&(t.fileSize=e.fileSize),typeof e.lines==`number`&&(t.lines=e.lines),e.timedOut===!0&&(t.timedOut=!0),e.promoted===!0&&(t.promoted=!0),typeof e.reason==`string`&&(t.reason=e.reason),typeof e.tail==`string`&&(t.tail=e.tail),typeof e.tailLines==`number`&&(t.tailLines=e.tailLines),typeof e.sequenceId==`string`&&(t.sequenceId=e.sequenceId,Array.isArray(e.stages)&&(t.stages=e.stages.flatMap(e=>!pt(e)||!Number.isInteger(e.index)||Number(e.index)<0||typeof e.state!=`string`?[]:[{index:Number(e.index),state:e.state,...typeof e.logPath==`string`?{logPath:e.logPath}:{}}]))),t}function ht(e){return e.replace(ft,`~`)}function gt(e){let t=e.split(`
|
|
5
|
+
`).map(e=>e.trim()).filter(e=>e.length>0),n=t[0]??``;return t.length>1?`${n} ${st} +${t.length-1} lines`:n}function _t(e,t=lt){if(e.length<=t)return e;let n=t-3,r=Math.ceil(n/2),i=e.slice(0,r),a=e.slice(e.length-(n-r)),o=i.lastIndexOf(` `);o>i.length/2&&(i=i.slice(0,o));let s=a.indexOf(` `);return s>=0&&s<a.length/2&&(a=a.slice(s+1)),`${i}${ct}${a}`}function vt(e){return typeof e==`string`?e:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e.join(`
|
|
6
|
+
|
|
7
|
+
`):``}function yt(e){let t=vt(e);if(t.length===0)return``;let n=Array.isArray(e)?vt(e[0]):t,r=Array.isArray(e)&&e.length>1?` ${st} +${e.length-1} commands`:``;return _t(`${ht(gt(n))}${r}`)}function bt(e){let t=[];return e.background===!0&&t.push(`bg`),e.interactive===!0&&t.push(`tty`),typeof e.timeout==`number`&&t.push(`${e.timeout}s`),typeof e.name==`string`&&e.name.length>0&&t.push(e.name),t}function xt(e){return e<Q?`${e} B`:e<dt?`${(e/Q).toFixed(1)} KB`:`${(e/dt).toFixed(1)} MB`}function St(e){let t=[];return e.lines!==void 0&&t.push(`${e.lines.toLocaleString(`en-US`)} lines`),e.fileSize!==void 0&&t.push(xt(e.fileSize)),e.runner!==void 0&&t.push(e.runner),t.join(` · `)}function Ct(e,t){let n=e.split(`
|
|
8
|
+
`);for(;n.length>0&&n[n.length-1]?.trim()===``;)n.pop();return n.length<=t?n:n.slice(-t)}function wt(e){let t=mt(e.details),n=(t.stages??[]).flatMap(e=>e.logPath===void 0?[]:[`stage ${e.index+1} · ${e.state} · ${e.logPath}`]);if(e.isPartial)return{lines:[...n,...Ct(e.output,ut)],status:{glyph:`◐`,tone:`running`,text:`running`},hidden:0};if(e.isError){let r=Ct(t.sequenceId===void 0?e.output:t.tail??e.output,2**53-1),i=[...n,...e.expanded?r:r.slice(-12)],a=St(t);return{lines:i,status:{glyph:`✗`,tone:`error`,text:a.length>0?a:`failed`},hidden:Math.max(0,r.length+n.length-i.length)}}if(t.promoted===!0)return{lines:n,status:{glyph:`●`,tone:`background`,text:`${t.runner??t.id??`runner`}${t.id===void 0?``:` · ${t.id}`} · background`},hidden:0};let r=Ct(t.tail??(t.sequenceId===void 0?``:e.output),2**53-1),i=[...n,...e.expanded?r:r.slice(-12)],a=t.exitCode!==void 0&&t.exitCode!==null,o=t.timedOut===!0||a&&t.exitCode!==0,s=[];t.timedOut===!0?s.push(`timed out`):o&&s.push(`exit ${t.exitCode}`);let c=St(t);c.length>0&&s.push(c);let l=s.length>0?s.join(` · `):o?`failed`:i.length===0?`done`:``;return{lines:i,status:l.length>0?{glyph:o?`✗`:`✓`,tone:o?`error`:`ok`,text:l}:null,hidden:Math.max(0,r.length+n.length-i.length)}}function Tt(e){if(e===void 0)return{tone:`info`,badge:`In background`};if(e.exit===void 0)return{tone:`running`,badge:`In background`};let{reason:t,code:n}=e.exit,r=n===null?``:` · exit ${n}`;return t===`completed`?{tone:`ok`,badge:`Completed${r}`}:t===`stopped`?{tone:`neutral`,badge:`Stopped`}:{tone:`error`,badge:`Failed${r}`}}var Et={running:`running`,ok:`ok`,error:`error`,background:`info`};function Dt({sessionId:t,args:n,result:i,output:a,running:o,isError:s,sendSessionFrame:c,openTransientTab:l}){let p=mt(i?.details),m=p.sequenceId===void 0?p.id:void 0,h=p.promoted===!0?m:void 0,_=D(V.store,e=>m===void 0?void 0:V.select(e,t).runs.find(e=>e.id===m)),v=D(V.store,e=>h!==void 0&&V.select(e,t).stopRequested.includes(h)),y=vt(n.command),b=yt(n.command),C=bt(n),w=t!==null&&h!==void 0&&_!==void 0&&_.exit===void 0,T=h===void 0?void 0:Tt(_);return A(k,{tone:T?.tone??r({running:o,isError:s}),expandable:!0,children:({expanded:n})=>{let r=wt({details:i?.details,output:a,expanded:!0,isPartial:o,isError:s});return P(x,{children:[P(d,{title:`bash`,...T?{badge:T.badge}:{},children:[P(`span`,{"data-testid":`tool-call-bash`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[A(`span`,{className:`min-w-0 flex-1 truncate font-mono text-po-text`,children:b}),C.length>0?P(`span`,{className:`hidden shrink-0 text-po-dim sm:inline`,children:[`· `,C.join(` · `)]}):null]}),_!==void 0&&t!==null?P(e,{variant:`outline`,size:`xs`,"data-testid":`tool-result-bash-open-log`,title:`open this runner's full log`,onClick:e=>{e.stopPropagation(),l(Ve(_))},className:`shrink-0 gap-1 px-1.5 `,children:[A(S,{className:`h-2.5 w-2.5`}),`log`]}):null,w?A(e,{size:`xs`,variant:v?`outline`:`danger-outline`,disabled:v,"data-testid":`tool-result-bash-stop`,"data-stopping":v,title:v?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:e=>{e.stopPropagation(),t!==null&&h!==void 0&&G(c,t,h)},className:`shrink-0 px-1.5 `,children:v?`stopping…`:`stop`}):null]}),n?P(u,{"data-testid":`tool-result-bash`,className:`flex flex-col gap-2`,children:[y.length>0?A(g,{"data-testid":`tool-result-bash-command`,grammar:`shell`,text:y,className:`max-h-40 overflow-auto text-po-text`}):null,r.lines.length>0?A(oe,{"data-testid":`tool-result-bash-output`,text:r.lines.join(`
|
|
9
|
+
`),className:`max-h-96 overflow-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere] border-po-border-soft border-t pt-2 font-mono text-po-dim`}):null,r.status?A(f,{"data-testid":`tool-result-bash-status`,tone:Et[r.status.tone],glyph:r.status.glyph,className:`min-w-0`,children:A(`span`,{className:`break-words`,children:r.status.text})}):null,p.sequenceId===void 0&&p.logPath!==void 0?P(`span`,{"data-testid":`tool-result-bash-log`,className:`min-w-0 break-all text-po-dim`,children:[`full log · `,A(`span`,{className:`text-po-dim`,children:p.logPath})]}):null]}):null]})}})}var Ot=p({message:Dt}),$=(e,t)=>t===void 0?void 0:{...e,...t},kt=c({id:`runner`,packageName:`@agimon-ai/po-runner`,session:{get activityGroups(){return[$({name:`runners`},$e)]},get channels(){return[$({channel:`runner_runs`},et)]},get fills(){return[$({slot:`activity.runners`,id:`runners`},ot)]},get toolRenderers(){return[$({tools:[`bash`]},Ot)]}}});export{kt as webPlugin};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Wt as PO_BROWSER_SESSION_SERVICE, Yt as readPoBrowserSession, t as defineServerPlugin } from "./serverPlugin-CNbUxIzn.js";
|
|
2
2
|
import "./platform-B5tkndf7.js";
|
|
3
3
|
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-BC69sRMW.js";
|
|
4
|
+
//#region ../../../layers/browser/po-browse/src/types/webBrowseActivity.ts
|
|
5
|
+
/**
|
|
6
|
+
* Wire types shared by the hub channel, the session methods and the web
|
|
7
|
+
* plugin. JSON only, no node types, so the cockpit bundle can carry them.
|
|
8
|
+
*/
|
|
9
|
+
/** The frame type the hub publishes and the web plugin claims. */
|
|
10
|
+
const browseActivityChannelType = "browse_activity";
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region ../../../layers/browser/po-browse/src/services/edgeBrowserNamespace/index.ts
|
|
5
13
|
const MAX_URL_CHARS = 2048;
|
|
6
14
|
const MAX_SELECTOR_CHARS = 1e3;
|
|
@@ -239,6 +247,73 @@ function createEdgeBrowserNamespace(options) {
|
|
|
239
247
|
}
|
|
240
248
|
//#endregion
|
|
241
249
|
//#region ../../../layers/browser/po-browse/src/services/edgeBrowsePlugin/index.ts
|
|
250
|
+
const POLL_INTERVAL_MS = 2e3;
|
|
251
|
+
/**
|
|
252
|
+
* The edge browser has no daemon; observe the host's connected browser without keeping it alive. The timer runs only
|
|
253
|
+
* while a tool is in flight or the browser is open, so an idle session object can still be put to sleep.
|
|
254
|
+
*/
|
|
255
|
+
function createEdgeBrowseActivityChannel(sessionId, read, watch) {
|
|
256
|
+
return {
|
|
257
|
+
frameType: browseActivityChannelType,
|
|
258
|
+
start(host) {
|
|
259
|
+
let payload = { identities: [] };
|
|
260
|
+
let previous = "unread";
|
|
261
|
+
let pending = false;
|
|
262
|
+
let closed = false;
|
|
263
|
+
let open = false;
|
|
264
|
+
let timer;
|
|
265
|
+
const tick = async () => {
|
|
266
|
+
if (pending || closed) return;
|
|
267
|
+
pending = true;
|
|
268
|
+
try {
|
|
269
|
+
const pages = await read();
|
|
270
|
+
if (closed) return;
|
|
271
|
+
open = pages !== void 0;
|
|
272
|
+
const next = JSON.stringify(pages);
|
|
273
|
+
if (next === previous) return;
|
|
274
|
+
previous = next;
|
|
275
|
+
const lastUsedAt = Date.now();
|
|
276
|
+
payload = { identities: pages === void 0 ? [] : [{
|
|
277
|
+
id: "remote-browser",
|
|
278
|
+
name: "Remote browser",
|
|
279
|
+
state: "idle",
|
|
280
|
+
window: "headless",
|
|
281
|
+
profile: false,
|
|
282
|
+
lastUsedAt,
|
|
283
|
+
tabs: pages.map((page) => ({
|
|
284
|
+
id: page.pageId,
|
|
285
|
+
title: page.title,
|
|
286
|
+
url: page.url,
|
|
287
|
+
current: page.current,
|
|
288
|
+
lastAccessedAt: lastUsedAt
|
|
289
|
+
}))
|
|
290
|
+
}] };
|
|
291
|
+
host.publish(sessionId, payload);
|
|
292
|
+
} catch {
|
|
293
|
+
host.onNotice(`browse activity poll failed for ${sessionId}`);
|
|
294
|
+
} finally {
|
|
295
|
+
pending = false;
|
|
296
|
+
if (!closed && timer === void 0 && (open || watch.tools > 0)) timer = setTimeout(() => {
|
|
297
|
+
timer = void 0;
|
|
298
|
+
tick();
|
|
299
|
+
}, POLL_INTERVAL_MS);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
watch.wake = () => {
|
|
303
|
+
if (timer === void 0) tick();
|
|
304
|
+
};
|
|
305
|
+
tick();
|
|
306
|
+
return {
|
|
307
|
+
payloadFor: (scope) => scope.sessionId === sessionId ? payload : void 0,
|
|
308
|
+
close() {
|
|
309
|
+
closed = true;
|
|
310
|
+
watch.wake = void 0;
|
|
311
|
+
clearTimeout(timer);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
242
317
|
/**
|
|
243
318
|
* po-browse for hosts without browse-tool (the Cloudflare Worker): `browser` in code mode, backed by
|
|
244
319
|
* the host's `po/browser-session`. Sessions on hosts that bind no browser session get nothing.
|
|
@@ -250,16 +325,38 @@ const edgeBrowsePlugin = defineServerPlugin({
|
|
|
250
325
|
session: ({ context, agent }) => {
|
|
251
326
|
const execution = agent?.context;
|
|
252
327
|
if (!execution) return {};
|
|
328
|
+
let peekPages;
|
|
329
|
+
const watch = { tools: 0 };
|
|
253
330
|
context.inject([PO_BROWSER_SESSION_SERVICE, PO_CODEMODE_SERVICE], (scoped) => {
|
|
254
331
|
const browser = readPoBrowserSession(scoped);
|
|
332
|
+
const observable = browser;
|
|
333
|
+
peekPages = observable?.peekPages?.bind(observable);
|
|
255
334
|
const registration = browser ? readPoCodemode(scoped)?.register("@agimon-ai/po-browse", createEdgeBrowserNamespace({
|
|
256
335
|
sessionId: execution.sessionId,
|
|
257
336
|
browser,
|
|
258
337
|
notify: (request) => execution.client.notify(request)
|
|
259
338
|
})) : void 0;
|
|
260
|
-
return () =>
|
|
339
|
+
return () => {
|
|
340
|
+
peekPages = void 0;
|
|
341
|
+
registration?.dispose();
|
|
342
|
+
};
|
|
261
343
|
});
|
|
262
|
-
return {
|
|
344
|
+
return {
|
|
345
|
+
channels: [() => createEdgeBrowseActivityChannel(execution.sessionId, async () => peekPages?.(), watch)],
|
|
346
|
+
hooks: [{
|
|
347
|
+
event: "tool_execution_start",
|
|
348
|
+
handle: () => {
|
|
349
|
+
watch.tools += 1;
|
|
350
|
+
watch.wake?.();
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
event: "tool_execution_end",
|
|
354
|
+
handle: () => {
|
|
355
|
+
watch.tools = Math.max(0, watch.tools - 1);
|
|
356
|
+
watch.wake?.();
|
|
357
|
+
}
|
|
358
|
+
}]
|
|
359
|
+
};
|
|
263
360
|
}
|
|
264
361
|
});
|
|
265
362
|
//#endregion
|
|
@@ -7,6 +7,11 @@ const PO_LOG_METRICS_CONTRACT = defineServiceContract("po/log-metrics", {
|
|
|
7
7
|
scope: "host",
|
|
8
8
|
description: "Records sanitized session telemetry and answers metrics reports for the host's own organization."
|
|
9
9
|
});
|
|
10
|
+
/** Bound by a host that meters resources for its account. The log API reads it; an unbound host reports none. */
|
|
11
|
+
const PO_LOG_HOST_USAGE_CONTRACT = defineServiceContract("po/log-host-usage", {
|
|
12
|
+
scope: "host",
|
|
13
|
+
description: "Reports the resources the host meters for its own account, with their limits."
|
|
14
|
+
});
|
|
10
15
|
//#endregion
|
|
11
16
|
//#region ../../default/po-log/src/constants/metricsStore.ts
|
|
12
17
|
/**
|
|
@@ -56,4 +61,4 @@ async function queryHttp(endpoint, params, fetchImpl) {
|
|
|
56
61
|
return body;
|
|
57
62
|
}
|
|
58
63
|
//#endregion
|
|
59
|
-
export { PO_LOG_METRICS_CONTRACT as i, METRICS_ATTRIBUTE as n, TOOL_CALL_TURN_ATTRIBUTION as r, queryHttp as t };
|
|
64
|
+
export { PO_LOG_METRICS_CONTRACT as a, PO_LOG_HOST_USAGE_CONTRACT as i, METRICS_ATTRIBUTE as n, TOOL_CALL_TURN_ATTRIBUTION as r, queryHttp as t };
|