@rubytech/create-maxy-code 0.1.51 → 0.1.58
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__/platform-port-stamp.test.js +24 -0
- package/dist/index.js +5 -2
- package/dist/port-resolution.js +2 -0
- package/package.json +1 -1
- package/payload/platform/lib/require-port-env/dist/index.d.ts +31 -0
- package/payload/platform/lib/require-port-env/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/require-port-env/dist/index.js +52 -0
- package/payload/platform/lib/require-port-env/dist/index.js.map +1 -0
- package/payload/platform/lib/require-port-env/src/index.ts +56 -0
- package/payload/platform/lib/require-port-env/tsconfig.json +8 -0
- package/payload/platform/package-lock.json +0 -1
- package/payload/platform/package.json +2 -3
- package/payload/platform/plugins/admin/PLUGIN.md +16 -3
- package/payload/platform/plugins/admin/hooks/__tests__/turn-completed-graph-write.test.sh +183 -144
- package/payload/platform/plugins/admin/hooks/turn-completed-graph-write.sh +180 -99
- package/payload/platform/plugins/admin/mcp/dist/index.js +20 -12
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/brochures/PLUGIN.md +2 -0
- package/payload/platform/plugins/brochures/skills/property-market-report/SKILL.md +100 -0
- package/payload/platform/plugins/brochures/skills/property-market-report/references/render.py +267 -0
- package/payload/platform/plugins/brochures/skills/property-market-report/references/template.html +266 -0
- package/payload/platform/plugins/brochures/skills/property-socials/SKILL.md +141 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +1 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +2 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +1 -1
- package/payload/platform/plugins/docs/references/admin-session.md +33 -3
- package/payload/platform/plugins/docs/references/deployment.md +25 -0
- package/payload/platform/plugins/docs/references/internals.md +26 -0
- package/payload/platform/plugins/docs/references/platform.md +3 -1
- package/payload/platform/plugins/docs/references/plugins-guide.md +1 -1
- package/payload/platform/plugins/docs/references/troubleshooting.md +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +2 -1
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +1 -1
- package/payload/platform/plugins/memory/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/memory/PLUGIN.md +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js +6 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js +107 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts +4 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +22 -13
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -1
- package/payload/platform/plugins/memory/references/graph-primitives.md +42 -0
- package/payload/platform/plugins/memory/skills/concept-synthesis/SKILL.md +1 -1
- package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +2 -2
- package/payload/platform/plugins/memory/skills/document-ingest/SKILL.md +1 -1
- package/payload/platform/plugins/property-data/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/property-data/PLUGIN.md +100 -0
- package/payload/platform/plugins/property-data/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/property-data/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/index.js +153 -0
- package/payload/platform/plugins/property-data/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/crypto.d.ts +3 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/crypto.js +72 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/neo4j.js +38 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +29 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js +112 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.d.ts +14 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js +20 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.d.ts +4 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-list.js +10 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.d.ts +5 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js +43 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/package-lock.json +2566 -0
- package/payload/platform/plugins/property-data/mcp/package.json +21 -0
- package/payload/platform/plugins/property-data/mcp/src/__tests__/key-roundtrip.test.ts +107 -0
- package/payload/platform/plugins/property-data/mcp/src/__tests__/propertydata-api.test.ts +184 -0
- package/payload/platform/plugins/property-data/mcp/src/__tests__/schema-parity.test.ts +48 -0
- package/payload/platform/plugins/property-data/mcp/src/index.ts +249 -0
- package/payload/platform/plugins/property-data/mcp/src/lib/crypto.ts +79 -0
- package/payload/platform/plugins/property-data/mcp/src/lib/neo4j.ts +47 -0
- package/payload/platform/plugins/property-data/mcp/src/lib/propertydata-api.ts +135 -0
- package/payload/platform/plugins/property-data/mcp/src/tools/endpoints.ts +27 -0
- package/payload/platform/plugins/property-data/mcp/src/tools/key-deregister.ts +21 -0
- package/payload/platform/plugins/property-data/mcp/src/tools/key-list.ts +10 -0
- package/payload/platform/plugins/property-data/mcp/src/tools/key-register.ts +58 -0
- package/payload/platform/plugins/property-data/mcp/tsconfig.json +20 -0
- package/payload/platform/plugins/property-data/mcp/vitest.config.ts +8 -0
- package/payload/platform/plugins/property-data/skills/property-data/SKILL.md +58 -0
- package/payload/platform/plugins/waitlist/PLUGIN.md +6 -8
- package/payload/platform/plugins/waitlist/mcp/dist/index.js +33 -0
- package/payload/platform/plugins/waitlist/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/waitlist/mcp/dist/lib/admin-model.d.ts +16 -0
- package/payload/platform/plugins/waitlist/mcp/dist/lib/admin-model.d.ts.map +1 -0
- package/payload/platform/plugins/waitlist/mcp/dist/lib/admin-model.js +58 -0
- package/payload/platform/plugins/waitlist/mcp/dist/lib/admin-model.js.map +1 -0
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-extract.d.ts +34 -0
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-extract.d.ts.map +1 -0
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-extract.js +129 -0
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-extract.js.map +1 -0
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-heal.d.ts +12 -18
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-heal.d.ts.map +1 -1
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-heal.js +89 -86
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-heal.js.map +1 -1
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-setup.d.ts.map +1 -1
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-setup.js +15 -53
- package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-setup.js.map +1 -1
- package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +5 -5
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/workflows/PLUGIN.md +10 -176
- package/payload/platform/plugins/workflows/mcp/dist/index.js +14 -142
- package/payload/platform/plugins/workflows/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.d.ts +1 -88
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.js +0 -86
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.d.ts +5 -12
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.js +5 -46
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.d.ts +1 -16
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js +39 -75
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.d.ts +8 -21
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js +39 -266
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.d.ts +3 -8
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.js +3 -10
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js +38 -86
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.d.ts.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.js +8 -26
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +1 -2
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -1
- 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 +204 -23
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +39 -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 +109 -10
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/reaper.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/reaper.js +11 -0
- package/payload/platform/services/claude-session-manager/dist/reaper.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +21 -0
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.js.map +1 -1
- package/payload/platform/services/claude-session-manager/vitest.config.ts +14 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +2 -0
- package/payload/platform/templates/agents/admin/SOUL.md +3 -1
- package/payload/premium-plugins/real-agent/BUNDLE.md +5 -3
- package/payload/premium-plugins/real-agent/agents/negotiator.md +1 -1
- package/payload/premium-plugins/real-agent/agents/valuer.md +1 -1
- package/payload/premium-plugins/real-agent/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/premium-plugins/real-agent/plugins/brochures/PLUGIN.md +2 -0
- package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-market-report/SKILL.md +100 -0
- package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-market-report/references/render.py +267 -0
- package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-market-report/references/template.html +266 -0
- package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-socials/SKILL.md +141 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/.claude-plugin/plugin.json +17 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/PLUGIN.md +100 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.d.ts +2 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js +153 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/crypto.d.ts +3 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/crypto.js +72 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/neo4j.js +38 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +29 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js +112 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts +14 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js +20 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.d.ts +4 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-list.js +10 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.d.ts +5 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js +43 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/package-lock.json +2566 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/package.json +21 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/__tests__/key-roundtrip.test.ts +107 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/__tests__/propertydata-api.test.ts +184 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/__tests__/schema-parity.test.ts +48 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/index.ts +249 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/crypto.ts +79 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/neo4j.ts +47 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/propertydata-api.ts +135 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/endpoints.ts +27 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-deregister.ts +21 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-list.ts +10 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-register.ts +58 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/tsconfig.json +20 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/vitest.config.ts +8 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/skills/property-data/SKILL.md +58 -0
- package/payload/server/{chunk-CWI7NOWK.js → chunk-2IKQERHN.js} +32 -4
- package/payload/server/maxy-edge.js +53 -25
- package/payload/server/public/assets/admin-2ZJmzJ_g.js +216 -0
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-DGHlapUl.js → architectureDiagram-Q4EWVU46-DgfgldJT.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-Dgnf9J14.js → blockDiagram-DXYQGD6D-agu8GDzA.js} +1 -1
- package/payload/server/public/assets/{brand-CtilcX3W.css → brand-BDASZqMG.css} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-GBVmghhJ.js → c4Diagram-AHTNJAMY-CmNsUmAe.js} +1 -1
- package/payload/server/public/assets/channel-DXGOX55q.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-CSVC_J3A.js → chunk-336JU56O-D9Uts7k9.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-CK1Z0942.js → chunk-426QAEUC-D4ABqXMn.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-CaqJYLxL.js → chunk-4TB4RGXK-D1KE4OAX.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-57BmPy_B.js → chunk-5FUZZQ4R-CAh0GXe2.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-Ud03uYx_.js → chunk-5PVQY5BW-DBHa6HOv.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-p5KO0PoG.js → chunk-EDXVE4YY-BDC-6mL3.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-CkxgLujt.js → chunk-ENJZ2VHE-CH3uROkW.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-DwMkY8p7.js → chunk-ICPOFSXX-BzZf0nAw.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-CyYOUKBw.js → chunk-OYMX7WX6-BrLHrI6O.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-Dk5rfJM6.js → chunk-U2HBQHQK-Bw4UkLe_.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-D0qCg9Nq.js → chunk-X2U36JSP-23xgdk05.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-C0uFHrdT.js → chunk-YZCP3GAM-BA8iGgRa.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-C7lSyGRs.js → chunk-ZZ45TVLE-B-ol4EgR.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DTuuDxpK.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-CIw8RU0q.js +1 -0
- package/payload/server/public/assets/clone-O4ZyuvYl.js +1 -0
- package/payload/server/public/assets/{dagre-BWZ4wr8y.js → dagre--kXszEIb.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-C7mpqRpw.js → dagre-KV5264BT-amN1uU2d.js} +1 -1
- package/payload/server/public/assets/data-DlmoKxmN.js +1 -0
- package/payload/server/public/assets/{device-url-actions-347cMDY4.js → device-url-actions-CPoz5fqz.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-BcQRB7_3.js → diagram-5BDNPKRD-Cwizs9tP.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-BLSGUKbc.js → diagram-G4DWMVQ6-BpSu5Uao.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-Ra1VvGJh.js → diagram-MMDJMWI5-DiArtkto.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-Bx_r1USn.js → diagram-TYMM5635-_tygK58Y.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-CJhoN8dG.js → erDiagram-SMLLAGMA-CBV6LWYA.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-Bd5CZIoq.js → flowDiagram-DWJPFMVM-CHZFrtOU.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-BNQJqJFh.js → ganttDiagram-T4ZO3ILL-B3vKq5ov.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-DoE1AFmA.js → gitGraphDiagram-UUTBAWPF-dnJPjbtj.js} +1 -1
- package/payload/server/public/assets/graph-BVvcFSEQ.js +1 -0
- package/payload/server/public/assets/graph-labels-cCvgu38Y.js +1 -0
- package/payload/server/public/assets/{graphlib-D7JFfLSw.js → graphlib-CNXtnega.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-BtsKRO-J.js → infoDiagram-42DDH7IO-D8DYwVAF.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-DapnDR0V.js → ishikawaDiagram-UXIWVN3A-CfEVY2Ud.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-BLqfwMMu.js → journeyDiagram-VCZTEJTY-FmoBq7Kh.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-DqiSbvUW.js → kanban-definition-6JOO6SKY-B-Q9qk99.js} +1 -1
- package/payload/server/public/assets/{line-DcwBbbhp.js → line-DZwbJENP.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-BZwNRInp.js → mermaid-parser.core-C3ahKykw.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-DnsyVInc.js → mermaid.core-B8OFZIE8.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-MPPO8aDx.js → mindmap-definition-QFDTVHPH-CqhkfbWa.js} +1 -1
- package/payload/server/public/assets/{page-Cz_pVOv_.js → page-BnAxPkmg.js} +1 -1
- package/payload/server/public/assets/{page-pXt2BdOS.js → page-BnaN3u86.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-BKzbjD_5.js → pieDiagram-DEJITSTG-CJqQ6u3-.js} +1 -1
- package/payload/server/public/assets/{public-C-0V5aC8.js → public-rWe9ADCS.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-CvvvRvae.js → quadrantDiagram-34T5L4WZ-BtEqOXQM.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-BxXZA7z2.js → requirementDiagram-MS252O5E-DPHWUtE6.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-BRRFjjao.js → sankeyDiagram-XADWPNL6-FBmc3wHT.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-DOy_E8xe.js → sequenceDiagram-FGHM5R23-BMSd2-1M.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-CDqat01p.js → stateDiagram-FHFEXIEX-DqFbU-LT.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CXTnsHGq.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-AK1yuR8Z.js → timeline-definition-GMOUNBTQ-DsfvHVK8.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-CCKJ7H16.js → vennDiagram-DHZGUBPP-kHU05mqC.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-CKHKJnG_.js → wardleyDiagram-NUSXRM2D-C696Mez_.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-BBD35k9e.js → xychartDiagram-5P7HB3ND-yht-JyXJ.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +5 -5
- package/payload/server/public/index.html +7 -7
- package/payload/server/public/public.html +4 -4
- package/payload/server/server.js +211 -178
- package/payload/server/public/assets/admin-BbcN8otj.js +0 -216
- package/payload/server/public/assets/channel-p5ZCfK_I.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DqDM1D4-.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DeYvPD8H.js +0 -1
- package/payload/server/public/assets/clone-60k82qeh.js +0 -1
- package/payload/server/public/assets/data-oXs84UW6.js +0 -1
- package/payload/server/public/assets/graph-DcpqWbSs.js +0 -1
- package/payload/server/public/assets/graph-labels-DJvuUODB.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DHckg-aj.js +0 -1
- /package/payload/server/public/assets/{brand-B6pMzF6h.js → brand-BWCtpG7_.js} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
USERS_FILE,
|
|
15
15
|
VNC_DISPLAY,
|
|
16
16
|
WEBSOCKIFY_PORT,
|
|
17
|
-
appendStreamLogLine,
|
|
18
17
|
autoDeliverPremiumPlugins,
|
|
19
18
|
browserViewerLog,
|
|
20
19
|
canAccessAdmin,
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
registerSession,
|
|
43
42
|
renderLoginPage,
|
|
44
43
|
requireAdminSession,
|
|
44
|
+
requirePortEnv,
|
|
45
45
|
resolveAccount,
|
|
46
46
|
resolveClientIp,
|
|
47
47
|
resolveUserAccounts,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
vncLog,
|
|
61
61
|
waitForExit,
|
|
62
62
|
walkPremiumBundles
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-2IKQERHN.js";
|
|
64
64
|
import {
|
|
65
65
|
CLOUDFLARE_TASK_DIAGNOSTICS,
|
|
66
66
|
appendCloudflareSteps,
|
|
@@ -4410,7 +4410,7 @@ import { resolve as resolve5 } from "path";
|
|
|
4410
4410
|
|
|
4411
4411
|
// app/lib/channel-pty-bridge/manager-client.ts
|
|
4412
4412
|
function managerBase() {
|
|
4413
|
-
const port2 =
|
|
4413
|
+
const port2 = requirePortEnv("CLAUDE_SESSION_MANAGER_PORT", { tag: "channel-pty-bridge:manager-client" });
|
|
4414
4414
|
return `http://127.0.0.1:${port2}`;
|
|
4415
4415
|
}
|
|
4416
4416
|
async function managerSpawn(opts) {
|
|
@@ -6861,71 +6861,6 @@ app8.post("/", requireAdminSession, async (c) => {
|
|
|
6861
6861
|
});
|
|
6862
6862
|
var new_session_submit_default = app8;
|
|
6863
6863
|
|
|
6864
|
-
// server/routes/admin/failure-report.ts
|
|
6865
|
-
var SESSION_KEY_RE2 = /^sk_[0-9a-f]{16}$/i;
|
|
6866
|
-
var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
6867
|
-
var ISO_RE3 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
6868
|
-
var SAFE_TOKEN_RE = /^[\w.:-]{1,64}$/;
|
|
6869
|
-
function validate(body) {
|
|
6870
|
-
const missing = [];
|
|
6871
|
-
if (typeof body.sessionKey !== "string" || !SESSION_KEY_RE2.test(body.sessionKey)) missing.push("sessionKey");
|
|
6872
|
-
if (typeof body.conversationId !== "string" || !UUID_RE2.test(body.conversationId)) missing.push("conversationId");
|
|
6873
|
-
if (typeof body.lastUserMessageId !== "string" || !SAFE_TOKEN_RE.test(body.lastUserMessageId)) missing.push("lastUserMessageId");
|
|
6874
|
-
if (typeof body.clickTs !== "string" || !ISO_RE3.test(body.clickTs)) missing.push("clickTs");
|
|
6875
|
-
const snap = body.clientSnapshot;
|
|
6876
|
-
if (!snap || typeof snap !== "object") missing.push("clientSnapshot");
|
|
6877
|
-
if (missing.length > 0) return { ok: false, missing };
|
|
6878
|
-
const snapshot = snap;
|
|
6879
|
-
const lastAssistantMessageId = typeof body.lastAssistantMessageId === "string" && SAFE_TOKEN_RE.test(body.lastAssistantMessageId) ? body.lastAssistantMessageId : "-";
|
|
6880
|
-
const sseReadyState = typeof snapshot.sseReadyState === "string" && SAFE_TOKEN_RE.test(snapshot.sseReadyState) ? snapshot.sseReadyState : typeof snapshot.sseReadyState === "number" ? String(snapshot.sseReadyState) : "-";
|
|
6881
|
-
const lastEventType = typeof snapshot.lastEventType === "string" && SAFE_TOKEN_RE.test(snapshot.lastEventType) ? snapshot.lastEventType : "-";
|
|
6882
|
-
const lastAppliedMessageId = typeof snapshot.lastAppliedMessageId === "string" && SAFE_TOKEN_RE.test(snapshot.lastAppliedMessageId) ? snapshot.lastAppliedMessageId : "-";
|
|
6883
|
-
return {
|
|
6884
|
-
ok: true,
|
|
6885
|
-
value: {
|
|
6886
|
-
sessionKey: body.sessionKey,
|
|
6887
|
-
conversationId: body.conversationId,
|
|
6888
|
-
lastUserMessageId: body.lastUserMessageId,
|
|
6889
|
-
lastAssistantMessageId,
|
|
6890
|
-
clickTs: body.clickTs,
|
|
6891
|
-
sseReadyState,
|
|
6892
|
-
lastEventType,
|
|
6893
|
-
lastAppliedMessageId
|
|
6894
|
-
}
|
|
6895
|
-
};
|
|
6896
|
-
}
|
|
6897
|
-
var app9 = new Hono();
|
|
6898
|
-
app9.post("/", requireAdminSession, async (c) => {
|
|
6899
|
-
let body;
|
|
6900
|
-
try {
|
|
6901
|
-
body = await c.req.json();
|
|
6902
|
-
} catch {
|
|
6903
|
-
return c.json({ ok: false, error: "missing-turn-identifiers", missing: ["body-not-json"] }, 400);
|
|
6904
|
-
}
|
|
6905
|
-
const v = validate(body);
|
|
6906
|
-
if (!v.ok) {
|
|
6907
|
-
return c.json({ ok: false, error: "missing-turn-identifiers", missing: v.missing }, 400);
|
|
6908
|
-
}
|
|
6909
|
-
const cacheKey = c.var.cacheKey;
|
|
6910
|
-
const accountId = getAccountIdForSession(cacheKey);
|
|
6911
|
-
if (!accountId) {
|
|
6912
|
-
return c.json({ ok: false, error: "no-account" }, 401);
|
|
6913
|
-
}
|
|
6914
|
-
const line = [
|
|
6915
|
-
`[failure-report] sessionKey=${v.value.sessionKey}`,
|
|
6916
|
-
`conversationId=${v.value.conversationId}`,
|
|
6917
|
-
`userMessageId=${v.value.lastUserMessageId}`,
|
|
6918
|
-
`assistantMessageId=${v.value.lastAssistantMessageId}`,
|
|
6919
|
-
`sseState=${v.value.sseReadyState}`,
|
|
6920
|
-
`lastEventType=${v.value.lastEventType}`,
|
|
6921
|
-
`lastAppliedMessageId=${v.value.lastAppliedMessageId}`,
|
|
6922
|
-
`ts=${v.value.clickTs}`
|
|
6923
|
-
].join(" ");
|
|
6924
|
-
appendStreamLogLine(accountId, v.value.sessionKey, line);
|
|
6925
|
-
return c.json({ ok: true });
|
|
6926
|
-
});
|
|
6927
|
-
var failure_report_default = app9;
|
|
6928
|
-
|
|
6929
6864
|
// server/routes/admin/logs.ts
|
|
6930
6865
|
import { existsSync as existsSync10, readdirSync as readdirSync5, readFileSync as readFileSync11, statSync as statSync5 } from "fs";
|
|
6931
6866
|
import { resolve as resolve8, basename as basename3 } from "path";
|
|
@@ -6947,8 +6882,8 @@ function resolveSessionLogPaths(filename, logDirs) {
|
|
|
6947
6882
|
|
|
6948
6883
|
// server/routes/admin/logs.ts
|
|
6949
6884
|
var TAIL_BYTES = 8192;
|
|
6950
|
-
var
|
|
6951
|
-
|
|
6885
|
+
var app9 = new Hono();
|
|
6886
|
+
app9.get("/", async (c) => {
|
|
6952
6887
|
const fileParam = c.req.query("file");
|
|
6953
6888
|
const typeParam = c.req.query("type");
|
|
6954
6889
|
const conversationIdParam = c.req.query("conversationId");
|
|
@@ -7090,12 +7025,12 @@ app10.get("/", async (c) => {
|
|
|
7090
7025
|
}
|
|
7091
7026
|
return c.json({ logs });
|
|
7092
7027
|
});
|
|
7093
|
-
var logs_default =
|
|
7028
|
+
var logs_default = app9;
|
|
7094
7029
|
|
|
7095
7030
|
// server/routes/admin/claude-info.ts
|
|
7096
7031
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
7097
|
-
var
|
|
7098
|
-
|
|
7032
|
+
var app10 = new Hono();
|
|
7033
|
+
app10.get("/", (c) => {
|
|
7099
7034
|
let version = "unknown";
|
|
7100
7035
|
try {
|
|
7101
7036
|
const raw = execFileSync3("claude", ["--version"], { encoding: "utf-8", timeout: 5e3 });
|
|
@@ -7113,14 +7048,14 @@ app11.get("/", (c) => {
|
|
|
7113
7048
|
const thinkingView = resolvedAccount?.config.thinkingView ?? "default";
|
|
7114
7049
|
return c.json({ version, account, model, thinkingView });
|
|
7115
7050
|
});
|
|
7116
|
-
var claude_info_default =
|
|
7051
|
+
var claude_info_default = app10;
|
|
7117
7052
|
|
|
7118
7053
|
// server/routes/admin/attachment.ts
|
|
7119
7054
|
import { readFile as readFile3, readdir } from "fs/promises";
|
|
7120
7055
|
import { existsSync as existsSync11 } from "fs";
|
|
7121
7056
|
import { resolve as resolve9 } from "path";
|
|
7122
|
-
var
|
|
7123
|
-
|
|
7057
|
+
var app11 = new Hono();
|
|
7058
|
+
app11.get("/:attachmentId", requireAdminSession, async (c) => {
|
|
7124
7059
|
const attachmentId = c.req.param("attachmentId");
|
|
7125
7060
|
const cacheKey = c.var.cacheKey;
|
|
7126
7061
|
const accountId = getAccountIdForSession(cacheKey);
|
|
@@ -7159,13 +7094,13 @@ app12.get("/:attachmentId", requireAdminSession, async (c) => {
|
|
|
7159
7094
|
}
|
|
7160
7095
|
});
|
|
7161
7096
|
});
|
|
7162
|
-
var attachment_default =
|
|
7097
|
+
var attachment_default = app11;
|
|
7163
7098
|
|
|
7164
7099
|
// server/routes/admin/agents.ts
|
|
7165
7100
|
import { resolve as resolve10 } from "path";
|
|
7166
7101
|
import { readdirSync as readdirSync6, readFileSync as readFileSync12, existsSync as existsSync12, rmSync } from "fs";
|
|
7167
|
-
var
|
|
7168
|
-
|
|
7102
|
+
var app12 = new Hono();
|
|
7103
|
+
app12.get("/", (c) => {
|
|
7169
7104
|
const account = resolveAccount();
|
|
7170
7105
|
if (!account) return c.json({ agents: [] });
|
|
7171
7106
|
const agentsDir = resolve10(account.accountDir, "agents");
|
|
@@ -7195,7 +7130,7 @@ app13.get("/", (c) => {
|
|
|
7195
7130
|
}
|
|
7196
7131
|
return c.json({ agents });
|
|
7197
7132
|
});
|
|
7198
|
-
|
|
7133
|
+
app12.delete("/:slug", async (c) => {
|
|
7199
7134
|
const slug = c.req.param("slug");
|
|
7200
7135
|
const account = resolveAccount();
|
|
7201
7136
|
if (!account) return c.json({ error: "No account resolved" }, 400);
|
|
@@ -7225,7 +7160,7 @@ app13.delete("/:slug", async (c) => {
|
|
|
7225
7160
|
return c.json({ error: "Failed to delete agent" }, 500);
|
|
7226
7161
|
}
|
|
7227
7162
|
});
|
|
7228
|
-
|
|
7163
|
+
app12.post("/:slug/project", async (c) => {
|
|
7229
7164
|
const slug = c.req.param("slug");
|
|
7230
7165
|
const account = resolveAccount();
|
|
7231
7166
|
if (!account) return c.json({ error: "No account resolved" }, 400);
|
|
@@ -7247,7 +7182,7 @@ app13.post("/:slug/project", async (c) => {
|
|
|
7247
7182
|
return c.json({ error: `Projection failed: ${msg}` }, 500);
|
|
7248
7183
|
}
|
|
7249
7184
|
});
|
|
7250
|
-
var agents_default =
|
|
7185
|
+
var agents_default = app12;
|
|
7251
7186
|
|
|
7252
7187
|
// server/routes/admin/sessions.ts
|
|
7253
7188
|
import crypto from "crypto";
|
|
@@ -7416,8 +7351,8 @@ function formatAge(updatedAtStr) {
|
|
|
7416
7351
|
return "unknown";
|
|
7417
7352
|
}
|
|
7418
7353
|
}
|
|
7419
|
-
var
|
|
7420
|
-
|
|
7354
|
+
var app13 = new Hono();
|
|
7355
|
+
app13.get("/", requireAdminSession, async (c) => {
|
|
7421
7356
|
const cacheKey = c.var.cacheKey;
|
|
7422
7357
|
const accountId = getAccountIdForSession(cacheKey);
|
|
7423
7358
|
if (!accountId) return c.json({ error: "Account not found for session" }, 401);
|
|
@@ -7447,7 +7382,7 @@ app14.get("/", requireAdminSession, async (c) => {
|
|
|
7447
7382
|
return c.json({ error: "Failed to fetch sessions" }, 500);
|
|
7448
7383
|
}
|
|
7449
7384
|
});
|
|
7450
|
-
|
|
7385
|
+
app13.post("/new", requireAdminSession, async (c) => {
|
|
7451
7386
|
const oldCacheKey = c.var.cacheKey;
|
|
7452
7387
|
console.log(`[admin-chat] new-conversation outcome=ingress cacheKey=${oldCacheKey.slice(0, 8)}`);
|
|
7453
7388
|
const accountId = getAccountIdForSession(oldCacheKey);
|
|
@@ -7464,7 +7399,7 @@ app14.post("/new", requireAdminSession, async (c) => {
|
|
|
7464
7399
|
console.log(`[admin-chat] new-conversation outcome=ok oldKey=${oldCacheKey.slice(0, 8)} newKey=${newCacheKey.slice(0, 8)}`);
|
|
7465
7400
|
return c.json({ session_key: newSignedSessionToken, conversationId: null });
|
|
7466
7401
|
});
|
|
7467
|
-
|
|
7402
|
+
app13.post("/switch", requireAdminSession, async (c) => {
|
|
7468
7403
|
const cacheKey = c.var.cacheKey;
|
|
7469
7404
|
const accountId = getAccountIdForSession(cacheKey);
|
|
7470
7405
|
const userId = getUserIdForSession(cacheKey);
|
|
@@ -7492,7 +7427,7 @@ app14.post("/switch", requireAdminSession, async (c) => {
|
|
|
7492
7427
|
console.log(`[session-switch] from=${cacheKey.slice(0, 8)} to=${targetCacheKey.slice(0, 8)} targetConvId=${targetConversationId?.slice(0, 8) ?? "none"} accountId=${accountId.slice(0, 8)}`);
|
|
7493
7428
|
return c.json({ session_key: targetSignedSessionToken, conversationId: targetConversationId });
|
|
7494
7429
|
});
|
|
7495
|
-
|
|
7430
|
+
app13.delete("/:id", requireAdminSession, async (c) => {
|
|
7496
7431
|
const conversationId = c.req.param("id");
|
|
7497
7432
|
const cacheKey = c.var.cacheKey;
|
|
7498
7433
|
const accountId = getAccountIdForSession(cacheKey);
|
|
@@ -7507,7 +7442,7 @@ app14.delete("/:id", requireAdminSession, async (c) => {
|
|
|
7507
7442
|
return c.json({ error: "Failed to delete session" }, 500);
|
|
7508
7443
|
}
|
|
7509
7444
|
});
|
|
7510
|
-
|
|
7445
|
+
app13.post("/:id/resume", async (c) => {
|
|
7511
7446
|
const conversationId = c.req.param("id");
|
|
7512
7447
|
const t0 = Date.now();
|
|
7513
7448
|
const signedSessionToken = c.req.query("session_key") ?? "";
|
|
@@ -7780,7 +7715,7 @@ app14.post("/:id/resume", async (c) => {
|
|
|
7780
7715
|
}
|
|
7781
7716
|
});
|
|
7782
7717
|
});
|
|
7783
|
-
|
|
7718
|
+
app13.put("/:id/label", requireAdminSession, async (c) => {
|
|
7784
7719
|
const conversationId = c.req.param("id");
|
|
7785
7720
|
const cacheKey = c.var.cacheKey;
|
|
7786
7721
|
let body;
|
|
@@ -7806,7 +7741,7 @@ app14.put("/:id/label", requireAdminSession, async (c) => {
|
|
|
7806
7741
|
return c.json({ error: "Failed to rename session" }, 500);
|
|
7807
7742
|
}
|
|
7808
7743
|
});
|
|
7809
|
-
var sessions_default =
|
|
7744
|
+
var sessions_default = app13;
|
|
7810
7745
|
|
|
7811
7746
|
// app/lib/claude-agent/spawn-context.ts
|
|
7812
7747
|
import { existsSync as existsSync14, readFileSync as readFileSync13, readdirSync as readdirSync7, statSync as statSync6 } from "fs";
|
|
@@ -8106,10 +8041,11 @@ function resolveTunnelUrl() {
|
|
|
8106
8041
|
}
|
|
8107
8042
|
var TAG18 = "[claude-session-manager:wrapper]";
|
|
8108
8043
|
function managerBase2() {
|
|
8109
|
-
const port2 =
|
|
8044
|
+
const port2 = requirePortEnv("CLAUDE_SESSION_MANAGER_PORT", { tag: "claude-session-manager:wrapper" });
|
|
8110
8045
|
return `http://127.0.0.1:${port2}`;
|
|
8111
8046
|
}
|
|
8112
|
-
var
|
|
8047
|
+
var app14 = new Hono();
|
|
8048
|
+
var UUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
8113
8049
|
async function performSpawnWithInitialMessage(args) {
|
|
8114
8050
|
const ownerStart = Date.now();
|
|
8115
8051
|
const aboutOwner = await resolveOwnerProfileBlock(args.senderId, args.userId);
|
|
@@ -8132,7 +8068,8 @@ async function performSpawnWithInitialMessage(args) {
|
|
|
8132
8068
|
dormantPlugins,
|
|
8133
8069
|
activePlugins,
|
|
8134
8070
|
specialistDomains,
|
|
8135
|
-
tunnelUrl
|
|
8071
|
+
tunnelUrl,
|
|
8072
|
+
originatingSessionId: args.originatingSessionId
|
|
8136
8073
|
});
|
|
8137
8074
|
console.log(`${TAG18} forward-spawn-start managerBase=${managerBase2()} bytes=${upstreamPayload.length} hidden=${args.hidden} specialist=${args.specialist ?? "none"}`);
|
|
8138
8075
|
const forwardStart = Date.now();
|
|
@@ -8166,69 +8103,123 @@ async function performSpawnWithInitialMessage(args) {
|
|
|
8166
8103
|
}
|
|
8167
8104
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8168
8105
|
}
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
} catch {
|
|
8180
|
-
return c.json({ error: "body-not-json" }, 400);
|
|
8181
|
-
}
|
|
8182
|
-
if (body.senderId !== "turn-recorder") {
|
|
8183
|
-
return c.json({ error: "recorder-senderId-required" }, 400);
|
|
8106
|
+
var requireAdminSessionUnlessLoopbackSpawn = async (c, next) => {
|
|
8107
|
+
if (c.req.method === "POST" && c.req.path === "/api/admin/claude-sessions") {
|
|
8108
|
+
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
8109
|
+
const isLoopback = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
|
|
8110
|
+
const xff = c.req.header("x-forwarded-for");
|
|
8111
|
+
const xffPresent = typeof xff === "string" && xff.length > 0;
|
|
8112
|
+
if (isLoopback && !xffPresent) {
|
|
8113
|
+
console.log(`${TAG18} loopback-spawn-bypass remoteAddr=${remoteAddr} xff=absent`);
|
|
8114
|
+
return next();
|
|
8115
|
+
}
|
|
8184
8116
|
}
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
senderId: "turn-recorder",
|
|
8190
|
-
userId: void 0,
|
|
8191
|
-
role: "admin",
|
|
8192
|
-
channel: "browser",
|
|
8193
|
-
permissionMode: void 0,
|
|
8194
|
-
hidden: true,
|
|
8195
|
-
specialist,
|
|
8196
|
-
initialMessage
|
|
8197
|
-
});
|
|
8198
|
-
});
|
|
8199
|
-
app15.use("*", requireAdminSession);
|
|
8200
|
-
app15.post("/", async (c) => {
|
|
8117
|
+
return requireAdminSession(c, next);
|
|
8118
|
+
};
|
|
8119
|
+
app14.use("*", requireAdminSessionUnlessLoopbackSpawn);
|
|
8120
|
+
app14.post("/", async (c) => {
|
|
8201
8121
|
const routeStart = Date.now();
|
|
8202
8122
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
8203
|
-
const senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8204
|
-
if (!senderId) {
|
|
8205
|
-
console.error(`${TAG18} reject reason=no-account-id cacheKey-prefix=${cacheKey.slice(0, 8)}`);
|
|
8206
|
-
return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
8207
|
-
}
|
|
8208
|
-
const userId = getUserIdForSession(cacheKey);
|
|
8209
8123
|
let body = {};
|
|
8210
8124
|
try {
|
|
8211
8125
|
body = await c.req.json();
|
|
8212
8126
|
} catch {
|
|
8213
8127
|
}
|
|
8128
|
+
let senderId;
|
|
8129
|
+
let userId;
|
|
8130
|
+
let specialist;
|
|
8131
|
+
let originatingSessionId;
|
|
8132
|
+
let authSurface;
|
|
8133
|
+
if (cacheKey) {
|
|
8134
|
+
authSurface = "cookie";
|
|
8135
|
+
senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8136
|
+
if (!senderId) {
|
|
8137
|
+
console.error(`${TAG18} reject reason=no-account-id cacheKey-prefix=${cacheKey.slice(0, 8)}`);
|
|
8138
|
+
return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
8139
|
+
}
|
|
8140
|
+
userId = getUserIdForSession(cacheKey) ?? void 0;
|
|
8141
|
+
specialist = void 0;
|
|
8142
|
+
originatingSessionId = void 0;
|
|
8143
|
+
} else {
|
|
8144
|
+
authSurface = "loopback";
|
|
8145
|
+
if (typeof body.originatingSessionId !== "string" || !UUID_PATTERN.test(body.originatingSessionId)) {
|
|
8146
|
+
console.log(`[turn-recorder] spawn-failed sessionId=unknown reason=missing-originating-session-id`);
|
|
8147
|
+
return c.json({ error: "originating-session-id-required" }, 400);
|
|
8148
|
+
}
|
|
8149
|
+
originatingSessionId = body.originatingSessionId;
|
|
8150
|
+
const operatorMeta = await fetch(
|
|
8151
|
+
`${managerBase2()}/${encodeURIComponent(originatingSessionId)}/meta`
|
|
8152
|
+
).then((r) => r.ok ? r.json() : null).catch((err) => {
|
|
8153
|
+
console.error(`${TAG18} fetch-failed op=operator-meta-lookup message=${err instanceof Error ? err.message : String(err)}`);
|
|
8154
|
+
return null;
|
|
8155
|
+
});
|
|
8156
|
+
const operatorSenderId = operatorMeta && typeof operatorMeta.senderId === "string" && operatorMeta.senderId.length > 0 ? operatorMeta.senderId : null;
|
|
8157
|
+
if (!operatorSenderId) {
|
|
8158
|
+
console.log(
|
|
8159
|
+
`[turn-recorder] spawn-failed sessionId=${originatingSessionId} reason=originating-session-not-found`
|
|
8160
|
+
);
|
|
8161
|
+
return c.json({ error: "originating-session-not-found" }, 404);
|
|
8162
|
+
}
|
|
8163
|
+
senderId = operatorSenderId;
|
|
8164
|
+
userId = void 0;
|
|
8165
|
+
specialist = typeof body.specialist === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(body.specialist) ? body.specialist : "database-operator";
|
|
8166
|
+
}
|
|
8214
8167
|
const channel = typeof body.channel === "string" ? body.channel : "browser";
|
|
8215
8168
|
const initialMessage = typeof body.initialMessage === "string" && body.initialMessage.trim() ? body.initialMessage : null;
|
|
8169
|
+
const initialMessageBytes = initialMessage ? Buffer.byteLength(initialMessage, "utf8") : 0;
|
|
8216
8170
|
const permissionMode = typeof body.permissionMode === "string" ? body.permissionMode : void 0;
|
|
8217
|
-
|
|
8218
|
-
|
|
8171
|
+
if (authSurface === "cookie") {
|
|
8172
|
+
console.log(`${TAG18} spawn-request-in surface=cookie cacheKey-prefix=${cacheKey.slice(0, 8)} accountId=${senderId.slice(0, 8)} userId=${userId ? userId.slice(0, 8) : "absent"} channel=${channel} permissionMode=${permissionMode ?? "default"} initialMessage=${initialMessage ? "yes" : "no"}`);
|
|
8173
|
+
} else {
|
|
8174
|
+
console.log(`[turn-recorder] spawn-request sessionId=${originatingSessionId} specialist=${specialist ?? "none"} initialMessageBytes=${initialMessageBytes}`);
|
|
8175
|
+
}
|
|
8176
|
+
const t0 = Date.now();
|
|
8177
|
+
const response = await performSpawnWithInitialMessage({
|
|
8219
8178
|
senderId,
|
|
8220
|
-
userId
|
|
8179
|
+
userId,
|
|
8221
8180
|
role: "admin",
|
|
8222
8181
|
channel,
|
|
8223
8182
|
permissionMode,
|
|
8224
8183
|
hidden: false,
|
|
8225
|
-
specialist
|
|
8226
|
-
initialMessage
|
|
8184
|
+
specialist,
|
|
8185
|
+
initialMessage,
|
|
8186
|
+
originatingSessionId
|
|
8227
8187
|
});
|
|
8228
|
-
|
|
8229
|
-
|
|
8188
|
+
if (authSurface === "loopback" && originatingSessionId) {
|
|
8189
|
+
const respText = await response.text().catch(() => "");
|
|
8190
|
+
const respStatus = response.status;
|
|
8191
|
+
const replay = new Response(respText, { status: respStatus, headers: response.headers });
|
|
8192
|
+
let parsed = null;
|
|
8193
|
+
try {
|
|
8194
|
+
parsed = JSON.parse(respText);
|
|
8195
|
+
} catch {
|
|
8196
|
+
parsed = null;
|
|
8197
|
+
}
|
|
8198
|
+
if (respStatus >= 200 && respStatus < 300 && parsed && typeof parsed.sessionId === "string") {
|
|
8199
|
+
const recorderSessionId = parsed.sessionId;
|
|
8200
|
+
console.log(
|
|
8201
|
+
`[turn-recorder] spawn-success sessionId=${originatingSessionId} recorderSessionId=${recorderSessionId} pid=${parsed.pid ?? 0} latency-ms=${Date.now() - t0}`
|
|
8202
|
+
);
|
|
8203
|
+
if (initialMessage) {
|
|
8204
|
+
console.log(
|
|
8205
|
+
`[turn-recorder] input-delivered sessionId=${originatingSessionId} recorderSessionId=${recorderSessionId} bytes=${initialMessageBytes} multiline=${initialMessage.includes("\n")}`
|
|
8206
|
+
);
|
|
8207
|
+
}
|
|
8208
|
+
} else {
|
|
8209
|
+
const reasonRaw = parsed && typeof parsed.error === "string" ? parsed.error : "unknown";
|
|
8210
|
+
if (reasonRaw !== "tool-surface-missing" && reasonRaw !== "missing-originating-session-id") {
|
|
8211
|
+
const detail = parsed && typeof parsed.detail === "string" ? parsed.detail.slice(0, 200) : "";
|
|
8212
|
+
console.log(
|
|
8213
|
+
`[turn-recorder] spawn-failed sessionId=${originatingSessionId} reason=manager-spawn http=${respStatus} err=${JSON.stringify(detail || reasonRaw)}`
|
|
8214
|
+
);
|
|
8215
|
+
}
|
|
8216
|
+
}
|
|
8217
|
+
return replay;
|
|
8218
|
+
}
|
|
8219
|
+
console.log(`${TAG18} route-done surface=cookie status=${response.status} route-ms=${Date.now() - routeStart}`);
|
|
8220
|
+
return response;
|
|
8230
8221
|
});
|
|
8231
|
-
|
|
8222
|
+
app14.get("/events", async (c) => {
|
|
8232
8223
|
const upstream = await fetch(`${managerBase2()}/events`, {
|
|
8233
8224
|
headers: { accept: "text/event-stream" }
|
|
8234
8225
|
}).catch((err) => {
|
|
@@ -8246,7 +8237,7 @@ app15.get("/events", async (c) => {
|
|
|
8246
8237
|
}
|
|
8247
8238
|
});
|
|
8248
8239
|
});
|
|
8249
|
-
|
|
8240
|
+
app14.get("/", async (c) => {
|
|
8250
8241
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
8251
8242
|
const senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8252
8243
|
if (!senderId) return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
@@ -8259,7 +8250,7 @@ app15.get("/", async (c) => {
|
|
|
8259
8250
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8260
8251
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8261
8252
|
});
|
|
8262
|
-
|
|
8253
|
+
app14.post("/resume", async (c) => {
|
|
8263
8254
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
8264
8255
|
const senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8265
8256
|
if (!senderId) return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
@@ -8270,8 +8261,8 @@ app15.post("/resume", async (c) => {
|
|
|
8270
8261
|
} catch {
|
|
8271
8262
|
return c.json({ error: "body-not-json" }, 400);
|
|
8272
8263
|
}
|
|
8273
|
-
if (typeof body.
|
|
8274
|
-
return c.json({ error: "
|
|
8264
|
+
if (typeof body.sessionId !== "string" || !body.sessionId) {
|
|
8265
|
+
return c.json({ error: "sessionId-required" }, 400);
|
|
8275
8266
|
}
|
|
8276
8267
|
const channel = typeof body.channel === "string" ? body.channel : "browser";
|
|
8277
8268
|
const aboutOwner = await resolveOwnerProfileBlock(senderId, userId);
|
|
@@ -8286,7 +8277,7 @@ app15.post("/resume", async (c) => {
|
|
|
8286
8277
|
senderId,
|
|
8287
8278
|
role: "admin",
|
|
8288
8279
|
channel,
|
|
8289
|
-
|
|
8280
|
+
sessionId: body.sessionId,
|
|
8290
8281
|
aboutOwner,
|
|
8291
8282
|
dormantPlugins,
|
|
8292
8283
|
activePlugins,
|
|
@@ -8300,7 +8291,7 @@ app15.post("/resume", async (c) => {
|
|
|
8300
8291
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8301
8292
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8302
8293
|
});
|
|
8303
|
-
|
|
8294
|
+
app14.post("/:sessionId/stop", async (c) => {
|
|
8304
8295
|
const sessionId = c.req.param("sessionId");
|
|
8305
8296
|
const upstream = await fetch(
|
|
8306
8297
|
`${managerBase2()}/${encodeURIComponent(sessionId)}/stop`,
|
|
@@ -8312,7 +8303,7 @@ app15.post("/:sessionId/stop", async (c) => {
|
|
|
8312
8303
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8313
8304
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8314
8305
|
});
|
|
8315
|
-
|
|
8306
|
+
app14.delete("/:sessionId", async (c) => {
|
|
8316
8307
|
const sessionId = c.req.param("sessionId");
|
|
8317
8308
|
const upstream = await fetch(
|
|
8318
8309
|
`${managerBase2()}/${encodeURIComponent(sessionId)}`,
|
|
@@ -8324,7 +8315,7 @@ app15.delete("/:sessionId", async (c) => {
|
|
|
8324
8315
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8325
8316
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8326
8317
|
});
|
|
8327
|
-
|
|
8318
|
+
app14.post("/:sessionId/archive", async (c) => {
|
|
8328
8319
|
const sessionId = c.req.param("sessionId");
|
|
8329
8320
|
const body = await c.req.text();
|
|
8330
8321
|
const upstream = await fetch(
|
|
@@ -8341,7 +8332,7 @@ app15.post("/:sessionId/archive", async (c) => {
|
|
|
8341
8332
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8342
8333
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8343
8334
|
});
|
|
8344
|
-
|
|
8335
|
+
app14.get("/:sessionId/meta", async (c) => {
|
|
8345
8336
|
const sessionId = c.req.param("sessionId");
|
|
8346
8337
|
const upstream = await fetch(
|
|
8347
8338
|
`${managerBase2()}/${encodeURIComponent(sessionId)}/meta`
|
|
@@ -8352,7 +8343,7 @@ app15.get("/:sessionId/meta", async (c) => {
|
|
|
8352
8343
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8353
8344
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8354
8345
|
});
|
|
8355
|
-
|
|
8346
|
+
app14.patch("/:sessionId", async (c) => {
|
|
8356
8347
|
const sessionId = c.req.param("sessionId");
|
|
8357
8348
|
const body = await c.req.text();
|
|
8358
8349
|
const upstream = await fetch(
|
|
@@ -8369,7 +8360,7 @@ app15.patch("/:sessionId", async (c) => {
|
|
|
8369
8360
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8370
8361
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8371
8362
|
});
|
|
8372
|
-
|
|
8363
|
+
app14.post("/:sessionId/input", async (c) => {
|
|
8373
8364
|
const sessionId = c.req.param("sessionId");
|
|
8374
8365
|
const rawBody = await c.req.text();
|
|
8375
8366
|
const upstream = await fetch(
|
|
@@ -8386,7 +8377,7 @@ app15.post("/:sessionId/input", async (c) => {
|
|
|
8386
8377
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8387
8378
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8388
8379
|
});
|
|
8389
|
-
|
|
8380
|
+
app14.get("/:sessionId/log", async (c) => {
|
|
8390
8381
|
const sessionId = c.req.param("sessionId");
|
|
8391
8382
|
const follow = c.req.query("follow") === "1" ? "?follow=1" : "";
|
|
8392
8383
|
const upstream = await fetch(
|
|
@@ -8398,7 +8389,49 @@ app15.get("/:sessionId/log", async (c) => {
|
|
|
8398
8389
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8399
8390
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8400
8391
|
});
|
|
8401
|
-
var claude_sessions_default =
|
|
8392
|
+
var claude_sessions_default = app14;
|
|
8393
|
+
|
|
8394
|
+
// server/routes/admin/log-ingest.ts
|
|
8395
|
+
var TAG19 = "[log-ingest]";
|
|
8396
|
+
var TAG_PATTERN = /^[A-Za-z0-9_-]{1,32}$/;
|
|
8397
|
+
var LEVELS = /* @__PURE__ */ new Set(["debug", "info", "warn", "error"]);
|
|
8398
|
+
var MAX_LINE_BYTES = 4096;
|
|
8399
|
+
var app15 = new Hono();
|
|
8400
|
+
app15.post("/", async (c) => {
|
|
8401
|
+
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
8402
|
+
const isLoopback = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
|
|
8403
|
+
if (!isLoopback) {
|
|
8404
|
+
console.error(`${TAG19} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
8405
|
+
return c.json({ error: "log-ingest-loopback-only" }, 403);
|
|
8406
|
+
}
|
|
8407
|
+
let body = {};
|
|
8408
|
+
try {
|
|
8409
|
+
body = await c.req.json();
|
|
8410
|
+
} catch {
|
|
8411
|
+
return c.json({ error: "body-not-json" }, 400);
|
|
8412
|
+
}
|
|
8413
|
+
if (typeof body.tag !== "string" || !TAG_PATTERN.test(body.tag)) {
|
|
8414
|
+
return c.json({ error: "tag-invalid" }, 400);
|
|
8415
|
+
}
|
|
8416
|
+
if (typeof body.level !== "string" || !LEVELS.has(body.level)) {
|
|
8417
|
+
return c.json({ error: "level-invalid" }, 400);
|
|
8418
|
+
}
|
|
8419
|
+
if (typeof body.line !== "string" || body.line.length === 0) {
|
|
8420
|
+
return c.json({ error: "line-required" }, 400);
|
|
8421
|
+
}
|
|
8422
|
+
if (body.line.includes("\n") || body.line.includes("\r")) {
|
|
8423
|
+
return c.json({ error: "line-must-be-single-line" }, 400);
|
|
8424
|
+
}
|
|
8425
|
+
if (Buffer.byteLength(body.line, "utf8") > MAX_LINE_BYTES) {
|
|
8426
|
+
return c.json({ error: "line-too-long", max: MAX_LINE_BYTES }, 400);
|
|
8427
|
+
}
|
|
8428
|
+
const formatted = `[${body.tag}] ${body.line}`;
|
|
8429
|
+
if (body.level === "error") console.error(formatted);
|
|
8430
|
+
else if (body.level === "warn") console.warn(formatted);
|
|
8431
|
+
else console.log(formatted);
|
|
8432
|
+
return c.json({ ok: true }, 200);
|
|
8433
|
+
});
|
|
8434
|
+
var log_ingest_default = app15;
|
|
8402
8435
|
|
|
8403
8436
|
// server/routes/admin/browser.ts
|
|
8404
8437
|
var app16 = new Hono();
|
|
@@ -8508,13 +8541,13 @@ async function cdpNavigateNewTab(url, opts = {}) {
|
|
|
8508
8541
|
// server/routes/admin/device-browser.ts
|
|
8509
8542
|
var app18 = new Hono();
|
|
8510
8543
|
app18.post("/navigate", async (c) => {
|
|
8511
|
-
const
|
|
8544
|
+
const TAG21 = "[device-url:click]";
|
|
8512
8545
|
let body;
|
|
8513
8546
|
try {
|
|
8514
8547
|
body = await c.req.json();
|
|
8515
8548
|
} catch (err) {
|
|
8516
8549
|
const detail = err instanceof Error ? err.message : String(err);
|
|
8517
|
-
console.error(`${
|
|
8550
|
+
console.error(`${TAG21} reject reason=body-not-json detail=${detail} browser=fallback navigateResult=error`);
|
|
8518
8551
|
return c.json(
|
|
8519
8552
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "Request body was not valid JSON" },
|
|
8520
8553
|
400
|
|
@@ -8524,7 +8557,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8524
8557
|
const intent = typeof body.intent === "string" ? body.intent : "";
|
|
8525
8558
|
const hostname2 = typeof body.hostname === "string" ? body.hostname : "";
|
|
8526
8559
|
if (!url) {
|
|
8527
|
-
console.error(`${
|
|
8560
|
+
console.error(`${TAG21} reject reason=missing-url intent=${JSON.stringify(intent)} browser=fallback navigateResult=error`);
|
|
8528
8561
|
return c.json(
|
|
8529
8562
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "url field is required" },
|
|
8530
8563
|
400
|
|
@@ -8534,7 +8567,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8534
8567
|
try {
|
|
8535
8568
|
parsed = new URL(url);
|
|
8536
8569
|
} catch {
|
|
8537
|
-
console.error(`${
|
|
8570
|
+
console.error(`${TAG21} reject reason=url-malformed intent=${JSON.stringify(intent)} url=${url} browser=fallback navigateResult=error`);
|
|
8538
8571
|
return c.json(
|
|
8539
8572
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "url is not a valid URL" },
|
|
8540
8573
|
400
|
|
@@ -8542,7 +8575,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8542
8575
|
}
|
|
8543
8576
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
8544
8577
|
console.error(
|
|
8545
|
-
`${
|
|
8578
|
+
`${TAG21} reject reason=scheme-not-allowed scheme=${parsed.protocol} intent=${JSON.stringify(intent)} browser=fallback navigateResult=error`
|
|
8546
8579
|
);
|
|
8547
8580
|
return c.json(
|
|
8548
8581
|
{
|
|
@@ -8558,7 +8591,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8558
8591
|
const cdpOk = await ensureCdp(transport);
|
|
8559
8592
|
if (!cdpOk) {
|
|
8560
8593
|
console.error(
|
|
8561
|
-
`${
|
|
8594
|
+
`${TAG21} intent=${JSON.stringify(intent)} browser=fallback navigateResult=cdp-unreachable hostname=${JSON.stringify(hostname2)}`
|
|
8562
8595
|
);
|
|
8563
8596
|
return c.json(
|
|
8564
8597
|
{
|
|
@@ -8574,7 +8607,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8574
8607
|
const browser = outcome.result === "ok" ? "vnc" : "fallback";
|
|
8575
8608
|
const detailStr = outcome.detail ? ` detail=${JSON.stringify(outcome.detail.length > 230 ? outcome.detail.slice(0, 227) + "..." : outcome.detail)}` : "";
|
|
8576
8609
|
console.error(
|
|
8577
|
-
`${
|
|
8610
|
+
`${TAG21} intent=${JSON.stringify(intent)} browser=${browser} navigateResult=${outcome.result} hostname=${JSON.stringify(hostname2)} targetId=${outcome.targetId ?? "none"}${detailStr}`
|
|
8578
8611
|
);
|
|
8579
8612
|
if (outcome.result !== "ok") {
|
|
8580
8613
|
return c.json(
|
|
@@ -8605,18 +8638,18 @@ var ALLOWED_EVENTS2 = /* @__PURE__ */ new Set([
|
|
|
8605
8638
|
]);
|
|
8606
8639
|
var app19 = new Hono();
|
|
8607
8640
|
app19.post("/", async (c) => {
|
|
8608
|
-
const
|
|
8641
|
+
const TAG21 = "[admin:events]";
|
|
8609
8642
|
let body;
|
|
8610
8643
|
try {
|
|
8611
8644
|
body = await c.req.json();
|
|
8612
8645
|
} catch (err) {
|
|
8613
8646
|
const detail = err instanceof Error ? err.message : String(err);
|
|
8614
|
-
console.error(`${
|
|
8647
|
+
console.error(`${TAG21} reject reason=body-not-json detail=${detail}`);
|
|
8615
8648
|
return c.json({ ok: false, detail: "Request body was not valid JSON" }, 400);
|
|
8616
8649
|
}
|
|
8617
8650
|
const event = typeof body.event === "string" ? body.event : "";
|
|
8618
8651
|
if (!ALLOWED_EVENTS2.has(event)) {
|
|
8619
|
-
console.error(`${
|
|
8652
|
+
console.error(`${TAG21} reject reason=event-not-allowed event=${JSON.stringify(event)}`);
|
|
8620
8653
|
return c.json({ ok: false, detail: `Event "${event}" is not allowed` }, 400);
|
|
8621
8654
|
}
|
|
8622
8655
|
const rawFields = body.fields && typeof body.fields === "object" ? body.fields : {};
|
|
@@ -9782,7 +9815,7 @@ async function restoreNode(params) {
|
|
|
9782
9815
|
}
|
|
9783
9816
|
|
|
9784
9817
|
// app/lib/file-delete-cascade.ts
|
|
9785
|
-
var
|
|
9818
|
+
var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9786
9819
|
function parseAttachmentPath(relPath2) {
|
|
9787
9820
|
const segments = relPath2.split("/").filter(Boolean);
|
|
9788
9821
|
if (segments.length !== 4) return null;
|
|
@@ -9790,7 +9823,7 @@ function parseAttachmentPath(relPath2) {
|
|
|
9790
9823
|
const accountId = segments[1];
|
|
9791
9824
|
const attachmentId = segments[2];
|
|
9792
9825
|
const filename = segments[3];
|
|
9793
|
-
if (!
|
|
9826
|
+
if (!UUID_RE2.test(accountId) || !UUID_RE2.test(attachmentId)) return null;
|
|
9794
9827
|
const dot = filename.lastIndexOf(".");
|
|
9795
9828
|
if (dot === -1) return null;
|
|
9796
9829
|
const stem = filename.slice(0, dot);
|
|
@@ -9862,7 +9895,7 @@ async function cascadeDeleteDocument(params) {
|
|
|
9862
9895
|
}
|
|
9863
9896
|
|
|
9864
9897
|
// server/routes/admin/files.ts
|
|
9865
|
-
var
|
|
9898
|
+
var UUID_RE3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9866
9899
|
async function readMeta(absDir, baseName) {
|
|
9867
9900
|
try {
|
|
9868
9901
|
const raw = await readFile4(join11(absDir, `${baseName}.meta.json`), "utf8");
|
|
@@ -9884,7 +9917,7 @@ async function readAccountNames() {
|
|
|
9884
9917
|
return map;
|
|
9885
9918
|
}
|
|
9886
9919
|
for (const name of names) {
|
|
9887
|
-
if (!
|
|
9920
|
+
if (!UUID_RE3.test(name)) continue;
|
|
9888
9921
|
const configPath2 = resolve16(accountsDir, name, "account.json");
|
|
9889
9922
|
try {
|
|
9890
9923
|
const raw = await readFile4(configPath2, "utf8");
|
|
@@ -9902,7 +9935,7 @@ async function readAccountNames() {
|
|
|
9902
9935
|
return map;
|
|
9903
9936
|
}
|
|
9904
9937
|
async function enrich(absolute, entry, accountNames) {
|
|
9905
|
-
if (entry.kind === "directory" &&
|
|
9938
|
+
if (entry.kind === "directory" && UUID_RE3.test(entry.name)) {
|
|
9906
9939
|
const meta = await readMeta(join11(absolute, entry.name), entry.name);
|
|
9907
9940
|
if (meta?.filename) {
|
|
9908
9941
|
entry.displayName = meta.filename;
|
|
@@ -9918,7 +9951,7 @@ async function enrich(absolute, entry, accountNames) {
|
|
|
9918
9951
|
if (entry.kind === "file") {
|
|
9919
9952
|
const dot = entry.name.lastIndexOf(".");
|
|
9920
9953
|
const base = dot === -1 ? entry.name : entry.name.slice(0, dot);
|
|
9921
|
-
if (
|
|
9954
|
+
if (UUID_RE3.test(base)) {
|
|
9922
9955
|
const meta = await readMeta(absolute, base);
|
|
9923
9956
|
if (meta?.filename) {
|
|
9924
9957
|
entry.displayName = meta.filename;
|
|
@@ -9930,7 +9963,7 @@ async function enrich(absolute, entry, accountNames) {
|
|
|
9930
9963
|
function buildDisplayPath(relPath2, accountNames) {
|
|
9931
9964
|
if (relPath2 === "." || relPath2 === "") return [];
|
|
9932
9965
|
return relPath2.split("/").filter(Boolean).map((seg) => {
|
|
9933
|
-
const dn =
|
|
9966
|
+
const dn = UUID_RE3.test(seg) ? accountNames.get(seg) : void 0;
|
|
9934
9967
|
return dn ? { name: seg, displayName: dn } : { name: seg };
|
|
9935
9968
|
});
|
|
9936
9969
|
}
|
|
@@ -9958,7 +9991,7 @@ app21.get("/", requireAdminSession, async (c) => {
|
|
|
9958
9991
|
const names = await readdir2(absolute);
|
|
9959
9992
|
const entries = [];
|
|
9960
9993
|
for (const name of names) {
|
|
9961
|
-
if (
|
|
9994
|
+
if (UUID_RE3.test(name.replace(/\.meta\.json$/, "")) && name.endsWith(".meta.json")) {
|
|
9962
9995
|
continue;
|
|
9963
9996
|
}
|
|
9964
9997
|
try {
|
|
@@ -10135,7 +10168,7 @@ app21.delete("/", requireAdminSession, async (c) => {
|
|
|
10135
10168
|
}
|
|
10136
10169
|
const dot = base.lastIndexOf(".");
|
|
10137
10170
|
const stem = dot === -1 ? base : base.slice(0, dot);
|
|
10138
|
-
const sidecarPath =
|
|
10171
|
+
const sidecarPath = UUID_RE3.test(stem) && base !== `${stem}.meta.json` ? join11(dirname5(absolute), `${stem}.meta.json`) : null;
|
|
10139
10172
|
await unlink2(absolute);
|
|
10140
10173
|
if (sidecarPath) {
|
|
10141
10174
|
try {
|
|
@@ -12015,7 +12048,7 @@ import { mkdir as mkdir4, readdir as readdir4, stat as stat6, writeFile as write
|
|
|
12015
12048
|
import { resolve as resolve18 } from "path";
|
|
12016
12049
|
import { existsSync as existsSync17 } from "fs";
|
|
12017
12050
|
var ADMIN_AGENT_FILES2 = /* @__PURE__ */ new Set(["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"]);
|
|
12018
|
-
var
|
|
12051
|
+
var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12019
12052
|
var app30 = new Hono();
|
|
12020
12053
|
app30.post("/", requireAdminSession, async (c) => {
|
|
12021
12054
|
const cacheKey = c.var.cacheKey;
|
|
@@ -12079,7 +12112,7 @@ async function resolveSavePath(id, accountId, accountDir) {
|
|
|
12079
12112
|
}
|
|
12080
12113
|
return { kind: "admin-template", path: resolve18(parent, filename) };
|
|
12081
12114
|
}
|
|
12082
|
-
if (
|
|
12115
|
+
if (UUID_RE4.test(id)) {
|
|
12083
12116
|
const dir = resolve18(ATTACHMENTS_ROOT, accountId, id);
|
|
12084
12117
|
if (!existsSync17(dir)) {
|
|
12085
12118
|
const attShort = id.slice(0, 8);
|
|
@@ -12135,14 +12168,14 @@ var sidebar_artefact_save_default = app30;
|
|
|
12135
12168
|
import { readFile as readFile6, readdir as readdir5 } from "fs/promises";
|
|
12136
12169
|
import { existsSync as existsSync18 } from "fs";
|
|
12137
12170
|
import { resolve as resolve19 } from "path";
|
|
12138
|
-
var
|
|
12171
|
+
var UUID_RE5 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12139
12172
|
var app31 = new Hono();
|
|
12140
12173
|
app31.get("/", requireAdminSession, async (c) => {
|
|
12141
12174
|
const cacheKey = c.var.cacheKey;
|
|
12142
12175
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12143
12176
|
if (!accountId) return new Response("Unauthorized", { status: 401 });
|
|
12144
12177
|
const id = c.req.query("id") ?? "";
|
|
12145
|
-
if (!
|
|
12178
|
+
if (!UUID_RE5.test(id)) {
|
|
12146
12179
|
console.error(`[admin/sidebar-artefact-content] not-found id=${id.slice(0, 8)}`);
|
|
12147
12180
|
return new Response("Not found", { status: 404 });
|
|
12148
12181
|
}
|
|
@@ -12253,13 +12286,13 @@ var app33 = new Hono();
|
|
|
12253
12286
|
app33.route("/session", session_default);
|
|
12254
12287
|
app33.route("/new-session-failure", new_session_failure_default);
|
|
12255
12288
|
app33.route("/new-session-submit", new_session_submit_default);
|
|
12256
|
-
app33.route("/failure-report", failure_report_default);
|
|
12257
12289
|
app33.route("/logs", logs_default);
|
|
12258
12290
|
app33.route("/claude-info", claude_info_default);
|
|
12259
12291
|
app33.route("/attachment", attachment_default);
|
|
12260
12292
|
app33.route("/agents", agents_default);
|
|
12261
12293
|
app33.route("/sessions", sessions_default);
|
|
12262
12294
|
app33.route("/claude-sessions", claude_sessions_default);
|
|
12295
|
+
app33.route("/log-ingest", log_ingest_default);
|
|
12263
12296
|
app33.route("/browser", browser_default);
|
|
12264
12297
|
app33.route("/browser-iframe", browser_iframe_default);
|
|
12265
12298
|
app33.route("/device-browser", device_browser_default);
|
|
@@ -12500,7 +12533,7 @@ function startGraphHealthTimer() {
|
|
|
12500
12533
|
}
|
|
12501
12534
|
|
|
12502
12535
|
// app/lib/whatsapp/inbound/claude-bridge.ts
|
|
12503
|
-
var
|
|
12536
|
+
var TAG20 = "[whatsapp-adaptor]";
|
|
12504
12537
|
function whatsappTurnTimeoutMs() {
|
|
12505
12538
|
return Number(process.env.WHATSAPP_PTY_TURN_TIMEOUT_MS ?? String(5 * 6e4));
|
|
12506
12539
|
}
|
|
@@ -12521,7 +12554,7 @@ async function dispatchToClaude(input) {
|
|
|
12521
12554
|
await input.reply(result.turnText);
|
|
12522
12555
|
} catch (err) {
|
|
12523
12556
|
const m = err instanceof Error ? err.message : String(err);
|
|
12524
|
-
console.error(`${
|
|
12557
|
+
console.error(`${TAG20} reject reason=reply-failed senderId=${input.senderId} message=${m}`);
|
|
12525
12558
|
}
|
|
12526
12559
|
}
|
|
12527
12560
|
function startReaper2() {
|
|
@@ -13457,7 +13490,7 @@ if (brandFaviconPath !== "/favicon.ico") {
|
|
|
13457
13490
|
});
|
|
13458
13491
|
}
|
|
13459
13492
|
app35.use("/*", serveStatic({ root: "./public" }));
|
|
13460
|
-
var port =
|
|
13493
|
+
var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
|
|
13461
13494
|
var hostname = process.env.HOSTNAME ?? "127.0.0.1";
|
|
13462
13495
|
var httpServer = serve({ fetch: app35.fetch, port, hostname });
|
|
13463
13496
|
console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|