@agent-spaces/server 0.3.64 → 0.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/agent-runtime.js +4 -0
- package/dist/adapters/claude-code-runtime/index.js +68 -2
- package/dist/adapters/claude-code-runtime/message-format.js +26 -0
- package/dist/adapters/claude-code-runtime/sdk-config.js +12 -0
- package/dist/adapters/codex-function-tool-bridge.js +144 -0
- package/dist/adapters/codex-runtime.js +23 -4
- package/dist/adapters/git.js +25 -7
- package/dist/adapters/hermes-runtime.js +210 -0
- package/dist/agents/agent-message-parts.js +1 -1
- package/dist/agents/commit-agent.js +4 -2
- package/dist/agents/issue-task-controller.js +75 -4
- package/dist/agents/pull-request-agent.js +115 -0
- package/dist/agents/scheduler-agent.js +1 -1
- package/dist/app.js +12 -70
- package/dist/middleware/auth.js +1 -1
- package/dist/package.json +2 -1
- package/dist/routes/agent-sse.js +2 -0
- package/dist/routes/agent.js +3 -0
- package/dist/routes/database.js +1 -0
- package/dist/routes/git.js +197 -317
- package/dist/routes/issue.js +1 -1
- package/dist/routes/notification.js +10 -0
- package/dist/routes/robot-account.js +68 -0
- package/dist/routes/version.js +94 -0
- package/dist/routes/worktree.js +93 -0
- package/dist/services/agent.js +37 -3
- package/dist/services/builtin-tools/kanban-tools.js +4 -0
- package/dist/services/git-operation-log.js +40 -0
- package/dist/services/global-wechat-qr.js +72 -0
- package/dist/services/hook-engine.js +175 -17
- package/dist/services/notification-center.js +9 -0
- package/dist/services/notification-hub/bot-agent.js +3 -1
- package/dist/services/notification-hub/service.js +12 -2
- package/dist/services/robot-account.js +34 -0
- package/dist/services/version.js +59 -0
- package/dist/services/workflow-command-runner.js +23 -0
- package/dist/services/workflow.js +25 -8
- package/dist/services/workspace.js +25 -1
- package/dist/services/worktree.js +207 -0
- package/dist/storage/robot-account-store.js +39 -0
- package/dist/storage/worktree-store.js +33 -0
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +23 -25
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +13 -13
- package/dist/web/__next._tree.txt +2 -2
- package/dist/web/_next/static/chunks/{0n6_4so_afuwk.js → 0-92u-tiuy40a.js} +4 -4
- package/dist/web/_next/static/chunks/{0vbqaynjq8ga..js → 0-yizd8osmas2.js} +1 -1
- package/dist/web/_next/static/chunks/0.ln~3mnv8.69.js +1 -0
- package/dist/web/_next/static/chunks/{0iuf30t0rjsjv.js → 01y3e9pemva7b.js} +10 -10
- package/dist/web/_next/static/chunks/02802taez976w.js +67 -0
- package/dist/web/_next/static/chunks/02l~tmzrgny.~.js +1 -0
- package/dist/web/_next/static/chunks/033.awk90g6eh.js +1 -0
- package/dist/web/_next/static/chunks/03f1bwuynjdmk.js +1 -0
- package/dist/web/_next/static/chunks/04cb4kc9r2pd1.js +1 -0
- package/dist/web/_next/static/chunks/04de6ha5_e3pp.js +1 -0
- package/dist/web/_next/static/chunks/06.kdsa9rr2h1.js +1 -0
- package/dist/web/_next/static/chunks/09he0p79ov1rn.js +1 -0
- package/dist/web/_next/static/chunks/09vpocs4zuc8h.js +1 -0
- package/dist/web/_next/static/chunks/0_o2exgr0e_nh.js +1 -0
- package/dist/web/_next/static/chunks/{0xbaakj0dfc0..js → 0_y9nskc-xt2k.js} +1 -1
- package/dist/web/_next/static/chunks/0clnj-1fi6u8j.js +3 -0
- package/dist/web/_next/static/chunks/0gv40by0zzxs_.js +1 -0
- package/dist/web/_next/static/chunks/0iusr8y88.kjg.js +1 -0
- package/dist/web/_next/static/chunks/{04a4vsq2wknm4.js → 0j-8418fxvkd1.js} +1 -1
- package/dist/web/_next/static/chunks/0j-l7l_k9jt45.js +1 -0
- package/dist/web/_next/static/chunks/0j.wxxyoclma5.js +1 -0
- package/dist/web/_next/static/chunks/0jq.16sozqik..js +3 -0
- package/dist/web/_next/static/chunks/0jw8xdk_fpnp0.css +1 -0
- package/dist/web/_next/static/chunks/0l1lkd-wcotma.js +1 -0
- package/dist/web/_next/static/chunks/0ncxf_zr4n839.js +1 -0
- package/dist/web/_next/static/chunks/0ndo7um~v7vco.js +1 -0
- package/dist/web/_next/static/chunks/0ngk.~kan8wq_.js +1 -0
- package/dist/web/_next/static/chunks/0p3h-h3zj5ujg.js +30 -0
- package/dist/web/_next/static/chunks/0pm-un~-sy3rl.js +1 -0
- package/dist/web/_next/static/chunks/0rt9bofnn6qvn.js +1 -0
- package/dist/web/_next/static/chunks/0t64.9jd00hio.js +3 -0
- package/dist/web/_next/static/chunks/0taui9--5n6-5.js +1 -0
- package/dist/web/_next/static/chunks/0ty39169lh~z3.js +1 -0
- package/dist/web/_next/static/chunks/0uxzi~9b~k4mn.js +31 -0
- package/dist/web/_next/static/chunks/0v8nof~waedlu.js +1 -0
- package/dist/web/_next/static/chunks/{0ctg5qmw7uu.1.js → 0vcfoagnpf.aw.js} +3 -3
- package/dist/web/_next/static/chunks/{08ckpwmmwlors.js → 0wwwq.gyyz0vg.js} +3 -3
- package/dist/web/_next/static/chunks/0x5lak8yz7pm7.js +1 -0
- package/dist/web/_next/static/chunks/0xon_.4-o0_zq.js +7 -0
- package/dist/web/_next/static/chunks/0zjnrbt7inime.js +1 -0
- package/dist/web/_next/static/chunks/0zncg76rgtbm-.js +1 -0
- package/dist/web/_next/static/chunks/0zwebpitvpuv1.js +1 -0
- package/dist/web/_next/static/chunks/0~02o4g-o6n~m.js +1 -0
- package/dist/web/_next/static/chunks/{10l-9myrdo3x9.js → 0~fjezp.k4qk3.js} +1 -1
- package/dist/web/_next/static/chunks/0~sh93re1-_rp.js +1 -0
- package/dist/web/_next/static/chunks/10_niiq0k6o-p.js +5 -0
- package/dist/web/_next/static/chunks/12tjr0_2ccrtq.js +2 -0
- package/dist/web/_next/static/chunks/12x5.go_x9mfk.js +1 -0
- package/dist/web/_next/static/chunks/{1442stwa0gbxe.js → 12~5dk9i9d16t.js} +2 -2
- package/dist/web/_next/static/chunks/13iye4rv5p31b.js +1 -0
- package/dist/web/_next/static/chunks/{01~quun6sefgl.js → 13~y-b.b9rrw4.js} +1 -1
- package/dist/web/_next/static/chunks/151wzhb5q0lo5.js +1 -0
- package/dist/web/_next/static/chunks/18c7g84y01mj0.js +1 -0
- package/dist/web/_next/static/chunks/{turbopack-0ndm2zc_pdptk.js → turbopack-11qjwlynmfc-n.js} +1 -1
- package/dist/web/_not-found/__next._full.txt +30 -29
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +13 -13
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +2 -2
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +30 -29
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +23 -25
- package/dist/web/login/__next._full.txt +28 -28
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +13 -13
- package/dist/web/login/__next._tree.txt +2 -2
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +28 -28
- package/dist/web/settings/__next._full.txt +33 -32
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +13 -13
- package/dist/web/settings/__next._tree.txt +2 -2
- package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
- package/dist/web/settings/__next.settings.txt +5 -5
- package/dist/web/settings/agents/__next._full.txt +24 -24
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +13 -13
- package/dist/web/settings/agents/__next._tree.txt +2 -2
- package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
- package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
- package/dist/web/settings/agents/__next.settings.txt +5 -5
- package/dist/web/settings/agents.html +1 -1
- package/dist/web/settings/agents.txt +24 -24
- package/dist/web/settings/mcps/__next._full.txt +24 -24
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +13 -13
- package/dist/web/settings/mcps/__next._tree.txt +2 -2
- package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
- package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
- package/dist/web/settings/mcps/__next.settings.txt +5 -5
- package/dist/web/settings/mcps.html +1 -1
- package/dist/web/settings/mcps.txt +24 -24
- package/dist/web/settings/models/__next._full.txt +24 -24
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +13 -13
- package/dist/web/settings/models/__next._tree.txt +2 -2
- package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
- package/dist/web/settings/models/__next.settings.models.txt +3 -3
- package/dist/web/settings/models/__next.settings.txt +5 -5
- package/dist/web/settings/models.html +1 -1
- package/dist/web/settings/models.txt +24 -24
- package/dist/web/settings/output-styles/__next._full.txt +24 -24
- package/dist/web/settings/output-styles/__next._head.txt +4 -4
- package/dist/web/settings/output-styles/__next._index.txt +13 -13
- package/dist/web/settings/output-styles/__next._tree.txt +2 -2
- package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +4 -4
- package/dist/web/settings/output-styles/__next.settings.output-styles.txt +3 -3
- package/dist/web/settings/output-styles/__next.settings.txt +5 -5
- package/dist/web/settings/output-styles.html +1 -1
- package/dist/web/settings/output-styles.txt +24 -24
- package/dist/web/settings/prompts/__next._full.txt +24 -24
- package/dist/web/settings/prompts/__next._head.txt +4 -4
- package/dist/web/settings/prompts/__next._index.txt +13 -13
- package/dist/web/settings/prompts/__next._tree.txt +2 -2
- package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
- package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
- package/dist/web/settings/prompts/__next.settings.txt +5 -5
- package/dist/web/settings/prompts.html +1 -1
- package/dist/web/settings/prompts.txt +24 -24
- package/dist/web/settings/providers/__next._full.txt +24 -24
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +13 -13
- package/dist/web/settings/providers/__next._tree.txt +2 -2
- package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
- package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
- package/dist/web/settings/providers/__next.settings.txt +5 -5
- package/dist/web/settings/providers.html +1 -1
- package/dist/web/settings/providers.txt +24 -24
- package/dist/web/settings/skills/__next._full.txt +24 -24
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +13 -13
- package/dist/web/settings/skills/__next._tree.txt +2 -2
- package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
- package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
- package/dist/web/settings/skills/__next.settings.txt +5 -5
- package/dist/web/settings/skills.html +1 -1
- package/dist/web/settings/skills.txt +24 -24
- package/dist/web/settings/tools/__next._full.txt +24 -24
- package/dist/web/settings/tools/__next._head.txt +4 -4
- package/dist/web/settings/tools/__next._index.txt +13 -13
- package/dist/web/settings/tools/__next._tree.txt +2 -2
- package/dist/web/settings/tools/__next.settings.tools.__PAGE__.txt +4 -4
- package/dist/web/settings/tools/__next.settings.tools.txt +3 -3
- package/dist/web/settings/tools/__next.settings.txt +5 -5
- package/dist/web/settings/tools.html +1 -1
- package/dist/web/settings/tools.txt +24 -24
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +33 -32
- package/dist/web/workflows/__next._full.txt +31 -33
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +13 -13
- package/dist/web/workflows/__next._tree.txt +2 -2
- package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
- package/dist/web/workflows/__next.workflows.txt +3 -3
- package/dist/web/workflows.html +1 -1
- package/dist/web/workflows.txt +31 -33
- package/dist/web/workspace/_/__next._full.txt +28 -29
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +13 -13
- package/dist/web/workspace/_/__next._tree.txt +2 -2
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.txt +3 -3
- package/dist/web/workspace/_.html +1 -1
- package/dist/web/workspace/_.txt +28 -29
- package/dist/web/workspaces/__next._full.txt +29 -31
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +13 -13
- package/dist/web/workspaces/__next._tree.txt +2 -2
- package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
- package/dist/web/workspaces/__next.workspaces.txt +3 -3
- package/dist/web/workspaces.html +1 -1
- package/dist/web/workspaces.txt +29 -31
- package/dist/ws/agent-prompt.js +32 -3
- package/dist/ws/agent-runner.js +83 -6
- package/package.json +11 -11
- package/dist/web/_next/static/chunks/0-9194nbxy_6d.js +0 -1
- package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +0 -1
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +0 -31
- package/dist/web/_next/static/chunks/04dg4l4hv11q2.js +0 -3
- package/dist/web/_next/static/chunks/04fxddw-y20~-.js +0 -7
- package/dist/web/_next/static/chunks/04w7~5ooz_pwm.js +0 -1
- package/dist/web/_next/static/chunks/05oc21sj24wtq.js +0 -1
- package/dist/web/_next/static/chunks/08kfx8on9oty~.js +0 -1
- package/dist/web/_next/static/chunks/08k~meqbd8d6v.js +0 -1
- package/dist/web/_next/static/chunks/099h96wjsdb25.js +0 -2
- package/dist/web/_next/static/chunks/09h23logvq65m.js +0 -1
- package/dist/web/_next/static/chunks/0a5y-vhf4i5id.js +0 -3
- package/dist/web/_next/static/chunks/0ake2f3x2uan4.js +0 -24
- package/dist/web/_next/static/chunks/0ck8dw_9-1cdx.js +0 -1
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +0 -1
- package/dist/web/_next/static/chunks/0f7cb9li~3jra.js +0 -67
- package/dist/web/_next/static/chunks/0ghs9on7wodrm.js +0 -1
- package/dist/web/_next/static/chunks/0ghx3j_.-gdyd.js +0 -1
- package/dist/web/_next/static/chunks/0h9cu-k6z5o08.js +0 -1
- package/dist/web/_next/static/chunks/0jb4~3qqkw2ps.js +0 -1
- package/dist/web/_next/static/chunks/0nb8.iteznuvx.js +0 -1
- package/dist/web/_next/static/chunks/0os58q93stt7j.js +0 -3
- package/dist/web/_next/static/chunks/0s9lmk8iauou3.js +0 -1
- package/dist/web/_next/static/chunks/0sp_zbx~w0am7.js +0 -1
- package/dist/web/_next/static/chunks/0tel~zsv4z8l_.js +0 -1
- package/dist/web/_next/static/chunks/0twamv4wr_dbv.js +0 -1
- package/dist/web/_next/static/chunks/0uhol5wafdbl~.js +0 -1
- package/dist/web/_next/static/chunks/0v3a_x4vt42kx.js +0 -5
- package/dist/web/_next/static/chunks/0v7q4mys.mnm..css +0 -1
- package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +0 -1
- package/dist/web/_next/static/chunks/0z~vqzbm_q371.js +0 -1
- package/dist/web/_next/static/chunks/0~3xm80~j9ddg.js +0 -1
- package/dist/web/_next/static/chunks/14s37n6h0_q3x.js +0 -16
- package/dist/web/_next/static/chunks/161ik5kfyuwtd.js +0 -1
- package/dist/web/_next/static/chunks/17k~zbv0_4rep.js +0 -1
- package/public/output-styles/carmack-mode.md +0 -381
- package/public/output-styles/codex-rigor-mode.md +0 -114
- package/public/output-styles/dhh-mode.md +0 -265
- package/public/output-styles/evan-you-mode.md +0 -539
- package/public/output-styles/index.json +0 -37
- package/public/output-styles/jobs-mode.md +0 -369
- package/public/output-styles/linus-mode.md +0 -135
- package/public/output-styles/uncle-bob-mode.md +0 -221
- package/public/prompt/andrej-karpathy-skills.md +0 -65
- package/public/prompt/claude-token-efficient-coding.md +0 -35
- package/public/prompt/index.json +0 -12
- package/public/skills/index.json +0 -92
- package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +0 -243
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +0 -44
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +0 -46
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +0 -124
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +0 -124
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +0 -438
- package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +0 -29
- package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +0 -40
- package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +0 -58
- package/public/skills/superpowers/brainstorming/SKILL.md +0 -164
- package/public/skills/superpowers/brainstorming/scripts/frame-template.html +0 -214
- package/public/skills/superpowers/brainstorming/scripts/helper.js +0 -88
- package/public/skills/superpowers/brainstorming/scripts/server.cjs +0 -354
- package/public/skills/superpowers/brainstorming/scripts/start-server.sh +0 -148
- package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +0 -56
- package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/public/skills/superpowers/brainstorming/visual-companion.md +0 -287
- package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +0 -182
- package/public/skills/superpowers/executing-plans/SKILL.md +0 -70
- package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +0 -251
- package/public/skills/superpowers/receiving-code-review/SKILL.md +0 -213
- package/public/skills/superpowers/requesting-code-review/SKILL.md +0 -103
- package/public/skills/superpowers/requesting-code-review/code-reviewer.md +0 -168
- package/public/skills/superpowers/subagent-driven-development/SKILL.md +0 -279
- package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +0 -25
- package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +0 -113
- package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +0 -61
- package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +0 -119
- package/public/skills/superpowers/systematic-debugging/SKILL.md +0 -296
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +0 -115
- package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +0 -122
- package/public/skills/superpowers/systematic-debugging/find-polluter.sh +0 -63
- package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +0 -169
- package/public/skills/superpowers/systematic-debugging/test-academic.md +0 -14
- package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +0 -58
- package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +0 -68
- package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +0 -69
- package/public/skills/superpowers/test-driven-development/SKILL.md +0 -371
- package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +0 -299
- package/public/skills/superpowers/using-git-worktrees/SKILL.md +0 -215
- package/public/skills/superpowers/using-superpowers/SKILL.md +0 -117
- package/public/skills/superpowers/using-superpowers/references/codex-tools.md +0 -59
- package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +0 -42
- package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +0 -51
- package/public/skills/superpowers/verification-before-completion/SKILL.md +0 -139
- package/public/skills/superpowers/writing-plans/SKILL.md +0 -152
- package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +0 -49
- package/public/skills/superpowers/writing-skills/SKILL.md +0 -655
- package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +0 -1150
- package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
- package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +0 -172
- package/public/skills/superpowers/writing-skills/persuasion-principles.md +0 -187
- package/public/skills/superpowers/writing-skills/render-graphs.js +0 -168
- package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +0 -384
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { writeFileSync, unlinkSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { getLocalVersion, getCachedLatest, fetchLatestVersion, isNewerVersion } from '../services/version.js';
|
|
7
|
+
const router = Router();
|
|
8
|
+
const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
|
|
9
|
+
let isUpdating = false;
|
|
10
|
+
// GET /version — cached version info (openPaths in auth.ts)
|
|
11
|
+
router.get('/version', async (_req, res) => {
|
|
12
|
+
const local = getLocalVersion();
|
|
13
|
+
if (isDev) {
|
|
14
|
+
res.json({ local, latest: null, updateAvailable: false, dev: true });
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let latest = getCachedLatest();
|
|
18
|
+
if (!latest) {
|
|
19
|
+
latest = await fetchLatestVersion(false);
|
|
20
|
+
}
|
|
21
|
+
res.json({ local, latest, updateAvailable: latest ? isNewerVersion(latest, local) : false });
|
|
22
|
+
});
|
|
23
|
+
// GET /version/check — force npm lookup (openPaths in auth.ts)
|
|
24
|
+
router.get('/version/check', async (_req, res) => {
|
|
25
|
+
const local = getLocalVersion();
|
|
26
|
+
if (isDev) {
|
|
27
|
+
res.json({ local, latest: null, updateAvailable: false, dev: true });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const latest = await fetchLatestVersion(true);
|
|
31
|
+
res.json({
|
|
32
|
+
local,
|
|
33
|
+
latest,
|
|
34
|
+
updateAvailable: latest ? isNewerVersion(latest, local) : false,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
// POST /version/update — trigger self-update (requires auth)
|
|
38
|
+
router.post('/version/update', (_req, res) => {
|
|
39
|
+
if (isDev) {
|
|
40
|
+
res.status(403).json({ error: 'Updates are disabled in development mode' });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (isUpdating) {
|
|
44
|
+
res.status(409).json({ error: 'Update already in progress' });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
isUpdating = true;
|
|
48
|
+
const pid = process.pid;
|
|
49
|
+
const ppid = process.ppid;
|
|
50
|
+
const projectRoot = join(import.meta.dirname, '..', '..');
|
|
51
|
+
const isWin = process.platform === 'win32';
|
|
52
|
+
let scriptPath;
|
|
53
|
+
if (isWin) {
|
|
54
|
+
scriptPath = join(tmpdir(), `agent-spaces-update-${pid}.cmd`);
|
|
55
|
+
const cmd = [
|
|
56
|
+
'@echo off',
|
|
57
|
+
'timeout /t 2 /nobreak >nul',
|
|
58
|
+
`taskkill /pid ${ppid} /f /t >nul 2>&1`,
|
|
59
|
+
`taskkill /pid ${pid} /f /t >nul 2>&1`,
|
|
60
|
+
`cd /d "${projectRoot}"`,
|
|
61
|
+
'call pnpm install',
|
|
62
|
+
'call pnpm start',
|
|
63
|
+
].join('\r\n');
|
|
64
|
+
writeFileSync(scriptPath, cmd, 'utf-8');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
scriptPath = join(tmpdir(), `agent-spaces-update-${pid}.sh`);
|
|
68
|
+
const sh = [
|
|
69
|
+
'#!/bin/sh',
|
|
70
|
+
'sleep 2',
|
|
71
|
+
`kill -9 ${ppid} 2>/dev/null || true`,
|
|
72
|
+
`kill -9 ${pid} 2>/dev/null || true`,
|
|
73
|
+
`cd "${projectRoot}"`,
|
|
74
|
+
'pnpm install',
|
|
75
|
+
'pnpm start',
|
|
76
|
+
].join('\n');
|
|
77
|
+
writeFileSync(scriptPath, sh, 'utf-8');
|
|
78
|
+
}
|
|
79
|
+
const child = spawn(isWin ? 'cmd' : '/bin/sh', isWin ? ['/c', scriptPath] : [scriptPath], {
|
|
80
|
+
detached: true,
|
|
81
|
+
stdio: 'ignore',
|
|
82
|
+
windowsHide: true,
|
|
83
|
+
});
|
|
84
|
+
child.unref();
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
try {
|
|
87
|
+
unlinkSync(scriptPath);
|
|
88
|
+
}
|
|
89
|
+
catch { }
|
|
90
|
+
}, 10_000);
|
|
91
|
+
res.json({ ok: true });
|
|
92
|
+
});
|
|
93
|
+
export default router;
|
|
94
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { listWorkspaceWorktrees, getWorkspaceWorktree, createWorkspaceWorktree, deleteWorkspaceWorktree, getWorktreeDiff, createWorktreePR, mergeWorktreePR, getWorktreePRDraft, } from '../services/worktree.js';
|
|
4
|
+
export const worktreeRouter = Router({ mergeParams: true });
|
|
5
|
+
const createSchema = z.object({
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
branch: z.string().optional(),
|
|
8
|
+
agentId: z.string().optional(),
|
|
9
|
+
issueId: z.string().optional(),
|
|
10
|
+
taskId: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
const prSchema = z.object({
|
|
13
|
+
title: z.string().optional(),
|
|
14
|
+
body: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
const prDraftSchema = z.object({
|
|
17
|
+
title: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
worktreeRouter.get('/', (req, res) => {
|
|
20
|
+
const { id } = req.params;
|
|
21
|
+
res.json(listWorkspaceWorktrees(id));
|
|
22
|
+
});
|
|
23
|
+
worktreeRouter.post('/', async (req, res) => {
|
|
24
|
+
try {
|
|
25
|
+
const { id } = req.params;
|
|
26
|
+
const input = createSchema.parse(req.body);
|
|
27
|
+
const info = await createWorkspaceWorktree(id, input);
|
|
28
|
+
res.status(201).json(info);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
res.status(400).json({ error: err.message });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
worktreeRouter.get('/:wtId', (req, res) => {
|
|
35
|
+
const { id, wtId } = req.params;
|
|
36
|
+
const info = getWorkspaceWorktree(id, wtId);
|
|
37
|
+
if (!info)
|
|
38
|
+
return res.status(404).json({ error: 'Worktree not found' });
|
|
39
|
+
res.json(info);
|
|
40
|
+
});
|
|
41
|
+
worktreeRouter.delete('/:wtId', async (req, res) => {
|
|
42
|
+
try {
|
|
43
|
+
const { id, wtId } = req.params;
|
|
44
|
+
await deleteWorkspaceWorktree(id, wtId);
|
|
45
|
+
res.json({ ok: true });
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
res.status(400).json({ error: err.message });
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
worktreeRouter.get('/:wtId/diff', async (req, res) => {
|
|
52
|
+
try {
|
|
53
|
+
const { id, wtId } = req.params;
|
|
54
|
+
const diffs = await getWorktreeDiff(id, wtId);
|
|
55
|
+
res.json(diffs);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
res.status(400).json({ error: err.message });
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
worktreeRouter.post('/:wtId/pr', async (req, res) => {
|
|
62
|
+
try {
|
|
63
|
+
const { id, wtId } = req.params;
|
|
64
|
+
const { title, body } = prSchema.parse(req.body);
|
|
65
|
+
const prUrl = await createWorktreePR(id, wtId, title, body);
|
|
66
|
+
res.json({ prUrl });
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
res.status(400).json({ error: err.message });
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
worktreeRouter.post('/:wtId/pr/draft', async (req, res) => {
|
|
73
|
+
try {
|
|
74
|
+
const { id, wtId } = req.params;
|
|
75
|
+
const { title } = prDraftSchema.parse(req.body);
|
|
76
|
+
const draft = await getWorktreePRDraft(id, wtId, title);
|
|
77
|
+
res.json(draft);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
res.status(400).json({ error: err.message });
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
worktreeRouter.post('/:wtId/merge', async (req, res) => {
|
|
84
|
+
try {
|
|
85
|
+
const { id, wtId } = req.params;
|
|
86
|
+
await mergeWorktreePR(id, wtId);
|
|
87
|
+
res.json({ ok: true });
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
res.status(400).json({ error: err.message });
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=worktree.js.map
|
package/dist/services/agent.js
CHANGED
|
@@ -3,7 +3,7 @@ import { copyFileSync, cpSync, existsSync, readFileSync, readdirSync, rmSync, st
|
|
|
3
3
|
import { basename, extname, isAbsolute, join, normalize, relative } from 'node:path';
|
|
4
4
|
import { BUILT_IN_AGENT_TOOLS } from '@agent-spaces/shared';
|
|
5
5
|
import { listAgentSessions, getAgentSession, createAgentSession, updateAgentSession, deleteAgentSession, getAgentUsageDashboard, recordAgentUsage, } from '../storage/agent-store.js';
|
|
6
|
-
import { getWorkspace } from '../storage/workspace-store.js';
|
|
6
|
+
import { getWorkspace, listWorkspaces } from '../storage/workspace-store.js';
|
|
7
7
|
import { listIssues, updateIssue } from '../storage/issue-store.js';
|
|
8
8
|
import { listChannels, updateChannel } from './channel.js';
|
|
9
9
|
import { ensureDir, getDataDir } from '../storage/json-store.js';
|
|
@@ -11,8 +11,9 @@ import { extractUsageFromOutput } from '../storage/usage.js';
|
|
|
11
11
|
const DEFAULT_AGENT_ROLE = 'agent';
|
|
12
12
|
export const AGENT_GENERATOR_PRESET_ID = 'agent-generator';
|
|
13
13
|
export const AGENT_COMMIT_PRESET_ID = 'commit-agent';
|
|
14
|
-
const VALID_RUNTIME_KINDS = ['open-agent-sdk', 'claude-code', 'codex', 'langchain'];
|
|
14
|
+
const VALID_RUNTIME_KINDS = ['open-agent-sdk', 'claude-code', 'codex', 'langchain', 'hermes'];
|
|
15
15
|
const VALID_TOOL_NAMES = new Set(BUILT_IN_AGENT_TOOLS.map((tool) => tool.name));
|
|
16
|
+
const CLAUDE_BUILT_IN_DIRS = ['agents', 'commands'];
|
|
16
17
|
const ANTHROPIC_BRIDGE_PROVIDERS = [
|
|
17
18
|
'openai-responses-to-anthropic-messages',
|
|
18
19
|
'openai-chat-completions-to-anthropic-messages',
|
|
@@ -338,6 +339,20 @@ export function getAgentConfigDir(workspaceId, preset) {
|
|
|
338
339
|
ensureWorkspaceAgentCopy(preset, ws.agentspaceDir);
|
|
339
340
|
return workspaceAgentDir;
|
|
340
341
|
}
|
|
342
|
+
export function syncTemplatesToAllWorkspaces() {
|
|
343
|
+
const templates = listTemplates().filter((template) => existsSync(getGlobalAgentTemplateDir(template.id)));
|
|
344
|
+
const workspaces = listWorkspaces();
|
|
345
|
+
let agents = 0;
|
|
346
|
+
for (const workspace of workspaces) {
|
|
347
|
+
if (!workspace.agentspaceDir)
|
|
348
|
+
continue;
|
|
349
|
+
for (const template of templates) {
|
|
350
|
+
writeWorkspaceAgentCopy(template, workspace.agentspaceDir);
|
|
351
|
+
agents++;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return { workspaces: workspaces.length, agents };
|
|
355
|
+
}
|
|
341
356
|
export function getAvailableSkillNames(agentDir, skills) {
|
|
342
357
|
if (!agentDir || !Array.isArray(skills))
|
|
343
358
|
return [];
|
|
@@ -541,10 +556,29 @@ function writeWorkspaceAgentCopy(preset, agentspaceDir) {
|
|
|
541
556
|
function ensureWorkspaceAgentCopy(preset, agentspaceDir) {
|
|
542
557
|
const workspaceAgentDir = getWorkspaceAgentDir(agentspaceDir, preset.id);
|
|
543
558
|
const requiredFiles = ['agent.json', 'mcp.json'];
|
|
544
|
-
|
|
559
|
+
const sourceDir = getGlobalAgentTemplateDir(preset.id);
|
|
560
|
+
const missingRequiredFile = requiredFiles.some((file) => !existsSync(join(workspaceAgentDir, file)));
|
|
561
|
+
const missingBuiltInDir = CLAUDE_BUILT_IN_DIRS.some((dir) => {
|
|
562
|
+
const sourceBuiltInDir = join(sourceDir, dir);
|
|
563
|
+
const targetBuiltInDir = join(workspaceAgentDir, dir);
|
|
564
|
+
return existsSync(sourceBuiltInDir)
|
|
565
|
+
&& statSync(sourceBuiltInDir).isDirectory()
|
|
566
|
+
&& countFiles(sourceBuiltInDir) > countFiles(targetBuiltInDir);
|
|
567
|
+
});
|
|
568
|
+
if (!missingRequiredFile && !missingBuiltInDir)
|
|
545
569
|
return;
|
|
546
570
|
writeWorkspaceAgentCopy(preset, agentspaceDir);
|
|
547
571
|
}
|
|
572
|
+
function countFiles(dir) {
|
|
573
|
+
if (!existsSync(dir) || !statSync(dir).isDirectory())
|
|
574
|
+
return 0;
|
|
575
|
+
return readdirSync(dir, { withFileTypes: true }).reduce((count, entry) => {
|
|
576
|
+
const fullPath = join(dir, entry.name);
|
|
577
|
+
if (entry.isDirectory())
|
|
578
|
+
return count + countFiles(fullPath);
|
|
579
|
+
return entry.isFile() ? count + 1 : count;
|
|
580
|
+
}, 0);
|
|
581
|
+
}
|
|
548
582
|
export function readAgentTemplate(agentId) {
|
|
549
583
|
const filePath = join(getGlobalAgentTemplateDir(agentId), 'agent.json');
|
|
550
584
|
if (!existsSync(filePath)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BUILT_IN_AGENT_TOOLS } from '@agent-spaces/shared';
|
|
2
2
|
import * as kanbanStore from '../../storage/kanban-store.js';
|
|
3
|
+
import { broadcastToWorkspace } from '../../ws/connection-manager.js';
|
|
3
4
|
import { assertRecord, readOptionalString, readRequiredString, readString } from './input-helpers.js';
|
|
4
5
|
const kanbanLayoutModes = ['horizontal', 'vertical'];
|
|
5
6
|
const kanbanPriorities = ['low', 'medium', 'high'];
|
|
@@ -158,6 +159,7 @@ function createKanbanBoard(workspaceId, input) {
|
|
|
158
159
|
const created = kanbanStore.getBoard(workspaceId);
|
|
159
160
|
if (!created)
|
|
160
161
|
throw new Error('Failed to create Kanban board.');
|
|
162
|
+
broadcastToWorkspace(workspaceId, 'kanban.updated', created);
|
|
161
163
|
return created;
|
|
162
164
|
}
|
|
163
165
|
function updateKanbanBoard(workspaceId, input) {
|
|
@@ -185,6 +187,7 @@ function updateKanbanBoard(workspaceId, input) {
|
|
|
185
187
|
const updated = kanbanStore.listBoards(workspaceId).find((item) => item.id === board.id);
|
|
186
188
|
if (!updated)
|
|
187
189
|
throw new Error(`Kanban board not found: ${board.id}`);
|
|
190
|
+
broadcastToWorkspace(workspaceId, 'kanban.updated', updated);
|
|
188
191
|
return updated;
|
|
189
192
|
}
|
|
190
193
|
function deleteKanbanBoard(workspaceId, input) {
|
|
@@ -193,6 +196,7 @@ function deleteKanbanBoard(workspaceId, input) {
|
|
|
193
196
|
const ok = kanbanStore.deleteBoard(workspaceId, board.id);
|
|
194
197
|
if (!ok)
|
|
195
198
|
throw new Error(`Kanban board not found: ${board.id}`);
|
|
199
|
+
broadcastToWorkspace(workspaceId, 'kanban.deleted', { boardId: board.id });
|
|
196
200
|
return { ok: true, deletedBoardId: board.id };
|
|
197
201
|
}
|
|
198
202
|
function resolveKanbanBoard(workspaceId, boardId) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const MAX_ENTRIES = 1000;
|
|
2
|
+
const store = new Map();
|
|
3
|
+
function getList(workspaceId) {
|
|
4
|
+
let list = store.get(workspaceId);
|
|
5
|
+
if (!list) {
|
|
6
|
+
list = [];
|
|
7
|
+
store.set(workspaceId, list);
|
|
8
|
+
}
|
|
9
|
+
return list;
|
|
10
|
+
}
|
|
11
|
+
let counter = 0;
|
|
12
|
+
export function logGitOperation(workspaceId, operation, input, result, error, duration = 0) {
|
|
13
|
+
const list = getList(workspaceId);
|
|
14
|
+
const entry = {
|
|
15
|
+
id: `${Date.now()}-${++counter}`,
|
|
16
|
+
operation,
|
|
17
|
+
input,
|
|
18
|
+
output: truncateOutput(result),
|
|
19
|
+
error,
|
|
20
|
+
timestamp: new Date().toISOString(),
|
|
21
|
+
duration,
|
|
22
|
+
};
|
|
23
|
+
list.unshift(entry);
|
|
24
|
+
if (list.length > MAX_ENTRIES)
|
|
25
|
+
list.length = MAX_ENTRIES;
|
|
26
|
+
}
|
|
27
|
+
export function getGitOperations(workspaceId) {
|
|
28
|
+
return getList(workspaceId);
|
|
29
|
+
}
|
|
30
|
+
function truncateOutput(value) {
|
|
31
|
+
if (value === undefined || value === null)
|
|
32
|
+
return value;
|
|
33
|
+
if (typeof value === 'string')
|
|
34
|
+
return value.length > 5000 ? value.slice(0, 5000) + '...(truncated)' : value;
|
|
35
|
+
const s = JSON.stringify(value);
|
|
36
|
+
if (s && s.length > 5000)
|
|
37
|
+
return JSON.parse(s.slice(0, 5000) + '...(truncated)');
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=git-operation-log.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { WECHAT_BASE_URL, WECHAT_BOT_TYPE, WECHAT_QR_STATUS_TIMEOUT_MS, } from './notification-hub/types.js';
|
|
2
|
+
import { createAccount } from './robot-account.js';
|
|
3
|
+
const globalSessions = new Map();
|
|
4
|
+
export async function getGlobalWeChatQRCode() {
|
|
5
|
+
// cleanup old sessions
|
|
6
|
+
const now = Date.now();
|
|
7
|
+
for (const [key, s] of globalSessions) {
|
|
8
|
+
if (now - s.createdAt > 5 * 60_000)
|
|
9
|
+
globalSessions.delete(key);
|
|
10
|
+
}
|
|
11
|
+
const res = await fetch(`${WECHAT_BASE_URL}/ilink/bot/get_bot_qrcode?bot_type=${WECHAT_BOT_TYPE}`);
|
|
12
|
+
if (!res.ok)
|
|
13
|
+
throw new Error(`Failed to get WeChat QR code: ${res.status}`);
|
|
14
|
+
const qr = await res.json();
|
|
15
|
+
const sessionId = `global-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
16
|
+
globalSessions.set(sessionId, {
|
|
17
|
+
qrcode: qr.qrcode,
|
|
18
|
+
qrcodeImgContent: qr.qrcode_img_content,
|
|
19
|
+
createdAt: now,
|
|
20
|
+
});
|
|
21
|
+
return { status: 'wait', qrcodeImgContent: qr.qrcode_img_content, sessionId };
|
|
22
|
+
}
|
|
23
|
+
export async function pollGlobalWeChatQRCode(sessionId) {
|
|
24
|
+
if (!sessionId)
|
|
25
|
+
throw new Error('sessionId is required');
|
|
26
|
+
const session = globalSessions.get(sessionId);
|
|
27
|
+
if (!session)
|
|
28
|
+
throw new Error('Session not found or expired');
|
|
29
|
+
const status = await fetchQRStatus(session.qrcode);
|
|
30
|
+
if (status.status === 'confirmed') {
|
|
31
|
+
if (!status.bot_token || !status.ilink_bot_id) {
|
|
32
|
+
throw new Error('WeChat login confirmed but token or bot id is missing');
|
|
33
|
+
}
|
|
34
|
+
globalSessions.delete(sessionId);
|
|
35
|
+
const account = createAccount({
|
|
36
|
+
name: `微信 ${status.ilink_bot_id}`,
|
|
37
|
+
type: 'wechat',
|
|
38
|
+
wechat: {
|
|
39
|
+
token: status.bot_token,
|
|
40
|
+
baseUrl: status.baseurl || WECHAT_BASE_URL,
|
|
41
|
+
accountId: status.ilink_bot_id,
|
|
42
|
+
userId: status.ilink_user_id,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return { status: 'confirmed', account };
|
|
46
|
+
}
|
|
47
|
+
if (status.status === 'expired') {
|
|
48
|
+
globalSessions.delete(sessionId);
|
|
49
|
+
}
|
|
50
|
+
return { status: status.status, qrcodeImgContent: session.qrcodeImgContent, sessionId };
|
|
51
|
+
}
|
|
52
|
+
async function fetchQRStatus(qrcode) {
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timer = setTimeout(() => controller.abort(), WECHAT_QR_STATUS_TIMEOUT_MS);
|
|
55
|
+
try {
|
|
56
|
+
const res = await fetch(`${WECHAT_BASE_URL}/ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(qrcode)}`, {
|
|
57
|
+
headers: { 'iLink-App-ClientVersion': '1' },
|
|
58
|
+
signal: controller.signal,
|
|
59
|
+
});
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
if (!res.ok)
|
|
62
|
+
throw new Error(`Failed to poll QR status: ${res.status}`);
|
|
63
|
+
return await res.json();
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
clearTimeout(timer);
|
|
67
|
+
if (err instanceof Error && err.name === 'AbortError')
|
|
68
|
+
return { status: 'wait' };
|
|
69
|
+
throw err;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=global-wechat-qr.js.map
|