agim-cli 1.5.0 → 1.5.1
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/CHANGELOG.md +22 -0
- package/README.md +39 -3
- package/README.zh-CN.md +42 -7
- package/dist/cli-ui/cmd-handlers.d.ts +22 -1
- package/dist/cli-ui/cmd-handlers.d.ts.map +1 -1
- package/dist/cli-ui/cmd-handlers.js +304 -40
- package/dist/cli-ui/cmd-handlers.js.map +1 -1
- package/dist/cli-ui/config-wizard.d.ts +13 -1
- package/dist/cli-ui/config-wizard.d.ts.map +1 -1
- package/dist/cli-ui/config-wizard.js +93 -21
- package/dist/cli-ui/config-wizard.js.map +1 -1
- package/dist/cli-ui/doctor.d.ts +15 -0
- package/dist/cli-ui/doctor.d.ts.map +1 -0
- package/dist/cli-ui/doctor.js +151 -0
- package/dist/cli-ui/doctor.js.map +1 -0
- package/dist/cli-ui/entry-menu.d.ts +6 -0
- package/dist/cli-ui/entry-menu.d.ts.map +1 -1
- package/dist/cli-ui/entry-menu.js +67 -30
- package/dist/cli-ui/entry-menu.js.map +1 -1
- package/dist/cli-ui/i18n.d.ts +15 -6
- package/dist/cli-ui/i18n.d.ts.map +1 -1
- package/dist/cli-ui/i18n.js +30 -12
- package/dist/cli-ui/i18n.js.map +1 -1
- package/dist/cli-ui/quickstart.d.ts +3 -0
- package/dist/cli-ui/quickstart.d.ts.map +1 -0
- package/dist/cli-ui/quickstart.js +108 -0
- package/dist/cli-ui/quickstart.js.map +1 -0
- package/dist/cli-ui/readiness.d.ts +10 -0
- package/dist/cli-ui/readiness.d.ts.map +1 -0
- package/dist/cli-ui/readiness.js +75 -0
- package/dist/cli-ui/readiness.js.map +1 -0
- package/dist/cli-ui/service.d.ts +23 -0
- package/dist/cli-ui/service.d.ts.map +1 -1
- package/dist/cli-ui/service.js +114 -5
- package/dist/cli-ui/service.js.map +1 -1
- package/dist/cli.js +99 -396
- package/dist/cli.js.map +1 -1
- package/dist/core/acp-server.d.ts.map +1 -1
- package/dist/core/acp-server.js +16 -2
- package/dist/core/acp-server.js.map +1 -1
- package/dist/core/agent-cwd.d.ts +8 -0
- package/dist/core/agent-cwd.d.ts.map +1 -1
- package/dist/core/agent-cwd.js +57 -7
- package/dist/core/agent-cwd.js.map +1 -1
- package/dist/core/commands/builtin.d.ts.map +1 -1
- package/dist/core/commands/builtin.js +12 -2
- package/dist/core/commands/builtin.js.map +1 -1
- package/dist/core/commands/model.d.ts.map +1 -1
- package/dist/core/commands/model.js +31 -2
- package/dist/core/commands/model.js.map +1 -1
- package/dist/core/llm/anthropic-provider.js +2 -1
- package/dist/core/llm/anthropic-provider.js.map +1 -1
- package/dist/core/llm/openai-compat-provider.js +3 -2
- package/dist/core/llm/openai-compat-provider.js.map +1 -1
- package/dist/core/llm/provider-base.d.ts +4 -4
- package/dist/core/llm/provider-base.d.ts.map +1 -1
- package/dist/core/llm/provider-base.js +1 -1
- package/dist/core/llm/provider-base.js.map +1 -1
- package/dist/plugins/agents/native/index.d.ts +1 -0
- package/dist/plugins/agents/native/index.d.ts.map +1 -1
- package/dist/plugins/agents/native/index.js +14 -0
- package/dist/plugins/agents/native/index.js.map +1 -1
- package/dist/plugins/agents/pi-native/factory.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/factory.js +19 -3
- package/dist/plugins/agents/pi-native/factory.js.map +1 -1
- package/dist/plugins/agents/pi-native/index.d.ts +11 -0
- package/dist/plugins/agents/pi-native/index.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/index.js +56 -2
- package/dist/plugins/agents/pi-native/index.js.map +1 -1
- package/dist/plugins/agents/pi-native/provider-resolver.d.ts +2 -0
- package/dist/plugins/agents/pi-native/provider-resolver.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/provider-resolver.js +9 -1
- package/dist/plugins/agents/pi-native/provider-resolver.js.map +1 -1
- package/dist/web/public/assets/a2a-CTsDMefo.js +7 -0
- package/dist/web/public/assets/a2a-CTsDMefo.js.map +1 -0
- package/dist/web/public/assets/{activity-BAgb2WZC.js → activity-ul8Os7Pz.js} +2 -2
- package/dist/web/public/assets/{activity-BAgb2WZC.js.map → activity-ul8Os7Pz.js.map} +1 -1
- package/dist/web/public/assets/{admins-CZYANmhn.js → admins-ByMAuquy.js} +3 -3
- package/dist/web/public/assets/{admins-CZYANmhn.js.map → admins-ByMAuquy.js.map} +1 -1
- package/dist/web/public/assets/agents-Ds1zyxBj.js +2 -0
- package/dist/web/public/assets/{agents-BXThDW6f.js.map → agents-Ds1zyxBj.js.map} +1 -1
- package/dist/web/public/assets/{approvals-ByPXIYVl.js → approvals-DOWlWI7Z.js} +3 -3
- package/dist/web/public/assets/{approvals-ByPXIYVl.js.map → approvals-DOWlWI7Z.js.map} +1 -1
- package/dist/web/public/assets/{arrow-down-B8DkdbEY.js → arrow-down-7i0xwCI2.js} +2 -2
- package/dist/web/public/assets/{arrow-down-B8DkdbEY.js.map → arrow-down-7i0xwCI2.js.map} +1 -1
- package/dist/web/public/assets/arrow-right-A889Wof8.js +7 -0
- package/dist/web/public/assets/arrow-right-A889Wof8.js.map +1 -0
- package/dist/web/public/assets/{arrow-up-i_dEdXkz.js → arrow-up-Dm0U4-6U.js} +2 -2
- package/dist/web/public/assets/{arrow-up-i_dEdXkz.js.map → arrow-up-Dm0U4-6U.js.map} +1 -1
- package/dist/web/public/assets/{asks-yD_inOnM.js → asks-DGuBsrJ7.js} +3 -3
- package/dist/web/public/assets/{asks-yD_inOnM.js.map → asks-DGuBsrJ7.js.map} +1 -1
- package/dist/web/public/assets/{audit-teCIRtgN.js → audit-BRXsplJ2.js} +2 -2
- package/dist/web/public/assets/{audit-teCIRtgN.js.map → audit-BRXsplJ2.js.map} +1 -1
- package/dist/web/public/assets/{bell-CeWDMs8_.js → bell-B-UdeJsp.js} +2 -2
- package/dist/web/public/assets/{bell-CeWDMs8_.js.map → bell-B-UdeJsp.js.map} +1 -1
- package/dist/web/public/assets/bgjobs-CcRiffyJ.js +2 -0
- package/dist/web/public/assets/bgjobs-CcRiffyJ.js.map +1 -0
- package/dist/web/public/assets/book-open-CSCq5cjL.js +7 -0
- package/dist/web/public/assets/book-open-CSCq5cjL.js.map +1 -0
- package/dist/web/public/assets/{brain-BQqv0Zhc.js → brain-Dl4DF5kX.js} +2 -2
- package/dist/web/public/assets/{brain-BQqv0Zhc.js.map → brain-Dl4DF5kX.js.map} +1 -1
- package/dist/web/public/assets/{briefcase-DUXbR4xs.js → briefcase-CeKUkFSq.js} +2 -2
- package/dist/web/public/assets/{briefcase-DUXbR4xs.js.map → briefcase-CeKUkFSq.js.map} +1 -1
- package/dist/web/public/assets/chat-rLJMdJBk.js +12 -0
- package/dist/web/public/assets/chat-rLJMdJBk.js.map +1 -0
- package/dist/web/public/assets/{chevron-left-RC6mMSiX.js → chevron-left-01fAFVpo.js} +2 -2
- package/dist/web/public/assets/{chevron-left-RC6mMSiX.js.map → chevron-left-01fAFVpo.js.map} +1 -1
- package/dist/web/public/assets/{chevron-right-DrkYVi19.js → chevron-right-CFRb-SM_.js} +3 -3
- package/dist/web/public/assets/{chevron-right-DrkYVi19.js.map → chevron-right-CFRb-SM_.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-big-BC8ntMsz.js → circle-check-big-DBg2BD6o.js} +2 -2
- package/dist/web/public/assets/{circle-check-big-BC8ntMsz.js.map → circle-check-big-DBg2BD6o.js.map} +1 -1
- package/dist/web/public/assets/{circle-x-DHK7ypFY.js → circle-x-CqFMzO-x.js} +2 -2
- package/dist/web/public/assets/{circle-x-DHK7ypFY.js.map → circle-x-CqFMzO-x.js.map} +1 -1
- package/dist/web/public/assets/clipboard-list-lnqdk2_J.js +7 -0
- package/dist/web/public/assets/clipboard-list-lnqdk2_J.js.map +1 -0
- package/dist/web/public/assets/{clock-DXHhWqJH.js → clock-4hd1joQe.js} +3 -3
- package/dist/web/public/assets/{clock-DXHhWqJH.js.map → clock-4hd1joQe.js.map} +1 -1
- package/dist/web/public/assets/confirm-dialog-BDb0NLny.js +2 -0
- package/dist/web/public/assets/{confirm-dialog-gPKJnvEW.js.map → confirm-dialog-BDb0NLny.js.map} +1 -1
- package/dist/web/public/assets/{copy-DtQxgcR0.js → copy-CD4A7VD8.js} +3 -3
- package/dist/web/public/assets/{copy-DtQxgcR0.js.map → copy-CD4A7VD8.js.map} +1 -1
- package/dist/web/public/assets/dashboard-CG3WiG7h.js +2 -0
- package/dist/web/public/assets/dashboard-CG3WiG7h.js.map +1 -0
- package/dist/web/public/assets/{data-table-DOKUic1J.js → data-table-BkUshOZz.js} +2 -2
- package/dist/web/public/assets/{data-table-DOKUic1J.js.map → data-table-BkUshOZz.js.map} +1 -1
- package/dist/web/public/assets/database-lQzk64rV.js +7 -0
- package/dist/web/public/assets/database-lQzk64rV.js.map +1 -0
- package/dist/web/public/assets/{distill-p6P7-1UR.js → distill-CPurVW3v.js} +3 -3
- package/dist/web/public/assets/{distill-p6P7-1UR.js.map → distill-CPurVW3v.js.map} +1 -1
- package/dist/web/public/assets/{download-CqNiIHa8.js → download-CVZnHcwj.js} +2 -2
- package/dist/web/public/assets/{download-CqNiIHa8.js.map → download-CVZnHcwj.js.map} +1 -1
- package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js +7 -0
- package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js.map +1 -0
- package/dist/web/public/assets/{email-DwbfTUlV.js → email-YlI4MWLp.js} +3 -3
- package/dist/web/public/assets/{email-DwbfTUlV.js.map → email-YlI4MWLp.js.map} +1 -1
- package/dist/web/public/assets/{empty-state-CTwOQemt.js → empty-state-CuiqdZiB.js} +2 -2
- package/dist/web/public/assets/{empty-state-CTwOQemt.js.map → empty-state-CuiqdZiB.js.map} +1 -1
- package/dist/web/public/assets/{external-link-BY7Ye8yi.js → external-link-1WPpVvdu.js} +2 -2
- package/dist/web/public/assets/{external-link-BY7Ye8yi.js.map → external-link-1WPpVvdu.js.map} +1 -1
- package/dist/web/public/assets/{eye-6RUADoDS.js → eye-BfPyNFzk.js} +2 -2
- package/dist/web/public/assets/{eye-6RUADoDS.js.map → eye-BfPyNFzk.js.map} +1 -1
- package/dist/web/public/assets/{facts-DXE0aJmb.js → facts-xT_24pH8.js} +2 -2
- package/dist/web/public/assets/{facts-DXE0aJmb.js.map → facts-xT_24pH8.js.map} +1 -1
- package/dist/web/public/assets/file-text-BxfdLM0-.js +7 -0
- package/dist/web/public/assets/file-text-BxfdLM0-.js.map +1 -0
- package/dist/web/public/assets/{goals-C1LCm3qL.js → goals-C8ZQfbhj.js} +3 -3
- package/dist/web/public/assets/{goals-C1LCm3qL.js.map → goals-C8ZQfbhj.js.map} +1 -1
- package/dist/web/public/assets/health-A2StNEfn.js +2 -0
- package/dist/web/public/assets/{health-wqCp-K_o.js.map → health-A2StNEfn.js.map} +1 -1
- package/dist/web/public/assets/{heart-pulse-DfqI4GF7.js → heart-pulse-DXlE9oic.js} +2 -2
- package/dist/web/public/assets/{heart-pulse-DfqI4GF7.js.map → heart-pulse-DXlE9oic.js.map} +1 -1
- package/dist/web/public/assets/{heartbeat-Bumv4XtQ.js → heartbeat-ClO5gJrj.js} +3 -3
- package/dist/web/public/assets/{heartbeat-Bumv4XtQ.js.map → heartbeat-ClO5gJrj.js.map} +1 -1
- package/dist/web/public/assets/hot-bfTA-V_z.js +7 -0
- package/dist/web/public/assets/{hot-B-CMjQIr.js.map → hot-bfTA-V_z.js.map} +1 -1
- package/dist/web/public/assets/index-Bi2qWb-u.css +1 -0
- package/dist/web/public/assets/index-DCfdN5R7.js +244 -0
- package/dist/web/public/assets/index-DCfdN5R7.js.map +1 -0
- package/dist/web/public/assets/{injection-Dn_XqgLG.js → injection-omvCR6-p.js} +2 -2
- package/dist/web/public/assets/{injection-Dn_XqgLG.js.map → injection-omvCR6-p.js.map} +1 -1
- package/dist/web/public/assets/{installed-Cet-1M2Q.js → installed-DL6r3ktm.js} +4 -9
- package/dist/web/public/assets/installed-DL6r3ktm.js.map +1 -0
- package/dist/web/public/assets/jobs-Biy5lYd4.js +2 -0
- package/dist/web/public/assets/jobs-Biy5lYd4.js.map +1 -0
- package/dist/web/public/assets/layout-BLm6NJ3V.js +2 -0
- package/dist/web/public/assets/layout-BLm6NJ3V.js.map +1 -0
- package/dist/web/public/assets/layout-BTKafRVZ.js +2 -0
- package/dist/web/public/assets/layout-BTKafRVZ.js.map +1 -0
- package/dist/web/public/assets/layout-Bm-2s2fp.js +2 -0
- package/dist/web/public/assets/layout-Bm-2s2fp.js.map +1 -0
- package/dist/web/public/assets/layout-DsZ8eR4i.js +2 -0
- package/dist/web/public/assets/layout-DsZ8eR4i.js.map +1 -0
- package/dist/web/public/assets/{layout-D_3ZcVG7.js → layout-sxvovjEH.js} +2 -2
- package/dist/web/public/assets/{layout-D_3ZcVG7.js.map → layout-sxvovjEH.js.map} +1 -1
- package/dist/web/public/assets/llm-JjZDbBvJ.js +37 -0
- package/dist/web/public/assets/llm-JjZDbBvJ.js.map +1 -0
- package/dist/web/public/assets/loader-circle-DDdmcH0k.js +7 -0
- package/dist/web/public/assets/{loader-circle-DgdBWYl0.js.map → loader-circle-DDdmcH0k.js.map} +1 -1
- package/dist/web/public/assets/{map-pin-3QS1A0-I.js → map-pin-C_jAxukI.js} +2 -2
- package/dist/web/public/assets/{map-pin-3QS1A0-I.js.map → map-pin-C_jAxukI.js.map} +1 -1
- package/dist/web/public/assets/{mcp-DwKZULET.js → mcp-vKajK1F8.js} +3 -3
- package/dist/web/public/assets/{mcp-DwKZULET.js.map → mcp-vKajK1F8.js.map} +1 -1
- package/dist/web/public/assets/memos-DAt4k3DO.js +7 -0
- package/dist/web/public/assets/memos-DAt4k3DO.js.map +1 -0
- package/dist/web/public/assets/messengers-GYVTFlAj.js +2 -0
- package/dist/web/public/assets/messengers-GYVTFlAj.js.map +1 -0
- package/dist/web/public/assets/{mobile-Bq0FH9JV.js → mobile-VUyTo40E.js} +3 -3
- package/dist/web/public/assets/{mobile-Bq0FH9JV.js.map → mobile-VUyTo40E.js.map} +1 -1
- package/dist/web/public/assets/{network--s113Jkm.js → network-BUeWK3bs.js} +2 -2
- package/dist/web/public/assets/{network--s113Jkm.js.map → network-BUeWK3bs.js.map} +1 -1
- package/dist/web/public/assets/outbox-CEE0rwN3.js +2 -0
- package/dist/web/public/assets/outbox-CEE0rwN3.js.map +1 -0
- package/dist/web/public/assets/overview-BSOZ5gTD.js +12 -0
- package/dist/web/public/assets/overview-BSOZ5gTD.js.map +1 -0
- package/dist/web/public/assets/overview-COop5K2Y.js +12 -0
- package/dist/web/public/assets/overview-COop5K2Y.js.map +1 -0
- package/dist/web/public/assets/overview-DeH5ud6d.js +2 -0
- package/dist/web/public/assets/overview-DeH5ud6d.js.map +1 -0
- package/dist/web/public/assets/{pagination-DkdCTctJ.js → pagination-BBicLzXP.js} +3 -3
- package/dist/web/public/assets/{pagination-DkdCTctJ.js.map → pagination-BBicLzXP.js.map} +1 -1
- package/dist/web/public/assets/persona-CElXQZ4p.js +2 -0
- package/dist/web/public/assets/{persona-BvtcZh6G.js.map → persona-CElXQZ4p.js.map} +1 -1
- package/dist/web/public/assets/{plans-i3a6lrqF.js → plans-Bo5LlLeH.js} +3 -8
- package/dist/web/public/assets/plans-Bo5LlLeH.js.map +1 -0
- package/dist/web/public/assets/{play-CPoE_JnS.js → play-DX5wp4WH.js} +2 -2
- package/dist/web/public/assets/{play-CPoE_JnS.js.map → play-DX5wp4WH.js.map} +1 -1
- package/dist/web/public/assets/{plus-CfzKV_0u.js → plus-DH4J_YhN.js} +2 -2
- package/dist/web/public/assets/{plus-CfzKV_0u.js.map → plus-DH4J_YhN.js.map} +1 -1
- package/dist/web/public/assets/policy-BrgOuDt_.js +2 -0
- package/dist/web/public/assets/{policy-Cm88P8LO.js.map → policy-BrgOuDt_.js.map} +1 -1
- package/dist/web/public/assets/{qr-code-DMkV8nv2.js → qr-code-YrEuhMPC.js} +2 -2
- package/dist/web/public/assets/{qr-code-DMkV8nv2.js.map → qr-code-YrEuhMPC.js.map} +1 -1
- package/dist/web/public/assets/{refresh-ccw-nBMm5Xal.js → refresh-ccw-DlAd-eTQ.js} +2 -2
- package/dist/web/public/assets/{refresh-ccw-nBMm5Xal.js.map → refresh-ccw-DlAd-eTQ.js.map} +1 -1
- package/dist/web/public/assets/{reminders-DjEujanC.js → reminders-DBEE0zXG.js} +3 -3
- package/dist/web/public/assets/{reminders-DjEujanC.js.map → reminders-DBEE0zXG.js.map} +1 -1
- package/dist/web/public/assets/{save-DbrrCFDM.js → save-BDOtZrfp.js} +2 -2
- package/dist/web/public/assets/{save-DbrrCFDM.js.map → save-BDOtZrfp.js.map} +1 -1
- package/dist/web/public/assets/schedules-DAyhVI8-.js +2 -0
- package/dist/web/public/assets/schedules-DAyhVI8-.js.map +1 -0
- package/dist/web/public/assets/{search-5q3dkINm.js → search-55mtgHrB.js} +3 -3
- package/dist/web/public/assets/{search-5q3dkINm.js.map → search-55mtgHrB.js.map} +1 -1
- package/dist/web/public/assets/{search-DbE4VEm9.js → search-CAICU3aU.js} +2 -2
- package/dist/web/public/assets/{search-DbE4VEm9.js.map → search-CAICU3aU.js.map} +1 -1
- package/dist/web/public/assets/security-CbP4QgVp.js +2 -0
- package/dist/web/public/assets/security-CbP4QgVp.js.map +1 -0
- package/dist/web/public/assets/server-Dg4e8pvm.js +7 -0
- package/dist/web/public/assets/server-Dg4e8pvm.js.map +1 -0
- package/dist/web/public/assets/service-gWZa3sup.js +7 -0
- package/dist/web/public/assets/service-gWZa3sup.js.map +1 -0
- package/dist/web/public/assets/{shield-alert-WOa69jy3.js → shield-alert-DOKK9EnJ.js} +2 -2
- package/dist/web/public/assets/{shield-alert-WOa69jy3.js.map → shield-alert-DOKK9EnJ.js.map} +1 -1
- package/dist/web/public/assets/sparkles-G0QIs9nP.js +7 -0
- package/dist/web/public/assets/sparkles-G0QIs9nP.js.map +1 -0
- package/dist/web/public/assets/start-D-abhl3q.js +2 -0
- package/dist/web/public/assets/start-D-abhl3q.js.map +1 -0
- package/dist/web/public/assets/{status-badge-D5xhwquL.js → status-badge-CyLdpsXq.js} +2 -2
- package/dist/web/public/assets/{status-badge-D5xhwquL.js.map → status-badge-CyLdpsXq.js.map} +1 -1
- package/dist/web/public/assets/{subtasks-DMRyk6YS.js → subtasks-BnEjSGUR.js} +3 -3
- package/dist/web/public/assets/{subtasks-DMRyk6YS.js.map → subtasks-BnEjSGUR.js.map} +1 -1
- package/dist/web/public/assets/{table-Dx65w6V0.js → table-sCMZBe_Z.js} +2 -2
- package/dist/web/public/assets/{table-Dx65w6V0.js.map → table-sCMZBe_Z.js.map} +1 -1
- package/dist/web/public/assets/terminal-_pXeEjXG.js +7 -0
- package/dist/web/public/assets/terminal-_pXeEjXG.js.map +1 -0
- package/dist/web/public/assets/{topn-L7Juczp3.js → topn-D1B-gS1M.js} +3 -3
- package/dist/web/public/assets/{topn-L7Juczp3.js.map → topn-D1B-gS1M.js.map} +1 -1
- package/dist/web/public/assets/{trash-2-7xrfqd-v.js → trash-2-D2x2UPuZ.js} +2 -2
- package/dist/web/public/assets/{trash-2-7xrfqd-v.js.map → trash-2-D2x2UPuZ.js.map} +1 -1
- package/dist/web/public/assets/use-a2a-C98e2Via.js +2 -0
- package/dist/web/public/assets/use-a2a-C98e2Via.js.map +1 -0
- package/dist/web/public/assets/{use-agim-skills-pFjfgqMF.js → use-agim-skills-BbuJP3NT.js} +2 -2
- package/dist/web/public/assets/{use-agim-skills-pFjfgqMF.js.map → use-agim-skills-BbuJP3NT.js.map} +1 -1
- package/dist/web/public/assets/use-background-tasks-CwFmOokw.js +2 -0
- package/dist/web/public/assets/{use-background-tasks-D1--hHjp.js.map → use-background-tasks-CwFmOokw.js.map} +1 -1
- package/dist/web/public/assets/use-jobs-BJjeJ5lh.js +2 -0
- package/dist/web/public/assets/use-jobs-BJjeJ5lh.js.map +1 -0
- package/dist/web/public/assets/use-memory-CXDwKCco.js +2 -0
- package/dist/web/public/assets/{use-memory-Bz1Zao7g.js.map → use-memory-CXDwKCco.js.map} +1 -1
- package/dist/web/public/assets/use-observability-CY5ZUPrC.js +2 -0
- package/dist/web/public/assets/{use-observability-DtqSWVjM.js.map → use-observability-CY5ZUPrC.js.map} +1 -1
- package/dist/web/public/assets/use-outbox-DT_XWB_7.js +7 -0
- package/dist/web/public/assets/use-outbox-DT_XWB_7.js.map +1 -0
- package/dist/web/public/assets/use-schedules-D4W8fMwo.js +7 -0
- package/dist/web/public/assets/use-schedules-D4W8fMwo.js.map +1 -0
- package/dist/web/public/assets/use-settings-DGIjmUX0.js +2 -0
- package/dist/web/public/assets/use-settings-DGIjmUX0.js.map +1 -0
- package/dist/web/public/assets/use-skills-D2bMM580.js +7 -0
- package/dist/web/public/assets/use-skills-D2bMM580.js.map +1 -0
- package/dist/web/public/assets/use-vector-BYOFwjU0.js +2 -0
- package/dist/web/public/assets/use-vector-BYOFwjU0.js.map +1 -0
- package/dist/web/public/assets/use-workspace-CuytyHwb.js +2 -0
- package/dist/web/public/assets/{use-workspace-CConjEx0.js.map → use-workspace-CuytyHwb.js.map} +1 -1
- package/dist/web/public/assets/vector-CL8ezpSR.js +2 -0
- package/dist/web/public/assets/vector-CL8ezpSR.js.map +1 -0
- package/dist/web/public/assets/viewer-CD0iEfPU.js +7 -0
- package/dist/web/public/assets/viewer-CD0iEfPU.js.map +1 -0
- package/dist/web/public/assets/workspace-BA1_hso3.js +17 -0
- package/dist/web/public/assets/workspace-BA1_hso3.js.map +1 -0
- package/dist/web/public/assets/workspaces-DyGLJUgB.js +7 -0
- package/dist/web/public/assets/workspaces-DyGLJUgB.js.map +1 -0
- package/dist/web/public/index.html +2 -2
- package/dist/web/server.d.ts +0 -3
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +138 -3
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/assets/a2a-D7MoJ1iT.js +0 -7
- package/dist/web/public/assets/a2a-D7MoJ1iT.js.map +0 -1
- package/dist/web/public/assets/agents-BXThDW6f.js +0 -7
- package/dist/web/public/assets/bgjobs-Rc05aEy9.js +0 -7
- package/dist/web/public/assets/bgjobs-Rc05aEy9.js.map +0 -1
- package/dist/web/public/assets/chat-DQpQLW9j.js +0 -17
- package/dist/web/public/assets/chat-DQpQLW9j.js.map +0 -1
- package/dist/web/public/assets/circle-check-DZnkaUdk.js +0 -7
- package/dist/web/public/assets/circle-check-DZnkaUdk.js.map +0 -1
- package/dist/web/public/assets/confirm-dialog-gPKJnvEW.js +0 -2
- package/dist/web/public/assets/health-wqCp-K_o.js +0 -2
- package/dist/web/public/assets/hot-B-CMjQIr.js +0 -12
- package/dist/web/public/assets/index-DHh1LYlA.js +0 -209
- package/dist/web/public/assets/index-DHh1LYlA.js.map +0 -1
- package/dist/web/public/assets/index-DknVjPYB.css +0 -1
- package/dist/web/public/assets/installed-Cet-1M2Q.js.map +0 -1
- package/dist/web/public/assets/jobs-CfEzOOAC.js +0 -2
- package/dist/web/public/assets/jobs-CfEzOOAC.js.map +0 -1
- package/dist/web/public/assets/layout-BX43KyXM.js +0 -2
- package/dist/web/public/assets/layout-BX43KyXM.js.map +0 -1
- package/dist/web/public/assets/layout-BcYZlaqf.js +0 -2
- package/dist/web/public/assets/layout-BcYZlaqf.js.map +0 -1
- package/dist/web/public/assets/layout-Cb7looUv.js +0 -2
- package/dist/web/public/assets/layout-Cb7looUv.js.map +0 -1
- package/dist/web/public/assets/layout-D7xH78OU.js +0 -2
- package/dist/web/public/assets/layout-D7xH78OU.js.map +0 -1
- package/dist/web/public/assets/llm-BZ9qqp-D.js +0 -27
- package/dist/web/public/assets/llm-BZ9qqp-D.js.map +0 -1
- package/dist/web/public/assets/loader-circle-DgdBWYl0.js +0 -7
- package/dist/web/public/assets/memos-BBtqFcoH.js +0 -12
- package/dist/web/public/assets/memos-BBtqFcoH.js.map +0 -1
- package/dist/web/public/assets/messengers-i7WvNT3o.js +0 -2
- package/dist/web/public/assets/messengers-i7WvNT3o.js.map +0 -1
- package/dist/web/public/assets/outbox-BbfC5kuG.js +0 -7
- package/dist/web/public/assets/outbox-BbfC5kuG.js.map +0 -1
- package/dist/web/public/assets/persona-BvtcZh6G.js +0 -2
- package/dist/web/public/assets/plans-i3a6lrqF.js.map +0 -1
- package/dist/web/public/assets/policy-Cm88P8LO.js +0 -2
- package/dist/web/public/assets/schedules-DzwDWykc.js +0 -7
- package/dist/web/public/assets/schedules-DzwDWykc.js.map +0 -1
- package/dist/web/public/assets/security-BIcnUrAs.js +0 -2
- package/dist/web/public/assets/security-BIcnUrAs.js.map +0 -1
- package/dist/web/public/assets/service-CnorFHzZ.js +0 -7
- package/dist/web/public/assets/service-CnorFHzZ.js.map +0 -1
- package/dist/web/public/assets/use-background-tasks-D1--hHjp.js +0 -2
- package/dist/web/public/assets/use-memory-Bz1Zao7g.js +0 -2
- package/dist/web/public/assets/use-observability-DtqSWVjM.js +0 -2
- package/dist/web/public/assets/use-settings-DKbDqCEJ.js +0 -2
- package/dist/web/public/assets/use-settings-DKbDqCEJ.js.map +0 -1
- package/dist/web/public/assets/use-workspace-CConjEx0.js +0 -2
- package/dist/web/public/assets/vector-D8sEa2W-.js +0 -2
- package/dist/web/public/assets/vector-D8sEa2W-.js.map +0 -1
- package/dist/web/public/assets/viewer-aSIjAKVA.js +0 -12
- package/dist/web/public/assets/viewer-aSIjAKVA.js.map +0 -1
- package/dist/web/public/assets/workspace-BqwWoinI.js +0 -17
- package/dist/web/public/assets/workspace-BqwWoinI.js.map +0 -1
- package/dist/web/public/assets/workspaces-ChsJcrav.js +0 -7
- package/dist/web/public/assets/workspaces-ChsJcrav.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.5.1] - 2026-07-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added a first-run Web dashboard path with clear next actions for Web chat, Agim Agent API setup, and IM connection.
|
|
12
|
+
- Added `agim go`, `agim web`, service recovery hints, local doctor checks, and safer background-start diagnostics for new users.
|
|
13
|
+
- Added Web settings overviews for Start, Memory, Tasks, agim Skills, Workspace, Service recovery, Security posture, and Agim Agent API setup.
|
|
14
|
+
- Added native Agim Agent `/models` and `/model` support, including backend switching by name or list index.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Made Agim Agent API setup progressive: quick setup is shown first; multi-API management, role bindings, and runtime knobs now live behind Advanced settings.
|
|
19
|
+
- Simplified IM, workspace, memory, tasks, and settings navigation so advanced features remain available without overwhelming first-time users.
|
|
20
|
+
- Improved security settings visual hierarchy with explicit surfaces for status, controls, diagnostics, and warning items.
|
|
21
|
+
- Native/OpenAI-compatible model probes now omit `temperature` unless explicitly configured, avoiding providers that reject deprecated temperature parameters.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Fixed Web service log handling when the log file has not been created yet.
|
|
26
|
+
- Ensured workspace-created memory files are linked into the Agent workspace so Agim Agent can consume them.
|
|
27
|
+
- Fixed undefined Web theme utility classes that made some settings blocks visually blend into the page background.
|
|
28
|
+
|
|
7
29
|
## [1.5.0] - 2026-06-29
|
|
8
30
|
|
|
9
31
|
### Changed
|
package/README.md
CHANGED
|
@@ -15,18 +15,54 @@ It is designed for production use: persistent delivery, session continuity, huma
|
|
|
15
15
|
|
|
16
16
|
## Quick start
|
|
17
17
|
|
|
18
|
+
You do not need to configure IM, systemd, tokens, or workspaces first.
|
|
19
|
+
Start with the smallest loop: Web console + one working agent.
|
|
20
|
+
|
|
18
21
|
```bash
|
|
19
22
|
npm install -g agim-cli
|
|
20
|
-
agim
|
|
21
|
-
agim start
|
|
23
|
+
agim go
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
`agim go` will:
|
|
27
|
+
|
|
28
|
+
1. Detect usable local agents such as Claude Code, Codex, Cursor, or Agim Agent.
|
|
29
|
+
2. Help configure an Agim Agent model API if no agent is ready yet.
|
|
30
|
+
3. Start Agim in the background and print the Web console URL plus the first access token.
|
|
31
|
+
|
|
32
|
+
Default Web console: `http://localhost:3000`
|
|
25
33
|
|
|
26
34
|
- Chat: `/`
|
|
27
35
|
- Tasks: `/tasks`
|
|
28
36
|
- Settings: `/settings`
|
|
29
37
|
|
|
38
|
+
If you forget the URL or token path:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
agim web
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Local health check:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
agim doctor
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
After the Web chat works, connect WeChat / Feishu / DingTalk from Settings.
|
|
51
|
+
`agim quickstart` is kept as a compatibility alias.
|
|
52
|
+
|
|
53
|
+
Common CLI entries:
|
|
54
|
+
|
|
55
|
+
| Command | When to use |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `agim` | Open the guided entry menu when you are unsure what to run |
|
|
58
|
+
| `agim go` | First install: get one agent + Web working |
|
|
59
|
+
| `agim web` | Recover the console URL, service state, or token path |
|
|
60
|
+
| `agim web --open` | Open the Web console in your default browser |
|
|
61
|
+
| `agim web --start --open` | Start the background service and open Web in one step |
|
|
62
|
+
| `agim config` | Continue setup: Agent, IM, Web, admins |
|
|
63
|
+
| `agim doctor` | Explain what is not ready locally |
|
|
64
|
+
| `agim start --bg` / `status` / `restart` / `stop` | Service operations after setup |
|
|
65
|
+
|
|
30
66
|
## Choose your AI backend
|
|
31
67
|
|
|
32
68
|
| Scenario | Recommended path |
|
package/README.zh-CN.md
CHANGED
|
@@ -15,18 +15,53 @@ Agim 是一个 **IM 到 AI Agent 的桥接系统**。
|
|
|
15
15
|
|
|
16
16
|
## 快速开始
|
|
17
17
|
|
|
18
|
+
先不用配置 IM,也不用理解 systemd / token / 工作区。先把 Web 控制台跑起来,确认能和一个 Agent 对话:
|
|
19
|
+
|
|
18
20
|
```bash
|
|
19
21
|
npm install -g agim-cli
|
|
20
|
-
agim
|
|
21
|
-
agim start
|
|
22
|
+
agim go
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
`agim go` 会做三件事:
|
|
26
|
+
|
|
27
|
+
1. 检测本机可用的 Agent(Claude Code / Codex / Cursor / Agim Agent 等)。
|
|
28
|
+
2. 如果没有可用 Agent,引导你配置 Agim Agent 的大模型 API。
|
|
29
|
+
3. 后台启动 Agim,并打印 Web 控制台地址和首次访问 token。
|
|
30
|
+
|
|
31
|
+
默认 Web 控制台:`http://localhost:3000`
|
|
25
32
|
|
|
26
33
|
- 对话:`/`
|
|
27
34
|
- 任务:`/tasks`
|
|
28
35
|
- 设置:`/settings`
|
|
29
36
|
|
|
37
|
+
忘记入口或 token 时:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
agim web
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
本机体检:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
agim doctor
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
跑通 Web 对话后,再到设置里连接微信 / 飞书 / 钉钉等 IM 渠道。
|
|
50
|
+
`agim quickstart` 会作为兼容别名保留。
|
|
51
|
+
|
|
52
|
+
常用 CLI 入口:
|
|
53
|
+
|
|
54
|
+
| 命令 | 什么时候用 |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `agim` | 不确定该运行哪个命令时,打开引导入口菜单 |
|
|
57
|
+
| `agim go` | 第一次安装后,先跑通 Agent + Web |
|
|
58
|
+
| `agim web` | 忘记控制台地址、服务状态或 token 路径 |
|
|
59
|
+
| `agim web --open` | 用默认浏览器打开 Web 控制台 |
|
|
60
|
+
| `agim web --start --open` | 后台启动服务并一步打开 Web |
|
|
61
|
+
| `agim config` | 继续配置 Agent、IM、Web、管理员 |
|
|
62
|
+
| `agim doctor` | 不知道卡在哪里时做本机体检 |
|
|
63
|
+
| `agim start --bg` / `status` / `restart` / `stop` | 已配置后的服务运维 |
|
|
64
|
+
|
|
30
65
|
## 如何选择 Agent 后端
|
|
31
66
|
|
|
32
67
|
| 场景 | 推荐路径 |
|
|
@@ -112,11 +147,11 @@ native 配置详见:`docs/llm-backends.md`
|
|
|
112
147
|
|
|
113
148
|
## 迁移说明
|
|
114
149
|
|
|
115
|
-
|
|
150
|
+
当前公开入口统一使用 Agim 命名:
|
|
116
151
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
152
|
+
- 命令:`agim`
|
|
153
|
+
- 环境变量:`AGIM_*`
|
|
154
|
+
- 数据目录:`~/.agim` 与 `~/.agim-workspaces`
|
|
120
155
|
|
|
121
156
|
## 开发
|
|
122
157
|
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type Lang } from './i18n.js';
|
|
2
|
+
declare function browserOpenCommand(url: string, platform?: NodeJS.Platform): {
|
|
3
|
+
command: string;
|
|
4
|
+
args: string[];
|
|
5
|
+
} | null;
|
|
2
6
|
export declare function cmdStatus(): void;
|
|
7
|
+
export declare function cmdWeb(opts?: {
|
|
8
|
+
public?: boolean;
|
|
9
|
+
welcome?: boolean;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
start?: boolean;
|
|
12
|
+
openBrowser?: (url: string) => boolean;
|
|
13
|
+
}): Promise<number>;
|
|
3
14
|
/**
|
|
4
15
|
* Foreground start is implemented by `program.command('start').action(...)`
|
|
5
16
|
* in cli.ts; this handler delegates to it. For background, we re-spawn
|
|
@@ -9,5 +20,15 @@ export declare function cmdStart(bg: boolean, runForegroundStart: () => Promise<
|
|
|
9
20
|
export declare function cmdStop(): Promise<void>;
|
|
10
21
|
export declare function cmdRestart(): Promise<void>;
|
|
11
22
|
export declare function cmdUninstall(): Promise<void>;
|
|
12
|
-
export declare function offerServiceStart(lang: Lang
|
|
23
|
+
export declare function offerServiceStart(lang: Lang, opts?: {
|
|
24
|
+
welcome?: boolean;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
export declare function printWebAccessHint(lang: Lang, opts?: {
|
|
27
|
+
showUrl?: boolean;
|
|
28
|
+
welcome?: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
export declare const _internal: {
|
|
31
|
+
browserOpenCommand: typeof browserOpenCommand;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
13
34
|
//# sourceMappingURL=cmd-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd-handlers.d.ts","sourceRoot":"","sources":["../../src/cli-ui/cmd-handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cmd-handlers.d.ts","sourceRoot":"","sources":["../../src/cli-ui/cmd-handlers.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AAcvD,iBAAS,kBAAkB,CACzB,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAO5C;AAgJD,wBAAgB,SAAS,IAAI,IAAI,CAkChC;AAiFD,wBAAsB,MAAM,CAAC,IAAI,GAAE;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CAClC,GAAG,OAAO,CAAC,MAAM,CAAC,CA2EvB;AAID;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBlG;AAID,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB7C;AAID,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAgChD;AA8CD,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAqKlD;AAkBD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,IAAI,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,OAAO,CAAC,IAAI,CAAC,CA+Ff;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,IAAI,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAClD,OAAO,CAAC,IAAI,CAAC,CAgCf;AAMD,eAAO,MAAM,SAAS;;CAErB,CAAA"}
|
|
@@ -2,18 +2,124 @@
|
|
|
2
2
|
// commands. Each handler reads the persisted language preference, prints
|
|
3
3
|
// status / outcomes in that language, and shells out to systemctl / npm /
|
|
4
4
|
// rm where appropriate.
|
|
5
|
-
import {
|
|
5
|
+
import { execFileSync, execSync } from 'node:child_process';
|
|
6
6
|
import { unlinkSync, existsSync, readFileSync, rmSync } from 'node:fs';
|
|
7
7
|
import { dirname } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { homedir } from 'node:os';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
|
-
import { detectService, spawnBackground, stopService, formatUptime, readWebEndpoint, PID_FILE, LOG_FILE, } from './service.js';
|
|
11
|
+
import { detectService, spawnBackground, stopService, formatUptime, findTcpListenOwner, readAcpEndpoint, readWebEndpoint, DEFAULT_WEB_PORT, PID_FILE, LOG_FILE, } from './service.js';
|
|
12
12
|
import { menu, inputText, UserAbortError } from './prompts.js';
|
|
13
13
|
import { pickLang } from './lang-picker.js';
|
|
14
14
|
import { readSavedLang, t } from './i18n.js';
|
|
15
15
|
import { CONFIG_DIR, CONFIG_FILE, WORKSPACES_DIR } from './paths.js';
|
|
16
|
-
import { ENV_FILE, removeEnvFile } from './env-file.js';
|
|
16
|
+
import { ENV_FILE, readEnvFile, removeEnvFile } from './env-file.js';
|
|
17
|
+
function localWebUrl(web) {
|
|
18
|
+
const bind = web.bind === '0.0.0.0' ? '127.0.0.1' : web.bind;
|
|
19
|
+
return `http://${bind}:${web.port}`;
|
|
20
|
+
}
|
|
21
|
+
function webConsoleUrl(web, opts = {}) {
|
|
22
|
+
const base = localWebUrl(web);
|
|
23
|
+
return opts.welcome ? `${base}/?welcome=1` : base;
|
|
24
|
+
}
|
|
25
|
+
function browserOpenCommand(url, platform = process.platform) {
|
|
26
|
+
if (platform === 'darwin')
|
|
27
|
+
return { command: 'open', args: [url] };
|
|
28
|
+
if (platform === 'win32')
|
|
29
|
+
return { command: 'cmd', args: ['/c', 'start', '', url] };
|
|
30
|
+
if (platform === 'linux' || platform === 'freebsd' || platform === 'openbsd') {
|
|
31
|
+
return { command: 'xdg-open', args: [url] };
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function openBrowserUrl(url) {
|
|
36
|
+
const cmd = browserOpenCommand(url);
|
|
37
|
+
if (!cmd)
|
|
38
|
+
return false;
|
|
39
|
+
try {
|
|
40
|
+
execFileSync(cmd.command, cmd.args, { stdio: 'ignore' });
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function printBrowserOpenResult(lang, ok, url) {
|
|
48
|
+
console.log(ok
|
|
49
|
+
? text(lang, `浏览器:已打开 ${url}`, `Browser: opened ${url}`)
|
|
50
|
+
: text(lang, '浏览器:无法自动打开,请手动复制上面的地址。', 'Browser: could not open automatically; copy the URL above.'));
|
|
51
|
+
}
|
|
52
|
+
function printWebConsoleLine(lang, web, opts = {}) {
|
|
53
|
+
console.log(text(lang, ' Web 控制台:', ' Web console:') + webConsoleUrl(web, opts));
|
|
54
|
+
}
|
|
55
|
+
function text(lang, zh, en) {
|
|
56
|
+
return lang === 'zh' ? zh : en;
|
|
57
|
+
}
|
|
58
|
+
function describeRecentStartupFailure(lang) {
|
|
59
|
+
if (!existsSync(LOG_FILE))
|
|
60
|
+
return null;
|
|
61
|
+
try {
|
|
62
|
+
const raw = readFileSync(LOG_FILE, 'utf-8');
|
|
63
|
+
const tail = raw.split(/\r?\n/).slice(-160).join('\n');
|
|
64
|
+
const match = tail.match(/listen EADDRINUSE: address already in use\s+([^\s:]+):(\d+)/);
|
|
65
|
+
if (!match)
|
|
66
|
+
return null;
|
|
67
|
+
const bind = match[1];
|
|
68
|
+
const port = Number.parseInt(match[2], 10);
|
|
69
|
+
if (!Number.isFinite(port))
|
|
70
|
+
return null;
|
|
71
|
+
const web = readWebEndpoint() ?? { bind: '127.0.0.1', port: 3000 };
|
|
72
|
+
const acp = readAcpEndpoint();
|
|
73
|
+
const owner = findTcpListenOwner(port);
|
|
74
|
+
const ownerText = owner
|
|
75
|
+
? text(lang, `,当前占用进程:${owner}`, `, current owner: ${owner}`)
|
|
76
|
+
: '';
|
|
77
|
+
if (port === acp.port) {
|
|
78
|
+
return text(lang, `启动失败原因:ACP 端口 ${bind}:${port} 已被占用${ownerText}。\n` +
|
|
79
|
+
' ACP 不是首次 Web 对话必需;可以关闭占用程序,或在 ~/.agim/config.json 设置 "acpPort" 为其他端口后重试。', `Startup failed because ACP port ${bind}:${port} is already in use${ownerText}.\n` +
|
|
80
|
+
' ACP is not required for first Web chat; close the owner process, or set "acpPort" in ~/.agim/config.json and retry.');
|
|
81
|
+
}
|
|
82
|
+
if (port === web.port) {
|
|
83
|
+
return text(lang, `启动失败原因:Web 端口 ${bind}:${port} 已被占用${ownerText}。\n` +
|
|
84
|
+
' 请关闭占用程序,或运行 agim config 修改 Web 端口后重试。', `Startup failed because Web port ${bind}:${port} is already in use${ownerText}.\n` +
|
|
85
|
+
' Close the owner process, or run agim config to change the Web port and retry.');
|
|
86
|
+
}
|
|
87
|
+
return text(lang, `启动失败原因:本地端口 ${bind}:${port} 已被占用${ownerText}。`, `Startup failed because local port ${bind}:${port} is already in use${ownerText}.`);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function printStartupCheckLog(lang) {
|
|
94
|
+
const diagnosis = describeRecentStartupFailure(lang);
|
|
95
|
+
if (diagnosis)
|
|
96
|
+
console.log(diagnosis);
|
|
97
|
+
console.log(t(lang, 'svc.offer.bg_check_log'));
|
|
98
|
+
if (existsSync(LOG_FILE)) {
|
|
99
|
+
console.log(` tail -n 40 ${LOG_FILE}`);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
console.log(text(lang, ` 日志文件尚未生成;首次后台启动成功后会创建:${LOG_FILE}`, ` Log file has not been created yet; it appears after the first successful background start: ${LOG_FILE}`));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function startBackgroundDaemon(lang, opts = {}) {
|
|
106
|
+
console.log(t(lang, 'svc.start.starting_bg'));
|
|
107
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
108
|
+
const cliJs = join(__dirname, '..', 'cli.js');
|
|
109
|
+
const { pid } = spawnBackground(process.execPath, [cliJs, 'start']);
|
|
110
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
111
|
+
const after = detectService();
|
|
112
|
+
if (after.mode === 'background' && after.pid === pid) {
|
|
113
|
+
console.log(t(lang, 'svc.start.bg_ready', { pid, log: LOG_FILE }));
|
|
114
|
+
if (opts.showAccessHint !== false) {
|
|
115
|
+
console.log(t(lang, 'svc.start.bg_hint'));
|
|
116
|
+
await printWebAccessHint(lang, { welcome: opts.welcome });
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
printStartupCheckLog(lang);
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
17
123
|
/** Candidate paths for the systemd unit. Resolved at runtime by
|
|
18
124
|
* `findSystemdUnit()` so we operate on the unit only when it exists. */
|
|
19
125
|
const SYSTEMD_UNIT_CANDIDATES = [
|
|
@@ -45,6 +151,8 @@ export function cmdStatus() {
|
|
|
45
151
|
console.log(t(lang, 'svc.status.title'));
|
|
46
152
|
console.log('─'.repeat(50));
|
|
47
153
|
const st = detectService();
|
|
154
|
+
const web = readWebEndpoint() ?? { bind: '127.0.0.1', port: DEFAULT_WEB_PORT };
|
|
155
|
+
const webBind = web.bind === '0.0.0.0' ? '127.0.0.1' : web.bind;
|
|
48
156
|
switch (st.mode) {
|
|
49
157
|
case 'systemd':
|
|
50
158
|
console.log(' ' + t(lang, 'svc.status.systemd_active', { pid: st.pid ?? '?' }));
|
|
@@ -60,16 +168,151 @@ export function cmdStatus() {
|
|
|
60
168
|
if (systemdUnitPath()) {
|
|
61
169
|
console.log(' ' + t(lang, 'svc.status.systemd_inactive'));
|
|
62
170
|
}
|
|
171
|
+
console.log(' ' + t(lang, 'svc.status.web', { bind: webBind, port: web.port }));
|
|
172
|
+
console.log(' ' + t(lang, 'svc.status.next_not_running'));
|
|
173
|
+
console.log();
|
|
63
174
|
return;
|
|
64
175
|
}
|
|
65
176
|
if (typeof st.uptimeSec === 'number') {
|
|
66
177
|
console.log(' ' + t(lang, 'svc.status.uptime', { duration: formatUptime(st.uptimeSec) }));
|
|
67
178
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
179
|
+
console.log(' ' + t(lang, 'svc.status.web', { bind: webBind, port: web.port }));
|
|
180
|
+
console.log(' ' + t(lang, 'svc.status.next_running'));
|
|
181
|
+
console.log();
|
|
182
|
+
}
|
|
183
|
+
function loadWebRelatedEnv() {
|
|
184
|
+
try {
|
|
185
|
+
const f = readEnvFile();
|
|
186
|
+
for (const k of [
|
|
187
|
+
'AGIM_WEB_BIND',
|
|
188
|
+
'AGIM_WEB_AUTH',
|
|
189
|
+
'AGIM_TRUST_LOOPBACK',
|
|
190
|
+
'AGIM_VIEWER_PUBLIC_BASE_URL',
|
|
191
|
+
'AGIM_VIEWER_TUNNEL_MODE',
|
|
192
|
+
'AGIM_VIEWER_ENABLED',
|
|
193
|
+
]) {
|
|
194
|
+
if (f[k] && !process.env[k])
|
|
195
|
+
process.env[k] = f[k];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch { /* ignore */ }
|
|
199
|
+
}
|
|
200
|
+
function isEnvOff(name) {
|
|
201
|
+
const v = (process.env[name] || '').trim().toLowerCase();
|
|
202
|
+
return v === 'off' || v === '0' || v === 'false' || v === 'no';
|
|
203
|
+
}
|
|
204
|
+
function describeServiceState(lang) {
|
|
205
|
+
const st = detectService();
|
|
206
|
+
switch (st.mode) {
|
|
207
|
+
case 'systemd':
|
|
208
|
+
return st.pid
|
|
209
|
+
? text(lang, `运行中:systemd,pid ${st.pid}`, `running: systemd, pid ${st.pid}`)
|
|
210
|
+
: text(lang, `systemd 已接管,状态:${st.active ?? 'unknown'}`, `managed by systemd, state: ${st.active ?? 'unknown'}`);
|
|
211
|
+
case 'background':
|
|
212
|
+
return text(lang, `运行中:后台进程,pid ${st.pid ?? '?'}`, `running: background daemon, pid ${st.pid ?? '?'}`);
|
|
213
|
+
case 'foreground':
|
|
214
|
+
return text(lang, `运行中:前台进程,pid ${st.pid ?? '?'}`, `running: foreground process, pid ${st.pid ?? '?'}`);
|
|
215
|
+
case 'none':
|
|
216
|
+
return text(lang, '未运行', 'not running');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async function getPublicWebInfo() {
|
|
220
|
+
const { getEffectivePublicBaseUrl, getViewerConfig } = await import('../core/viewer-config.js');
|
|
221
|
+
const cfg = getViewerConfig();
|
|
222
|
+
const url = getEffectivePublicBaseUrl();
|
|
223
|
+
if (!url)
|
|
224
|
+
return null;
|
|
225
|
+
return {
|
|
226
|
+
url,
|
|
227
|
+
source: cfg.publicBaseUrl ? 'AGIM_VIEWER_PUBLIC_BASE_URL' : 'cloudflared tunnel',
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
async function printWebCredentialHint(lang) {
|
|
231
|
+
try {
|
|
232
|
+
const { getWebBootstrapTokenFile, hasAnyToken, isAuthEnabled, } = await import('../core/access-token.js');
|
|
233
|
+
if (!isAuthEnabled()) {
|
|
234
|
+
console.log(text(lang, '登录:Web 鉴权已关闭(AGIM_WEB_AUTH=off)。', 'Login: Web auth is disabled (AGIM_WEB_AUTH=off).'));
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const trustLoopback = !isEnvOff('AGIM_TRUST_LOOPBACK');
|
|
238
|
+
console.log(trustLoopback
|
|
239
|
+
? text(lang, '登录:本机浏览器直连通常无需 token;远程/反代访问需要 Web token。', 'Login: local browser access usually needs no token; remote/proxied access needs a Web token.')
|
|
240
|
+
: text(lang, '登录:本机 loopback 免登录已关闭,也需要 Web token。', 'Login: loopback trust is disabled; local access also needs a Web token.'));
|
|
241
|
+
const bootstrapFile = getWebBootstrapTokenFile();
|
|
242
|
+
if (existsSync(bootstrapFile)) {
|
|
243
|
+
console.log(text(lang, '首次 token:运行 `agim token bootstrap` 读取一次性 token。', 'First token: run `agim token bootstrap` to read the one-time token.'));
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (hasAnyToken()) {
|
|
247
|
+
console.log(text(lang, '忘记 token:运行 `agim token create <label>` 生成一个新的。', 'Forgot the token: run `agim token create <label>` to create a new one.'));
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
console.log(text(lang, '尚无 token:首次启动会生成;也可以运行 `agim token create <label>`。', 'No token yet: first startup will generate one; or run `agim token create <label>`.'));
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
console.log(text(lang, 'Token 帮助:agim token bootstrap 或 agim token create <label>', 'Token help: agim token bootstrap or agim token create <label>'));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
export async function cmdWeb(opts = {}) {
|
|
257
|
+
const lang = quietLang();
|
|
258
|
+
loadWebRelatedEnv();
|
|
259
|
+
const publicInfo = await getPublicWebInfo();
|
|
260
|
+
const openBrowser = opts.openBrowser ?? openBrowserUrl;
|
|
261
|
+
if (opts.public) {
|
|
262
|
+
if (publicInfo) {
|
|
263
|
+
console.log(publicInfo.url);
|
|
264
|
+
console.log(text(lang, `(来源:${publicInfo.source})`, `(source: ${publicInfo.source})`));
|
|
265
|
+
if (opts.open)
|
|
266
|
+
printBrowserOpenResult(lang, openBrowser(publicInfo.url), publicInfo.url);
|
|
267
|
+
return 0;
|
|
268
|
+
}
|
|
269
|
+
const tunnelMode = (process.env.AGIM_VIEWER_TUNNEL_MODE || '').toLowerCase();
|
|
270
|
+
if (tunnelMode === 'quick') {
|
|
271
|
+
console.log(text(lang, '公网地址由 cloudflared 临时隧道提供,但当前 CLI 进程查不到运行中隧道 URL。', 'The public URL comes from a cloudflared quick tunnel, but this CLI process cannot see the running tunnel URL.'));
|
|
272
|
+
console.log(text(lang, '请在 IM 内发送 /web,或先确认 Agim daemon 正在运行。', 'Send /web in IM, or confirm the Agim daemon is running.'));
|
|
273
|
+
return 2;
|
|
274
|
+
}
|
|
275
|
+
console.log(text(lang, '公网地址未配置。需要反代域名时设置 AGIM_VIEWER_PUBLIC_BASE_URL。', 'No public URL configured. Set AGIM_VIEWER_PUBLIC_BASE_URL when using a reverse-proxy domain.'));
|
|
276
|
+
return 2;
|
|
71
277
|
}
|
|
278
|
+
const endpoint = readWebEndpoint() ?? {
|
|
279
|
+
bind: (process.env.AGIM_WEB_BIND || '127.0.0.1').trim() || '127.0.0.1',
|
|
280
|
+
port: DEFAULT_WEB_PORT,
|
|
281
|
+
};
|
|
282
|
+
const before = detectService();
|
|
283
|
+
if (before.mode === 'none' && opts.start) {
|
|
284
|
+
await startBackgroundDaemon(lang, { showAccessHint: false, welcome: opts.welcome });
|
|
285
|
+
}
|
|
286
|
+
const service = detectService();
|
|
287
|
+
const url = webConsoleUrl(endpoint, { welcome: opts.welcome });
|
|
72
288
|
console.log();
|
|
289
|
+
console.log(text(lang, 'Agim Web 控制台', 'Agim Web console'));
|
|
290
|
+
console.log('='.repeat(34));
|
|
291
|
+
console.log(text(lang, '服务:', 'Service:') + describeServiceState(lang));
|
|
292
|
+
console.log(text(lang, '本机地址:', 'Local URL:') + url);
|
|
293
|
+
if (publicInfo) {
|
|
294
|
+
console.log(text(lang, '远程地址:', 'Remote URL:') + `${publicInfo.url} (${publicInfo.source})`);
|
|
295
|
+
}
|
|
296
|
+
if (service.mode === 'none') {
|
|
297
|
+
console.log(text(lang, '启动:首次体验用 `agim go`;已配置好则用 `agim start --bg`。', 'Start: use `agim go` for first run; use `agim start --bg` after setup.'));
|
|
298
|
+
console.log(text(lang, '一键启动并打开:agim web --start --open', 'Start and open in one step: agim web --start --open'));
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
console.log(text(lang, '下一步:打开上面的地址发送第一条消息。', 'Next: open the URL above and send the first message.'));
|
|
302
|
+
if (!opts.open) {
|
|
303
|
+
console.log(text(lang, '打开浏览器:agim web --open', 'Open in browser: agim web --open'));
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
await printWebCredentialHint(lang);
|
|
307
|
+
if (opts.open) {
|
|
308
|
+
if (service.mode === 'none') {
|
|
309
|
+
console.log(text(lang, '浏览器:服务未运行,未打开;可运行 `agim web --start --open`。', 'Browser: service is not running; run `agim web --start --open`.'));
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
printBrowserOpenResult(lang, openBrowser(url), url);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return 0;
|
|
73
316
|
}
|
|
74
317
|
// ─── start ───────────────────────────────────────────────────────────
|
|
75
318
|
/**
|
|
@@ -89,24 +332,7 @@ export async function cmdStart(bg, runForegroundStart) {
|
|
|
89
332
|
return;
|
|
90
333
|
}
|
|
91
334
|
if (bg) {
|
|
92
|
-
|
|
93
|
-
// Re-exec self detached. Use the same node + cli.js paths so global vs
|
|
94
|
-
// local install both work.
|
|
95
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
96
|
-
const cliJs = join(__dirname, '..', 'cli.js');
|
|
97
|
-
const { pid } = spawnBackground(process.execPath, [cliJs, 'start']);
|
|
98
|
-
// Tiny wait so the child has a chance to either bind ports or crash;
|
|
99
|
-
// status check picks up the latter.
|
|
100
|
-
await new Promise(r => setTimeout(r, 1500));
|
|
101
|
-
const after = detectService();
|
|
102
|
-
if (after.mode === 'background' && after.pid === pid) {
|
|
103
|
-
console.log(t(lang, 'svc.start.bg_ready', { pid, log: LOG_FILE }));
|
|
104
|
-
console.log(t(lang, 'svc.start.bg_hint'));
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
console.log('⚠️ Background daemon may have failed to bind ports — check log:');
|
|
108
|
-
console.log(` tail -n 40 ${LOG_FILE}`);
|
|
109
|
-
}
|
|
335
|
+
await startBackgroundDaemon(lang);
|
|
110
336
|
return;
|
|
111
337
|
}
|
|
112
338
|
console.log(t(lang, 'svc.start.starting_fg'));
|
|
@@ -144,6 +370,7 @@ export async function cmdRestart() {
|
|
|
144
370
|
if (unit)
|
|
145
371
|
execSync(`systemctl restart ${unit.name}`, { stdio: 'inherit' });
|
|
146
372
|
console.log(t(lang, 'svc.restart.done'));
|
|
373
|
+
await printWebAccessHint(lang);
|
|
147
374
|
return;
|
|
148
375
|
}
|
|
149
376
|
if (st.mode === 'foreground') {
|
|
@@ -159,8 +386,15 @@ export async function cmdRestart() {
|
|
|
159
386
|
const cliJs = join(__dirname, '..', 'cli.js');
|
|
160
387
|
const { pid } = spawnBackground(process.execPath, [cliJs, 'start']);
|
|
161
388
|
await new Promise(r => setTimeout(r, 1500));
|
|
162
|
-
|
|
163
|
-
|
|
389
|
+
const after = detectService();
|
|
390
|
+
if (after.mode === 'background' && after.pid === pid) {
|
|
391
|
+
console.log(t(lang, 'svc.start.bg_ready', { pid, log: LOG_FILE }));
|
|
392
|
+
console.log(t(lang, 'svc.restart.done'));
|
|
393
|
+
await printWebAccessHint(lang);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
printStartupCheckLog(lang);
|
|
397
|
+
}
|
|
164
398
|
}
|
|
165
399
|
}
|
|
166
400
|
/** The credential files that mode='creds' and mode='full' both wipe. */
|
|
@@ -399,7 +633,7 @@ export async function cmdUninstall() {
|
|
|
399
633
|
//
|
|
400
634
|
// Stays quiet on Ctrl-C (UserAbortError) so an exit doesn't dump a
|
|
401
635
|
// stack on top of a successful wizard run.
|
|
402
|
-
export async function offerServiceStart(lang) {
|
|
636
|
+
export async function offerServiceStart(lang, opts = {}) {
|
|
403
637
|
const { yesNo, UserAbortError } = await import('./prompts.js');
|
|
404
638
|
const st = detectService();
|
|
405
639
|
try {
|
|
@@ -424,16 +658,12 @@ export async function offerServiceStart(lang) {
|
|
|
424
658
|
console.log(t(lang, 'svc.offer.bg_started', { pid, log: LOG_FILE }));
|
|
425
659
|
const web = readWebEndpoint();
|
|
426
660
|
if (web) {
|
|
427
|
-
|
|
428
|
-
// open in a browser on this machine). 0.0.0.0 is a server-side
|
|
429
|
-
// listen address that no browser actually connects to as-is.
|
|
430
|
-
const bind = web.bind === '0.0.0.0' ? '127.0.0.1' : web.bind;
|
|
431
|
-
console.log(t(lang, 'svc.offer.bg_url', { bind, port: web.port }));
|
|
661
|
+
printWebConsoleLine(lang, web, { welcome: opts.welcome });
|
|
432
662
|
}
|
|
663
|
+
await printWebAccessHint(lang, { showUrl: false, welcome: opts.welcome });
|
|
433
664
|
}
|
|
434
665
|
else {
|
|
435
|
-
|
|
436
|
-
console.log(` tail -n 40 ${LOG_FILE}`);
|
|
666
|
+
printStartupCheckLog(lang);
|
|
437
667
|
}
|
|
438
668
|
return;
|
|
439
669
|
}
|
|
@@ -441,6 +671,7 @@ export async function offerServiceStart(lang) {
|
|
|
441
671
|
console.log();
|
|
442
672
|
console.log(t(lang, 'svc.offer.running_title', { mode: 'foreground', pid: st.pid ?? '?' }));
|
|
443
673
|
console.log(t(lang, 'svc.offer.foreground_hint'));
|
|
674
|
+
await printWebAccessHint(lang, { welcome: opts.welcome });
|
|
444
675
|
return;
|
|
445
676
|
}
|
|
446
677
|
// background OR systemd — same UX: ask whether to restart so the
|
|
@@ -453,6 +684,7 @@ export async function offerServiceStart(lang) {
|
|
|
453
684
|
});
|
|
454
685
|
if (!wantRestart) {
|
|
455
686
|
console.log(t(lang, 'svc.offer.restart_skipped'));
|
|
687
|
+
await printWebAccessHint(lang, { welcome: opts.welcome });
|
|
456
688
|
return;
|
|
457
689
|
}
|
|
458
690
|
if (st.mode === 'systemd') {
|
|
@@ -461,6 +693,7 @@ export async function offerServiceStart(lang) {
|
|
|
461
693
|
try {
|
|
462
694
|
execSync(`systemctl restart ${unit.name}`, { stdio: 'inherit' });
|
|
463
695
|
console.log(t(lang, 'svc.offer.systemd_restarted'));
|
|
696
|
+
await printWebAccessHint(lang, { welcome: opts.welcome });
|
|
464
697
|
}
|
|
465
698
|
catch (err) {
|
|
466
699
|
console.warn(`⚠️ ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -480,13 +713,12 @@ export async function offerServiceStart(lang) {
|
|
|
480
713
|
console.log(t(lang, 'svc.offer.bg_started', { pid, log: LOG_FILE }));
|
|
481
714
|
const web = readWebEndpoint();
|
|
482
715
|
if (web) {
|
|
483
|
-
|
|
484
|
-
console.log(t(lang, 'svc.offer.bg_url', { bind, port: web.port }));
|
|
716
|
+
printWebConsoleLine(lang, web, { welcome: opts.welcome });
|
|
485
717
|
}
|
|
718
|
+
await printWebAccessHint(lang, { showUrl: false, welcome: opts.welcome });
|
|
486
719
|
}
|
|
487
720
|
else {
|
|
488
|
-
|
|
489
|
-
console.log(` tail -n 40 ${LOG_FILE}`);
|
|
721
|
+
printStartupCheckLog(lang);
|
|
490
722
|
}
|
|
491
723
|
}
|
|
492
724
|
catch (err) {
|
|
@@ -497,9 +729,41 @@ export async function offerServiceStart(lang) {
|
|
|
497
729
|
throw err;
|
|
498
730
|
}
|
|
499
731
|
}
|
|
500
|
-
|
|
501
|
-
|
|
732
|
+
export async function printWebAccessHint(lang, opts = {}) {
|
|
733
|
+
const web = readWebEndpoint() ?? { bind: '127.0.0.1', port: 3000 };
|
|
734
|
+
const baseUrl = localWebUrl(web);
|
|
735
|
+
console.log();
|
|
736
|
+
if (opts.showUrl !== false) {
|
|
737
|
+
console.log(text(lang, 'Web 控制台:', 'Web console:') + webConsoleUrl(web, { welcome: opts.welcome }));
|
|
738
|
+
}
|
|
739
|
+
try {
|
|
740
|
+
const { isAuthEnabled, retrieveWebBootstrapTokenRaw, hasAnyToken, } = await import('../core/access-token.js');
|
|
741
|
+
if (!isAuthEnabled()) {
|
|
742
|
+
console.log(text(lang, 'Web 鉴权已关闭(AGIM_WEB_AUTH=off)。', 'Web auth is disabled (AGIM_WEB_AUTH=off).'));
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
const row = retrieveWebBootstrapTokenRaw();
|
|
746
|
+
if (row) {
|
|
747
|
+
console.log(text(lang, '首次访问 token(仅显示这一次):', 'First access token (shown once):'));
|
|
748
|
+
console.log(` ${row.raw}`);
|
|
749
|
+
console.log(`${text(lang, '登录页:', 'Login page:')}${baseUrl}/login`);
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (hasAnyToken()) {
|
|
753
|
+
console.log(text(lang, '已有 Web token;如需新 token:agim token create <label>', 'A Web token already exists; create another with: agim token create <label>'));
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
console.log(text(lang, '首次启动后会生成 Web token;如未看到,请运行:agim token bootstrap', 'First startup creates a Web token; if you did not see it, run: agim token bootstrap'));
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
catch {
|
|
760
|
+
console.log(text(lang, '如需 Web token:agim token bootstrap 或 agim token create <label>', 'For a Web token: agim token bootstrap or agim token create <label>'));
|
|
761
|
+
}
|
|
762
|
+
}
|
|
502
763
|
void readFileSync;
|
|
503
764
|
void homedir;
|
|
504
765
|
void ENV_FILE;
|
|
766
|
+
export const _internal = {
|
|
767
|
+
browserOpenCommand,
|
|
768
|
+
};
|
|
505
769
|
//# sourceMappingURL=cmd-handlers.js.map
|