@rubytech/create-maxy-code 0.1.593 → 0.1.594
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/package.json +2 -2
- package/payload/platform/package.json +1 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +5 -3
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +5 -0
- package/payload/platform/plugins/cloudflare/PLUGIN.md +2 -0
- package/payload/platform/plugins/docs/references/internals.md +1 -1
- package/payload/platform/plugins/docs/references/telegram-guide.md +3 -1
- package/payload/platform/scripts/__tests__/agent-identity-reconcile.test.sh +110 -0
- package/payload/platform/scripts/__tests__/check-orphan-dist.test.sh +87 -0
- package/payload/platform/scripts/check-orphan-dist.mjs +143 -0
- package/payload/platform/scripts/lib/agent-identity-reconcile.sh +122 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +8 -26
- package/payload/platform/scripts/setup-account.sh +15 -0
- package/payload/platform/services/claude-session-manager/dist/index.js +5 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +42 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
- package/payload/platform/templates/agents/public/IDENTITY.md +3 -3
- package/payload/platform/lib/anthropic-key/dist/index.d.ts +0 -22
- package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/anthropic-key/dist/index.js +0 -232
- package/payload/platform/lib/anthropic-key/dist/index.js.map +0 -1
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +0 -37
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +0 -1
- package/payload/platform/lib/graph-search/dist/query-expansion.js +0 -101
- package/payload/platform/lib/graph-search/dist/query-expansion.js.map +0 -1
- package/payload/platform/lib/oauth-llm/dist/index.d.ts +0 -116
- package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/oauth-llm/dist/index.js +0 -386
- package/payload/platform/lib/oauth-llm/dist/index.js.map +0 -1
- package/payload/platform/lib/screening-patterns/dist/index.d.ts +0 -29
- package/payload/platform/lib/screening-patterns/dist/index.d.ts.map +0 -1
- package/payload/platform/lib/screening-patterns/dist/index.js +0 -48
- package/payload/platform/lib/screening-patterns/dist/index.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts +0 -2
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js +0 -34
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +0 -39
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +0 -249
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts +0 -6
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts.map +0 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js +0 -32
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +0 -283
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +0 -1155
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +0 -90
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +0 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +0 -551
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +0 -17
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +0 -186
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +0 -29
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js +0 -105
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts +0 -38
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +0 -817
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +0 -30
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +0 -215
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts +0 -19
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js +0 -151
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts +0 -6
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts.map +0 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js +0 -89
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +0 -90
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +0 -226
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +0 -60
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +0 -169
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +0 -248
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +0 -824
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +0 -63
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +0 -210
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +0 -35
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +0 -28
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js +0 -68
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js +0 -88
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js +0 -58
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js +0 -64
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js +0 -70
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js +0 -48
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js +0 -74
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js +0 -47
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js +0 -65
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js +0 -43
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js +0 -65
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js +0 -49
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +0 -79
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +0 -329
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +0 -81
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +0 -34
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +0 -62
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts +0 -61
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +0 -102
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts +0 -35
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js +0 -73
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +0 -29
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +0 -22
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +0 -30
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +0 -130
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +0 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts +0 -65
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +0 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +0 -262
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts +0 -2
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js +0 -100
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/normalise-start-date.test.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts +0 -2
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js +0 -22
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/scheduled-seat-id.test.js.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts +0 -11
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.d.ts.map +0 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js +0 -19
- package/payload/platform/plugins/scheduling/mcp/dist/lib/scheduled-seat-id.js.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts +0 -2
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js +0 -196
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts +0 -70
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js +0 -247
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +0 -21
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +0 -40
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +0 -1
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts +0 -8
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts.map +0 -1
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js +0 -83
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js.map +0 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +0 -151
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts.map +0 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js +0 -299
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts +0 -39
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.js +0 -122
- package/payload/platform/services/claude-session-manager/dist/account-admin-census.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts +0 -39
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js +0 -133
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts +0 -22
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js +0 -50
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts +0 -30
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +0 -204
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts +0 -80
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js +0 -306
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +0 -49
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.js +0 -52
- package/payload/platform/services/claude-session-manager/dist/session-store.js.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts +0 -83
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts.map +0 -1
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js +0 -345
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js.map +0 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +0 -104
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +0 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.js +0 -408
- package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +0 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +0 -104
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +0 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +0 -393
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-seat-id.d.ts","sourceRoot":"","sources":["../../src/lib/scheduled-seat-id.ts"],"names":[],"mappings":"AAEA;;;;;;;;0EAQ0E;AAC1E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAOxH"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
/** Task 1526 — the per-firing scheduled seat id. A recurring agent-bearing
|
|
3
|
-
* :Event that resumed the deterministic adminSessionIdFor(effectiveAccount,
|
|
4
|
-
* destination) seat accreted every firing into one compaction-lossy session.
|
|
5
|
-
* This id salts the seat with the firing's own eventId + dispatchedAt, so each
|
|
6
|
-
* firing is a session id the manager has never seen and spawns FRESH (the
|
|
7
|
-
* manager's resume-vs-fresh decision keys purely on JSONL existence). Same v4
|
|
8
|
-
* shaping as adminSessionIdFor so it satisfies `claude --session-id`, but a
|
|
9
|
-
* distinct hash domain (`:scheduled:`) so it can never collide with a real
|
|
10
|
-
* inbound seat for the same sender. Pure — reproducible and testable. */
|
|
11
|
-
export function scheduledSeatIdFor(accountId, destination, eventId, dispatchedAt) {
|
|
12
|
-
const b = createHash("sha256").update(`${accountId}:scheduled:${destination}:${eventId}:${dispatchedAt}`).digest().subarray(0, 16);
|
|
13
|
-
const v = Buffer.from(b);
|
|
14
|
-
v[6] = (v[6] & 0x0f) | 0x40;
|
|
15
|
-
v[8] = (v[8] & 0x3f) | 0x80;
|
|
16
|
-
const h = v.toString("hex");
|
|
17
|
-
return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20, 32)}`;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=scheduled-seat-id.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-seat-id.js","sourceRoot":"","sources":["../../src/lib/scheduled-seat-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;0EAQ0E;AAC1E,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,WAAmB,EAAE,OAAe,EAAE,YAAoB;IAC9G,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,cAAc,WAAW,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnI,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AACvG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-tool.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/invoice-tool.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, beforeEach } from "vitest";
|
|
2
|
-
import { mkdtempSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { telegramInvoice, INVOICE_METHOD } from "../tools/invoice.js";
|
|
6
|
-
const ACC = "acc-1";
|
|
7
|
-
const BOT = "111";
|
|
8
|
-
let platformRoot;
|
|
9
|
-
let lines;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
const root = mkdtempSync(join(tmpdir(), "brand-"));
|
|
12
|
-
mkdirSync(join(root, "platform"), { recursive: true });
|
|
13
|
-
const dir = join(root, "data", "accounts", ACC);
|
|
14
|
-
mkdirSync(dir, { recursive: true });
|
|
15
|
-
writeFileSync(join(dir, "account.json"), JSON.stringify({ telegram: { bots: [{ id: BOT, role: "admin", token: `${BOT}:SECRET` }] } }), "utf-8");
|
|
16
|
-
platformRoot = join(root, "platform");
|
|
17
|
-
lines = [];
|
|
18
|
-
});
|
|
19
|
-
function recorder(reply) {
|
|
20
|
-
const calls = [];
|
|
21
|
-
const fetchImpl = (async (url, init) => {
|
|
22
|
-
calls.push({
|
|
23
|
-
method: String(url).split("/").pop() ?? "",
|
|
24
|
-
body: JSON.parse(String(init.body)),
|
|
25
|
-
});
|
|
26
|
-
return new Response(JSON.stringify(reply));
|
|
27
|
-
});
|
|
28
|
-
return { calls, fetchImpl };
|
|
29
|
-
}
|
|
30
|
-
function deps(fetchImpl) {
|
|
31
|
-
return {
|
|
32
|
-
platformRoot,
|
|
33
|
-
accountId: ACC,
|
|
34
|
-
callId: "cafe",
|
|
35
|
-
log: (l) => lines.push(l),
|
|
36
|
-
fetchImpl,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
describe("INVOICE_METHOD", () => {
|
|
40
|
-
it("maps every action to its Bot API method name", () => {
|
|
41
|
-
expect(INVOICE_METHOD).toEqual({
|
|
42
|
-
send: "sendInvoice",
|
|
43
|
-
link: "createInvoiceLink",
|
|
44
|
-
answerShipping: "answerShippingQuery",
|
|
45
|
-
answerPreCheckout: "answerPreCheckoutQuery",
|
|
46
|
-
balance: "getMyStarBalance",
|
|
47
|
-
transactions: "getStarTransactions",
|
|
48
|
-
refund: "refundStarPayment",
|
|
49
|
-
editSubscription: "editUserStarSubscription",
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe("telegramInvoice", () => {
|
|
54
|
-
it("sends an invoice with prices as LabeledPrice objects", async () => {
|
|
55
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: { message_id: 1 } });
|
|
56
|
-
const out = await telegramInvoice({
|
|
57
|
-
botId: BOT,
|
|
58
|
-
action: "send",
|
|
59
|
-
chatId: 7,
|
|
60
|
-
title: "Callout",
|
|
61
|
-
description: "Emergency callout",
|
|
62
|
-
payload: "job-4102",
|
|
63
|
-
currency: "XTR",
|
|
64
|
-
prices: [{ label: "Callout", amount: 500 }],
|
|
65
|
-
}, deps(fetchImpl));
|
|
66
|
-
expect(out.outcome).toBe("sent");
|
|
67
|
-
expect(calls[0]?.method).toBe("sendInvoice");
|
|
68
|
-
expect(calls[0]?.body).toEqual({
|
|
69
|
-
chat_id: 7,
|
|
70
|
-
title: "Callout",
|
|
71
|
-
description: "Emergency callout",
|
|
72
|
-
payload: "job-4102",
|
|
73
|
-
currency: "XTR",
|
|
74
|
-
prices: [{ label: "Callout", amount: 500 }],
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
it("refuses an invoice with no prices, before any network call", async () => {
|
|
78
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: {} });
|
|
79
|
-
const out = await telegramInvoice({
|
|
80
|
-
botId: BOT,
|
|
81
|
-
action: "send",
|
|
82
|
-
chatId: 7,
|
|
83
|
-
title: "t",
|
|
84
|
-
description: "d",
|
|
85
|
-
payload: "p",
|
|
86
|
-
currency: "XTR",
|
|
87
|
-
}, deps(fetchImpl));
|
|
88
|
-
expect(out.isError).toBe(true);
|
|
89
|
-
expect(out.text).toContain("prices");
|
|
90
|
-
expect(calls.length).toBe(0);
|
|
91
|
-
});
|
|
92
|
-
it("refuses a send with no chatId, which the link action does not need", async () => {
|
|
93
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: {} });
|
|
94
|
-
const out = await telegramInvoice({
|
|
95
|
-
botId: BOT,
|
|
96
|
-
action: "send",
|
|
97
|
-
title: "t",
|
|
98
|
-
description: "d",
|
|
99
|
-
payload: "p",
|
|
100
|
-
currency: "XTR",
|
|
101
|
-
prices: [{ label: "l", amount: 1 }],
|
|
102
|
-
}, deps(fetchImpl));
|
|
103
|
-
expect(out.isError).toBe(true);
|
|
104
|
-
expect(out.text).toContain("chatId");
|
|
105
|
-
expect(calls.length).toBe(0);
|
|
106
|
-
});
|
|
107
|
-
it("treats ok:false as supplied, not missing", async () => {
|
|
108
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: true });
|
|
109
|
-
const out = await telegramInvoice({
|
|
110
|
-
botId: BOT,
|
|
111
|
-
action: "answerPreCheckout",
|
|
112
|
-
preCheckoutQueryId: "q1",
|
|
113
|
-
ok: false,
|
|
114
|
-
errorMessage: "Out of stock",
|
|
115
|
-
}, deps(fetchImpl));
|
|
116
|
-
expect(out.isError).toBe(false);
|
|
117
|
-
expect(calls[0]?.body).toEqual({
|
|
118
|
-
pre_checkout_query_id: "q1",
|
|
119
|
-
ok: false,
|
|
120
|
-
error_message: "Out of stock",
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
it("sends an empty body for the balance read", async () => {
|
|
124
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: { amount: 42 } });
|
|
125
|
-
await telegramInvoice({ botId: BOT, action: "balance" }, deps(fetchImpl));
|
|
126
|
-
expect(calls[0]?.method).toBe("getMyStarBalance");
|
|
127
|
-
expect(calls[0]?.body).toEqual({});
|
|
128
|
-
});
|
|
129
|
-
it("refuses a refund with no charge id, before any network call", async () => {
|
|
130
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: true });
|
|
131
|
-
const out = await telegramInvoice({ botId: BOT, action: "refund", userId: 5 }, deps(fetchImpl));
|
|
132
|
-
expect(out.isError).toBe(true);
|
|
133
|
-
expect(out.text).toContain("telegramPaymentChargeId");
|
|
134
|
-
expect(calls.length).toBe(0);
|
|
135
|
-
});
|
|
136
|
-
it("treats isCanceled:false as supplied, not missing", async () => {
|
|
137
|
-
const { calls, fetchImpl } = recorder({ ok: true, result: true });
|
|
138
|
-
const out = await telegramInvoice({
|
|
139
|
-
botId: BOT,
|
|
140
|
-
action: "editSubscription",
|
|
141
|
-
userId: 5,
|
|
142
|
-
telegramPaymentChargeId: "c1",
|
|
143
|
-
isCanceled: false,
|
|
144
|
-
}, deps(fetchImpl));
|
|
145
|
-
expect(out.isError).toBe(false);
|
|
146
|
-
expect(calls[0]?.body).toEqual({
|
|
147
|
-
user_id: 5,
|
|
148
|
-
telegram_payment_charge_id: "c1",
|
|
149
|
-
is_canceled: false,
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
it("emits op=invoice outcome=link on a created link, and not on a read", async () => {
|
|
153
|
-
const { fetchImpl } = recorder({ ok: true, result: "https://t.me/invoice/abc" });
|
|
154
|
-
await telegramInvoice({
|
|
155
|
-
botId: BOT,
|
|
156
|
-
action: "link",
|
|
157
|
-
title: "t",
|
|
158
|
-
description: "d",
|
|
159
|
-
payload: "p",
|
|
160
|
-
currency: "XTR",
|
|
161
|
-
prices: [{ label: "l", amount: 1 }],
|
|
162
|
-
}, deps(fetchImpl));
|
|
163
|
-
expect(lines.join("\n")).toContain("op=invoice callId=cafe outcome=link");
|
|
164
|
-
lines.length = 0;
|
|
165
|
-
const second = recorder({ ok: true, result: { amount: 1 } });
|
|
166
|
-
await telegramInvoice({ botId: BOT, action: "balance" }, deps(second.fetchImpl));
|
|
167
|
-
expect(lines.join("\n")).not.toContain("op=invoice");
|
|
168
|
-
});
|
|
169
|
-
it("emits no op=invoice line when Telegram refuses the send", async () => {
|
|
170
|
-
const { fetchImpl } = recorder({
|
|
171
|
-
ok: false,
|
|
172
|
-
error_code: 400,
|
|
173
|
-
description: "Bad Request: CURRENCY_INVALID",
|
|
174
|
-
});
|
|
175
|
-
const out = await telegramInvoice({
|
|
176
|
-
botId: BOT,
|
|
177
|
-
action: "link",
|
|
178
|
-
title: "t",
|
|
179
|
-
description: "d",
|
|
180
|
-
payload: "p",
|
|
181
|
-
currency: "ZZZ",
|
|
182
|
-
prices: [{ label: "l", amount: 1 }],
|
|
183
|
-
}, deps(fetchImpl));
|
|
184
|
-
expect(out.isError).toBe(true);
|
|
185
|
-
expect(out.outcome).toBe("none");
|
|
186
|
-
expect(out.text).toContain("CURRENCY_INVALID");
|
|
187
|
-
expect(lines.join("\n")).not.toContain("op=invoice");
|
|
188
|
-
});
|
|
189
|
-
it("emits a call/result pair sharing one callId", async () => {
|
|
190
|
-
const { fetchImpl } = recorder({ ok: true, result: { amount: 1 } });
|
|
191
|
-
await telegramInvoice({ botId: BOT, action: "balance" }, deps(fetchImpl));
|
|
192
|
-
expect(lines.join("\n")).toContain("op=call tool=telegram-invoice method=getMyStarBalance callId=cafe");
|
|
193
|
-
expect(lines.join("\n")).toContain("op=result callId=cafe");
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
//# sourceMappingURL=invoice-tool.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-tool.test.js","sourceRoot":"","sources":["../../src/__tests__/invoice-tool.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE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" | "answerShipping" | "answerPreCheckout" | "balance" | "transactions" | "refund" | "editSubscription";
|
|
2
|
-
/** Action to Bot API method. Verified against the live parameter tables on
|
|
3
|
-
* 2026-08-08. Exported so the census's owned-method map and this tool cannot
|
|
4
|
-
* disagree about which methods the tool owns. */
|
|
5
|
-
export declare const INVOICE_METHOD: Readonly<Record<InvoiceAction, string>>;
|
|
6
|
-
export interface LabeledPrice {
|
|
7
|
-
label: string;
|
|
8
|
-
amount: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ShippingOptionInput {
|
|
11
|
-
id: string;
|
|
12
|
-
title: string;
|
|
13
|
-
prices: LabeledPrice[];
|
|
14
|
-
}
|
|
15
|
-
export interface InvoiceParams {
|
|
16
|
-
botId: string;
|
|
17
|
-
action: InvoiceAction;
|
|
18
|
-
chatId?: string | number;
|
|
19
|
-
title?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
payload?: string;
|
|
22
|
-
providerToken?: string;
|
|
23
|
-
currency?: string;
|
|
24
|
-
prices?: LabeledPrice[];
|
|
25
|
-
subscriptionPeriod?: number;
|
|
26
|
-
maxTipAmount?: number;
|
|
27
|
-
suggestedTipAmounts?: number[];
|
|
28
|
-
photoUrl?: string;
|
|
29
|
-
needName?: boolean;
|
|
30
|
-
needPhoneNumber?: boolean;
|
|
31
|
-
needEmail?: boolean;
|
|
32
|
-
needShippingAddress?: boolean;
|
|
33
|
-
isFlexible?: boolean;
|
|
34
|
-
shippingQueryId?: string;
|
|
35
|
-
preCheckoutQueryId?: string;
|
|
36
|
-
ok?: boolean;
|
|
37
|
-
shippingOptions?: ShippingOptionInput[];
|
|
38
|
-
errorMessage?: string;
|
|
39
|
-
offset?: number;
|
|
40
|
-
limit?: number;
|
|
41
|
-
userId?: number;
|
|
42
|
-
telegramPaymentChargeId?: string;
|
|
43
|
-
isCanceled?: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface InvoiceDeps {
|
|
46
|
-
platformRoot: string;
|
|
47
|
-
accountId: string | undefined;
|
|
48
|
-
/** Per-invocation id threading one call's lines together. */
|
|
49
|
-
callId: string;
|
|
50
|
-
log: (line: string) => void;
|
|
51
|
-
fetchImpl?: typeof fetch;
|
|
52
|
-
}
|
|
53
|
-
export interface InvoiceResult {
|
|
54
|
-
ok: boolean;
|
|
55
|
-
text: string;
|
|
56
|
-
isError: boolean;
|
|
57
|
-
/** What was created, for the op=invoice line. `none` covers the six actions
|
|
58
|
-
* that create nothing, and any action Telegram refused. */
|
|
59
|
-
outcome: "sent" | "link" | "none";
|
|
60
|
-
}
|
|
61
|
-
/** Invoices and invoice links, the two checkout answers, and the Telegram Stars
|
|
62
|
-
* balance, transaction list, refund and subscription controls.
|
|
63
|
-
*
|
|
64
|
-
* Task 2594: these eight methods were reachable only through telegram-api,
|
|
65
|
-
* whose untyped params object gave the model no field names for any of them.
|
|
66
|
-
*
|
|
67
|
-
* An invoice created and never paid is a business outcome, not a defect, so
|
|
68
|
-
* op=invoice is one line and no alert. */
|
|
69
|
-
export declare function telegramInvoice(p: InvoiceParams, deps: InvoiceDeps): Promise<InvoiceResult>;
|
|
70
|
-
//# sourceMappingURL=invoice.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../src/tools/invoice.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,mBAAmB,GACnB,SAAS,GACT,cAAc,GACd,QAAQ,GACR,kBAAkB,CAAC;AAEvB;;kDAEkD;AAClD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CASjE,CAAC;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd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D,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB;gEAC4D;IAC5D,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACnC;AAwID;;;;;;;2CAO2C;AAC3C,wBAAsB,eAAe,CACnC,CAAC,EAAE,aAAa,EAChB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,aAAa,CAAC,CAkGxB"}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { callBotApi } from "../lib/bot-api.js";
|
|
2
|
-
import { listRegisteredBots, resolveBotToken } from "../lib/account-token.js";
|
|
3
|
-
import { gateChatSend } from "../lib/chat-send-policy.js";
|
|
4
|
-
const TAG = "[telegram-tools]";
|
|
5
|
-
const TOOL = "telegram-invoice";
|
|
6
|
-
/** Action to Bot API method. Verified against the live parameter tables on
|
|
7
|
-
* 2026-08-08. Exported so the census's owned-method map and this tool cannot
|
|
8
|
-
* disagree about which methods the tool owns. */
|
|
9
|
-
export const INVOICE_METHOD = Object.freeze({
|
|
10
|
-
send: "sendInvoice",
|
|
11
|
-
link: "createInvoiceLink",
|
|
12
|
-
answerShipping: "answerShippingQuery",
|
|
13
|
-
answerPreCheckout: "answerPreCheckoutQuery",
|
|
14
|
-
balance: "getMyStarBalance",
|
|
15
|
-
transactions: "getStarTransactions",
|
|
16
|
-
refund: "refundStarPayment",
|
|
17
|
-
editSubscription: "editUserStarSubscription",
|
|
18
|
-
});
|
|
19
|
-
/** The per-action required fields Zod cannot express in one flat shape, refused
|
|
20
|
-
* BEFORE any network call.
|
|
21
|
-
*
|
|
22
|
-
* `ok` and `isCanceled` are tested against undefined rather than falsiness:
|
|
23
|
-
* false is a meaningful answer to both, and `!p.ok` would refuse the very call
|
|
24
|
-
* that declines an order. */
|
|
25
|
-
function missingField(p) {
|
|
26
|
-
switch (p.action) {
|
|
27
|
-
case "send":
|
|
28
|
-
case "link": {
|
|
29
|
-
if (p.action === "send" && p.chatId === undefined) {
|
|
30
|
-
return "send needs `chatId` (the chat the invoice is posted into). Use action `link` for a payable URL with no chat.";
|
|
31
|
-
}
|
|
32
|
-
if (!p.title)
|
|
33
|
-
return `${p.action} needs \`title\` (the product name, 1-32 characters).`;
|
|
34
|
-
if (!p.description) {
|
|
35
|
-
return `${p.action} needs \`description\` (the product description, 1-255 characters).`;
|
|
36
|
-
}
|
|
37
|
-
if (!p.payload) {
|
|
38
|
-
return `${p.action} needs \`payload\` (your own reference, 1-128 bytes, returned to you on payment).`;
|
|
39
|
-
}
|
|
40
|
-
if (!p.currency) {
|
|
41
|
-
return `${p.action} needs \`currency\` (a three-letter ISO 4217 code, or XTR for Telegram Stars).`;
|
|
42
|
-
}
|
|
43
|
-
if (!p.prices?.length) {
|
|
44
|
-
return `${p.action} needs \`prices\` (the price breakdown; exactly one item for Telegram Stars).`;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
case "answerShipping":
|
|
49
|
-
if (!p.shippingQueryId)
|
|
50
|
-
return "answerShipping needs `shippingQueryId`.";
|
|
51
|
-
if (p.ok === undefined) {
|
|
52
|
-
return "answerShipping needs `ok`: true with `shippingOptions`, or false with `errorMessage`.";
|
|
53
|
-
}
|
|
54
|
-
if (p.ok && !p.shippingOptions?.length) {
|
|
55
|
-
return "answerShipping with ok true needs `shippingOptions`.";
|
|
56
|
-
}
|
|
57
|
-
if (!p.ok && !p.errorMessage) {
|
|
58
|
-
return "answerShipping with ok false needs `errorMessage`, which Telegram shows the payer.";
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
case "answerPreCheckout":
|
|
62
|
-
if (!p.preCheckoutQueryId)
|
|
63
|
-
return "answerPreCheckout needs `preCheckoutQueryId`.";
|
|
64
|
-
if (p.ok === undefined) {
|
|
65
|
-
return "answerPreCheckout needs `ok`: true to proceed, or false with `errorMessage`.";
|
|
66
|
-
}
|
|
67
|
-
if (!p.ok && !p.errorMessage) {
|
|
68
|
-
return "answerPreCheckout with ok false needs `errorMessage`, which Telegram shows the payer.";
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
case "balance":
|
|
72
|
-
case "transactions":
|
|
73
|
-
return null;
|
|
74
|
-
case "refund":
|
|
75
|
-
case "editSubscription": {
|
|
76
|
-
if (p.userId === undefined)
|
|
77
|
-
return `${p.action} needs \`userId\` (the payer's numeric id).`;
|
|
78
|
-
if (!p.telegramPaymentChargeId) {
|
|
79
|
-
return `${p.action} needs \`telegramPaymentChargeId\` (Telegram's own id for the payment).`;
|
|
80
|
-
}
|
|
81
|
-
if (p.action === "editSubscription" && p.isCanceled === undefined) {
|
|
82
|
-
return "editSubscription needs `isCanceled`: true stops the renewal, false re-enables it.";
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/** The product fields sendInvoice and createInvoiceLink share. One definition,
|
|
89
|
-
* because an invoice and its link describing different products would be a
|
|
90
|
-
* difference nobody intended. */
|
|
91
|
-
function productBody(p) {
|
|
92
|
-
return {
|
|
93
|
-
title: p.title,
|
|
94
|
-
description: p.description,
|
|
95
|
-
payload: p.payload,
|
|
96
|
-
...(p.providerToken !== undefined ? { provider_token: p.providerToken } : {}),
|
|
97
|
-
currency: p.currency,
|
|
98
|
-
prices: p.prices,
|
|
99
|
-
...(p.maxTipAmount !== undefined ? { max_tip_amount: p.maxTipAmount } : {}),
|
|
100
|
-
...(p.suggestedTipAmounts !== undefined
|
|
101
|
-
? { suggested_tip_amounts: p.suggestedTipAmounts }
|
|
102
|
-
: {}),
|
|
103
|
-
...(p.photoUrl !== undefined ? { photo_url: p.photoUrl } : {}),
|
|
104
|
-
...(p.needName !== undefined ? { need_name: p.needName } : {}),
|
|
105
|
-
...(p.needPhoneNumber !== undefined ? { need_phone_number: p.needPhoneNumber } : {}),
|
|
106
|
-
...(p.needEmail !== undefined ? { need_email: p.needEmail } : {}),
|
|
107
|
-
...(p.needShippingAddress !== undefined
|
|
108
|
-
? { need_shipping_address: p.needShippingAddress }
|
|
109
|
-
: {}),
|
|
110
|
-
...(p.isFlexible !== undefined ? { is_flexible: p.isFlexible } : {}),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function bodyFor(p) {
|
|
114
|
-
switch (p.action) {
|
|
115
|
-
case "send":
|
|
116
|
-
return { chat_id: p.chatId, ...productBody(p) };
|
|
117
|
-
case "link":
|
|
118
|
-
return {
|
|
119
|
-
...productBody(p),
|
|
120
|
-
...(p.subscriptionPeriod !== undefined
|
|
121
|
-
? { subscription_period: p.subscriptionPeriod }
|
|
122
|
-
: {}),
|
|
123
|
-
};
|
|
124
|
-
case "answerShipping":
|
|
125
|
-
return {
|
|
126
|
-
shipping_query_id: p.shippingQueryId,
|
|
127
|
-
ok: p.ok,
|
|
128
|
-
...(p.shippingOptions !== undefined ? { shipping_options: p.shippingOptions } : {}),
|
|
129
|
-
...(p.errorMessage !== undefined ? { error_message: p.errorMessage } : {}),
|
|
130
|
-
};
|
|
131
|
-
case "answerPreCheckout":
|
|
132
|
-
return {
|
|
133
|
-
pre_checkout_query_id: p.preCheckoutQueryId,
|
|
134
|
-
ok: p.ok,
|
|
135
|
-
...(p.errorMessage !== undefined ? { error_message: p.errorMessage } : {}),
|
|
136
|
-
};
|
|
137
|
-
case "balance":
|
|
138
|
-
return {};
|
|
139
|
-
case "transactions":
|
|
140
|
-
return {
|
|
141
|
-
...(p.offset !== undefined ? { offset: p.offset } : {}),
|
|
142
|
-
...(p.limit !== undefined ? { limit: p.limit } : {}),
|
|
143
|
-
};
|
|
144
|
-
case "refund":
|
|
145
|
-
return { user_id: p.userId, telegram_payment_charge_id: p.telegramPaymentChargeId };
|
|
146
|
-
case "editSubscription":
|
|
147
|
-
return {
|
|
148
|
-
user_id: p.userId,
|
|
149
|
-
telegram_payment_charge_id: p.telegramPaymentChargeId,
|
|
150
|
-
is_canceled: p.isCanceled,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/** Invoices and invoice links, the two checkout answers, and the Telegram Stars
|
|
155
|
-
* balance, transaction list, refund and subscription controls.
|
|
156
|
-
*
|
|
157
|
-
* Task 2594: these eight methods were reachable only through telegram-api,
|
|
158
|
-
* whose untyped params object gave the model no field names for any of them.
|
|
159
|
-
*
|
|
160
|
-
* An invoice created and never paid is a business outcome, not a defect, so
|
|
161
|
-
* op=invoice is one line and no alert. */
|
|
162
|
-
export async function telegramInvoice(p, deps) {
|
|
163
|
-
const { callId, log } = deps;
|
|
164
|
-
if (!deps.accountId) {
|
|
165
|
-
log(`${TAG} op=no-account callId=${callId} tool=${TOOL}`);
|
|
166
|
-
return {
|
|
167
|
-
ok: false,
|
|
168
|
-
isError: true,
|
|
169
|
-
outcome: "none",
|
|
170
|
-
text: "telegram-invoice cannot execute: this MCP instance was launched without ACCOUNT_ID " +
|
|
171
|
-
"(plugin-system metadata-only mode).",
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
const missing = missingField(p);
|
|
175
|
-
if (missing) {
|
|
176
|
-
log(`${TAG} op=refused callId=${callId} tool=${TOOL} action=${p.action} reason=missing-field`);
|
|
177
|
-
return { ok: false, isError: true, outcome: "none", text: missing };
|
|
178
|
-
}
|
|
179
|
-
const token = resolveBotToken(deps.platformRoot, deps.accountId, p.botId);
|
|
180
|
-
if (!token) {
|
|
181
|
-
const known = listRegisteredBots(deps.platformRoot, deps.accountId);
|
|
182
|
-
log(`${TAG} op=no-bot callId=${callId} tool=${TOOL} account=${deps.accountId} botId=${p.botId} registered=${known.length}`);
|
|
183
|
-
return {
|
|
184
|
-
ok: false,
|
|
185
|
-
isError: true,
|
|
186
|
-
outcome: "none",
|
|
187
|
-
text: known.length
|
|
188
|
-
? `No bot "${p.botId}" is registered on this account. Registered: ${known
|
|
189
|
-
.map((b) => `${b.id} (${b.role})`)
|
|
190
|
-
.join(", ")}.`
|
|
191
|
-
: "No Telegram bot is registered on this account. Run the telegram:configure skill first.",
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
// Task 2617 — guarded on PRESENCE, because `action: 'link'` mints a payable URL
|
|
195
|
-
// and posts to no chat at all. Gating an absent chat id would refuse an action
|
|
196
|
-
// that reaches nobody.
|
|
197
|
-
if (p.chatId !== undefined) {
|
|
198
|
-
const gate = gateChatSend({
|
|
199
|
-
platformRoot: deps.platformRoot,
|
|
200
|
-
accountId: deps.accountId,
|
|
201
|
-
botId: p.botId,
|
|
202
|
-
chatId: p.chatId,
|
|
203
|
-
log,
|
|
204
|
-
});
|
|
205
|
-
if (!gate.allowed)
|
|
206
|
-
return { ok: false, isError: true, outcome: "none", text: gate.text };
|
|
207
|
-
}
|
|
208
|
-
const method = INVOICE_METHOD[p.action];
|
|
209
|
-
log(`${TAG} op=call tool=${TOOL} method=${method} callId=${callId} botId=${p.botId}`);
|
|
210
|
-
let envelope;
|
|
211
|
-
try {
|
|
212
|
-
envelope = await callBotApi(token, method, bodyFor(p), {
|
|
213
|
-
...(deps.fetchImpl ? { fetchImpl: deps.fetchImpl } : {}),
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
catch (err) {
|
|
217
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
218
|
-
log(`${TAG} op=error callId=${callId} tool=${TOOL} method=${method} reason="${reason}"`);
|
|
219
|
-
return {
|
|
220
|
-
ok: false,
|
|
221
|
-
isError: true,
|
|
222
|
-
outcome: "none",
|
|
223
|
-
text: `telegram-invoice could not reach Telegram: ${reason}`,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
log(`${TAG} op=result callId=${callId} tool=${TOOL} method=${method} ok=${envelope.ok} ` +
|
|
227
|
-
`errorCode=${envelope.error_code ?? "-"} description="${envelope.description ?? ""}"`);
|
|
228
|
-
if (!envelope.ok) {
|
|
229
|
-
return {
|
|
230
|
-
ok: false,
|
|
231
|
-
isError: true,
|
|
232
|
-
outcome: "none",
|
|
233
|
-
text: `Telegram refused ${method} (${envelope.error_code ?? "no code"}): ${envelope.description ?? "no description"}`,
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
const outcome = p.action === "send" ? "sent" : p.action === "link" ? "link" : "none";
|
|
237
|
-
if (outcome !== "none") {
|
|
238
|
-
log(`${TAG} op=invoice callId=${callId} outcome=${outcome}`);
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
ok: true,
|
|
242
|
-
isError: false,
|
|
243
|
-
outcome,
|
|
244
|
-
text: JSON.stringify(envelope.result ?? true, null, 2),
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=invoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../src/tools/invoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAC/B,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAYhC;;kDAEkD;AAClD,MAAM,CAAC,MAAM,cAAc,GAA4C,MAAM,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,mBAAmB;IACzB,cAAc,EAAE,qBAAqB;IACrC,iBAAiB,EAAE,wBAAwB;IAC3C,OAAO,EAAE,kBAAkB;IAC3B,YAAY,EAAE,qBAAqB;IACnC,MAAM,EAAE,mBAAmB;IAC3B,gBAAgB,EAAE,0BAA0B;CAC7C,CAAC,CAAC;AA8DH;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KAAK,QAAQ,CAAC,UAAU,IAAI,SAAS,MAAM,QAAQ,CAAC,WAAW,IAAI,gBAAgB,EAAE;SACtH,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GACX,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACvE,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,GAAG,CAAC,GAAG,GAAG,sBAAsB,MAAM,YAAY,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,OAAO,EAAE,KAAK;QACd,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;KACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type InlineKeyboardButtonInput } from "../lib/telegram.js";
|
|
2
|
-
interface MessageParams {
|
|
3
|
-
channel: "telegram";
|
|
4
|
-
/** Task 2368 — which registered bot to send as. An account holds N bots, each
|
|
5
|
-
* with its own token, so "the account's token" is no longer a thing that can
|
|
6
|
-
* be resolved without naming one. */
|
|
7
|
-
botId: string;
|
|
8
|
-
chatId: string | number;
|
|
9
|
-
text: string;
|
|
10
|
-
parseMode?: "HTML" | "Markdown" | "MarkdownV2";
|
|
11
|
-
inlineKeyboard?: InlineKeyboardButtonInput[][];
|
|
12
|
-
}
|
|
13
|
-
interface MessageResult {
|
|
14
|
-
sent: boolean;
|
|
15
|
-
channel: string;
|
|
16
|
-
messageId?: number;
|
|
17
|
-
error?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function message(params: MessageParams): Promise<MessageResult>;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tools/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAG5B,UAAU,aAAa;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB;;0CAEsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;IAC/C,cAAc,CAAC,EAAE,yBAAyB,EAAE,EAAE,CAAC;CAChD;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAwC3E"}
|