@rubytech/create-maxy-code 0.1.38 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/onboarding-state-readback.test.js +61 -0
- package/dist/index.js +35 -101
- package/dist/onboarding-readback.js +27 -0
- package/dist/uninstall.js +11 -102
- package/package.json +1 -1
- package/payload/platform/lib/anthropic-key/dist/index.d.ts +22 -0
- package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/anthropic-key/dist/index.js +232 -0
- package/payload/platform/lib/anthropic-key/dist/index.js.map +1 -0
- package/payload/platform/package-lock.json +513 -753
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +39 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +249 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +1 -0
- package/payload/platform/plugins/docs/references/deployment.md +7 -3
- package/payload/platform/plugins/docs/references/platform.md +1 -1
- package/payload/platform/plugins/real-agency/plugins/.claude-plugin/marketplace.json +13 -0
- package/payload/platform/plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js +293 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +88 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +35 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +14 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +60 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +87 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +11 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +41 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +49 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +32 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.js +6 -1
- package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.d.ts +7 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.js +90 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +62 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +22 -2
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +3 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +10 -3
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +54 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js +111 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +4 -2
- package/payload/platform/templates/agents/admin/SOUL.md +8 -14
- package/payload/premium-plugins/real-agency/plugins/.claude-plugin/marketplace.json +13 -0
- package/payload/premium-plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +17 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +2 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js +293 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +88 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +35 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +14 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +60 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +87 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +41 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +49 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +32 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
- package/payload/server/{chunk-NNHHGQJL.js → chunk-4P2MPERV.js} +6 -163
- package/payload/server/{chunk-3G6JMV7N.js → chunk-MEGIQYUD.js} +1 -1
- package/payload/server/{chunk-QC5LHYPH.js → chunk-XJVJ2B2Q.js} +1 -1
- package/payload/server/{cloudflare-task-tracker-NEB3X6O2.js → cloudflare-task-tracker-R6MMORFU.js} +2 -2
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/public/assets/{Checkbox-DAki3vDW.js → Checkbox-6lLDKzMP.js} +1 -1
- package/payload/server/public/assets/{admin-CyAZtsYZ.js → admin-DO9W2D9g.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-C-hla3Ip.js → architectureDiagram-Q4EWVU46-BbLtk_k6.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-CbzjtNs3.js → blockDiagram-DXYQGD6D-B9IgcgeJ.js} +1 -1
- package/payload/server/public/assets/{brand-Cun0PBrA.css → brand-DQrOw38P.css} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-B87UblA0.js → c4Diagram-AHTNJAMY-BrvPS09f.js} +1 -1
- package/payload/server/public/assets/channel-Bmc1qlCD.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-2a2pVlSg.js → chunk-336JU56O-DXOr0ZnC.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-j9NOD8_a.js → chunk-426QAEUC-BFW4zwrV.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-Cs872xAq.js → chunk-4TB4RGXK-D7_xc8xf.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-BnDFbZ_I.js → chunk-5FUZZQ4R-CdCSpb8j.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-Bu5B3Hyf.js → chunk-5PVQY5BW-BVgnD9QR.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-B96Fw4FF.js → chunk-EDXVE4YY-CYrT1Tom.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-CcGrGQim.js → chunk-ENJZ2VHE-B70d0jN7.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-ZRvcI4Ai.js → chunk-ICPOFSXX-BcLouRbd.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-B6RI9Fbf.js → chunk-OYMX7WX6-C2ja2fPj.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-BYGHVYyo.js → chunk-U2HBQHQK-CCjoTpL6.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-rwNs-gTO.js → chunk-X2U36JSP-QIVkp-XR.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-jPttJRap.js → chunk-YZCP3GAM-qD9rebhx.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-DLykWOT5.js → chunk-ZZ45TVLE-C0J_f05H.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-RVZorqSk.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BEZem5bl.js +1 -0
- package/payload/server/public/assets/clone-B6eXIhiR.js +1 -0
- package/payload/server/public/assets/{dagre-jnQDnF-5.js → dagre-B3cA7jId.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-C6wSzHX2.js → dagre-KV5264BT-C8lVFO5U.js} +1 -1
- package/payload/server/public/assets/data-BaSmBQ7U.js +1 -0
- package/payload/server/public/assets/{device-url-actions-y1tXNDZx.js → device-url-actions-qu2-XiHc.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-N3X-n90h.js → diagram-5BDNPKRD-BYkcTelK.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-vfmbzdPd.js → diagram-G4DWMVQ6-B6f_WR4j.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-BETmPx_w.js → diagram-MMDJMWI5-ALaKcN6w.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-BSUGM4wG.js → diagram-TYMM5635-CkVg3crF.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-CWZ9OwMb.js → erDiagram-SMLLAGMA-DszlTGIQ.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-BpQOQS1a.js → flowDiagram-DWJPFMVM-C9-FqSlk.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-Dc59igCS.js → ganttDiagram-T4ZO3ILL-faJU-5Zy.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-D6lXg3zl.js → gitGraphDiagram-UUTBAWPF-Cck8_tiG.js} +1 -1
- package/payload/server/public/assets/{graph-labels-DFyNH0jb.js → graph-labels-COhLbJD0.js} +1 -1
- package/payload/server/public/assets/graph-qg6fkRyC.js +1 -0
- package/payload/server/public/assets/{graphlib-yG7kH8Fr.js → graphlib-CYRxeBXj.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-TS9Pv8Os.js → infoDiagram-42DDH7IO-CLjEjhJX.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-BJiJJTq6.js → ishikawaDiagram-UXIWVN3A-nSIaVXdw.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-C7PW4fmw.js → journeyDiagram-VCZTEJTY-DuKq7d3g.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-BEk21ciD.js → kanban-definition-6JOO6SKY-Bt5xqHfY.js} +1 -1
- package/payload/server/public/assets/{line-DusyVWDE.js → line-BgV8qCP_.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-DeeojQSb.js → mermaid-parser.core-DQzl__pY.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-p65Lo7Sj.js → mermaid.core-BAPEOjwh.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-B0jxFxdS.js → mindmap-definition-QFDTVHPH-CmMBrI79.js} +1 -1
- package/payload/server/public/assets/{page-x5khmfRx.js → page-BoDdtGsH.js} +1 -1
- package/payload/server/public/assets/{page-BeYGnDzI.js → page-D_NCNi5j.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-DJ5GKYt6.js → pieDiagram-DEJITSTG-BhsR9k6j.js} +1 -1
- package/payload/server/public/assets/{public-cnoUs7vq.js → public-DCcGKIMW.js} +4 -4
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-BV7R-kwV.js → quadrantDiagram-34T5L4WZ-DSKV6d_A.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-DRiLzlGN.js → requirementDiagram-MS252O5E-BccM48AI.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-C5-6_cCI.js → sankeyDiagram-XADWPNL6-C0pxiQfn.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-5FXm_VYM.js → sequenceDiagram-FGHM5R23-BVsUIJsW.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-FCQTaGqV.js → stateDiagram-FHFEXIEX-lqYQZ-F1.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-D2eHThhC.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-tvtq62ef.js → timeline-definition-GMOUNBTQ-D-LxYOHq.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-Dk-k7CE4.js → vennDiagram-DHZGUBPP-BNHzvNba.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-CZSrqniY.js → wardleyDiagram-NUSXRM2D-BfXR9l5s.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-CpGLpk7Q.js → xychartDiagram-5P7HB3ND-CL7mVEbT.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +981 -859
- package/payload/server/public/assets/channel-CTNo72W7.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-BaV5nDmT.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DOKlCKjY.js +0 -1
- package/payload/server/public/assets/clone-sQSwlSln.js +0 -1
- package/payload/server/public/assets/data-DbkuXcPb.js +0 -1
- package/payload/server/public/assets/graph-CC5_6-dg.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BdpPhdqg.js +0 -1
- /package/payload/server/public/assets/{brand-lj7EhWRg.js → brand-Bky-hMVw.js} +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralised Anthropic API key management.
|
|
4
|
+
*
|
|
5
|
+
* Provides read/write/validate operations for the Anthropic API key
|
|
6
|
+
* used by the public agent. All consumers import from this module
|
|
7
|
+
* instead of inlining the env-var-then-file lookup pattern.
|
|
8
|
+
*
|
|
9
|
+
* Follows the same shape as cloudflare/mcp/src/lib/cloudflared.ts
|
|
10
|
+
* (readToken, writeToken, hasToken, validateToken).
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.readKey = readKey;
|
|
14
|
+
exports.writeKey = writeKey;
|
|
15
|
+
exports.hasKey = hasKey;
|
|
16
|
+
exports.deleteKey = deleteKey;
|
|
17
|
+
exports.validateKey = validateKey;
|
|
18
|
+
exports.keyFilePath = keyFilePath;
|
|
19
|
+
const index_js_1 = require("../../models/dist/index.js");
|
|
20
|
+
const node_fs_1 = require("node:fs");
|
|
21
|
+
const node_path_1 = require("node:path");
|
|
22
|
+
const node_os_1 = require("node:os");
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Path resolution — lazy, cached
|
|
25
|
+
//
|
|
26
|
+
// The key file lives at ~/{configDir}/.anthropic-api-key where configDir
|
|
27
|
+
// is read from brand.json. Resolution strategy:
|
|
28
|
+
// 1. PLATFORM_ROOT env var → brand.json → configDir (MCP servers)
|
|
29
|
+
// 2. MAXY_PLATFORM_ROOT env var → brand.json → configDir (UI/Next.js)
|
|
30
|
+
// 3. Fall back to .maxy (dev environment, neither env var set)
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
let cachedKeyFilePath = null;
|
|
33
|
+
function resolveKeyFilePath() {
|
|
34
|
+
if (cachedKeyFilePath)
|
|
35
|
+
return cachedKeyFilePath;
|
|
36
|
+
let configDirName = ".maxy"; // default for dev
|
|
37
|
+
const platformRoot = process.env.PLATFORM_ROOT ?? process.env.MAXY_PLATFORM_ROOT;
|
|
38
|
+
if (platformRoot) {
|
|
39
|
+
const brandPath = (0, node_path_1.join)(platformRoot, "config", "brand.json");
|
|
40
|
+
if (!(0, node_fs_1.existsSync)(brandPath)) {
|
|
41
|
+
throw new Error(`brand.json not found at ${brandPath} — platform not properly installed`);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const brand = JSON.parse((0, node_fs_1.readFileSync)(brandPath, "utf-8"));
|
|
45
|
+
if (!brand.configDir) {
|
|
46
|
+
throw new Error(`brand.json at ${brandPath} is missing the configDir field`);
|
|
47
|
+
}
|
|
48
|
+
configDirName = brand.configDir;
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
if (err instanceof SyntaxError) {
|
|
52
|
+
throw new Error(`brand.json at ${brandPath} is not valid JSON: ${err.message}`);
|
|
53
|
+
}
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
cachedKeyFilePath = (0, node_path_1.resolve)((0, node_os_1.homedir)(), configDirName, ".anthropic-api-key");
|
|
58
|
+
return cachedKeyFilePath;
|
|
59
|
+
}
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// readKey — two-tier lookup: env var → file
|
|
62
|
+
//
|
|
63
|
+
// Returns the key string or null if unavailable. Never throws on
|
|
64
|
+
// missing/unreadable key — callers handle null per their context.
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
function readKey() {
|
|
67
|
+
const envKey = process.env.ANTHROPIC_API_KEY;
|
|
68
|
+
if (envKey && envKey.trim()) {
|
|
69
|
+
return envKey.trim();
|
|
70
|
+
}
|
|
71
|
+
let keyFilePath;
|
|
72
|
+
try {
|
|
73
|
+
keyFilePath = resolveKeyFilePath();
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
77
|
+
console.error(`[anthropic-key] path resolution failed: ${msg}`);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
if (envKey !== undefined) {
|
|
81
|
+
// env var was set but empty — log and fall through to file
|
|
82
|
+
console.error(`[anthropic-key] ANTHROPIC_API_KEY env var is set but empty, falling back to file`);
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const raw = (0, node_fs_1.readFileSync)(keyFilePath, "utf-8").trim();
|
|
86
|
+
if (!raw) {
|
|
87
|
+
console.error(`[anthropic-key] key file exists but is empty: ${keyFilePath}`);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return raw;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
const code = err instanceof Error && "code" in err
|
|
94
|
+
? err.code
|
|
95
|
+
: undefined;
|
|
96
|
+
if (code === "ENOENT") {
|
|
97
|
+
// File does not exist — expected on fresh installs
|
|
98
|
+
console.error(`[anthropic-key] no key available (env var unset, file not found: ${keyFilePath})`);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
102
|
+
console.error(`[anthropic-key] failed to read key file ${keyFilePath}: ${msg}`);
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// writeKey — validate format and write with restricted permissions
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
function writeKey(key) {
|
|
111
|
+
const trimmed = key.trim();
|
|
112
|
+
if (!trimmed.startsWith("sk-ant-")) {
|
|
113
|
+
throw new Error("Invalid key format. Must start with sk-ant-.");
|
|
114
|
+
}
|
|
115
|
+
if (trimmed.length < 90) {
|
|
116
|
+
throw new Error("Invalid key format. Must be at least 90 characters.");
|
|
117
|
+
}
|
|
118
|
+
const keyFilePath = resolveKeyFilePath();
|
|
119
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(keyFilePath), { recursive: true });
|
|
120
|
+
(0, node_fs_1.writeFileSync)(keyFilePath, trimmed, { mode: 0o600 });
|
|
121
|
+
console.error(`[anthropic-key] key written to ${keyFilePath}`);
|
|
122
|
+
}
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
// hasKey — thin check, no validation
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
function hasKey() {
|
|
127
|
+
return readKey() !== null;
|
|
128
|
+
}
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// deleteKey — remove the stored key file; idempotent on ENOENT
|
|
131
|
+
//
|
|
132
|
+
// Throws on unexpected fs errors (EACCES, EBUSY, EPERM) so callers can
|
|
133
|
+
// surface a structured failure. ENOENT is treated as a no-op because the
|
|
134
|
+
// intended post-condition ("no key file on disk") is already satisfied.
|
|
135
|
+
// Per Task 531 learning, never use `{ force: true }` — it swallows the
|
|
136
|
+
// error classes that matter (permission, busy) and leaves the caller
|
|
137
|
+
// believing removal succeeded.
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
function deleteKey() {
|
|
140
|
+
const keyFilePath = resolveKeyFilePath();
|
|
141
|
+
try {
|
|
142
|
+
(0, node_fs_1.unlinkSync)(keyFilePath);
|
|
143
|
+
console.error(`[anthropic-key] deleteKey: removed ${keyFilePath}`);
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
const code = err instanceof Error && "code" in err
|
|
147
|
+
? err.code
|
|
148
|
+
: undefined;
|
|
149
|
+
if (code === "ENOENT") {
|
|
150
|
+
console.error(`[anthropic-key] deleteKey: nothing to remove (ENOENT): ${keyFilePath}`);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
154
|
+
console.error(`[anthropic-key] deleteKey: failed to remove ${keyFilePath}: ${msg}`);
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async function validateKey(key) {
|
|
159
|
+
const effectiveKey = key ?? readKey();
|
|
160
|
+
if (!effectiveKey) {
|
|
161
|
+
return {
|
|
162
|
+
status: "missing",
|
|
163
|
+
message: "No API key available (env var unset, file missing or empty).",
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const start = Date.now();
|
|
167
|
+
try {
|
|
168
|
+
const res = await fetch("https://api.anthropic.com/v1/messages", {
|
|
169
|
+
method: "POST",
|
|
170
|
+
headers: {
|
|
171
|
+
"Content-Type": "application/json",
|
|
172
|
+
"x-api-key": effectiveKey,
|
|
173
|
+
"anthropic-version": "2023-06-01",
|
|
174
|
+
},
|
|
175
|
+
body: JSON.stringify({
|
|
176
|
+
model: index_js_1.HAIKU_MODEL,
|
|
177
|
+
max_tokens: 1,
|
|
178
|
+
messages: [{ role: "user", content: "hi" }],
|
|
179
|
+
}),
|
|
180
|
+
signal: AbortSignal.timeout(10000),
|
|
181
|
+
});
|
|
182
|
+
const latency = Date.now() - start;
|
|
183
|
+
if (res.ok || res.status === 429) {
|
|
184
|
+
// Consume the response body to release the connection back to the pool.
|
|
185
|
+
await res.text();
|
|
186
|
+
console.error(`[anthropic-key] validate: valid (${res.status}, ${latency}ms)`);
|
|
187
|
+
return {
|
|
188
|
+
status: "valid",
|
|
189
|
+
message: "API key is working. Credits available.",
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const body = await res.text();
|
|
193
|
+
if (/credit balance|billing|purchase credits/i.test(body)) {
|
|
194
|
+
console.error(`[anthropic-key] validate: billing (${res.status}, ${latency}ms)`);
|
|
195
|
+
return {
|
|
196
|
+
status: "billing",
|
|
197
|
+
message: "API key is valid but credit balance is too low. The user must add credits at console.anthropic.com under Plans & Billing, or enable auto-top-up.",
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (res.status === 401 ||
|
|
201
|
+
res.status === 403 ||
|
|
202
|
+
/authentication_error|permission_error/i.test(body)) {
|
|
203
|
+
console.error(`[anthropic-key] validate: auth_error (${res.status}, ${latency}ms)`);
|
|
204
|
+
return {
|
|
205
|
+
status: "auth_error",
|
|
206
|
+
message: "API key was rejected. It may be invalid, revoked, or expired. The user should create a new key at console.anthropic.com/settings/keys.",
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
console.error(`[anthropic-key] validate: error (${res.status}, ${latency}ms)`);
|
|
210
|
+
return {
|
|
211
|
+
status: "error",
|
|
212
|
+
message: `Could not verify API key. Anthropic returned ${res.status}. This may be a temporary outage — try again later.`,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
const latency = Date.now() - start;
|
|
217
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
218
|
+
console.error(`[anthropic-key] validate: error (network failure, ${latency}ms): ${msg}`);
|
|
219
|
+
return {
|
|
220
|
+
status: "error",
|
|
221
|
+
message: `Could not reach the Anthropic API: ${msg}. Check network connectivity.`,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
// keyFilePath — expose the resolved path for callers that need it
|
|
227
|
+
// (e.g., existsSync checks, user-facing messages about the key location)
|
|
228
|
+
// ---------------------------------------------------------------------------
|
|
229
|
+
function keyFilePath() {
|
|
230
|
+
return resolveKeyFilePath();
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAoEH,0BAiDC;AAMD,4BAiBC;AAMD,wBAEC;AAaD,8BAsBC;AAiBD,kCAsFC;AAOD,kCAEC;AArSD,yDAAyD;AACzD,qCAMiB;AACjB,yCAAmD;AACnD,qCAAkC;AAElC,8EAA8E;AAC9E,iCAAiC;AACjC,EAAE;AACF,yEAAyE;AACzE,gDAAgD;AAChD,qEAAqE;AACrE,yEAAyE;AACzE,kEAAkE;AAClE,8EAA8E;AAE9E,IAAI,iBAAiB,GAAkB,IAAI,CAAC;AAE5C,SAAS,kBAAkB;IACzB,IAAI,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IAEhD,IAAI,aAAa,GAAG,OAAO,CAAC,CAAC,kBAAkB;IAC/C,MAAM,YAAY,GAChB,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