@rubytech/create-sitedesk-code 0.1.340
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__/account-id-env.test.js +48 -0
- package/dist/__tests__/apt-resolve.test.js +179 -0
- package/dist/__tests__/base-toolchain-deps.test.js +67 -0
- package/dist/__tests__/brand-fonts.test.js +102 -0
- package/dist/__tests__/brew-install.test.js +151 -0
- package/dist/__tests__/brew-resolve.test.js +138 -0
- package/dist/__tests__/bundler-rewrite-platform-lib.test.js +68 -0
- package/dist/__tests__/cdp-port-no-silent-fallback.test.js +53 -0
- package/dist/__tests__/claude-ptys-slice.test.js +25 -0
- package/dist/__tests__/cloudflared-slice.test.js +20 -0
- package/dist/__tests__/cloudflared-version-pin.test.js +24 -0
- package/dist/__tests__/entitlement-flag.test.js +43 -0
- package/dist/__tests__/init-logging.test.js +85 -0
- package/dist/__tests__/install-immutability.test.js +55 -0
- package/dist/__tests__/installer-settings-permissions.test.js +220 -0
- package/dist/__tests__/installer-specialist-registration.test.js +116 -0
- package/dist/__tests__/launchd-plist.test.js +195 -0
- package/dist/__tests__/macos-darwin-branch.test.js +83 -0
- package/dist/__tests__/macos-version.test.js +96 -0
- package/dist/__tests__/peer-brand-detect.test.js +103 -0
- package/dist/__tests__/platform-detect.test.js +50 -0
- package/dist/__tests__/platform-port-stamp.test.js +28 -0
- package/dist/__tests__/plugin-install.test.js +145 -0
- package/dist/__tests__/port-canonicalisation.test.js +200 -0
- package/dist/__tests__/preflight-port-classifier.test.js +330 -0
- package/dist/__tests__/premium-bundle-gate.test.js +59 -0
- package/dist/__tests__/premium-mcp-discover.test.js +127 -0
- package/dist/__tests__/samba-provision.test.js +294 -0
- package/dist/__tests__/snap-chromium.test.js +115 -0
- package/dist/__tests__/tier-flag.test.js +53 -0
- package/dist/__tests__/watchdog-deferred-arming.test.js +64 -0
- package/dist/apt-resolve.js +73 -0
- package/dist/brew-install.js +180 -0
- package/dist/brew-resolve.js +68 -0
- package/dist/bundler-rewrite-platform-lib.js +29 -0
- package/dist/index.js +4418 -0
- package/dist/init-logging.js +28 -0
- package/dist/install-immutability.js +59 -0
- package/dist/launchd-plist.js +68 -0
- package/dist/lib/plugin-install.js +126 -0
- package/dist/lib/premium-mcp-discover.js +41 -0
- package/dist/macos-version.js +53 -0
- package/dist/peer-brand-detect.js +39 -0
- package/dist/permissions-seed.js +147 -0
- package/dist/pinned-binaries.js +12 -0
- package/dist/platform-detect.js +36 -0
- package/dist/port-resolution.js +209 -0
- package/dist/preflight-port-classifier.js +222 -0
- package/dist/samba-provision.js +275 -0
- package/dist/snap-chromium.js +88 -0
- package/dist/specialist-registration.js +78 -0
- package/dist/tier-flag.js +85 -0
- package/dist/uninstall.js +952 -0
- package/package.json +35 -0
- package/payload/platform/.docs/search-surface-contract.md +58 -0
- package/payload/platform/config/brand-registry.json +28 -0
- package/payload/platform/config/brand.json +82 -0
- package/payload/platform/docs/superpowers/plans/2026-06-02-task-610-follower-202-retry.md +372 -0
- package/payload/platform/docs/superpowers/plans/2026-06-04-public-agent-knowledge-delivery.md +230 -0
- package/payload/platform/docs/superpowers/specs/2026-06-02-task-610-follower-202-retry-design.md +116 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts +2 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js +88 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.d.ts +2 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.js +55 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.js.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts +82 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.js +185 -0
- package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -0
- package/payload/platform/lib/account-enumeration/src/__tests__/enumerate.test.ts +94 -0
- package/payload/platform/lib/account-enumeration/src/__tests__/validate-env.test.ts +57 -0
- package/payload/platform/lib/account-enumeration/src/index.ts +218 -0
- package/payload/platform/lib/account-enumeration/tsconfig.json +8 -0
- package/payload/platform/lib/admin-access-password/__tests__/index.test.ts +142 -0
- package/payload/platform/lib/admin-access-password/dist/index.d.ts +49 -0
- package/payload/platform/lib/admin-access-password/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/admin-access-password/dist/index.js +198 -0
- package/payload/platform/lib/admin-access-password/dist/index.js.map +1 -0
- package/payload/platform/lib/admin-access-password/src/index.ts +176 -0
- package/payload/platform/lib/admin-access-password/tsconfig.json +8 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.d.ts +54 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.js +84 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.js.map +1 -0
- package/payload/platform/lib/admin-conversation-purge/src/index.ts +120 -0
- package/payload/platform/lib/admin-conversation-purge/tsconfig.json +8 -0
- package/payload/platform/lib/admins-write/dist/index.d.ts +86 -0
- package/payload/platform/lib/admins-write/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/admins-write/dist/index.js +245 -0
- package/payload/platform/lib/admins-write/dist/index.js.map +1 -0
- package/payload/platform/lib/admins-write/src/index.ts +305 -0
- package/payload/platform/lib/admins-write/tsconfig.json +8 -0
- package/payload/platform/lib/aeo-llms-txt-writer/dist/index.d.ts +33 -0
- package/payload/platform/lib/aeo-llms-txt-writer/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/aeo-llms-txt-writer/dist/index.js +119 -0
- package/payload/platform/lib/aeo-llms-txt-writer/dist/index.js.map +1 -0
- package/payload/platform/lib/aeo-llms-txt-writer/src/index.ts +172 -0
- package/payload/platform/lib/aeo-llms-txt-writer/tsconfig.json +8 -0
- package/payload/platform/lib/anthropic-key/dist/index.d.ts +22 -0
- package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/anthropic-key/dist/index.js +232 -0
- package/payload/platform/lib/anthropic-key/dist/index.js.map +1 -0
- package/payload/platform/lib/brand-templating/dist/index.d.ts +18 -0
- package/payload/platform/lib/brand-templating/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/brand-templating/dist/index.js +69 -0
- package/payload/platform/lib/brand-templating/dist/index.js.map +1 -0
- package/payload/platform/lib/brand-templating/src/index.ts +76 -0
- package/payload/platform/lib/brand-templating/tsconfig.json +8 -0
- package/payload/platform/lib/device-url/dist/index.d.ts +44 -0
- package/payload/platform/lib/device-url/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/device-url/dist/index.js +68 -0
- package/payload/platform/lib/device-url/dist/index.js.map +1 -0
- package/payload/platform/lib/device-url/src/index.ts +78 -0
- package/payload/platform/lib/device-url/tsconfig.json +8 -0
- package/payload/platform/lib/embed-client/dist/index.d.ts +6 -0
- package/payload/platform/lib/embed-client/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/embed-client/dist/index.js +93 -0
- package/payload/platform/lib/embed-client/dist/index.js.map +1 -0
- package/payload/platform/lib/embed-client/src/index.ts +101 -0
- package/payload/platform/lib/embed-client/tsconfig.json +8 -0
- package/payload/platform/lib/entitlement/PUBKEY-HASH.txt +1 -0
- package/payload/platform/lib/entitlement/dist/canonicalize.d.ts +26 -0
- package/payload/platform/lib/entitlement/dist/canonicalize.d.ts.map +1 -0
- package/payload/platform/lib/entitlement/dist/canonicalize.js +54 -0
- package/payload/platform/lib/entitlement/dist/canonicalize.js.map +1 -0
- package/payload/platform/lib/entitlement/dist/index.d.ts +76 -0
- package/payload/platform/lib/entitlement/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/entitlement/dist/index.js +293 -0
- package/payload/platform/lib/entitlement/dist/index.js.map +1 -0
- package/payload/platform/lib/entitlement/rubytech-pubkey.pem +3 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.js +97 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate.test.js +112 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cache.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cache.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cache.test.js +163 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cache.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js +89 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.js +140 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.d.ts +37 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.js +333 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.d.ts +85 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.js +93 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.d.ts +71 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.js +168 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.d.ts +50 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.js +197 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/index.d.ts +26 -0
- package/payload/platform/lib/graph-mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/index.js +845 -0
- package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cache.d.ts +76 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cache.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cache.js +218 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cache.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts +42 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js +87 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js.map +1 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/cypher-validate-write.test.ts +150 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/cypher-validate.test.ts +141 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/schema-cache.test.ts +169 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/schema-cypher-parser.test.ts +99 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/warnings-envelope.test.ts +151 -0
- package/payload/platform/lib/graph-mcp/src/cypher-rewrite-stamp.ts +349 -0
- package/payload/platform/lib/graph-mcp/src/cypher-shim-read.ts +141 -0
- package/payload/platform/lib/graph-mcp/src/cypher-shim-write.ts +240 -0
- package/payload/platform/lib/graph-mcp/src/cypher-validate.ts +249 -0
- package/payload/platform/lib/graph-mcp/src/index.ts +1074 -0
- package/payload/platform/lib/graph-mcp/src/schema-cache.ts +243 -0
- package/payload/platform/lib/graph-mcp/src/schema-cypher-parser.ts +84 -0
- package/payload/platform/lib/graph-mcp/tsconfig.json +8 -0
- package/payload/platform/lib/graph-search/dist/boosts.d.ts +39 -0
- package/payload/platform/lib/graph-search/dist/boosts.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/boosts.js +57 -0
- package/payload/platform/lib/graph-search/dist/boosts.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/dedup.d.ts +29 -0
- package/payload/platform/lib/graph-search/dist/dedup.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/dedup.js +97 -0
- package/payload/platform/lib/graph-search/dist/dedup.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/index.d.ts +342 -0
- package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/index.js +848 -0
- package/payload/platform/lib/graph-search/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +37 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.js +101 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/route.d.ts +29 -0
- package/payload/platform/lib/graph-search/dist/route.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/route.js +53 -0
- package/payload/platform/lib/graph-search/dist/route.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.d.ts +31 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.js +57 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.js.map +1 -0
- package/payload/platform/lib/graph-search/src/__tests__/bm25-label-gate.test.ts +88 -0
- package/payload/platform/lib/graph-search/src/__tests__/bm25-only.test.ts +129 -0
- package/payload/platform/lib/graph-search/src/__tests__/bm25-strong-bypass-threshold.test.ts +126 -0
- package/payload/platform/lib/graph-search/src/__tests__/boosts.test.ts +59 -0
- package/payload/platform/lib/graph-search/src/__tests__/brochure-threshold.test.ts +136 -0
- package/payload/platform/lib/graph-search/src/__tests__/dedup.test.ts +83 -0
- package/payload/platform/lib/graph-search/src/__tests__/escape-and-normalise.test.ts +53 -0
- package/payload/platform/lib/graph-search/src/__tests__/expand-batch.test.ts +206 -0
- package/payload/platform/lib/graph-search/src/__tests__/fulltext-coverage.test.ts +348 -0
- package/payload/platform/lib/graph-search/src/__tests__/hybrid.test.ts +355 -0
- package/payload/platform/lib/graph-search/src/__tests__/route.test.ts +62 -0
- package/payload/platform/lib/graph-search/src/__tests__/rrf-fusion.test.ts +39 -0
- package/payload/platform/lib/graph-search/src/__tests__/vector-index-coverage.test.ts +198 -0
- package/payload/platform/lib/graph-search/src/__tests__/vector-threshold.test.ts +170 -0
- package/payload/platform/lib/graph-search/src/boosts.ts +61 -0
- package/payload/platform/lib/graph-search/src/dedup.ts +108 -0
- package/payload/platform/lib/graph-search/src/index.ts +1144 -0
- package/payload/platform/lib/graph-search/src/route.ts +70 -0
- package/payload/platform/lib/graph-search/src/rrf-fusion.ts +62 -0
- package/payload/platform/lib/graph-search/tsconfig.json +9 -0
- package/payload/platform/lib/graph-search/vitest.config.ts +9 -0
- package/payload/platform/lib/graph-style/dist/index.d.ts +84 -0
- package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-style/dist/index.js +378 -0
- package/payload/platform/lib/graph-style/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-style/src/__tests__/parity.test.ts +332 -0
- package/payload/platform/lib/graph-style/src/index.ts +382 -0
- package/payload/platform/lib/graph-style/tsconfig.json +9 -0
- package/payload/platform/lib/graph-style/vitest.config.ts +9 -0
- package/payload/platform/lib/graph-trash/dist/index.d.ts +106 -0
- package/payload/platform/lib/graph-trash/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-trash/dist/index.js +340 -0
- package/payload/platform/lib/graph-trash/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-trash/package.json +7 -0
- package/payload/platform/lib/graph-trash/src/index.ts +493 -0
- package/payload/platform/lib/graph-trash/tsconfig.json +8 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts +2 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js +165 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.d.ts +2 -0
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js +263 -0
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.d.ts +2 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.js +147 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/audit.d.ts +84 -0
- package/payload/platform/lib/graph-write/dist/audit.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/audit.js +129 -0
- package/payload/platform/lib/graph-write/dist/audit.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/conversation-provenance.d.ts +30 -0
- package/payload/platform/lib/graph-write/dist/conversation-provenance.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/conversation-provenance.js +88 -0
- package/payload/platform/lib/graph-write/dist/conversation-provenance.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/index.d.ts +151 -0
- package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/index.js +380 -0
- package/payload/platform/lib/graph-write/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-write/src/__tests__/account-id-gate.test.ts +189 -0
- package/payload/platform/lib/graph-write/src/__tests__/action-provenance-gate.test.ts +279 -0
- package/payload/platform/lib/graph-write/src/__tests__/audit.test.ts +162 -0
- package/payload/platform/lib/graph-write/src/audit.ts +182 -0
- package/payload/platform/lib/graph-write/src/conversation-provenance.ts +148 -0
- package/payload/platform/lib/graph-write/src/index.ts +494 -0
- package/payload/platform/lib/graph-write/tsconfig.json +8 -0
- package/payload/platform/lib/mcp-eager/dist/index.d.ts +41 -0
- package/payload/platform/lib/mcp-eager/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-eager/dist/index.js +50 -0
- package/payload/platform/lib/mcp-eager/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-eager/package.json +7 -0
- package/payload/platform/lib/mcp-eager/src/index.ts +80 -0
- package/payload/platform/lib/mcp-eager/tsconfig.json +8 -0
- package/payload/platform/lib/mcp-lifeline/dist/index.d.ts +8 -0
- package/payload/platform/lib/mcp-lifeline/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-lifeline/dist/index.js +71 -0
- package/payload/platform/lib/mcp-lifeline/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-lifeline/package.json +7 -0
- package/payload/platform/lib/mcp-lifeline/src/__tests__/lifeline.test.ts +146 -0
- package/payload/platform/lib/mcp-lifeline/src/index.ts +78 -0
- package/payload/platform/lib/mcp-lifeline/tsconfig.json +9 -0
- package/payload/platform/lib/mcp-lifeline/vitest.config.ts +9 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +41 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js +193 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +148 -0
- package/payload/platform/lib/mcp-spawn-tee/src/index.ts +198 -0
- package/payload/platform/lib/mcp-spawn-tee/tsconfig.json +9 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +51 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js +196 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-stderr-tee/package.json +7 -0
- package/payload/platform/lib/mcp-stderr-tee/src/index.ts +206 -0
- package/payload/platform/lib/mcp-stderr-tee/tsconfig.json +8 -0
- package/payload/platform/lib/models/dist/index.d.ts +58 -0
- package/payload/platform/lib/models/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/models/dist/index.js +110 -0
- package/payload/platform/lib/models/dist/index.js.map +1 -0
- package/payload/platform/lib/models/src/index.ts +118 -0
- package/payload/platform/lib/models/tsconfig.json +8 -0
- package/payload/platform/lib/oauth-llm/dist/index.d.ts +116 -0
- package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/oauth-llm/dist/index.js +386 -0
- package/payload/platform/lib/oauth-llm/dist/index.js.map +1 -0
- package/payload/platform/lib/obsidian-parser/dist/index.d.ts +98 -0
- package/payload/platform/lib/obsidian-parser/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/obsidian-parser/dist/index.js +480 -0
- package/payload/platform/lib/obsidian-parser/dist/index.js.map +1 -0
- package/payload/platform/lib/obsidian-parser/src/index.ts +572 -0
- package/payload/platform/lib/obsidian-parser/tsconfig.json +8 -0
- package/payload/platform/lib/persistent-components/dist/index.d.ts +20 -0
- package/payload/platform/lib/persistent-components/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/persistent-components/dist/index.js +31 -0
- package/payload/platform/lib/persistent-components/dist/index.js.map +1 -0
- package/payload/platform/lib/persistent-components/src/index.ts +27 -0
- package/payload/platform/lib/persistent-components/tsconfig.json +8 -0
- 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/lib/screening-patterns/dist/index.d.ts +29 -0
- package/payload/platform/lib/screening-patterns/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/screening-patterns/dist/index.js +48 -0
- package/payload/platform/lib/screening-patterns/dist/index.js.map +1 -0
- package/payload/platform/lib/task-secrets/dist/index.d.ts +40 -0
- package/payload/platform/lib/task-secrets/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/task-secrets/dist/index.js +44 -0
- package/payload/platform/lib/task-secrets/dist/index.js.map +1 -0
- package/payload/platform/lib/task-secrets/src/__tests__/redact-secrets.test.ts +127 -0
- package/payload/platform/lib/task-secrets/src/index.ts +77 -0
- package/payload/platform/lib/task-secrets/tsconfig.json +9 -0
- package/payload/platform/lib/task-secrets/vitest.config.ts +9 -0
- package/payload/platform/neo4j/edge-annotations.json +158 -0
- package/payload/platform/neo4j/schema.cypher +2041 -0
- package/payload/platform/package-lock.json +4093 -0
- package/payload/platform/package.json +31 -0
- package/payload/platform/plugins/.claude-plugin/marketplace.json +163 -0
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/admin/PLUGIN.md +180 -0
- package/payload/platform/plugins/admin/hooks/__tests__/archive-ingest-surface-gate.test.sh +191 -0
- package/payload/platform/plugins/admin/hooks/__tests__/askuserquestion-investigate-gate.test.sh +176 -0
- package/payload/platform/plugins/admin/hooks/__tests__/hook-emit-stale-lock-ttl.test.sh +102 -0
- package/payload/platform/plugins/admin/hooks/__tests__/hook-emit.test.sh +75 -0
- package/payload/platform/plugins/admin/hooks/__tests__/post-tool-use-agent.test.sh +173 -0
- package/payload/platform/plugins/admin/hooks/__tests__/prompt-optimiser-compliance.test.sh +242 -0
- package/payload/platform/plugins/admin/hooks/__tests__/prompt-optimiser-directive.test.sh +191 -0
- package/payload/platform/plugins/admin/hooks/admin-authoring-observer.sh +155 -0
- package/payload/platform/plugins/admin/hooks/archive-ingest-surface-gate.sh +224 -0
- package/payload/platform/plugins/admin/hooks/askuserquestion-investigate-gate.sh +257 -0
- package/payload/platform/plugins/admin/hooks/lib/hook-emit.sh +143 -0
- package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +17 -0
- package/payload/platform/plugins/admin/hooks/mcp-tool-missing.sh +94 -0
- package/payload/platform/plugins/admin/hooks/post-tool-use-agent.sh +155 -0
- package/payload/platform/plugins/admin/hooks/prompt-optimiser-compliance.sh +213 -0
- package/payload/platform/plugins/admin/hooks/prompt-optimiser-directive.sh +166 -0
- package/payload/platform/plugins/admin/hooks/webfetch-preflight.mjs +363 -0
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.js +86 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-authoring-skill-gate.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js +34 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/admin-identity-authenticate.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/capabilities-here.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/capabilities-here.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/capabilities-here.test.js +171 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/capabilities-here.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/e-sign-discoverable.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/e-sign-discoverable.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/e-sign-discoverable.test.js +54 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/e-sign-discoverable.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.js +91 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.js +98 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js +141 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.js +88 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-no-prescribed-role.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-no-prescribed-role.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-no-prescribed-role.test.js +50 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-no-prescribed-role.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-search.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-search.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-search.test.js +106 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-search.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.js +41 -0
- package/payload/platform/plugins/admin/mcp/dist/content-producer-authoring-skills.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js +3294 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/catalogue-census.d.ts +14 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/catalogue-census.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/catalogue-census.js +50 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/catalogue-census.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +39 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +249 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.d.ts +15 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.js +73 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.d.ts +56 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js +358 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/__tests__/account-lifecycle.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/__tests__/account-lifecycle.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/__tests__/account-lifecycle.test.js +57 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/__tests__/account-lifecycle.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts +34 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js +78 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts +6 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js +32 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/admin-identity-authenticate.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/capabilities-here.d.ts +28 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/capabilities-here.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/capabilities-here.js +68 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/capabilities-here.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/publish-site.d.ts +34 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/publish-site.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/publish-site.js +176 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/publish-site.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/package.json +23 -0
- package/payload/platform/plugins/admin/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/admin/references/chat-ui-guide.md +31 -0
- package/payload/platform/plugins/admin/references/publish-site-routing.md +44 -0
- package/payload/platform/plugins/admin/skills/a4-print-documents/SKILL.md +243 -0
- package/payload/platform/plugins/admin/skills/access-manager/SKILL.md +33 -0
- package/payload/platform/plugins/admin/skills/access-manager/references/operations.md +176 -0
- package/payload/platform/plugins/admin/skills/admin-user-management/SKILL.md +57 -0
- package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +55 -0
- package/payload/platform/plugins/admin/skills/capabilities-here/SKILL.md +33 -0
- package/payload/platform/plugins/admin/skills/datetime/SKILL.md +151 -0
- package/payload/platform/plugins/admin/skills/deck-pages/SKILL.md +412 -0
- package/payload/platform/plugins/admin/skills/file-presentation/SKILL.md +49 -0
- package/payload/platform/plugins/admin/skills/insight/SKILL.md +24 -0
- package/payload/platform/plugins/admin/skills/investigate/SKILL.md +320 -0
- package/payload/platform/plugins/admin/skills/plainly/SKILL.md +149 -0
- package/payload/platform/plugins/admin/skills/plainly/references/worked-examples.md +114 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +4181 -0
- package/payload/platform/plugins/admin/skills/plugin-management/SKILL.md +101 -0
- package/payload/platform/plugins/admin/skills/professional-document/SKILL.md +186 -0
- package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +258 -0
- package/payload/platform/plugins/admin/skills/publish-site/SKILL.md +42 -0
- package/payload/platform/plugins/admin/skills/qr-code/SKILL.md +38 -0
- package/payload/platform/plugins/admin/skills/qr-code/references/data-formats.md +113 -0
- package/payload/platform/plugins/admin/skills/session-management/SKILL.md +64 -0
- package/payload/platform/plugins/admin/skills/skill-builder/SKILL.md +115 -0
- package/payload/platform/plugins/admin/skills/skill-builder/references/lean-pattern.md +110 -0
- package/payload/platform/plugins/admin/skills/skill-builder/references/pdf-generation.md +30 -0
- package/payload/platform/plugins/admin/skills/specialist-management/SKILL.md +47 -0
- package/payload/platform/plugins/admin/skills/stream-log-review/SKILL.md +73 -0
- package/payload/platform/plugins/admin/skills/stream-log-review/references/analysis-patterns.md +193 -0
- package/payload/platform/plugins/admin/skills/superpowers-sprint/SKILL.md +363 -0
- package/payload/platform/plugins/admin/skills/task/SKILL.md +316 -0
- package/payload/platform/plugins/admin/skills/unzip-attachment/SKILL.md +84 -0
- package/payload/platform/plugins/admin/skills/unzip-attachment/__tests__/preflight.sh +148 -0
- package/payload/platform/plugins/admin/skills/unzip-attachment/references/safety.md +116 -0
- package/payload/platform/plugins/admin/skills/update-knowledge/SKILL.md +54 -0
- package/payload/platform/plugins/admin/skills/upgrade/SKILL.md +36 -0
- package/payload/platform/plugins/aeo/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/aeo/PLUGIN.md +80 -0
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/audit-heuristics.test.d.ts +2 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/audit-heuristics.test.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/audit-heuristics.test.js +121 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/audit-heuristics.test.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/schema-mapping.test.d.ts +2 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/schema-mapping.test.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/schema-mapping.test.js +129 -0
- package/payload/platform/plugins/aeo/mcp/dist/__tests__/schema-mapping.test.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/aeo/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/index.js +189 -0
- package/payload/platform/plugins/aeo/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/audit-heuristics.d.ts +27 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/audit-heuristics.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/audit-heuristics.js +274 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/audit-heuristics.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/neo4j.js +38 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/schema-mapping.d.ts +48 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/schema-mapping.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/schema-mapping.js +254 -0
- package/payload/platform/plugins/aeo/mcp/dist/lib/schema-mapping.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-audit-page.d.ts +25 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-audit-page.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-audit-page.js +78 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-audit-page.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-emit-jsonld.d.ts +18 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-emit-jsonld.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-emit-jsonld.js +56 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-emit-jsonld.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-write-llms-txt.d.ts +9 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-write-llms-txt.d.ts.map +1 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-write-llms-txt.js +11 -0
- package/payload/platform/plugins/aeo/mcp/dist/tools/aeo-write-llms-txt.js.map +1 -0
- package/payload/platform/plugins/aeo/mcp/package.json +22 -0
- package/payload/platform/plugins/aeo/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/aeo/skills/structured-answer/SKILL.md +55 -0
- package/payload/platform/plugins/browser/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/browser/PLUGIN.md +114 -0
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/browser/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/browser/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/index.js +165 -0
- package/payload/platform/plugins/browser/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-actions.d.ts +98 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-actions.d.ts.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-actions.js +455 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-actions.js.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-render.d.ts +44 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-render.d.ts.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-render.js +89 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-render.js.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-session.d.ts +153 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-session.d.ts.map +1 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-session.js +401 -0
- package/payload/platform/plugins/browser/mcp/dist/lib/cdp-session.js.map +1 -0
- package/payload/platform/plugins/browser/mcp/package.json +19 -0
- package/payload/platform/plugins/business-assistant/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/business-assistant/PLUGIN.md +66 -0
- package/payload/platform/plugins/business-assistant/references/crm.md +118 -0
- package/payload/platform/plugins/business-assistant/references/document-management.md +96 -0
- package/payload/platform/plugins/business-assistant/references/escalation.md +126 -0
- package/payload/platform/plugins/business-assistant/references/invoicing.md +163 -0
- package/payload/platform/plugins/business-assistant/references/profiling.md +50 -0
- package/payload/platform/plugins/business-assistant/references/scheduling.md +127 -0
- package/payload/platform/plugins/business-assistant/references/site-lead-intake.md +52 -0
- package/payload/platform/plugins/business-assistant/references/task-management.md +163 -0
- package/payload/platform/plugins/business-assistant/skills/e-sign/SKILL.md +680 -0
- package/payload/platform/plugins/cloudflare/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/cloudflare/PLUGIN.md +62 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js +24 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +283 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +1155 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +90 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +551 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js.map +1 -0
- package/payload/platform/plugins/cloudflare/mcp/package.json +18 -0
- package/payload/platform/plugins/cloudflare/mcp/vitest.config.ts +10 -0
- package/payload/platform/plugins/cloudflare/references/api.md +255 -0
- package/payload/platform/plugins/cloudflare/references/d1-data-capture.md +165 -0
- package/payload/platform/plugins/cloudflare/references/dashboard-guide.md +184 -0
- package/payload/platform/plugins/cloudflare/references/hosting-sites.md +68 -0
- package/payload/platform/plugins/cloudflare/references/manual-setup.md +710 -0
- package/payload/platform/plugins/cloudflare/references/reset-guide.md +137 -0
- package/payload/platform/plugins/cloudflare/references/serving-published-sites.md +73 -0
- package/payload/platform/plugins/cloudflare/references/web-analytics.md +64 -0
- package/payload/platform/plugins/cloudflare/skills/cloudflare/SKILL.md +91 -0
- package/payload/platform/plugins/contacts/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/contacts/PLUGIN.md +62 -0
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/contacts/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/contacts/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/index.js +467 -0
- package/payload/platform/plugins/contacts/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.d.ts +33 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.js +53 -0
- package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/contact-lookup.test.d.ts +2 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/contact-lookup.test.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/contact-lookup.test.js +71 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/contact-lookup.test.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-create.test.d.ts +2 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-create.test.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-create.test.js +112 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-create.test.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-manage.test.d.ts +2 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-manage.test.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-manage.test.js +102 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/__tests__/group-manage.test.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.d.ts +23 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js +123 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-delete.d.ts +28 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-delete.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-delete.js +39 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-delete.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-erase.d.ts +52 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-erase.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-erase.js +181 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-erase.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-export.d.ts +52 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-export.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-export.js +122 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-export.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.d.ts +23 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.js +49 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.d.ts +22 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.js +77 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.d.ts +14 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.js +43 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.d.ts +18 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.js +100 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-manage.d.ts +15 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-manage.d.ts.map +1 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-manage.js +73 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-manage.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/package.json +21 -0
- package/payload/platform/plugins/deep-research/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/deep-research/PLUGIN.md +19 -0
- package/payload/platform/plugins/deep-research/recipes/README.md +36 -0
- package/payload/platform/plugins/deep-research/skills/academic-verify/SKILL.md +77 -0
- package/payload/platform/plugins/deep-research/skills/book-mirror/SKILL.md +70 -0
- package/payload/platform/plugins/deep-research/skills/data-research/SKILL.md +110 -0
- package/payload/platform/plugins/deep-research/skills/deep-research/SKILL.md +48 -0
- package/payload/platform/plugins/deep-research/skills/deep-research/references/citation-styles.md +52 -0
- package/payload/platform/plugins/deep-research/skills/deep-research/references/research-modes.md +22 -0
- package/payload/platform/plugins/deep-research/skills/deep-research/references/search-strategy.md +24 -0
- package/payload/platform/plugins/deep-research/skills/strategic-reading/SKILL.md +71 -0
- package/payload/platform/plugins/docs/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/docs/PLUGIN.md +58 -0
- package/payload/platform/plugins/docs/references/access-control.md +84 -0
- package/payload/platform/plugins/docs/references/admin-identity-gate.md +77 -0
- package/payload/platform/plugins/docs/references/admin-session.md +181 -0
- package/payload/platform/plugins/docs/references/admin-ui.md +397 -0
- package/payload/platform/plugins/docs/references/aeo.md +87 -0
- package/payload/platform/plugins/docs/references/attachments.md +44 -0
- package/payload/platform/plugins/docs/references/cloudflare.md +102 -0
- package/payload/platform/plugins/docs/references/contacts-guide.md +94 -0
- package/payload/platform/plugins/docs/references/deployment.md +323 -0
- package/payload/platform/plugins/docs/references/getting-started.md +95 -0
- package/payload/platform/plugins/docs/references/graph.md +163 -0
- package/payload/platform/plugins/docs/references/internals.md +547 -0
- package/payload/platform/plugins/docs/references/investigate-and-task-skills.md +9 -0
- package/payload/platform/plugins/docs/references/linkedin-extension.md +49 -0
- package/payload/platform/plugins/docs/references/memory-guide.md +163 -0
- package/payload/platform/plugins/docs/references/neo4j.md +72 -0
- package/payload/platform/plugins/docs/references/outlook-guide.md +69 -0
- package/payload/platform/plugins/docs/references/platform.md +190 -0
- package/payload/platform/plugins/docs/references/plugins-guide.md +189 -0
- package/payload/platform/plugins/docs/references/projects-guide.md +94 -0
- package/payload/platform/plugins/docs/references/quickbooks.md +29 -0
- package/payload/platform/plugins/docs/references/samba.md +93 -0
- package/payload/platform/plugins/docs/references/session-retrospective.md +14 -0
- package/payload/platform/plugins/docs/references/settings.md +82 -0
- package/payload/platform/plugins/docs/references/slides.md +31 -0
- package/payload/platform/plugins/docs/references/telegram-guide.md +58 -0
- package/payload/platform/plugins/docs/references/troubleshooting.md +291 -0
- package/payload/platform/plugins/docs/references/visitor-graph.md +83 -0
- package/payload/platform/plugins/docs/references/voice-mirror-guide.md +72 -0
- package/payload/platform/plugins/docs/superpowers/plans/2026-06-01-memory-edge.md +589 -0
- package/payload/platform/plugins/email/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/email/PLUGIN.md +112 -0
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.js +92 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-edit.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-edit.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-edit.test.js +71 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-edit.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.js +95 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.js +129 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js +113 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js +165 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js +69 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.js +46 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.js +110 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.js +57 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/send-raw.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/send-raw.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/send-raw.test.js +38 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/send-raw.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.js +56 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.js +46 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/index.js +522 -0
- package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.d.ts +39 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.js +0 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts +31 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js +103 -0
- package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +17 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +186 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/compose.d.ts +47 -0
- package/payload/platform/plugins/email/mcp/dist/lib/compose.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/compose.js +75 -0
- package/payload/platform/plugins/email/mcp/dist/lib/compose.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.d.ts +30 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.js +305 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.d.ts +19 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.js +51 -0
- package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts +89 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js +245 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/embedding.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/lib/embedding.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/embedding.js +24 -0
- package/payload/platform/plugins/email/mcp/dist/lib/embedding.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/graph.d.ts +29 -0
- package/payload/platform/plugins/email/mcp/dist/lib/graph.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/graph.js +18 -0
- package/payload/platform/plugins/email/mcp/dist/lib/graph.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +352 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js +1021 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.d.ts +31 -0
- package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.js +15 -0
- package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/email/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/email/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/providers.d.ts +71 -0
- package/payload/platform/plugins/email/mcp/dist/lib/providers.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/providers.js +782 -0
- package/payload/platform/plugins/email/mcp/dist/lib/providers.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +29 -0
- package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js +105 -0
- package/payload/platform/plugins/email/mcp/dist/lib/screening.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts +42 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js +72 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts +61 -0
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.js +140 -0
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts +38 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +817 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +30 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +215 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.js +55 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts +19 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js +151 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-auto-respond-config.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts +6 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js +89 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-classify.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-edit.d.ts +9 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-edit.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-edit.js +23 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-edit.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.d.ts +8 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.js +52 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.d.ts +7 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.js +17 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.d.ts +15 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js +54 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.d.ts +24 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.js +293 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.d.ts +20 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.js +195 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-otp-extract.d.ts +15 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-otp-extract.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-otp-extract.js +144 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-otp-extract.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-read.d.ts +14 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-read.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-read.js +94 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-read.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts +13 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js +71 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-search.d.ts +15 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-search.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-search.js +77 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-search.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts +13 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.js +36 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.d.ts +22 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js +202 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.d.ts +6 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js +43 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js.map +1 -0
- package/payload/platform/plugins/email/mcp/package.json +24 -0
- package/payload/platform/plugins/email/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/email/references/email-reference.md +181 -0
- package/payload/platform/plugins/email/skills/email-composition/SKILL.md +208 -0
- package/payload/platform/plugins/email/skills/email-ingest/SKILL.md +89 -0
- package/payload/platform/plugins/graph/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/graph/PLUGIN.md +39 -0
- package/payload/platform/plugins/graph-viewer/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/graph-viewer/PLUGIN.md +56 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/index.d.ts +7 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/index.js +70 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/lib/neo4j.js +43 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/draw.d.ts +28 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/draw.d.ts.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/draw.js +73 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/draw.js.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/layout.d.ts +40 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/layout.d.ts.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/layout.js +117 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/render/layout.js.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.d.ts +45 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.d.ts.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js +199 -0
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js.map +1 -0
- package/payload/platform/plugins/graph-viewer/mcp/package.json +25 -0
- package/payload/platform/plugins/graph-viewer/mcp/vitest.config.ts +8 -0
- package/payload/platform/plugins/graph-viewer/skills/render-graph/SKILL.md +43 -0
- package/payload/platform/plugins/linkedin-extension/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/linkedin-extension/PLUGIN.md +58 -0
- package/payload/platform/plugins/linkedin-extension/extension/README.md +44 -0
- package/payload/platform/plugins/linkedin-extension/extension/__tests__/fixtures/profile.html +34 -0
- package/payload/platform/plugins/linkedin-extension/extension/__tests__/fixtures/thread.html +36 -0
- package/payload/platform/plugins/linkedin-extension/extension/assets/pill.css +52 -0
- package/payload/platform/plugins/linkedin-extension/extension/background/sw.js +60 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/extractors.js +127 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/profile.js +82 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/thread.js +84 -0
- package/payload/platform/plugins/linkedin-extension/extension/manifest.json +32 -0
- package/payload/platform/plugins/linkedin-extension/extension/options/options.html +33 -0
- package/payload/platform/plugins/linkedin-extension/extension/options/options.js +30 -0
- package/payload/platform/plugins/linkedin-extension/skills/linkedin-extension/SKILL.md +93 -0
- package/payload/platform/plugins/linkedin-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/linkedin-import/PLUGIN.md +27 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +119 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/connections.md +135 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/profile.md +94 -0
- package/payload/platform/plugins/memory/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/memory/PLUGIN.md +290 -0
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.mjs +616 -0
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.sh +106 -0
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/memory/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js +2479 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.js +68 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-revision.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js +90 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/compiled-truth-rewriter-operator-hint.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.js +41 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.js +90 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-label.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-label.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-label.test.js +30 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-label.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.js +25 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-delete-gate.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-delete-gate.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-delete-gate.test.js +62 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-delete-gate.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.js +50 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.js +154 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +226 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js +57 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-backlinks.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-backlinks.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-backlinks.test.js +24 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-backlinks.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-prune-revisions.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-prune-revisions.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-prune-revisions.test.js +51 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-prune-revisions.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-tag-normalisation.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-tag-normalisation.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-tag-normalisation.test.js +51 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-tag-normalisation.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js +146 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relative-date.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relative-date.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relative-date.test.js +68 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relative-date.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js +116 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js +71 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-doc-contradictions.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-doc-contradictions.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-doc-contradictions.test.js +214 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-doc-contradictions.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +245 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +642 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js +113 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.js +111 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.js +85 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.js +27 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/attachments.d.ts +37 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/attachments.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/attachments.js +69 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/attachments.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-revision.d.ts +91 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-revision.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-revision.js +39 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-revision.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +60 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +169 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/email.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/email.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/email.js +61 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/email.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/index.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/index.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/index.js +36 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/index.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.d.ts +49 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.js +35 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.d.ts +47 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js +38 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js +155 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/x-dm.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/x-dm.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/x-dm.js +101 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/x-dm.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.d.ts +11 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.js +20 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js +43 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js +60 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sessionize.d.ts +9 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sessionize.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sessionize.js +32 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sessionize.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js +29 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/turn-text-cache-path.d.ts +8 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/turn-text-cache-path.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/turn-text-cache-path.js +27 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/turn-text-cache-path.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.d.ts +45 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.js +125 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.d.ts +9 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.js +61 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.d.ts +10 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.js +47 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.d.ts +44 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.js +14 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-backlinks.d.ts +15 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-backlinks.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-backlinks.js +37 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-backlinks.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.js +16 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-citation-audit.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-dead-edges.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-dead-edges.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-dead-edges.js +39 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-dead-edges.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.js +42 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-orphans.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-prune-revisions.d.ts +21 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-prune-revisions.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-prune-revisions.js +27 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-prune-revisions.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-stale-truth.d.ts +18 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-stale-truth.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-stale-truth.js +60 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-stale-truth.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-tag-normalisation.d.ts +25 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-tag-normalisation.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-tag-normalisation.js +90 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-tag-normalisation.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js +6 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/filter-token.d.ts +36 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/filter-token.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/filter-token.js +86 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/filter-token.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.d.ts +41 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.js +113 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts +76 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js +148 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.d.ts +41 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.js +69 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-delete-gate.d.ts +18 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-delete-gate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-delete-gate.js +31 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-delete-gate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.d.ts +18 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.js +35 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.d.ts +119 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.js +208 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +248 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +824 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +63 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +210 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.d.ts +65 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js +182 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +76 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts +66 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js +102 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relative-date.d.ts +13 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relative-date.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relative-date.js +191 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/relative-date.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts +33 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js +44 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +200 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +607 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts +92 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +243 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/section-types.d.ts +127 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/section-types.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/section-types.js +56 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/section-types.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.js +179 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +35 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +28 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js +160 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js +12 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/_helpers/emit-capture.d.ts +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/_helpers/emit-capture.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/_helpers/emit-capture.js +44 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/_helpers/emit-capture.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.js +20 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js +68 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js +298 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection-emit.test.js +48 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.js +184 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.js +67 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-memory-expunge-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-memory-expunge-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-memory-expunge-emit.test.js +53 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-memory-expunge-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js +75 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js +109 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.js +34 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-add-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-add-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-add-emit.test.js +40 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-add-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-remove-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-remove-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-remove-emit.test.js +39 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/graph-prune-denylist-remove-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.js +31 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/log-ingest.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/log-ingest.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/log-ingest.test.js +241 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/log-ingest.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.js +61 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js +88 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +106 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js +58 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-classify-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-compiled-truth-history.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-compiled-truth-history.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-compiled-truth-history.test.js +129 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-compiled-truth-history.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js +64 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-reserved-label.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-reserved-label.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-reserved-label.test.js +141 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-delete-reserved-label.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edge.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edge.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edge.test.js +164 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edge.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js +70 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-edit-attachment-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.js +168 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js +48 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-reserved-label.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-reserved-label.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-reserved-label.test.js +86 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-reserved-label.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-body-server-sliced.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-body-server-sliced.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-body-server-sliced.test.js +134 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-body-server-sliced.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-chat-body-server-sliced.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-chat-body-server-sliced.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-chat-body-server-sliced.test.js +124 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-chat-body-server-sliced.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js +74 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js +47 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-extract-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-inline-rewrite.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-inline-rewrite.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-inline-rewrite.test.js +66 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-inline-rewrite.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.js +104 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js +65 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-web-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js +175 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-lookup-by-name.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-lookup-by-name.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-lookup-by-name.test.js +174 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-lookup-by-name.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js +43 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.js +87 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js +65 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-rename-attachment-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-report-tools.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-report-tools.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-report-tools.test.js +115 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-report-tools.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js +49 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-restore-emit.test.js.map +1 -0
- 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 +128 -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/__tests__/memory-search-threshold.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.js +34 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-by-name.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-by-name.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-by-name.test.js +125 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-by-name.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +79 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js +329 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-operator-hint.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.js +39 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-compiled-truth-rejection.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +81 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-timeline-learned-at.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-timeline-learned-at.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-timeline-learned-at.test.js +30 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-timeline-learned-at.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-delete-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-delete-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-delete-emit.test.js +62 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-delete-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-emit.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-emit.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-emit.test.js +76 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-emit.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js +88 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js +151 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts +114 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js +415 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.d.ts +41 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.js +124 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-list-chunks.d.ts +43 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-list-chunks.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-list-chunks.js +96 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-list-chunks.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.d.ts +8 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.js +15 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.js +32 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.js +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.js +31 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/image-fetch.d.ts +15 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/image-fetch.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/image-fetch.js +64 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/image-fetch.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.d.ts +11 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.js +92 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +202 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +1084 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.d.ts +35 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.js +80 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +34 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +62 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-compiled-truth-history.d.ts +41 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-compiled-truth-history.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-compiled-truth-history.js +73 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-compiled-truth-history.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.d.ts +65 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js +151 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.d.ts +48 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.js +197 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.d.ts +30 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js +75 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edit-attachment.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edit-attachment.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edit-attachment.js +95 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-edit-attachment.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts +50 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.js +104 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-find-candidates.d.ts +58 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-find-candidates.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-find-candidates.js +125 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-find-candidates.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.d.ts +37 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.js +97 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-web.d.ts +32 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-web.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-web.js +116 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-web.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts +194 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +1303 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.js +125 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-lookup-by-name.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-lookup-by-name.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-lookup-by-name.js +68 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-lookup-by-name.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-node-exists.d.ts +28 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-node-exists.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-node-exists.js +46 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-node-exists.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts +61 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +102 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-read-attachment.d.ts +12 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-read-attachment.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-read-attachment.js +100 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-read-attachment.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts +9 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js +127 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rename-attachment.d.ts +13 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rename-attachment.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rename-attachment.js +67 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rename-attachment.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-list.d.ts +28 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-list.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-list.js +64 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-list.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-read-latest.d.ts +24 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-read-latest.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-read-latest.js +49 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-read-latest.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-write.d.ts +34 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-write.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-write.js +99 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-report-write.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.d.ts +24 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.js +47 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-restore.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-review-queue.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-review-queue.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-review-queue.js +67 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-review-queue.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +184 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts +35 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js +73 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-signals-recent.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update-by-name.d.ts +15 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update-by-name.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update-by-name.js +45 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update-by-name.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +194 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +47 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +397 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.d.ts +127 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.js +477 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.d.ts +24 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.js +35 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +46 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +423 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +65 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +395 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +30 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +130 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/package.json +23 -0
- package/payload/platform/plugins/memory/mcp/scripts/boot-smoke.sh +69 -0
- package/payload/platform/plugins/memory/mcp/scripts/generate-edge-docs.ts +75 -0
- package/payload/platform/plugins/memory/mcp/scripts/graph/accept.sh +217 -0
- package/payload/platform/plugins/memory/mcp/scripts/graph/fixture.cypher +59 -0
- package/payload/platform/plugins/memory/mcp/vitest.config.ts +53 -0
- package/payload/platform/plugins/memory/references/graph-primitives.md +394 -0
- package/payload/platform/plugins/memory/references/schema-base.md +338 -0
- package/payload/platform/plugins/memory/references/schema-construction.md +96 -0
- package/payload/platform/plugins/memory/references/schema-creator.md +35 -0
- package/payload/platform/plugins/memory/references/schema-estate-agent.md +154 -0
- package/payload/platform/plugins/memory/references/schema-food-beverage.md +32 -0
- package/payload/platform/plugins/memory/references/schema-hospitality.md +31 -0
- package/payload/platform/plugins/memory/references/schema-knowledge-work.md +80 -0
- package/payload/platform/plugins/memory/references/schema-logistics.md +30 -0
- package/payload/platform/plugins/memory/references/schema-professional-services.md +33 -0
- package/payload/platform/plugins/memory/references/schema-retail.md +33 -0
- package/payload/platform/plugins/memory/references/schema-trades.md +36 -0
- package/payload/platform/plugins/memory/references/transcript-formats/circleback.md +49 -0
- package/payload/platform/plugins/memory/references/transcript-formats/granola.md +50 -0
- package/payload/platform/plugins/memory/references/transcript-formats/otter.md +50 -0
- package/payload/platform/plugins/memory/skills/archive-crawler/SKILL.md +69 -0
- package/payload/platform/plugins/memory/skills/challenge/SKILL.md +54 -0
- package/payload/platform/plugins/memory/skills/concept-synthesis/SKILL.md +81 -0
- package/payload/platform/plugins/memory/skills/connect/SKILL.md +58 -0
- package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +193 -0
- package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +207 -0
- package/payload/platform/plugins/memory/skills/conversation-archive-mcp/SKILL.md +170 -0
- package/payload/platform/plugins/memory/skills/conversational-memory/SKILL.md +115 -0
- package/payload/platform/plugins/memory/skills/document-ingest/SKILL.md +331 -0
- package/payload/platform/plugins/memory/skills/emerge/SKILL.md +89 -0
- package/payload/platform/plugins/notion-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/notion-import/PLUGIN.md +27 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/SKILL.md +114 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/attachments.md +55 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/databases.md +83 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/page-tree.md +61 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/workspace-export.md +41 -0
- package/payload/platform/plugins/obsidian-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/obsidian-import/PLUGIN.md +39 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/SKILL.md +92 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/attachments.md +80 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/daily-notes.md +31 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/vault-structure.md +46 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/wikilinks.md +70 -0
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/outlook/PLUGIN.md +74 -0
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js +94 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/log.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/log.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/log.test.js +31 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/log.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js +213 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.js +130 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts +65 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +261 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.d.ts +61 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.js +170 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.d.ts +18 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js +184 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +60 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +189 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/log.d.ts +23 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/log.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/log.js +53 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/log.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js +50 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-event.d.ts +12 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-event.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-event.js +32 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-event.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-list.d.ts +59 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-list.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-list.js +54 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-list.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/contacts-list.d.ts +14 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/contacts-list.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/contacts-list.js +45 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/contacts-list.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts +15 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js +48 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts +8 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js +49 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.d.ts +19 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.js +58 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/package.json +20 -0
- package/payload/platform/plugins/outlook/mcp/scripts/verify-doc-impl.sh +109 -0
- package/payload/platform/plugins/outlook/references/auth.md +118 -0
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +114 -0
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +67 -0
- package/payload/platform/plugins/projects/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/projects/PLUGIN.md +101 -0
- package/payload/platform/plugins/projects/references/investigation.md +63 -0
- package/payload/platform/plugins/projects/references/meeting-to-tasks.md +34 -0
- package/payload/platform/plugins/projects/references/prioritization.md +43 -0
- package/payload/platform/plugins/projects/references/retrospective.md +71 -0
- package/payload/platform/plugins/projects/references/review.md +51 -0
- package/payload/platform/plugins/projects/references/risk-premortem.md +34 -0
- package/payload/platform/plugins/projects/references/sprint.md +172 -0
- package/payload/platform/plugins/projects/references/stakeholder-map.md +43 -0
- package/payload/platform/plugins/prompt-optimiser/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/prompt-optimiser/PLUGIN.md +14 -0
- package/payload/platform/plugins/prompt-optimiser/skills/prompt-optimiser/SKILL.md +321 -0
- package/payload/platform/plugins/prompt-optimiser/skills/prompt-optimiser/__tests__/restatement-ladder.test.sh +21 -0
- package/payload/platform/plugins/quickbooks/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/quickbooks/PLUGIN.md +91 -0
- package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/index.js +219 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.d.ts +37 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.d.ts.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.js +75 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.js.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.d.ts +39 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.d.ts.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.js +178 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.js.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.d.ts +36 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.d.ts.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.js +107 -0
- package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.js.map +1 -0
- package/payload/platform/plugins/quickbooks/mcp/package.json +19 -0
- package/payload/platform/plugins/quickbooks/skills/quickbooks/SKILL.md +37 -0
- package/payload/platform/plugins/replicate/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/replicate/PLUGIN.md +49 -0
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/replicate/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/replicate/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/replicate/mcp/dist/index.js +126 -0
- package/payload/platform/plugins/replicate/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/replicate/mcp/dist/lib/replicate-key.d.ts +15 -0
- package/payload/platform/plugins/replicate/mcp/dist/lib/replicate-key.d.ts.map +1 -0
- package/payload/platform/plugins/replicate/mcp/dist/lib/replicate-key.js +73 -0
- package/payload/platform/plugins/replicate/mcp/dist/lib/replicate-key.js.map +1 -0
- package/payload/platform/plugins/replicate/mcp/dist/tools/image-generate.d.ts +14 -0
- package/payload/platform/plugins/replicate/mcp/dist/tools/image-generate.d.ts.map +1 -0
- package/payload/platform/plugins/replicate/mcp/dist/tools/image-generate.js +201 -0
- package/payload/platform/plugins/replicate/mcp/dist/tools/image-generate.js.map +1 -0
- package/payload/platform/plugins/replicate/mcp/package.json +21 -0
- package/payload/platform/plugins/sales/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/sales/PLUGIN.md +106 -0
- package/payload/platform/plugins/sales/references/close-tracking.md +69 -0
- package/payload/platform/plugins/sales/references/comparisons.md +99 -0
- package/payload/platform/plugins/sales/references/competitive-positioning.md +51 -0
- package/payload/platform/plugins/sales/references/faq.md +73 -0
- package/payload/platform/plugins/sales/references/objection-handling.md +157 -0
- package/payload/platform/plugins/sales/references/pricing.md +101 -0
- package/payload/platform/plugins/scheduling/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/scheduling/PLUGIN.md +153 -0
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.js +16 -0
- package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +440 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js +119 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/embedding.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/embedding.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/embedding.js +19 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/embedding.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.d.ts +80 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.js +410 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics.d.ts +63 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics.js +471 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/ics.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts +30 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js +89 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/time-format.d.ts +48 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/time-format.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/time-format.js +140 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/time-format.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts +24 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +572 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-archive-ics.d.ts +20 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-archive-ics.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-archive-ics.js +63 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-archive-ics.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts +7 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js +23 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts +25 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js +121 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-export-ics.d.ts +9 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-export-ics.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-export-ics.js +77 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-export-ics.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts +25 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js +53 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-import-ics.d.ts +8 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-import-ics.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-import-ics.js +48 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-import-ics.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.d.ts +20 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.js +76 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts +18 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js +167 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/package.json +23 -0
- package/payload/platform/plugins/scheduling/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/scheduling/skills/briefing/SKILL.md +88 -0
- package/payload/platform/plugins/scheduling/skills/daily-prep/SKILL.md +63 -0
- package/payload/platform/plugins/slides/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/slides/LICENSE +21 -0
- package/payload/platform/plugins/slides/PLUGIN.md +18 -0
- package/payload/platform/plugins/slides/PROVENANCE.md +40 -0
- package/payload/platform/plugins/slides/commands/add-slide.md +29 -0
- package/payload/platform/plugins/slides/commands/slides-claus.md +39 -0
- package/payload/platform/plugins/slides/commands/slides-new-component.md +39 -0
- package/payload/platform/plugins/slides/commands/slides-outline.md +43 -0
- package/payload/platform/plugins/slides/commands/slides-review.md +52 -0
- package/payload/platform/plugins/slides/commands/slides-theme.md +64 -0
- package/payload/platform/plugins/slides/commands/slides.md +59 -0
- package/payload/platform/plugins/slides/skills/deck-system/REFERENCE.md +581 -0
- package/payload/platform/plugins/slides/skills/deck-system/SKILL.md +611 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-board.md +426 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-claus.md +185 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-mbb.md +450 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-product-launch.md +579 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-sales.md +464 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING-sequoia.md +489 -0
- package/payload/platform/plugins/slides/skills/deck-system/STORYTELLING.md +273 -0
- package/payload/platform/plugins/slides/skills/deck-system/deck-craft.html +1371 -0
- package/payload/platform/plugins/slides/skills/deck-system/deck-solid.html +1667 -0
- package/payload/platform/plugins/slides/skills/deck-system/deck.html +1359 -0
- package/payload/platform/plugins/substack-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/substack-import/PLUGIN.md +34 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/SKILL.md +183 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/references/archive-shape.md +68 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/references/attachments.md +72 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/references/engagement.md +61 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/references/posts.md +80 -0
- package/payload/platform/plugins/substack-import/skills/substack-import/references/subscribers.md +74 -0
- package/payload/platform/plugins/telegram/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/telegram/PLUGIN.md +58 -0
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.js +253 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-token.d.ts +6 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-token.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-token.js +20 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-token.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.d.ts +21 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.js +52 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts +41 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js +70 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts +16 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js +68 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +20 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +37 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/package.json +19 -0
- package/payload/platform/plugins/telegram/references/setup-guide.md +53 -0
- package/payload/platform/plugins/telegram/skills/configure/SKILL.md +79 -0
- package/payload/platform/plugins/url-get/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/url-get/PLUGIN.md +91 -0
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/url-get/mcp/dist/index.d.ts +9 -0
- package/payload/platform/plugins/url-get/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/url-get/mcp/dist/index.js +53 -0
- package/payload/platform/plugins/url-get/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts +8 -0
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.d.ts.map +1 -0
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js +83 -0
- package/payload/platform/plugins/url-get/mcp/dist/lib/summarise.js.map +1 -0
- package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.d.ts +21 -0
- package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.d.ts.map +1 -0
- package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.js +133 -0
- package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.js.map +1 -0
- package/payload/platform/plugins/url-get/mcp/package.json +22 -0
- package/payload/platform/plugins/whatsapp/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/whatsapp/PLUGIN.md +112 -0
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.d.ts +2 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.js +58 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-login-start.test.d.ts +2 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-login-start.test.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-login-start.test.js +16 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/format-login-start.test.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.d.ts +14 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.js +42 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.d.ts +7 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.js +21 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/format.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.d.ts +8 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +436 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/package.json +21 -0
- package/payload/platform/plugins/whatsapp/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +307 -0
- package/payload/platform/plugins/whatsapp/skills/connect-whatsapp/SKILL.md +86 -0
- package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +90 -0
- package/payload/platform/plugins/work/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/work/.mcp.json +13 -0
- package/payload/platform/plugins/work/PLUGIN.md +124 -0
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/work/mcp/dist/cli/project-create-cli.d.ts +2 -0
- package/payload/platform/plugins/work/mcp/dist/cli/project-create-cli.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/cli/project-create-cli.js +78 -0
- package/payload/platform/plugins/work/mcp/dist/cli/project-create-cli.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/work/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/index.js +547 -0
- package/payload/platform/plugins/work/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts +7 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js +24 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts +17 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js +76 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts +29 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.js +235 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts +40 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.js +125 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts +26 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.js +81 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts +19 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.js +102 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts +20 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.js +37 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts +12 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.js +28 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts +16 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js +33 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts +63 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js +141 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts +19 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.js +51 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts +18 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.js +66 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts +21 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js +54 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts +12 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js +59 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts +32 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.js +112 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.js.map +1 -0
- package/payload/platform/plugins/work/mcp/package.json +20 -0
- package/payload/platform/plugins/work/skills/execute-task/SKILL.md +103 -0
- package/payload/platform/plugins/workflows/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/workflows/.mcp.json +12 -0
- package/payload/platform/plugins/workflows/PLUGIN.md +160 -0
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/workflows/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/workflows/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/index.js +440 -0
- package/payload/platform/plugins/workflows/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.d.ts +38 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.js +83 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/embeddings.d.ts +2 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/embeddings.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/embeddings.js +19 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/embeddings.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +151 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js +299 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.d.ts +66 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.js +187 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/step-resolver.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.d.ts +25 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.js +56 -0
- package/payload/platform/plugins/workflows/mcp/dist/lib/validate-capabilities.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.d.ts +33 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js +130 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-delete.d.ts +28 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-delete.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-delete.js +57 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-delete.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.d.ts +51 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js +382 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.d.ts +24 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.js +48 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-get.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-list.d.ts +16 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-list.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-list.js +44 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-list.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-runs.d.ts +28 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-runs.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-runs.js +71 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-runs.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.d.ts +11 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js +150 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.d.ts +13 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.d.ts.map +1 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.js +53 -0
- package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-validate.js.map +1 -0
- package/payload/platform/plugins/workflows/mcp/package.json +20 -0
- package/payload/platform/plugins/workflows/mcp/test-runner.mjs +710 -0
- package/payload/platform/plugins/workflows/mcp/test-workflows.sh +77 -0
- package/payload/platform/plugins/workflows/skills/workflow-manager/SKILL.md +95 -0
- package/payload/platform/plugins/x-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/x-import/PLUGIN.md +33 -0
- package/payload/platform/plugins/x-import/references/archive-shape.md +124 -0
- package/payload/platform/plugins/x-import/references/transcript-shape.md +121 -0
- package/payload/platform/plugins/x-import/skills/x-import/SKILL.md +123 -0
- package/payload/platform/scripts/__tests__/agents-md-bootstrap.test.sh +111 -0
- package/payload/platform/scripts/__tests__/check-no-raw-mcp-registrations.test.sh +57 -0
- package/payload/platform/scripts/__tests__/check-no-task-id-leaks.test.sh +153 -0
- package/payload/platform/scripts/__tests__/first-token-creates-stream-log.test.sh +37 -0
- package/payload/platform/scripts/__tests__/logs-read-prefix.sh +237 -0
- package/payload/platform/scripts/__tests__/prompt-optimiser-audit.test.sh +59 -0
- package/payload/platform/scripts/__tests__/provision-role-stamp.test.sh +40 -0
- package/payload/platform/scripts/__tests__/resume-tunnel.test.sh +641 -0
- package/payload/platform/scripts/__tests__/sweep-durability.test.sh +103 -0
- package/payload/platform/scripts/admin-conversation-recover.mjs +386 -0
- package/payload/platform/scripts/admin-persist-audit.ts +211 -0
- package/payload/platform/scripts/backfill-bypass-permissions.sh +58 -0
- package/payload/platform/scripts/check-architecture-skill-no-drift.mjs +114 -0
- package/payload/platform/scripts/check-canonical-tool-names.mjs +110 -0
- package/payload/platform/scripts/check-cypher-int-params.mjs +277 -0
- package/payload/platform/scripts/check-no-conversation-id-leaks.mjs +165 -0
- package/payload/platform/scripts/check-no-direct-clipboard.mjs +54 -0
- package/payload/platform/scripts/check-no-esm-require.mjs +164 -0
- package/payload/platform/scripts/check-no-legacy-spawn-route.mjs +37 -0
- package/payload/platform/scripts/check-no-raw-mcp-registrations.mjs +70 -0
- package/payload/platform/scripts/check-no-task-id-leaks.mjs +201 -0
- package/payload/platform/scripts/check-plugin-references.mjs +256 -0
- package/payload/platform/scripts/check-plugin-tools-mcp-consistency.mjs +136 -0
- package/payload/platform/scripts/check-roles-doc-completeness.mjs +96 -0
- package/payload/platform/scripts/check-routing-prose-bash.mjs +134 -0
- package/payload/platform/scripts/check-skill-frontmatter.mjs +142 -0
- package/payload/platform/scripts/check-skill-load-coverage.mjs +100 -0
- package/payload/platform/scripts/check-specialist-tool-surface.mjs +323 -0
- package/payload/platform/scripts/conversation-id-allowlist.txt +142 -0
- package/payload/platform/scripts/dedupe-userprofile-ghosts.sh +388 -0
- package/payload/platform/scripts/generate-canonical-tool-names.mjs +63 -0
- package/payload/platform/scripts/generate-entitlement-fixture.mjs +152 -0
- package/payload/platform/scripts/identity-forbidden-token-check.mjs +87 -0
- package/payload/platform/scripts/installer-device-verify.sh +358 -0
- package/payload/platform/scripts/lib/__tests__/admin-skills-bootstrap.test.sh +64 -0
- package/payload/platform/scripts/lib/admin-skills-bootstrap.sh +109 -0
- package/payload/platform/scripts/lib/agents-md-bootstrap.sh +49 -0
- package/payload/platform/scripts/lib/canonical-tool-names.mjs +88 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +316 -0
- package/payload/platform/scripts/lib/read-brand-json.sh +69 -0
- package/payload/platform/scripts/lib/resolve-account-dir.sh +131 -0
- package/payload/platform/scripts/log-adherence-check.sh +125 -0
- package/payload/platform/scripts/logs-read-jsonl.test.sh +307 -0
- package/payload/platform/scripts/logs-read.sh +980 -0
- package/payload/platform/scripts/logs-read.test.sh +159 -0
- package/payload/platform/scripts/prompt-optimiser-audit.sh +82 -0
- package/payload/platform/scripts/redact-install-logs.sh +87 -0
- package/payload/platform/scripts/resume-tunnel.sh +280 -0
- package/payload/platform/scripts/rss-sampler.sh +58 -0
- package/payload/platform/scripts/seed-neo4j.sh +211 -0
- package/payload/platform/scripts/setup-account.sh +55 -0
- package/payload/platform/scripts/smoke-boot-services.sh +413 -0
- package/payload/platform/scripts/test-laptop-vnc-boot.sh +88 -0
- package/payload/platform/scripts/verify-skill-tool-surface.sh +389 -0
- package/payload/platform/scripts/vnc.sh +476 -0
- package/payload/platform/scripts/wifi-provision-server/server.js +743 -0
- package/payload/platform/scripts/wifi-provision.sh +492 -0
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts +39 -0
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js +133 -0
- package/payload/platform/services/claude-session-manager/dist/admin-identity-audit.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts +23 -0
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js +29 -0
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/auth-snapshot.d.ts +4 -0
- package/payload/platform/services/claude-session-manager/dist/auth-snapshot.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/auth-snapshot.js +50 -0
- package/payload/platform/services/claude-session-manager/dist/auth-snapshot.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.d.ts +30 -0
- package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.js +86 -0
- package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.d.ts +7 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +226 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.js +23 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.d.ts +15 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.js +34 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/channel-targets.d.ts +26 -0
- package/payload/platform/services/claude-session-manager/dist/channel-targets.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/channel-targets.js +19 -0
- package/payload/platform/services/claude-session-manager/dist/channel-targets.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts +73 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/config.js +290 -0
- package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts +150 -0
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +913 -0
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.d.ts +7 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.js +90 -0
- package/payload/platform/services/claude-session-manager/dist/hooks-discovery.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +56 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js +2797 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/index.d.ts +2 -0
- package/payload/platform/services/claude-session-manager/dist/index.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/index.js +784 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts +22 -0
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js +50 -0
- package/payload/platform/services/claude-session-manager/dist/input-postcondition.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/install-log-sink.d.ts +2 -0
- package/payload/platform/services/claude-session-manager/dist/install-log-sink.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/install-log-sink.js +6 -0
- package/payload/platform/services/claude-session-manager/dist/install-log-sink.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts +49 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js +169 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts +30 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +204 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.d.ts +67 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.js +141 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-path.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-tail.d.ts +81 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-tail.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-tail.js +503 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-tail.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/liveness-divergence.d.ts +19 -0
- package/payload/platform/services/claude-session-manager/dist/liveness-divergence.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/liveness-divergence.js +38 -0
- package/payload/platform/services/claude-session-manager/dist/liveness-divergence.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/log-sink.d.ts +12 -0
- package/payload/platform/services/claude-session-manager/dist/log-sink.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/log-sink.js +48 -0
- package/payload/platform/services/claude-session-manager/dist/log-sink.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/mcp-tools-probe.d.ts +38 -0
- package/payload/platform/services/claude-session-manager/dist/mcp-tools-probe.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/mcp-tools-probe.js +131 -0
- package/payload/platform/services/claude-session-manager/dist/mcp-tools-probe.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/permission-mode-tail.d.ts +22 -0
- package/payload/platform/services/claude-session-manager/dist/permission-mode-tail.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/permission-mode-tail.js +71 -0
- package/payload/platform/services/claude-session-manager/dist/permission-mode-tail.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-census.d.ts +40 -0
- package/payload/platform/services/claude-session-manager/dist/pty-census.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-census.js +125 -0
- package/payload/platform/services/claude-session-manager/dist/pty-census.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +684 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +2245 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +40 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +123 -0
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts +33 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js +149 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-child-log.d.ts +13 -0
- package/payload/platform/services/claude-session-manager/dist/rc-child-log.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-child-log.js +52 -0
- package/payload/platform/services/claude-session-manager/dist/rc-child-log.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +175 -0
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +644 -0
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-life.d.ts +4 -0
- package/payload/platform/services/claude-session-manager/dist/rc-life.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-life.js +16 -0
- package/payload/platform/services/claude-session-manager/dist/rc-life.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts +80 -0
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js +306 -0
- package/payload/platform/services/claude-session-manager/dist/rc-script-spawn.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/reaper.d.ts +28 -0
- package/payload/platform/services/claude-session-manager/dist/reaper.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/reaper.js +118 -0
- package/payload/platform/services/claude-session-manager/dist/reaper.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/reseat-ledger.d.ts +49 -0
- package/payload/platform/services/claude-session-manager/dist/reseat-ledger.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/reseat-ledger.js +148 -0
- package/payload/platform/services/claude-session-manager/dist/reseat-ledger.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/scope-record.d.ts +11 -0
- package/payload/platform/services/claude-session-manager/dist/scope-record.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/scope-record.js +63 -0
- package/payload/platform/services/claude-session-manager/dist/scope-record.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts +130 -0
- package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/session-sidecar.js +291 -0
- package/payload/platform/services/claude-session-manager/dist/session-sidecar.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +49 -0
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/session-store.js +52 -0
- package/payload/platform/services/claude-session-manager/dist/session-store.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/settings-permission-mode.d.ts +12 -0
- package/payload/platform/services/claude-session-manager/dist/settings-permission-mode.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/settings-permission-mode.js +57 -0
- package/payload/platform/services/claude-session-manager/dist/settings-permission-mode.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/sidecar-store.d.ts +45 -0
- package/payload/platform/services/claude-session-manager/dist/sidecar-store.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/sidecar-store.js +118 -0
- package/payload/platform/services/claude-session-manager/dist/sidecar-store.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts +28 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js +77 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.d.ts +60 -0
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.js +203 -0
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts +70 -0
- package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/stuck-turn.js +213 -0
- package/payload/platform/services/claude-session-manager/dist/stuck-turn.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +157 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js +482 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-scope.d.ts +164 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-scope.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-scope.js +296 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-scope.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts +83 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js +345 -0
- package/payload/platform/services/claude-session-manager/dist/systemd-spawn.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.d.ts +69 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.js +373 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/types.d.ts +41 -0
- package/payload/platform/services/claude-session-manager/dist/types.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/types.js +2 -0
- package/payload/platform/services/claude-session-manager/dist/types.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/url-capture.d.ts +12 -0
- package/payload/platform/services/claude-session-manager/dist/url-capture.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/url-capture.js +79 -0
- package/payload/platform/services/claude-session-manager/dist/url-capture.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/user-title-store.d.ts +39 -0
- package/payload/platform/services/claude-session-manager/dist/user-title-store.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/user-title-store.js +138 -0
- package/payload/platform/services/claude-session-manager/dist/user-title-store.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts +36 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js +63 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-store.d.ts +29 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-store.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-store.js +124 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-store.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts +35 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js +52 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-store.d.ts +29 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-store.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-store.js +121 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-store.js.map +1 -0
- package/payload/platform/services/claude-session-manager/package.json +22 -0
- package/payload/platform/services/claude-session-manager/scripts/stash-cleanup.sh +410 -0
- package/payload/platform/services/claude-session-manager/vitest.config.ts +14 -0
- package/payload/platform/services/webchat-channel/dist/instructions.d.ts +9 -0
- package/payload/platform/services/webchat-channel/dist/instructions.d.ts.map +1 -0
- package/payload/platform/services/webchat-channel/dist/instructions.js +106 -0
- package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -0
- package/payload/platform/services/webchat-channel/dist/notification.d.ts +89 -0
- package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -0
- package/payload/platform/services/webchat-channel/dist/notification.js +118 -0
- package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -0
- package/payload/platform/services/webchat-channel/dist/permission.d.ts +46 -0
- package/payload/platform/services/webchat-channel/dist/permission.d.ts.map +1 -0
- package/payload/platform/services/webchat-channel/dist/permission.js +56 -0
- package/payload/platform/services/webchat-channel/dist/permission.js.map +1 -0
- package/payload/platform/services/webchat-channel/dist/server.d.ts +40 -0
- package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -0
- package/payload/platform/services/webchat-channel/dist/server.js +329 -0
- package/payload/platform/services/webchat-channel/dist/server.js.map +1 -0
- package/payload/platform/services/webchat-channel/dist/turn-follow.d.ts +28 -0
- package/payload/platform/services/webchat-channel/dist/turn-follow.d.ts.map +1 -0
- package/payload/platform/services/webchat-channel/dist/turn-follow.js +188 -0
- package/payload/platform/services/webchat-channel/dist/turn-follow.js.map +1 -0
- package/payload/platform/services/webchat-channel/package.json +20 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.d.ts +10 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.js +70 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +194 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.js +265 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts +57 -0
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/server.js +625 -0
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +100 -0
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/targets.js +154 -0
- package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +22 -0
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +163 -0
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/package.json +20 -0
- package/payload/platform/templates/account.json +14 -0
- package/payload/platform/templates/agents/admin/AGENTS.md +23 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +65 -0
- package/payload/platform/templates/agents/admin/LEARNINGS.md +3 -0
- package/payload/platform/templates/agents/admin/SOUL.md +1 -0
- package/payload/platform/templates/agents/public/IDENTITY.md +19 -0
- package/payload/platform/templates/specialists/.claude-plugin/plugin.json +4 -0
- package/payload/platform/templates/specialists/agents/citation-auditor.md +37 -0
- package/payload/platform/templates/specialists/agents/coding-assistant.md +73 -0
- package/payload/platform/templates/specialists/agents/compiled-truth-rewriter.md +42 -0
- package/payload/platform/templates/specialists/agents/content-producer.md +65 -0
- package/payload/platform/templates/specialists/agents/data-manager.md +29 -0
- package/payload/platform/templates/specialists/agents/database-operator.md +25 -0
- package/payload/platform/templates/specialists/agents/librarian.md +70 -0
- package/payload/platform/templates/specialists/agents/personal-assistant.md +62 -0
- package/payload/platform/templates/specialists/agents/project-manager.md +63 -0
- package/payload/platform/templates/specialists/agents/public-session-reviewer.md +40 -0
- package/payload/platform/templates/specialists/agents/research-assistant.md +73 -0
- package/payload/platform/templates/specialists/agents/typed-edge-classifier.md +37 -0
- package/payload/platform/templates/systemd/edge.service.template +38 -0
- package/payload/platform/tsconfig.base.json +18 -0
- package/payload/premium-plugins/.claude-plugin/marketplace.json +28 -0
- package/payload/premium-plugins/sitedesk/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/sitedesk/BUNDLE.md +35 -0
- package/payload/premium-plugins/sitedesk/PLUGIN.md +18 -0
- package/payload/premium-plugins/sitedesk/agents/sitedesk--site-manager.md +45 -0
- package/payload/premium-plugins/sitedesk/agents/worker-checkin/IDENTITY.md +11 -0
- package/payload/premium-plugins/sitedesk/agents/worker-checkin/SOUL.md +7 -0
- package/payload/premium-plugins/sitedesk/agents/worker-checkin/template.json +9 -0
- package/payload/premium-plugins/sitedesk/plugins/.claude-plugin/marketplace.json +18 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/PLUGIN.md +46 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/SKILL.md +79 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/learning-from-history.md +51 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/maintenance.md +32 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/manual-definition.md +42 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/quote-engine.md +122 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/quote-generation.md +110 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/quoting.md +86 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/quotation/references/verification.md +39 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/SKILL.md +47 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/references/checkin-contract.md +31 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/references/documents.md +28 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/references/roll-up.md +38 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/references/setup.md +20 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/rollup.mjs +90 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/timesheet/rollup.test.mjs +106 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/SKILL.md +108 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/contract-template.md +34 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/document-learning.md +63 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/document-verification.md +52 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/document.md +108 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/issue-flow.md +117 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/job-folder.md +91 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/references/roll-up.md +73 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-job/skills/valuation/rollup.mjs +147 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/PLUGIN.md +49 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/README.md +70 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/commands/make-media.md +13 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/brand-extract/SKILL.md +86 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/make-media/SKILL.md +75 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/make-media/references/intake-and-questions.md +74 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/microsite/SKILL.md +88 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/microsite/references/placeholders.md +96 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/microsite/references/sections.md +48 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/microsite/templates/index.html +1004 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/microsite/templates/llms.txt +32 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/SKILL.md +133 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/references/pii-strip.md +64 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/references/sources.md +96 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/templates/og.html +92 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/templates/social-posts.md +47 -0
- package/payload/premium-plugins/sitedesk/plugins/sitedesk-media/skills/socials/templates/socials.html +87 -0
- package/payload/premium-plugins/teaching/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/teaching/PLUGIN.md +58 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/SKILL.md +59 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/assessment.md +70 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +43 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +83 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/SKILL.md +48 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/references/context-gathering.md +41 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/references/plan-structure.md +94 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/SKILL.md +52 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/references/disaggregation.md +49 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/references/materials.md +116 -0
- package/payload/premium-plugins/venture-studio/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/venture-studio/PLUGIN.md +128 -0
- package/payload/premium-plugins/venture-studio/bin/scaffold.sh +116 -0
- package/payload/premium-plugins/venture-studio/skills/brand-pack/SKILL.md +256 -0
- package/payload/premium-plugins/venture-studio/skills/brand-pack/references/color-psychology.md +118 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/SKILL.md +390 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/business-plan-template.md +64 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitive-battlecard.md +37 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitor-analysis.md +32 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/compliance-research-checklist.md +53 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/data-room-structure.md +88 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/deck-blueprint-template.md +39 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/design-tokens-application.md +79 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/html-pdf-pipeline.md +236 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/internal-workings-scrub.md +33 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/monetization-strategy.md +35 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/pricing-strategy.md +37 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/strategy-frameworks.md +46 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/termsheet-template.md +88 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/index.html +1565 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/render-pdf.mjs +91 -0
- package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/term_sheet.html +715 -0
- package/payload/premium-plugins/venture-studio/skills/legal-essentials/SKILL.md +65 -0
- package/payload/premium-plugins/venture-studio/skills/office-hours/SKILL.md +587 -0
- package/payload/premium-plugins/venture-studio/skills/prototype-host/SKILL.md +179 -0
- package/payload/premium-plugins/venture-studio/skills/prototype-host/references/cloudflared-ingress-edit.md +81 -0
- package/payload/premium-plugins/venture-studio/skills/prototype-host/references/scaffold-frameworks.md +60 -0
- package/payload/premium-plugins/venture-studio/skills/prototype-host/references/systemd-user-service.md +104 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/SKILL.md +342 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/aarrr-metrics.md +275 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/assumption-testing.md +93 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/boolean-search.md +308 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/build-measure-learn.md +262 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/business-model-canvas.md +171 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/commitment-signals.md +246 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/design-thinking.md +183 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/earlyvangelist.md +190 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/first-principles.md +58 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/fishbone.md +114 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/five-whys.md +43 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/ice-scoring.md +237 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/innovation-accounting.md +290 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/jtbd.md +105 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/landing-page.md +361 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-sizing.md +58 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-type.md +167 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mom-test.md +193 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mvp-types.md +200 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/og-images.md +239 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pareto.md +103 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/persona-development.md +291 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pivot-types.md +225 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/positioning-statement.md +179 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/prd.md +363 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pre-mortem.md +74 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/problem-validation.md +253 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/product-market-fit.md +256 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/research-synthesis.md +276 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/strategy-red-team.md +41 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/three-engines-of-growth.md +248 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/validation-tests.md +89 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/value-proposition-canvas.md +121 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/win-loss-analysis.md +242 -0
- package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/workflow-mapping.md +271 -0
- package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +21 -0
- package/payload/premium-plugins/writer-craft/PLUGIN.md +134 -0
- package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +96 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts +8 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js +71 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js.map +1 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/package.json +7 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts +51 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js +196 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js.map +1 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/package.json +7 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts +3 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js +58 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts +3 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/index.js +403 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/index.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts +14 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js +47 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts +117 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js +138 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts +90 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js +609 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts +19 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js +124 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts +38 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js +93 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts +61 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js +171 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts +35 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js +127 -0
- package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js.map +1 -0
- package/payload/premium-plugins/writer-craft/mcp/package-lock.json +1327 -0
- package/payload/premium-plugins/writer-craft/mcp/package.json +19 -0
- package/payload/premium-plugins/writer-craft/mcp/scripts/smoke.mjs +420 -0
- package/payload/premium-plugins/writer-craft/mcp/src/index.ts +457 -0
- package/payload/premium-plugins/writer-craft/mcp/src/lib/neo4j.ts +56 -0
- package/payload/premium-plugins/writer-craft/mcp/src/lib/voice-corpus.ts +154 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +833 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-ingest-session-text.ts +153 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +148 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +270 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +181 -0
- package/payload/premium-plugins/writer-craft/mcp/tsconfig.json +8 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/SKILL.md +94 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +77 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/citation-rules.md +103 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/journal-article-models.md +74 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/other-source-models.md +146 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +70 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/SKILL.md +108 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/copyediting.md +73 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +85 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +78 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/line-editing.md +55 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/self-editing.md +89 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +114 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +73 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +76 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +67 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +86 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/SKILL.md +97 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +72 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +91 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +71 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +85 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/SKILL.md +100 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +72 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/repetition.md +71 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +64 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/word-economy.md +93 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/SKILL.md +100 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +79 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +81 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +67 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +94 -0
- package/payload/premium-plugins/writer-craft/skills/review-manuscript/SKILL.md +111 -0
- package/payload/premium-plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +119 -0
- package/payload/premium-plugins/writer-craft/skills/review-prose/SKILL.md +99 -0
- package/payload/premium-plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +112 -0
- package/payload/premium-plugins/writer-craft/skills/review-scene/SKILL.md +99 -0
- package/payload/premium-plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +95 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/SKILL.md +106 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +118 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +66 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +87 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +82 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/SKILL.md +133 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +118 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +128 -0
- package/payload/premium-plugins/writer-craft/skills/voice-mirror/SKILL.md +241 -0
- package/payload/server/adminuser-self-heal-LC7HZAC6.js +54 -0
- package/payload/server/chunk-NE7G5GT7.js +5807 -0
- package/payload/server/chunk-PFF6I7KP.js +31 -0
- package/payload/server/maxy-edge.js +832 -0
- package/payload/server/package.json +11 -0
- package/payload/server/power-health.cjs +129 -0
- package/payload/server/public/assets/AdminLoginScreens-CHTeh_Vu.js +1 -0
- package/payload/server/public/assets/AdminLoginScreens-CWMpccrR.css +1 -0
- package/payload/server/public/assets/AdminShell-DjoP7YoA.js +1 -0
- package/payload/server/public/assets/Checkbox-D58GsKoQ.js +1 -0
- package/payload/server/public/assets/OperatorConversations-CDdp2nVn.css +1 -0
- package/payload/server/public/assets/OperatorConversations-RmqANYz8.js +9 -0
- package/payload/server/public/assets/_baseFor-DVaNaTfF.js +1 -0
- package/payload/server/public/assets/admin-LGICBqil.js +1 -0
- package/payload/server/public/assets/admin-types-CJrGd46U.js +1 -0
- package/payload/server/public/assets/arc-CxLB9WCE.js +1 -0
- package/payload/server/public/assets/architecture-YZFGNWBL-DN-MYxff.js +1 -0
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-D-EdJPSY.js +36 -0
- package/payload/server/public/assets/array-8_H1156C.js +1 -0
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-CXx9RgCm.js +132 -0
- package/payload/server/public/assets/browser-CRgweVtw.js +1 -0
- package/payload/server/public/assets/c4Diagram-AHTNJAMY-RFBXEe0B.js +10 -0
- package/payload/server/public/assets/channel-y27xl53N.js +1 -0
- package/payload/server/public/assets/chat-CXPRTVW7.js +1 -0
- package/payload/server/public/assets/chunk-2KRD3SAO-DBqAFwK9.js +1 -0
- package/payload/server/public/assets/chunk-336JU56O-DdnFEz6R.js +2 -0
- package/payload/server/public/assets/chunk-426QAEUC-D8Iwaegm.js +1 -0
- package/payload/server/public/assets/chunk-4BX2VUAB-cnw-3Gbs.js +1 -0
- package/payload/server/public/assets/chunk-4TB4RGXK-BnqJ0bDc.js +206 -0
- package/payload/server/public/assets/chunk-55IACEB6-BwyHvvzo.js +1 -0
- package/payload/server/public/assets/chunk-5FUZZQ4R-DXA9U02I.js +62 -0
- package/payload/server/public/assets/chunk-5PVQY5BW-D78bZ_8D.js +2 -0
- package/payload/server/public/assets/chunk-67CJDMHE-CtE_Mgv7.js +1 -0
- package/payload/server/public/assets/chunk-7N4EOEYR-CUZDaySl.js +1 -0
- package/payload/server/public/assets/chunk-AA7GKIK3-CYQ3jO4X.js +1 -0
- package/payload/server/public/assets/chunk-BSJP7CBP-BbA_HyTR.js +1 -0
- package/payload/server/public/assets/chunk-CIAEETIT-D7_YqRhG.js +1 -0
- package/payload/server/public/assets/chunk-EDXVE4YY-B23LrtSw.js +1 -0
- package/payload/server/public/assets/chunk-ENJZ2VHE-D3fTHYKN.js +10 -0
- package/payload/server/public/assets/chunk-FMBD7UC4-DFAA2tyh.js +15 -0
- package/payload/server/public/assets/chunk-FOC6F5B3-BF4IHvlI.js +1 -0
- package/payload/server/public/assets/chunk-ICPOFSXX-DBUGemHy.js +122 -0
- package/payload/server/public/assets/chunk-K5T4RW27-rMMs08Eh.js +94 -0
- package/payload/server/public/assets/chunk-KGLVRYIC-BD2r8R2G.js +1 -0
- package/payload/server/public/assets/chunk-LIHQZDEY-D4sYTTwM.js +1 -0
- package/payload/server/public/assets/chunk-ORNJ4GCN-CAs_uFzb.js +1 -0
- package/payload/server/public/assets/chunk-OYMX7WX6-Fkp-2ORc.js +231 -0
- package/payload/server/public/assets/chunk-Pqm5yXtL.js +1 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-qHqDpwz3.js +1 -0
- package/payload/server/public/assets/chunk-U2HBQHQK-D_pxZh25.js +70 -0
- package/payload/server/public/assets/chunk-X2U36JSP-CeVmvvRf.js +1 -0
- package/payload/server/public/assets/chunk-XPW4576I-iWP54fKp.js +32 -0
- package/payload/server/public/assets/chunk-YZCP3GAM-CNtbWJNN.js +1 -0
- package/payload/server/public/assets/chunk-ZZ45TVLE-BmlFjU_9.js +1 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DgVoYWhO.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-C0WNP3uN.js +1 -0
- package/payload/server/public/assets/clone-D50F_pvg.js +1 -0
- package/payload/server/public/assets/cormorant-cyrillic-300-normal-CzPHYadL.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-300-normal-DFUoTmrg.woff2 +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-400-normal-C8QS47vb.woff2 +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-400-normal-D3EsxgFc.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-500-normal-B7dJQtg-.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-500-normal-BLlg2W5x.woff2 +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-300-normal-BXl3lXsi.woff2 +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-300-normal-DmxSOTe3.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-400-normal-Bgrpe4p1.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-400-normal-BlcaxZtM.woff2 +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-500-normal-CdQuyvtc.woff +0 -0
- package/payload/server/public/assets/cormorant-cyrillic-ext-500-normal-pZw22qtS.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-300-normal-CJ5dfen0.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-300-normal-DQZObO_3.woff +0 -0
- package/payload/server/public/assets/cormorant-latin-400-normal-BGH8Vunh.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-400-normal-C3_-2Ua-.woff +0 -0
- package/payload/server/public/assets/cormorant-latin-500-normal-Dj3SQ6fR.woff +0 -0
- package/payload/server/public/assets/cormorant-latin-500-normal-EBdSCOD3.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-300-normal-CkiUx0UG.woff +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-300-normal-De3D72RL.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-400-normal-DuQ88yz3.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-400-normal-DuXFa1Dr.woff +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-500-normal-AH9qog1s.woff2 +0 -0
- package/payload/server/public/assets/cormorant-latin-ext-500-normal-DAuUCO41.woff +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-300-normal-BVqIp_mg.woff2 +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-300-normal-CEMS9Pw-.woff +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-400-normal-C-RiYxEf.woff2 +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-400-normal-DmUuA7Y2.woff +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-500-normal-DsPuwQHi.woff2 +0 -0
- package/payload/server/public/assets/cormorant-vietnamese-500-normal-tGBW_mI7.woff +0 -0
- package/payload/server/public/assets/cose-bilkent-S5V4N54A-C7YmF1Pg.js +1 -0
- package/payload/server/public/assets/cytoscape.esm-h10p_6j-.js +321 -0
- package/payload/server/public/assets/dagre-BAmiDDtR.js +1 -0
- package/payload/server/public/assets/dagre-KV5264BT-Ca3ESJhc.js +4 -0
- package/payload/server/public/assets/data-CttrzhfL.js +1 -0
- package/payload/server/public/assets/defaultLocale-pD7tFa1r.js +1 -0
- package/payload/server/public/assets/diagram-5BDNPKRD-BgT1ORf2.js +10 -0
- package/payload/server/public/assets/diagram-G4DWMVQ6-BTaUIiem.js +24 -0
- package/payload/server/public/assets/diagram-MMDJMWI5-Bdb2g6Uo.js +43 -0
- package/payload/server/public/assets/diagram-TYMM5635-CkLGC0zZ.js +24 -0
- package/payload/server/public/assets/dist-Bkbhs3jw.js +1 -0
- package/payload/server/public/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
- package/payload/server/public/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
- package/payload/server/public/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
- package/payload/server/public/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
- package/payload/server/public/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
- package/payload/server/public/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
- package/payload/server/public/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
- package/payload/server/public/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
- package/payload/server/public/assets/erDiagram-SMLLAGMA-D_sj4DMg.js +85 -0
- package/payload/server/public/assets/flatten-E2Sr0FeD.js +1 -0
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-iLERoZTe.js +162 -0
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-D60hjMBy.js +292 -0
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-D-L2yzYf.js +1 -0
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-Di0XM6fi.js +106 -0
- package/payload/server/public/assets/graph-CIBba84R.js +51 -0
- package/payload/server/public/assets/graph-labels-Bi0fu8Ns.js +1 -0
- package/payload/server/public/assets/graphlib-C8fUP7uV.js +1 -0
- package/payload/server/public/assets/info-OMHHGYJF-BQn6jndO.js +1 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-BwMdbiXg.js +2 -0
- package/payload/server/public/assets/init-CwJ4b81e.js +1 -0
- package/payload/server/public/assets/isEmpty-CLz-UprQ.js +1 -0
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CwgI4B5Z.js +70 -0
- package/payload/server/public/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/payload/server/public/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/payload/server/public/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/payload/server/public/assets/journeyDiagram-VCZTEJTY-CxBu-tze.js +139 -0
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-D2qlheA5.js +89 -0
- package/payload/server/public/assets/katex-DJPjIBAI.js +257 -0
- package/payload/server/public/assets/line-Bdod7uzQ.js +1 -0
- package/payload/server/public/assets/linear-BiVe6QzC.js +1 -0
- package/payload/server/public/assets/mermaid-parser.core-xZN7hC6M.js +4 -0
- package/payload/server/public/assets/mermaid.core-D0IylAac.js +11 -0
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-J_Szhwf1.js +96 -0
- package/payload/server/public/assets/operator-mwkYv8g5.js +1 -0
- package/payload/server/public/assets/ordinal-5RtyPJVt.js +1 -0
- package/payload/server/public/assets/packet-4T2RLAQJ-DmkQBx4h.js +1 -0
- package/payload/server/public/assets/page-BpxHz1N-.js +30 -0
- package/payload/server/public/assets/path-CK8wrAxY.js +1 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-DDnxYUBm.js +1 -0
- package/payload/server/public/assets/pieDiagram-DEJITSTG-CV5DxUVx.js +30 -0
- package/payload/server/public/assets/preload-helper-Bf_JiD2A.js +1 -0
- package/payload/server/public/assets/public-CiUboUwu.js +1 -0
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-BsFMVizF.js +7 -0
- package/payload/server/public/assets/radar-PYXPWWZC-7H4k0ChM.js +1 -0
- package/payload/server/public/assets/reduce-B3Mw_0s1.js +1 -0
- package/payload/server/public/assets/requirementDiagram-MS252O5E-C5eRRvGc.js +84 -0
- package/payload/server/public/assets/rough.esm-Dwml_la6.js +1 -0
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-CJYv5gpw.js +10 -0
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-B25563_2.js +157 -0
- package/payload/server/public/assets/src-BKOAoFQc.js +1 -0
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-BLyNJYOA.js +1 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BSVuxZxz.js +1 -0
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-D-HgOM6Q.js +120 -0
- package/payload/server/public/assets/treeView-SZITEDCU-BLXWTQtW.js +1 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-DiePDF5d.js +1 -0
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-Cw1JElYp.js +34 -0
- package/payload/server/public/assets/wardley-RL74JXVD-OSUWK5LN.js +1 -0
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-BqMWzEko.js +20 -0
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-DBp71TLT.js +7 -0
- package/payload/server/public/brand/claude.png +0 -0
- package/payload/server/public/brand/maxy-black.png +0 -0
- package/payload/server/public/brand/maxy-monochrome.png +0 -0
- package/payload/server/public/brand/maxy.png +0 -0
- package/payload/server/public/brand/sitedesk-black.png +0 -0
- package/payload/server/public/brand/sitedesk-favicon-180.png +0 -0
- package/payload/server/public/brand/sitedesk-favicon-32.png +0 -0
- package/payload/server/public/brand/sitedesk-favicon-512.png +0 -0
- package/payload/server/public/brand/sitedesk-horizontal-dark.png +0 -0
- package/payload/server/public/brand/sitedesk-horizontal.png +0 -0
- package/payload/server/public/brand/sitedesk-icon.svg +8 -0
- package/payload/server/public/brand/sitedesk-monochrome.png +0 -0
- package/payload/server/public/brand/sitedesk-square.png +0 -0
- package/payload/server/public/brand/sitedesk-stacked.png +0 -0
- package/payload/server/public/brand/sitedesk-white.png +0 -0
- package/payload/server/public/brand/star.png +0 -0
- package/payload/server/public/brand-constants.json +8 -0
- package/payload/server/public/brand-defaults.css +12 -0
- package/payload/server/public/browser.html +17 -0
- package/payload/server/public/chat.html +20 -0
- package/payload/server/public/consent.css +97 -0
- package/payload/server/public/consent.js +259 -0
- package/payload/server/public/data.html +17 -0
- package/payload/server/public/favicon.ico +0 -0
- package/payload/server/public/graph.html +19 -0
- package/payload/server/public/index.html +22 -0
- package/payload/server/public/operator.html +23 -0
- package/payload/server/public/privacy.html +129 -0
- package/payload/server/public/public.html +21 -0
- package/payload/server/public/robots.txt +5 -0
- package/payload/server/public/sw.js +24 -0
- package/payload/server/public/v.js +244 -0
- package/payload/server/public/vnc-popout.html +63 -0
- package/payload/server/public/whatsapp-wallpaper.webp +0 -0
- package/payload/server/server-init-line-stamper.cjs +26 -0
- package/payload/server/server-init.cjs +251 -0
- package/payload/server/server.js +21647 -0
|
@@ -0,0 +1,2797 @@
|
|
|
1
|
+
// Loopback-only HTTP API exposed by the manager. The Hono wrapper at
|
|
2
|
+
// platform/ui/server/routes/admin/claude-sessions.ts proxies admin requests
|
|
3
|
+
// here via fetch.
|
|
4
|
+
//
|
|
5
|
+
// Routes:
|
|
6
|
+
// POST /spawn { senderId, role, channel, tunnelUrl? } -> Session
|
|
7
|
+
// POST /:id/stop -> 204 (kill PTY; idempotent on already-dead row)
|
|
8
|
+
// 404 if no row matches any of the 4 keys
|
|
9
|
+
// DELETE /:id -> 204 (rmSync JSONL + subdir)
|
|
10
|
+
// 409 if PTY still alive
|
|
11
|
+
// 404 if no transcript on disk
|
|
12
|
+
// POST /:id/input { text }
|
|
13
|
+
// GET /:id/log -> { jsonlPath, sizeBytes, exists }
|
|
14
|
+
// GET /:id/log?follow=1 -> streamed file content (current + new)
|
|
15
|
+
// GET /:id/meta -> SessionMeta payload
|
|
16
|
+
// POST /:id/archive { mode }
|
|
17
|
+
//
|
|
18
|
+
// Any of the four ids — intrinsic sessionId, bridgeSessionId, bridgeSuffix,
|
|
19
|
+
// or pid (numeric) — resolves to the same row via the fs-watcher index.
|
|
20
|
+
// Unknown ids return 404; nothing returns a silent 204 against an id the
|
|
21
|
+
// manager does not know.
|
|
22
|
+
import { Hono } from 'hono';
|
|
23
|
+
import { stream } from 'hono/streaming';
|
|
24
|
+
import { existsSync, statSync, createReadStream, watchFile, unwatchFile, rmSync, mkdirSync, renameSync, readFileSync, writeFileSync } from 'node:fs';
|
|
25
|
+
import { tmpdir } from 'node:os';
|
|
26
|
+
import { buildWaChannelMcpServers, buildWaChannelArgv, waChannelMcpConfigPath, isDevChannelPrompt } from './wa-channel-mcp.js';
|
|
27
|
+
import { buildWebchatChannelMcpServers, buildWebchatChannelArgv, webchatChannelMcpConfigPath } from './webchat-channel-mcp.js';
|
|
28
|
+
import { buildChannelMcpServers, buildChannelArgv, channelMcpConfigPath } from './channel-mcp.js';
|
|
29
|
+
import { mergeTarget, isMultiTarget, targetKinds } from './channel-targets.js';
|
|
30
|
+
import { randomUUID } from 'node:crypto';
|
|
31
|
+
import { execFileSync } from 'node:child_process';
|
|
32
|
+
import { buildRcChildEnv, reapplyAdminLevers } from './rc-daemon.js';
|
|
33
|
+
import { isEffortLevel, isNewSessionEffortLevel, isPermissionMode, SONNET_MODEL } from '../../../lib/models/dist/index.js';
|
|
34
|
+
import { spawnClaudeSession, stopSession, writeInputToPty, isLive, onPtyExit, livePtyCount, liveSessionIds, getPtyTrackerForTests, livePidForSession, classifyLiveness, priorExitedCountForSession, PERMISSION_MODES, openFdCount, registerRcSpawnPty, } from './pty-spawner.js';
|
|
35
|
+
import { writeScopeRecord, removeScopeRecord } from './scope-record.js';
|
|
36
|
+
import { writeReseatMarker, resolveReseatChain, clearReseatMarker } from './reseat-ledger.js';
|
|
37
|
+
import { getScopeMainPid, defaultProcessSignals, defaultSystemctlRunner } from './systemd-scope.js';
|
|
38
|
+
import { readSidecar, updateSidecar, appendBridgeId, writeSidecar } from './session-sidecar.js';
|
|
39
|
+
import { resolveSettingsPermissionMode, resolveSettingsModel, resolveSettingsEffort } from './settings-permission-mode.js';
|
|
40
|
+
import { emitRcLife } from './rc-life.js';
|
|
41
|
+
import { createRcChildLog } from './rc-child-log.js';
|
|
42
|
+
import { readJsonlSession } from './jsonl-enumerator.js';
|
|
43
|
+
import { watchInputSubmission, countUserEntries } from './input-postcondition.js';
|
|
44
|
+
import { claudeStateRoot, projectSlugForCwd, jsonlPathForSessionId, sidecarPathForSessionId, permissionModeLogPathForSessionId, findExistingJsonlForSessionId, detectRemoteControlSlug, classifyBindBlocker, } from './jsonl-path.js';
|
|
45
|
+
import { basename, dirname, join } from 'node:path';
|
|
46
|
+
import { validateUserTitle } from './user-title-store.js';
|
|
47
|
+
import { credentialsPathForConfigDir, snapshotAuthForFailureReason } from './auth-snapshot.js';
|
|
48
|
+
const ROLES = ['admin', 'public'];
|
|
49
|
+
const CHANNELS = ['browser', 'whatsapp', 'telegram', 'webchat', 'email'];
|
|
50
|
+
// Task 382 — body.conversationNodeId shape gate. The value is the
|
|
51
|
+
// sessionId UUID (v4) minted by createNewAdminConversation in
|
|
52
|
+
// platform/ui/app/lib/neo4j-store.ts.
|
|
53
|
+
const 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}$/;
|
|
54
|
+
function parseAboutOwner(raw) {
|
|
55
|
+
if (!raw || typeof raw !== 'object')
|
|
56
|
+
return undefined;
|
|
57
|
+
const r = raw;
|
|
58
|
+
if (r.ok === true && typeof r.body === 'string')
|
|
59
|
+
return { ok: true, body: r.body };
|
|
60
|
+
if (r.ok === false && typeof r.reason === 'string' && r.reason.length > 0)
|
|
61
|
+
return { ok: false, reason: r.reason };
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
function parseDormantPlugins(raw) {
|
|
65
|
+
if (!Array.isArray(raw))
|
|
66
|
+
return undefined;
|
|
67
|
+
const out = [];
|
|
68
|
+
for (const entry of raw) {
|
|
69
|
+
if (!entry || typeof entry !== 'object')
|
|
70
|
+
continue;
|
|
71
|
+
const e = entry;
|
|
72
|
+
if (typeof e.name !== 'string' || e.name.length === 0)
|
|
73
|
+
continue;
|
|
74
|
+
if (typeof e.description !== 'string')
|
|
75
|
+
continue;
|
|
76
|
+
out.push({ name: e.name, description: e.description });
|
|
77
|
+
}
|
|
78
|
+
return out.length > 0 ? out : undefined;
|
|
79
|
+
}
|
|
80
|
+
function parseNameDescList(raw) {
|
|
81
|
+
if (!Array.isArray(raw))
|
|
82
|
+
return [];
|
|
83
|
+
const out = [];
|
|
84
|
+
for (const entry of raw) {
|
|
85
|
+
if (!entry || typeof entry !== 'object')
|
|
86
|
+
continue;
|
|
87
|
+
const e = entry;
|
|
88
|
+
if (typeof e.name !== 'string' || e.name.length === 0)
|
|
89
|
+
continue;
|
|
90
|
+
const item = { name: e.name };
|
|
91
|
+
if (typeof e.description === 'string' && e.description.length > 0)
|
|
92
|
+
item.description = e.description;
|
|
93
|
+
out.push(item);
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
function parseActivePlugins(raw) {
|
|
98
|
+
if (!Array.isArray(raw))
|
|
99
|
+
return undefined;
|
|
100
|
+
const out = [];
|
|
101
|
+
for (const entry of raw) {
|
|
102
|
+
if (!entry || typeof entry !== 'object')
|
|
103
|
+
continue;
|
|
104
|
+
const e = entry;
|
|
105
|
+
if (typeof e.name !== 'string' || e.name.length === 0)
|
|
106
|
+
continue;
|
|
107
|
+
if (typeof e.description !== 'string')
|
|
108
|
+
continue;
|
|
109
|
+
out.push({
|
|
110
|
+
name: e.name,
|
|
111
|
+
description: e.description,
|
|
112
|
+
tools: parseNameDescList(e.tools),
|
|
113
|
+
skills: parseNameDescList(e.skills),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return out.length > 0 ? out : undefined;
|
|
117
|
+
}
|
|
118
|
+
function parseSpecialistDomains(raw) {
|
|
119
|
+
if (!Array.isArray(raw))
|
|
120
|
+
return undefined;
|
|
121
|
+
const out = [];
|
|
122
|
+
for (const entry of raw) {
|
|
123
|
+
if (!entry || typeof entry !== 'object')
|
|
124
|
+
continue;
|
|
125
|
+
const e = entry;
|
|
126
|
+
if (typeof e.name !== 'string' || e.name.length === 0)
|
|
127
|
+
continue;
|
|
128
|
+
if (typeof e.description !== 'string')
|
|
129
|
+
continue;
|
|
130
|
+
out.push({ name: e.name, description: e.description, tools: parseNameDescList(e.tools) });
|
|
131
|
+
}
|
|
132
|
+
return out.length > 0 ? out : undefined;
|
|
133
|
+
}
|
|
134
|
+
// `<id>` may be: intrinsic UUID, bridgeSessionId ("session_<suffix>"),
|
|
135
|
+
// bridgeSuffix, or pid (numeric). No `.` or `/` — the character class
|
|
136
|
+
// is narrowed so the downstream `jsonlPathForSessionId` composition
|
|
137
|
+
// cannot be steered into a sibling extension or a path segment.
|
|
138
|
+
export const SESSION_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
139
|
+
// Task 648 — `/rc-spawn` polls the pid file for the late-written
|
|
140
|
+
// bridgeSessionId (the `claude.ai/code/session_<id>` slug) up to this bound.
|
|
141
|
+
// Device-measured RC bridge bind latency is 18–30s; the prior 12s bound
|
|
142
|
+
// expired first, so the slug was never captured before the response returned
|
|
143
|
+
// and the client opened a bare URL. 60s covers the observed worst case.
|
|
144
|
+
// Injectable via `HttpDeps.rcSpawnUrlWaitMs` so the timeout path is
|
|
145
|
+
// unit-testable without a real 60s wait.
|
|
146
|
+
export const RC_SPAWN_URL_WAIT_DEFAULT_MS = 60_000;
|
|
147
|
+
const LIST_TAIL_BYTES = 64 * 1024;
|
|
148
|
+
function timed(logger, method, path, status, ms) {
|
|
149
|
+
logger(`api method=${method} path=${path} outcome=${status} ms=${ms}`);
|
|
150
|
+
}
|
|
151
|
+
/** Task 666 — parse an env override to a finite positive number, falling back to
|
|
152
|
+
* `fallback` for unset / non-numeric / non-positive values so a bad
|
|
153
|
+
* INPUT_SUBMIT_POLL_* override cannot turn the post-condition poll into a
|
|
154
|
+
* never-terminating NaN loop. */
|
|
155
|
+
function finitePositive(raw, fallback) {
|
|
156
|
+
const n = Number(raw);
|
|
157
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
158
|
+
}
|
|
159
|
+
/** Resolve any of the 4 keys to the canonical (sessionId, row) pair.
|
|
160
|
+
* Tries: intrinsic sessionId, bridgeSessionId, bridgeSuffix, numeric pid.
|
|
161
|
+
* Returns undefined when nothing matches. */
|
|
162
|
+
function resolveRow(watcher, id) {
|
|
163
|
+
const direct = watcher.getBySessionId(id);
|
|
164
|
+
if (direct)
|
|
165
|
+
return direct;
|
|
166
|
+
const byBridge = watcher.getByBridgeSessionId(id);
|
|
167
|
+
if (byBridge)
|
|
168
|
+
return byBridge;
|
|
169
|
+
const bySuffix = watcher.getByBridgeSuffix(id);
|
|
170
|
+
if (bySuffix)
|
|
171
|
+
return bySuffix;
|
|
172
|
+
if (/^\d+$/.test(id)) {
|
|
173
|
+
const byPid = watcher.getByPid(Number(id));
|
|
174
|
+
if (byPid)
|
|
175
|
+
return byPid;
|
|
176
|
+
}
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
// Task 147 — auto-archive for the database-operator specialist on
|
|
180
|
+
// `end_turn`. The recorder is a Sidebar-equivalent admin spawn whose only
|
|
181
|
+
// override is the specialist value. Once its JSONL contains an assistant
|
|
182
|
+
// message with `stop_reason === "end_turn"`, stop the PTY and let the
|
|
183
|
+
// normal archive path run. No tool-call tally, no recorder-only log
|
|
184
|
+
// surfaces — the Sidebar's `pty-spawned … jsonl … end_turn …
|
|
185
|
+
// auto-archive` lines cover the lifecycle.
|
|
186
|
+
const END_TURN_SIGNATURE = '"stop_reason":"end_turn"';
|
|
187
|
+
const AUTO_ARCHIVE_SPECIALIST = 'database-operator';
|
|
188
|
+
// Task 876 — re-seat (operator-initiated model change for an existing admin
|
|
189
|
+
// webchat session). Fork the source onto a fresh session born on the chosen
|
|
190
|
+
// model: `--resume <old>` seeds history, `--fork-session` mints into the
|
|
191
|
+
// pre-supplied `--session-id <new>`, `--model` pins the fork's first turn.
|
|
192
|
+
// Pure so the argv shape is unit-tested without a spawn.
|
|
193
|
+
export function forkArgvSegment(fromSessionId, newSessionId, model) {
|
|
194
|
+
return ['--resume', fromSessionId, '--fork-session', '--session-id', newSessionId, '--model', model];
|
|
195
|
+
}
|
|
196
|
+
// Task 928 — the re-seat fork carries an optional permission mode (pushed as the
|
|
197
|
+
// `--permission-mode` argv flag) and an optional effort (merged into the
|
|
198
|
+
// per-spawn inline `--settings` as `effortLevel`). Both are validated here as a
|
|
199
|
+
// shape defence-in-depth: the UI route is the authoritative allowlist gate, but
|
|
200
|
+
// a malformed value must never reach the child argv. The allowlists are the
|
|
201
|
+
// canonical sets in lib/models (isPermissionMode / isEffortLevel); `dontAsk` and
|
|
202
|
+
// `max` are excluded there (not fork-writable).
|
|
203
|
+
// Task 879 — the re-seated fork inherits the source's history, including the
|
|
204
|
+
// source's earlier self-identification on the OLD model. The rc-spawn path does
|
|
205
|
+
// not compose --append-system-prompt (only fresh spawnSession does), so the
|
|
206
|
+
// fork alone gets an authoritative current-model line on its argv: the agent
|
|
207
|
+
// answers the live model on the first ask, without being challenged. General
|
|
208
|
+
// self-ID accuracy (absent a re-seat) is out of scope — only the fork gets it.
|
|
209
|
+
export function reseatIdentityPrompt(model) {
|
|
210
|
+
return `This conversation now runs on the model ${model}. Earlier messages may show you identifying as a different model; that is stale context from before a model change — disregard it and state ${model} as your current model if asked.`;
|
|
211
|
+
}
|
|
212
|
+
// Task 889 — the authenticated-admin identity line for a webchat-bound admin
|
|
213
|
+
// rc session. The rc-spawn path composes no fresh-spawn system prompt, so this
|
|
214
|
+
// --append-system-prompt segment is the agent's only signal of who it is
|
|
215
|
+
// talking to. Re-passed on every spawn (fresh and resume) because the append
|
|
216
|
+
// fact is not persisted in the JSONL; without it the agent guesses the
|
|
217
|
+
// Anthropic account email visible in its context. `name` is the resolved
|
|
218
|
+
// `AdminUser` display name, or null/empty when the identity could not be
|
|
219
|
+
// resolved — the not-resolvable line is still injected to suppress the guess.
|
|
220
|
+
export function authenticatedIdentityPrompt(name) {
|
|
221
|
+
const trimmed = name?.trim() ?? '';
|
|
222
|
+
if (trimmed.length > 0) {
|
|
223
|
+
return `This admin webchat session is authenticated as ${trimmed}. If you are asked who you are talking to or who this session is authenticated as, answer ${trimmed}; never infer the operator's identity from an email address or account label visible in your context.`;
|
|
224
|
+
}
|
|
225
|
+
return `This admin webchat session's authenticated identity could not be resolved. If you are asked who you are talking to or who this session is authenticated as, say the identity is not resolvable; never infer it from an email address or account label visible in your context.`;
|
|
226
|
+
}
|
|
227
|
+
// Task 876 — the re-seat post-condition line. Emitted ONLY after a real
|
|
228
|
+
// assistant turn on the fork is read (intention is not logged, per the
|
|
229
|
+
// observability contract): a re-seat that silently lands on the wrong model
|
|
230
|
+
// is visible rather than reported as success. Correlation key: old→new id.
|
|
231
|
+
export function formatReseatLine(fromModel, toModel, oldSessionId, newSessionId, observed) {
|
|
232
|
+
return `[webchat:reseat] op=reseat from-model=${fromModel ?? 'unknown'} to-model=${toModel} old-session=${oldSessionId} new-session=${newSessionId} first-turn-model=${observed ?? 'unknown'}`;
|
|
233
|
+
}
|
|
234
|
+
// Task 876 — read the most-recent real (non-synthetic) assistant model from a
|
|
235
|
+
// session's JSONL. The source's last answered model is the re-seat's
|
|
236
|
+
// from-model; a stranded session whose only tail is a synthetic error yields
|
|
237
|
+
// null ('unknown'). Bottom-up scan: the latest answered turn wins.
|
|
238
|
+
function lastRealAssistantModel(jsonlPath) {
|
|
239
|
+
let lines;
|
|
240
|
+
try {
|
|
241
|
+
lines = readFileSync(jsonlPath, 'utf8').split('\n').filter((l) => l.length > 0);
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
247
|
+
try {
|
|
248
|
+
const rec = JSON.parse(lines[i]);
|
|
249
|
+
if (rec.type === 'assistant' && typeof rec.message?.model === 'string' && rec.message.model !== '<synthetic>') {
|
|
250
|
+
return rec.message.model;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
/* a mid-write line — skip it */
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
// Task 876 — the FORK's first post-reseat assistant model. The fork JSONL
|
|
260
|
+
// opens with the copied history, and `--fork-session` PRESERVES each copied
|
|
261
|
+
// turn's original `timestamp` (verified: only `sessionId` is rewritten), so a
|
|
262
|
+
// post-arm timestamp cleanly discriminates the operator's first new turn from
|
|
263
|
+
// the copied history — independent of WHEN the copy flushes to disk (a
|
|
264
|
+
// line-count baseline would race the flush). Returns the first non-synthetic
|
|
265
|
+
// assistant model whose turn timestamp is strictly after `armTimeMs`, or null
|
|
266
|
+
// when no such turn has landed yet.
|
|
267
|
+
export function firstPostArmAssistantModel(lines, armTimeMs) {
|
|
268
|
+
for (const line of lines) {
|
|
269
|
+
if (line.length === 0)
|
|
270
|
+
continue;
|
|
271
|
+
try {
|
|
272
|
+
const rec = JSON.parse(line);
|
|
273
|
+
if (rec.type !== 'assistant')
|
|
274
|
+
continue;
|
|
275
|
+
const model = rec.message?.model;
|
|
276
|
+
if (typeof model !== 'string' || model === '<synthetic>')
|
|
277
|
+
continue;
|
|
278
|
+
const ts = typeof rec.timestamp === 'string' ? Date.parse(rec.timestamp) : NaN;
|
|
279
|
+
if (Number.isFinite(ts) && ts > armTimeMs)
|
|
280
|
+
return model;
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
/* a mid-write line — skip it */
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
// Task 876 — arm a one-shot reader on the FORK's first post-reseat assistant
|
|
289
|
+
// turn. `armTimeMs` is captured here (after bind); only assistant turns
|
|
290
|
+
// timestamped after it are read, so the copied history (old timestamps) is
|
|
291
|
+
// skipped however late it flushes. Emits the correlation line once a real
|
|
292
|
+
// model is read, then detaches; cleaned up on PTY exit.
|
|
293
|
+
function attachReseatObserve(deps, newSessionId, ctx) {
|
|
294
|
+
let done = false;
|
|
295
|
+
const jsonlPath = jsonlPathForSessionId(deps.spawnCwd, newSessionId);
|
|
296
|
+
const armTimeMs = Date.now();
|
|
297
|
+
function tryEmit() {
|
|
298
|
+
if (done)
|
|
299
|
+
return;
|
|
300
|
+
let lines;
|
|
301
|
+
try {
|
|
302
|
+
lines = readFileSync(jsonlPath, 'utf8').split('\n');
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const observed = firstPostArmAssistantModel(lines, armTimeMs);
|
|
308
|
+
if (observed === null)
|
|
309
|
+
return;
|
|
310
|
+
done = true;
|
|
311
|
+
deps.logger(formatReseatLine(ctx.fromModel, ctx.toModel, ctx.oldSessionId, newSessionId, observed));
|
|
312
|
+
}
|
|
313
|
+
const unsubscribe = deps.watcher.subscribe((event) => {
|
|
314
|
+
if (done)
|
|
315
|
+
return;
|
|
316
|
+
if (event.sessionId !== newSessionId)
|
|
317
|
+
return;
|
|
318
|
+
if (event.source !== 'jsonl')
|
|
319
|
+
return;
|
|
320
|
+
tryEmit();
|
|
321
|
+
});
|
|
322
|
+
onPtyExit(newSessionId, () => unsubscribe());
|
|
323
|
+
}
|
|
324
|
+
// One-shot auto-close: once the session's JSONL contains an assistant
|
|
325
|
+
// message with `stop_reason === "end_turn"`, stop the PTY so the session
|
|
326
|
+
// closes after its single turn. Shared by the public-spawn database-operator
|
|
327
|
+
// specialist path (below) and the `/rc-spawn` `closeAfterTurn` jobs (LinkedIn
|
|
328
|
+
// ingest, public session-end review). `label` only colours the log line.
|
|
329
|
+
function attachEndTurnAutoClose(deps, sessionId, label) {
|
|
330
|
+
let closed = false;
|
|
331
|
+
const jsonlPath = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
332
|
+
function endTurnSeen() {
|
|
333
|
+
try {
|
|
334
|
+
return readFileSync(jsonlPath, 'utf8').includes(END_TURN_SIGNATURE);
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function tryClose() {
|
|
341
|
+
if (closed)
|
|
342
|
+
return;
|
|
343
|
+
if (!existsSync(jsonlPath))
|
|
344
|
+
return;
|
|
345
|
+
if (!endTurnSeen())
|
|
346
|
+
return;
|
|
347
|
+
closed = true;
|
|
348
|
+
deps.logger(`auto-archive sessionId=${sessionId} ${label} reason=end-turn archivedAt=${new Date().toISOString()}`);
|
|
349
|
+
void stopSession({
|
|
350
|
+
killGraceMs: deps.killGraceMs,
|
|
351
|
+
logger: deps.logger,
|
|
352
|
+
runSystemctl: deps.runSystemctl,
|
|
353
|
+
}, sessionId);
|
|
354
|
+
}
|
|
355
|
+
tryClose();
|
|
356
|
+
const unsubscribe = deps.watcher.subscribe((event) => {
|
|
357
|
+
if (closed)
|
|
358
|
+
return;
|
|
359
|
+
if (event.sessionId !== sessionId)
|
|
360
|
+
return;
|
|
361
|
+
if (event.source !== 'jsonl')
|
|
362
|
+
return;
|
|
363
|
+
tryClose();
|
|
364
|
+
});
|
|
365
|
+
onPtyExit(sessionId, () => unsubscribe());
|
|
366
|
+
}
|
|
367
|
+
// Task 147 — public-spawn database-operator specialist auto-archive. Unchanged
|
|
368
|
+
// behaviour: only the database-operator specialist auto-closes on end_turn.
|
|
369
|
+
function attachSpecialistEndTurnAutoArchive(deps, sessionId, specialist) {
|
|
370
|
+
if (specialist !== AUTO_ARCHIVE_SPECIALIST)
|
|
371
|
+
return;
|
|
372
|
+
attachEndTurnAutoClose(deps, sessionId, `specialist=${AUTO_ARCHIVE_SPECIALIST}`);
|
|
373
|
+
}
|
|
374
|
+
function attachPublicAudit(deps, sessionId, role) {
|
|
375
|
+
if (role !== 'public')
|
|
376
|
+
return;
|
|
377
|
+
const jsonlPath = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
378
|
+
if (!existsSync(jsonlPath))
|
|
379
|
+
return;
|
|
380
|
+
deps.publicToolAudit.attach(sessionId, jsonlPath);
|
|
381
|
+
if (!isLive(sessionId)) {
|
|
382
|
+
deps.publicToolAudit.detach(sessionId);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
onPtyExit(sessionId, () => {
|
|
386
|
+
deps.publicToolAudit.detach(sessionId);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
// Task 488 — one-time guard so a manager booted without the UI port logs the
|
|
390
|
+
// gap once rather than on every public PTY exit.
|
|
391
|
+
let exitNotifyEnvWarned = false;
|
|
392
|
+
/** Task 488 — notify the bridge when a role=public PTY exits explicitly
|
|
393
|
+
* (operator stop, claude crash, manager DELETE). The bridge owns the slice
|
|
394
|
+
* ringfence the session-end reviewer needs; the manager knows only the
|
|
395
|
+
* sessionId, so it POSTs that and lets the bridge resolve the rest. Wired at
|
|
396
|
+
* the same two sites as `attachPublicAudit` (spawn-ready + watcher create) so
|
|
397
|
+
* it covers every public PTY this manager process owns.
|
|
398
|
+
*
|
|
399
|
+
* Fire-and-forget: the POST is best-effort. When it is lost (bridge down,
|
|
400
|
+
* port unset), the bridge idle-reaper is the backstop — it reviews the
|
|
401
|
+
* session from the archived transcript at its next sweep. The notify only
|
|
402
|
+
* makes the review prompt and covers the manager-DELETE case where the
|
|
403
|
+
* transcript is removed before the idle sweep. */
|
|
404
|
+
function attachPublicExitNotify(sessionId, role, logger) {
|
|
405
|
+
if (role !== 'public')
|
|
406
|
+
return;
|
|
407
|
+
if (!isLive(sessionId))
|
|
408
|
+
return;
|
|
409
|
+
onPtyExit(sessionId, () => {
|
|
410
|
+
const uiPort = process.env.MAXY_UI_INTERNAL_PORT ?? '';
|
|
411
|
+
if (uiPort.length === 0) {
|
|
412
|
+
if (!exitNotifyEnvWarned) {
|
|
413
|
+
exitNotifyEnvWarned = true;
|
|
414
|
+
logger('[public-session-exit-notify] warn=MAXY_UI_INTERNAL_PORT-missing review-on-exit=will-not-reach-bridge');
|
|
415
|
+
}
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const url = `http://127.0.0.1:${uiPort}/api/admin/public-session-exit`;
|
|
419
|
+
void fetch(url, {
|
|
420
|
+
method: 'POST',
|
|
421
|
+
headers: { 'content-type': 'application/json' },
|
|
422
|
+
body: JSON.stringify({ sessionId }),
|
|
423
|
+
})
|
|
424
|
+
.then((res) => {
|
|
425
|
+
logger(`[public-session-exit-notify] sessionId=${sessionId.slice(0, 8)} status=${res.status}`);
|
|
426
|
+
})
|
|
427
|
+
.catch((err) => {
|
|
428
|
+
logger(`[public-session-exit-notify] sessionId=${sessionId.slice(0, 8)} error=${err instanceof Error ? err.message : String(err)}`);
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
// Task 662 — the installed Claude Code version, detected once per process and
|
|
433
|
+
// cached. Only the `/rc-spawn` bind-signal-absent path reads it (a cold path),
|
|
434
|
+
// so the `claude --version` subprocess never runs on a successful spawn. A
|
|
435
|
+
// failure to detect (missing binary, slow exec) degrades to 'unknown' rather
|
|
436
|
+
// than throwing — the marker still lands, naming the contract that drifted.
|
|
437
|
+
let cachedCliVersion = null;
|
|
438
|
+
function detectCliVersion(claudeBin) {
|
|
439
|
+
if (cachedCliVersion !== null)
|
|
440
|
+
return cachedCliVersion;
|
|
441
|
+
try {
|
|
442
|
+
const out = execFileSync(claudeBin, ['--version'], { encoding: 'utf8', timeout: 5_000 });
|
|
443
|
+
cachedCliVersion = out.trim().split('\n')[0] || 'unknown';
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
cachedCliVersion = 'unknown';
|
|
447
|
+
}
|
|
448
|
+
return cachedCliVersion;
|
|
449
|
+
}
|
|
450
|
+
export function buildHttpApp(deps) {
|
|
451
|
+
const app = new Hono();
|
|
452
|
+
// Task 702 — the dir holding pid files and rc-spawn scope records.
|
|
453
|
+
const sessionsDir = join(deps.claudeConfigDir, 'sessions');
|
|
454
|
+
// Task 189 — process-local fan-out from `url-capture` to every connected
|
|
455
|
+
// `/events` client. The pty-spawner mutates `StoredSession.url` in place
|
|
456
|
+
// when the `/remote-control is active · <url>` banner lands; this
|
|
457
|
+
// broadcaster relays the sessionId so each /events handler can push a
|
|
458
|
+
// `row-updated` frame carrying the new URL. The set is mutated by the
|
|
459
|
+
// /events handler on connect/disconnect; the spawner deps below pass
|
|
460
|
+
// `notifyUrlCaptured` into both spawn call sites.
|
|
461
|
+
const urlUpdateListeners = new Set();
|
|
462
|
+
function notifyUrlCaptured(sessionId) {
|
|
463
|
+
for (const listener of urlUpdateListeners)
|
|
464
|
+
listener(sessionId);
|
|
465
|
+
}
|
|
466
|
+
app.__notifyUrlCapturedForTests = notifyUrlCaptured;
|
|
467
|
+
// Task 253 — same fan-out shape for rename. The POST /:sessionId/rename
|
|
468
|
+
// route writes the user-title store and then calls notifyRename; each
|
|
469
|
+
// /events handler then re-emits a `row-updated` frame so every browser
|
|
470
|
+
// tab sees the new label without re-fetching the sidebar route.
|
|
471
|
+
const renameListeners = new Set();
|
|
472
|
+
function notifyRename(sessionId) {
|
|
473
|
+
for (const listener of renameListeners)
|
|
474
|
+
listener(sessionId);
|
|
475
|
+
}
|
|
476
|
+
app.__notifyRenameForTests = notifyRename;
|
|
477
|
+
// Task 550 — bridge ULID → JSONL UUID persistence. The fs-watcher reads
|
|
478
|
+
// each `<sessionsDir>/<pid>.json` and exposes the composer's
|
|
479
|
+
// `bridgeSessionId` on the row. On every pid-source create/modify event
|
|
480
|
+
// where the row carries a non-null bridge suffix, append that suffix to
|
|
481
|
+
// the matching `<projectsDir>/<sessionId>.meta.json` sidecar so a future
|
|
482
|
+
// composer-URL lookup resolves to this row even after the PID file is
|
|
483
|
+
// unlinked at PTY exit. Append-only with duplicate suppression in
|
|
484
|
+
// `appendBridgeId`; legacy rows without a sidecar log `no-sidecar` and
|
|
485
|
+
// skip per the task brief (out of scope for back-fill).
|
|
486
|
+
deps.watcher.subscribe((event) => {
|
|
487
|
+
if (event.source !== 'pid')
|
|
488
|
+
return;
|
|
489
|
+
if (event.kind !== 'create' && event.kind !== 'modify')
|
|
490
|
+
return;
|
|
491
|
+
if (!event.row)
|
|
492
|
+
return;
|
|
493
|
+
const suffix = event.row.bridgeSuffix;
|
|
494
|
+
if (!suffix)
|
|
495
|
+
return;
|
|
496
|
+
const sidecarPath = sidecarPathForSessionId(deps.spawnCwd, event.sessionId);
|
|
497
|
+
const outcome = appendBridgeId(sidecarPath, suffix, deps.logger);
|
|
498
|
+
if (outcome === 'ok') {
|
|
499
|
+
deps.logger(`[sessions-bridge-bind] sessionId=${event.sessionId} bridgeId=${suffix}`);
|
|
500
|
+
deps.watcher.refreshSidecar?.(event.sessionId);
|
|
501
|
+
}
|
|
502
|
+
else if (outcome === 'no-sidecar') {
|
|
503
|
+
deps.logger(`[sessions-bridge-bind] sessionId=${event.sessionId} bridgeId=${suffix} outcome=no-sidecar`);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
// Watcher subscriber: when the JSONL CREATE event fires for a live
|
|
507
|
+
// session, attach the public-audit watcher. The watcher row carries
|
|
508
|
+
// the role from the sidecar (Task 260 — disk is the source of truth),
|
|
509
|
+
// so the audit attachment fires deterministically against rows whose
|
|
510
|
+
// PTY is still alive in this manager process.
|
|
511
|
+
deps.watcher.subscribe((event) => {
|
|
512
|
+
if (event.source !== 'jsonl')
|
|
513
|
+
return;
|
|
514
|
+
if (event.kind !== 'create' && event.kind !== 'modify')
|
|
515
|
+
return;
|
|
516
|
+
if (!event.row)
|
|
517
|
+
return;
|
|
518
|
+
if (!isLive(event.sessionId))
|
|
519
|
+
return;
|
|
520
|
+
attachPublicAudit(deps, event.sessionId, event.row.role);
|
|
521
|
+
attachPublicExitNotify(event.sessionId, event.row.role, deps.logger);
|
|
522
|
+
});
|
|
523
|
+
// Task 183 — dispatch jsonl modify/create events into the recorder
|
|
524
|
+
// tail. The tail filters by registered sessionId (only specialist
|
|
525
|
+
// database-operator spawns are registered), so operator turns pass
|
|
526
|
+
// through without producing recorder-* lines. The tail's append-only
|
|
527
|
+
// cursor ensures repeated modify events for the same JSONL only read
|
|
528
|
+
// newly-appended bytes. Path is derived from sessionId + spawnCwd
|
|
529
|
+
// (Task 258).
|
|
530
|
+
if (deps.jsonlTail) {
|
|
531
|
+
const tail = deps.jsonlTail;
|
|
532
|
+
deps.watcher.subscribe((event) => {
|
|
533
|
+
if (event.source !== 'jsonl')
|
|
534
|
+
return;
|
|
535
|
+
if (event.kind !== 'create' && event.kind !== 'modify')
|
|
536
|
+
return;
|
|
537
|
+
const path = jsonlPathForSessionId(deps.spawnCwd, event.sessionId);
|
|
538
|
+
if (!existsSync(path))
|
|
539
|
+
return;
|
|
540
|
+
tail.onJsonlModify(event.sessionId, path);
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
// Task 278 — derive `effectivePermissionMode` from the per-session
|
|
544
|
+
// auto-mode debug capture and persist it on the sidecar. We piggyback
|
|
545
|
+
// on the JSONL CREATE/MODIFY events because the binary writes the
|
|
546
|
+
// `[auto-mode] verifyAutoModeGateAccess` line at startup (before the
|
|
547
|
+
// first JSONL flush) and on every shift-tab transition (which also
|
|
548
|
+
// writes a `permission-mode` JSONL record). Each event re-reads the
|
|
549
|
+
// small debug file and updates the sidecar only when the derived
|
|
550
|
+
// value differs from the persisted one. Non-auto requested spawns
|
|
551
|
+
// skip the file read entirely — pty-spawner does not capture a debug
|
|
552
|
+
// log for those.
|
|
553
|
+
if (deps.permissionModeTail) {
|
|
554
|
+
const tail = deps.permissionModeTail;
|
|
555
|
+
deps.watcher.subscribe((event) => {
|
|
556
|
+
if (event.source !== 'jsonl')
|
|
557
|
+
return;
|
|
558
|
+
if (event.kind !== 'create' && event.kind !== 'modify')
|
|
559
|
+
return;
|
|
560
|
+
if (!event.row)
|
|
561
|
+
return;
|
|
562
|
+
if (event.row.permissionMode !== 'auto')
|
|
563
|
+
return;
|
|
564
|
+
const logPath = permissionModeLogPathForSessionId(deps.spawnCwd, event.sessionId);
|
|
565
|
+
const derived = tail.deriveFromFile(event.sessionId, logPath, event.row.permissionMode);
|
|
566
|
+
if (derived === null)
|
|
567
|
+
return;
|
|
568
|
+
if (derived === event.row.effectivePermissionMode)
|
|
569
|
+
return;
|
|
570
|
+
const sidecarPath = sidecarPathForSessionId(deps.spawnCwd, event.sessionId);
|
|
571
|
+
const wrote = updateSidecar(sidecarPath, { effectivePermissionMode: derived }, deps.logger);
|
|
572
|
+
if (wrote) {
|
|
573
|
+
deps.watcher.refreshSidecar?.(event.sessionId);
|
|
574
|
+
if (derived !== event.row.permissionMode) {
|
|
575
|
+
deps.logger(`[permission-mode-tail] downgrade-detected sessionId=${event.sessionId.slice(0, 8)} requested=${event.row.permissionMode} effective=${derived}`);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
/** Task 260 — /spawn and /rc-spawn need to return a wire payload
|
|
581
|
+
* immediately, but at that moment the watcher row may not yet
|
|
582
|
+
* include the sidecar fields (the JSONL CREATE event hasn't fired
|
|
583
|
+
* in fresh-spawn tests with synthetic watchers). Build the payload
|
|
584
|
+
* from the row if present, falling back to a synthetic shape that
|
|
585
|
+
* reads the sidecar directly. */
|
|
586
|
+
function buildSpawnReturnPayload(sessionId, pid, startedAt, capturedUrl) {
|
|
587
|
+
const row = deps.watcher.getBySessionId(sessionId);
|
|
588
|
+
if (row && row.senderId !== null) {
|
|
589
|
+
return toPayload(row);
|
|
590
|
+
}
|
|
591
|
+
// Read the sidecar directly — the spawn just wrote it.
|
|
592
|
+
const sidecarPath = sidecarPathForSessionId(deps.spawnCwd, sessionId);
|
|
593
|
+
const { sidecar } = readSidecar(sidecarPath, deps.logger);
|
|
594
|
+
const jsonlPath = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
595
|
+
const hasJsonl = existsSync(jsonlPath);
|
|
596
|
+
return {
|
|
597
|
+
sessionId,
|
|
598
|
+
pid,
|
|
599
|
+
url: capturedUrl ?? sidecar?.url ?? null,
|
|
600
|
+
startedAt: sidecar?.startedAt ?? startedAt,
|
|
601
|
+
senderId: sidecar?.senderId ?? '',
|
|
602
|
+
role: sidecar?.role ?? null,
|
|
603
|
+
channel: sidecar?.channel ?? null,
|
|
604
|
+
jsonlPath: hasJsonl ? jsonlPath : null,
|
|
605
|
+
status: 'alive',
|
|
606
|
+
archived: false,
|
|
607
|
+
displayName: null,
|
|
608
|
+
titleSource: null,
|
|
609
|
+
lastMessageAt: null,
|
|
610
|
+
turnCount: 0,
|
|
611
|
+
capped: false,
|
|
612
|
+
sizeBytes: hasJsonl ? statSync(jsonlPath).size : null,
|
|
613
|
+
hidden: sidecar?.hidden ?? false,
|
|
614
|
+
specialist: sidecar?.specialist ?? null,
|
|
615
|
+
model: null,
|
|
616
|
+
permissionMode: sidecar?.permissionMode ?? null,
|
|
617
|
+
effectivePermissionMode: sidecar?.effectivePermissionMode ?? null,
|
|
618
|
+
// Pre-index spawn return: no watcher row yet (or a senderId-less one).
|
|
619
|
+
// 'idle' mirrors the fs-watcher's default for a pidfile without a
|
|
620
|
+
// busy stamp; the row's real status takes over on the next read.
|
|
621
|
+
activity: row?.status ?? 'idle',
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
/** Task 260 — single payload builder. Both live and archived rows
|
|
625
|
+
* derive every wire field from the watcher row (which itself derived
|
|
626
|
+
* from the sidecar + JSONL + PID file). The split between
|
|
627
|
+
* `toLivePayload`/`toArchivedPayload` is gone; the row's `state`
|
|
628
|
+
* and `pid` decide `status` and the `archived` flag.
|
|
629
|
+
*
|
|
630
|
+
* The `model` field continues to derive from the JSONL tail (last
|
|
631
|
+
* assistant turn) rather than the sidecar's spawn-request model —
|
|
632
|
+
* see [[learnings_writer_reader_charset_drift]] family: the running
|
|
633
|
+
* model is what the wire's `model` has historically meant, and the
|
|
634
|
+
* sidecar's `model` is kept as a self-diagnostic record. */
|
|
635
|
+
function toPayload(row) {
|
|
636
|
+
const isLiveState = row.state === 'live';
|
|
637
|
+
const archivedJsonlPath = jsonlPathForSessionId(deps.spawnCwd, row.sessionId, { archived: true });
|
|
638
|
+
const topJsonlPath = jsonlPathForSessionId(deps.spawnCwd, row.sessionId);
|
|
639
|
+
const jsonlPath = isLiveState
|
|
640
|
+
? topJsonlPath
|
|
641
|
+
: existsSync(archivedJsonlPath) ? archivedJsonlPath : topJsonlPath;
|
|
642
|
+
const hasJsonl = existsSync(jsonlPath);
|
|
643
|
+
let displayName = null;
|
|
644
|
+
let titleSource = null;
|
|
645
|
+
let lastMessageAt = null;
|
|
646
|
+
let turnCount = 0;
|
|
647
|
+
let capped = false;
|
|
648
|
+
let sizeBytes = hasJsonl ? statSync(jsonlPath).size : null;
|
|
649
|
+
let model = null;
|
|
650
|
+
let enrichedStartedAt = null;
|
|
651
|
+
if (hasJsonl) {
|
|
652
|
+
const enriched = readJsonlSession(deps.spawnCwd, row.sessionId, LIST_TAIL_BYTES, deps.logger, deps.userTitleStore);
|
|
653
|
+
if (enriched) {
|
|
654
|
+
displayName = enriched.displayName;
|
|
655
|
+
titleSource = enriched.titleSource;
|
|
656
|
+
lastMessageAt = enriched.lastMessageAt;
|
|
657
|
+
turnCount = enriched.turnCount;
|
|
658
|
+
capped = enriched.capped;
|
|
659
|
+
sizeBytes = enriched.sizeBytes;
|
|
660
|
+
enrichedStartedAt = enriched.startedAt;
|
|
661
|
+
model = enriched.model;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
const userTitle = deps.userTitleStore.get(row.sessionId)?.title;
|
|
666
|
+
if (userTitle) {
|
|
667
|
+
displayName = userTitle;
|
|
668
|
+
titleSource = 'user';
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
// Task 624 — standing reconciliation. A LIVE role=public row whose title did
|
|
672
|
+
// not resolve from the user-override tier means the /spawn userTitleStore.set
|
|
673
|
+
// silently failed or was evicted. Fires on the next list read while the
|
|
674
|
+
// session is live, so a missing write is caught without a live repro. Gated
|
|
675
|
+
// to live rows so pre-Task-624 public sessions (no title, forward-only — the
|
|
676
|
+
// designed pre-migration state, not a defect) never emit this signal.
|
|
677
|
+
if (isLiveState && row.role === 'public' && titleSource !== 'user') {
|
|
678
|
+
deps.logger(`[public-title] sessionId=${row.sessionId.slice(0, 8)} unexpected titleSource=${titleSource ?? 'null'}`);
|
|
679
|
+
}
|
|
680
|
+
// startedAt resolution order:
|
|
681
|
+
// 1. JSONL enrichment (the most authoritative — claude's own record)
|
|
682
|
+
// 2. Sidecar (/spawn time)
|
|
683
|
+
// 3. Row mtime fallback (legacy archived rows without sidecar)
|
|
684
|
+
const startedAt = enrichedStartedAt
|
|
685
|
+
?? row.startedAt
|
|
686
|
+
?? new Date(row.updatedAt || 0).toISOString();
|
|
687
|
+
// Agent label: PID-file `agent` for live rows; cachedAgentSetting for
|
|
688
|
+
// archived rows (JSONL head). Sidecar's `sidecarSpecialist` is the
|
|
689
|
+
// spawn-time request — fall back to it when both above are null so
|
|
690
|
+
// post-Task-260 rows surface their specialist even if the JSONL
|
|
691
|
+
// doesn't include an agent-setting record.
|
|
692
|
+
const specialist = row.agent ?? row.cachedAgentSetting ?? row.sidecarSpecialist;
|
|
693
|
+
return {
|
|
694
|
+
sessionId: row.sessionId,
|
|
695
|
+
pid: row.pid,
|
|
696
|
+
url: row.url,
|
|
697
|
+
startedAt,
|
|
698
|
+
senderId: row.senderId ?? '',
|
|
699
|
+
role: row.role,
|
|
700
|
+
channel: row.channel,
|
|
701
|
+
jsonlPath: hasJsonl ? jsonlPath : null,
|
|
702
|
+
status: isLiveState ? 'alive' : 'ended',
|
|
703
|
+
archived: row.state === 'archived',
|
|
704
|
+
displayName,
|
|
705
|
+
titleSource,
|
|
706
|
+
lastMessageAt,
|
|
707
|
+
turnCount,
|
|
708
|
+
capped,
|
|
709
|
+
sizeBytes,
|
|
710
|
+
hidden: row.hidden,
|
|
711
|
+
specialist,
|
|
712
|
+
model,
|
|
713
|
+
permissionMode: row.permissionMode,
|
|
714
|
+
effectivePermissionMode: row.effectivePermissionMode,
|
|
715
|
+
activity: row.status,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
app.post('/public-spawn', async (c) => {
|
|
719
|
+
const start = Date.now();
|
|
720
|
+
let body;
|
|
721
|
+
try {
|
|
722
|
+
body = await c.req.json();
|
|
723
|
+
}
|
|
724
|
+
catch {
|
|
725
|
+
deps.logger(`spawn-request body-parse-failed`);
|
|
726
|
+
timed(deps.logger, 'POST', '/public-spawn', 400, Date.now() - start);
|
|
727
|
+
return c.json({ error: 'body-not-json' }, 400);
|
|
728
|
+
}
|
|
729
|
+
const senderId = typeof body.senderId === 'string' ? body.senderId : '';
|
|
730
|
+
// Task 205 — admin operator's userId. Optional; falls through as
|
|
731
|
+
// empty to the pty child env. Validated only for shape (non-empty
|
|
732
|
+
// string); the cookie-auth path resolves the value, the
|
|
733
|
+
// silent-compaction / recorder paths legitimately omit it.
|
|
734
|
+
const userId = typeof body.userId === 'string' && body.userId.length > 0 && body.userId.length <= 128
|
|
735
|
+
? body.userId
|
|
736
|
+
: undefined;
|
|
737
|
+
const role = typeof body.role === 'string' ? body.role : '';
|
|
738
|
+
const channel = typeof body.channel === 'string' ? body.channel : '';
|
|
739
|
+
const hidden = body.hidden === true;
|
|
740
|
+
const specialist = typeof body.specialist === 'string' && /^[A-Za-z0-9_-]{1,64}$/.test(body.specialist)
|
|
741
|
+
? body.specialist
|
|
742
|
+
: undefined;
|
|
743
|
+
// Task 956 — public sessions are pinned to Sonnet 4.6 (operator decision:
|
|
744
|
+
// admin-only Bypass/Opus; public stays Sonnet + fail-closed dontAsk). The
|
|
745
|
+
// role==='public' force is the chokepoint covering every public spawn
|
|
746
|
+
// (webchat + WhatsApp); other roles keep their body-supplied model.
|
|
747
|
+
const model = role === 'public'
|
|
748
|
+
? SONNET_MODEL
|
|
749
|
+
: typeof body.model === 'string' && /^[A-Za-z0-9._-]{1,64}$/.test(body.model)
|
|
750
|
+
? body.model
|
|
751
|
+
: undefined;
|
|
752
|
+
const initialMessage = typeof body.initialMessage === 'string' && body.initialMessage.length > 0
|
|
753
|
+
? body.initialMessage
|
|
754
|
+
: undefined;
|
|
755
|
+
// Task 346 — agent slug arrives on every spawn from the bridge.
|
|
756
|
+
// Admin spawns send 'admin'; public spawns send the per-account default
|
|
757
|
+
// (chat.ts) or the per-group/per-account/top-level resolver result
|
|
758
|
+
// (whatsapp). Shape gate matches account.ts's SLUG_PATTERN — keeping
|
|
759
|
+
// it conservative refuses a body-controlled traversal segment from
|
|
760
|
+
// reaching the agents-dir read below.
|
|
761
|
+
const agentSlug = typeof body.agentSlug === 'string' && /^[A-Za-z0-9_-]{1,64}$/.test(body.agentSlug)
|
|
762
|
+
? body.agentSlug
|
|
763
|
+
: undefined;
|
|
764
|
+
// Task 382 — sessionId UUID of the active :AdminConversation (or
|
|
765
|
+
// :PublicConversation). Shape-validated as a v4 UUID; anything else is
|
|
766
|
+
// discarded so a body-controlled value cannot reach the env-stamp.
|
|
767
|
+
const conversationNodeId = typeof body.conversationNodeId === 'string' && UUID_PATTERN.test(body.conversationNodeId)
|
|
768
|
+
? body.conversationNodeId
|
|
769
|
+
: undefined;
|
|
770
|
+
// Task 485 — per-visitor slice ringfence values. sliceToken is shape-gated
|
|
771
|
+
// to UUID v4 (matches the AccessGrant.sliceToken generator); personId is
|
|
772
|
+
// a Neo4j elementId so the length cap is conservative — anything else is
|
|
773
|
+
// discarded so a body-controlled value cannot reach the child env.
|
|
774
|
+
const sliceToken = typeof body.sliceToken === 'string' && UUID_PATTERN.test(body.sliceToken)
|
|
775
|
+
? body.sliceToken
|
|
776
|
+
: undefined;
|
|
777
|
+
const personId = typeof body.personId === 'string' && body.personId.length > 0 && body.personId.length <= 128
|
|
778
|
+
? body.personId
|
|
779
|
+
: undefined;
|
|
780
|
+
// Task 884 — open-mode visitor anchor (the maxy_visitor cookie). Validated
|
|
781
|
+
// as a UUID, the same shape /api/session mints; absent on gated spawns.
|
|
782
|
+
const visitorId = typeof body.visitorId === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(body.visitorId)
|
|
783
|
+
? body.visitorId
|
|
784
|
+
: undefined;
|
|
785
|
+
// Task 756 — the per-conversation webchat native channel for a public
|
|
786
|
+
// spawn. Shape-validated here (all three fields are non-empty strings, the
|
|
787
|
+
// gateway is loopback http) before it reaches the spawn, which composes it
|
|
788
|
+
// under the public ringfence (deny-all + reply-only allow + strict mcp).
|
|
789
|
+
const wc = body.webchatChannel;
|
|
790
|
+
const webchatChannel = wc && typeof wc === 'object'
|
|
791
|
+
&& typeof wc.key === 'string' && wc.key.length > 0
|
|
792
|
+
&& typeof wc.gatewayUrl === 'string' && wc.gatewayUrl.startsWith('http')
|
|
793
|
+
&& typeof wc.serverPath === 'string' && wc.serverPath.startsWith('/')
|
|
794
|
+
? { key: wc.key, gatewayUrl: wc.gatewayUrl, serverPath: wc.serverPath }
|
|
795
|
+
: undefined;
|
|
796
|
+
// Task 939 — gated-visitor read-back block, rendered UI-side. Shape-gated
|
|
797
|
+
// to a non-empty string with a generous ceiling; absent otherwise.
|
|
798
|
+
const previousContext = typeof body.previousContext === 'string' && body.previousContext.length > 0 && body.previousContext.length <= 20000
|
|
799
|
+
? body.previousContext
|
|
800
|
+
: undefined;
|
|
801
|
+
// Task 624 — maxy-composed public-session title. Validated by the same
|
|
802
|
+
// validateUserTitle the /:sessionId/rename route uses; persisted only for
|
|
803
|
+
// role=public after the sessionId is minted. An invalid/absent name leaves
|
|
804
|
+
// the title to fall through to Claude Code's ai-title — surfaced as
|
|
805
|
+
// title=missing on the spawn log line below, never a silent drop.
|
|
806
|
+
const titleResult = validateUserTitle(body.name);
|
|
807
|
+
const publicTitle = titleResult.ok ? titleResult.title : null;
|
|
808
|
+
const aboutOwnerShape = body.aboutOwner == null ? 'absent' : (typeof body.aboutOwner === 'object' ? 'object' : typeof body.aboutOwner);
|
|
809
|
+
const dormantPluginsShape = Array.isArray(body.dormantPlugins)
|
|
810
|
+
? `array(${body.dormantPlugins.length})`
|
|
811
|
+
: body.dormantPlugins == null ? 'absent' : typeof body.dormantPlugins;
|
|
812
|
+
const initialMessageBytes = typeof body.initialMessage === 'string' ? Buffer.byteLength(body.initialMessage, 'utf8') : 0;
|
|
813
|
+
deps.logger(`spawn-request senderId=${senderId || 'missing'} userId=${userId ? userId.slice(0, 8) : 'absent'} role=${role || 'missing'} channel=${channel || 'missing'} permissionMode=${typeof body.permissionMode === 'string' ? body.permissionMode : 'default'} channels=${Array.isArray(body.channels) ? body.channels.length : 0} attachmentDir=${typeof body.attachmentDir === 'string' ? 'set' : 'absent'} aboutOwner=${aboutOwnerShape} dormantPlugins=${dormantPluginsShape} tunnelUrl=${typeof body.tunnelUrl === 'string' ? 'set' : (body.tunnelUrl === null ? 'null' : 'absent')} initialMessageBytes=${initialMessageBytes}`);
|
|
814
|
+
if (!senderId || !ROLES.includes(role) || !CHANNELS.includes(channel)) {
|
|
815
|
+
timed(deps.logger, 'POST', '/public-spawn', 400, Date.now() - start);
|
|
816
|
+
return c.json({ error: 'invalid-arguments', detail: { senderId: !!senderId, role, channel } }, 400);
|
|
817
|
+
}
|
|
818
|
+
if (role === 'public') {
|
|
819
|
+
const decision = deps.publicSpawnLimiter.admit(senderId, channel);
|
|
820
|
+
if (!decision.admitted) {
|
|
821
|
+
deps.logger(`spawn-rate-limited senderId=${senderId} channel=${channel} scope=${decision.scope} window=${decision.windowMs} cap=${decision.cap}`);
|
|
822
|
+
timed(deps.logger, 'POST', '/public-spawn', 429, Date.now() - start);
|
|
823
|
+
return c.json({
|
|
824
|
+
error: 'too-many-spawns',
|
|
825
|
+
detail: { scope: decision.scope, cap: decision.cap, windowMs: decision.windowMs, channel },
|
|
826
|
+
}, 429);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const channels = Array.isArray(body.channels)
|
|
830
|
+
? body.channels.filter((c) => typeof c === 'string' && c.length > 0)
|
|
831
|
+
: undefined;
|
|
832
|
+
const permissionMode = typeof body.permissionMode === 'string' && PERMISSION_MODES.includes(body.permissionMode)
|
|
833
|
+
? body.permissionMode
|
|
834
|
+
: undefined;
|
|
835
|
+
const attachmentDir = typeof body.attachmentDir === 'string' && body.attachmentDir.startsWith('/')
|
|
836
|
+
? body.attachmentDir
|
|
837
|
+
: undefined;
|
|
838
|
+
const aboutOwner = parseAboutOwner(body.aboutOwner);
|
|
839
|
+
const dormantPlugins = parseDormantPlugins(body.dormantPlugins);
|
|
840
|
+
const activePlugins = parseActivePlugins(body.activePlugins);
|
|
841
|
+
const specialistDomains = parseSpecialistDomains(body.specialistDomains);
|
|
842
|
+
const tunnelUrlOverride = typeof body.tunnelUrl === 'string'
|
|
843
|
+
? body.tunnelUrl
|
|
844
|
+
: body.tunnelUrl === null
|
|
845
|
+
? null
|
|
846
|
+
: undefined;
|
|
847
|
+
const result = await spawnClaudeSession({
|
|
848
|
+
...deps,
|
|
849
|
+
watcher: deps.watcher,
|
|
850
|
+
onSessionReady: (tracker) => {
|
|
851
|
+
attachPublicAudit(deps, tracker.sessionId, role);
|
|
852
|
+
attachPublicExitNotify(tracker.sessionId, role, deps.logger);
|
|
853
|
+
attachSpecialistEndTurnAutoArchive(deps, tracker.sessionId, tracker.specialist);
|
|
854
|
+
},
|
|
855
|
+
onUrlCaptured: notifyUrlCaptured,
|
|
856
|
+
tunnelUrlOverride,
|
|
857
|
+
}, {
|
|
858
|
+
senderId,
|
|
859
|
+
userId,
|
|
860
|
+
role: role,
|
|
861
|
+
channel: channel,
|
|
862
|
+
channels,
|
|
863
|
+
permissionMode,
|
|
864
|
+
attachmentDir,
|
|
865
|
+
aboutOwner,
|
|
866
|
+
dormantPlugins,
|
|
867
|
+
activePlugins,
|
|
868
|
+
specialistDomains,
|
|
869
|
+
hidden,
|
|
870
|
+
specialist,
|
|
871
|
+
model,
|
|
872
|
+
initialMessage,
|
|
873
|
+
agentSlug,
|
|
874
|
+
conversationNodeId,
|
|
875
|
+
sliceToken,
|
|
876
|
+
personId,
|
|
877
|
+
visitorId,
|
|
878
|
+
webchatChannel,
|
|
879
|
+
previousContext,
|
|
880
|
+
});
|
|
881
|
+
if (!result.ok) {
|
|
882
|
+
if ('rejected' in result) {
|
|
883
|
+
timed(deps.logger, 'POST', '/public-spawn', 503, Date.now() - start);
|
|
884
|
+
if (result.rejected.kind === 'specialist-cap-reached') {
|
|
885
|
+
return c.json({ error: 'specialist-cap-reached', currentCount: result.rejected.currentCount, cap: result.rejected.cap }, 503);
|
|
886
|
+
}
|
|
887
|
+
if (result.rejected.kind === 'low-memory') {
|
|
888
|
+
return c.json({ error: 'low-memory', memAvailableMb: result.rejected.memAvailableMb, thresholdMb: result.rejected.thresholdMb }, 503);
|
|
889
|
+
}
|
|
890
|
+
return c.json({ error: 'operator-slots-reserved', total: result.rejected.total, reserve: result.rejected.reserve, totalCap: result.rejected.totalCap }, 503);
|
|
891
|
+
}
|
|
892
|
+
timed(deps.logger, 'POST', '/public-spawn', 500, Date.now() - start);
|
|
893
|
+
// Task 576 — surface the auth-refresh-failed reason when the
|
|
894
|
+
// creds file says `dead` or `expired`. Without this the operator
|
|
895
|
+
// sees a generic `pid-file-timeout` for what is actually an
|
|
896
|
+
// OAuth-token failure and cannot recover via "Reconnect Claude".
|
|
897
|
+
const authSnap = snapshotAuthForFailureReason(credentialsPathForConfigDir(deps.claudeConfigDir));
|
|
898
|
+
const reason = authSnap === 'dead' || authSnap === 'expired' ? 'auth-refresh-failed' : result.reason;
|
|
899
|
+
if (reason === 'auth-refresh-failed') {
|
|
900
|
+
deps.logger(`[spawn-failed] reason=auth-refresh-failed authStatus=${authSnap} originalReason=${result.reason}`);
|
|
901
|
+
}
|
|
902
|
+
return c.json({ error: 'spawn-failed', reason, stderrTail: result.stderrTail, authStatus: authSnap }, 500);
|
|
903
|
+
}
|
|
904
|
+
timed(deps.logger, 'POST', '/public-spawn', 200, Date.now() - start);
|
|
905
|
+
// Task 624 — persist the maxy title into the user-override tier so it wins
|
|
906
|
+
// over Claude Code's ai-title in both the manager list and the UI sidebar
|
|
907
|
+
// (sidebar-sessions.ts reads the same session-titles.json). role=public only;
|
|
908
|
+
// admin/whatsapp titling is unchanged. The spawn line always carries a title
|
|
909
|
+
// field so a dropped name is visible without reproducing.
|
|
910
|
+
if (role === 'public') {
|
|
911
|
+
if (publicTitle) {
|
|
912
|
+
deps.userTitleStore.set(result.session.sessionId, publicTitle);
|
|
913
|
+
deps.logger(`[spawn] role=public senderId=${senderId} sessionId=${result.session.sessionId.slice(0, 8)} title="${publicTitle}"`);
|
|
914
|
+
}
|
|
915
|
+
else {
|
|
916
|
+
deps.logger(`[spawn] role=public senderId=${senderId} sessionId=${result.session.sessionId.slice(0, 8)} title=missing`);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
const payload = buildSpawnReturnPayload(result.session.sessionId, result.session.pid, result.session.startedAt, result.session.url);
|
|
920
|
+
return c.json(payload, 200);
|
|
921
|
+
});
|
|
922
|
+
// SSE feed of row deltas. One channel per client; manager fans out from
|
|
923
|
+
// a single watcher subscription. On connect: replay current rows as
|
|
924
|
+
// `row-created`, then stream subsequent watcher events as
|
|
925
|
+
// `row-<created|updated|archived|removed>`.
|
|
926
|
+
//
|
|
927
|
+
// Payload shape per event (`data: <json>`):
|
|
928
|
+
// { sessionId, live, status, agentLabel, cwd, firstPrompt, titleSource,
|
|
929
|
+
// updatedAt, url, archived }
|
|
930
|
+
// Task 141: `sessionId` carries whichever phase is current (bridge
|
|
931
|
+
// suffix preferred, JSONL basename fallback) — same single-id contract
|
|
932
|
+
// as `/meta`.
|
|
933
|
+
//
|
|
934
|
+
// `live` mirrors the watcher's `state === 'live'`. `status` is the
|
|
935
|
+
// watcher's `idle | busy | gone`. `agentLabel` is the resolution
|
|
936
|
+
// `agent ?? cachedAgentSetting`; the UI maps null → "admin",
|
|
937
|
+
// non-null → the specialist name. `firstPrompt` is the resolved
|
|
938
|
+
// displayName (tail.aiTitle verbatim, else null — Task 146) so the row
|
|
939
|
+
// title is computed once on the server, not by every browser tab.
|
|
940
|
+
// Task 189: `url` is `StoredSession.url` for a live row in the in-memory
|
|
941
|
+
// store, or null otherwise. Stays null forever on headless spawns (they
|
|
942
|
+
// never get `--remote-control`) and on archived rows (the StoredSession
|
|
943
|
+
// is removed on PTY exit). The client uses null to hide the
|
|
944
|
+
// Open-in-new-tab arrow; the SSE re-emit below pushes a fresh frame
|
|
945
|
+
// when url-capture lands so the arrow appears in step.
|
|
946
|
+
app.get('/events', (c) => {
|
|
947
|
+
const start = Date.now();
|
|
948
|
+
const clientIp = c.req.header('x-forwarded-for') ?? 'loopback';
|
|
949
|
+
const replayRows = deps.watcher.all();
|
|
950
|
+
deps.logger(`[admin-events] client-connected ip=${clientIp} seeded-rows=${replayRows.length}`);
|
|
951
|
+
function rowToPayload(row) {
|
|
952
|
+
const agentLabel = row.agent ?? row.cachedAgentSetting ?? null;
|
|
953
|
+
let firstPrompt = null;
|
|
954
|
+
let titleSource = null;
|
|
955
|
+
const jsonlPath = jsonlPathForSessionId(deps.spawnCwd, row.sessionId);
|
|
956
|
+
if (existsSync(jsonlPath)) {
|
|
957
|
+
const enriched = readJsonlSession(deps.spawnCwd, row.sessionId, LIST_TAIL_BYTES, deps.logger, deps.userTitleStore);
|
|
958
|
+
if (enriched) {
|
|
959
|
+
firstPrompt = enriched.displayName;
|
|
960
|
+
titleSource = enriched.titleSource;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
else {
|
|
964
|
+
// Pre-jsonl / post-purge: only the user-title store can answer.
|
|
965
|
+
const userTitle = deps.userTitleStore.get(row.sessionId)?.title;
|
|
966
|
+
if (userTitle) {
|
|
967
|
+
firstPrompt = userTitle;
|
|
968
|
+
titleSource = 'user';
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
return {
|
|
972
|
+
sessionId: row.sessionId,
|
|
973
|
+
live: row.state === 'live',
|
|
974
|
+
status: row.status,
|
|
975
|
+
agentLabel,
|
|
976
|
+
cwd: row.cwd,
|
|
977
|
+
firstPrompt,
|
|
978
|
+
titleSource,
|
|
979
|
+
updatedAt: row.updatedAt,
|
|
980
|
+
// Task 260 — url is on the row from the sidecar; url-capture
|
|
981
|
+
// mutates the sidecar in place and the watcher re-reads on the
|
|
982
|
+
// next event. Earlier this dipped into deps.store for the live-
|
|
983
|
+
// row case and returned null for everything else.
|
|
984
|
+
url: row.url,
|
|
985
|
+
// Task 260 — archive state is on the row directly (the watcher
|
|
986
|
+
// enumerates both top and archive subdirs and folds a top→archive
|
|
987
|
+
// move into a single state change). Earlier this was an extra
|
|
988
|
+
// existsSync against the archive path because archived rows
|
|
989
|
+
// weren't first-class members of the index.
|
|
990
|
+
archived: row.state === 'archived',
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
timed(deps.logger, 'GET', '/events', 200, Date.now() - start);
|
|
994
|
+
return stream(c, async (out) => {
|
|
995
|
+
// SSE response headers — Hono's stream() helper sets text/event-stream
|
|
996
|
+
// automatically, but we explicitly disable proxy buffering so the
|
|
997
|
+
// first replay batch arrives before any keep-alive.
|
|
998
|
+
c.header('Content-Type', 'text/event-stream');
|
|
999
|
+
c.header('Cache-Control', 'no-cache, no-transform');
|
|
1000
|
+
c.header('X-Accel-Buffering', 'no');
|
|
1001
|
+
c.header('Connection', 'keep-alive');
|
|
1002
|
+
const connectStart = Date.now();
|
|
1003
|
+
let active = true;
|
|
1004
|
+
let subscribersCount = 0;
|
|
1005
|
+
// Task 272 — paired dedup for the live→archived demote sequence.
|
|
1006
|
+
// The watcher fires `delete pid` immediately followed by `modify jsonl`
|
|
1007
|
+
// for the same sessionId; the pid-delete branch emits row-archived and
|
|
1008
|
+
// we must swallow the trailing modify so the client sees one
|
|
1009
|
+
// transition. Pre-Task-272 the dedup matched on row state instead, so
|
|
1010
|
+
// every modify-jsonl on a non-live row was dropped — including
|
|
1011
|
+
// archive↔top renames on stash composites and sidecar refreshes on
|
|
1012
|
+
// ended rows. Window is comfortably wider than the watcher's per-path
|
|
1013
|
+
// debounce (~30 ms in production) so back-to-back events on the same
|
|
1014
|
+
// sessionId pair correctly without dropping unrelated mutations
|
|
1015
|
+
// arriving later in the connection.
|
|
1016
|
+
const pendingDedupAt = new Map();
|
|
1017
|
+
const DEDUP_WINDOW_MS = 100;
|
|
1018
|
+
// Replay phase. Emit a `row-created` for every row in the index so
|
|
1019
|
+
// a freshly-connected tab catches up to the manager's view before
|
|
1020
|
+
// any subsequent delta arrives.
|
|
1021
|
+
for (const row of replayRows) {
|
|
1022
|
+
if (!active)
|
|
1023
|
+
break;
|
|
1024
|
+
const payload = rowToPayload(row);
|
|
1025
|
+
await out.write(`event: row-created\ndata: ${JSON.stringify(payload)}\n\n`);
|
|
1026
|
+
}
|
|
1027
|
+
// Delta phase. Subscribe to the watcher and map watcher events to
|
|
1028
|
+
// the four SSE event kinds. Mapping:
|
|
1029
|
+
// create → row-created
|
|
1030
|
+
// modify → row-updated (state may have flipped — see archive)
|
|
1031
|
+
// delete → three real cases:
|
|
1032
|
+
// pid + row present → row-archived (PID gone, JSONL survives)
|
|
1033
|
+
// pid + row null → row-removed (PID gone, no JSONL ever existed)
|
|
1034
|
+
// jsonl + row null → row-removed (JSONL deleted, row unindexed)
|
|
1035
|
+
const unsubscribe = deps.watcher.subscribe((event) => {
|
|
1036
|
+
if (!active)
|
|
1037
|
+
return;
|
|
1038
|
+
// The watcher emits a synthetic `kind=modify source=jsonl` pair
|
|
1039
|
+
// immediately after `kind=delete source=pid` when a row demotes
|
|
1040
|
+
// from live → archived. Treat that pair as one `row-archived`
|
|
1041
|
+
// event so the UI sees a single transition rather than a delete
|
|
1042
|
+
// followed by an unrelated update.
|
|
1043
|
+
if (event.kind === 'delete' && event.source === 'pid' && event.row) {
|
|
1044
|
+
const payload = rowToPayload(event.row);
|
|
1045
|
+
subscribersCount += 1;
|
|
1046
|
+
// Task 272 — arm the paired dedup BEFORE the synchronous emit so
|
|
1047
|
+
// the trailing modify-jsonl on the same sessionId (delivered by
|
|
1048
|
+
// the same subscriber callback, off the same debounce flush) hits
|
|
1049
|
+
// an entry that has not yet expired.
|
|
1050
|
+
pendingDedupAt.set(event.sessionId, Date.now());
|
|
1051
|
+
deps.logger(`[admin-events] emit event=row-archived sessionId=${event.sessionId} subscribers=1`);
|
|
1052
|
+
void out.write(`event: row-archived\ndata: ${JSON.stringify(payload)}\n\n`);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
// Recorder case: PID file disappeared before any JSONL was ever
|
|
1056
|
+
// written. Row is unindexed at the manager. Without this branch
|
|
1057
|
+
// the row falls through `if (!event.row) return` below and the
|
|
1058
|
+
// client sidebar keeps showing a session that no longer exists.
|
|
1059
|
+
if (event.kind === 'delete' && event.source === 'pid' && !event.row) {
|
|
1060
|
+
subscribersCount += 1;
|
|
1061
|
+
deps.logger(`[admin-events] emit event=row-removed sessionId=${event.sessionId} subscribers=1`);
|
|
1062
|
+
void out.write(`event: row-removed\ndata: ${JSON.stringify({ sessionId: event.sessionId })}\n\n`);
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
if (event.kind === 'delete' && event.source === 'jsonl' && !event.row) {
|
|
1066
|
+
subscribersCount += 1;
|
|
1067
|
+
deps.logger(`[admin-events] emit event=row-removed sessionId=${event.sessionId} subscribers=1`);
|
|
1068
|
+
void out.write(`event: row-removed\ndata: ${JSON.stringify({ sessionId: event.sessionId })}\n\n`);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
// Task 272 — paired dedup for the live→archived demote sequence.
|
|
1072
|
+
// Only swallow the modify-jsonl that immediately follows a
|
|
1073
|
+
// delete-pid for the SAME sessionId, within the debounce window.
|
|
1074
|
+
// The pre-Task-272 predicate (row no longer live AND pidFilePath
|
|
1075
|
+
// null) was too broad: it caught archive↔top renames on stash
|
|
1076
|
+
// composites and sidecar refreshes on ended rows, leaving the
|
|
1077
|
+
// sidebar stuck on the pre-rename state.
|
|
1078
|
+
if (event.kind === 'modify' && event.source === 'jsonl' && event.row) {
|
|
1079
|
+
const dedupTs = pendingDedupAt.get(event.sessionId);
|
|
1080
|
+
if (dedupTs !== undefined && Date.now() - dedupTs <= DEDUP_WINDOW_MS) {
|
|
1081
|
+
pendingDedupAt.delete(event.sessionId);
|
|
1082
|
+
deps.logger(`[admin-events] dedup-paired sessionId=${event.sessionId} reason=pid-delete-coalesce`);
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
// Drop any stale pending entry so it cannot dedup an unrelated
|
|
1086
|
+
// future modify on the same sessionId.
|
|
1087
|
+
if (dedupTs !== undefined)
|
|
1088
|
+
pendingDedupAt.delete(event.sessionId);
|
|
1089
|
+
}
|
|
1090
|
+
if (!event.row)
|
|
1091
|
+
return;
|
|
1092
|
+
const sseEvent = event.kind === 'create' ? 'row-created' : 'row-updated';
|
|
1093
|
+
const payload = rowToPayload(event.row);
|
|
1094
|
+
subscribersCount += 1;
|
|
1095
|
+
// Task 272 — the previously-swallowed case (state !== 'live' AND
|
|
1096
|
+
// pidFilePath === null with no paired pid-delete in the window)
|
|
1097
|
+
// now emits. Tag it with reason=jsonl-modify-non-live so the
|
|
1098
|
+
// regression is visible in a single grep against server logs.
|
|
1099
|
+
const previouslySwallowed = event.kind === 'modify'
|
|
1100
|
+
&& event.source === 'jsonl'
|
|
1101
|
+
&& event.row.state !== 'live'
|
|
1102
|
+
&& event.row.pidFilePath === null;
|
|
1103
|
+
const reasonSuffix = previouslySwallowed ? ' reason=jsonl-modify-non-live' : '';
|
|
1104
|
+
deps.logger(`[admin-events] emit event=${sseEvent} sessionId=${event.sessionId} subscribers=1${reasonSuffix}`);
|
|
1105
|
+
void out.write(`event: ${sseEvent}\ndata: ${JSON.stringify(payload)}\n\n`);
|
|
1106
|
+
});
|
|
1107
|
+
// Task 189 / 260 — when `url-capture` fires for a session, the
|
|
1108
|
+
// pty-spawner calls `notifyUrlCaptured(sessionId)` after writing
|
|
1109
|
+
// the URL to the sidecar. Re-emit the row so the client's hidden
|
|
1110
|
+
// Open-in-new-tab arrow appears in step. The row lookup goes
|
|
1111
|
+
// through the watcher (canonical row index); rowToPayload then
|
|
1112
|
+
// reads `url` from the row (which the watcher just refreshed
|
|
1113
|
+
// from the sidecar).
|
|
1114
|
+
const urlListener = (sessionId) => {
|
|
1115
|
+
if (!active)
|
|
1116
|
+
return;
|
|
1117
|
+
const row = deps.watcher.getBySessionId(sessionId);
|
|
1118
|
+
if (!row)
|
|
1119
|
+
return;
|
|
1120
|
+
const payload = rowToPayload(row);
|
|
1121
|
+
subscribersCount += 1;
|
|
1122
|
+
deps.logger(`[admin-events] emit event=row-updated sessionId=${sessionId} subscribers=1`);
|
|
1123
|
+
void out.write(`event: row-updated\ndata: ${JSON.stringify(payload)}\n\n`);
|
|
1124
|
+
};
|
|
1125
|
+
urlUpdateListeners.add(urlListener);
|
|
1126
|
+
// Task 253 — rename re-emit. The POST /:sessionId/rename handler
|
|
1127
|
+
// mutates the user-title store and then calls notifyRename(); each
|
|
1128
|
+
// /events handler re-emits the row so every browser tab sees the new
|
|
1129
|
+
// label without re-fetching the sidebar route. The row lookup goes through the
|
|
1130
|
+
// watcher (canonical row index); rowToPayload then re-reads the user
|
|
1131
|
+
// title from `deps.userTitleStore`, picking up the freshly-set value.
|
|
1132
|
+
const renameListener = (sessionId) => {
|
|
1133
|
+
if (!active)
|
|
1134
|
+
return;
|
|
1135
|
+
const row = deps.watcher.getBySessionId(sessionId);
|
|
1136
|
+
if (!row)
|
|
1137
|
+
return;
|
|
1138
|
+
const payload = rowToPayload(row);
|
|
1139
|
+
subscribersCount += 1;
|
|
1140
|
+
deps.logger(`[admin-events] emit event=row-updated sessionId=${sessionId} reason=rename subscribers=1`);
|
|
1141
|
+
void out.write(`event: row-updated\ndata: ${JSON.stringify(payload)}\n\n`);
|
|
1142
|
+
};
|
|
1143
|
+
renameListeners.add(renameListener);
|
|
1144
|
+
// Keep-alive comment every 25 s. Proxies aggressively close idle
|
|
1145
|
+
// text/event-stream connections at 30–60 s; a comment line is
|
|
1146
|
+
// ignored by EventSource consumers but resets the proxy clock.
|
|
1147
|
+
const keepAlive = setInterval(() => {
|
|
1148
|
+
if (!active)
|
|
1149
|
+
return;
|
|
1150
|
+
void out.write(`: keep-alive ${Date.now()}\n\n`);
|
|
1151
|
+
}, 25_000);
|
|
1152
|
+
out.onAbort(() => {
|
|
1153
|
+
active = false;
|
|
1154
|
+
clearInterval(keepAlive);
|
|
1155
|
+
unsubscribe();
|
|
1156
|
+
urlUpdateListeners.delete(urlListener);
|
|
1157
|
+
renameListeners.delete(renameListener);
|
|
1158
|
+
const durationMs = Date.now() - connectStart;
|
|
1159
|
+
deps.logger(`[admin-events] client-disconnected ip=${clientIp} duration-ms=${durationMs} emits=${subscribersCount}`);
|
|
1160
|
+
});
|
|
1161
|
+
// Park the stream open until the client aborts. Without this the
|
|
1162
|
+
// handler returns and Hono closes the response.
|
|
1163
|
+
while (active) {
|
|
1164
|
+
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
});
|
|
1168
|
+
app.get('/:sessionId/meta', (c) => {
|
|
1169
|
+
const start = Date.now();
|
|
1170
|
+
const id = c.req.param('sessionId');
|
|
1171
|
+
if (!SESSION_ID_PATTERN.test(id)) {
|
|
1172
|
+
timed(deps.logger, 'GET', `/${id}/meta`, 400, Date.now() - start);
|
|
1173
|
+
return c.json({ error: 'invalid-session-id' }, 400);
|
|
1174
|
+
}
|
|
1175
|
+
const row = resolveRow(deps.watcher, id);
|
|
1176
|
+
if (!row) {
|
|
1177
|
+
timed(deps.logger, 'GET', `/${id}/meta`, 404, Date.now() - start);
|
|
1178
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1179
|
+
}
|
|
1180
|
+
// Task 260 — single row source. /meta uses the deeper enumerator
|
|
1181
|
+
// limit (jsonlReadMaxBytes) for richer turn/sizeBytes data than
|
|
1182
|
+
// the /events SSE rowToPayload's 64 KB tail; otherwise the payload
|
|
1183
|
+
// shape matches what /events emits.
|
|
1184
|
+
let payload = toPayload(row);
|
|
1185
|
+
const candidatePath = row.state === 'archived'
|
|
1186
|
+
? jsonlPathForSessionId(deps.spawnCwd, row.sessionId, { archived: true })
|
|
1187
|
+
: jsonlPathForSessionId(deps.spawnCwd, row.sessionId);
|
|
1188
|
+
if (existsSync(candidatePath)) {
|
|
1189
|
+
const enriched = readJsonlSession(deps.spawnCwd, row.sessionId, deps.jsonlReadMaxBytes, deps.logger, deps.userTitleStore);
|
|
1190
|
+
if (enriched) {
|
|
1191
|
+
payload = {
|
|
1192
|
+
...payload,
|
|
1193
|
+
lastMessageAt: enriched.lastMessageAt,
|
|
1194
|
+
turnCount: enriched.turnCount,
|
|
1195
|
+
capped: enriched.capped,
|
|
1196
|
+
sizeBytes: enriched.sizeBytes,
|
|
1197
|
+
model: enriched.model,
|
|
1198
|
+
displayName: enriched.displayName,
|
|
1199
|
+
titleSource: enriched.titleSource,
|
|
1200
|
+
// Task 956 — context-usage source (latest-turn token sum) + the
|
|
1201
|
+
// settings-resolved effort the session launched under, for the
|
|
1202
|
+
// /chat read-only params row.
|
|
1203
|
+
usedTokens: enriched.usedTokens,
|
|
1204
|
+
effortLevel: resolveSettingsEffort(deps.claudeConfigDir),
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
deps.logger(`meta sessionId=${row.sessionId.slice(0, 8)} fields=${Object.keys(payload).length} ms=${Date.now() - start}`);
|
|
1209
|
+
timed(deps.logger, 'GET', `/${id}/meta`, 200, Date.now() - start);
|
|
1210
|
+
return c.json(payload, 200);
|
|
1211
|
+
});
|
|
1212
|
+
app.post('/:sessionId/archive', async (c) => {
|
|
1213
|
+
const start = Date.now();
|
|
1214
|
+
const id = c.req.param('sessionId');
|
|
1215
|
+
if (!SESSION_ID_PATTERN.test(id)) {
|
|
1216
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 400, Date.now() - start);
|
|
1217
|
+
return c.json({ error: 'invalid-session-id' }, 400);
|
|
1218
|
+
}
|
|
1219
|
+
let body;
|
|
1220
|
+
try {
|
|
1221
|
+
body = await c.req.json();
|
|
1222
|
+
}
|
|
1223
|
+
catch {
|
|
1224
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 400, Date.now() - start);
|
|
1225
|
+
return c.json({ error: 'body-not-json' }, 400);
|
|
1226
|
+
}
|
|
1227
|
+
const mode = body.mode;
|
|
1228
|
+
if (mode !== 'archive' && mode !== 'unarchive') {
|
|
1229
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 400, Date.now() - start);
|
|
1230
|
+
return c.json({ error: 'invalid-mode', detail: { expected: ['archive', 'unarchive'] } }, 400);
|
|
1231
|
+
}
|
|
1232
|
+
const row = resolveRow(deps.watcher, id);
|
|
1233
|
+
if (!row) {
|
|
1234
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 404, Date.now() - start);
|
|
1235
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1236
|
+
}
|
|
1237
|
+
const slug = projectSlugForCwd(deps.spawnCwd);
|
|
1238
|
+
const slugDir = join(claudeStateRoot(), 'projects', slug);
|
|
1239
|
+
const archiveDir = join(slugDir, 'archive');
|
|
1240
|
+
const fileName = `${row.sessionId}.jsonl`;
|
|
1241
|
+
// Task 260 — refuse archive whenever an alive PTY exists for this
|
|
1242
|
+
// row in the manager's tracker map. Earlier this walked every
|
|
1243
|
+
// store entry to find one whose derived path equaled the candidate
|
|
1244
|
+
// — that loop was redundant because the JSONL basename IS the
|
|
1245
|
+
// sessionId, so the only relevant check is "is this sessionId
|
|
1246
|
+
// tracker alive?". `isLive` answers in O(1).
|
|
1247
|
+
if (mode === 'archive' && isLive(row.sessionId)) {
|
|
1248
|
+
deps.logger(`archive-refused sessionId=${row.sessionId.slice(0, 8)} reason=pty-alive`);
|
|
1249
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 409, Date.now() - start);
|
|
1250
|
+
return c.json({ error: 'pty-still-alive', detail: 'end the session before archiving' }, 409);
|
|
1251
|
+
}
|
|
1252
|
+
const fromJsonl = mode === 'archive' ? join(slugDir, fileName) : join(archiveDir, fileName);
|
|
1253
|
+
const toJsonl = mode === 'archive' ? join(archiveDir, fileName) : join(slugDir, fileName);
|
|
1254
|
+
if (!existsSync(fromJsonl)) {
|
|
1255
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 404, Date.now() - start);
|
|
1256
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1257
|
+
}
|
|
1258
|
+
try {
|
|
1259
|
+
if (mode === 'archive')
|
|
1260
|
+
mkdirSync(archiveDir, { recursive: true });
|
|
1261
|
+
renameSync(fromJsonl, toJsonl);
|
|
1262
|
+
}
|
|
1263
|
+
catch (err) {
|
|
1264
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1265
|
+
deps.logger(`archive-failed sessionId=${row.sessionId.slice(0, 8)} mode=${mode} message=${msg}`);
|
|
1266
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 500, Date.now() - start);
|
|
1267
|
+
return c.json({ error: 'archive-failed', detail: msg }, 500);
|
|
1268
|
+
}
|
|
1269
|
+
// Task 260 — the sidecar travels with the JSONL. Best-effort: an
|
|
1270
|
+
// orphan sidecar at the source path is self-healing (the next
|
|
1271
|
+
// bootSeed indexes the row with null fields and the operator
|
|
1272
|
+
// re-archives), but the orphan is itself a regression signal the
|
|
1273
|
+
// log line surfaces.
|
|
1274
|
+
let sidecarMoved = false;
|
|
1275
|
+
try {
|
|
1276
|
+
const fromSidecar = mode === 'archive'
|
|
1277
|
+
? sidecarPathForSessionId(deps.spawnCwd, row.sessionId)
|
|
1278
|
+
: sidecarPathForSessionId(deps.spawnCwd, row.sessionId, { archived: true });
|
|
1279
|
+
const toSidecar = mode === 'archive'
|
|
1280
|
+
? sidecarPathForSessionId(deps.spawnCwd, row.sessionId, { archived: true })
|
|
1281
|
+
: sidecarPathForSessionId(deps.spawnCwd, row.sessionId);
|
|
1282
|
+
if (existsSync(fromSidecar)) {
|
|
1283
|
+
renameSync(fromSidecar, toSidecar);
|
|
1284
|
+
sidecarMoved = true;
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
catch (err) {
|
|
1288
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1289
|
+
deps.logger(`archive-sidecar-move-failed sessionId=${row.sessionId.slice(0, 8)} mode=${mode} message=${msg}`);
|
|
1290
|
+
}
|
|
1291
|
+
deps.logger(`[archive] sessionId=${row.sessionId.slice(0, 8)} mode=${mode} from=${basename(fromJsonl)} to=${join(mode === 'archive' ? 'archive' : '.', basename(toJsonl))} sidecar-moved=${sidecarMoved}`);
|
|
1292
|
+
timed(deps.logger, 'POST', `/${id}/archive`, 200, Date.now() - start);
|
|
1293
|
+
return c.json({ ok: true, mode }, 200);
|
|
1294
|
+
});
|
|
1295
|
+
// Task 253 — POST /:sessionId/rename { title }
|
|
1296
|
+
// - 200 + body on accept (carries the persisted title)
|
|
1297
|
+
// - 400 on validator reject (empty / too-long / control-chars)
|
|
1298
|
+
// - 404 when no row matches any of the four ids
|
|
1299
|
+
// After accepting, the user-title store persists and notifyRename()
|
|
1300
|
+
// fans a row-updated frame to every connected /events client so the
|
|
1301
|
+
// sidebar refreshes without a sidebar-route re-fetch.
|
|
1302
|
+
app.post('/:sessionId/rename', async (c) => {
|
|
1303
|
+
const start = Date.now();
|
|
1304
|
+
const id = c.req.param('sessionId');
|
|
1305
|
+
if (!SESSION_ID_PATTERN.test(id) && !/^\d+$/.test(id)) {
|
|
1306
|
+
timed(deps.logger, 'POST', `/${id}/rename`, 400, Date.now() - start);
|
|
1307
|
+
return c.json({ error: 'invalid-session-id' }, 400);
|
|
1308
|
+
}
|
|
1309
|
+
let body;
|
|
1310
|
+
try {
|
|
1311
|
+
body = await c.req.json();
|
|
1312
|
+
}
|
|
1313
|
+
catch {
|
|
1314
|
+
timed(deps.logger, 'POST', `/${id}/rename`, 400, Date.now() - start);
|
|
1315
|
+
return c.json({ error: 'invalid-json-body' }, 400);
|
|
1316
|
+
}
|
|
1317
|
+
const row = resolveRow(deps.watcher, id);
|
|
1318
|
+
// Task 260 — rename resolves via the watcher row index. The live
|
|
1319
|
+
// tracker is no longer a secondary lookup surface — the watcher's
|
|
1320
|
+
// PID-file event indexes every live session, so a sessionId that
|
|
1321
|
+
// names no row also names no live PTY.
|
|
1322
|
+
const sessionId = row?.sessionId;
|
|
1323
|
+
if (!sessionId) {
|
|
1324
|
+
timed(deps.logger, 'POST', `/${id}/rename`, 404, Date.now() - start);
|
|
1325
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1326
|
+
}
|
|
1327
|
+
const result = validateUserTitle(body.title);
|
|
1328
|
+
if (!result.ok) {
|
|
1329
|
+
deps.logger(`rename-rejected sessionId=${sessionId.slice(0, 8)} reason=${result.reason}`);
|
|
1330
|
+
timed(deps.logger, 'POST', `/${id}/rename`, 400, Date.now() - start);
|
|
1331
|
+
return c.json({ error: 'invalid-title', reason: result.reason }, 400);
|
|
1332
|
+
}
|
|
1333
|
+
const entry = deps.userTitleStore.set(sessionId, result.title);
|
|
1334
|
+
// Title content is never logged — operator names may contain customer
|
|
1335
|
+
// data. Byte count is enough for forensic recovery of bulk-rename surges.
|
|
1336
|
+
const titleBytes = Buffer.byteLength(entry.title, 'utf-8');
|
|
1337
|
+
deps.logger(`rename sessionId=${sessionId.slice(0, 8)} title-bytes=${titleBytes} source=manager-route`);
|
|
1338
|
+
notifyRename(sessionId);
|
|
1339
|
+
timed(deps.logger, 'POST', `/${id}/rename`, 200, Date.now() - start);
|
|
1340
|
+
return c.json({ ok: true, sessionId, titleSource: 'user', renamedAt: entry.renamedAt }, 200);
|
|
1341
|
+
});
|
|
1342
|
+
// SIGTERM-only stop. Idempotent on already-dead PTYs. JSONL untouched.
|
|
1343
|
+
app.post('/:sessionId/stop', async (c) => {
|
|
1344
|
+
const start = Date.now();
|
|
1345
|
+
const id = c.req.param('sessionId');
|
|
1346
|
+
if (!SESSION_ID_PATTERN.test(id) && !/^\d+$/.test(id)) {
|
|
1347
|
+
timed(deps.logger, 'POST', `/${id}/stop`, 400, Date.now() - start);
|
|
1348
|
+
return c.json({ error: 'invalid-session-id' }, 400);
|
|
1349
|
+
}
|
|
1350
|
+
const row = resolveRow(deps.watcher, id);
|
|
1351
|
+
if (!row && !isLive(id)) {
|
|
1352
|
+
timed(deps.logger, 'POST', `/${id}/stop`, 404, Date.now() - start);
|
|
1353
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1354
|
+
}
|
|
1355
|
+
const sessionId = row?.sessionId ?? id;
|
|
1356
|
+
// Task 455 — snapshot the live pid and prior-exited-count BEFORE
|
|
1357
|
+
// stopSession runs (the call mutates module state). When prior history
|
|
1358
|
+
// exists, emit a single observability line naming the pid the lookup
|
|
1359
|
+
// resolved to; the existing `[stop-session] systemd-scope-stop` line
|
|
1360
|
+
// still fires from inside stopSession. The new line is gated on count
|
|
1361
|
+
// > 0 so the happy-path log shape stays unchanged.
|
|
1362
|
+
const liveBeforeStop = livePidForSession(sessionId);
|
|
1363
|
+
const priorExitedCount = priorExitedCountForSession(sessionId);
|
|
1364
|
+
if (priorExitedCount > 0) {
|
|
1365
|
+
deps.logger(`[stop-session] resolved sessionId=${sessionId.slice(0, 8)} pid=${liveBeforeStop ?? 'none'} prior-exited-count=${priorExitedCount}`);
|
|
1366
|
+
}
|
|
1367
|
+
const outcome = await stopSession({
|
|
1368
|
+
killGraceMs: deps.killGraceMs,
|
|
1369
|
+
logger: deps.logger,
|
|
1370
|
+
runSystemctl: deps.runSystemctl,
|
|
1371
|
+
// Task 427 — when the row was reattached after a manager restart,
|
|
1372
|
+
// `livePtys` has no entry but `row.scopeUnitToken` is set; pass it
|
|
1373
|
+
// so stopSession can take the row-scope fallback path.
|
|
1374
|
+
rowScopeUnitToken: row?.scopeUnitToken ?? null,
|
|
1375
|
+
// Task 451 — paired with rowScopeUnitToken so the row-scope branch
|
|
1376
|
+
// can post-flight verify the kill via kill(pid, 0).
|
|
1377
|
+
rowPid: row?.pid ?? null,
|
|
1378
|
+
}, sessionId);
|
|
1379
|
+
// Task 427 — one unified log line per /stop attempt that names the
|
|
1380
|
+
// path taken. Detail lines from each branch keep their own per-branch
|
|
1381
|
+
// formatting (Task 250 contract); this is the single audit line the
|
|
1382
|
+
// operator and tests can grep against to confirm which branch ran.
|
|
1383
|
+
deps.logger(`[stop-session] path=${outcome.path} outcome=${outcome.scopeOutcome} sessionId=${sessionId.slice(0, 8)} unit=${row?.scopeUnitToken ?? 'none'} pid=${row?.pid ?? 'unknown'}`);
|
|
1384
|
+
// Task 250 — surface scope-stop failures as 500 so the operator sees
|
|
1385
|
+
// the End-click fail when systemd cannot stop the unit. The liveptys
|
|
1386
|
+
// happy path keeps its original 204 response (Task 250 contract).
|
|
1387
|
+
if (outcome.scopeOutcome === 'error') {
|
|
1388
|
+
timed(deps.logger, 'POST', `/${sessionId}/stop`, 500, Date.now() - start);
|
|
1389
|
+
return c.json({
|
|
1390
|
+
error: 'scope-stop-failed',
|
|
1391
|
+
path: outcome.path,
|
|
1392
|
+
exitCode: outcome.exitCode,
|
|
1393
|
+
detail: 'systemctl --user stop returned a non-zero exit code for the session\'s scope unit',
|
|
1394
|
+
}, 500);
|
|
1395
|
+
}
|
|
1396
|
+
// Task 451 — `failed-pid-survives` means the manager escalated SIGTERM
|
|
1397
|
+
// then SIGKILL and the pid is STILL alive. Surface as 500 so the End
|
|
1398
|
+
// click does not falsely succeed; the operator needs to know termination
|
|
1399
|
+
// did not happen.
|
|
1400
|
+
if (outcome.scopeOutcome === 'failed-pid-survives') {
|
|
1401
|
+
timed(deps.logger, 'POST', `/${sessionId}/stop`, 500, Date.now() - start);
|
|
1402
|
+
return c.json({
|
|
1403
|
+
error: 'pid-survived-sigkill',
|
|
1404
|
+
path: outcome.path,
|
|
1405
|
+
exitCode: outcome.exitCode,
|
|
1406
|
+
detail: 'systemctl stop returned 0 but the claude pid resisted SIGTERM and SIGKILL; manual intervention required',
|
|
1407
|
+
}, 500);
|
|
1408
|
+
}
|
|
1409
|
+
// Task 427 — the row-scope branch returns a 200 JSON body so the UI
|
|
1410
|
+
// can distinguish "the manager actually stopped a reattached PTY" from
|
|
1411
|
+
// the original single-process happy path's 204. The boot-seed reattach
|
|
1412
|
+
// case is genuine work — systemctl stopped a surviving scope unit —
|
|
1413
|
+
// and the operator's log surface should reflect that distinction.
|
|
1414
|
+
//
|
|
1415
|
+
// Task 455 — the `no-store-entry` branch falls through to 204. There
|
|
1416
|
+
// was no live pid anywhere (no tracker, no row scope token), so the
|
|
1417
|
+
// request is idempotent "already stopped"; nothing was signalled. The
|
|
1418
|
+
// UI logger sees the same 204 it does for the live happy path, which
|
|
1419
|
+
// is correct — both cases describe "nothing live remains".
|
|
1420
|
+
// Task 702 — the process is stopped; its reattach hint is now stale.
|
|
1421
|
+
removeScopeRecord(sessionsDir, sessionId, deps.logger);
|
|
1422
|
+
if (outcome.path === 'row-scope') {
|
|
1423
|
+
timed(deps.logger, 'POST', `/${sessionId}/stop`, 200, Date.now() - start);
|
|
1424
|
+
return c.json({ ok: true, path: outcome.path, outcome: outcome.scopeOutcome }, 200);
|
|
1425
|
+
}
|
|
1426
|
+
timed(deps.logger, 'POST', `/${sessionId}/stop`, 204, Date.now() - start);
|
|
1427
|
+
return c.body(null, 204);
|
|
1428
|
+
});
|
|
1429
|
+
// Hard-remove transcript. 409 if PTY is still alive (stop first).
|
|
1430
|
+
app.delete('/:sessionId', async (c) => {
|
|
1431
|
+
const start = Date.now();
|
|
1432
|
+
const id = c.req.param('sessionId');
|
|
1433
|
+
if (!SESSION_ID_PATTERN.test(id) && !/^\d+$/.test(id)) {
|
|
1434
|
+
timed(deps.logger, 'DELETE', `/${id}`, 400, Date.now() - start);
|
|
1435
|
+
return c.json({ error: 'invalid-session-id' }, 400);
|
|
1436
|
+
}
|
|
1437
|
+
const row = resolveRow(deps.watcher, id);
|
|
1438
|
+
const sessionId = row?.sessionId ?? id;
|
|
1439
|
+
if (isLive(sessionId)) {
|
|
1440
|
+
deps.logger(`delete-rejected sessionId=${sessionId.slice(0, 8)} reason=pty-still-alive`);
|
|
1441
|
+
timed(deps.logger, 'DELETE', `/${id}`, 409, Date.now() - start);
|
|
1442
|
+
return c.json({ error: 'pty-still-alive', detail: 'stop the session before deleting' }, 409);
|
|
1443
|
+
}
|
|
1444
|
+
// Task 260 — purge from BOTH locations: a row may have its JSONL
|
|
1445
|
+
// at the top level (live or just-ended) or under archive/ (archived).
|
|
1446
|
+
const topJsonl = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
1447
|
+
const archivedJsonl = jsonlPathForSessionId(deps.spawnCwd, sessionId, { archived: true });
|
|
1448
|
+
const topSidecar = sidecarPathForSessionId(deps.spawnCwd, sessionId);
|
|
1449
|
+
const archivedSidecar = sidecarPathForSessionId(deps.spawnCwd, sessionId, { archived: true });
|
|
1450
|
+
const hasTop = existsSync(topJsonl);
|
|
1451
|
+
const hasArchived = existsSync(archivedJsonl);
|
|
1452
|
+
if (!row || (!hasTop && !hasArchived)) {
|
|
1453
|
+
timed(deps.logger, 'DELETE', `/${id}`, 404, Date.now() - start);
|
|
1454
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1455
|
+
}
|
|
1456
|
+
const subdir = join(claudeStateRoot(), 'projects', projectSlugForCwd(deps.spawnCwd), sessionId);
|
|
1457
|
+
let bytes = 0;
|
|
1458
|
+
try {
|
|
1459
|
+
bytes = hasTop ? statSync(topJsonl).size : hasArchived ? statSync(archivedJsonl).size : 0;
|
|
1460
|
+
}
|
|
1461
|
+
catch {
|
|
1462
|
+
// size is informational
|
|
1463
|
+
}
|
|
1464
|
+
try {
|
|
1465
|
+
if (hasTop)
|
|
1466
|
+
rmSync(topJsonl);
|
|
1467
|
+
if (hasArchived)
|
|
1468
|
+
rmSync(archivedJsonl);
|
|
1469
|
+
if (existsSync(topSidecar))
|
|
1470
|
+
rmSync(topSidecar);
|
|
1471
|
+
if (existsSync(archivedSidecar))
|
|
1472
|
+
rmSync(archivedSidecar);
|
|
1473
|
+
if (existsSync(subdir))
|
|
1474
|
+
rmSync(subdir, { recursive: true, force: true });
|
|
1475
|
+
}
|
|
1476
|
+
catch (err) {
|
|
1477
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1478
|
+
deps.logger(`delete-failed sessionId=${sessionId.slice(0, 8)} message=${msg}`);
|
|
1479
|
+
timed(deps.logger, 'DELETE', `/${id}`, 500, Date.now() - start);
|
|
1480
|
+
return c.json({ error: 'delete-failed', detail: msg }, 500);
|
|
1481
|
+
}
|
|
1482
|
+
// Task 253 — drop the user-title entry for the purged session so the
|
|
1483
|
+
// session-titles.json doesn't accrete orphans. Best-effort; the store
|
|
1484
|
+
// logs its own failure and reads still serve from the in-memory map
|
|
1485
|
+
// until next boot.
|
|
1486
|
+
deps.userTitleStore.remove(sessionId);
|
|
1487
|
+
// Task 683 — drop the channel binding too so wa-channel-bindings.json
|
|
1488
|
+
// doesn't accrete orphans and a recreated session can't inherit a stale
|
|
1489
|
+
// binding. Best-effort; the store logs its own failure.
|
|
1490
|
+
deps.waChannelStore.remove(sessionId);
|
|
1491
|
+
deps.webchatChannelStore?.remove(sessionId);
|
|
1492
|
+
// Task 702 — the transcript is gone; its reattach hint must go too.
|
|
1493
|
+
removeScopeRecord(sessionsDir, sessionId, deps.logger);
|
|
1494
|
+
deps.logger(`purge sessionId=${sessionId.slice(0, 8)} bytes=${bytes}`);
|
|
1495
|
+
timed(deps.logger, 'DELETE', `/${id}`, 204, Date.now() - start);
|
|
1496
|
+
return c.body(null, 204);
|
|
1497
|
+
});
|
|
1498
|
+
app.post('/:sessionId/input', async (c) => {
|
|
1499
|
+
const start = Date.now();
|
|
1500
|
+
const id = c.req.param('sessionId');
|
|
1501
|
+
const row = resolveRow(deps.watcher, id);
|
|
1502
|
+
const sessionId = row?.sessionId ?? id;
|
|
1503
|
+
let body;
|
|
1504
|
+
try {
|
|
1505
|
+
body = await c.req.json();
|
|
1506
|
+
}
|
|
1507
|
+
catch {
|
|
1508
|
+
timed(deps.logger, 'POST', `/${id}/input`, 400, Date.now() - start);
|
|
1509
|
+
return c.json({ error: 'body-not-json' }, 400);
|
|
1510
|
+
}
|
|
1511
|
+
if (typeof body.text !== 'string') {
|
|
1512
|
+
timed(deps.logger, 'POST', `/${id}/input`, 400, Date.now() - start);
|
|
1513
|
+
return c.json({ error: 'text-required' }, 400);
|
|
1514
|
+
}
|
|
1515
|
+
const channel = row?.channel ?? null;
|
|
1516
|
+
const result = writeInputToPty(sessionId, body.text, deps.logger, channel);
|
|
1517
|
+
if (!result.ok) {
|
|
1518
|
+
if (result.error === 'not-found') {
|
|
1519
|
+
timed(deps.logger, 'POST', `/${id}/input`, 404, Date.now() - start);
|
|
1520
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1521
|
+
}
|
|
1522
|
+
if (result.error === 'exited') {
|
|
1523
|
+
timed(deps.logger, 'POST', `/${id}/input`, 410, Date.now() - start);
|
|
1524
|
+
return c.json({ error: 'session-exited' }, 410);
|
|
1525
|
+
}
|
|
1526
|
+
timed(deps.logger, 'POST', `/${id}/input`, 500, Date.now() - start);
|
|
1527
|
+
return c.json({ error: 'pty-write-failed', detail: result.detail }, 500);
|
|
1528
|
+
}
|
|
1529
|
+
// Task 666 — the 200 means the write was accepted, not that a turn
|
|
1530
|
+
// submitted. Fire a bounded post-condition poll (non-awaited) that confirms
|
|
1531
|
+
// the PTY went `busy` or a new user JSONL entry landed, or emits
|
|
1532
|
+
// `op=input-no-turn` so an accepted-but-unsubmitted input is visible without
|
|
1533
|
+
// waiting for the 300s turn-timeout. The 200 is no longer the success signal.
|
|
1534
|
+
// Finite-guard the tunables: a non-numeric env override would otherwise make
|
|
1535
|
+
// windowMs/intervalMs NaN, so the elapse check never fires and the poll spins
|
|
1536
|
+
// forever (a timer leak per /input). Fall back to the defaults instead.
|
|
1537
|
+
const windowMs = finitePositive(process.env.INPUT_SUBMIT_POLL_MS, 8000);
|
|
1538
|
+
const intervalMs = finitePositive(process.env.INPUT_SUBMIT_POLL_INTERVAL_MS, 250);
|
|
1539
|
+
const postcondJsonlPath = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
1540
|
+
const baselineUserCount = countUserEntries(postcondJsonlPath);
|
|
1541
|
+
const pid = resolveRow(deps.watcher, id)?.pid ?? null;
|
|
1542
|
+
void watchInputSubmission({
|
|
1543
|
+
pid,
|
|
1544
|
+
sessionId,
|
|
1545
|
+
bytes: result.bytes ?? 0,
|
|
1546
|
+
baselineUserCount,
|
|
1547
|
+
deps: {
|
|
1548
|
+
getPtyStatus: () => deps.watcher.getBySessionId(sessionId)?.status ?? null,
|
|
1549
|
+
getUserEntryCount: () => countUserEntries(postcondJsonlPath),
|
|
1550
|
+
getLastEntryAgeMs: () => {
|
|
1551
|
+
try {
|
|
1552
|
+
return Date.now() - statSync(postcondJsonlPath).mtimeMs;
|
|
1553
|
+
}
|
|
1554
|
+
catch {
|
|
1555
|
+
return null;
|
|
1556
|
+
}
|
|
1557
|
+
},
|
|
1558
|
+
now: () => Date.now(),
|
|
1559
|
+
sleep: (ms) => new Promise((r) => setTimeout(r, ms)),
|
|
1560
|
+
log: deps.logger,
|
|
1561
|
+
windowMs,
|
|
1562
|
+
intervalMs,
|
|
1563
|
+
},
|
|
1564
|
+
}).catch((err) => {
|
|
1565
|
+
deps.logger(`op=input-postcondition-error sessionId=${sessionId.slice(0, 8)} message=${err instanceof Error ? err.message : String(err)}`);
|
|
1566
|
+
});
|
|
1567
|
+
timed(deps.logger, 'POST', `/${id}/input`, 200, Date.now() - start);
|
|
1568
|
+
return c.json({ ok: true, bytes: result.bytes }, 200);
|
|
1569
|
+
});
|
|
1570
|
+
app.get('/:sessionId/log', (c) => {
|
|
1571
|
+
const start = Date.now();
|
|
1572
|
+
const id = c.req.param('sessionId');
|
|
1573
|
+
const row = resolveRow(deps.watcher, id);
|
|
1574
|
+
const sessionId = row?.sessionId ?? id;
|
|
1575
|
+
const live = isLive(sessionId);
|
|
1576
|
+
// Task 260 — /log reads from whichever location holds the JSONL
|
|
1577
|
+
// right now: top level for live + recently-ended rows, archive
|
|
1578
|
+
// subdir for archived rows. 404 when there's no row AND no live
|
|
1579
|
+
// PTY for this id; 202 pending when a live PTY hasn't flushed
|
|
1580
|
+
// its first turn yet (no JSONL on disk in either location).
|
|
1581
|
+
if (!live && !row) {
|
|
1582
|
+
timed(deps.logger, 'GET', `/${id}/log`, 404, Date.now() - start);
|
|
1583
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1584
|
+
}
|
|
1585
|
+
const topJsonl = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
1586
|
+
const archivedJsonl = jsonlPathForSessionId(deps.spawnCwd, sessionId, { archived: true });
|
|
1587
|
+
const jsonlPath = existsSync(topJsonl) ? topJsonl : archivedJsonl;
|
|
1588
|
+
if (live && !existsSync(topJsonl) && !existsSync(archivedJsonl)) {
|
|
1589
|
+
timed(deps.logger, 'GET', `/${id}/log`, 202, Date.now() - start);
|
|
1590
|
+
return c.json({ jsonlPath: null, exists: false, sizeBytes: 0, pending: true }, 202);
|
|
1591
|
+
}
|
|
1592
|
+
if (!existsSync(jsonlPath)) {
|
|
1593
|
+
timed(deps.logger, 'GET', `/${id}/log`, 404, Date.now() - start);
|
|
1594
|
+
return c.json({ error: 'session-not-found' }, 404);
|
|
1595
|
+
}
|
|
1596
|
+
const download = c.req.query('download') === '1';
|
|
1597
|
+
const follow = c.req.query('follow') === '1';
|
|
1598
|
+
// Task 631 — `&boundary=1` (channel resume-suppressing follower only) makes
|
|
1599
|
+
// the follow stream emit a single head→tail boundary sentinel line after
|
|
1600
|
+
// the existing JSONL, before tailing, so the follower can discard pre-attach
|
|
1601
|
+
// replay. The in-browser viewer omits it and streams from offset 0 as before.
|
|
1602
|
+
const boundary = c.req.query('boundary') === '1';
|
|
1603
|
+
// Task 197 — `?download=1` short-circuits before the JSON-metadata branch
|
|
1604
|
+
// so the browser receives the raw NDJSON bytes with attachment-disposition
|
|
1605
|
+
// headers. The non-follow JSON branch's "file gone, sizeBytes:0" answer is
|
|
1606
|
+
// correct for metadata but would silently save an empty file to the
|
|
1607
|
+
// operator's Downloads folder; refuse with a loud 404 instead.
|
|
1608
|
+
if (download) {
|
|
1609
|
+
if (!existsSync(jsonlPath)) {
|
|
1610
|
+
timed(deps.logger, 'GET', `/${id}/log?download=1`, 404, Date.now() - start);
|
|
1611
|
+
return c.json({ error: 'jsonl-missing-on-disk' }, 404);
|
|
1612
|
+
}
|
|
1613
|
+
const sizeBytes = statSync(jsonlPath).size;
|
|
1614
|
+
// RFC 6266 quoted-string. The sessionId arrives URL-decoded from the
|
|
1615
|
+
// route param; replace any character outside the safe charset so a
|
|
1616
|
+
// quote or newline cannot terminate the header early.
|
|
1617
|
+
const safeName = sessionId.replace(/[^A-Za-z0-9._-]/g, '_');
|
|
1618
|
+
c.header('Content-Type', 'application/x-ndjson');
|
|
1619
|
+
c.header('Content-Disposition', `attachment; filename="${safeName}.jsonl"`);
|
|
1620
|
+
c.header('Cache-Control', 'no-store');
|
|
1621
|
+
timed(deps.logger, 'GET', `/${id}/log?download=1`, 200, Date.now() - start);
|
|
1622
|
+
return stream(c, async (out) => {
|
|
1623
|
+
const reader = createReadStream(jsonlPath);
|
|
1624
|
+
for await (const chunk of reader) {
|
|
1625
|
+
await out.write(chunk);
|
|
1626
|
+
}
|
|
1627
|
+
deps.logger(`log-download sessionId=${sessionId} bytes=${sizeBytes} ms=${Date.now() - start}`);
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
if (!follow) {
|
|
1631
|
+
const exists = existsSync(jsonlPath);
|
|
1632
|
+
const sizeBytes = exists ? statSync(jsonlPath).size : 0;
|
|
1633
|
+
timed(deps.logger, 'GET', `/${id}/log`, 200, Date.now() - start);
|
|
1634
|
+
return c.json({ jsonlPath, exists, sizeBytes }, 200);
|
|
1635
|
+
}
|
|
1636
|
+
timed(deps.logger, 'GET', `/${id}/log?follow=1`, 200, Date.now() - start);
|
|
1637
|
+
// Task 198 — open/close lifecycle lines bracket every follow stream so
|
|
1638
|
+
// the in-browser viewer's session is observable on the manager side.
|
|
1639
|
+
// `linesStreamed` counts `\n` bytes written across initial-read + tail, so
|
|
1640
|
+
// the value matches the operator's `wc -l` mental model. `closeReason`
|
|
1641
|
+
// defaults to `end` (unreachable today; reserved for a future natural-EOF
|
|
1642
|
+
// path such as file-deleted-mid-stream) and flips to `aborted` whenever
|
|
1643
|
+
// `out.onAbort` fires — that single hook covers both browser-initiated
|
|
1644
|
+
// abort and network disconnect, which the server cannot distinguish.
|
|
1645
|
+
const followStreamStart = Date.now();
|
|
1646
|
+
return stream(c, async (out) => {
|
|
1647
|
+
let position = 0;
|
|
1648
|
+
let linesStreamed = 0;
|
|
1649
|
+
let closeReason = 'end';
|
|
1650
|
+
const countNewlines = (buf) => {
|
|
1651
|
+
let n = 0;
|
|
1652
|
+
for (let i = 0; i < buf.length; i++)
|
|
1653
|
+
if (buf[i] === 0x0a)
|
|
1654
|
+
n++;
|
|
1655
|
+
return n;
|
|
1656
|
+
};
|
|
1657
|
+
if (existsSync(jsonlPath)) {
|
|
1658
|
+
const initialSize = statSync(jsonlPath).size;
|
|
1659
|
+
const head = createReadStream(jsonlPath, { start: 0, end: Math.max(0, initialSize - 1) });
|
|
1660
|
+
for await (const chunk of head) {
|
|
1661
|
+
const buf = chunk;
|
|
1662
|
+
linesStreamed += countNewlines(buf);
|
|
1663
|
+
await out.write(buf);
|
|
1664
|
+
}
|
|
1665
|
+
position = initialSize;
|
|
1666
|
+
}
|
|
1667
|
+
// Task 631 — mark the head→tail boundary. Everything written above is the
|
|
1668
|
+
// pre-attach JSONL (full prior conversation on a resumed session, a
|
|
1669
|
+
// partial in-flight turn or nothing on a cold spawn); the sentinel tells
|
|
1670
|
+
// the channel follower the live tail starts here. Not counted in
|
|
1671
|
+
// `linesStreamed` — it is not a file line, and the viewer never sets
|
|
1672
|
+
// `boundary`.
|
|
1673
|
+
if (boundary) {
|
|
1674
|
+
await out.write(Buffer.from(JSON.stringify({ type: '__channel_resume_boundary__' }) + '\n'));
|
|
1675
|
+
}
|
|
1676
|
+
// Task 260 — prefer the row's PID (watcher-derived) but fall back
|
|
1677
|
+
// to the live tracker if the row hasn't been populated yet (the
|
|
1678
|
+
// pre-first-turn window during which the watcher's PID-file event
|
|
1679
|
+
// has not fired against the row builder).
|
|
1680
|
+
const followPid = row?.pid ?? getPtyTrackerForTests(sessionId)?.pid ?? null;
|
|
1681
|
+
deps.logger(`log-follow-open sessionId=${sessionId} initialBytes=${position} pid=${followPid ?? 'null'}`);
|
|
1682
|
+
let active = true;
|
|
1683
|
+
out.onAbort(() => {
|
|
1684
|
+
active = false;
|
|
1685
|
+
closeReason = 'aborted';
|
|
1686
|
+
unwatchFile(jsonlPath);
|
|
1687
|
+
});
|
|
1688
|
+
const listener = () => {
|
|
1689
|
+
if (!active)
|
|
1690
|
+
return;
|
|
1691
|
+
if (!existsSync(jsonlPath))
|
|
1692
|
+
return;
|
|
1693
|
+
const newSize = statSync(jsonlPath).size;
|
|
1694
|
+
if (newSize <= position)
|
|
1695
|
+
return;
|
|
1696
|
+
const tail = createReadStream(jsonlPath, { start: position, end: newSize - 1 });
|
|
1697
|
+
position = newSize;
|
|
1698
|
+
tail.on('data', (chunk) => {
|
|
1699
|
+
if (active) {
|
|
1700
|
+
const buf = chunk;
|
|
1701
|
+
linesStreamed += countNewlines(buf);
|
|
1702
|
+
void out.write(buf);
|
|
1703
|
+
}
|
|
1704
|
+
});
|
|
1705
|
+
};
|
|
1706
|
+
watchFile(jsonlPath, { interval: 250 }, listener);
|
|
1707
|
+
while (active) {
|
|
1708
|
+
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
1709
|
+
}
|
|
1710
|
+
deps.logger(`log-follow-close sessionId=${sessionId} reason=${closeReason} linesStreamed=${linesStreamed} ms=${Date.now() - followStreamStart}`);
|
|
1711
|
+
});
|
|
1712
|
+
});
|
|
1713
|
+
app.get('/healthz', (c) => c.json({ ok: true, sessions: livePtyCount() }));
|
|
1714
|
+
// Task 797 — /chat composer settings write-through. The UI server persists
|
|
1715
|
+
// the lever to account.json, then calls this so settings.json picks it up
|
|
1716
|
+
// for the next spawn (the boot-time merge, run on demand). No session gate,
|
|
1717
|
+
// like every manager route: the manager binds loopback-only, so the trust
|
|
1718
|
+
// boundary is the host, not the route.
|
|
1719
|
+
app.post('/reapply-levers', (c) => {
|
|
1720
|
+
const result = reapplyAdminLevers(deps.accountDir, deps.claudeConfigDir, deps.logger);
|
|
1721
|
+
deps.logger(`[manager] reapply-levers model=${result.model ?? 'unset'} effortLevel=${result.effortLevel ?? 'unset'} permissionMode=${result.permissionMode ?? 'unset'}`);
|
|
1722
|
+
return c.json({ ok: true, ...result });
|
|
1723
|
+
});
|
|
1724
|
+
// Task 702 — process-truth liveness. The union of owned live PTYs and
|
|
1725
|
+
// reattached survivor scopes (status=detached). The dashboard dot, the
|
|
1726
|
+
// /rc-spawn reconcile, and the standing reconciler all read this instead of
|
|
1727
|
+
// scanning disk pid files (stale on newer Claude Code).
|
|
1728
|
+
app.get('/live-sessions', (c) => {
|
|
1729
|
+
const seen = new Map();
|
|
1730
|
+
for (const { sessionId, pid } of liveSessionIds())
|
|
1731
|
+
seen.set(sessionId, pid);
|
|
1732
|
+
// A reattached survivor (status=detached) is a live process the manager no
|
|
1733
|
+
// longer owns the fd for — but only while its scope is actually running. A
|
|
1734
|
+
// Stop kills the scope yet keeps the JSONL (so the row lingers), and a
|
|
1735
|
+
// survivor can crash on its own; in both cases reporting it live would be
|
|
1736
|
+
// a false-green dot (the bug this task removes). Verify the scope's MainPID
|
|
1737
|
+
// is alive before trusting a detached row. Detached rows are rare (only
|
|
1738
|
+
// after a manager restart with survivors), so the per-row systemctl cost is
|
|
1739
|
+
// bounded and zero in the common case.
|
|
1740
|
+
const runSystemctl = deps.runSystemctl ?? defaultSystemctlRunner;
|
|
1741
|
+
for (const row of deps.watcher.all()) {
|
|
1742
|
+
if (row.status !== 'detached' || seen.has(row.sessionId) || !row.scopeUnitToken)
|
|
1743
|
+
continue;
|
|
1744
|
+
const mainPid = getScopeMainPid(runSystemctl, row.scopeUnitToken);
|
|
1745
|
+
if (mainPid !== null && defaultProcessSignals.isAlive(mainPid))
|
|
1746
|
+
seen.set(row.sessionId, mainPid);
|
|
1747
|
+
}
|
|
1748
|
+
// Task 731 — a live, non-detached row whose owned PTY tracker has been
|
|
1749
|
+
// released (or was registered under a placeholder sessionId, never the
|
|
1750
|
+
// real one) is counted by the master-reconcile `liveSessions` census yet
|
|
1751
|
+
// missed by both arms above: it is not an owned PTY and not a detached
|
|
1752
|
+
// survivor. Adopt it on PID-file process truth — `row.pid` is claude's own
|
|
1753
|
+
// live pid for a `state==='live'` row — gated on `isAlive` so a stale PID
|
|
1754
|
+
// file (dead process) never reports a false-green dot. Detached rows are
|
|
1755
|
+
// excluded here on purpose: their liveness is the scope MainPID (resolved
|
|
1756
|
+
// above) and their `row.pid` may be a stale manager-side pid.
|
|
1757
|
+
for (const row of deps.watcher.all()) {
|
|
1758
|
+
if (row.state !== 'live' || row.status === 'detached' || seen.has(row.sessionId) || row.pid === null)
|
|
1759
|
+
continue;
|
|
1760
|
+
if (defaultProcessSignals.isAlive(row.pid)) {
|
|
1761
|
+
seen.set(row.sessionId, row.pid);
|
|
1762
|
+
deps.logger(`[live-sessions] op=adopt-orphan-live sessionId=${row.sessionId.slice(0, 8)} pid=${row.pid} via=reconcile`);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
const sessions = [...seen.entries()].map(([sessionId, pid]) => ({ sessionId, pid }));
|
|
1766
|
+
return c.json({ sessions });
|
|
1767
|
+
});
|
|
1768
|
+
// Task 543 — fire-and-forget `claude --remote-control [--session-id <sid>]`
|
|
1769
|
+
// spawn for the admin sessions pane. (Task 945 removed the `name` positional —
|
|
1770
|
+
// `name` is a display label, never a CLI prompt; do not re-add it to argv.) The new PTY registers itself in
|
|
1771
|
+
// claude.ai/code as its own Remote Control entry; reconciliation with the
|
|
1772
|
+
// rc-daemon is out of scope. The PID lands in
|
|
1773
|
+
// `<CLAUDE_CONFIG_DIR>/sessions/<pid>.json` via claude's own bootstrap,
|
|
1774
|
+
// which is how the sidebar list keeps `live` accurate and how the delete
|
|
1775
|
+
// route later finds the PID to SIGTERM.
|
|
1776
|
+
//
|
|
1777
|
+
// Task 573 — single spawn path: node-pty wrapped in `systemd-run --user
|
|
1778
|
+
// --scope`. Success signal is the on-disk PID file (logged as
|
|
1779
|
+
// `op=pidfile-present`); the prior A/B `script-scope` arm and its
|
|
1780
|
+
// non-PTY scope primitive are gone. The manager owns
|
|
1781
|
+
// one master fd per live rc-spawn child; lifecycle observability emits
|
|
1782
|
+
// `[rc-spawn]` and `[rc-life]` lines tagged with the `unitToken`
|
|
1783
|
+
// covering request → argv → pty-spawned → child-output → pidfile-present
|
|
1784
|
+
// (success) / early-exit (failure) → exit.
|
|
1785
|
+
app.post('/rc-spawn', async (c) => {
|
|
1786
|
+
const start = Date.now();
|
|
1787
|
+
let body;
|
|
1788
|
+
try {
|
|
1789
|
+
body = await c.req.json();
|
|
1790
|
+
}
|
|
1791
|
+
catch {
|
|
1792
|
+
body = {};
|
|
1793
|
+
}
|
|
1794
|
+
const sessionId = typeof body.sessionId === 'string' && body.sessionId.length > 0 ? body.sessionId : null;
|
|
1795
|
+
const name = typeof body.name === 'string' && body.name.length > 0 ? body.name : null;
|
|
1796
|
+
// Task 876 — re-seat fork. `forkFromSessionId` is the source whose history
|
|
1797
|
+
// is copied; `sessionId` is the caller-pre-minted fork target; `model` is
|
|
1798
|
+
// the chosen model. The UI allowlist (isSelectableModel) is the
|
|
1799
|
+
// authoritative gate; this shape-guard is defence-in-depth so a malformed
|
|
1800
|
+
// value cannot reach the `--model` argv (the manager has no rootDir-clean
|
|
1801
|
+
// path to import the models lib, so it guards on shape, not the exact list).
|
|
1802
|
+
const forkFromSessionId = typeof body.forkFromSessionId === 'string' && UUID_PATTERN.test(body.forkFromSessionId) ? body.forkFromSessionId : null;
|
|
1803
|
+
const reseatModel = typeof body.model === 'string' && /^claude-[a-z0-9.-]+(\[1m\])?$/i.test(body.model) ? body.model : null;
|
|
1804
|
+
// Task 928 — fork-carried levers. `null` when the field is present but not in
|
|
1805
|
+
// the allowlist (rejected below, on the fork path only); `undefined` when
|
|
1806
|
+
// absent (the fork keeps the settings-resolved mode / the harness default effort).
|
|
1807
|
+
const reseatPermissionMode = typeof body.permissionMode === 'string' ? (isPermissionMode(body.permissionMode) ? body.permissionMode : null) : undefined;
|
|
1808
|
+
const reseatEffort = typeof body.effort === 'string' ? (isEffortLevel(body.effort) ? body.effort : null) : undefined;
|
|
1809
|
+
// Task 970 — the fresh new-session picker admits a 5th level, `max`, that the
|
|
1810
|
+
// fork path never offers. Parsed against the wider allowlist; `max` is routed
|
|
1811
|
+
// to the `--effort` argv below (it is session-only — invalid as a settings.json
|
|
1812
|
+
// `effortLevel`), the 4 lower levels ride the inline `effortLevel`. null when
|
|
1813
|
+
// present-but-invalid (a silent drop to the settings default — the fresh path
|
|
1814
|
+
// is not a hard-reject path, unlike the fork's reseatEffort 400 above).
|
|
1815
|
+
const freshEffort = typeof body.effort === 'string' ? (isNewSessionEffortLevel(body.effort) ? body.effort : null) : undefined;
|
|
1816
|
+
// Task 626 — per-visitor slice ringfence for the public session-end review
|
|
1817
|
+
// rc session. Shape-gated identically to /public-spawn so a body-controlled
|
|
1818
|
+
// value cannot reach the child env. Absent on channel-admin / LinkedIn.
|
|
1819
|
+
const sliceToken = typeof body.sliceToken === 'string' && UUID_PATTERN.test(body.sliceToken) ? body.sliceToken : undefined;
|
|
1820
|
+
const personId = typeof body.personId === 'string' && body.personId.length > 0 && body.personId.length <= 128
|
|
1821
|
+
? body.personId
|
|
1822
|
+
: undefined;
|
|
1823
|
+
// Task 865 — the authenticated admin's AdminUser.userId, threaded by the UI
|
|
1824
|
+
// from the validated PIN session (never message content). Shape-validated
|
|
1825
|
+
// the same way as personId; written into the classification sidecar so the
|
|
1826
|
+
// Sessions panel resolves the admin's display name. Absent on every
|
|
1827
|
+
// non-admin-webchat spawn.
|
|
1828
|
+
const adminUserId = typeof body.adminUserId === 'string' && body.adminUserId.length > 0 && body.adminUserId.length <= 128
|
|
1829
|
+
? body.adminUserId
|
|
1830
|
+
: undefined;
|
|
1831
|
+
// Task 889 — the resolved authenticated-admin display name, resolved by the
|
|
1832
|
+
// UI from USER_ID -> AdminUser (the manager holds no Neo4j driver) and
|
|
1833
|
+
// shape-bounded here. Absent => the identity line renders its not-resolvable
|
|
1834
|
+
// form. Only consumed for webchat-bound admin spawns.
|
|
1835
|
+
const authenticatedName = typeof body.authenticatedName === 'string' && body.authenticatedName.length > 0 && body.authenticatedName.length <= 256
|
|
1836
|
+
? body.authenticatedName
|
|
1837
|
+
: undefined;
|
|
1838
|
+
// Task 682 — per-session userId override. Server-resolved by the UI from the
|
|
1839
|
+
// authoritative users.json/account.json (never message content) and shape-
|
|
1840
|
+
// validated here the same way as personId. Absent for owner self-phone and
|
|
1841
|
+
// any unbound sender, where the boot-time deps.userId (owner) is used.
|
|
1842
|
+
const overrideUserId = typeof body.userId === 'string' && body.userId.length > 0 && body.userId.length <= 128
|
|
1843
|
+
? body.userId
|
|
1844
|
+
: undefined;
|
|
1845
|
+
// Task 626 — one-shot admin jobs (LinkedIn ingest, public session-end
|
|
1846
|
+
// review) carry their prompt as the session's first turn, the same
|
|
1847
|
+
// trailing-positional mechanism /public-spawn uses, and close after that
|
|
1848
|
+
// one assistant turn. `closeAfterTurn` only takes effect with a sessionId
|
|
1849
|
+
// so the JSONL watcher has a path to follow.
|
|
1850
|
+
const initialMessage = typeof body.initialMessage === 'string' && body.initialMessage.length > 0 ? body.initialMessage : null;
|
|
1851
|
+
const closeAfterTurn = body.closeAfterTurn === true && sessionId !== null;
|
|
1852
|
+
// Task 677 P2 — optional WhatsApp native-channel attach (admin path). All
|
|
1853
|
+
// three fields must be present strings or the attach is skipped.
|
|
1854
|
+
const waChannelRaw = body.waChannel;
|
|
1855
|
+
const waChannel = waChannelRaw !== null &&
|
|
1856
|
+
typeof waChannelRaw === 'object' &&
|
|
1857
|
+
typeof waChannelRaw.senderId === 'string' &&
|
|
1858
|
+
typeof waChannelRaw.gatewayUrl === 'string' &&
|
|
1859
|
+
typeof waChannelRaw.serverPath === 'string'
|
|
1860
|
+
? waChannelRaw
|
|
1861
|
+
: undefined;
|
|
1862
|
+
// Task 772 — optional webchat native-channel attach, the webchat twin of
|
|
1863
|
+
// waChannel. All three fields must be present strings or the attach is
|
|
1864
|
+
// skipped. A session is whatsapp XOR webchat, so at most one of the two
|
|
1865
|
+
// channel blocks below fires.
|
|
1866
|
+
const webchatChannelRaw = body.webchatChannel;
|
|
1867
|
+
const webchatChannel = webchatChannelRaw !== null &&
|
|
1868
|
+
typeof webchatChannelRaw === 'object' &&
|
|
1869
|
+
typeof webchatChannelRaw.key === 'string' &&
|
|
1870
|
+
typeof webchatChannelRaw.gatewayUrl === 'string' &&
|
|
1871
|
+
typeof webchatChannelRaw.serverPath === 'string'
|
|
1872
|
+
? webchatChannelRaw
|
|
1873
|
+
: undefined;
|
|
1874
|
+
// Task-962 — recover an already-live but unresponsive webchat session. When
|
|
1875
|
+
// set, the already-live branch classifies the child busy vs wedged and
|
|
1876
|
+
// respawns ONLY a wedged one (busy → idempotent-busy reply; not-live → a
|
|
1877
|
+
// no-op `live:false`). Carried only by the gateway's recovery pass.
|
|
1878
|
+
const recover = body.recover === true;
|
|
1879
|
+
// Task 724 — the bridge routes EVERY role=admin channel inbound here, not
|
|
1880
|
+
// just WhatsApp, and supplies the real channel (+ role, senderId) so the
|
|
1881
|
+
// classification sidecar below records the actual channel. The WaGateway
|
|
1882
|
+
// supplies channel:'whatsapp'; the one-shot admin jobs (LinkedIn ingest,
|
|
1883
|
+
// session-end review) supply no channel and get no sidecar. Task 852 widens
|
|
1884
|
+
// the accepted role to 'public' (authenticated-public WhatsApp person) and
|
|
1885
|
+
// the sidecar records the actual role.
|
|
1886
|
+
const rcRole = body.role === 'admin' || body.role === 'public' ? body.role : undefined;
|
|
1887
|
+
const adminChannel = typeof body.channel === 'string' && CHANNELS.includes(body.channel)
|
|
1888
|
+
? body.channel
|
|
1889
|
+
: undefined;
|
|
1890
|
+
const adminSenderId = typeof body.senderId === 'string' && body.senderId.length > 0 && body.senderId.length <= 256
|
|
1891
|
+
? body.senderId
|
|
1892
|
+
: undefined;
|
|
1893
|
+
// Task 983 — operator-selected target account. The admin shell sends the
|
|
1894
|
+
// active account uuid; the spawned session is scoped to it (ACCOUNT_ID /
|
|
1895
|
+
// ACCOUNT_DIR). Shape-gated to a v4 UUID; validated against the on-disk
|
|
1896
|
+
// registry below. Absent => default to the boot/house account.
|
|
1897
|
+
const requestedAccountId = typeof body.targetAccountId === 'string' && UUID_PATTERN.test(body.targetAccountId)
|
|
1898
|
+
? body.targetAccountId
|
|
1899
|
+
: undefined;
|
|
1900
|
+
if (sessionId !== null && !UUID_PATTERN.test(sessionId)) {
|
|
1901
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1902
|
+
return c.json({ error: 'sessionId must be a v4 UUID' }, 400);
|
|
1903
|
+
}
|
|
1904
|
+
// Task 983 — resolve the effective account. A requested target must exist in
|
|
1905
|
+
// the on-disk registry (a dir with account.json under data/accounts/); an
|
|
1906
|
+
// unknown id is REJECTED, never silently defaulted to house — a silent
|
|
1907
|
+
// default would route a switched session to the wrong account's graph. The
|
|
1908
|
+
// manager has no rootDir-clean import path for the account-enumeration lib,
|
|
1909
|
+
// so membership is checked inline by fs (mirrors the lib's predicate).
|
|
1910
|
+
const accountsRoot = join(dirname(deps.platformRoot), 'data', 'accounts');
|
|
1911
|
+
if (requestedAccountId !== undefined && !existsSync(join(accountsRoot, requestedAccountId, 'account.json'))) {
|
|
1912
|
+
deps.logger(`[spawn] op=account-reject sessionId=${sessionId ? sessionId.slice(0, 8) : 'new'} requested=${requestedAccountId} reason=not-in-registry`);
|
|
1913
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1914
|
+
return c.json({ error: 'targetAccountId not in this install registry' }, 400);
|
|
1915
|
+
}
|
|
1916
|
+
const effectiveAccountId = requestedAccountId ?? deps.accountId;
|
|
1917
|
+
// Task 876 — re-seat fork validation. The fork needs a pre-minted target
|
|
1918
|
+
// id that does NOT yet exist, a shape-valid model, and a source whose
|
|
1919
|
+
// transcript exists (history to copy). Any failure → 400, no spawn.
|
|
1920
|
+
if (forkFromSessionId !== null) {
|
|
1921
|
+
if (sessionId === null) {
|
|
1922
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1923
|
+
return c.json({ error: 're-seat requires a pre-minted sessionId' }, 400);
|
|
1924
|
+
}
|
|
1925
|
+
if (reseatModel === null) {
|
|
1926
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1927
|
+
return c.json({ error: 're-seat requires a valid model' }, 400);
|
|
1928
|
+
}
|
|
1929
|
+
if (!findExistingJsonlForSessionId(deps.claudeConfigDir, forkFromSessionId)) {
|
|
1930
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1931
|
+
return c.json({ error: 're-seat source has no transcript' }, 400);
|
|
1932
|
+
}
|
|
1933
|
+
if (findExistingJsonlForSessionId(deps.claudeConfigDir, sessionId)) {
|
|
1934
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1935
|
+
return c.json({ error: 're-seat target id already exists' }, 400);
|
|
1936
|
+
}
|
|
1937
|
+
// Task 928 — a present-but-disallowed mode/effort is a hard reject (no
|
|
1938
|
+
// spawn), not a silent drop, so a UI bug cannot land a fork on an
|
|
1939
|
+
// unintended lever.
|
|
1940
|
+
if (reseatPermissionMode === null) {
|
|
1941
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1942
|
+
return c.json({ error: 're-seat permissionMode is not allowed' }, 400);
|
|
1943
|
+
}
|
|
1944
|
+
if (reseatEffort === null) {
|
|
1945
|
+
timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
|
|
1946
|
+
return c.json({ error: 're-seat effort is not allowed' }, 400);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
// Task 896 — a plain resume (NOT a fork spawn) of a re-seated source id must
|
|
1950
|
+
// not start a second live process beside the fork. Resolve the marker chain
|
|
1951
|
+
// to the deepest live fork and redirect there. A stale marker (the fork's
|
|
1952
|
+
// JSONL is gone) is cleared and the resume proceeds normally.
|
|
1953
|
+
if (forkFromSessionId === null && sessionId) {
|
|
1954
|
+
// The fork must have a LIVE (non-archived) transcript to be a valid
|
|
1955
|
+
// redirect target. findExistingJsonlForSessionId also matches archive/, so
|
|
1956
|
+
// it would redirect to an archived dead-end; the live path is the check.
|
|
1957
|
+
const chain = resolveReseatChain(sessionsDir, sessionId, (id) => existsSync(jsonlPathForSessionId(deps.spawnCwd, id)));
|
|
1958
|
+
if (chain.redirected) {
|
|
1959
|
+
const fork = chain.target;
|
|
1960
|
+
const liveRow = deps.watcher.getBySessionId(fork);
|
|
1961
|
+
const bridgeSessionId = liveRow?.bridgeSessionId ?? `session_${fork}`;
|
|
1962
|
+
deps.logger(`[rc-spawn] op=reseat-redirect from=${sessionId.slice(0, 8)} to=${fork.slice(0, 8)} hops=${chain.hops.length}`);
|
|
1963
|
+
timed(deps.logger, 'POST', '/rc-spawn', 200, Date.now() - start);
|
|
1964
|
+
return c.json({ spawnedPid: liveRow?.pid ?? null, sessionId: fork, bridgeSessionId, slug: bridgeSessionId, outcome: 'reseated', reason: null, redirected: true }, 200);
|
|
1965
|
+
}
|
|
1966
|
+
if (chain.stale) {
|
|
1967
|
+
clearReseatMarker(sessionsDir, sessionId, deps.logger);
|
|
1968
|
+
deps.logger(`[rc-spawn] op=reseat-marker-stale sessionId=${sessionId.slice(0, 8)}`);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
// Task 702 — never run two processes on one sessionId. If we already own a
|
|
1972
|
+
// live PTY for this id, the spawn is a no-op (a bridge that lost its
|
|
1973
|
+
// in-memory index after a restart re-asks; the live PTY takes the next
|
|
1974
|
+
// /input). If a reattached survivor scope holds the id (status=detached, a
|
|
1975
|
+
// process this manager cannot own after its own restart and cannot feed
|
|
1976
|
+
// via /input), stop that scope first so the fresh --resume below is the
|
|
1977
|
+
// only process.
|
|
1978
|
+
// Task-962 — set on a wedged-child respawn so the spawn-success response
|
|
1979
|
+
// below reports the recovery verdict to the gateway.
|
|
1980
|
+
let recoverOutcome = null;
|
|
1981
|
+
if (sessionId) {
|
|
1982
|
+
if (recover) {
|
|
1983
|
+
// The gateway only asks to recover a session it believes is live. A
|
|
1984
|
+
// not-live target is the cold-start class (Tasks 782/813), out of scope
|
|
1985
|
+
// here: report and do nothing, so the gateway keeps its cold-start drop.
|
|
1986
|
+
if (!isLive(sessionId)) {
|
|
1987
|
+
deps.logger(`[rc-spawn] op=recover-skip sessionId=${sessionId.slice(0, 8)} reason=not-live`);
|
|
1988
|
+
timed(deps.logger, 'POST', '/rc-spawn', 200, Date.now() - start);
|
|
1989
|
+
return c.json({ live: false, sessionId, recovered: false }, 200);
|
|
1990
|
+
}
|
|
1991
|
+
const liveRow = deps.watcher.getBySessionId(sessionId);
|
|
1992
|
+
const jp = jsonlPathForSessionId(deps.spawnCwd, sessionId);
|
|
1993
|
+
let jsonlMtimeMs = null;
|
|
1994
|
+
try {
|
|
1995
|
+
jsonlMtimeMs = existsSync(jp) ? statSync(jp).mtimeMs : null;
|
|
1996
|
+
}
|
|
1997
|
+
catch {
|
|
1998
|
+
jsonlMtimeMs = null;
|
|
1999
|
+
}
|
|
2000
|
+
const klass = classifyLiveness({
|
|
2001
|
+
jsonlMtimeMs,
|
|
2002
|
+
status: liveRow?.status,
|
|
2003
|
+
updatedAt: liveRow?.updatedAt ?? 0,
|
|
2004
|
+
now: Date.now(),
|
|
2005
|
+
staleMs: finitePositive(process.env.WEBCHAT_WEDGE_STALE_MS, 20_000),
|
|
2006
|
+
});
|
|
2007
|
+
if (klass === 'busy') {
|
|
2008
|
+
// Making progress (or just slow): never kill mid-turn. The channel
|
|
2009
|
+
// server's 2s auto-reconnect will drain the queue once it frees up.
|
|
2010
|
+
deps.logger(`[rc-spawn] op=recover-busy sessionId=${sessionId.slice(0, 8)}`);
|
|
2011
|
+
timed(deps.logger, 'POST', '/rc-spawn', 200, Date.now() - start);
|
|
2012
|
+
return c.json({ live: true, classification: 'busy', recovered: false, sessionId }, 200);
|
|
2013
|
+
}
|
|
2014
|
+
// Wedged: stop the frozen child, then fall through to the resume path,
|
|
2015
|
+
// which re-binds the webchat channel (op=webchat-channel-rebind) so the
|
|
2016
|
+
// resumed child re-attaches and drains the queue. Stop unconditionally —
|
|
2017
|
+
// we are inside `isLive`, so stopSession resolves the live tracker and
|
|
2018
|
+
// stops via ITS scopeUnitToken; the `liveRow` fields are only the
|
|
2019
|
+
// post-restart row-scope fallback and may lag (null token) while the
|
|
2020
|
+
// tracker is healthy. Gating on `liveRow.scopeUnitToken` would skip the
|
|
2021
|
+
// kill in that window and lose the message (isLive would stay true → the
|
|
2022
|
+
// idempotent branch returns without recoverOutcome).
|
|
2023
|
+
deps.logger(`[rc-spawn] op=recover-respawn sessionId=${sessionId.slice(0, 8)} reason=wedged`);
|
|
2024
|
+
await stopSession({
|
|
2025
|
+
killGraceMs: deps.killGraceMs,
|
|
2026
|
+
logger: deps.logger,
|
|
2027
|
+
runSystemctl: deps.runSystemctl,
|
|
2028
|
+
rowScopeUnitToken: liveRow?.scopeUnitToken ?? undefined,
|
|
2029
|
+
rowPid: liveRow?.pid ?? null,
|
|
2030
|
+
}, sessionId);
|
|
2031
|
+
recoverOutcome = { live: true, classification: 'wedged', recovered: true };
|
|
2032
|
+
// Do NOT return — isLive is now false; the resume path below re-binds
|
|
2033
|
+
// the channel and the success response carries recoverOutcome.
|
|
2034
|
+
}
|
|
2035
|
+
if (isLive(sessionId)) {
|
|
2036
|
+
// Idempotent: no second process. The operator's Resume click still
|
|
2037
|
+
// needs to navigate to the running session, so return the same
|
|
2038
|
+
// navigable shape as a fresh spawn — the live session's bridgeSessionId
|
|
2039
|
+
// is its claude.ai/code slug. Without this the UI sees a 200 with no
|
|
2040
|
+
// slug and renders a spurious resume-failed modal.
|
|
2041
|
+
const liveRow = deps.watcher.getBySessionId(sessionId);
|
|
2042
|
+
const bridgeSessionId = liveRow?.bridgeSessionId ?? `session_${sessionId}`;
|
|
2043
|
+
deps.logger(`[rc-spawn] op=reconcile-idempotent sessionId=${sessionId.slice(0, 8)} reason=already-live slug=${bridgeSessionId}`);
|
|
2044
|
+
timed(deps.logger, 'POST', '/rc-spawn', 200, Date.now() - start);
|
|
2045
|
+
return c.json({ spawnedPid: liveRow?.pid ?? null, sessionId, bridgeSessionId, slug: bridgeSessionId, outcome: 'bound', reason: null, reused: true }, 200);
|
|
2046
|
+
}
|
|
2047
|
+
const detached = deps.watcher.getBySessionId(sessionId);
|
|
2048
|
+
if (detached && detached.status === 'detached' && detached.scopeUnitToken) {
|
|
2049
|
+
deps.logger(`[rc-spawn] op=reconcile-stop-survivor sessionId=${sessionId.slice(0, 8)} unitToken=${detached.scopeUnitToken}`);
|
|
2050
|
+
await stopSession({
|
|
2051
|
+
killGraceMs: deps.killGraceMs,
|
|
2052
|
+
logger: deps.logger,
|
|
2053
|
+
runSystemctl: deps.runSystemctl,
|
|
2054
|
+
rowScopeUnitToken: detached.scopeUnitToken,
|
|
2055
|
+
rowPid: detached.pid,
|
|
2056
|
+
}, sessionId);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
// Task 547 — when a JSONL already exists for the requested sessionId,
|
|
2060
|
+
// resume the existing conversation instead of forking a fresh one
|
|
2061
|
+
// under the same id. `--session-id` is claude's fresh-spawn flag;
|
|
2062
|
+
// `--resume` is the continue-this-conversation flag.
|
|
2063
|
+
const existingJsonlPath = sessionId ? findExistingJsonlForSessionId(deps.claudeConfigDir, sessionId) : null;
|
|
2064
|
+
const mode = existingJsonlPath ? 'resume' : 'fresh';
|
|
2065
|
+
// Task 969 — the new-session picker's model/effort apply only to a genuinely
|
|
2066
|
+
// fresh ADMIN spawn (the /chat popover posts role:'admin'). Gating on the
|
|
2067
|
+
// admin role as well as freshness keeps any other fresh spawn (LinkedIn
|
|
2068
|
+
// ingest, public, specialist, channel cold-start) on the settings defaults
|
|
2069
|
+
// even if a future caller were to put model/effort on its body.
|
|
2070
|
+
const freshAdminLevers = mode === 'fresh' && rcRole === 'admin';
|
|
2071
|
+
const argv = ['--remote-control'];
|
|
2072
|
+
// Task 945 — `name` is the row's display label, never a prompt. It must NOT
|
|
2073
|
+
// be pushed as a positional: the CLI treats a bare positional as the initial
|
|
2074
|
+
// prompt, so a long label (e.g. a first-message-derived title) became a
|
|
2075
|
+
// multi-kilobyte prompt and the remote-control bind timed out. The sole
|
|
2076
|
+
// positional is `initialMessage` (pushed below). `name` stays in the request
|
|
2077
|
+
// body and the log lines for observability only.
|
|
2078
|
+
// Task 889 — append-system-prompt segments are accumulated and pushed once
|
|
2079
|
+
// (below, after channel resolution) so the re-seat model line and the
|
|
2080
|
+
// authenticated-identity line share a single flag.
|
|
2081
|
+
const appendSegments = [];
|
|
2082
|
+
// Task 876 — a re-seat forks the source onto the pre-minted target id; the
|
|
2083
|
+
// ordinary fresh/resume single-id push is replaced by the fork segment.
|
|
2084
|
+
if (forkFromSessionId !== null && reseatModel !== null && sessionId) {
|
|
2085
|
+
argv.push(...forkArgvSegment(forkFromSessionId, sessionId, reseatModel));
|
|
2086
|
+
// Task 928 — the picked permission mode rides the fork as the canonical CLI
|
|
2087
|
+
// flag (the same flag the daemon spawn uses). Absent => the fork keeps the
|
|
2088
|
+
// settings-resolved mode, unchanged from a model-only re-seat.
|
|
2089
|
+
if (reseatPermissionMode)
|
|
2090
|
+
argv.push('--permission-mode', reseatPermissionMode);
|
|
2091
|
+
// Task 879 — authoritative current-model signal for the fork only.
|
|
2092
|
+
appendSegments.push(reseatIdentityPrompt(reseatModel));
|
|
2093
|
+
}
|
|
2094
|
+
else if (sessionId) {
|
|
2095
|
+
argv.push(mode === 'resume' ? '--resume' : '--session-id', sessionId);
|
|
2096
|
+
// Task 969 — a fresh new-session spawn (the /chat new-session popover)
|
|
2097
|
+
// carries the picked model as the canonical --model flag. A resume keeps
|
|
2098
|
+
// the model its JSONL already ran under, and an absent/invalid model
|
|
2099
|
+
// (reseatModel null) leaves the settings.json default model in force.
|
|
2100
|
+
if (freshAdminLevers && reseatModel)
|
|
2101
|
+
argv.push('--model', reseatModel);
|
|
2102
|
+
}
|
|
2103
|
+
// Task 592 — per-spawn bypass-permissions waiver. The brand settings.json
|
|
2104
|
+
// carries `defaultMode: bypassPermissions` (Task 583); without this flag
|
|
2105
|
+
// the first-time "WARNING: … 1. No, exit 2. Yes, I accept" disclaimer
|
|
2106
|
+
// hangs the spawn and times out waitForPid. Both documented skip keys are
|
|
2107
|
+
// waived so the disclaimer is suppressed whatever mode the session resolves
|
|
2108
|
+
// to. Per Task 574 doctrine the waiver is per-spawn (never written into
|
|
2109
|
+
// settings.json / .claude.json, which would permanently waive it).
|
|
2110
|
+
// Task 928 (fork) / Task 969/970 (fresh new-session) — the picked effort rides
|
|
2111
|
+
// the per-spawn inline settings (never the shared settings.json — that would
|
|
2112
|
+
// change every later spawn's effort fleet-wide), EXCEPT the fresh-path `max`
|
|
2113
|
+
// pick: `max` is session-only and invalid as a settings.json `effortLevel`
|
|
2114
|
+
// (the binary silently ignores it), so it must reach the CLI via the
|
|
2115
|
+
// `--effort max` argv flag. A fork keeps its 4-level effort on the inline path
|
|
2116
|
+
// (max is never offered there); a resume keeps its settings-resolved effort.
|
|
2117
|
+
const inlineSettings = { skipDangerousModePermissionPrompt: true, skipAutoPermissionPrompt: true };
|
|
2118
|
+
if (forkFromSessionId !== null) {
|
|
2119
|
+
if (reseatEffort)
|
|
2120
|
+
inlineSettings.effortLevel = reseatEffort;
|
|
2121
|
+
}
|
|
2122
|
+
else if (freshAdminLevers && freshEffort) {
|
|
2123
|
+
if (freshEffort === 'max')
|
|
2124
|
+
argv.push('--effort', 'max');
|
|
2125
|
+
else
|
|
2126
|
+
inlineSettings.effortLevel = freshEffort;
|
|
2127
|
+
}
|
|
2128
|
+
argv.push('--settings', JSON.stringify(inlineSettings));
|
|
2129
|
+
// Task 677 P2 — admin WhatsApp native channel. When the caller supplies
|
|
2130
|
+
// waChannel, register the per-sender channel server in its own --mcp-config
|
|
2131
|
+
// (additive; rc-spawn carries no --strict-mcp-config) and activate it as a
|
|
2132
|
+
// development channel. Inbound WhatsApp then arrives as a `<channel
|
|
2133
|
+
// source="whatsapp">` event and the agent replies via the channel `reply`
|
|
2134
|
+
// tool — no keystroke injection. Pushed before the trailing positional.
|
|
2135
|
+
// Task 683 — resolve the effective binding. The gateway `/rc-spawn` supplies
|
|
2136
|
+
// waChannel and we write it through to the store; any later resume (operator
|
|
2137
|
+
// / PIN / manager) omits it, so we read the binding back. Either way the same
|
|
2138
|
+
// per-session --mcp-config + development-channels argv is injected, so
|
|
2139
|
+
// `mcp__whatsapp-channel__reply` is present on every live PTY for the session.
|
|
2140
|
+
// Task 850 — resolve the effective binding for EACH kind (no XOR). A gateway
|
|
2141
|
+
// /rc-spawn supplies waChannel/webchatChannel and we write it through; a bare
|
|
2142
|
+
// resume reads it back. The old whatsapp-XOR-webchat refusal is removed: a
|
|
2143
|
+
// session may now be bound to BOTH kinds (one :Person reachable on phone and
|
|
2144
|
+
// web), and the two are fanned by one unified channel server below.
|
|
2145
|
+
let effectiveWaChannel;
|
|
2146
|
+
let effectiveWebchatChannel;
|
|
2147
|
+
if (sessionId) {
|
|
2148
|
+
if (waChannel) {
|
|
2149
|
+
effectiveWaChannel = waChannel;
|
|
2150
|
+
deps.waChannelStore.set(sessionId, waChannel);
|
|
2151
|
+
}
|
|
2152
|
+
else {
|
|
2153
|
+
const stored = deps.waChannelStore.get(sessionId);
|
|
2154
|
+
if (stored) {
|
|
2155
|
+
effectiveWaChannel = { senderId: stored.senderId, gatewayUrl: stored.gatewayUrl, serverPath: stored.serverPath };
|
|
2156
|
+
deps.logger(`[rc-spawn] op=wa-channel-rebind sessionId=${sessionId.slice(0, 8)} senderId=${stored.senderId} source=store`);
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
if (webchatChannel) {
|
|
2160
|
+
effectiveWebchatChannel = webchatChannel;
|
|
2161
|
+
deps.webchatChannelStore?.set(sessionId, webchatChannel);
|
|
2162
|
+
}
|
|
2163
|
+
else {
|
|
2164
|
+
const stored = deps.webchatChannelStore?.get(sessionId);
|
|
2165
|
+
if (stored) {
|
|
2166
|
+
effectiveWebchatChannel = { key: stored.key, gatewayUrl: stored.gatewayUrl, serverPath: stored.serverPath };
|
|
2167
|
+
deps.logger(`[rc-spawn] op=webchat-channel-rebind sessionId=${sessionId.slice(0, 8)} key=${stored.key} source=store`);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
// Task 933 — read the persisted sidecar once so the identity gate below can
|
|
2172
|
+
// resolve role + name + adminUserId from disk when the caller omitted them
|
|
2173
|
+
// (a channel-driven resume passes only sessionId). Missing/unparseable
|
|
2174
|
+
// yields null; the gate degrades to the not-resolvable identity form. Only
|
|
2175
|
+
// the webchat identity gate + name-refresh consume it, so the read (and its
|
|
2176
|
+
// log line) is scoped to a webchat-bound session — every other resume path
|
|
2177
|
+
// skips the disk touch.
|
|
2178
|
+
const priorSidecar = sessionId && effectiveWebchatChannel
|
|
2179
|
+
? readSidecar(sidecarPathForSessionId(deps.spawnCwd, sessionId), deps.logger).sidecar
|
|
2180
|
+
: null;
|
|
2181
|
+
// Task 850 — assemble the bound target set and choose the channel server:
|
|
2182
|
+
// - ≥2 kinds: ONE unified `channel` server (one reply tool fanning to every
|
|
2183
|
+
// target's existing gateway endpoint). The mature per-kind servers are
|
|
2184
|
+
// untouched for single-target sessions.
|
|
2185
|
+
// - 1 kind: the existing per-kind server, unchanged.
|
|
2186
|
+
// waPath/webchatPath are the "is this kind carried on the PTY" signals the
|
|
2187
|
+
// standing binding-lost invariant below reads; the unified server carries
|
|
2188
|
+
// both, so both paths are set to the unified config path.
|
|
2189
|
+
let targetSet = {};
|
|
2190
|
+
if (effectiveWaChannel)
|
|
2191
|
+
targetSet = mergeTarget(targetSet, { kind: 'whatsapp', ...effectiveWaChannel });
|
|
2192
|
+
if (effectiveWebchatChannel)
|
|
2193
|
+
targetSet = mergeTarget(targetSet, { kind: 'webchat', ...effectiveWebchatChannel });
|
|
2194
|
+
let waPath = null;
|
|
2195
|
+
let webchatPath = null;
|
|
2196
|
+
if (sessionId && isMultiTarget(targetSet)) {
|
|
2197
|
+
const unifiedServers = buildChannelMcpServers({ sessionId, targets: targetSet });
|
|
2198
|
+
const unifiedPath = channelMcpConfigPath(sessionId, tmpdir());
|
|
2199
|
+
try {
|
|
2200
|
+
writeFileSync(unifiedPath, JSON.stringify({ mcpServers: unifiedServers }, null, 2), 'utf8');
|
|
2201
|
+
argv.push(...buildChannelArgv(unifiedPath));
|
|
2202
|
+
waPath = unifiedPath;
|
|
2203
|
+
webchatPath = unifiedPath;
|
|
2204
|
+
deps.logger(`[rc-spawn] op=channel-unified sessionId=${sessionId.slice(0, 8)} bound=[${targetKinds(targetSet).join(',')}] path=${unifiedPath}`);
|
|
2205
|
+
}
|
|
2206
|
+
catch (err) {
|
|
2207
|
+
deps.logger(`[rc-spawn] op=channel-unified-write-failed err=${JSON.stringify(err instanceof Error ? err.message : String(err))}`);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
else {
|
|
2211
|
+
if (effectiveWaChannel && sessionId) {
|
|
2212
|
+
const waServers = buildWaChannelMcpServers({
|
|
2213
|
+
sessionId,
|
|
2214
|
+
senderId: effectiveWaChannel.senderId,
|
|
2215
|
+
gatewayUrl: effectiveWaChannel.gatewayUrl,
|
|
2216
|
+
serverPath: effectiveWaChannel.serverPath,
|
|
2217
|
+
});
|
|
2218
|
+
waPath = waChannelMcpConfigPath(sessionId, tmpdir());
|
|
2219
|
+
try {
|
|
2220
|
+
writeFileSync(waPath, JSON.stringify({ mcpServers: waServers }, null, 2), 'utf8');
|
|
2221
|
+
argv.push(...buildWaChannelArgv(waPath));
|
|
2222
|
+
deps.logger(`[rc-spawn] op=wa-channel senderId=${effectiveWaChannel.senderId} gateway=${effectiveWaChannel.gatewayUrl} path=${waPath}`);
|
|
2223
|
+
}
|
|
2224
|
+
catch (err) {
|
|
2225
|
+
waPath = null;
|
|
2226
|
+
deps.logger(`[rc-spawn] op=wa-channel-write-failed err=${JSON.stringify(err instanceof Error ? err.message : String(err))}`);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (effectiveWebchatChannel && sessionId) {
|
|
2230
|
+
const webchatServers = buildWebchatChannelMcpServers({
|
|
2231
|
+
sessionId,
|
|
2232
|
+
key: effectiveWebchatChannel.key,
|
|
2233
|
+
gatewayUrl: effectiveWebchatChannel.gatewayUrl,
|
|
2234
|
+
serverPath: effectiveWebchatChannel.serverPath,
|
|
2235
|
+
});
|
|
2236
|
+
webchatPath = webchatChannelMcpConfigPath(sessionId, tmpdir());
|
|
2237
|
+
try {
|
|
2238
|
+
writeFileSync(webchatPath, JSON.stringify({ mcpServers: webchatServers }, null, 2), 'utf8');
|
|
2239
|
+
argv.push(...buildWebchatChannelArgv(webchatPath));
|
|
2240
|
+
deps.logger(`[rc-spawn] op=webchat-channel key=${effectiveWebchatChannel.key} gateway=${effectiveWebchatChannel.gatewayUrl} path=${webchatPath}`);
|
|
2241
|
+
}
|
|
2242
|
+
catch (err) {
|
|
2243
|
+
webchatPath = null;
|
|
2244
|
+
deps.logger(`[rc-spawn] op=webchat-channel-write-failed err=${JSON.stringify(err instanceof Error ? err.message : String(err))}`);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
// Task 889 — a webchat-bound admin rc session is the /chat admin surface.
|
|
2249
|
+
// Inject the authenticated-identity line (resolved name, or the explicit
|
|
2250
|
+
// not-resolvable form) so the agent states who it is talking to instead of
|
|
2251
|
+
// guessing the account email. Gated on the webchat binding + admin role so
|
|
2252
|
+
// public visitor spawns and the one-shot admin jobs are untouched. The
|
|
2253
|
+
// breadcrumb makes a silent resolution regression visible without a chat.
|
|
2254
|
+
//
|
|
2255
|
+
// Task 933 — make the gate caller-independent. A channel-driven resume
|
|
2256
|
+
// recovers the webchat binding from the store but passes no role/name, so
|
|
2257
|
+
// the body-only gate used to skip injection and the resumed agent ran with
|
|
2258
|
+
// no identity. The admin role and the resolved name are now derived from
|
|
2259
|
+
// the persisted sidecar when the body omits them; `source` records whether
|
|
2260
|
+
// the identity came from the caller (body) or from disk (sidecar).
|
|
2261
|
+
const adminBinding = rcRole === 'admin' || priorSidecar?.role === 'admin';
|
|
2262
|
+
if (effectiveWebchatChannel && adminBinding) {
|
|
2263
|
+
const resolvedName = authenticatedName ?? priorSidecar?.authenticatedName ?? null;
|
|
2264
|
+
const resolvedAdminUserId = adminUserId ?? priorSidecar?.adminUserId ?? null;
|
|
2265
|
+
// `source` follows where the resolved name actually came from. When no
|
|
2266
|
+
// name resolves (resolved=0) it reports which signal marked the session
|
|
2267
|
+
// admin: the caller's body role, else the persisted sidecar.
|
|
2268
|
+
const identitySource = authenticatedName
|
|
2269
|
+
? 'body'
|
|
2270
|
+
: priorSidecar?.authenticatedName
|
|
2271
|
+
? 'sidecar'
|
|
2272
|
+
: rcRole === 'admin'
|
|
2273
|
+
? 'body'
|
|
2274
|
+
: 'sidecar';
|
|
2275
|
+
appendSegments.push(authenticatedIdentityPrompt(resolvedName));
|
|
2276
|
+
deps.logger(`[rc-spawn] op=identity-injected userId=${resolvedAdminUserId ? resolvedAdminUserId.slice(0, 8) : 'none'} resolved=${resolvedName ? 1 : 0} source=${identitySource}`);
|
|
2277
|
+
}
|
|
2278
|
+
if (appendSegments.length > 0) {
|
|
2279
|
+
argv.push('--append-system-prompt', appendSegments.join('\n\n'));
|
|
2280
|
+
}
|
|
2281
|
+
// Task 626 — the initial message is the trailing positional, processed as
|
|
2282
|
+
// the session's first user turn at PTY startup. One-shot jobs omit `name`
|
|
2283
|
+
// so the prompt is the sole positional.
|
|
2284
|
+
if (initialMessage)
|
|
2285
|
+
argv.push(initialMessage);
|
|
2286
|
+
// Task 606 — thread the validated per-session sessionId (fresh and resume
|
|
2287
|
+
// share the one var) so session-linked writes resolve SESSION_ID; logDir
|
|
2288
|
+
// so the child's MCP stderr-tee writes its readable per-server log.
|
|
2289
|
+
const env = buildRcChildEnv({
|
|
2290
|
+
accountId: effectiveAccountId,
|
|
2291
|
+
userId: overrideUserId ?? deps.userId,
|
|
2292
|
+
sessionId: sessionId ?? undefined,
|
|
2293
|
+
uiPort: process.env.MAXY_UI_INTERNAL_PORT ?? '',
|
|
2294
|
+
platformRoot: deps.platformRoot,
|
|
2295
|
+
claudeConfigDir: deps.claudeConfigDir,
|
|
2296
|
+
logDir: deps.logDir,
|
|
2297
|
+
brandedNeo4jUri: process.env.NEO4J_URI ?? '',
|
|
2298
|
+
brandedNeo4jPassword: process.env.NEO4J_PASSWORD ?? '',
|
|
2299
|
+
sliceToken,
|
|
2300
|
+
});
|
|
2301
|
+
// Task 983 — account-resolved lifeline, emitted before the child starts so a
|
|
2302
|
+
// grep on one sessionId shows where the spawn landed. requested==resolved
|
|
2303
|
+
// (or default=true when none requested) is success; the reject path above
|
|
2304
|
+
// logs op=account-reject and never reaches here.
|
|
2305
|
+
deps.logger(`[spawn] op=account-resolved sessionId=${sessionId ? sessionId.slice(0, 8) : 'new'} requested=${requestedAccountId ?? ''} resolved=${effectiveAccountId} dir=${env.ACCOUNT_DIR} default=${requestedAccountId === undefined}`);
|
|
2306
|
+
// Task 606 — standing startup signal: confirms per-spawn whether the
|
|
2307
|
+
// child env carries a session id. `mode=new` when none was requested
|
|
2308
|
+
// (CLI fresh-spawn), else the resolved fresh/resume.
|
|
2309
|
+
const childEnvMode = sessionId === null ? 'new' : mode;
|
|
2310
|
+
deps.logger(`[claude-session-manager] rc-child-env sessionId-present=${sessionId ? 'yes' : 'no'} mode=${childEnvMode}`);
|
|
2311
|
+
const unitToken = `rc-resume-${randomUUID()}`;
|
|
2312
|
+
const sessionIdForLog = sessionId ? sessionId.slice(0, 8) : 'new';
|
|
2313
|
+
const rcLifeMode = mode === 'resume' ? 'resume' : 'new';
|
|
2314
|
+
// Step 1 — request received, before any spawn work. The argv-resolved
|
|
2315
|
+
// line (step 2) emits next, so a 500 between them isolates resolution
|
|
2316
|
+
// failures from spawn failures.
|
|
2317
|
+
deps.logger(`[rc-spawn] op=request unitToken=${unitToken} sessionId=${sessionIdForLog} name=${name ?? 'none'} mode=${mode} jsonl=${existingJsonlPath ?? 'none'} initialMessage=${initialMessage ? Buffer.byteLength(initialMessage, 'utf8') + 'b' : 'none'} closeAfterTurn=${closeAfterTurn}`);
|
|
2318
|
+
// Cross-arm schema mirror so `grep '[rc-life]'` covers rc-spawn and
|
|
2319
|
+
// rc-daemon under one shape.
|
|
2320
|
+
emitRcLife(deps.logger, 'request', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2321
|
+
sessionId: sessionId ?? 'new',
|
|
2322
|
+
name: name ?? 'none',
|
|
2323
|
+
existingJsonl: existingJsonlPath ?? 'none',
|
|
2324
|
+
});
|
|
2325
|
+
// Task 798 — the mode this session actually runs under. rc-spawn argv
|
|
2326
|
+
// carries no --permission-mode, so the binary resolves
|
|
2327
|
+
// settings.json permissions.defaultMode (else 'default'); mirror that
|
|
2328
|
+
// resolution for the classification sidecar and the lifeline.
|
|
2329
|
+
const settingsPermissionMode = resolveSettingsPermissionMode(deps.claudeConfigDir);
|
|
2330
|
+
// Task 928 — when the fork carries a picked mode, the argv flag governs (not
|
|
2331
|
+
// settings.json), so the lifeline and the sidecar must report the picked mode.
|
|
2332
|
+
const effectiveRcPermissionMode = forkFromSessionId !== null && reseatPermissionMode ? reseatPermissionMode : settingsPermissionMode;
|
|
2333
|
+
// Task 956 — the model/effort the rc session actually runs under. A non-fork
|
|
2334
|
+
// admin spawn carries no --model/effort argv, so the binary reads
|
|
2335
|
+
// settings.json (pinned to Opus/medium by the rc-daemon); a fork rides its
|
|
2336
|
+
// picked values. Surfaced on the lifeline so the admin-param audit can assert
|
|
2337
|
+
// model=claude-opus-4-8[1m] effort=medium without reconstructing the argv.
|
|
2338
|
+
// Task 969 — a fresh new-session spawn carrying picked levers runs under
|
|
2339
|
+
// them too (not just a fork), so the sidecar + lifeline + the /chat params
|
|
2340
|
+
// row report the model/effort the session actually launched on.
|
|
2341
|
+
const effectiveRcModel = (forkFromSessionId !== null || freshAdminLevers) && reseatModel ? reseatModel : resolveSettingsModel(deps.claudeConfigDir);
|
|
2342
|
+
// Task 970 — the fork path reports its 4-level effort; the fresh path reports
|
|
2343
|
+
// its 5-level pick (incl. `max`). Falls back to the settings-resolved effort
|
|
2344
|
+
// when neither path carries one (absent on a fork, invalid/absent on a fresh).
|
|
2345
|
+
const pickedRcEffort = forkFromSessionId !== null ? reseatEffort : freshAdminLevers ? freshEffort : undefined;
|
|
2346
|
+
const effectiveRcEffort = pickedRcEffort ?? resolveSettingsEffort(deps.claudeConfigDir);
|
|
2347
|
+
// Step 2 — the exact claude argv (the inner command). The systemd-run
|
|
2348
|
+
// wrap is composed by the spawnPty adapter; logging the inner argv
|
|
2349
|
+
// here is enough for an operator to reproduce by hand. The wrapped
|
|
2350
|
+
// argv is fully reconstructible from this line + the spawn adapter
|
|
2351
|
+
// source (Task 250 / 556).
|
|
2352
|
+
// Task 945 — record the byte count of the sole positional actually placed in
|
|
2353
|
+
// argv (the trailing `initialMessage`, else 0) so a future oversized positional
|
|
2354
|
+
// is visible without reconstructing it from the full argv dump.
|
|
2355
|
+
const positionalBytes = initialMessage ? Buffer.byteLength(initialMessage, 'utf8') : 0;
|
|
2356
|
+
deps.logger(`[rc-spawn] op=argv unitToken=${unitToken} cwd=${deps.spawnCwd} permissionMode=${effectiveRcPermissionMode} model=${effectiveRcModel ?? 'unset'} effort=${effectiveRcEffort ?? 'unset'} positionalBytes=${positionalBytes} argv=${JSON.stringify([deps.claudeBin, ...argv])}`);
|
|
2357
|
+
emitRcLife(deps.logger, 'argv', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2358
|
+
cwd: deps.spawnCwd,
|
|
2359
|
+
argv: JSON.stringify([deps.claudeBin, ...argv]),
|
|
2360
|
+
});
|
|
2361
|
+
let pty;
|
|
2362
|
+
try {
|
|
2363
|
+
pty = deps.spawnPty(deps.claudeBin, argv, env, unitToken);
|
|
2364
|
+
}
|
|
2365
|
+
catch (err) {
|
|
2366
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2367
|
+
deps.logger(`[sessions-rc-resume] spawn-failed sessionId=${sessionId ?? 'new'} name=${name ?? 'none'} err=${msg}`);
|
|
2368
|
+
deps.logger(`[rc-spawn] op=spawn-failed unitToken=${unitToken} err=${JSON.stringify(msg)}`);
|
|
2369
|
+
timed(deps.logger, 'POST', '/rc-spawn', 500, Date.now() - start);
|
|
2370
|
+
// Task 576 — same auth-aware reason as /spawn so the resume path
|
|
2371
|
+
// surfaces auth death too, not only spawn-time failures.
|
|
2372
|
+
const authSnap = snapshotAuthForFailureReason(credentialsPathForConfigDir(deps.claudeConfigDir));
|
|
2373
|
+
const reason = authSnap === 'dead' || authSnap === 'expired' ? 'auth-refresh-failed' : msg;
|
|
2374
|
+
if (reason === 'auth-refresh-failed') {
|
|
2375
|
+
deps.logger(`[rc-spawn] op=auth-refresh-failed authStatus=${authSnap} unitToken=${unitToken}`);
|
|
2376
|
+
}
|
|
2377
|
+
// Task 648 — tie the 500 to the same resume-response decision line the
|
|
2378
|
+
// success/timeout paths emit, so one grep covers every spawn outcome.
|
|
2379
|
+
deps.logger(`[rc-spawn] op=resume-response sessionId=${sessionId ?? 'none'} slug=none outcome=spawn-failed reason=${JSON.stringify(reason)}`);
|
|
2380
|
+
return c.json({ error: msg, reason, authStatus: authSnap }, 500);
|
|
2381
|
+
}
|
|
2382
|
+
// Step 3 — PTY spawned. fd baseline at this instant; the fd-release
|
|
2383
|
+
// line later in the lifecycle is read relative to this value.
|
|
2384
|
+
deps.logger(`[rc-spawn] op=pty-spawned unitToken=${unitToken} pid=${pty.pid} openFds=${openFdCount()}`);
|
|
2385
|
+
emitRcLife(deps.logger, 'spawned', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2386
|
+
pid: pty.pid,
|
|
2387
|
+
managerOpenFds: openFdCount(),
|
|
2388
|
+
});
|
|
2389
|
+
// Task 683 — standing invariant. A bound session whose live PTY was spawned
|
|
2390
|
+
// without the channel mcp-config is the silent-revert state (the reply tool
|
|
2391
|
+
// is absent, the agent falls back to whatsapp-send). The resume read-back
|
|
2392
|
+
// makes the resume-without-binding case impossible, so this now fires only
|
|
2393
|
+
// when the mcp-config write itself failed (waPath reset to null) — it
|
|
2394
|
+
// verifies the post-condition (PTY actually carries the channel) rather than
|
|
2395
|
+
// the intent to spawn it.
|
|
2396
|
+
if (sessionId && deps.waChannelStore.get(sessionId) && waPath === null) {
|
|
2397
|
+
deps.logger(`[rc-spawn] op=channel-binding-lost sessionId=${sessionId} pid=${pty.pid} reason=resume-without-mcp-config`);
|
|
2398
|
+
}
|
|
2399
|
+
// Task 772 — the same post-condition for the webchat binding.
|
|
2400
|
+
if (sessionId && deps.webchatChannelStore?.get(sessionId) && webchatPath === null) {
|
|
2401
|
+
deps.logger(`[rc-spawn] op=webchat-channel-binding-lost sessionId=${sessionId} pid=${pty.pid} reason=resume-without-mcp-config`);
|
|
2402
|
+
}
|
|
2403
|
+
// Tracker registration — closes the leak gap the Task 552 path opened.
|
|
2404
|
+
// For fresh spawns without a caller-supplied sessionId we register the
|
|
2405
|
+
// tracker under the unitToken so the entry has a stable key; the
|
|
2406
|
+
// operator-visible sessionId only becomes known when claude writes its
|
|
2407
|
+
// pid file. Both keys are equally good for fd-ownership purposes.
|
|
2408
|
+
const trackerKey = sessionId ?? `rc-${unitToken}`;
|
|
2409
|
+
const tracker = registerRcSpawnPty({ logger: deps.logger }, trackerKey, pty, unitToken);
|
|
2410
|
+
// Task 702 — persist the reattach hint so a manager restart adopts this
|
|
2411
|
+
// scope instead of orphan-killing it. /spawn persists this via its sidecar;
|
|
2412
|
+
// the Task 721/724 classification sidecar below carries scopeUnitToken too,
|
|
2413
|
+
// but only for channel-admin spawns, so /rc-spawn writes the record here for
|
|
2414
|
+
// every resumable session. Only resumable sessions (a caller-supplied
|
|
2415
|
+
// sessionId) have a stable id worth reattaching.
|
|
2416
|
+
if (sessionId)
|
|
2417
|
+
writeScopeRecord(sessionsDir, sessionId, unitToken, deps.logger);
|
|
2418
|
+
// Task 721 / Task 724 — the WhatsApp reader, the sidebar channel badge, and
|
|
2419
|
+
// archive classification read a live session's channel ONLY from its
|
|
2420
|
+
// <sessionId>.meta.json sidecar (role:admin, channel:<channel>). /spawn
|
|
2421
|
+
// writes that sidecar for the public path; channel-admin sessions never use
|
|
2422
|
+
// /spawn — they land here via /rc-spawn — so /rc-spawn must write it too.
|
|
2423
|
+
// Task 721 wrote it only for the WhatsApp case (keyed on effectiveWaChannel);
|
|
2424
|
+
// Task 724 generalizes it: the bridge routes EVERY role=admin channel inbound
|
|
2425
|
+
// here and supplies the real channel, so write the sidecar for any admin
|
|
2426
|
+
// channel, not one at a time. The channel comes from the body (the bridge and
|
|
2427
|
+
// the WaGateway both supply it); senderId comes from the body, or for the
|
|
2428
|
+
// WhatsApp gateway path that carries it inside waChannel, from
|
|
2429
|
+
// effectiveWaChannel. The one-shot admin jobs (LinkedIn ingest, session-end
|
|
2430
|
+
// review) supply no channel and are correctly skipped — they are role:admin
|
|
2431
|
+
// but not channel conversations. Write-once: a resume already has the sidecar
|
|
2432
|
+
// (url filled by url-capture, bridgeIds appended by Task 550); overwriting
|
|
2433
|
+
// would wipe both (the single-writer note in session-sidecar.ts), so skip
|
|
2434
|
+
// when one exists. Non-fatal: the PTY here is already serving a live thread —
|
|
2435
|
+
// a failed classification sidecar must not tear it down, so it logs and the
|
|
2436
|
+
// session keeps running (the pre-fix reader-blind behaviour, no worse).
|
|
2437
|
+
const classifyChannel = rcRole !== undefined ? adminChannel : undefined;
|
|
2438
|
+
const classifySenderId = adminSenderId ?? effectiveWaChannel?.senderId ?? effectiveWebchatChannel?.key;
|
|
2439
|
+
if (sessionId && classifyChannel && classifySenderId) {
|
|
2440
|
+
const classifySidecarPath = sidecarPathForSessionId(deps.spawnCwd, sessionId);
|
|
2441
|
+
if (!existsSync(classifySidecarPath)) {
|
|
2442
|
+
try {
|
|
2443
|
+
writeSidecar(classifySidecarPath, {
|
|
2444
|
+
senderId: classifySenderId,
|
|
2445
|
+
// Task 852 — the actual role from the body ('admin' | 'public'),
|
|
2446
|
+
// not a hardcoded 'admin'; rcRole is defined whenever
|
|
2447
|
+
// classifyChannel is.
|
|
2448
|
+
role: rcRole,
|
|
2449
|
+
channel: classifyChannel,
|
|
2450
|
+
url: null,
|
|
2451
|
+
startedAt: new Date().toISOString(),
|
|
2452
|
+
// Task 798 — settings-resolved (rc-spawn has no operator mode
|
|
2453
|
+
// choice); the /chat chip renders this. effectivePermissionMode
|
|
2454
|
+
// stays null: the Task 278 tail is auto-only and rc-spawn
|
|
2455
|
+
// passes no --debug=auto-mode.
|
|
2456
|
+
permissionMode: effectiveRcPermissionMode,
|
|
2457
|
+
effectivePermissionMode: null,
|
|
2458
|
+
model: null,
|
|
2459
|
+
hidden: false,
|
|
2460
|
+
specialist: null,
|
|
2461
|
+
scopeUnitToken: unitToken,
|
|
2462
|
+
bridgeIds: [],
|
|
2463
|
+
// Task 863 — visitor identity from the rc-spawn body (public
|
|
2464
|
+
// path); null for channel-admin sessions, which carry none.
|
|
2465
|
+
personId: personId ?? null,
|
|
2466
|
+
// Task 865 — admin-webchat author identity from the rc-spawn body;
|
|
2467
|
+
// null for public and one-shot sessions, which carry none.
|
|
2468
|
+
adminUserId: adminUserId ?? null,
|
|
2469
|
+
// Task 933 — resolved admin display name from the rc-spawn body,
|
|
2470
|
+
// persisted so a later caller-driven channel resume (which carries
|
|
2471
|
+
// no authenticatedName) can re-inject the identity segment.
|
|
2472
|
+
authenticatedName: authenticatedName ?? null,
|
|
2473
|
+
// Task 884 — open-mode anchor + per-agent scope are stamped only on
|
|
2474
|
+
// the /public-spawn path; the rc-spawn write carries neither, so
|
|
2475
|
+
// both are null here.
|
|
2476
|
+
visitorId: null,
|
|
2477
|
+
agentSlug: null,
|
|
2478
|
+
// Task 983 — scope this session to the resolved account so the
|
|
2479
|
+
// admin shell's switcher can filter the session list by account.
|
|
2480
|
+
accountId: effectiveAccountId,
|
|
2481
|
+
}, deps.logger);
|
|
2482
|
+
deps.watcher.refreshSidecar?.(sessionId);
|
|
2483
|
+
}
|
|
2484
|
+
catch (err) {
|
|
2485
|
+
deps.logger(`[rc-spawn] op=channel-sidecar-write-failed sessionId=${sessionId.slice(0, 8)} channel=${classifyChannel} err=${JSON.stringify(err instanceof Error ? err.message : String(err))}`);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
else if (authenticatedName && priorSidecar && priorSidecar.authenticatedName !== authenticatedName) {
|
|
2489
|
+
// Task 933 — the write above is write-once; refresh the persisted name
|
|
2490
|
+
// when a later operator spawn carries a fresher one so a caller-driven
|
|
2491
|
+
// resume injects the current identity, not the first-spawn snapshot.
|
|
2492
|
+
const refreshed = updateSidecar(classifySidecarPath, { authenticatedName }, deps.logger);
|
|
2493
|
+
if (refreshed)
|
|
2494
|
+
deps.watcher.refreshSidecar?.(sessionId);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
// Task 626 — one-shot job (LinkedIn ingest, public session-end review):
|
|
2498
|
+
// stop the PTY once its single assistant turn lands `end_turn`. closeAfterTurn
|
|
2499
|
+
// implies a sessionId (validated above), so trackerKey === sessionId and the
|
|
2500
|
+
// JSONL watcher follows the same id claude writes under.
|
|
2501
|
+
if (closeAfterTurn && sessionId)
|
|
2502
|
+
attachEndTurnAutoClose(deps, sessionId, 'closeAfterTurn=true');
|
|
2503
|
+
// Step 4 — first child output. Accumulate up to 1 KB or until 500 ms
|
|
2504
|
+
// after the first byte arrives, then emit one line. The single log
|
|
2505
|
+
// that ends the 5-occasion blindness: claude's own words land here
|
|
2506
|
+
// — `Remote Control` on success, `No deferred tool marker` /
|
|
2507
|
+
// `Unknown assignment` on failure.
|
|
2508
|
+
let outputBuf = '';
|
|
2509
|
+
let outputEmitted = false;
|
|
2510
|
+
let outputTimer = null;
|
|
2511
|
+
// Task 977 — persist the full child stdout/stderr for the session's
|
|
2512
|
+
// lifetime, not just the 1 KB boot banner above. Without this a mid-turn
|
|
2513
|
+
// wedge leaves no harness-side evidence of the last SDK activity before the
|
|
2514
|
+
// loop parked. Keyed on the resumable sessionId when present, else the
|
|
2515
|
+
// spawn unitToken. The MCP-helper tee and /spawn get the same treatment.
|
|
2516
|
+
const childLog = createRcChildLog({
|
|
2517
|
+
logDir: deps.logDir,
|
|
2518
|
+
id: sessionId ?? unitToken,
|
|
2519
|
+
logger: deps.logger,
|
|
2520
|
+
});
|
|
2521
|
+
const emitChildOutput = () => {
|
|
2522
|
+
if (outputEmitted)
|
|
2523
|
+
return;
|
|
2524
|
+
outputEmitted = true;
|
|
2525
|
+
if (outputTimer) {
|
|
2526
|
+
clearTimeout(outputTimer);
|
|
2527
|
+
outputTimer = null;
|
|
2528
|
+
}
|
|
2529
|
+
deps.logger(`[rc-spawn] op=child-output unitToken=${unitToken} pid=${pty.pid} head=${JSON.stringify(outputBuf)}`);
|
|
2530
|
+
};
|
|
2531
|
+
// Task 662 — the durable bind signal. Claude Code 2.1.167 stopped writing
|
|
2532
|
+
// `sessions/<pid>.json`; the only place the bridge session id surfaces is
|
|
2533
|
+
// the `https://claude.ai/code/session_<slug>` banner the CLI prints on
|
|
2534
|
+
// stdout when `--remote-control` registers, pre-connection. The 1 KB
|
|
2535
|
+
// `outputBuf` above stops accumulating before that banner (it lands after
|
|
2536
|
+
// the boot banner), so the bind scan keeps its own rolling buffer. The
|
|
2537
|
+
// buffer holds a bounded tail so a URL split across two PTY chunks still
|
|
2538
|
+
// matches; once the slug is found the buffer is released and scanning
|
|
2539
|
+
// stops. `resolveStdoutSlug` feeds the bind-decision race below.
|
|
2540
|
+
let bindBuf = '';
|
|
2541
|
+
let stdoutBytes = 0;
|
|
2542
|
+
let stdoutSlug = null;
|
|
2543
|
+
// Task 677 P2 — auto-confirm the one-time development-channels prompt.
|
|
2544
|
+
// `--dangerously-load-development-channels` (the only way to load a custom,
|
|
2545
|
+
// non-allowlisted channel like whatsapp) prints an interactive prompt
|
|
2546
|
+
// ("Loading development channels … ❯ 1. I am using this for local
|
|
2547
|
+
// development … Enter to confirm") that a programmatic spawn cannot answer,
|
|
2548
|
+
// hanging the boot until pid-bind-timeout. Detect it once and send Enter to
|
|
2549
|
+
// select option 1. The prompt is laid out with cursor-position escapes and
|
|
2550
|
+
// no literal spaces, so match on the ANSI/space-stripped letter stream.
|
|
2551
|
+
// Bounded startup keystroke only — inbound message submission stays a
|
|
2552
|
+
// channel event (the whole point of the migration). Armed only when a
|
|
2553
|
+
// native channel (waChannel or webchatChannel, Task 772) is attached,
|
|
2554
|
+
// fired at most once — the prompt text is channel-agnostic.
|
|
2555
|
+
let devChannelConfirmed = false;
|
|
2556
|
+
let devChannelScan = '';
|
|
2557
|
+
let resolveStdoutSlug = () => { };
|
|
2558
|
+
const stdoutSlugPromise = new Promise((resolve) => { resolveStdoutSlug = resolve; });
|
|
2559
|
+
const BIND_BUF_TAIL = 8 * 1024;
|
|
2560
|
+
pty.onData((data) => {
|
|
2561
|
+
stdoutBytes += data.length;
|
|
2562
|
+
childLog.write(data);
|
|
2563
|
+
if ((effectiveWaChannel || effectiveWebchatChannel) && !devChannelConfirmed) {
|
|
2564
|
+
devChannelScan += data;
|
|
2565
|
+
if (devChannelScan.length > 4096)
|
|
2566
|
+
devChannelScan = devChannelScan.slice(devChannelScan.length - 4096);
|
|
2567
|
+
if (isDevChannelPrompt(devChannelScan)) {
|
|
2568
|
+
devChannelConfirmed = true;
|
|
2569
|
+
devChannelScan = '';
|
|
2570
|
+
pty.write('\r');
|
|
2571
|
+
deps.logger(`[rc-spawn] op=dev-channel-confirmed unitToken=${unitToken} pid=${pty.pid}`);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
if (!stdoutSlug) {
|
|
2575
|
+
bindBuf += data;
|
|
2576
|
+
if (bindBuf.length > BIND_BUF_TAIL)
|
|
2577
|
+
bindBuf = bindBuf.slice(bindBuf.length - BIND_BUF_TAIL);
|
|
2578
|
+
const slug = detectRemoteControlSlug(bindBuf);
|
|
2579
|
+
if (slug) {
|
|
2580
|
+
stdoutSlug = slug;
|
|
2581
|
+
bindBuf = '';
|
|
2582
|
+
deps.logger(`[rc-spawn] op=rc-url-bound unitToken=${unitToken} pid=${pty.pid} slug=${slug} ageMs=${Date.now() - start}`);
|
|
2583
|
+
resolveStdoutSlug(slug);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
if (outputEmitted)
|
|
2587
|
+
return;
|
|
2588
|
+
const remaining = 1024 - outputBuf.length;
|
|
2589
|
+
outputBuf += remaining >= data.length ? data : data.slice(0, remaining);
|
|
2590
|
+
if (outputBuf.length >= 1024)
|
|
2591
|
+
emitChildOutput();
|
|
2592
|
+
else if (!outputTimer)
|
|
2593
|
+
outputTimer = setTimeout(emitChildOutput, 500);
|
|
2594
|
+
});
|
|
2595
|
+
// Step 5/10 — exit observation. `pidFileSeen` discriminates `early-exit`
|
|
2596
|
+
// (no pid file ever appeared — the no-TTY death signature) from `exit`
|
|
2597
|
+
// (clean termination after a normal run). `handlePtyNaturalExit` (wired
|
|
2598
|
+
// by `registerRcSpawnPty`) handles the tracker side — fd release +
|
|
2599
|
+
// tracker delete + the `kill … reason=process-exited` log.
|
|
2600
|
+
let pidFileSeen = false;
|
|
2601
|
+
pty.onExit((e) => {
|
|
2602
|
+
const ranMs = Date.now() - start;
|
|
2603
|
+
if (!pidFileSeen) {
|
|
2604
|
+
deps.logger(`[rc-spawn] op=early-exit unitToken=${unitToken} pid=${pty.pid} ranMs=${ranMs} exitCode=${e.exitCode} signal=${e.signal ?? 'none'}`);
|
|
2605
|
+
emitRcLife(deps.logger, 'early-exit', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2606
|
+
pid: pty.pid,
|
|
2607
|
+
ranMs,
|
|
2608
|
+
exitCode: e.exitCode ?? 'null',
|
|
2609
|
+
signal: e.signal ?? 'none',
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
deps.logger(`[rc-spawn] op=exit unitToken=${unitToken} pid=${pty.pid} ranMs=${ranMs}`);
|
|
2613
|
+
emitRcLife(deps.logger, 'exit', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2614
|
+
pid: pty.pid,
|
|
2615
|
+
lifetimeMs: ranMs,
|
|
2616
|
+
exitCode: e.exitCode ?? 'null',
|
|
2617
|
+
signal: e.signal ?? 'none',
|
|
2618
|
+
});
|
|
2619
|
+
// Flush any buffered child output that never reached 1 KB nor the
|
|
2620
|
+
// 500 ms idle deadline before the child exited.
|
|
2621
|
+
if (!outputEmitted)
|
|
2622
|
+
emitChildOutput();
|
|
2623
|
+
// Task 977 — close the per-session child log on exit.
|
|
2624
|
+
childLog.close();
|
|
2625
|
+
});
|
|
2626
|
+
// Task 558 — session-ready is terminal for the spawn path. The PTY
|
|
2627
|
+
// master IS the live session, not a reclaimable spawn artifact:
|
|
2628
|
+
// claude operates on the slave, and closing the master hangs up the
|
|
2629
|
+
// slave (Task 557 evidence: claude exits ~0.8s after `op=fd-release
|
|
2630
|
+
// trigger=session-ready`). The master must stay open for the slave
|
|
2631
|
+
// to function. The only valid release points are the explicit
|
|
2632
|
+
// operator teardown — `/stop` → `stopSession` → `releasePtyMasterFd`
|
|
2633
|
+
// — and the natural-exit path inside `pty.onExit →
|
|
2634
|
+
// handlePtyNaturalExit`. The tracker remains in `livePtys` for the
|
|
2635
|
+
// session's lifetime.
|
|
2636
|
+
//
|
|
2637
|
+
// Task 592 — capture the promise once so the fire-and-forget logging
|
|
2638
|
+
// and the bounded bridgeSessionId await share the same resolution.
|
|
2639
|
+
const RC_SPAWN_URL_WAIT_MS = deps.rcSpawnUrlWaitMs ?? RC_SPAWN_URL_WAIT_DEFAULT_MS;
|
|
2640
|
+
const waitPidPromise = deps.watcher.waitForPid(pty.pid, deps.pidFileTimeoutMs);
|
|
2641
|
+
// Fire-and-forget: unchanged logging contract.
|
|
2642
|
+
void waitPidPromise
|
|
2643
|
+
.then((row) => {
|
|
2644
|
+
pidFileSeen = true;
|
|
2645
|
+
const ageMs = Date.now() - start;
|
|
2646
|
+
// Task 573 — on-disk pid file presence is the success evidence.
|
|
2647
|
+
// Replaces the prior op=alive / op=session-ready pair.
|
|
2648
|
+
deps.logger(`[rc-spawn] op=pidfile-present unitToken=${unitToken} pid=${pty.pid} path=${row.pidFilePath ?? 'unknown'} ageMs=${ageMs} bridgeId=${row.bridgeSessionId ?? 'unknown'}`);
|
|
2649
|
+
emitRcLife(deps.logger, 'pidfile-present', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2650
|
+
pid: pty.pid,
|
|
2651
|
+
path: row.pidFilePath ?? 'unknown',
|
|
2652
|
+
ageMs,
|
|
2653
|
+
bridgeId: row.bridgeSessionId ?? 'unknown',
|
|
2654
|
+
});
|
|
2655
|
+
})
|
|
2656
|
+
.catch((err) => {
|
|
2657
|
+
deps.logger(`[rc-spawn] op=wait-pid-failed unitToken=${unitToken} pid=${pty.pid} err=${err instanceof Error ? err.message : String(err)}`);
|
|
2658
|
+
emitRcLife(deps.logger, 'wait-pid-failed', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
2659
|
+
pid: pty.pid,
|
|
2660
|
+
err: JSON.stringify(err instanceof Error ? err.message : String(err)),
|
|
2661
|
+
});
|
|
2662
|
+
});
|
|
2663
|
+
// Task 662 — bind on the first of TWO signals, whichever the installed
|
|
2664
|
+
// CLI emits. The durable signal (CC 2.1.167+) is the stdout
|
|
2665
|
+
// `claude.ai/code/session_<slug>` banner captured above; the legacy
|
|
2666
|
+
// signal is the pid-file `bridgeSessionId`. The pid-file path is kept
|
|
2667
|
+
// intact so older CLIs that still write `sessions/<pid>.json` bind exactly
|
|
2668
|
+
// as before (Task 592 device behaviour: the file first lands with NO
|
|
2669
|
+
// bridge, then the RC bridge writes it ~0.6 s later, so the file is
|
|
2670
|
+
// re-read until the bridge appears). Each path resolves ONLY on a real
|
|
2671
|
+
// slug; the deadline below supplies the null. Whichever lands first wins.
|
|
2672
|
+
const deadline = start + RC_SPAWN_URL_WAIT_MS;
|
|
2673
|
+
let settled = false;
|
|
2674
|
+
const pidBridgeSlugPromise = (async () => {
|
|
2675
|
+
let row;
|
|
2676
|
+
try {
|
|
2677
|
+
row = await waitPidPromise;
|
|
2678
|
+
}
|
|
2679
|
+
catch {
|
|
2680
|
+
// No pid file ever appeared (the 2.1.167 contract). Never resolve —
|
|
2681
|
+
// the stdout signal or the deadline decides the outcome.
|
|
2682
|
+
return new Promise(() => { });
|
|
2683
|
+
}
|
|
2684
|
+
if (row.bridgeSessionId)
|
|
2685
|
+
return row.bridgeSessionId;
|
|
2686
|
+
const path = row.pidFilePath;
|
|
2687
|
+
while (path && !settled && Date.now() < deadline) {
|
|
2688
|
+
await new Promise((r) => setTimeout(r, 200));
|
|
2689
|
+
try {
|
|
2690
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
2691
|
+
if (typeof parsed.bridgeSessionId === 'string' && parsed.bridgeSessionId.length > 0) {
|
|
2692
|
+
return parsed.bridgeSessionId;
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
catch {
|
|
2696
|
+
// file mid-write or transiently unreadable — retry until the deadline
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
return new Promise(() => { });
|
|
2700
|
+
})();
|
|
2701
|
+
const winner = await Promise.race([
|
|
2702
|
+
stdoutSlugPromise.then((slug) => ({ slug, via: 'stdout-url' })),
|
|
2703
|
+
pidBridgeSlugPromise.then((slug) => ({ slug, via: 'pidfile' })),
|
|
2704
|
+
new Promise((resolve) => setTimeout(() => resolve({ slug: null, via: null }), Math.max(0, deadline - Date.now()))),
|
|
2705
|
+
]);
|
|
2706
|
+
settled = true;
|
|
2707
|
+
const bridgeSessionId = winner.slug;
|
|
2708
|
+
const via = winner.via;
|
|
2709
|
+
// Task 648 — the bind decision drives what the client renders: a slug
|
|
2710
|
+
// navigates the opened tab to the exact session URL; a null slug after
|
|
2711
|
+
// the full wait is a bind-timeout the client surfaces as an error modal
|
|
2712
|
+
// (never a bare claude.ai/code tab). `outcome` and `reason` are threaded
|
|
2713
|
+
// through the proxy unchanged so the client decides modal-vs-navigate
|
|
2714
|
+
// from one server-supplied value.
|
|
2715
|
+
const waitedMs = Date.now() - start;
|
|
2716
|
+
const outcome = bridgeSessionId ? 'bound' : 'timeout';
|
|
2717
|
+
const reason = outcome === 'bound' ? null : 'pid-bind-timeout';
|
|
2718
|
+
if (outcome === 'bound') {
|
|
2719
|
+
deps.logger(`[rc-spawn] op=resume-bound sessionId=${sessionId ?? 'none'} slug=${bridgeSessionId} via=${via} ms=${waitedMs}`);
|
|
2720
|
+
}
|
|
2721
|
+
else {
|
|
2722
|
+
// Task 662 — standing contract check: neither the stdout URL nor the pid
|
|
2723
|
+
// file produced a slug within the bound. This distinct marker names the
|
|
2724
|
+
// artifact the manager waited for and the CLI version that produced
|
|
2725
|
+
// neither, so a future CLI drift is read from one log line instead of
|
|
2726
|
+
// re-derived by reproduction. `reason=pid-bind-timeout` (below) is kept
|
|
2727
|
+
// unchanged so the client still renders the bind-timeout modal.
|
|
2728
|
+
//
|
|
2729
|
+
// Task 664 — scan the captured child stdout for the known blocking-screen
|
|
2730
|
+
// markers and name the matched one (`blocker=`). `bindBuf` holds the 8 KB
|
|
2731
|
+
// stdout tail; in a failed bind no slug was found so it was never released
|
|
2732
|
+
// and carries the (sub-8 KB) blocking screen — e.g. the CC >= 2.1.167
|
|
2733
|
+
// "Settings Warning" the redundant allow:["*"] used to trigger.
|
|
2734
|
+
deps.logger(`[rc-spawn] op=bind-signal-absent unitToken=${unitToken} pid=${pty.pid} expected=stdout-url cliVersion=${detectCliVersion(deps.claudeBin)} stdoutBytes=${stdoutBytes} pidFileSeen=${pidFileSeen} blocker=${classifyBindBlocker(bindBuf)}`);
|
|
2735
|
+
deps.logger(`[rc-spawn] op=resume-timeout sessionId=${sessionId ?? 'none'} waitedMs=${RC_SPAWN_URL_WAIT_MS} slug=none`);
|
|
2736
|
+
}
|
|
2737
|
+
deps.logger(`[rc-spawn] op=resume-response sessionId=${sessionId ?? 'none'} slug=${bridgeSessionId ?? 'none'} outcome=${outcome} reason=${reason ?? 'none'}`);
|
|
2738
|
+
// Every rc-spawn child runs inside a `systemd-run --user --scope`
|
|
2739
|
+
// unit driven by node-pty; the operator-visible spawnMethod marker
|
|
2740
|
+
// is kept stable so server.log greps survive the Task 573 cleanup.
|
|
2741
|
+
deps.logger(`[sessions-rc-resume] mode=${mode} sessionId=${sessionId ?? 'none'} jsonlPath=${existingJsonlPath ?? 'none'} name=${name ?? 'none'} spawnedPid=${pty.pid} bridgeId=${bridgeSessionId ?? 'pending'} spawnMethod=systemd-scope env.CLAUDE_CONFIG_DIR=${deps.claudeConfigDir}`);
|
|
2742
|
+
// Task 876 — re-seat post-bind. Once the fork is bound: (1) arm the
|
|
2743
|
+
// one-shot observer so the post-condition line emits on the fork's first
|
|
2744
|
+
// real turn, and (2) best-effort stop the source session's live PTY — the
|
|
2745
|
+
// operator has explicitly moved off it (the removed-model case has no live
|
|
2746
|
+
// PTY, so the stop is a no-op there). Neither must fail the response.
|
|
2747
|
+
if (forkFromSessionId !== null && reseatModel !== null && sessionId && outcome === 'bound') {
|
|
2748
|
+
const sourceJsonl = findExistingJsonlForSessionId(deps.claudeConfigDir, forkFromSessionId);
|
|
2749
|
+
const fromModel = sourceJsonl ? lastRealAssistantModel(sourceJsonl) : null;
|
|
2750
|
+
attachReseatObserve(deps, sessionId, { fromModel, toModel: reseatModel, oldSessionId: forkFromSessionId });
|
|
2751
|
+
try {
|
|
2752
|
+
const source = deps.watcher.getBySessionId(forkFromSessionId);
|
|
2753
|
+
if (source && source.scopeUnitToken) {
|
|
2754
|
+
await stopSession({
|
|
2755
|
+
killGraceMs: deps.killGraceMs,
|
|
2756
|
+
logger: deps.logger,
|
|
2757
|
+
runSystemctl: deps.runSystemctl,
|
|
2758
|
+
rowScopeUnitToken: source.scopeUnitToken,
|
|
2759
|
+
rowPid: source.pid,
|
|
2760
|
+
}, forkFromSessionId);
|
|
2761
|
+
deps.logger(`[webchat:reseat] op=old-session-stop old-session=${forkFromSessionId} result=stopped`);
|
|
2762
|
+
}
|
|
2763
|
+
else {
|
|
2764
|
+
deps.logger(`[webchat:reseat] op=old-session-stop old-session=${forkFromSessionId} result=absent`);
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
catch (err) {
|
|
2768
|
+
deps.logger(`[webchat:reseat] op=old-session-stop old-session=${forkFromSessionId} result=error err=${JSON.stringify(err instanceof Error ? err.message : String(err))}`);
|
|
2769
|
+
}
|
|
2770
|
+
// Task 896 — record source -> fork so a later resume of the source id is
|
|
2771
|
+
// redirected to the fork instead of spawning a second live process. The
|
|
2772
|
+
// marker is written whether or not the source had a live PTY to stop (the
|
|
2773
|
+
// removed-model case has no live PTY but the source is still re-seated).
|
|
2774
|
+
writeReseatMarker(sessionsDir, forkFromSessionId, sessionId, Date.now(), deps.logger);
|
|
2775
|
+
deps.logger(`[webchat:reseat] op=reseat-retire from=${forkFromSessionId} fork=${sessionId} outcome=marked`);
|
|
2776
|
+
}
|
|
2777
|
+
timed(deps.logger, 'POST', '/rc-spawn', 200, Date.now() - start);
|
|
2778
|
+
// `slug` is the Task 648 canonical field the client navigates by;
|
|
2779
|
+
// `bridgeSessionId` is the same value, retained so pre-648 consumers and
|
|
2780
|
+
// tests keep resolving. They never diverge — `slug` IS `bridgeSessionId`.
|
|
2781
|
+
// Task-962 — a wedged-child respawn carries the recovery verdict so the
|
|
2782
|
+
// gateway records `respawned` and leaves the queued message to redeliver.
|
|
2783
|
+
// `recovered` reflects the actual bind outcome, not just that a respawn was
|
|
2784
|
+
// attempted, so the op=recover log line doesn't overstate a failed re-bind.
|
|
2785
|
+
return c.json({
|
|
2786
|
+
spawnedPid: pty.pid,
|
|
2787
|
+
sessionId: sessionId ?? null,
|
|
2788
|
+
bridgeSessionId,
|
|
2789
|
+
slug: bridgeSessionId,
|
|
2790
|
+
outcome,
|
|
2791
|
+
reason,
|
|
2792
|
+
...(recoverOutcome ? { live: true, classification: recoverOutcome.classification, recovered: outcome === 'bound' } : {}),
|
|
2793
|
+
});
|
|
2794
|
+
});
|
|
2795
|
+
return app;
|
|
2796
|
+
}
|
|
2797
|
+
//# sourceMappingURL=http-server.js.map
|