agim-cli 1.0.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 +1234 -0
- package/LICENSE +21 -0
- package/README.md +422 -0
- package/README.zh-CN.md +414 -0
- package/dist/cli-ui/cmd-handlers.d.ts +11 -0
- package/dist/cli-ui/cmd-handlers.d.ts.map +1 -0
- package/dist/cli-ui/cmd-handlers.js +240 -0
- package/dist/cli-ui/cmd-handlers.js.map +1 -0
- package/dist/cli-ui/config-wizard.d.ts +3 -0
- package/dist/cli-ui/config-wizard.d.ts.map +1 -0
- package/dist/cli-ui/config-wizard.js +851 -0
- package/dist/cli-ui/config-wizard.js.map +1 -0
- package/dist/cli-ui/entry-menu.d.ts +28 -0
- package/dist/cli-ui/entry-menu.d.ts.map +1 -0
- package/dist/cli-ui/entry-menu.js +50 -0
- package/dist/cli-ui/entry-menu.js.map +1 -0
- package/dist/cli-ui/env-file.d.ts +35 -0
- package/dist/cli-ui/env-file.d.ts.map +1 -0
- package/dist/cli-ui/env-file.js +163 -0
- package/dist/cli-ui/env-file.js.map +1 -0
- package/dist/cli-ui/i18n.d.ts +204 -0
- package/dist/cli-ui/i18n.d.ts.map +1 -0
- package/dist/cli-ui/i18n.js +455 -0
- package/dist/cli-ui/i18n.js.map +1 -0
- package/dist/cli-ui/lang-picker.d.ts +10 -0
- package/dist/cli-ui/lang-picker.d.ts.map +1 -0
- package/dist/cli-ui/lang-picker.js +33 -0
- package/dist/cli-ui/lang-picker.js.map +1 -0
- package/dist/cli-ui/paths.d.ts +4 -0
- package/dist/cli-ui/paths.d.ts.map +1 -0
- package/dist/cli-ui/paths.js +11 -0
- package/dist/cli-ui/paths.js.map +1 -0
- package/dist/cli-ui/prompts.d.ts +65 -0
- package/dist/cli-ui/prompts.d.ts.map +1 -0
- package/dist/cli-ui/prompts.js +125 -0
- package/dist/cli-ui/prompts.js.map +1 -0
- package/dist/cli-ui/service.d.ts +41 -0
- package/dist/cli-ui/service.d.ts.map +1 -0
- package/dist/cli-ui/service.js +241 -0
- package/dist/cli-ui/service.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1143 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/acp-server.d.ts +8 -0
- package/dist/core/acp-server.d.ts.map +1 -0
- package/dist/core/acp-server.js +266 -0
- package/dist/core/acp-server.js.map +1 -0
- package/dist/core/agent-base.d.ts +94 -0
- package/dist/core/agent-base.d.ts.map +1 -0
- package/dist/core/agent-base.js +373 -0
- package/dist/core/agent-base.js.map +1 -0
- package/dist/core/agent-cwd.d.ts +48 -0
- package/dist/core/agent-cwd.d.ts.map +1 -0
- package/dist/core/agent-cwd.js +181 -0
- package/dist/core/agent-cwd.js.map +1 -0
- package/dist/core/agent-helper.d.ts +65 -0
- package/dist/core/agent-helper.d.ts.map +1 -0
- package/dist/core/agent-helper.js +150 -0
- package/dist/core/agent-helper.js.map +1 -0
- package/dist/core/agim-paths.d.ts +10 -0
- package/dist/core/agim-paths.d.ts.map +1 -0
- package/dist/core/agim-paths.js +64 -0
- package/dist/core/agim-paths.js.map +1 -0
- package/dist/core/approval-bus.d.ts +300 -0
- package/dist/core/approval-bus.d.ts.map +1 -0
- package/dist/core/approval-bus.js +990 -0
- package/dist/core/approval-bus.js.map +1 -0
- package/dist/core/approval-router.d.ts +101 -0
- package/dist/core/approval-router.d.ts.map +1 -0
- package/dist/core/approval-router.js +540 -0
- package/dist/core/approval-router.js.map +1 -0
- package/dist/core/audit-log.d.ts +55 -0
- package/dist/core/audit-log.d.ts.map +1 -0
- package/dist/core/audit-log.js +203 -0
- package/dist/core/audit-log.js.map +1 -0
- package/dist/core/bgjob-reader.d.ts +65 -0
- package/dist/core/bgjob-reader.d.ts.map +1 -0
- package/dist/core/bgjob-reader.js +212 -0
- package/dist/core/bgjob-reader.js.map +1 -0
- package/dist/core/circuit-breaker.d.ts +37 -0
- package/dist/core/circuit-breaker.d.ts.map +1 -0
- package/dist/core/circuit-breaker.js +115 -0
- package/dist/core/circuit-breaker.js.map +1 -0
- package/dist/core/commands/agent.d.ts +4 -0
- package/dist/core/commands/agent.d.ts.map +1 -0
- package/dist/core/commands/agent.js +40 -0
- package/dist/core/commands/agent.js.map +1 -0
- package/dist/core/commands/approval.d.ts +3 -0
- package/dist/core/commands/approval.d.ts.map +1 -0
- package/dist/core/commands/approval.js +85 -0
- package/dist/core/commands/approval.js.map +1 -0
- package/dist/core/commands/audit.d.ts +3 -0
- package/dist/core/commands/audit.d.ts.map +1 -0
- package/dist/core/commands/audit.js +84 -0
- package/dist/core/commands/audit.js.map +1 -0
- package/dist/core/commands/builtin.d.ts +3 -0
- package/dist/core/commands/builtin.d.ts.map +1 -0
- package/dist/core/commands/builtin.js +304 -0
- package/dist/core/commands/builtin.js.map +1 -0
- package/dist/core/commands/cron.d.ts +3 -0
- package/dist/core/commands/cron.d.ts.map +1 -0
- package/dist/core/commands/cron.js +128 -0
- package/dist/core/commands/cron.js.map +1 -0
- package/dist/core/commands/job.d.ts +3 -0
- package/dist/core/commands/job.d.ts.map +1 -0
- package/dist/core/commands/job.js +195 -0
- package/dist/core/commands/job.js.map +1 -0
- package/dist/core/commands/memo.d.ts +3 -0
- package/dist/core/commands/memo.d.ts.map +1 -0
- package/dist/core/commands/memo.js +151 -0
- package/dist/core/commands/memo.js.map +1 -0
- package/dist/core/commands/model.d.ts +9 -0
- package/dist/core/commands/model.d.ts.map +1 -0
- package/dist/core/commands/model.js +183 -0
- package/dist/core/commands/model.js.map +1 -0
- package/dist/core/commands/plan.d.ts +3 -0
- package/dist/core/commands/plan.d.ts.map +1 -0
- package/dist/core/commands/plan.js +75 -0
- package/dist/core/commands/plan.js.map +1 -0
- package/dist/core/commands/remind.d.ts +3 -0
- package/dist/core/commands/remind.d.ts.map +1 -0
- package/dist/core/commands/remind.js +271 -0
- package/dist/core/commands/remind.js.map +1 -0
- package/dist/core/commands/router.d.ts +3 -0
- package/dist/core/commands/router.d.ts.map +1 -0
- package/dist/core/commands/router.js +71 -0
- package/dist/core/commands/router.js.map +1 -0
- package/dist/core/commands/sessions.d.ts +3 -0
- package/dist/core/commands/sessions.d.ts.map +1 -0
- package/dist/core/commands/sessions.js +88 -0
- package/dist/core/commands/sessions.js.map +1 -0
- package/dist/core/commands/stats.d.ts +3 -0
- package/dist/core/commands/stats.d.ts.map +1 -0
- package/dist/core/commands/stats.js +73 -0
- package/dist/core/commands/stats.js.map +1 -0
- package/dist/core/commands/think.d.ts +3 -0
- package/dist/core/commands/think.d.ts.map +1 -0
- package/dist/core/commands/think.js +28 -0
- package/dist/core/commands/think.js.map +1 -0
- package/dist/core/commands/workspaces.d.ts +3 -0
- package/dist/core/commands/workspaces.d.ts.map +1 -0
- package/dist/core/commands/workspaces.js +47 -0
- package/dist/core/commands/workspaces.js.map +1 -0
- package/dist/core/config-schema.d.ts +60 -0
- package/dist/core/config-schema.d.ts.map +1 -0
- package/dist/core/config-schema.js +75 -0
- package/dist/core/config-schema.js.map +1 -0
- package/dist/core/coord-systems.d.ts +65 -0
- package/dist/core/coord-systems.d.ts.map +1 -0
- package/dist/core/coord-systems.js +229 -0
- package/dist/core/coord-systems.js.map +1 -0
- package/dist/core/cron.d.ts +29 -0
- package/dist/core/cron.d.ts.map +1 -0
- package/dist/core/cron.js +184 -0
- package/dist/core/cron.js.map +1 -0
- package/dist/core/event-bus.d.ts +80 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +62 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/intent-llm.d.ts +27 -0
- package/dist/core/intent-llm.d.ts.map +1 -0
- package/dist/core/intent-llm.js +170 -0
- package/dist/core/intent-llm.js.map +1 -0
- package/dist/core/intent.d.ts +12 -0
- package/dist/core/intent.d.ts.map +1 -0
- package/dist/core/intent.js +187 -0
- package/dist/core/intent.js.map +1 -0
- package/dist/core/job-board.d.ts +82 -0
- package/dist/core/job-board.d.ts.map +1 -0
- package/dist/core/job-board.js +379 -0
- package/dist/core/job-board.js.map +1 -0
- package/dist/core/location-context.d.ts +32 -0
- package/dist/core/location-context.d.ts.map +1 -0
- package/dist/core/location-context.js +69 -0
- package/dist/core/location-context.js.map +1 -0
- package/dist/core/location-token.d.ts +57 -0
- package/dist/core/location-token.d.ts.map +1 -0
- package/dist/core/location-token.js +128 -0
- package/dist/core/location-token.js.map +1 -0
- package/dist/core/logger.d.ts +6 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +54 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/memo-rpc.d.ts +13 -0
- package/dist/core/memo-rpc.d.ts.map +1 -0
- package/dist/core/memo-rpc.js +288 -0
- package/dist/core/memo-rpc.js.map +1 -0
- package/dist/core/memos.d.ts +163 -0
- package/dist/core/memos.d.ts.map +1 -0
- package/dist/core/memos.js +502 -0
- package/dist/core/memos.js.map +1 -0
- package/dist/core/metrics.d.ts +55 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/metrics.js +291 -0
- package/dist/core/metrics.js.map +1 -0
- package/dist/core/onboarding.d.ts +99 -0
- package/dist/core/onboarding.d.ts.map +1 -0
- package/dist/core/onboarding.js +426 -0
- package/dist/core/onboarding.js.map +1 -0
- package/dist/core/pending-reminder.d.ts +25 -0
- package/dist/core/pending-reminder.d.ts.map +1 -0
- package/dist/core/pending-reminder.js +53 -0
- package/dist/core/pending-reminder.js.map +1 -0
- package/dist/core/rate-limiter.d.ts +44 -0
- package/dist/core/rate-limiter.d.ts.map +1 -0
- package/dist/core/rate-limiter.js +115 -0
- package/dist/core/rate-limiter.js.map +1 -0
- package/dist/core/registry.d.ts +32 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +126 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/remind-intent.d.ts +25 -0
- package/dist/core/remind-intent.d.ts.map +1 -0
- package/dist/core/remind-intent.js +196 -0
- package/dist/core/remind-intent.js.map +1 -0
- package/dist/core/reminder-rpc.d.ts +17 -0
- package/dist/core/reminder-rpc.d.ts.map +1 -0
- package/dist/core/reminder-rpc.js +169 -0
- package/dist/core/reminder-rpc.js.map +1 -0
- package/dist/core/reminders.d.ts +159 -0
- package/dist/core/reminders.d.ts.map +1 -0
- package/dist/core/reminders.js +977 -0
- package/dist/core/reminders.js.map +1 -0
- package/dist/core/router.d.ts +55 -0
- package/dist/core/router.d.ts.map +1 -0
- package/dist/core/router.js +497 -0
- package/dist/core/router.js.map +1 -0
- package/dist/core/schedule.d.ts +65 -0
- package/dist/core/schedule.d.ts.map +1 -0
- package/dist/core/schedule.js +323 -0
- package/dist/core/schedule.js.map +1 -0
- package/dist/core/session.d.ts +182 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +807 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/sqlite-helper.d.ts +37 -0
- package/dist/core/sqlite-helper.d.ts.map +1 -0
- package/dist/core/sqlite-helper.js +79 -0
- package/dist/core/sqlite-helper.js.map +1 -0
- package/dist/core/transcribe.d.ts +25 -0
- package/dist/core/transcribe.d.ts.map +1 -0
- package/dist/core/transcribe.js +217 -0
- package/dist/core/transcribe.js.map +1 -0
- package/dist/core/types.d.ts +360 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/workspace.d.ts +67 -0
- package/dist/core/workspace.d.ts.map +1 -0
- package/dist/core/workspace.js +113 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/agents/acp/acp-adapter.d.ts +16 -0
- package/dist/plugins/agents/acp/acp-adapter.d.ts.map +1 -0
- package/dist/plugins/agents/acp/acp-adapter.js +49 -0
- package/dist/plugins/agents/acp/acp-adapter.js.map +1 -0
- package/dist/plugins/agents/acp/acp-client.d.ts +32 -0
- package/dist/plugins/agents/acp/acp-client.d.ts.map +1 -0
- package/dist/plugins/agents/acp/acp-client.js +177 -0
- package/dist/plugins/agents/acp/acp-client.js.map +1 -0
- package/dist/plugins/agents/acp/discovery.d.ts +19 -0
- package/dist/plugins/agents/acp/discovery.d.ts.map +1 -0
- package/dist/plugins/agents/acp/discovery.js +111 -0
- package/dist/plugins/agents/acp/discovery.js.map +1 -0
- package/dist/plugins/agents/acp/index.d.ts +4 -0
- package/dist/plugins/agents/acp/index.d.ts.map +1 -0
- package/dist/plugins/agents/acp/index.js +4 -0
- package/dist/plugins/agents/acp/index.js.map +1 -0
- package/dist/plugins/agents/acp/types.d.ts +62 -0
- package/dist/plugins/agents/acp/types.d.ts.map +1 -0
- package/dist/plugins/agents/acp/types.js +5 -0
- package/dist/plugins/agents/acp/types.js.map +1 -0
- package/dist/plugins/agents/claude-code/index.d.ts +25 -0
- package/dist/plugins/agents/claude-code/index.d.ts.map +1 -0
- package/dist/plugins/agents/claude-code/index.js +184 -0
- package/dist/plugins/agents/claude-code/index.js.map +1 -0
- package/dist/plugins/agents/claude-code/mcp-approval-server.d.ts +59 -0
- package/dist/plugins/agents/claude-code/mcp-approval-server.d.ts.map +1 -0
- package/dist/plugins/agents/claude-code/mcp-approval-server.js +645 -0
- package/dist/plugins/agents/claude-code/mcp-approval-server.js.map +1 -0
- package/dist/plugins/agents/codex/build-mcp-cli-args.d.ts +28 -0
- package/dist/plugins/agents/codex/build-mcp-cli-args.d.ts.map +1 -0
- package/dist/plugins/agents/codex/build-mcp-cli-args.js +74 -0
- package/dist/plugins/agents/codex/build-mcp-cli-args.js.map +1 -0
- package/dist/plugins/agents/codex/index.d.ts +53 -0
- package/dist/plugins/agents/codex/index.d.ts.map +1 -0
- package/dist/plugins/agents/codex/index.js +341 -0
- package/dist/plugins/agents/codex/index.js.map +1 -0
- package/dist/plugins/agents/copilot/index.d.ts +35 -0
- package/dist/plugins/agents/copilot/index.d.ts.map +1 -0
- package/dist/plugins/agents/copilot/index.js +182 -0
- package/dist/plugins/agents/copilot/index.js.map +1 -0
- package/dist/plugins/agents/opencode/ensure-mcp-config.d.ts +11 -0
- package/dist/plugins/agents/opencode/ensure-mcp-config.d.ts.map +1 -0
- package/dist/plugins/agents/opencode/ensure-mcp-config.js +100 -0
- package/dist/plugins/agents/opencode/ensure-mcp-config.js.map +1 -0
- package/dist/plugins/agents/opencode/index.d.ts +5 -0
- package/dist/plugins/agents/opencode/index.d.ts.map +1 -0
- package/dist/plugins/agents/opencode/index.js +30 -0
- package/dist/plugins/agents/opencode/index.js.map +1 -0
- package/dist/plugins/agents/opencode/opencode-http-adapter.d.ts +166 -0
- package/dist/plugins/agents/opencode/opencode-http-adapter.d.ts.map +1 -0
- package/dist/plugins/agents/opencode/opencode-http-adapter.js +682 -0
- package/dist/plugins/agents/opencode/opencode-http-adapter.js.map +1 -0
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.d.ts +32 -0
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.d.ts.map +1 -0
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.js +137 -0
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.js.map +1 -0
- package/dist/plugins/agents/opencode/serve-manager.d.ts +27 -0
- package/dist/plugins/agents/opencode/serve-manager.d.ts.map +1 -0
- package/dist/plugins/agents/opencode/serve-manager.js +194 -0
- package/dist/plugins/agents/opencode/serve-manager.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.d.ts +57 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.js +409 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-client.d.ts +48 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-client.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-client.js +236 -0
- package/dist/plugins/messengers/dingtalk/dingtalk-client.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/index.d.ts +3 -0
- package/dist/plugins/messengers/dingtalk/index.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/index.js +3 -0
- package/dist/plugins/messengers/dingtalk/index.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/link-coords.d.ts +23 -0
- package/dist/plugins/messengers/dingtalk/link-coords.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/link-coords.js +89 -0
- package/dist/plugins/messengers/dingtalk/link-coords.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/media-store.d.ts +16 -0
- package/dist/plugins/messengers/dingtalk/media-store.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/media-store.js +77 -0
- package/dist/plugins/messengers/dingtalk/media-store.js.map +1 -0
- package/dist/plugins/messengers/dingtalk/types.d.ts +82 -0
- package/dist/plugins/messengers/dingtalk/types.d.ts.map +1 -0
- package/dist/plugins/messengers/dingtalk/types.js +14 -0
- package/dist/plugins/messengers/dingtalk/types.js.map +1 -0
- package/dist/plugins/messengers/discord/discord-adapter.d.ts +21 -0
- package/dist/plugins/messengers/discord/discord-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/discord/discord-adapter.js +238 -0
- package/dist/plugins/messengers/discord/discord-adapter.js.map +1 -0
- package/dist/plugins/messengers/discord/index.d.ts +4 -0
- package/dist/plugins/messengers/discord/index.d.ts.map +1 -0
- package/dist/plugins/messengers/discord/index.js +4 -0
- package/dist/plugins/messengers/discord/index.js.map +1 -0
- package/dist/plugins/messengers/discord/markdown-to-discord.d.ts +11 -0
- package/dist/plugins/messengers/discord/markdown-to-discord.d.ts.map +1 -0
- package/dist/plugins/messengers/discord/markdown-to-discord.js +59 -0
- package/dist/plugins/messengers/discord/markdown-to-discord.js.map +1 -0
- package/dist/plugins/messengers/discord/types.d.ts +9 -0
- package/dist/plugins/messengers/discord/types.d.ts.map +1 -0
- package/dist/plugins/messengers/discord/types.js +3 -0
- package/dist/plugins/messengers/discord/types.js.map +1 -0
- package/dist/plugins/messengers/email/email-adapter.d.ts +33 -0
- package/dist/plugins/messengers/email/email-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/email/email-adapter.js +137 -0
- package/dist/plugins/messengers/email/email-adapter.js.map +1 -0
- package/dist/plugins/messengers/feishu/card-builder.d.ts +23 -0
- package/dist/plugins/messengers/feishu/card-builder.d.ts.map +1 -0
- package/dist/plugins/messengers/feishu/card-builder.js +89 -0
- package/dist/plugins/messengers/feishu/card-builder.js.map +1 -0
- package/dist/plugins/messengers/feishu/feishu-adapter.d.ts +23 -0
- package/dist/plugins/messengers/feishu/feishu-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/feishu/feishu-adapter.js +250 -0
- package/dist/plugins/messengers/feishu/feishu-adapter.js.map +1 -0
- package/dist/plugins/messengers/feishu/feishu-client.d.ts +43 -0
- package/dist/plugins/messengers/feishu/feishu-client.d.ts.map +1 -0
- package/dist/plugins/messengers/feishu/feishu-client.js +118 -0
- package/dist/plugins/messengers/feishu/feishu-client.js.map +1 -0
- package/dist/plugins/messengers/feishu/index.d.ts +4 -0
- package/dist/plugins/messengers/feishu/index.d.ts.map +1 -0
- package/dist/plugins/messengers/feishu/index.js +4 -0
- package/dist/plugins/messengers/feishu/index.js.map +1 -0
- package/dist/plugins/messengers/feishu/types.d.ts +113 -0
- package/dist/plugins/messengers/feishu/types.d.ts.map +1 -0
- package/dist/plugins/messengers/feishu/types.js +4 -0
- package/dist/plugins/messengers/feishu/types.js.map +1 -0
- package/dist/plugins/messengers/telegram/index.d.ts +4 -0
- package/dist/plugins/messengers/telegram/index.d.ts.map +1 -0
- package/dist/plugins/messengers/telegram/index.js +4 -0
- package/dist/plugins/messengers/telegram/index.js.map +1 -0
- package/dist/plugins/messengers/telegram/markdown-to-html.d.ts +5 -0
- package/dist/plugins/messengers/telegram/markdown-to-html.d.ts.map +1 -0
- package/dist/plugins/messengers/telegram/markdown-to-html.js +186 -0
- package/dist/plugins/messengers/telegram/markdown-to-html.js.map +1 -0
- package/dist/plugins/messengers/telegram/media-download.d.ts +59 -0
- package/dist/plugins/messengers/telegram/media-download.d.ts.map +1 -0
- package/dist/plugins/messengers/telegram/media-download.js +228 -0
- package/dist/plugins/messengers/telegram/media-download.js.map +1 -0
- package/dist/plugins/messengers/telegram/telegram-adapter.d.ts +77 -0
- package/dist/plugins/messengers/telegram/telegram-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/telegram/telegram-adapter.js +880 -0
- package/dist/plugins/messengers/telegram/telegram-adapter.js.map +1 -0
- package/dist/plugins/messengers/telegram/types.d.ts +47 -0
- package/dist/plugins/messengers/telegram/types.d.ts.map +1 -0
- package/dist/plugins/messengers/telegram/types.js +3 -0
- package/dist/plugins/messengers/telegram/types.js.map +1 -0
- package/dist/plugins/messengers/wechat/context-store.d.ts +18 -0
- package/dist/plugins/messengers/wechat/context-store.d.ts.map +1 -0
- package/dist/plugins/messengers/wechat/context-store.js +105 -0
- package/dist/plugins/messengers/wechat/context-store.js.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-adapter.d.ts +71 -0
- package/dist/plugins/messengers/wechat/ilink-adapter.d.ts.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-adapter.js +664 -0
- package/dist/plugins/messengers/wechat/ilink-adapter.js.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-client.d.ts +75 -0
- package/dist/plugins/messengers/wechat/ilink-client.d.ts.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-client.js +331 -0
- package/dist/plugins/messengers/wechat/ilink-client.js.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-types.d.ts +181 -0
- package/dist/plugins/messengers/wechat/ilink-types.d.ts.map +1 -0
- package/dist/plugins/messengers/wechat/ilink-types.js +22 -0
- package/dist/plugins/messengers/wechat/ilink-types.js.map +1 -0
- package/dist/plugins/messengers/wechat/media-download.d.ts +32 -0
- package/dist/plugins/messengers/wechat/media-download.d.ts.map +1 -0
- package/dist/plugins/messengers/wechat/media-download.js +78 -0
- package/dist/plugins/messengers/wechat/media-download.js.map +1 -0
- package/dist/scripts/migrate-gcj02-to-wgs84.d.ts +3 -0
- package/dist/scripts/migrate-gcj02-to-wgs84.d.ts.map +1 -0
- package/dist/scripts/migrate-gcj02-to-wgs84.js +52 -0
- package/dist/scripts/migrate-gcj02-to-wgs84.js.map +1 -0
- package/dist/utils/backoff.d.ts +35 -0
- package/dist/utils/backoff.d.ts.map +1 -0
- package/dist/utils/backoff.js +59 -0
- package/dist/utils/backoff.js.map +1 -0
- package/dist/utils/cross-platform.d.ts +26 -0
- package/dist/utils/cross-platform.d.ts.map +1 -0
- package/dist/utils/cross-platform.js +58 -0
- package/dist/utils/cross-platform.js.map +1 -0
- package/dist/utils/message-split.d.ts +14 -0
- package/dist/utils/message-split.d.ts.map +1 -0
- package/dist/utils/message-split.js +65 -0
- package/dist/utils/message-split.js.map +1 -0
- package/dist/utils/safe-equal.d.ts +2 -0
- package/dist/utils/safe-equal.d.ts.map +1 -0
- package/dist/utils/safe-equal.js +11 -0
- package/dist/utils/safe-equal.js.map +1 -0
- package/dist/web/public/_app.js +196 -0
- package/dist/web/public/index.html +936 -0
- package/dist/web/public/loc.html +305 -0
- package/dist/web/public/login.html +106 -0
- package/dist/web/public/memos.html +271 -0
- package/dist/web/public/reminders.html +234 -0
- package/dist/web/public/settings.html +1355 -0
- package/dist/web/public/tasks.html +1835 -0
- package/dist/web/server.d.ts +12 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +2399 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +92 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Jerry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
# Agim · 阿吉姆
|
|
2
|
+
|
|
3
|
+
[中文文档](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
**Universal messenger-to-agent bridge** — connect WeChat / Feishu / DingTalk / Telegram / Discord to Claude Code / Codex / Copilot / OpenCode, or any custom agent via ACP. Single Node.js process, no Docker, no Redis.
|
|
6
|
+
|
|
7
|
+
> **Naming**: Agim ⟵ Agent + IM (with a hint of "agile"). Chinese name 阿吉姆.
|
|
8
|
+
> npm package: **`agim-cli`** (the unscoped `agim` is reserved by npm's
|
|
9
|
+
> anti-typosquat policy); the installed binary is **`agim`** — that's what
|
|
10
|
+
> you type. The legacy `im-hub-pro` bin name is kept as an alias so existing
|
|
11
|
+
> systemd units / shell aliases keep working unchanged.
|
|
12
|
+
> On-disk paths default to **`~/.agim/`** for fresh installs but auto-detect
|
|
13
|
+
> and continue using a pre-existing **`~/.im-hub/`** if one is present.
|
|
14
|
+
> Env vars (`IMHUB_*`), HTTP headers (`X-IM-Hub-Token`), and the systemd
|
|
15
|
+
> unit `im-hub.service` retain their legacy names for drop-in compatibility
|
|
16
|
+
> with installations from the 0.x line — see [Migrating](#migrating).
|
|
17
|
+
|
|
18
|
+
## Highlights
|
|
19
|
+
|
|
20
|
+
- **5 messengers + email, 4+ agents** — WeChat (image / file / voice), Feishu, DingTalk (image / voice with server-side ASR), Telegram, Discord, Email (SMTP); Claude Code, Codex, Copilot, OpenCode, plus any ACP endpoint
|
|
21
|
+
- **`/remind` reminders subsystem** — one-shot + recurring (`每天8点喝水`); LLM auto-detects reminder intent in casual chat; LLM polishes delivery; agent MCP tools; web `/reminders` page; email + IM delivery
|
|
22
|
+
- **`/memo` 5W1H persistent memory** — generic "what / who / when / where / how / why" notes with optional GPS capture (browser geolocation H5 + Baidu geocoder); permanent by default, transient bucket for parking spots / today's meeting; agents store + retrieve via MCP tools so casual mentions get remembered automatically
|
|
23
|
+
- **Browser dashboard** — chat UI, tasks panel (jobs / schedules / approvals / health / files / audit), reminders panel, settings page with workspace CRUD
|
|
24
|
+
- **Human-in-the-loop tool approval** — Claude tool calls pause for `y`/`n` in IM or in-page card; works across all platforms
|
|
25
|
+
- **Rich media in WeChat / Telegram / DingTalk** — receive images, files, videos; voice messages transcribed via WeChat STT, DingTalk's server-side ASR, OpenAI Whisper, or whisper.cpp (per-platform fallback chain)
|
|
26
|
+
- **Smart routing** — intent classifier (CJK + ASCII), sticky sessions, circuit breaker, rate limiter
|
|
27
|
+
- **Multi-tenant workspaces** — per-workspace agent whitelist, rate limits, command-level ACL
|
|
28
|
+
- **Persistent jobs & cron** — SQLite-backed, survives restarts, 30-day retention
|
|
29
|
+
- **Observability** — structured logging (pino + traceId), Prometheus metrics, audit log
|
|
30
|
+
- **Security** — timing-safe auth, SSRF guards, credential file permissions, approval socket entropy
|
|
31
|
+
|
|
32
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full version history.
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g agim-cli # Requires Node.js ≥ 18 (≥ 22 LTS recommended)
|
|
38
|
+
|
|
39
|
+
# Configure at least one messenger
|
|
40
|
+
agim # arrow-key wizard (recommended) — picks language,
|
|
41
|
+
# then per-component setup for every messenger / agent
|
|
42
|
+
# — or use the legacy per-component commands below:
|
|
43
|
+
agim config wechat # QR-code login
|
|
44
|
+
agim config feishu # App ID + Secret (no webhook needed)
|
|
45
|
+
agim config dingtalk # ClientID + ClientSecret (Stream-mode bot)
|
|
46
|
+
agim config telegram # @BotFather token
|
|
47
|
+
agim config discord # Bot token; see docs/discord-setup.md
|
|
48
|
+
|
|
49
|
+
# (Optional) Connect a custom remote agent over ACP
|
|
50
|
+
agim config agent
|
|
51
|
+
|
|
52
|
+
# Start the bridge
|
|
53
|
+
agim start
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Web UI at `http://localhost:3000` — chat at `/`, tasks at `/tasks`, settings at `/settings`.
|
|
57
|
+
|
|
58
|
+
### Migrating
|
|
59
|
+
|
|
60
|
+
#### From the original `im-hub`
|
|
61
|
+
```bash
|
|
62
|
+
npm uninstall -g im-hub
|
|
63
|
+
npm install -g agim-cli
|
|
64
|
+
agim start # config, env vars, headers all unchanged
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### From `im-hub-pro` (0.x → 1.0)
|
|
68
|
+
```bash
|
|
69
|
+
npm uninstall -g im-hub-pro
|
|
70
|
+
npm install -g agim-cli
|
|
71
|
+
agim start # same config dir, same env vars, same headers
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The npm package is named `agim-cli` (the unscoped name `agim` is reserved
|
|
75
|
+
by npm's anti-typosquat policy); the **binary** it installs is `agim`,
|
|
76
|
+
which is what you'll actually type. `im-hub-pro` is also retained as a
|
|
77
|
+
binary alias inside the package, so previous shell aliases and systemd
|
|
78
|
+
units that call `im-hub-pro` continue to work without any extra setup.
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
| Category | Details |
|
|
83
|
+
|----------|---------|
|
|
84
|
+
| **Messengers** | WeChat (iLink — image / file / voice / video), Feishu (WebSocket), DingTalk (Stream mode — image / voice with built-in ASR), Telegram (grammy — photo / voice / audio), Discord (discord.js), Email (SMTP, push-only) |
|
|
85
|
+
| **Agents** | Claude Code, Codex, Copilot, OpenCode — all via shared `AgentBase`; any HTTP agent via ACP |
|
|
86
|
+
| **Reminders** | `/remind` slash, LLM intent detection, LLM-polished delivery, MCP tools for agents (claude-code + opencode), web `/reminders` UI |
|
|
87
|
+
| **Web UI** | Chat with streaming, three-state theme (light / dark / system), bilingual (EN / 中文), SSE dashboard |
|
|
88
|
+
| **Tool Approval** | Human-in-the-loop over IM + in-page cards; MCP sidecar for Claude |
|
|
89
|
+
| **Jobs** | Persistent SQLite job board + cron scheduler; batch ops; background task reader |
|
|
90
|
+
| **Routing** | Intent classifier, circuit breaker, rate limiter, sticky sessions, LLM judge fallback |
|
|
91
|
+
| **Workspaces** | Multi-tenant; agent whitelist + rate limits; command-level ACL |
|
|
92
|
+
| **Observability** | pino structured logs, traceId, Prometheus `/api/metrics`, SQLite audit log |
|
|
93
|
+
| **ACP** | Client (connect to remote agents) + Server (Agim itself as an ACP agent) |
|
|
94
|
+
|
|
95
|
+
## CLI Commands
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
agim # Arrow-key wizard (bilingual zh/en) — recommended entry
|
|
99
|
+
agim start # Start the bridge + web UI (foreground)
|
|
100
|
+
agim start --bg # Start as a background daemon
|
|
101
|
+
agim status # Show service status (systemd / bg / fg)
|
|
102
|
+
agim restart # Restart the running service
|
|
103
|
+
agim stop # Stop the running service
|
|
104
|
+
agim uninstall # Uninstall (keeps ~/.im-hub-workspaces/)
|
|
105
|
+
agim config wechat # Configure WeChat
|
|
106
|
+
agim config feishu # Configure Feishu
|
|
107
|
+
agim config dingtalk # Configure DingTalk (Stream-mode internal app)
|
|
108
|
+
agim config telegram # Configure Telegram
|
|
109
|
+
agim config discord # Configure Discord
|
|
110
|
+
agim config claude # Configure Claude Code
|
|
111
|
+
agim config agent # Connect a custom ACP agent
|
|
112
|
+
agim agents # List available agents
|
|
113
|
+
agim messengers # List available messengers
|
|
114
|
+
# (`im-hub-pro …` continues to work as a deprecated alias)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Chat Commands
|
|
118
|
+
|
|
119
|
+
| Command | What it does |
|
|
120
|
+
|---------|-------------|
|
|
121
|
+
| any text | Route to agent (sticky session, intent-classified) |
|
|
122
|
+
| `/<agent> <prompt>` | Switch agent — `/cc`, `/oc`, `/cx`, `/co` |
|
|
123
|
+
| `/new` | New conversation (clear context) |
|
|
124
|
+
| `/model [provider/model]` | View or switch model |
|
|
125
|
+
| `/think on\|off` | Toggle extended thinking |
|
|
126
|
+
| `/remind …` | Reminders — see [Reminders](#reminders) below |
|
|
127
|
+
| `/memo …` | 5W1H persistent memory — see [Memos](#memos) below (aliases `/记`, `/note`) |
|
|
128
|
+
| `/job`, `/cron`, `/audit`, `/stats` | Manage jobs, cron schedules, audit, stats (`/schedule` aliases `/cron` until v0.4.0) |
|
|
129
|
+
| `/router status\|explain` | Inspect routing decisions |
|
|
130
|
+
| `y` / `n` / `批准` / `拒绝` | Approve / deny Claude tool call (or reminder confirmation card) |
|
|
131
|
+
|
|
132
|
+
## Human-in-the-loop Tool Approval
|
|
133
|
+
|
|
134
|
+
When a Claude run tries to use a tool, Agim pauses and sends an approval card:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
🔐 Tool approval request
|
|
138
|
+
Tool: Bash
|
|
139
|
+
Input: {"command":"rm -rf node_modules"}
|
|
140
|
+
Reply y to approve / n to deny (auto-deny in 5 min)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Reply `y` / `n` in IM, or click Allow / Deny in the web UI. Works identically across WeChat, Telegram, Feishu, DingTalk, and Discord. Disable with `IMHUB_APPROVAL_DISABLED=1`.
|
|
144
|
+
|
|
145
|
+
## Reminders
|
|
146
|
+
|
|
147
|
+
Built-in `/remind` subsystem — one-shot or recurring, with three creation paths and three delivery enhancements.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# One-shot
|
|
151
|
+
/remind 2m drink water
|
|
152
|
+
/remind 40秒喝水
|
|
153
|
+
/remind 下午6点下班
|
|
154
|
+
/remind 18:30 出门
|
|
155
|
+
|
|
156
|
+
# Recurring 🔁
|
|
157
|
+
/remind 每5分钟看屏幕外
|
|
158
|
+
/remind 每天早上8点喝水
|
|
159
|
+
/remind 每周一三五9点站会
|
|
160
|
+
/remind 每个工作日18:00下班
|
|
161
|
+
|
|
162
|
+
# Email delivery ✉️ (requires SMTP — see Configuration)
|
|
163
|
+
/remind email me@x.com 8:00 morning briefing
|
|
164
|
+
/remind bindemail me@x.com # bind default → /remind email 每天8点 早安
|
|
165
|
+
/remind unbindemail
|
|
166
|
+
|
|
167
|
+
# Manage
|
|
168
|
+
/remind list
|
|
169
|
+
/remind cancel <id>
|
|
170
|
+
/remind clear
|
|
171
|
+
/remind snooze <id> 5m
|
|
172
|
+
/remind aiwatch on|off # toggle the LLM intent detector
|
|
173
|
+
|
|
174
|
+
# Disable LLM polish for one reminder
|
|
175
|
+
/remind literal 每5分钟 喝水
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Three creation paths** (all land in the same `~/.im-hub/reminders.db`):
|
|
179
|
+
|
|
180
|
+
1. **`/remind` slash** — explicit, structured input
|
|
181
|
+
2. **LLM intent detection** (default-on) — say "明天早上8点提醒我开会" without `/remind`, the bot pops a confirmation card; reply `y` to create
|
|
182
|
+
3. **Agent MCP tools** — claude-code and opencode (stdio) auto-call `create_reminder` when you mention future commitments in chat. Works with opencode (http) too via single-user agent-asserted context
|
|
183
|
+
|
|
184
|
+
**Two delivery enhancements**:
|
|
185
|
+
|
|
186
|
+
- **LLM polish** (default-on): at fire time the active agent rewrites the literal seed text into a natural one-liner ("早上好,记得喝杯水"). Tone constrained: *no flattery, no over-humor, no exaggeration*. Falls back to literal text on agent failure / timeout
|
|
187
|
+
- **Late-delivery tag**: > 1 h overdue gets `⏰ 延迟投递` prefix so users know the bot was offline
|
|
188
|
+
|
|
189
|
+
Manage reminders in the web UI at `/reminders` (status filters, snooze, cancel).
|
|
190
|
+
|
|
191
|
+
Full design: [`docs/architecture/reminders.md`](docs/architecture/reminders.md).
|
|
192
|
+
|
|
193
|
+
## Memos
|
|
194
|
+
|
|
195
|
+
`/memo` is a 5W1H persistent memory database. Every memo can carry any subset of `what` / `who` / `when_at` / `where (lat/lng/label)` / `how` / `why` plus an optional `expires_at` lifecycle. Locations are just one axis — the same store also remembers "我爸生日 5月8日" or "苹果发了 AVP2".
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Slash
|
|
199
|
+
/memo # search hint + recent memos
|
|
200
|
+
/memo list # last 10
|
|
201
|
+
/memo show <id>
|
|
202
|
+
/memo delete <id>
|
|
203
|
+
/memo search 茶馆
|
|
204
|
+
/memo here [备注] # one-shot HTTPS link → browser GPS capture
|
|
205
|
+
/memo 39.9,116.4 家 # raw coords + label
|
|
206
|
+
|
|
207
|
+
# Aliases: /记, /note
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The agent (claude-code / opencode) sees 5 MCP tools and uses them automatically when you mention something worth remembering — no need to invoke a slash:
|
|
211
|
+
|
|
212
|
+
- `save_memo` — extract 5W1H from natural language and store; `address` arg triggers Baidu geocoder
|
|
213
|
+
- `request_location_capture` — return a one-shot H5 link so the user can authorize browser geolocation
|
|
214
|
+
- `search_memos` — multi-field AND-combined retrieval ("我的车在哪")
|
|
215
|
+
- `update_memo` — patch existing entry (e.g. add `where_*` later, or pass `address` to geocode)
|
|
216
|
+
- `delete_memo`
|
|
217
|
+
|
|
218
|
+
**Lifecycle**: memos default to permanent. Agents only set `expires_in_hours` when content is clearly transient ("我把车停这了" / "今天下午3点开会"). A background sweep deletes expired rows.
|
|
219
|
+
|
|
220
|
+
**Time zone**: all times are interpreted as Asia/Shanghai (UTC+8) and stored as bare-local `YYYY-MM-DD HH:MM:SS`. Override with `IMHUB_TZ_OFFSET_HOURS` if your deployment is elsewhere.
|
|
221
|
+
|
|
222
|
+
**Browser GPS capture**: `/memo here` and `request_location_capture` send a one-shot 10-min HTTPS link. Default base URL is `https://agent.iclaw.host`; override with `IMHUB_LOC_BASE_URL=https://your-host` if you want to keep H5 traffic on your own domain.
|
|
223
|
+
|
|
224
|
+
**Address geocoding (optional)**: set `IMHUB_BAIDU_MAP_AK` to a Baidu Maps AK to enable `address: "中关村大街27号"` style inputs in `save_memo` / `update_memo`. Without it, those calls return "geocoding not configured" but raw coords + browser GPS still work. Get a free AK at [lbsyun.baidu.com](https://lbsyun.baidu.com/) → Console → 应用管理 → 创建应用 → 服务端 API. The default key flow doesn't need SN signing; if you enable SN校验 in the console, see notes in `src/core/locations.ts`.
|
|
225
|
+
|
|
226
|
+
## Configuration
|
|
227
|
+
|
|
228
|
+
### Config file
|
|
229
|
+
`~/.im-hub/config.json` (validated by zod at startup):
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"messengers": ["wechat-ilink", "telegram"],
|
|
234
|
+
"agents": ["claude-code", "opencode"],
|
|
235
|
+
"defaultAgent": "claude-code",
|
|
236
|
+
"telegram": { "botToken": "***" },
|
|
237
|
+
"acpAgents": [
|
|
238
|
+
{
|
|
239
|
+
"name": "my-agent",
|
|
240
|
+
"endpoint": "https://api.example.com",
|
|
241
|
+
"auth": { "type": "bearer", "token": "***" }
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"workspaces": [
|
|
245
|
+
{
|
|
246
|
+
"id": "team-data",
|
|
247
|
+
"name": "Data team",
|
|
248
|
+
"agents": ["opencode", "my-agent"],
|
|
249
|
+
"members": ["user-123"],
|
|
250
|
+
"rateLimit": { "rate": 30, "intervalSec": 60, "burst": 60 }
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Email reminders (SMTP)
|
|
257
|
+
|
|
258
|
+
To enable `/remind email …`, set these environment variables before starting:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Required
|
|
262
|
+
export IMHUB_SMTP_HOST=smtp.gmail.com
|
|
263
|
+
export IMHUB_SMTP_USER=you@gmail.com
|
|
264
|
+
export IMHUB_SMTP_PASS=<16-char-app-password> # NOT your normal password
|
|
265
|
+
|
|
266
|
+
# Optional
|
|
267
|
+
export IMHUB_SMTP_PORT=465 # default 465
|
|
268
|
+
export IMHUB_SMTP_FROM=you@gmail.com # default = USER
|
|
269
|
+
export IMHUB_SMTP_SECURE=auto # auto | true | false
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Provider quick reference**:
|
|
273
|
+
|
|
274
|
+
| Provider | HOST | PORT | Notes |
|
|
275
|
+
|----------|------|------|-------|
|
|
276
|
+
| Gmail | `smtp.gmail.com` | 465 | Use [App Password](https://myaccount.google.com/apppasswords) — 2-Step Verification required |
|
|
277
|
+
| QQ Mail | `smtp.qq.com` | 465 | "授权码" (account → POP3/SMTP service) |
|
|
278
|
+
| 163 Mail | `smtp.163.com` | 465 | "授权码" (account → POP3/SMTP/IMAP service) |
|
|
279
|
+
| Outlook | `smtp-mail.outlook.com` | 587 | Set `IMHUB_SMTP_SECURE=false` (STARTTLS) |
|
|
280
|
+
| Custom | any host | any port | Set `SECURE` per provider docs |
|
|
281
|
+
|
|
282
|
+
Without these env vars, the email adapter still loads but `/remind email …` returns "Email adapter not configured" — IM reminders keep working.
|
|
283
|
+
|
|
284
|
+
For systemd, put env in your unit file:
|
|
285
|
+
```ini
|
|
286
|
+
[Service]
|
|
287
|
+
Environment="IMHUB_SMTP_HOST=smtp.gmail.com"
|
|
288
|
+
Environment="IMHUB_SMTP_USER=you@gmail.com"
|
|
289
|
+
Environment="IMHUB_SMTP_PASS=xxxxxxxxxxxxxxxx"
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Other env vars
|
|
293
|
+
|
|
294
|
+
| Env | Default | What it does |
|
|
295
|
+
|-----|---------|-------------|
|
|
296
|
+
| `IMHUB_WEB_BIND` | `127.0.0.1` | Web UI bind address (set `0.0.0.0` to expose; front with HTTPS reverse proxy) |
|
|
297
|
+
| `IMHUB_APPROVAL_DISABLED` | unset | Set `=1` to skip the human-in-the-loop tool approval gate |
|
|
298
|
+
| `IMHUB_OPENCODE_DRIVER` | `stdio` | `http` selects the HTTP driver (faster, but reminder MCP path uses single-user agent-asserted context) |
|
|
299
|
+
| `IMHUB_OPENCODE_GATE` | `medium` | `strict` / `loose` / `none` — opencode permission gate |
|
|
300
|
+
| `IM_HUB_LLM_JUDGE_AGENT` | unset | Agent name used as LLM router fallback judge |
|
|
301
|
+
| `OPENAI_API_KEY` | unset | Enables OpenAI Whisper for voice transcription |
|
|
302
|
+
| `IMHUB_WHISPERCPP_BIN` + `IMHUB_WHISPERCPP_MODEL` | unset | Local Whisper.cpp for voice transcription (no cloud) |
|
|
303
|
+
| `IMHUB_BAIDU_MAP_AK` | unset | Baidu Maps AK; enables `/memo` address-based geocoding. Without it, raw coords + browser GPS still work. |
|
|
304
|
+
| `IMHUB_LOC_BASE_URL` | `https://agent.iclaw.host` | Public HTTPS base URL the `/memo here` H5 capture link points at. Override for self-hosted deployments. |
|
|
305
|
+
| `IMHUB_TZ_OFFSET_HOURS` | `8` | Hours offset from UTC for memo timestamps (Asia/Shanghai default). Change only if your deployment is elsewhere. |
|
|
306
|
+
| `IMHUB_TELEGRAM_COORDS_GCJ02` | unset | Set to `1` to apply GCJ-02 → WGS-84 to Telegram native location/venue messages. Default off (WGS-84 pass-through). Turn on if your Telegram clients are Apple devices in mainland China — iOS Core Location applies the GCJ offset before handing coords to Telegram. |
|
|
307
|
+
| `IMHUB_H5_COORDS_GCJ02` | unset | Set to `1` to apply GCJ-02 → WGS-84 to coords POSTed from `/memo here` H5 capture pages. Default off (WGS-84 pass-through, fits WeChat X5 webview + Android Chrome). Turn on if your users open the H5 link in iOS Safari / iOS WebKit in mainland China. See [`src/core/coord-systems.ts`](src/core/coord-systems.ts) for the full per-platform policy. |
|
|
308
|
+
| `AGIM_HOME` | auto | Per-user state directory. By default Agim picks `~/.agim/` on a fresh install and `~/.im-hub/` on a legacy 0.x install (auto-detected). Set explicitly if you want to pin a location — e.g. on shared machines or for tests. `IMHUB_HOME` is also honored. |
|
|
309
|
+
| `AGIM_WORKSPACES` | auto | Per-agent workspace root. Same dual-detect logic as `AGIM_HOME` (`~/.agim-workspaces/` preferred, `~/.im-hub-workspaces/` if it exists). `IMHUB_WORKSPACES` also honored. |
|
|
310
|
+
|
|
311
|
+
## Architecture
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
┌─ IM ingress ─────────────────────────────────────┐
|
|
315
|
+
│ WeChat iLink (long-poll + image/voice/file) │
|
|
316
|
+
│ Telegram (grammy + photo/voice/audio) │
|
|
317
|
+
│ Feishu (Lark SDK WebSocket) │
|
|
318
|
+
│ DingTalk (Stream WebSocket + ASR baked in) │
|
|
319
|
+
│ Discord (discord.js Gateway) │
|
|
320
|
+
│ Web Chat (browser WebSocket) │
|
|
321
|
+
└───────────────────────┬──────────────────────────┘
|
|
322
|
+
│ MessageContext
|
|
323
|
+
▼
|
|
324
|
+
┌── Pre-route gates ────────────────┐
|
|
325
|
+
│ workspace · rate limiter · traceId │
|
|
326
|
+
└────────────────┬──────────────────┘
|
|
327
|
+
▼
|
|
328
|
+
┌── Intent router ──────────────────┐
|
|
329
|
+
│ command → builtin │
|
|
330
|
+
│ /agent → explicit switch │
|
|
331
|
+
│ default → classify (regex/keyword/ │
|
|
332
|
+
│ sticky/LLM judge) │
|
|
333
|
+
└────────────────┬──────────────────┘
|
|
334
|
+
▼
|
|
335
|
+
┌── Agent invocation ───────────────┐
|
|
336
|
+
│ circuit breaker + spawn stream │
|
|
337
|
+
└───┬──────┬──────┬──────┬──────┬───┘
|
|
338
|
+
▼ ▼ ▼ ▼ ▼
|
|
339
|
+
claude opencode codex copilot ACP
|
|
340
|
+
│
|
|
341
|
+
▼ (tool approval)
|
|
342
|
+
MCP sidecar → approvalBus → IM thread
|
|
343
|
+
|
|
344
|
+
┌─ Cross-cutting ──────────────────────────────────┐
|
|
345
|
+
│ SQLite (audit · jobs · schedules) │
|
|
346
|
+
│ session (append-only JSONL) │
|
|
347
|
+
│ Prometheus metrics · pino structured logging │
|
|
348
|
+
└──────────────────────────────────────────────────┘
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Single process, zero external dependencies — SQLite + session files are the entire persistence layer.
|
|
352
|
+
|
|
353
|
+
For the full deep-dive see [`docs/architecture/current.md`](docs/architecture/current.md).
|
|
354
|
+
|
|
355
|
+
## Requirements
|
|
356
|
+
|
|
357
|
+
- **Node.js ≥ 18** (≥ 22 LTS recommended)
|
|
358
|
+
- At least one agent CLI or ACP endpoint:
|
|
359
|
+
- `npm i -g @anthropic-ai/claude-code`
|
|
360
|
+
- `npm i -g @openai/codex`
|
|
361
|
+
- `npm i -g @github/copilot`
|
|
362
|
+
- `npm i -g opencode-ai`
|
|
363
|
+
|
|
364
|
+
## Development
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
git clone https://github.com/benking007/imhub.git && cd imhub
|
|
368
|
+
npm install
|
|
369
|
+
npm run build # tsc + copy public/
|
|
370
|
+
npm run dev # tsc --watch
|
|
371
|
+
npm test # bun test
|
|
372
|
+
npm run lint # biome lint
|
|
373
|
+
npm run typecheck # tsc --noEmit
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## Deployment
|
|
377
|
+
|
|
378
|
+
See [`docs/deployment.md`](docs/deployment.md) for systemd, Docker, nginx, monitoring, and upgrade instructions.
|
|
379
|
+
|
|
380
|
+
## Roadmap
|
|
381
|
+
|
|
382
|
+
### Done
|
|
383
|
+
|
|
384
|
+
| Version | Theme |
|
|
385
|
+
|---------|-------|
|
|
386
|
+
| v0.1.x | MVP — WeChat + 4 agents + command routing |
|
|
387
|
+
| v0.2.0 | Multi-IM — Feishu, Telegram, sessions, ACP |
|
|
388
|
+
| v0.2.13 | Foundations — logging, audit, intent, jobs, metrics, workspaces |
|
|
389
|
+
| v0.2.14 | Human-in-the-loop tool approval |
|
|
390
|
+
| v0.2.15 | Discord adapter + tasks dashboard |
|
|
391
|
+
| v0.2.16–17 | Security hardening + observability |
|
|
392
|
+
| v0.2.18–19 | IM reconnect backoff, Codex sandbox, dashboard filters |
|
|
393
|
+
| v0.2.20–23 | Web console — theme, approvals, SSE, files, batch ops |
|
|
394
|
+
| v0.2.30 | Production hardening — session isolation, serial WS, loopback bind |
|
|
395
|
+
| v0.2.35 | WeChat & Telegram rich media — image / file / voice / video |
|
|
396
|
+
| v0.2.37 | Reminders subsystem — `/remind`, LLM intent + polish, agent MCP tools, email channel, web `/reminders`, WeChat context_token persistence |
|
|
397
|
+
| v0.3.0 | `/memo` 5W1H persistent memory — `/location` → `/memo` rename, address geocoding via Baidu Maps, opencode HTTP driver SSE drain |
|
|
398
|
+
| v0.3.1 | Native location messages on Telegram + Feishu, GCJ-02 → WGS-84 fix across all ingest paths, `memo` column + LLM/heuristic `what` extractor |
|
|
399
|
+
| v0.4.0 | codex agent now sees the full imhub MCP toolset (reminder + memo); Telegram + Feishu location messages routed through agent-driven decision making (matches WeChat H5 architecture) |
|
|
400
|
+
| v0.5.0–0.5.2 | Bilingual arrow-key `agim` wizard (then `im-hub-pro` pre-rename); per-component flows (QR for WeChat, credentials prompts for Feishu / Telegram / Discord; live install detection for agents); systemd-unit env fallback for SMTP / Baidu prefill; full service lifecycle commands (`status / start --bg / restart / stop / uninstall`) |
|
|
401
|
+
| v0.6.0 | DingTalk Stream-mode adapter — bidirectional bot bridge via WebSocket, image inbound (`messageFiles/download` → claude-code multimodal Read), voice inbound (server-side ASR `recognition` field, whisper.cpp fallback) |
|
|
402
|
+
| v0.6.3 | Per-platform coord-system handling for native location messages (Telegram defaults WGS pass-through; H5 WGS pass-through fixes WeChat-X5 markers; DingTalk routes Baidu link URLs through BD-09→WGS) |
|
|
403
|
+
| **v1.0.0** | Brand rename to **Agim · 阿吉姆**. New canonical bin `agim`; `im-hub-pro` retained as deprecation alias. On-disk paths / env vars / HTTP headers / systemd unit name kept stable for drop-in compat with 0.x installs. |
|
|
404
|
+
|
|
405
|
+
### v1.1.0 (next)
|
|
406
|
+
|
|
407
|
+
- [ ] Slack adapter
|
|
408
|
+
- [ ] Feishu / DingTalk / Discord button-style approval cards
|
|
409
|
+
- [ ] Multi-instance event bus (Redis Streams / NATS)
|
|
410
|
+
- [ ] Workspace member picker UI
|
|
411
|
+
|
|
412
|
+
## Community
|
|
413
|
+
|
|
414
|
+
<p align="center">
|
|
415
|
+
<a href="https://deepseek.club/community/imhub">
|
|
416
|
+
<img src="https://deepseek.club/assets/logo-DH6LfKkF.png" style="width: 150px; height: auto;" alt="DeepSeek">
|
|
417
|
+
</a>
|
|
418
|
+
</p>
|
|
419
|
+
|
|
420
|
+
## License
|
|
421
|
+
|
|
422
|
+
MIT
|