@rubytech/create-maxy-code 0.1.51 → 0.1.57
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 +209 -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,121 @@ 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
|
-
try {
|
|
8178
|
-
body = await c.req.json();
|
|
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
|
+
if (isLoopback) {
|
|
8111
|
+
console.log(`${TAG18} loopback-spawn-bypass remoteAddr=${remoteAddr}`);
|
|
8112
|
+
return next();
|
|
8113
|
+
}
|
|
8184
8114
|
}
|
|
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) => {
|
|
8115
|
+
return requireAdminSession(c, next);
|
|
8116
|
+
};
|
|
8117
|
+
app14.use("*", requireAdminSessionUnlessLoopbackSpawn);
|
|
8118
|
+
app14.post("/", async (c) => {
|
|
8201
8119
|
const routeStart = Date.now();
|
|
8202
8120
|
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
8121
|
let body = {};
|
|
8210
8122
|
try {
|
|
8211
8123
|
body = await c.req.json();
|
|
8212
8124
|
} catch {
|
|
8213
8125
|
}
|
|
8126
|
+
let senderId;
|
|
8127
|
+
let userId;
|
|
8128
|
+
let specialist;
|
|
8129
|
+
let originatingSessionId;
|
|
8130
|
+
let authSurface;
|
|
8131
|
+
if (cacheKey) {
|
|
8132
|
+
authSurface = "cookie";
|
|
8133
|
+
senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8134
|
+
if (!senderId) {
|
|
8135
|
+
console.error(`${TAG18} reject reason=no-account-id cacheKey-prefix=${cacheKey.slice(0, 8)}`);
|
|
8136
|
+
return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
8137
|
+
}
|
|
8138
|
+
userId = getUserIdForSession(cacheKey) ?? void 0;
|
|
8139
|
+
specialist = void 0;
|
|
8140
|
+
originatingSessionId = void 0;
|
|
8141
|
+
} else {
|
|
8142
|
+
authSurface = "loopback";
|
|
8143
|
+
if (typeof body.originatingSessionId !== "string" || !UUID_PATTERN.test(body.originatingSessionId)) {
|
|
8144
|
+
console.log(`[turn-recorder] spawn-failed sessionId=unknown reason=missing-originating-session-id`);
|
|
8145
|
+
return c.json({ error: "originating-session-id-required" }, 400);
|
|
8146
|
+
}
|
|
8147
|
+
originatingSessionId = body.originatingSessionId;
|
|
8148
|
+
const operatorMeta = await fetch(
|
|
8149
|
+
`${managerBase2()}/${encodeURIComponent(originatingSessionId)}/meta`
|
|
8150
|
+
).then((r) => r.ok ? r.json() : null).catch((err) => {
|
|
8151
|
+
console.error(`${TAG18} fetch-failed op=operator-meta-lookup message=${err instanceof Error ? err.message : String(err)}`);
|
|
8152
|
+
return null;
|
|
8153
|
+
});
|
|
8154
|
+
const operatorSenderId = operatorMeta && typeof operatorMeta.senderId === "string" && operatorMeta.senderId.length > 0 ? operatorMeta.senderId : null;
|
|
8155
|
+
if (!operatorSenderId) {
|
|
8156
|
+
console.log(
|
|
8157
|
+
`[turn-recorder] spawn-failed sessionId=${originatingSessionId} reason=originating-session-not-found`
|
|
8158
|
+
);
|
|
8159
|
+
return c.json({ error: "originating-session-not-found" }, 404);
|
|
8160
|
+
}
|
|
8161
|
+
senderId = operatorSenderId;
|
|
8162
|
+
userId = void 0;
|
|
8163
|
+
specialist = typeof body.specialist === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(body.specialist) ? body.specialist : "database-operator";
|
|
8164
|
+
}
|
|
8214
8165
|
const channel = typeof body.channel === "string" ? body.channel : "browser";
|
|
8215
8166
|
const initialMessage = typeof body.initialMessage === "string" && body.initialMessage.trim() ? body.initialMessage : null;
|
|
8167
|
+
const initialMessageBytes = initialMessage ? Buffer.byteLength(initialMessage, "utf8") : 0;
|
|
8216
8168
|
const permissionMode = typeof body.permissionMode === "string" ? body.permissionMode : void 0;
|
|
8217
|
-
|
|
8218
|
-
|
|
8169
|
+
if (authSurface === "cookie") {
|
|
8170
|
+
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"}`);
|
|
8171
|
+
} else {
|
|
8172
|
+
console.log(`[turn-recorder] spawn-request sessionId=${originatingSessionId} specialist=${specialist ?? "none"} initialMessageBytes=${initialMessageBytes}`);
|
|
8173
|
+
}
|
|
8174
|
+
const t0 = Date.now();
|
|
8175
|
+
const response = await performSpawnWithInitialMessage({
|
|
8219
8176
|
senderId,
|
|
8220
|
-
userId
|
|
8177
|
+
userId,
|
|
8221
8178
|
role: "admin",
|
|
8222
8179
|
channel,
|
|
8223
8180
|
permissionMode,
|
|
8224
8181
|
hidden: false,
|
|
8225
|
-
specialist
|
|
8226
|
-
initialMessage
|
|
8182
|
+
specialist,
|
|
8183
|
+
initialMessage,
|
|
8184
|
+
originatingSessionId
|
|
8227
8185
|
});
|
|
8228
|
-
|
|
8229
|
-
|
|
8186
|
+
if (authSurface === "loopback" && originatingSessionId) {
|
|
8187
|
+
const respText = await response.text().catch(() => "");
|
|
8188
|
+
const respStatus = response.status;
|
|
8189
|
+
const replay = new Response(respText, { status: respStatus, headers: response.headers });
|
|
8190
|
+
let parsed = null;
|
|
8191
|
+
try {
|
|
8192
|
+
parsed = JSON.parse(respText);
|
|
8193
|
+
} catch {
|
|
8194
|
+
parsed = null;
|
|
8195
|
+
}
|
|
8196
|
+
if (respStatus >= 200 && respStatus < 300 && parsed && typeof parsed.sessionId === "string") {
|
|
8197
|
+
const recorderSessionId = parsed.sessionId;
|
|
8198
|
+
console.log(
|
|
8199
|
+
`[turn-recorder] spawn-success sessionId=${originatingSessionId} recorderSessionId=${recorderSessionId} pid=${parsed.pid ?? 0} latency-ms=${Date.now() - t0}`
|
|
8200
|
+
);
|
|
8201
|
+
if (initialMessage) {
|
|
8202
|
+
console.log(
|
|
8203
|
+
`[turn-recorder] input-delivered sessionId=${originatingSessionId} recorderSessionId=${recorderSessionId} bytes=${initialMessageBytes} multiline=${initialMessage.includes("\n")}`
|
|
8204
|
+
);
|
|
8205
|
+
}
|
|
8206
|
+
} else {
|
|
8207
|
+
const reasonRaw = parsed && typeof parsed.error === "string" ? parsed.error : "unknown";
|
|
8208
|
+
if (reasonRaw !== "tool-surface-missing" && reasonRaw !== "missing-originating-session-id") {
|
|
8209
|
+
const detail = parsed && typeof parsed.detail === "string" ? parsed.detail.slice(0, 200) : "";
|
|
8210
|
+
console.log(
|
|
8211
|
+
`[turn-recorder] spawn-failed sessionId=${originatingSessionId} reason=manager-spawn http=${respStatus} err=${JSON.stringify(detail || reasonRaw)}`
|
|
8212
|
+
);
|
|
8213
|
+
}
|
|
8214
|
+
}
|
|
8215
|
+
return replay;
|
|
8216
|
+
}
|
|
8217
|
+
console.log(`${TAG18} route-done surface=cookie status=${response.status} route-ms=${Date.now() - routeStart}`);
|
|
8218
|
+
return response;
|
|
8230
8219
|
});
|
|
8231
|
-
|
|
8220
|
+
app14.get("/events", async (c) => {
|
|
8232
8221
|
const upstream = await fetch(`${managerBase2()}/events`, {
|
|
8233
8222
|
headers: { accept: "text/event-stream" }
|
|
8234
8223
|
}).catch((err) => {
|
|
@@ -8246,7 +8235,7 @@ app15.get("/events", async (c) => {
|
|
|
8246
8235
|
}
|
|
8247
8236
|
});
|
|
8248
8237
|
});
|
|
8249
|
-
|
|
8238
|
+
app14.get("/", async (c) => {
|
|
8250
8239
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
8251
8240
|
const senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8252
8241
|
if (!senderId) return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
@@ -8259,7 +8248,7 @@ app15.get("/", async (c) => {
|
|
|
8259
8248
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8260
8249
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8261
8250
|
});
|
|
8262
|
-
|
|
8251
|
+
app14.post("/resume", async (c) => {
|
|
8263
8252
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
8264
8253
|
const senderId = getAccountIdForSession(cacheKey) ?? "";
|
|
8265
8254
|
if (!senderId) return c.json({ error: "admin-account-not-resolved" }, 500);
|
|
@@ -8270,8 +8259,8 @@ app15.post("/resume", async (c) => {
|
|
|
8270
8259
|
} catch {
|
|
8271
8260
|
return c.json({ error: "body-not-json" }, 400);
|
|
8272
8261
|
}
|
|
8273
|
-
if (typeof body.
|
|
8274
|
-
return c.json({ error: "
|
|
8262
|
+
if (typeof body.sessionId !== "string" || !body.sessionId) {
|
|
8263
|
+
return c.json({ error: "sessionId-required" }, 400);
|
|
8275
8264
|
}
|
|
8276
8265
|
const channel = typeof body.channel === "string" ? body.channel : "browser";
|
|
8277
8266
|
const aboutOwner = await resolveOwnerProfileBlock(senderId, userId);
|
|
@@ -8286,7 +8275,7 @@ app15.post("/resume", async (c) => {
|
|
|
8286
8275
|
senderId,
|
|
8287
8276
|
role: "admin",
|
|
8288
8277
|
channel,
|
|
8289
|
-
|
|
8278
|
+
sessionId: body.sessionId,
|
|
8290
8279
|
aboutOwner,
|
|
8291
8280
|
dormantPlugins,
|
|
8292
8281
|
activePlugins,
|
|
@@ -8300,7 +8289,7 @@ app15.post("/resume", async (c) => {
|
|
|
8300
8289
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8301
8290
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8302
8291
|
});
|
|
8303
|
-
|
|
8292
|
+
app14.post("/:sessionId/stop", async (c) => {
|
|
8304
8293
|
const sessionId = c.req.param("sessionId");
|
|
8305
8294
|
const upstream = await fetch(
|
|
8306
8295
|
`${managerBase2()}/${encodeURIComponent(sessionId)}/stop`,
|
|
@@ -8312,7 +8301,7 @@ app15.post("/:sessionId/stop", async (c) => {
|
|
|
8312
8301
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8313
8302
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8314
8303
|
});
|
|
8315
|
-
|
|
8304
|
+
app14.delete("/:sessionId", async (c) => {
|
|
8316
8305
|
const sessionId = c.req.param("sessionId");
|
|
8317
8306
|
const upstream = await fetch(
|
|
8318
8307
|
`${managerBase2()}/${encodeURIComponent(sessionId)}`,
|
|
@@ -8324,7 +8313,7 @@ app15.delete("/:sessionId", async (c) => {
|
|
|
8324
8313
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8325
8314
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8326
8315
|
});
|
|
8327
|
-
|
|
8316
|
+
app14.post("/:sessionId/archive", async (c) => {
|
|
8328
8317
|
const sessionId = c.req.param("sessionId");
|
|
8329
8318
|
const body = await c.req.text();
|
|
8330
8319
|
const upstream = await fetch(
|
|
@@ -8341,7 +8330,7 @@ app15.post("/:sessionId/archive", async (c) => {
|
|
|
8341
8330
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8342
8331
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8343
8332
|
});
|
|
8344
|
-
|
|
8333
|
+
app14.get("/:sessionId/meta", async (c) => {
|
|
8345
8334
|
const sessionId = c.req.param("sessionId");
|
|
8346
8335
|
const upstream = await fetch(
|
|
8347
8336
|
`${managerBase2()}/${encodeURIComponent(sessionId)}/meta`
|
|
@@ -8352,7 +8341,7 @@ app15.get("/:sessionId/meta", async (c) => {
|
|
|
8352
8341
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8353
8342
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8354
8343
|
});
|
|
8355
|
-
|
|
8344
|
+
app14.patch("/:sessionId", async (c) => {
|
|
8356
8345
|
const sessionId = c.req.param("sessionId");
|
|
8357
8346
|
const body = await c.req.text();
|
|
8358
8347
|
const upstream = await fetch(
|
|
@@ -8369,7 +8358,7 @@ app15.patch("/:sessionId", async (c) => {
|
|
|
8369
8358
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8370
8359
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8371
8360
|
});
|
|
8372
|
-
|
|
8361
|
+
app14.post("/:sessionId/input", async (c) => {
|
|
8373
8362
|
const sessionId = c.req.param("sessionId");
|
|
8374
8363
|
const rawBody = await c.req.text();
|
|
8375
8364
|
const upstream = await fetch(
|
|
@@ -8386,7 +8375,7 @@ app15.post("/:sessionId/input", async (c) => {
|
|
|
8386
8375
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8387
8376
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8388
8377
|
});
|
|
8389
|
-
|
|
8378
|
+
app14.get("/:sessionId/log", async (c) => {
|
|
8390
8379
|
const sessionId = c.req.param("sessionId");
|
|
8391
8380
|
const follow = c.req.query("follow") === "1" ? "?follow=1" : "";
|
|
8392
8381
|
const upstream = await fetch(
|
|
@@ -8398,7 +8387,49 @@ app15.get("/:sessionId/log", async (c) => {
|
|
|
8398
8387
|
if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
|
|
8399
8388
|
return new Response(upstream.body, { status: upstream.status, headers: upstream.headers });
|
|
8400
8389
|
});
|
|
8401
|
-
var claude_sessions_default =
|
|
8390
|
+
var claude_sessions_default = app14;
|
|
8391
|
+
|
|
8392
|
+
// server/routes/admin/log-ingest.ts
|
|
8393
|
+
var TAG19 = "[log-ingest]";
|
|
8394
|
+
var TAG_PATTERN = /^[A-Za-z0-9_-]{1,32}$/;
|
|
8395
|
+
var LEVELS = /* @__PURE__ */ new Set(["debug", "info", "warn", "error"]);
|
|
8396
|
+
var MAX_LINE_BYTES = 4096;
|
|
8397
|
+
var app15 = new Hono();
|
|
8398
|
+
app15.post("/", async (c) => {
|
|
8399
|
+
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
8400
|
+
const isLoopback = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
|
|
8401
|
+
if (!isLoopback) {
|
|
8402
|
+
console.error(`${TAG19} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
8403
|
+
return c.json({ error: "log-ingest-loopback-only" }, 403);
|
|
8404
|
+
}
|
|
8405
|
+
let body = {};
|
|
8406
|
+
try {
|
|
8407
|
+
body = await c.req.json();
|
|
8408
|
+
} catch {
|
|
8409
|
+
return c.json({ error: "body-not-json" }, 400);
|
|
8410
|
+
}
|
|
8411
|
+
if (typeof body.tag !== "string" || !TAG_PATTERN.test(body.tag)) {
|
|
8412
|
+
return c.json({ error: "tag-invalid" }, 400);
|
|
8413
|
+
}
|
|
8414
|
+
if (typeof body.level !== "string" || !LEVELS.has(body.level)) {
|
|
8415
|
+
return c.json({ error: "level-invalid" }, 400);
|
|
8416
|
+
}
|
|
8417
|
+
if (typeof body.line !== "string" || body.line.length === 0) {
|
|
8418
|
+
return c.json({ error: "line-required" }, 400);
|
|
8419
|
+
}
|
|
8420
|
+
if (body.line.includes("\n") || body.line.includes("\r")) {
|
|
8421
|
+
return c.json({ error: "line-must-be-single-line" }, 400);
|
|
8422
|
+
}
|
|
8423
|
+
if (Buffer.byteLength(body.line, "utf8") > MAX_LINE_BYTES) {
|
|
8424
|
+
return c.json({ error: "line-too-long", max: MAX_LINE_BYTES }, 400);
|
|
8425
|
+
}
|
|
8426
|
+
const formatted = `[${body.tag}] ${body.line}`;
|
|
8427
|
+
if (body.level === "error") console.error(formatted);
|
|
8428
|
+
else if (body.level === "warn") console.warn(formatted);
|
|
8429
|
+
else console.log(formatted);
|
|
8430
|
+
return c.json({ ok: true }, 200);
|
|
8431
|
+
});
|
|
8432
|
+
var log_ingest_default = app15;
|
|
8402
8433
|
|
|
8403
8434
|
// server/routes/admin/browser.ts
|
|
8404
8435
|
var app16 = new Hono();
|
|
@@ -8508,13 +8539,13 @@ async function cdpNavigateNewTab(url, opts = {}) {
|
|
|
8508
8539
|
// server/routes/admin/device-browser.ts
|
|
8509
8540
|
var app18 = new Hono();
|
|
8510
8541
|
app18.post("/navigate", async (c) => {
|
|
8511
|
-
const
|
|
8542
|
+
const TAG21 = "[device-url:click]";
|
|
8512
8543
|
let body;
|
|
8513
8544
|
try {
|
|
8514
8545
|
body = await c.req.json();
|
|
8515
8546
|
} catch (err) {
|
|
8516
8547
|
const detail = err instanceof Error ? err.message : String(err);
|
|
8517
|
-
console.error(`${
|
|
8548
|
+
console.error(`${TAG21} reject reason=body-not-json detail=${detail} browser=fallback navigateResult=error`);
|
|
8518
8549
|
return c.json(
|
|
8519
8550
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "Request body was not valid JSON" },
|
|
8520
8551
|
400
|
|
@@ -8524,7 +8555,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8524
8555
|
const intent = typeof body.intent === "string" ? body.intent : "";
|
|
8525
8556
|
const hostname2 = typeof body.hostname === "string" ? body.hostname : "";
|
|
8526
8557
|
if (!url) {
|
|
8527
|
-
console.error(`${
|
|
8558
|
+
console.error(`${TAG21} reject reason=missing-url intent=${JSON.stringify(intent)} browser=fallback navigateResult=error`);
|
|
8528
8559
|
return c.json(
|
|
8529
8560
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "url field is required" },
|
|
8530
8561
|
400
|
|
@@ -8534,7 +8565,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8534
8565
|
try {
|
|
8535
8566
|
parsed = new URL(url);
|
|
8536
8567
|
} catch {
|
|
8537
|
-
console.error(`${
|
|
8568
|
+
console.error(`${TAG21} reject reason=url-malformed intent=${JSON.stringify(intent)} url=${url} browser=fallback navigateResult=error`);
|
|
8538
8569
|
return c.json(
|
|
8539
8570
|
{ ok: false, navigateResult: "error", browser: "fallback", detail: "url is not a valid URL" },
|
|
8540
8571
|
400
|
|
@@ -8542,7 +8573,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8542
8573
|
}
|
|
8543
8574
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
8544
8575
|
console.error(
|
|
8545
|
-
`${
|
|
8576
|
+
`${TAG21} reject reason=scheme-not-allowed scheme=${parsed.protocol} intent=${JSON.stringify(intent)} browser=fallback navigateResult=error`
|
|
8546
8577
|
);
|
|
8547
8578
|
return c.json(
|
|
8548
8579
|
{
|
|
@@ -8558,7 +8589,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8558
8589
|
const cdpOk = await ensureCdp(transport);
|
|
8559
8590
|
if (!cdpOk) {
|
|
8560
8591
|
console.error(
|
|
8561
|
-
`${
|
|
8592
|
+
`${TAG21} intent=${JSON.stringify(intent)} browser=fallback navigateResult=cdp-unreachable hostname=${JSON.stringify(hostname2)}`
|
|
8562
8593
|
);
|
|
8563
8594
|
return c.json(
|
|
8564
8595
|
{
|
|
@@ -8574,7 +8605,7 @@ app18.post("/navigate", async (c) => {
|
|
|
8574
8605
|
const browser = outcome.result === "ok" ? "vnc" : "fallback";
|
|
8575
8606
|
const detailStr = outcome.detail ? ` detail=${JSON.stringify(outcome.detail.length > 230 ? outcome.detail.slice(0, 227) + "..." : outcome.detail)}` : "";
|
|
8576
8607
|
console.error(
|
|
8577
|
-
`${
|
|
8608
|
+
`${TAG21} intent=${JSON.stringify(intent)} browser=${browser} navigateResult=${outcome.result} hostname=${JSON.stringify(hostname2)} targetId=${outcome.targetId ?? "none"}${detailStr}`
|
|
8578
8609
|
);
|
|
8579
8610
|
if (outcome.result !== "ok") {
|
|
8580
8611
|
return c.json(
|
|
@@ -8605,18 +8636,18 @@ var ALLOWED_EVENTS2 = /* @__PURE__ */ new Set([
|
|
|
8605
8636
|
]);
|
|
8606
8637
|
var app19 = new Hono();
|
|
8607
8638
|
app19.post("/", async (c) => {
|
|
8608
|
-
const
|
|
8639
|
+
const TAG21 = "[admin:events]";
|
|
8609
8640
|
let body;
|
|
8610
8641
|
try {
|
|
8611
8642
|
body = await c.req.json();
|
|
8612
8643
|
} catch (err) {
|
|
8613
8644
|
const detail = err instanceof Error ? err.message : String(err);
|
|
8614
|
-
console.error(`${
|
|
8645
|
+
console.error(`${TAG21} reject reason=body-not-json detail=${detail}`);
|
|
8615
8646
|
return c.json({ ok: false, detail: "Request body was not valid JSON" }, 400);
|
|
8616
8647
|
}
|
|
8617
8648
|
const event = typeof body.event === "string" ? body.event : "";
|
|
8618
8649
|
if (!ALLOWED_EVENTS2.has(event)) {
|
|
8619
|
-
console.error(`${
|
|
8650
|
+
console.error(`${TAG21} reject reason=event-not-allowed event=${JSON.stringify(event)}`);
|
|
8620
8651
|
return c.json({ ok: false, detail: `Event "${event}" is not allowed` }, 400);
|
|
8621
8652
|
}
|
|
8622
8653
|
const rawFields = body.fields && typeof body.fields === "object" ? body.fields : {};
|
|
@@ -9782,7 +9813,7 @@ async function restoreNode(params) {
|
|
|
9782
9813
|
}
|
|
9783
9814
|
|
|
9784
9815
|
// app/lib/file-delete-cascade.ts
|
|
9785
|
-
var
|
|
9816
|
+
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
9817
|
function parseAttachmentPath(relPath2) {
|
|
9787
9818
|
const segments = relPath2.split("/").filter(Boolean);
|
|
9788
9819
|
if (segments.length !== 4) return null;
|
|
@@ -9790,7 +9821,7 @@ function parseAttachmentPath(relPath2) {
|
|
|
9790
9821
|
const accountId = segments[1];
|
|
9791
9822
|
const attachmentId = segments[2];
|
|
9792
9823
|
const filename = segments[3];
|
|
9793
|
-
if (!
|
|
9824
|
+
if (!UUID_RE2.test(accountId) || !UUID_RE2.test(attachmentId)) return null;
|
|
9794
9825
|
const dot = filename.lastIndexOf(".");
|
|
9795
9826
|
if (dot === -1) return null;
|
|
9796
9827
|
const stem = filename.slice(0, dot);
|
|
@@ -9862,7 +9893,7 @@ async function cascadeDeleteDocument(params) {
|
|
|
9862
9893
|
}
|
|
9863
9894
|
|
|
9864
9895
|
// server/routes/admin/files.ts
|
|
9865
|
-
var
|
|
9896
|
+
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
9897
|
async function readMeta(absDir, baseName) {
|
|
9867
9898
|
try {
|
|
9868
9899
|
const raw = await readFile4(join11(absDir, `${baseName}.meta.json`), "utf8");
|
|
@@ -9884,7 +9915,7 @@ async function readAccountNames() {
|
|
|
9884
9915
|
return map;
|
|
9885
9916
|
}
|
|
9886
9917
|
for (const name of names) {
|
|
9887
|
-
if (!
|
|
9918
|
+
if (!UUID_RE3.test(name)) continue;
|
|
9888
9919
|
const configPath2 = resolve16(accountsDir, name, "account.json");
|
|
9889
9920
|
try {
|
|
9890
9921
|
const raw = await readFile4(configPath2, "utf8");
|
|
@@ -9902,7 +9933,7 @@ async function readAccountNames() {
|
|
|
9902
9933
|
return map;
|
|
9903
9934
|
}
|
|
9904
9935
|
async function enrich(absolute, entry, accountNames) {
|
|
9905
|
-
if (entry.kind === "directory" &&
|
|
9936
|
+
if (entry.kind === "directory" && UUID_RE3.test(entry.name)) {
|
|
9906
9937
|
const meta = await readMeta(join11(absolute, entry.name), entry.name);
|
|
9907
9938
|
if (meta?.filename) {
|
|
9908
9939
|
entry.displayName = meta.filename;
|
|
@@ -9918,7 +9949,7 @@ async function enrich(absolute, entry, accountNames) {
|
|
|
9918
9949
|
if (entry.kind === "file") {
|
|
9919
9950
|
const dot = entry.name.lastIndexOf(".");
|
|
9920
9951
|
const base = dot === -1 ? entry.name : entry.name.slice(0, dot);
|
|
9921
|
-
if (
|
|
9952
|
+
if (UUID_RE3.test(base)) {
|
|
9922
9953
|
const meta = await readMeta(absolute, base);
|
|
9923
9954
|
if (meta?.filename) {
|
|
9924
9955
|
entry.displayName = meta.filename;
|
|
@@ -9930,7 +9961,7 @@ async function enrich(absolute, entry, accountNames) {
|
|
|
9930
9961
|
function buildDisplayPath(relPath2, accountNames) {
|
|
9931
9962
|
if (relPath2 === "." || relPath2 === "") return [];
|
|
9932
9963
|
return relPath2.split("/").filter(Boolean).map((seg) => {
|
|
9933
|
-
const dn =
|
|
9964
|
+
const dn = UUID_RE3.test(seg) ? accountNames.get(seg) : void 0;
|
|
9934
9965
|
return dn ? { name: seg, displayName: dn } : { name: seg };
|
|
9935
9966
|
});
|
|
9936
9967
|
}
|
|
@@ -9958,7 +9989,7 @@ app21.get("/", requireAdminSession, async (c) => {
|
|
|
9958
9989
|
const names = await readdir2(absolute);
|
|
9959
9990
|
const entries = [];
|
|
9960
9991
|
for (const name of names) {
|
|
9961
|
-
if (
|
|
9992
|
+
if (UUID_RE3.test(name.replace(/\.meta\.json$/, "")) && name.endsWith(".meta.json")) {
|
|
9962
9993
|
continue;
|
|
9963
9994
|
}
|
|
9964
9995
|
try {
|
|
@@ -10135,7 +10166,7 @@ app21.delete("/", requireAdminSession, async (c) => {
|
|
|
10135
10166
|
}
|
|
10136
10167
|
const dot = base.lastIndexOf(".");
|
|
10137
10168
|
const stem = dot === -1 ? base : base.slice(0, dot);
|
|
10138
|
-
const sidecarPath =
|
|
10169
|
+
const sidecarPath = UUID_RE3.test(stem) && base !== `${stem}.meta.json` ? join11(dirname5(absolute), `${stem}.meta.json`) : null;
|
|
10139
10170
|
await unlink2(absolute);
|
|
10140
10171
|
if (sidecarPath) {
|
|
10141
10172
|
try {
|
|
@@ -12015,7 +12046,7 @@ import { mkdir as mkdir4, readdir as readdir4, stat as stat6, writeFile as write
|
|
|
12015
12046
|
import { resolve as resolve18 } from "path";
|
|
12016
12047
|
import { existsSync as existsSync17 } from "fs";
|
|
12017
12048
|
var ADMIN_AGENT_FILES2 = /* @__PURE__ */ new Set(["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"]);
|
|
12018
|
-
var
|
|
12049
|
+
var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12019
12050
|
var app30 = new Hono();
|
|
12020
12051
|
app30.post("/", requireAdminSession, async (c) => {
|
|
12021
12052
|
const cacheKey = c.var.cacheKey;
|
|
@@ -12079,7 +12110,7 @@ async function resolveSavePath(id, accountId, accountDir) {
|
|
|
12079
12110
|
}
|
|
12080
12111
|
return { kind: "admin-template", path: resolve18(parent, filename) };
|
|
12081
12112
|
}
|
|
12082
|
-
if (
|
|
12113
|
+
if (UUID_RE4.test(id)) {
|
|
12083
12114
|
const dir = resolve18(ATTACHMENTS_ROOT, accountId, id);
|
|
12084
12115
|
if (!existsSync17(dir)) {
|
|
12085
12116
|
const attShort = id.slice(0, 8);
|
|
@@ -12135,14 +12166,14 @@ var sidebar_artefact_save_default = app30;
|
|
|
12135
12166
|
import { readFile as readFile6, readdir as readdir5 } from "fs/promises";
|
|
12136
12167
|
import { existsSync as existsSync18 } from "fs";
|
|
12137
12168
|
import { resolve as resolve19 } from "path";
|
|
12138
|
-
var
|
|
12169
|
+
var UUID_RE5 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12139
12170
|
var app31 = new Hono();
|
|
12140
12171
|
app31.get("/", requireAdminSession, async (c) => {
|
|
12141
12172
|
const cacheKey = c.var.cacheKey;
|
|
12142
12173
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12143
12174
|
if (!accountId) return new Response("Unauthorized", { status: 401 });
|
|
12144
12175
|
const id = c.req.query("id") ?? "";
|
|
12145
|
-
if (!
|
|
12176
|
+
if (!UUID_RE5.test(id)) {
|
|
12146
12177
|
console.error(`[admin/sidebar-artefact-content] not-found id=${id.slice(0, 8)}`);
|
|
12147
12178
|
return new Response("Not found", { status: 404 });
|
|
12148
12179
|
}
|
|
@@ -12253,13 +12284,13 @@ var app33 = new Hono();
|
|
|
12253
12284
|
app33.route("/session", session_default);
|
|
12254
12285
|
app33.route("/new-session-failure", new_session_failure_default);
|
|
12255
12286
|
app33.route("/new-session-submit", new_session_submit_default);
|
|
12256
|
-
app33.route("/failure-report", failure_report_default);
|
|
12257
12287
|
app33.route("/logs", logs_default);
|
|
12258
12288
|
app33.route("/claude-info", claude_info_default);
|
|
12259
12289
|
app33.route("/attachment", attachment_default);
|
|
12260
12290
|
app33.route("/agents", agents_default);
|
|
12261
12291
|
app33.route("/sessions", sessions_default);
|
|
12262
12292
|
app33.route("/claude-sessions", claude_sessions_default);
|
|
12293
|
+
app33.route("/log-ingest", log_ingest_default);
|
|
12263
12294
|
app33.route("/browser", browser_default);
|
|
12264
12295
|
app33.route("/browser-iframe", browser_iframe_default);
|
|
12265
12296
|
app33.route("/device-browser", device_browser_default);
|
|
@@ -12500,7 +12531,7 @@ function startGraphHealthTimer() {
|
|
|
12500
12531
|
}
|
|
12501
12532
|
|
|
12502
12533
|
// app/lib/whatsapp/inbound/claude-bridge.ts
|
|
12503
|
-
var
|
|
12534
|
+
var TAG20 = "[whatsapp-adaptor]";
|
|
12504
12535
|
function whatsappTurnTimeoutMs() {
|
|
12505
12536
|
return Number(process.env.WHATSAPP_PTY_TURN_TIMEOUT_MS ?? String(5 * 6e4));
|
|
12506
12537
|
}
|
|
@@ -12521,7 +12552,7 @@ async function dispatchToClaude(input) {
|
|
|
12521
12552
|
await input.reply(result.turnText);
|
|
12522
12553
|
} catch (err) {
|
|
12523
12554
|
const m = err instanceof Error ? err.message : String(err);
|
|
12524
|
-
console.error(`${
|
|
12555
|
+
console.error(`${TAG20} reject reason=reply-failed senderId=${input.senderId} message=${m}`);
|
|
12525
12556
|
}
|
|
12526
12557
|
}
|
|
12527
12558
|
function startReaper2() {
|
|
@@ -13457,7 +13488,7 @@ if (brandFaviconPath !== "/favicon.ico") {
|
|
|
13457
13488
|
});
|
|
13458
13489
|
}
|
|
13459
13490
|
app35.use("/*", serveStatic({ root: "./public" }));
|
|
13460
|
-
var port =
|
|
13491
|
+
var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
|
|
13461
13492
|
var hostname = process.env.HOSTNAME ?? "127.0.0.1";
|
|
13462
13493
|
var httpServer = serve({ fetch: app35.fetch, port, hostname });
|
|
13463
13494
|
console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|