agentworkshop 0.17.4 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/6EjYqizd2.js +1 -0
- package/.output/public/_nuxt/{B6OzW5oQ.js → BWYSIX3z.js} +1 -1
- package/.output/public/_nuxt/{DXY8bTqS.js → BYVeifDW.js} +1 -1
- package/.output/public/_nuxt/{ClVN8KaH2.js → Bb8neYWw2.js} +1 -1
- package/.output/public/_nuxt/{D4fDMDMY.js → ByxXSCf9.js} +3 -3
- package/.output/public/_nuxt/{BM-sWDDD.js → C3bwSomj.js} +1 -1
- package/.output/public/_nuxt/CDwx6Qk-2.js +1 -0
- package/.output/public/_nuxt/{CC8gRGAU.js → CL1GexAK.js} +1 -1
- package/.output/public/_nuxt/{CjSLwcFL.js → CTkJWXt4.js} +1 -1
- package/.output/public/_nuxt/{BIyCQj6O.js → CXBXiOFX.js} +2 -2
- package/.output/public/_nuxt/CXFz9B_-2.js +1 -0
- package/.output/public/_nuxt/CgEhlg4v2.js +8 -0
- package/.output/public/_nuxt/Ch8LlQ0r.js +1 -0
- package/.output/public/_nuxt/D8Poe1wJ.js +1 -0
- package/.output/public/_nuxt/{Uuf6Jdzd.js → DVUJFOJO.js} +1 -1
- package/.output/public/_nuxt/{CUMTaH3Z2.js → DhmtX4iY2.js} +1 -1
- package/.output/public/_nuxt/{Cu6Hle_d.js → DmeuO59Y.js} +1 -1
- package/.output/public/_nuxt/RMWsCPgI2.js +2 -0
- package/.output/public/_nuxt/{_wsId_.CzdXTLVh.css → _wsId_.DaZ8g4FD.css} +1 -1
- package/.output/public/_nuxt/board.CqeENEsw.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7becc7b9-c45c-4edb-81af-969c538d2fed.json +1 -0
- package/.output/public/_nuxt/channel-templates.BUNpRy6E.css +1 -0
- package/.output/public/_nuxt/{default.Diue5wr2.css → default.Cg1zKZla.css} +1 -1
- package/.output/public/_nuxt/{entry.D9gnKVzx.css → entry.DaOm6Z_i.css} +1 -1
- package/.output/public/_nuxt/ontology.NGw2WSc2.css +1 -0
- package/.output/public/_nuxt/optimizer.CkKx4qp3.css +1 -0
- package/.output/public/_nuxt/pipeline.BnaxJDtL.css +1 -0
- package/.output/public/_nuxt/projects.D7IsCl8K.css +1 -0
- package/.output/public/_nuxt/{settings.BRjXthG4.css → settings.B2GP7Esk.css} +1 -1
- package/.output/public/_nuxt/studio.CNtVgRxO.css +1 -0
- package/.output/public/_nuxt/{BpqmshmO.js → tjYEbvAS.js} +1 -1
- package/.output/server/chunks/_/nitro.mjs +1180 -1130
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/{TownView-BdwjWlnU.mjs → TownView-Czmlr5PS.mjs} +2 -2
- package/.output/server/chunks/build/{TownView-BdwjWlnU.mjs.map → TownView-Czmlr5PS.mjs.map} +1 -1
- package/.output/server/chunks/build/{_wsId_-CLBiQH5c.mjs → _wsId_-BW4pvga3.mjs} +17 -13
- package/.output/server/chunks/build/{_wsId_-CLBiQH5c.mjs.map → _wsId_-BW4pvga3.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-CBs5MnHX.mjs → agents-D01VNBtw.mjs} +6 -6
- package/.output/server/chunks/build/{agents-CBs5MnHX.mjs.map → agents-D01VNBtw.mjs.map} +1 -1
- package/.output/server/chunks/build/{board-2MX66I4I.mjs → board-DRTCHkkb.mjs} +15 -15
- package/.output/server/chunks/build/{board-2MX66I4I.mjs.map → board-DRTCHkkb.mjs.map} +1 -1
- package/.output/server/chunks/build/{channel-templates-HQdH7rSi.mjs → channel-templates-CLVbikUl.mjs} +25 -22
- package/.output/server/chunks/build/channel-templates-CLVbikUl.mjs.map +1 -0
- package/.output/server/chunks/build/{default-Bgt1lEEe.mjs → default-S1G03iOr.mjs} +195 -55
- package/.output/server/chunks/build/{default-Bgt1lEEe.mjs.map → default-S1G03iOr.mjs.map} +1 -1
- package/.output/server/chunks/build/{ontology-qi542_PU.mjs → ontology-ChvlO0hr.mjs} +69 -66
- package/.output/server/chunks/build/ontology-ChvlO0hr.mjs.map +1 -0
- package/.output/server/chunks/build/{optimizer-D1krDGJ8.mjs → optimizer-cAR_QJo3.mjs} +63 -63
- package/.output/server/chunks/build/{optimizer-D1krDGJ8.mjs.map → optimizer-cAR_QJo3.mjs.map} +1 -1
- package/.output/server/chunks/build/{pages-BglOdtvM.mjs → pages-BfBExPSN.mjs} +3 -3
- package/.output/server/chunks/build/{pages-BglOdtvM.mjs.map → pages-BfBExPSN.mjs.map} +1 -1
- package/.output/server/chunks/build/{pipeline-Bm4BvjJk.mjs → pipeline-Cown7Xpn.mjs} +38 -38
- package/.output/server/chunks/build/{pipeline-Bm4BvjJk.mjs.map → pipeline-Cown7Xpn.mjs.map} +1 -1
- package/.output/server/chunks/build/{projects-BxzJhim8.mjs → projects--pAY6UvD.mjs} +46 -29
- package/.output/server/chunks/build/projects--pAY6UvD.mjs.map +1 -0
- package/.output/server/chunks/build/{schedules-ByNLHzUb.mjs → schedules-CO8r0ATX.mjs} +2 -2
- package/.output/server/chunks/build/{schedules-ByNLHzUb.mjs.map → schedules-CO8r0ATX.mjs.map} +1 -1
- package/.output/server/chunks/build/{settings-Cmn3aD8S.mjs → settings-B2Y4Z_Dv.mjs} +102 -66
- package/.output/server/chunks/build/settings-B2Y4Z_Dv.mjs.map +1 -0
- package/.output/server/chunks/build/{studio-UA6uE2rX.mjs → studio-CrZ_athz.mjs} +49 -47
- package/.output/server/chunks/build/studio-CrZ_athz.mjs.map +1 -0
- package/.output/server/chunks/build/{teams-91fbSTKR.mjs → teams-CI3co-r4.mjs} +8 -8
- package/.output/server/chunks/build/{teams-91fbSTKR.mjs.map → teams-CI3co-r4.mjs.map} +1 -1
- package/.output/server/chunks/build/{tools-CymDQIxW.mjs → tools-6vjvrXEV.mjs} +2 -2
- package/.output/server/chunks/build/{tools-CymDQIxW.mjs.map → tools-6vjvrXEV.mjs.map} +1 -1
- package/.output/server/chunks/build/{town-Djy_zAJV.mjs → town-DmnFpDzr.mjs} +3 -3
- package/.output/server/chunks/build/{town-Djy_zAJV.mjs.map → town-DmnFpDzr.mjs.map} +1 -1
- package/.output/server/chunks/build/{useAgentHarnessOptions-_BNL2lCk.mjs → useAgentHarnessOptions-DA0sHG6Q.mjs} +2 -2
- package/.output/server/chunks/build/{useAgentHarnessOptions-_BNL2lCk.mjs.map → useAgentHarnessOptions-DA0sHG6Q.mjs.map} +1 -1
- package/.output/server/chunks/build/{useAgentTemplateActions-DwZgWchg.mjs → useAgentTemplateActions-NN7wJsn8.mjs} +2 -2
- package/.output/server/chunks/build/{useAgentTemplateActions-DwZgWchg.mjs.map → useAgentTemplateActions-NN7wJsn8.mjs.map} +1 -1
- package/.output/server/chunks/build/{useAgentTemplateForm-Coq1ZUFt.mjs → useAgentTemplateForm-Cnr5CF6p.mjs} +2 -2
- package/.output/server/chunks/build/{useAgentTemplateForm-Coq1ZUFt.mjs.map → useAgentTemplateForm-Cnr5CF6p.mjs.map} +1 -1
- package/.output/server/chunks/build/{useAgentTemplatesCatalog-D5_uOqc_.mjs → useAgentTemplatesCatalog-Cov5-icf.mjs} +2 -2
- package/.output/server/chunks/build/{useAgentTemplatesCatalog-D5_uOqc_.mjs.map → useAgentTemplatesCatalog-Cov5-icf.mjs.map} +1 -1
- package/.output/server/chunks/build/{useDashboardData-zegEZEVV.mjs → useDashboardData-mlV9XxSi.mjs} +2 -2
- package/.output/server/chunks/build/{useDashboardData-zegEZEVV.mjs.map → useDashboardData-mlV9XxSi.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamActions-DoE_H7SI.mjs → useTeamActions-6whZe0-H.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamActions-DoE_H7SI.mjs.map → useTeamActions-6whZe0-H.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamAddMemberDialog-DPo909sp.mjs → useTeamAddMemberDialog-Dfjq6MqH.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamAddMemberDialog-DPo909sp.mjs.map → useTeamAddMemberDialog-Dfjq6MqH.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamCreateDialog-De5FKDar.mjs → useTeamCreateDialog-CCL53yq2.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamCreateDialog-De5FKDar.mjs.map → useTeamCreateDialog-CCL53yq2.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamDeployDialog-CgF-2sLw.mjs → useTeamDeployDialog-CEOtXJ-6.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamDeployDialog-CgF-2sLw.mjs.map → useTeamDeployDialog-CEOtXJ-6.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamPluginDialog-DyTbDorE.mjs → useTeamPluginDialog-DrwWX0Fg.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamPluginDialog-DyTbDorE.mjs.map → useTeamPluginDialog-DrwWX0Fg.mjs.map} +1 -1
- package/.output/server/chunks/build/{useTeamsCatalog-D358hKGV.mjs → useTeamsCatalog-DpfL45qY.mjs} +2 -2
- package/.output/server/chunks/build/{useTeamsCatalog-D358hKGV.mjs.map → useTeamsCatalog-DpfL45qY.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkbenchWorkspaces-CfIx3ApC.mjs → useWorkbenchWorkspaces-4_MVYDdE.mjs} +2 -2
- package/.output/server/chunks/build/{useWorkbenchWorkspaces-CfIx3ApC.mjs.map → useWorkbenchWorkspaces-4_MVYDdE.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-Bj1wtLkN.mjs → useWorkshopApi-8Hs5PB69.mjs} +2 -1
- package/.output/server/chunks/build/useWorkshopApi-8Hs5PB69.mjs.map +1 -0
- package/.output/server/chunks/build/{useWorkspaceAuth-BYuPfKMw.mjs → useWorkspaceAuth-_ZjFSIR4.mjs} +2 -2
- package/.output/server/chunks/build/{useWorkspaceAuth-BYuPfKMw.mjs.map → useWorkspaceAuth-_ZjFSIR4.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkspaceChannels-DDDAh7iW.mjs → useWorkspaceChannels-QG6oBcmm.mjs} +2 -2
- package/.output/server/chunks/build/{useWorkspaceChannels-DDDAh7iW.mjs.map → useWorkspaceChannels-QG6oBcmm.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkspacePanels-ht2LWq_7.mjs → useWorkspacePanels-B4hGMl1e.mjs} +2 -2
- package/.output/server/chunks/build/{useWorkspacePanels-ht2LWq_7.mjs.map → useWorkspacePanels-B4hGMl1e.mjs.map} +1 -1
- package/.output/server/chunks/build/{workshop-DXJ1pkhv.mjs → workshop-xJRphBs5.mjs} +3 -3
- package/.output/server/chunks/build/{workshop-DXJ1pkhv.mjs.map → workshop-xJRphBs5.mjs.map} +1 -1
- package/.output/server/chunks/build/{workspaces-DSrMIrqL.mjs → workspaces-CtXv4a9w.mjs} +1 -11
- package/.output/server/chunks/build/{workspaces-DSrMIrqL.mjs.map → workspaces-CtXv4a9w.mjs.map} +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +10 -8
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +3 -2
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +20 -8
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +26 -28
- package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +10 -2
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reopen.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reopen.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/virtual/entry.mjs +32 -32
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +23 -8
- package/README.md +23 -8
- package/app/components/AppSidebar.vue +72 -10
- package/app/components/app-header/HeaderTools.vue +33 -8
- package/app/components/app-header/HitlBell.vue +89 -4
- package/app/components/settings/AppearancePane.vue +34 -7
- package/app/components/workshop/session-list/MountChannelModal.vue +10 -1
- package/app/composables/workshop/useWorkshopApi.ts +3 -2
- package/app/pages/ontology/index.vue +30 -4
- package/app/pages/optimizer/index.vue +31 -28
- package/app/pages/projects/index.vue +258 -38
- package/app/pages/settings.vue +80 -49
- package/app/pages/studio/board.vue +9 -1
- package/app/pages/studio/index.vue +40 -16
- package/app/pages/studio/pipeline.vue +20 -1
- package/app/pages/workshop/channel-templates.vue +14 -7
- package/app/stores/workshop/workspaces.ts +0 -10
- package/config.yml +1 -1
- package/desktop/chrome/contract.mjs +59 -3
- package/desktop/chrome/preload-splash.cjs +29 -0
- package/desktop/chrome/preload.cjs +2 -0
- package/desktop/chrome/settings.mjs +24 -0
- package/desktop/chrome/splash.html +610 -0
- package/desktop/chrome/titlebar.html +8 -1
- package/desktop/chrome/tray-menu.mjs +56 -0
- package/desktop/main.mjs +694 -42
- package/desktop/sidecar.mjs +12 -2
- package/docs/cli.en.md +1 -1
- package/docs/cli.md +1 -1
- package/docs/desktop.md +21 -3
- package/docs/mcp.md +10 -4
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/package.json +223 -219
- package/scripts/e2e-line-governance.mjs +9 -5
- package/scripts/experiments/gemma4-pipeline.mjs +811 -0
- package/scripts/experiments/gemma4-supplement-fix.mjs +119 -0
- package/scripts/experiments/gemma4-supplement.mjs +266 -0
- package/scripts/experiments/tsa-phase-c.mjs +154 -0
- package/scripts/experiments/tsa-phase-f.mjs +167 -0
- package/scripts/experiments/tsa-phase-i.mjs +151 -0
- package/scripts/experiments/tsa-phase-s.mjs +223 -0
- package/scripts/experiments/tsa2-phase-c.mjs +259 -0
- package/scripts/experiments/tsa2-phase-p.mjs +379 -0
- package/scripts/experiments/tsa2-phase-p1.mjs +386 -0
- package/scripts/experiments/tsa2-phase-s.mjs +224 -0
- package/scripts/ui/lib.mjs +7 -0
- package/scripts/ui/seed-demo.mjs +2 -0
- package/server/api/workshop/a2a/[agentId]/card/index.get.ts +15 -9
- package/server/api/workshop/a2a/[agentId]/rpc/index.post.ts +5 -2
- package/server/api/workshop/agents/[id].delete.ts +2 -1
- package/server/api/workshop/agents/[id].get.ts +2 -1
- package/server/api/workshop/channel-templates/[id].get.ts +2 -1
- package/server/api/workshop/channels.post.ts +22 -8
- package/server/api/workshop/daq/[id]/ingest.post.ts +23 -24
- package/server/api/workshop/dcw/line/query.get.ts +5 -2
- package/server/api/workshop/tasks/[id]/cancel/index.post.ts +4 -4
- package/server/api/workshop/tasks/[id]/reopen.post.ts +2 -1
- package/server/api/workshop/tasks/[id]/retry.post.ts +2 -1
- package/server/api/workshop/tasks/[id]/update.post.ts +2 -1
- package/server/api/workshop/tasks/[id].get.ts +2 -2
- package/server/api/workshop/teams/[id]/members/index.get.ts +2 -1
- package/server/api/workshop/teams/[id].get.ts +2 -1
- package/server/services/workshop/db/memory.repo.ts +16 -8
- package/server/services/workshop/dcw/line-query-window.ts +20 -0
- package/server/services/workshop/runtime/manager/admin-channel.ts +54 -3
- package/server/services/workshop/runtime/manager/workspace-defaults.ts +20 -0
- package/.output/public/_nuxt/4zHSAgHR2.js +0 -8
- package/.output/public/_nuxt/B7qnHEGS2.js +0 -1
- package/.output/public/_nuxt/Bn2mnZ8D2.js +0 -1
- package/.output/public/_nuxt/C7cwKZqJ2.js +0 -1
- package/.output/public/_nuxt/CuiM5V6m.js +0 -1
- package/.output/public/_nuxt/DIXtjY5n2.js +0 -2
- package/.output/public/_nuxt/DnKSca_n.js +0 -1
- package/.output/public/_nuxt/board.ByfnFvkG.css +0 -1
- package/.output/public/_nuxt/builds/meta/2547f38c-dfaf-48fa-9b29-334889a73f2c.json +0 -1
- package/.output/public/_nuxt/channel-templates.DnibuaPe.css +0 -1
- package/.output/public/_nuxt/ontology.Clux6c4G.css +0 -1
- package/.output/public/_nuxt/optimizer.BVfrqOYg.css +0 -1
- package/.output/public/_nuxt/pipeline.CYRrisV7.css +0 -1
- package/.output/public/_nuxt/projects.GM3P0C78.css +0 -1
- package/.output/public/_nuxt/studio.BiiONLaO.css +0 -1
- package/.output/server/chunks/build/channel-templates-HQdH7rSi.mjs.map +0 -1
- package/.output/server/chunks/build/ontology-qi542_PU.mjs.map +0 -1
- package/.output/server/chunks/build/projects-BxzJhim8.mjs.map +0 -1
- package/.output/server/chunks/build/settings-Cmn3aD8S.mjs.map +0 -1
- package/.output/server/chunks/build/studio-UA6uE2rX.mjs.map +0 -1
- package/.output/server/chunks/build/useWorkshopApi-Bj1wtLkN.mjs.map +0 -1
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN" data-phase="prepare" data-leaving="false">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data:; connect-src 'none'; font-src 'none'">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<title>AgentWorkShop · 初始化</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--bg: #070c14;
|
|
11
|
+
--top: #0b1322;
|
|
12
|
+
--line: #1d2a3d;
|
|
13
|
+
--line-strong: #2c405b;
|
|
14
|
+
--ink: #e9eff8;
|
|
15
|
+
--soft: #b6c3d5;
|
|
16
|
+
--faint: #93a3b8;
|
|
17
|
+
--dim: #6f8199;
|
|
18
|
+
--mint: #3fe4ab;
|
|
19
|
+
--mint-deep: #2fd79e;
|
|
20
|
+
--danger: #ff8b8b;
|
|
21
|
+
--panel: #0a1220;
|
|
22
|
+
--mono: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
|
|
23
|
+
--gutter: clamp(16px, 5.5vw, 36px);
|
|
24
|
+
/* Local copies of the app's motion tokens keep this page offline. */
|
|
25
|
+
--ease-out-quart: cubic-bezier(0.22, 1, 0.36, 1);
|
|
26
|
+
--transition-base: 200ms var(--ease-out-quart);
|
|
27
|
+
--transition-slow: 240ms var(--ease-out-quart);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
* { box-sizing: border-box; }
|
|
31
|
+
|
|
32
|
+
[hidden] { display: none !important; }
|
|
33
|
+
|
|
34
|
+
html,
|
|
35
|
+
body {
|
|
36
|
+
margin: 0;
|
|
37
|
+
background: var(--bg);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
body {
|
|
41
|
+
color: var(--ink);
|
|
42
|
+
font-family: 'Geist', 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', 'Noto Sans SC', system-ui, sans-serif;
|
|
43
|
+
-webkit-user-select: none;
|
|
44
|
+
user-select: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.frame {
|
|
48
|
+
position: relative;
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: minmax(0, 1fr);
|
|
51
|
+
grid-template-rows: auto 1fr auto;
|
|
52
|
+
min-height: 100vh;
|
|
53
|
+
background: linear-gradient(180deg, var(--top), var(--bg) 62%);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.head {
|
|
57
|
+
position: relative;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 10px;
|
|
61
|
+
min-height: 52px;
|
|
62
|
+
padding: 0 var(--gutter);
|
|
63
|
+
background: radial-gradient(280px 88px at 12% 0, rgb(63 228 171 / 6%), transparent 84%);
|
|
64
|
+
border-bottom: 1px solid var(--line);
|
|
65
|
+
-webkit-app-region: drag;
|
|
66
|
+
app-region: drag;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.head::before {
|
|
70
|
+
position: absolute;
|
|
71
|
+
inset: 0 auto auto 0;
|
|
72
|
+
width: 64px;
|
|
73
|
+
height: 1px;
|
|
74
|
+
content: '';
|
|
75
|
+
background: var(--mint);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.mark {
|
|
79
|
+
flex: none;
|
|
80
|
+
width: 28px;
|
|
81
|
+
height: 28px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.wordmark {
|
|
85
|
+
font-size: 13px;
|
|
86
|
+
line-height: 1;
|
|
87
|
+
letter-spacing: .015em;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.wordmark .agent {
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
color: var(--soft);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.wordmark .shop {
|
|
97
|
+
font-weight: 650;
|
|
98
|
+
color: var(--ink);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.version {
|
|
102
|
+
min-width: 0;
|
|
103
|
+
margin-left: auto;
|
|
104
|
+
padding: 3px 8px;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
font: 10px/1.4 var(--mono);
|
|
107
|
+
color: var(--faint);
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
border: 1px solid var(--line);
|
|
111
|
+
border-radius: 999px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.version:empty { display: none; }
|
|
115
|
+
|
|
116
|
+
.content {
|
|
117
|
+
position: relative;
|
|
118
|
+
display: grid;
|
|
119
|
+
grid-template-rows: auto minmax(60px, 1fr);
|
|
120
|
+
gap: 18px;
|
|
121
|
+
min-width: 0;
|
|
122
|
+
margin: 24px var(--gutter) 16px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.eyebrow {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
margin: 0 0 8px;
|
|
130
|
+
font-size: 11px;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
line-height: 1.4;
|
|
133
|
+
color: var(--mint);
|
|
134
|
+
letter-spacing: .1em;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.phase-dot {
|
|
138
|
+
position: relative;
|
|
139
|
+
flex: none;
|
|
140
|
+
width: 6px;
|
|
141
|
+
height: 6px;
|
|
142
|
+
background: currentColor;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.phase-dot::after {
|
|
147
|
+
position: absolute;
|
|
148
|
+
inset: -3px;
|
|
149
|
+
content: '';
|
|
150
|
+
background: rgb(63 228 171 / 14%);
|
|
151
|
+
border-radius: 50%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
h1 {
|
|
155
|
+
margin: 0;
|
|
156
|
+
font-size: clamp(24px, 5vw, 34px);
|
|
157
|
+
font-weight: 650;
|
|
158
|
+
line-height: 1.18;
|
|
159
|
+
letter-spacing: -.015em;
|
|
160
|
+
text-wrap: pretty;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.detail {
|
|
164
|
+
margin: 8px 0 0;
|
|
165
|
+
font-size: 13px;
|
|
166
|
+
line-height: 1.5;
|
|
167
|
+
color: var(--faint);
|
|
168
|
+
text-wrap: pretty;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.progress {
|
|
172
|
+
display: grid;
|
|
173
|
+
grid-template-columns: minmax(0, 1fr) 4ch;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: 12px;
|
|
176
|
+
margin-top: 18px;
|
|
177
|
+
font: 12px/1.4 var(--mono);
|
|
178
|
+
color: var(--mint);
|
|
179
|
+
text-align: right;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.meter {
|
|
183
|
+
height: 8px;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
background: #111c2c;
|
|
186
|
+
border: 1px solid var(--line);
|
|
187
|
+
border-radius: 999px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.meter-fill {
|
|
191
|
+
display: block;
|
|
192
|
+
height: 100%;
|
|
193
|
+
background: var(--mint-deep);
|
|
194
|
+
transform: scaleX(.1);
|
|
195
|
+
transform-origin: left center;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.steps {
|
|
199
|
+
display: grid;
|
|
200
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
201
|
+
margin: 14px 0 0;
|
|
202
|
+
padding: 0;
|
|
203
|
+
list-style: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.steps li {
|
|
207
|
+
position: relative;
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
gap: 7px;
|
|
211
|
+
font-size: 11px;
|
|
212
|
+
line-height: 1.4;
|
|
213
|
+
color: var(--dim);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.steps li:not(:last-child)::before {
|
|
217
|
+
position: absolute;
|
|
218
|
+
top: 4px;
|
|
219
|
+
right: 5px;
|
|
220
|
+
left: 14px;
|
|
221
|
+
height: 1px;
|
|
222
|
+
content: '';
|
|
223
|
+
background: var(--line);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.steps li.done::before { background: rgb(63 228 171 / 30%); }
|
|
227
|
+
|
|
228
|
+
.tick {
|
|
229
|
+
width: 9px;
|
|
230
|
+
height: 9px;
|
|
231
|
+
background: var(--bg);
|
|
232
|
+
border: 1px solid var(--line-strong);
|
|
233
|
+
border-radius: 50%;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.steps li.done .tick {
|
|
237
|
+
background: var(--mint);
|
|
238
|
+
border-color: var(--mint);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.steps li.active .tick {
|
|
242
|
+
background: var(--mint);
|
|
243
|
+
border-color: var(--bg);
|
|
244
|
+
outline: 1px solid var(--mint);
|
|
245
|
+
outline-offset: 1px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.steps li.done { color: var(--soft); }
|
|
249
|
+
|
|
250
|
+
.steps li.active {
|
|
251
|
+
font-weight: 600;
|
|
252
|
+
color: var(--ink);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.trace {
|
|
256
|
+
display: grid;
|
|
257
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
258
|
+
min-width: 0;
|
|
259
|
+
padding: 8px 12px;
|
|
260
|
+
background: var(--panel);
|
|
261
|
+
border: 1px solid var(--line);
|
|
262
|
+
border-radius: 10px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.trace-head {
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: space-between;
|
|
268
|
+
gap: 8px;
|
|
269
|
+
padding-bottom: 6px;
|
|
270
|
+
font-size: 11px;
|
|
271
|
+
line-height: 1.4;
|
|
272
|
+
color: var(--faint);
|
|
273
|
+
border-bottom: 1px solid var(--line);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
#elapsed { font-family: var(--mono); }
|
|
277
|
+
|
|
278
|
+
.lines {
|
|
279
|
+
margin-top: 6px;
|
|
280
|
+
overflow: auto;
|
|
281
|
+
font: 11px/1.55 var(--mono);
|
|
282
|
+
scrollbar-width: thin;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.line {
|
|
286
|
+
display: flex;
|
|
287
|
+
gap: 10px;
|
|
288
|
+
color: var(--faint);
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.line .at {
|
|
293
|
+
flex: none;
|
|
294
|
+
color: var(--dim);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.line span:last-child {
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
text-overflow: ellipsis;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.line:last-child { color: var(--ink); }
|
|
303
|
+
|
|
304
|
+
.foot {
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-wrap: wrap;
|
|
307
|
+
align-items: center;
|
|
308
|
+
gap: 4px 8px;
|
|
309
|
+
min-height: 40px;
|
|
310
|
+
padding: 6px var(--gutter);
|
|
311
|
+
font-size: 11px;
|
|
312
|
+
line-height: 1.4;
|
|
313
|
+
color: var(--faint);
|
|
314
|
+
border-top: 1px solid var(--line);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.foot-dot {
|
|
318
|
+
flex: none;
|
|
319
|
+
width: 5px;
|
|
320
|
+
height: 5px;
|
|
321
|
+
background: var(--mint);
|
|
322
|
+
border-radius: 50%;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.foot-path {
|
|
326
|
+
margin-left: auto;
|
|
327
|
+
font-family: var(--mono);
|
|
328
|
+
color: var(--dim);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.failure {
|
|
332
|
+
position: absolute;
|
|
333
|
+
inset: 0;
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
justify-content: safe center;
|
|
337
|
+
padding: clamp(14px, 4vw, 26px);
|
|
338
|
+
overflow: auto;
|
|
339
|
+
background: var(--panel);
|
|
340
|
+
border: 1px solid #3a2230;
|
|
341
|
+
border-radius: 12px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.failure-title {
|
|
345
|
+
flex: none;
|
|
346
|
+
margin: 0;
|
|
347
|
+
font-size: 22px;
|
|
348
|
+
font-weight: 650;
|
|
349
|
+
line-height: 1.2;
|
|
350
|
+
color: var(--danger);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.failure-text {
|
|
354
|
+
max-height: 88px;
|
|
355
|
+
margin: 8px 0 0;
|
|
356
|
+
overflow: auto;
|
|
357
|
+
font-size: 12px;
|
|
358
|
+
line-height: 1.6;
|
|
359
|
+
color: var(--soft);
|
|
360
|
+
white-space: pre-wrap;
|
|
361
|
+
overflow-wrap: anywhere;
|
|
362
|
+
-webkit-user-select: text;
|
|
363
|
+
user-select: text;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.actions {
|
|
367
|
+
display: flex;
|
|
368
|
+
flex: none;
|
|
369
|
+
flex-wrap: wrap;
|
|
370
|
+
gap: 8px;
|
|
371
|
+
margin-top: 16px;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.btn {
|
|
375
|
+
min-height: 34px;
|
|
376
|
+
padding: 0 14px;
|
|
377
|
+
font: inherit;
|
|
378
|
+
font-size: 12px;
|
|
379
|
+
font-weight: 600;
|
|
380
|
+
color: var(--soft);
|
|
381
|
+
cursor: pointer;
|
|
382
|
+
background: #101a28;
|
|
383
|
+
border: 1px solid var(--line-strong);
|
|
384
|
+
border-radius: 7px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.btn.primary {
|
|
388
|
+
color: var(--bg);
|
|
389
|
+
background: var(--mint);
|
|
390
|
+
border-color: transparent;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.btn.ghost { background: transparent; }
|
|
394
|
+
|
|
395
|
+
.btn:hover { border-color: var(--mint); }
|
|
396
|
+
.btn.primary:hover { background: #63ebbc; }
|
|
397
|
+
|
|
398
|
+
.btn:focus-visible {
|
|
399
|
+
outline: 2px solid #6fb3ff;
|
|
400
|
+
outline-offset: 2px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
html[data-phase='error'] .eyebrow { color: var(--danger); }
|
|
404
|
+
html[data-phase='error'] .foot-dot { background: var(--danger); }
|
|
405
|
+
|
|
406
|
+
@media (max-height: 420px) {
|
|
407
|
+
.head { min-height: 44px; }
|
|
408
|
+
.foot { min-height: 32px; }
|
|
409
|
+
.content { gap: 10px; margin-block: 10px 8px; }
|
|
410
|
+
.eyebrow { margin-bottom: 4px; }
|
|
411
|
+
h1 { font-size: clamp(22px, 5vw, 27px); }
|
|
412
|
+
.detail { margin-top: 4px; }
|
|
413
|
+
.progress,
|
|
414
|
+
.steps { margin-top: 8px; }
|
|
415
|
+
.trace { padding-block: 7px; }
|
|
416
|
+
.trace-head { padding-bottom: 4px; }
|
|
417
|
+
.lines { max-height: 3.1em; margin-top: 4px; }
|
|
418
|
+
.failure { padding-block: 14px; }
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
@media (max-height: 330px) {
|
|
422
|
+
.lines { max-height: 1.55em; }
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/* Reduced motion gets the same progress and ready state without any animation. */
|
|
426
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
427
|
+
.frame { transition: opacity var(--transition-slow); }
|
|
428
|
+
html[data-leaving='true'] .frame { opacity: 0; }
|
|
429
|
+
.meter-fill { transition: transform var(--transition-base); }
|
|
430
|
+
|
|
431
|
+
html:not([data-phase='ready'], [data-phase='error']) .phase-dot::after {
|
|
432
|
+
animation: phase-pulse 1.7s ease-in-out infinite;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
@keyframes phase-pulse {
|
|
437
|
+
50% { opacity: .35; }
|
|
438
|
+
}
|
|
439
|
+
</style>
|
|
440
|
+
</head>
|
|
441
|
+
<body>
|
|
442
|
+
<main class="frame" id="frame">
|
|
443
|
+
<header class="head">
|
|
444
|
+
<svg class="mark" viewBox="0 0 512 512" aria-hidden="true">
|
|
445
|
+
<defs>
|
|
446
|
+
<linearGradient id="badge" x1="0" y1="0" x2="0" y2="1">
|
|
447
|
+
<stop offset="0" stop-color="#142339" />
|
|
448
|
+
<stop offset=".58" stop-color="#0b1422" />
|
|
449
|
+
<stop offset="1" stop-color="#070c14" />
|
|
450
|
+
</linearGradient>
|
|
451
|
+
<linearGradient id="mint" x1="15" y1="51" x2="49" y2="11" gradientUnits="userSpaceOnUse">
|
|
452
|
+
<stop offset="0" stop-color="#2fd79e" />
|
|
453
|
+
<stop offset="1" stop-color="#63ebbc" />
|
|
454
|
+
</linearGradient>
|
|
455
|
+
<linearGradient id="cyan" x1="23" y1="37" x2="41" y2="37" gradientUnits="userSpaceOnUse">
|
|
456
|
+
<stop offset="0" stop-color="#2bb9e8" />
|
|
457
|
+
<stop offset="1" stop-color="#7ce0ff" />
|
|
458
|
+
</linearGradient>
|
|
459
|
+
</defs>
|
|
460
|
+
<rect width="512" height="512" rx="120" fill="url(#badge)" />
|
|
461
|
+
<rect x="2.5" y="2.5" width="507" height="507" rx="118" fill="none" stroke="#3fe4ab" stroke-opacity=".2" stroke-width="3" />
|
|
462
|
+
<g transform="translate(256 256) scale(8.2) translate(-32 -31.5)" fill="none" stroke-linecap="round">
|
|
463
|
+
<path d="M32 12 15.5 51" stroke="url(#mint)" stroke-width="6.4" />
|
|
464
|
+
<path d="M32 12 48.5 51" stroke="url(#mint)" stroke-width="6.4" />
|
|
465
|
+
<path d="M23.4 37h17.2" stroke="url(#cyan)" stroke-width="5.2" />
|
|
466
|
+
</g>
|
|
467
|
+
</svg>
|
|
468
|
+
<div class="wordmark"><span class="agent">Agent</span><span class="shop">WorkShop</span></div>
|
|
469
|
+
<span class="version" id="version"></span>
|
|
470
|
+
</header>
|
|
471
|
+
|
|
472
|
+
<div class="content">
|
|
473
|
+
<section class="stage">
|
|
474
|
+
<p class="eyebrow"><span class="phase-dot" aria-hidden="true"></span><span id="phase-label">正在初始化</span></p>
|
|
475
|
+
<h1 id="title" role="status" aria-live="polite">准备运行环境</h1>
|
|
476
|
+
<p class="detail" id="detail" aria-live="polite">校验安装载荷与用户数据目录</p>
|
|
477
|
+
<div class="progress">
|
|
478
|
+
<div class="meter" id="meter" role="progressbar" aria-label="初始化进度" aria-valuemin="0" aria-valuemax="100" aria-valuenow="10">
|
|
479
|
+
<span class="meter-fill" id="fill"></span>
|
|
480
|
+
</div>
|
|
481
|
+
<span id="percent" aria-hidden="true">10%</span>
|
|
482
|
+
</div>
|
|
483
|
+
<ol class="steps" id="steps">
|
|
484
|
+
<li data-step="prepare"><span class="tick" aria-hidden="true"></span><span>环境</span></li>
|
|
485
|
+
<li data-step="data"><span class="tick" aria-hidden="true"></span><span>数据</span></li>
|
|
486
|
+
<li data-step="service"><span class="tick" aria-hidden="true"></span><span>服务</span></li>
|
|
487
|
+
<li data-step="workshop"><span class="tick" aria-hidden="true"></span><span>工作台</span></li>
|
|
488
|
+
</ol>
|
|
489
|
+
</section>
|
|
490
|
+
|
|
491
|
+
<section class="trace" aria-label="启动记录">
|
|
492
|
+
<div class="trace-head"><span>启动记录</span><span id="elapsed">0.0s</span></div>
|
|
493
|
+
<div class="lines" id="lines"></div>
|
|
494
|
+
</section>
|
|
495
|
+
|
|
496
|
+
<section class="failure" id="failure" role="alert" hidden>
|
|
497
|
+
<p class="failure-title">启动失败</p>
|
|
498
|
+
<p class="failure-text" id="failure-text"></p>
|
|
499
|
+
<div class="actions">
|
|
500
|
+
<button type="button" class="btn primary" data-action="retry">重试</button>
|
|
501
|
+
<button type="button" class="btn" data-action="open-logs">打开日志</button>
|
|
502
|
+
<button type="button" class="btn ghost" data-action="quit">退出</button>
|
|
503
|
+
</div>
|
|
504
|
+
</section>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<footer class="foot">
|
|
508
|
+
<span class="foot-dot" aria-hidden="true"></span>
|
|
509
|
+
<span id="foot-text">服务就绪后自动进入工作台</span>
|
|
510
|
+
<span class="foot-path">本机服务 · 127.0.0.1</span>
|
|
511
|
+
</footer>
|
|
512
|
+
</main>
|
|
513
|
+
|
|
514
|
+
<script>
|
|
515
|
+
(() => {
|
|
516
|
+
const api = window.awSplash
|
|
517
|
+
const root = document.documentElement
|
|
518
|
+
const byId = id => document.getElementById(id)
|
|
519
|
+
const elements = {
|
|
520
|
+
title: byId('title'),
|
|
521
|
+
detail: byId('detail'),
|
|
522
|
+
phase: byId('phase-label'),
|
|
523
|
+
fill: byId('fill'),
|
|
524
|
+
meter: byId('meter'),
|
|
525
|
+
percent: byId('percent'),
|
|
526
|
+
steps: byId('steps'),
|
|
527
|
+
lines: byId('lines'),
|
|
528
|
+
elapsed: byId('elapsed'),
|
|
529
|
+
version: byId('version'),
|
|
530
|
+
failure: byId('failure'),
|
|
531
|
+
failureText: byId('failure-text'),
|
|
532
|
+
foot: byId('foot-text'),
|
|
533
|
+
}
|
|
534
|
+
const phaseText = {
|
|
535
|
+
prepare: '正在初始化',
|
|
536
|
+
data: '正在初始化',
|
|
537
|
+
service: '正在启动服务',
|
|
538
|
+
workshop: '正在装配工作台',
|
|
539
|
+
ready: '已就绪',
|
|
540
|
+
error: '启动中断',
|
|
541
|
+
}
|
|
542
|
+
const order = ['prepare', 'data', 'service', 'workshop']
|
|
543
|
+
let startedAt = Date.now()
|
|
544
|
+
|
|
545
|
+
const elapsedText = (ms) => {
|
|
546
|
+
const seconds = Math.max(0, ms) / 1000
|
|
547
|
+
return seconds < 60 ? `${seconds.toFixed(1)}s` : `${Math.floor(seconds / 60)}m ${(seconds % 60).toFixed(0)}s`
|
|
548
|
+
}
|
|
549
|
+
const traceAt = (ms) => `+${(Math.max(0, ms) / 1000).toFixed(2).padStart(5, '0')}`
|
|
550
|
+
|
|
551
|
+
function render(state) {
|
|
552
|
+
if (!state) return
|
|
553
|
+
startedAt = Number(state.startedAt) || startedAt
|
|
554
|
+
root.dataset.phase = state.phase || 'prepare'
|
|
555
|
+
root.dataset.leaving = state.leaving ? 'true' : 'false'
|
|
556
|
+
elements.title.textContent = state.title || ''
|
|
557
|
+
elements.detail.textContent = state.detail || ''
|
|
558
|
+
elements.phase.textContent = phaseText[state.phase] || '正在初始化'
|
|
559
|
+
const progress = Math.max(0, Math.min(100, Number(state.progress) || 0))
|
|
560
|
+
const roundedProgress = Math.round(progress)
|
|
561
|
+
elements.fill.style.transform = `scaleX(${progress / 100})`
|
|
562
|
+
elements.percent.textContent = `${roundedProgress}%`
|
|
563
|
+
elements.meter.setAttribute('aria-valuenow', String(roundedProgress))
|
|
564
|
+
elements.meter.setAttribute('aria-label', state.title || '初始化进度')
|
|
565
|
+
const index = order.indexOf(state.phase)
|
|
566
|
+
for (const item of elements.steps.querySelectorAll('[data-step]')) {
|
|
567
|
+
const at = order.indexOf(item.dataset.step)
|
|
568
|
+
item.classList.toggle('done', state.phase === 'ready' || (index >= 0 && at < index))
|
|
569
|
+
item.classList.toggle('active', at === index)
|
|
570
|
+
}
|
|
571
|
+
const trace = Array.isArray(state.trace) ? state.trace.slice(-4) : []
|
|
572
|
+
elements.lines.replaceChildren(...trace.map((entry) => {
|
|
573
|
+
const line = document.createElement('div')
|
|
574
|
+
line.className = 'line'
|
|
575
|
+
const at = document.createElement('span')
|
|
576
|
+
at.className = 'at'
|
|
577
|
+
at.textContent = traceAt(entry.at)
|
|
578
|
+
const text = document.createElement('span')
|
|
579
|
+
text.textContent = String(entry.text || '')
|
|
580
|
+
line.append(at, text)
|
|
581
|
+
return line
|
|
582
|
+
}))
|
|
583
|
+
elements.version.textContent = state.version ? `v${state.version}` : ''
|
|
584
|
+
const failed = state.phase === 'error'
|
|
585
|
+
elements.failure.hidden = !failed
|
|
586
|
+
if (failed) {
|
|
587
|
+
elements.failureText.textContent = `${state.error || '本机服务未能启动。'}\n日志:${state.logPath || ''}`
|
|
588
|
+
elements.phase.textContent = phaseText.error
|
|
589
|
+
}
|
|
590
|
+
elements.foot.textContent = failed
|
|
591
|
+
? '可以重试,或打开日志查看原因'
|
|
592
|
+
: state.phase === 'ready' ? '工作台已就绪,正在进入' : '服务就绪后自动进入工作台'
|
|
593
|
+
elements.lines.scrollTop = elements.lines.scrollHeight
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
setInterval(() => { elements.elapsed.textContent = elapsedText(Date.now() - startedAt) }, 100)
|
|
597
|
+
document.querySelectorAll('[data-action]').forEach((button) => {
|
|
598
|
+
button.addEventListener('click', () => api?.action(button.dataset.action))
|
|
599
|
+
})
|
|
600
|
+
if (api) {
|
|
601
|
+
api.onState(render)
|
|
602
|
+
api.hello()
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
root.dataset.ready = 'missing'
|
|
606
|
+
}
|
|
607
|
+
})()
|
|
608
|
+
</script>
|
|
609
|
+
</body>
|
|
610
|
+
</html>
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
<svg class="glyph-max" viewBox="0 0 10 10" aria-hidden="true"><rect x="1.1" y="1.1" width="7.8" height="7.8" rx="1.2" /></svg>
|
|
376
376
|
<svg class="glyph-restore" viewBox="0 0 10 10" aria-hidden="true"><path d="M3.4 2.2h4.4a.9.9 0 0 1 .9.9v4.4" /><rect x="1.3" y="3.3" width="5.4" height="5.4" rx="1" /></svg>
|
|
377
377
|
</button>
|
|
378
|
-
<button class="ctl ctl-close" type="button" data-action="close" aria-label="
|
|
378
|
+
<button class="ctl ctl-close" type="button" data-action="close" aria-label="关闭到托盘" title="关闭到托盘">
|
|
379
379
|
<svg viewBox="0 0 10 10" aria-hidden="true"><path d="M1.6 1.6l6.8 6.8M8.4 1.6l-6.8 6.8" /></svg>
|
|
380
380
|
</button>
|
|
381
381
|
</div>
|
|
@@ -390,6 +390,7 @@
|
|
|
390
390
|
const updateLabel = document.getElementById('update-label')
|
|
391
391
|
const status = document.getElementById('status')
|
|
392
392
|
const statusText = document.getElementById('status-text')
|
|
393
|
+
const close = document.querySelector('[data-action="close"]')
|
|
393
394
|
const labels = { online: '已连接', connecting: '连接中', offline: '已断开' }
|
|
394
395
|
if (!api) {
|
|
395
396
|
root.dataset.ready = 'missing'
|
|
@@ -439,6 +440,12 @@
|
|
|
439
440
|
api.onTheme((value) => {
|
|
440
441
|
root.dataset.theme = value === 'light' ? 'light' : 'dark'
|
|
441
442
|
})
|
|
443
|
+
api.onPrefs((prefs) => {
|
|
444
|
+
const toTray = !prefs || prefs.closeToTray !== false
|
|
445
|
+
if (!close) return
|
|
446
|
+
close.title = toTray ? '关闭到托盘' : '关闭'
|
|
447
|
+
close.setAttribute('aria-label', close.title)
|
|
448
|
+
})
|
|
442
449
|
api.onTitle((value) => {
|
|
443
450
|
const text = typeof value === 'string' ? value.trim() : ''
|
|
444
451
|
page.textContent = text
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Declarative tray menu model. Electron maps these descriptors to native menu
|
|
2
|
+
// items; unit tests can assert the exact user-facing surface without a display.
|
|
3
|
+
|
|
4
|
+
const SETTINGS = Object.freeze([
|
|
5
|
+
{ key: 'closeToTray', label: '关闭时最小化到托盘' },
|
|
6
|
+
{ key: 'launchAtLogin', label: '开机自动启动' },
|
|
7
|
+
{ key: 'startHidden', label: '启动后最小化到托盘' },
|
|
8
|
+
{ key: 'trayNotifications', label: '托盘通知' },
|
|
9
|
+
{ key: 'autoCheckUpdates', label: '自动检查更新' },
|
|
10
|
+
])
|
|
11
|
+
|
|
12
|
+
function updateLabel(update) {
|
|
13
|
+
if (update?.status === 'available') return `查看新版本 v${update.version}`
|
|
14
|
+
if (update?.status === 'downloading') return `正在下载更新 ${Math.max(0, Math.min(100, Number(update.progress) || 0))}%`
|
|
15
|
+
if (update?.status === 'ready') return `安装 v${update.version} 并重启`
|
|
16
|
+
return '检查更新…'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function buildTrayMenuModel({ settings, service, port, version, windowVisible, update }) {
|
|
20
|
+
const online = service === 'online'
|
|
21
|
+
const serviceLabel = online
|
|
22
|
+
? `本机服务 · 运行中${port ? ` · 127.0.0.1:${port}` : ''}`
|
|
23
|
+
: service === 'offline' ? '本机服务 · 已断开' : '本机服务 · 启动中…'
|
|
24
|
+
const updateBusy = ['downloading', 'ready'].includes(update?.status)
|
|
25
|
+
return [
|
|
26
|
+
{ id: 'open', label: windowVisible ? '打开 AgentWorkShop' : '显示主窗口' },
|
|
27
|
+
{ id: 'reload', label: '重新加载界面', enabled: online },
|
|
28
|
+
{ type: 'separator' },
|
|
29
|
+
{ id: 'service-status', label: serviceLabel, enabled: false },
|
|
30
|
+
{ id: 'restart-service', label: '重启本地服务…', enabled: online },
|
|
31
|
+
{ type: 'separator' },
|
|
32
|
+
{ id: 'check-update', label: updateLabel(update), enabled: !updateBusy && update?.status !== 'ready' },
|
|
33
|
+
{ id: 'open-home', label: '打开数据目录' },
|
|
34
|
+
{ id: 'open-logs', label: '打开日志目录' },
|
|
35
|
+
{ id: 'diagnostics', label: '诊断信息…' },
|
|
36
|
+
{ type: 'separator' },
|
|
37
|
+
{
|
|
38
|
+
id: 'settings',
|
|
39
|
+
label: '设置',
|
|
40
|
+
submenu: SETTINGS.map(item => ({
|
|
41
|
+
id: `setting:${item.key}`,
|
|
42
|
+
label: item.label,
|
|
43
|
+
type: 'checkbox',
|
|
44
|
+
checked: Boolean(settings?.[item.key]),
|
|
45
|
+
})),
|
|
46
|
+
},
|
|
47
|
+
{ type: 'separator' },
|
|
48
|
+
{ id: 'quit', label: `退出 AgentWorkShop${version ? ` ${version}` : ''}` },
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Settings entries for the tray submenu, also used for change notifications. */
|
|
53
|
+
export const TRAY_SETTINGS = SETTINGS
|
|
54
|
+
|
|
55
|
+
/** Settings keys exposed by the tray submenu; used to validate click payloads. */
|
|
56
|
+
export const TRAY_SETTING_KEYS = Object.freeze(SETTINGS.map(item => item.key))
|