@rubytech/create-siteoffice-code 0.1.256
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__/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 +19 -0
- package/dist/__tests__/entitlement-flag.test.js +43 -0
- package/dist/__tests__/init-logging.test.js +85 -0
- package/dist/__tests__/installer-settings-permissions.test.js +112 -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 +85 -0
- package/dist/__tests__/macos-version.test.js +96 -0
- package/dist/__tests__/onboarding-state-readback.test.js +61 -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 +123 -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__/rss-sampler-installer.test.js +27 -0
- package/dist/__tests__/samba-provision.test.js +226 -0
- package/dist/__tests__/snap-chromium.test.js +115 -0
- package/dist/__tests__/tier-flag.test.js +53 -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 +4048 -0
- package/dist/init-logging.js +28 -0
- package/dist/launchd-plist.js +68 -0
- package/dist/lib/plugin-install.js +110 -0
- package/dist/lib/premium-mcp-discover.js +41 -0
- package/dist/macos-version.js +53 -0
- package/dist/onboarding-readback.js +27 -0
- package/dist/peer-brand-detect.js +39 -0
- package/dist/permissions-seed.js +76 -0
- package/dist/pinned-binaries.js +12 -0
- package/dist/platform-detect.js +36 -0
- package/dist/port-resolution.js +208 -0
- package/dist/preflight-port-classifier.js +222 -0
- package/dist/samba-provision.js +218 -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 +947 -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 +49 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.js +109 -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 +140 -0
- package/payload/platform/lib/account-enumeration/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 +4 -0
- package/payload/platform/lib/embed-client/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/embed-client/dist/index.js +53 -0
- package/payload/platform/lib/embed-client/dist/index.js.map +1 -0
- package/payload/platform/lib/embed-client/src/index.ts +53 -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 +355 -0
- package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/index.js +864 -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 +357 -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 +1162 -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 +80 -0
- package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/graph-style/dist/index.js +285 -0
- package/payload/platform/lib/graph-style/dist/index.js.map +1 -0
- package/payload/platform/lib/graph-style/src/__tests__/parity.test.ts +114 -0
- package/payload/platform/lib/graph-style/src/index.ts +299 -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 +377 -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 +491 -0
- package/payload/platform/lib/graph-write/tsconfig.json +8 -0
- package/payload/platform/lib/mcp-eager/dist/index.d.ts +61 -0
- package/payload/platform/lib/mcp-eager/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-eager/dist/index.js +49 -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 +78 -0
- package/payload/platform/lib/mcp-eager/tsconfig.json +8 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +53 -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 +132 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-spawn-tee/src/index.ts +134 -0
- package/payload/platform/lib/mcp-spawn-tee/tsconfig.json +8 -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 +7 -0
- package/payload/platform/lib/models/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/models/dist/index.js +20 -0
- package/payload/platform/lib/models/dist/index.js.map +1 -0
- package/payload/platform/lib/models/src/index.ts +18 -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 +1899 -0
- package/payload/platform/package-lock.json +4060 -0
- package/payload/platform/package.json +26 -0
- package/payload/platform/plugins/.claude-plugin/marketplace.json +158 -0
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/admin/PLUGIN.md +163 -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__/pin-identity-gate.test.sh +96 -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-directive.test.sh +70 -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 +16 -0
- package/payload/platform/plugins/admin/hooks/mcp-tool-missing.sh +94 -0
- package/payload/platform/plugins/admin/hooks/pin-identity-gate.sh +136 -0
- package/payload/platform/plugins/admin/hooks/post-tool-use-agent.sh +155 -0
- package/payload/platform/plugins/admin/hooks/prompt-optimiser-directive.sh +52 -0
- package/payload/platform/plugins/admin/hooks/webfetch-preflight.mjs +363 -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 +79 -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 +130 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/capabilities-here.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/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 +3120 -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 +44 -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 +187 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.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 +241 -0
- package/payload/platform/plugins/admin/skills/access-manager/SKILL.md +30 -0
- package/payload/platform/plugins/admin/skills/access-manager/references/operations.md +154 -0
- package/payload/platform/plugins/admin/skills/admin-user-management/SKILL.md +49 -0
- package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +53 -0
- package/payload/platform/plugins/admin/skills/capabilities-here/SKILL.md +31 -0
- package/payload/platform/plugins/admin/skills/datetime/SKILL.md +149 -0
- package/payload/platform/plugins/admin/skills/deck-pages/SKILL.md +404 -0
- package/payload/platform/plugins/admin/skills/file-presentation/SKILL.md +47 -0
- package/payload/platform/plugins/admin/skills/insight/SKILL.md +24 -0
- package/payload/platform/plugins/admin/skills/investigate/SKILL.md +318 -0
- package/payload/platform/plugins/admin/skills/plainly/SKILL.md +105 -0
- package/payload/platform/plugins/admin/skills/plainly/references/worked-examples.md +301 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3943 -0
- package/payload/platform/plugins/admin/skills/plugin-management/SKILL.md +99 -0
- package/payload/platform/plugins/admin/skills/professional-document/SKILL.md +178 -0
- package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +256 -0
- package/payload/platform/plugins/admin/skills/publish-site/SKILL.md +42 -0
- package/payload/platform/plugins/admin/skills/qr-code/SKILL.md +36 -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 +62 -0
- package/payload/platform/plugins/admin/skills/skill-builder/SKILL.md +113 -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 +45 -0
- package/payload/platform/plugins/admin/skills/stream-log-review/SKILL.md +71 -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 +361 -0
- package/payload/platform/plugins/admin/skills/task/SKILL.md +314 -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 +52 -0
- package/payload/platform/plugins/admin/skills/upgrade/SKILL.md +34 -0
- package/payload/platform/plugins/aeo/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/aeo/PLUGIN.md +80 -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 +53 -0
- package/payload/platform/plugins/browser/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/browser/PLUGIN.md +114 -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 +62 -0
- package/payload/platform/plugins/business-assistant/references/crm.md +112 -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/quoting.md +56 -0
- package/payload/platform/plugins/business-assistant/references/scheduling.md +127 -0
- package/payload/platform/plugins/business-assistant/references/task-management.md +163 -0
- package/payload/platform/plugins/cloudflare/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/cloudflare/PLUGIN.md +61 -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 +166 -0
- package/payload/platform/plugins/cloudflare/references/d1-data-capture.md +157 -0
- package/payload/platform/plugins/cloudflare/references/dashboard-guide.md +173 -0
- package/payload/platform/plugins/cloudflare/references/hosting-sites.md +66 -0
- package/payload/platform/plugins/cloudflare/references/manual-setup.md +633 -0
- package/payload/platform/plugins/cloudflare/references/reset-guide.md +119 -0
- package/payload/platform/plugins/cloudflare/references/serving-published-sites.md +73 -0
- package/payload/platform/plugins/cloudflare/skills/cloudflare/SKILL.md +72 -0
- package/payload/platform/plugins/contacts/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/contacts/PLUGIN.md +62 -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/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 +21 -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 +70 -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 +95 -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 +72 -0
- package/payload/platform/plugins/contacts/mcp/dist/tools/group-manage.js.map +1 -0
- package/payload/platform/plugins/contacts/mcp/package.json +19 -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 +75 -0
- package/payload/platform/plugins/deep-research/skills/book-mirror/SKILL.md +68 -0
- package/payload/platform/plugins/deep-research/skills/data-research/SKILL.md +108 -0
- package/payload/platform/plugins/deep-research/skills/deep-research/SKILL.md +46 -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 +69 -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 +81 -0
- package/payload/platform/plugins/docs/references/admin-session.md +177 -0
- package/payload/platform/plugins/docs/references/admin-ui.md +266 -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 +303 -0
- package/payload/platform/plugins/docs/references/getting-started.md +82 -0
- package/payload/platform/plugins/docs/references/graph.md +163 -0
- package/payload/platform/plugins/docs/references/internals.md +539 -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 +63 -0
- package/payload/platform/plugins/docs/references/outlook-guide.md +69 -0
- package/payload/platform/plugins/docs/references/platform.md +193 -0
- package/payload/platform/plugins/docs/references/plugins-guide.md +188 -0
- package/payload/platform/plugins/docs/references/projects-guide.md +94 -0
- package/payload/platform/plugins/docs/references/samba.md +80 -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 +289 -0
- package/payload/platform/plugins/docs/references/visitor-graph.md +83 -0
- package/payload/platform/plugins/docs/references/voice-mirror-guide.md +64 -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 +17 -0
- package/payload/platform/plugins/email/PLUGIN.md +98 -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 +381 -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 +19 -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 +64 -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/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 +266 -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 +770 -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 +23 -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 +60 -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 +675 -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/smtp.d.ts +25 -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 +78 -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 +56 -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-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 +191 -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 +142 -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 +84 -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 +11 -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 +74 -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 +67 -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 +11 -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 +37 -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 +162 -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 +22 -0
- package/payload/platform/plugins/email/references/email-reference.md +144 -0
- package/payload/platform/plugins/email/skills/email-composition/SKILL.md +184 -0
- package/payload/platform/plugins/email/skills/email-ingest/SKILL.md +87 -0
- package/payload/platform/plugins/graph/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/graph/PLUGIN.md +37 -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 +198 -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 +38 -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 +91 -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 +17 -0
- package/payload/platform/plugins/memory/PLUGIN.md +291 -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/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 +2522 -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__/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 +67 -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-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 +217 -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 +640 -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__/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 +79 -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/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 +141 -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 +516 -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 +142 -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__/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 +95 -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 +135 -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 +149 -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 +6 -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 +73 -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 +21 -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 +51 -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 +1273 -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 +56 -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 +376 -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/backfill-typed-edges.ts +72 -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 +48 -0
- package/payload/platform/plugins/memory/references/graph-primitives.md +394 -0
- package/payload/platform/plugins/memory/references/schema-base.md +334 -0
- package/payload/platform/plugins/memory/references/schema-construction.md +72 -0
- package/payload/platform/plugins/memory/references/schema-creator.md +35 -0
- package/payload/platform/plugins/memory/references/schema-estate-agent.md +110 -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-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 +67 -0
- package/payload/platform/plugins/memory/skills/challenge/SKILL.md +52 -0
- package/payload/platform/plugins/memory/skills/concept-synthesis/SKILL.md +79 -0
- package/payload/platform/plugins/memory/skills/connect/SKILL.md +56 -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 +113 -0
- package/payload/platform/plugins/memory/skills/document-ingest/SKILL.md +331 -0
- package/payload/platform/plugins/memory/skills/emerge/SKILL.md +87 -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 +17 -0
- package/payload/platform/plugins/outlook/PLUGIN.md +74 -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 +183 -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 +65 -0
- package/payload/platform/plugins/projects/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/projects/PLUGIN.md +90 -0
- package/payload/platform/plugins/projects/references/investigation.md +63 -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/sprint.md +168 -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 +318 -0
- package/payload/platform/plugins/replicate/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/replicate/PLUGIN.md +49 -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 +125 -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 +17 -0
- package/payload/platform/plugins/scheduling/PLUGIN.md +153 -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 +86 -0
- package/payload/platform/plugins/scheduling/skills/daily-prep/SKILL.md +61 -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 +607 -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 +17 -0
- package/payload/platform/plugins/telegram/PLUGIN.md +53 -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 +198 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.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 +34 -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 +50 -0
- package/payload/platform/plugins/url-get/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/url-get/PLUGIN.md +91 -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 +17 -0
- package/payload/platform/plugins/whatsapp/PLUGIN.md +108 -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/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/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 +489 -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 +256 -0
- package/payload/platform/plugins/whatsapp/skills/connect-whatsapp/SKILL.md +82 -0
- package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +93 -0
- package/payload/platform/plugins/work/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/work/.mcp.json +13 -0
- package/payload/platform/plugins/work/PLUGIN.md +124 -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 +101 -0
- package/payload/platform/plugins/workflows/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/workflows/.mcp.json +12 -0
- package/payload/platform/plugins/workflows/PLUGIN.md +160 -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 +93 -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__/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__/resume-tunnel.test.sh +251 -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/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 +138 -0
- package/payload/platform/scripts/check-no-legacy-spawn-route.mjs +37 -0
- package/payload/platform/scripts/check-no-task-id-leaks.mjs +110 -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-skill-frontmatter.mjs +139 -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 +88 -0
- package/payload/platform/scripts/installer-device-verify.sh +249 -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/read-brand-json.sh +69 -0
- package/payload/platform/scripts/lib/resolve-account-dir.sh +184 -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/redact-install-logs.sh +87 -0
- package/payload/platform/scripts/resume-tunnel.sh +148 -0
- package/payload/platform/scripts/rss-sampler.sh +58 -0
- package/payload/platform/scripts/seed-neo4j.sh +193 -0
- package/payload/platform/scripts/setup-account.sh +373 -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 +205 -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/config.d.ts +55 -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 +234 -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 +881 -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 +40 -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 +1761 -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 +675 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts +43 -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 +155 -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 +41 -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 +105 -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 +499 -0
- package/payload/platform/services/claude-session-manager/dist/jsonl-tail.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 +20 -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 +641 -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 +2077 -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-daemon.d.ts +157 -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 +556 -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/session-sidecar.d.ts +91 -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 +232 -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/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/system-prompt.d.ts +151 -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 +445 -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/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/templates/account.json +12 -0
- package/payload/platform/templates/agents/admin/AGENTS.md +23 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +69 -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/archive-ingest-operator.md +45 -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/database-operator.md +29 -0
- package/payload/platform/templates/specialists/agents/librarian.md +57 -0
- package/payload/platform/templates/specialists/agents/personal-assistant.md +63 -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 +23 -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 +119 -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 +376 -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/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/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/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 +336 -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-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/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 +17 -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-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 +362 -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 +86 -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 +110 -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 +82 -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 +560 -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 +123 -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 +32 -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 +82 -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 +47 -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 +160 -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 +17 -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 +98 -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 +351 -0
- package/payload/premium-plugins/writer-craft/mcp/src/index.ts +409 -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 +115 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +767 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-ingest-session-text.ts +152 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +128 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +234 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +139 -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 +228 -0
- package/payload/server/adminuser-self-heal-YC47O34W.js +46 -0
- package/payload/server/chunk-76HRO7NX.js +5684 -0
- package/payload/server/chunk-HYQNUVGO.js +38 -0
- package/payload/server/maxy-edge.js +814 -0
- package/payload/server/package.json +11 -0
- package/payload/server/public/assets/AdminShell-T-YknnBn.js +1 -0
- package/payload/server/public/assets/AdminShell-qc_xy7Az.css +1 -0
- package/payload/server/public/assets/Checkbox-DmDxpqVv.js +1 -0
- package/payload/server/public/assets/_baseFor-Cs8Y-rGh.js +1 -0
- package/payload/server/public/assets/admin-COUV-jgt.js +1 -0
- package/payload/server/public/assets/admin-CWMpccrR.css +1 -0
- package/payload/server/public/assets/arc-B2CweJq3.js +1 -0
- package/payload/server/public/assets/architecture-YZFGNWBL-Dnn6Hc65.js +1 -0
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-DP2o-MFV.js +36 -0
- package/payload/server/public/assets/array-iHZP4KWJ.js +1 -0
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-DO4mcYDJ.js +132 -0
- package/payload/server/public/assets/c4Diagram-AHTNJAMY-Sy1giHbj.js +10 -0
- package/payload/server/public/assets/channel-CEpR_0rE.js +1 -0
- package/payload/server/public/assets/chunk-2KRD3SAO-CKsCYCsN.js +1 -0
- package/payload/server/public/assets/chunk-336JU56O-C0-P-aUF.js +2 -0
- package/payload/server/public/assets/chunk-426QAEUC-DFjEt3Zb.js +1 -0
- package/payload/server/public/assets/chunk-4BX2VUAB-B8bqAmBa.js +1 -0
- package/payload/server/public/assets/chunk-4TB4RGXK-D1k0VSlW.js +206 -0
- package/payload/server/public/assets/chunk-55IACEB6-B-p_QNqz.js +1 -0
- package/payload/server/public/assets/chunk-5FUZZQ4R-D6U6tV_j.js +62 -0
- package/payload/server/public/assets/chunk-5PVQY5BW-CYK76xfs.js +2 -0
- package/payload/server/public/assets/chunk-67CJDMHE-BC9js-lf.js +1 -0
- package/payload/server/public/assets/chunk-7N4EOEYR-4j2OqKkv.js +1 -0
- package/payload/server/public/assets/chunk-AA7GKIK3-Coen-fXN.js +1 -0
- package/payload/server/public/assets/chunk-BSJP7CBP-CAiOBvec.js +1 -0
- package/payload/server/public/assets/chunk-CIAEETIT-AJzzpZVb.js +1 -0
- package/payload/server/public/assets/chunk-DD-I1_y5.js +1 -0
- package/payload/server/public/assets/chunk-EDXVE4YY-BL4BKozX.js +1 -0
- package/payload/server/public/assets/chunk-ENJZ2VHE-mhAFG8UD.js +10 -0
- package/payload/server/public/assets/chunk-FMBD7UC4-H231gZA_.js +15 -0
- package/payload/server/public/assets/chunk-FOC6F5B3-Cl3ZZjYG.js +1 -0
- package/payload/server/public/assets/chunk-ICPOFSXX-DOEzvzJa.js +122 -0
- package/payload/server/public/assets/chunk-K5T4RW27-C_ipbUDD.js +94 -0
- package/payload/server/public/assets/chunk-KGLVRYIC-CTsDNSCU.js +1 -0
- package/payload/server/public/assets/chunk-LIHQZDEY-DvSXhkGf.js +1 -0
- package/payload/server/public/assets/chunk-ORNJ4GCN-p574NOI7.js +1 -0
- package/payload/server/public/assets/chunk-OYMX7WX6-BlEgFM6U.js +231 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-DpF06ZZQ.js +1 -0
- package/payload/server/public/assets/chunk-U2HBQHQK-B2bDK0jv.js +70 -0
- package/payload/server/public/assets/chunk-X2U36JSP-D69BxKFw.js +1 -0
- package/payload/server/public/assets/chunk-XPW4576I-Dm-PcyUi.js +32 -0
- package/payload/server/public/assets/chunk-YZCP3GAM-Be8RnXgx.js +1 -0
- package/payload/server/public/assets/chunk-ZZ45TVLE-Ck8PCTa4.js +1 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CYbXvKLI.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DEyHzRhq.js +1 -0
- package/payload/server/public/assets/clone-y8gexbBy.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-CmkW2Eaj.js +1 -0
- package/payload/server/public/assets/cytoscape.esm-BR2GOQ8_.js +321 -0
- package/payload/server/public/assets/dagre-Dqp-ns8F.js +1 -0
- package/payload/server/public/assets/dagre-KV5264BT-ZgWWXPLc.js +4 -0
- package/payload/server/public/assets/data-gy6QH9c1.js +1 -0
- package/payload/server/public/assets/defaultLocale-B9aLeOTg.js +1 -0
- package/payload/server/public/assets/diagram-5BDNPKRD-CTX5-ScM.js +10 -0
- package/payload/server/public/assets/diagram-G4DWMVQ6-BovIsO6H.js +24 -0
- package/payload/server/public/assets/diagram-MMDJMWI5-DcETsQy-.js +43 -0
- package/payload/server/public/assets/diagram-TYMM5635-yyq6peoZ.js +24 -0
- package/payload/server/public/assets/dist-DB-VPj_8.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-CiNToftB.js +85 -0
- package/payload/server/public/assets/flatten-BtFI066E.js +1 -0
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-Xnl3SpIM.js +162 -0
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-C1iyWe0f.js +292 -0
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-CNs-LD5i.js +1 -0
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-D97pbMQb.js +106 -0
- package/payload/server/public/assets/graph-labels-cZu4pK16.js +1 -0
- package/payload/server/public/assets/graph-qz5tFKqU.js +51 -0
- package/payload/server/public/assets/graphlib-Lq8ijgON.js +1 -0
- package/payload/server/public/assets/info-OMHHGYJF-DsTNigSS.js +1 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-C_OarRTA.js +2 -0
- package/payload/server/public/assets/init-BNFRgqHM.js +1 -0
- package/payload/server/public/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/payload/server/public/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/payload/server/public/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/payload/server/public/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/payload/server/public/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/payload/server/public/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/payload/server/public/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/payload/server/public/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/payload/server/public/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/payload/server/public/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/payload/server/public/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/payload/server/public/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/payload/server/public/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/payload/server/public/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/payload/server/public/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/payload/server/public/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/payload/server/public/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/payload/server/public/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/payload/server/public/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/payload/server/public/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/payload/server/public/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/payload/server/public/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/payload/server/public/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/payload/server/public/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/payload/server/public/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/payload/server/public/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/payload/server/public/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/payload/server/public/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/payload/server/public/assets/isEmpty-D6QovjYR.js +1 -0
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-B8XBdjJn.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-CZYbiOaQ.js +139 -0
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-B1PybFoh.js +89 -0
- package/payload/server/public/assets/katex-B-EfS3nw.js +257 -0
- package/payload/server/public/assets/line-D-tw3hHp.js +1 -0
- package/payload/server/public/assets/linear-BHhXD3cd.js +1 -0
- package/payload/server/public/assets/mermaid-parser.core-C9RAnysF.js +4 -0
- package/payload/server/public/assets/mermaid.core-B532LT1r.js +11 -0
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-DGlgeeTV.js +96 -0
- package/payload/server/public/assets/newsreader-latin-300-normal-AOSWdb_s.woff +0 -0
- package/payload/server/public/assets/newsreader-latin-300-normal-FGBQ0wlI.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-400-normal-BFBkh4jY.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-400-normal-gRTjlS2D.woff +0 -0
- package/payload/server/public/assets/newsreader-latin-500-normal-B66TYsaK.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-500-normal-DFwuUcdu.woff +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-300-normal-CFtw49Zd.woff +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-300-normal-DRMzurxT.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-400-normal-DYA1XoQK.woff +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-400-normal-svq1FPys.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-500-normal-BNHmvKvI.woff2 +0 -0
- package/payload/server/public/assets/newsreader-latin-ext-500-normal-CZruMFou.woff +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-300-normal-CsrIkm-V.woff +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-300-normal-D3VHEe81.woff2 +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-400-normal-BekUZro8.woff +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-400-normal-DdKr49mV.woff2 +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-500-normal-BEAbKU8A.woff +0 -0
- package/payload/server/public/assets/newsreader-vietnamese-500-normal-CL6a8tp2.woff2 +0 -0
- package/payload/server/public/assets/ordinal-Bl-aM5b9.js +1 -0
- package/payload/server/public/assets/packet-4T2RLAQJ-DGES22b-.js +1 -0
- package/payload/server/public/assets/path-DmWWdwp7.js +1 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-ChKeDbzt.js +1 -0
- package/payload/server/public/assets/pieDiagram-DEJITSTG-DV9FIWko.js +30 -0
- package/payload/server/public/assets/public-Bu2_Xi0a.js +35 -0
- package/payload/server/public/assets/public-vnj7OhQj.css +1 -0
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-Betwya4l.js +7 -0
- package/payload/server/public/assets/radar-PYXPWWZC-FGG5Fs7N.js +1 -0
- package/payload/server/public/assets/reduce-BD4xUd2c.js +1 -0
- package/payload/server/public/assets/requirementDiagram-MS252O5E-Cq3vODdg.js +84 -0
- package/payload/server/public/assets/rough.esm-Ci7Kjt46.js +1 -0
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-x8krXWcS.js +10 -0
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-i-_uH-Yl.js +157 -0
- package/payload/server/public/assets/src-C1jfwBq0.js +1 -0
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-il4KqSgI.js +1 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-B6zNJ6Tv.js +1 -0
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-DATdZkA5.js +120 -0
- package/payload/server/public/assets/treeView-SZITEDCU-VAQQdbtf.js +1 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-DKchO3zI.js +1 -0
- package/payload/server/public/assets/useSelectionMode-A5KItZ2T.js +13 -0
- package/payload/server/public/assets/useSelectionMode-C-Ojh7W9.css +1 -0
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-BJh9tJTt.js +34 -0
- package/payload/server/public/assets/wardley-RL74JXVD-CBGtx0bS.js +1 -0
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-EMN1Hdfg.js +20 -0
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-DbUWXa7T.js +7 -0
- package/payload/server/public/brand/claude.png +0 -0
- package/payload/server/public/brand/favicon.ico +0 -0
- package/payload/server/public/brand/maxy-black.png +0 -0
- package/payload/server/public/brand/maxy-horizontal.png +0 -0
- package/payload/server/public/brand/maxy-monochrome.png +0 -0
- package/payload/server/public/brand/maxy-square.png +0 -0
- package/payload/server/public/brand/maxy.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/consent.css +97 -0
- package/payload/server/public/consent.js +259 -0
- package/payload/server/public/data.html +19 -0
- package/payload/server/public/favicon.ico +0 -0
- package/payload/server/public/graph.html +20 -0
- package/payload/server/public/index.html +21 -0
- package/payload/server/public/privacy.html +129 -0
- package/payload/server/public/public.html +19 -0
- package/payload/server/public/robots.txt +5 -0
- package/payload/server/public/v.js +244 -0
- package/payload/server/public/vnc-popout.html +63 -0
- package/payload/server/server-init.cjs +197 -0
- package/payload/server/server.js +21128 -0
|
@@ -0,0 +1,3120 @@
|
|
|
1
|
+
import { initStderrTee } from "../../../../lib/mcp-stderr-tee/dist/index.js";
|
|
2
|
+
initStderrTee("admin");
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { eagerTool } from "../../../../lib/mcp-eager/dist/index.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
8
|
+
import { resolve, join } from "node:path";
|
|
9
|
+
import { execFileSync } from "node:child_process";
|
|
10
|
+
import { appendFileSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { writeAdminEntry, removeAdminFromAccount } from "../../../../lib/admins-write/dist/index.js";
|
|
12
|
+
import { embed } from "../../../../lib/embed-client/dist/index.js";
|
|
13
|
+
import { requirePortEnv } from "../../../../lib/require-port-env/dist/index.js";
|
|
14
|
+
import { deviceUrlBlock } from "../../../../lib/device-url/dist/index.js";
|
|
15
|
+
import { substituteBrandPlaceholders } from "../../../../lib/brand-templating/dist/index.js";
|
|
16
|
+
import { resolveEntitlement } from "../../../../lib/entitlement/dist/index.js";
|
|
17
|
+
import { createHash, randomInt, randomUUID } from "node:crypto";
|
|
18
|
+
import { createConnection } from "node:net";
|
|
19
|
+
import { homedir, hostname as osHostname } from "node:os";
|
|
20
|
+
import QRCode from "qrcode";
|
|
21
|
+
import { getSession, closeDriver } from "./lib/neo4j.js";
|
|
22
|
+
import { findSkillOwners, computePluginReadHint, loadSkill, parseRequiredInputs, adminAuthoringSkillBlock, skillSlugFromReadArgs, AUTHORING_DISPATCH_HINT } from "./skill-resolution.js";
|
|
23
|
+
import { resolvePublicHostname } from "./lib/public-hostname.js";
|
|
24
|
+
import { publishSite } from "./tools/publish-site.js";
|
|
25
|
+
import { resolveCapabilitiesHere } from "./tools/capabilities-here.js";
|
|
26
|
+
import { runCatalogueCensus } from "./lib/catalogue-census.js";
|
|
27
|
+
import { runAuthenticate } from "./tools/admin-identity-authenticate.js";
|
|
28
|
+
function refusalGuidance(kind) {
|
|
29
|
+
switch (kind) {
|
|
30
|
+
case "unsafe-slug":
|
|
31
|
+
return "Operator action: pick a slug whose segments match /^[a-z0-9_][a-z0-9_.-]{0,99}$/i, no leading dot, no `..`.";
|
|
32
|
+
case "destination-occupied":
|
|
33
|
+
return "Operator action: the target directory already exists with contents. Clean it up explicitly or pick a different slug.";
|
|
34
|
+
case "symlink-in-source":
|
|
35
|
+
return "Operator action: the source tree contains a symlink. Resolve or remove the symlink before publishing.";
|
|
36
|
+
case "zero-html":
|
|
37
|
+
return "Operator action: the source has no top-level .html file. Confirm the tree shape.";
|
|
38
|
+
case "ambiguous-html":
|
|
39
|
+
return "Operator action: pick which top-level .html file is the landing page (or add an index.html to the source).";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const server = new McpServer({
|
|
43
|
+
name: "admin",
|
|
44
|
+
version: "0.1.0",
|
|
45
|
+
});
|
|
46
|
+
const PLATFORM_ROOT = process.env.PLATFORM_ROOT ?? resolve(import.meta.dirname, "../../../..");
|
|
47
|
+
// Plugin-system boot tolerance — see Task 202.
|
|
48
|
+
// Module-init must never throw; plugin-system spawn enumerates tools/list
|
|
49
|
+
// before any per-account env is set. Per-call refusal preserves account
|
|
50
|
+
// isolation in metadata-only mode.
|
|
51
|
+
const ACCOUNT_ID = process.env.ACCOUNT_ID ?? null;
|
|
52
|
+
process.stderr.write(`[admin] boot accountId=${ACCOUNT_ID ?? "null"}\n`);
|
|
53
|
+
function refuseNoAccount(toolName) {
|
|
54
|
+
process.stderr.write(`[admin] tool=${toolName} refuse reason=no-account-context\n`);
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: `${toolName} cannot execute: this MCP instance was launched without ACCOUNT_ID (plugin-system metadata-only mode). Per-account admin tools require ACCOUNT_ID at spawn.`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
isError: true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Task 142 — `PLATFORM_PORT` is the internal loopback port, stamped on
|
|
66
|
+
// the claude-session-manager systemd unit and forwarded to this MCP
|
|
67
|
+
// process via the per-spawn `maxy-mcp-*.json` env block written by
|
|
68
|
+
// `pty-spawner.writePerSpawnMcpConfig`. `MAXY_BRAND_PORT` is the brand's
|
|
69
|
+
// public UI port, used only for display-surface `.local` URLs.
|
|
70
|
+
// Ports are best-effort at boot: plugin-system metadata-only spawn has no
|
|
71
|
+
// port env, so we capture the loud-fail message instead of crashing. Real
|
|
72
|
+
// per-account spawns supply both; any handler reaching the port-using code
|
|
73
|
+
// paths is gated upstream by the accountId refusal.
|
|
74
|
+
let PLATFORM_PORT = "";
|
|
75
|
+
let MAXY_BRAND_PORT = "";
|
|
76
|
+
try {
|
|
77
|
+
PLATFORM_PORT = String(requirePortEnv("PLATFORM_PORT", { tag: "admin:module-init" }));
|
|
78
|
+
MAXY_BRAND_PORT = String(requirePortEnv("MAXY_BRAND_PORT", { tag: "admin:module-init" }));
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
process.stderr.write(`[admin] boot port-env unavailable — ${err.message}\n`);
|
|
82
|
+
}
|
|
83
|
+
// Brand-aware config — reads configDir, productName, and commercialMode from
|
|
84
|
+
// brand.json stamped at install time. commercialMode gates the
|
|
85
|
+
// entitlement verifier: false (default) preserves personal-mode installs;
|
|
86
|
+
// true requires a Rubytech-signed entitlement.json or the install runs locked.
|
|
87
|
+
// No fallback: if brand.json is missing or incomplete, the platform wasn't properly installed.
|
|
88
|
+
function resolveBrandConfig() {
|
|
89
|
+
const brandPath = resolve(PLATFORM_ROOT, "config", "brand.json");
|
|
90
|
+
if (!existsSync(brandPath)) {
|
|
91
|
+
throw new Error(`brand.json not found at ${brandPath} — platform not properly installed`);
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const brand = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
95
|
+
if (!brand.configDir) {
|
|
96
|
+
throw new Error(`brand.json at ${brandPath} is missing the configDir field`);
|
|
97
|
+
}
|
|
98
|
+
if (!brand.productName) {
|
|
99
|
+
throw new Error(`brand.json at ${brandPath} is missing the productName field`);
|
|
100
|
+
}
|
|
101
|
+
// brand.json is the single source of truth for the
|
|
102
|
+
// four brand-scoped port fields. An admin MCP probe must see the exact
|
|
103
|
+
// same numbers the rest of the platform binds; silent vncDisplay-derived
|
|
104
|
+
// fallback was a recurrence-class silent-fallback-masks-root-cause
|
|
105
|
+
// violation and is now loud-fail.
|
|
106
|
+
const brandLabel = String(brand.configDir).replace(/^\./, "");
|
|
107
|
+
if (typeof brand.vncDisplay !== "number") {
|
|
108
|
+
console.error(`[mcp:admin] error reason=cdp-port-unresolved brand=${brandLabel} path=${brandPath} field=vncDisplay json_keys=${Object.keys(brand).join(",")}`);
|
|
109
|
+
throw new Error(`brand.json at ${brandPath} missing required field: vncDisplay`);
|
|
110
|
+
}
|
|
111
|
+
for (const field of ["rfbPort", "websockifyPort", "cdpPort"]) {
|
|
112
|
+
if (typeof brand[field] !== "number") {
|
|
113
|
+
console.error(`[mcp:admin] error reason=cdp-port-unresolved brand=${brandLabel} path=${brandPath} field=${field} json_keys=${Object.keys(brand).join(",")}`);
|
|
114
|
+
throw new Error(`brand.json at ${brandPath} missing required field: ${field}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
configDir: brand.configDir,
|
|
119
|
+
productName: brand.productName,
|
|
120
|
+
commercialMode: brand.commercialMode === true,
|
|
121
|
+
vncDisplay: brand.vncDisplay,
|
|
122
|
+
rfbPort: brand.rfbPort,
|
|
123
|
+
websockifyPort: brand.websockifyPort,
|
|
124
|
+
cdpPort: brand.cdpPort,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
if (err instanceof SyntaxError) {
|
|
129
|
+
throw new Error(`brand.json at ${brandPath} is not valid JSON: ${err.message}`);
|
|
130
|
+
}
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const BRAND_CONFIG = resolveBrandConfig();
|
|
135
|
+
const CONFIG_DIR = resolve(homedir(), BRAND_CONFIG.configDir);
|
|
136
|
+
const BRAND_NAME = BRAND_CONFIG.productName;
|
|
137
|
+
// Boot-time catalogue census — emits one [catalogue-census] line per spawn
|
|
138
|
+
// naming any specialist on disk that has no matching reference row in the
|
|
139
|
+
// shipped platform-architecture skill body. Closes the F5 silent-drift
|
|
140
|
+
// blind spot (template added, doc row missed). 24h periodic tick is
|
|
141
|
+
// deferred to Task 562.
|
|
142
|
+
try {
|
|
143
|
+
const brandPath = resolve(PLATFORM_ROOT, "config", "brand.json");
|
|
144
|
+
const brandJson = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
145
|
+
const shipsBundles = Array.isArray(brandJson.shipsPremiumBundles) ? brandJson.shipsPremiumBundles : [];
|
|
146
|
+
// Census against the shipped skill body — only bundles whose docs/references/
|
|
147
|
+
// tree is baked into the per-brand corpus contribute specialists that the
|
|
148
|
+
// body is expected to row. Bundles without docs/references/ (e.g. writer-craft,
|
|
149
|
+
// venture-studio, teaching today) ship agents but no SKILL body rows, so
|
|
150
|
+
// including them produces F5 false-positives.
|
|
151
|
+
const premiumRoot = resolve(PLATFORM_ROOT, "..", "premium-plugins");
|
|
152
|
+
const enabledBundles = shipsBundles.filter((b) => existsSync(resolve(premiumRoot, b, "docs", "references")));
|
|
153
|
+
const census = runCatalogueCensus({
|
|
154
|
+
platformRoot: PLATFORM_ROOT,
|
|
155
|
+
premiumPluginsRoot: premiumRoot,
|
|
156
|
+
enabledBundles,
|
|
157
|
+
shippedSkillPath: resolve(PLATFORM_ROOT, "plugins", "admin", "skills", "platform-architecture", "SKILL.md"),
|
|
158
|
+
});
|
|
159
|
+
process.stderr.write(`[catalogue-census] disk=${census.diskCount} documented=${census.documentedCount} missing=${census.missing.join(",")} stale=${census.stale.join(",")}\n`);
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
process.stderr.write(`[catalogue-census] error reason=${err.message}\n`);
|
|
163
|
+
}
|
|
164
|
+
// Entitlement input shape for the verifier. configDir is rooted under $HOME
|
|
165
|
+
// (where entitlement.json is delivered post-purchase). platformRoot is needed
|
|
166
|
+
// because the verifier runs in two bundle contexts (CJS dist for MCP, ESM tsup
|
|
167
|
+
// bundle for UI) — caller passes the root rather than the verifier guessing.
|
|
168
|
+
const ENTITLEMENT_BRAND = {
|
|
169
|
+
configDir: CONFIG_DIR,
|
|
170
|
+
platformRoot: PLATFORM_ROOT,
|
|
171
|
+
commercialMode: BRAND_CONFIG.commercialMode,
|
|
172
|
+
};
|
|
173
|
+
/** Resolve current effective entitlement. Memoized inside the verifier. */
|
|
174
|
+
async function currentEntitlement() {
|
|
175
|
+
const config = await readAccountConfig();
|
|
176
|
+
return resolveEntitlement(ENTITLEMENT_BRAND, {
|
|
177
|
+
accountId: typeof config.accountId === "string" ? config.accountId : "",
|
|
178
|
+
customerEmail: typeof config.customerEmail === "string" ? config.customerEmail : undefined,
|
|
179
|
+
tier: typeof config.tier === "string" ? config.tier : undefined,
|
|
180
|
+
purchasedPlugins: Array.isArray(config.purchasedPlugins)
|
|
181
|
+
? config.purchasedPlugins
|
|
182
|
+
: undefined,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const REMOTE_PASSWORD_FILE = resolve(CONFIG_DIR, ".remote-password");
|
|
186
|
+
// Resolve account directory
|
|
187
|
+
function getAccountDir() {
|
|
188
|
+
if (!ACCOUNT_ID) {
|
|
189
|
+
throw new Error("getAccountDir() called without ACCOUNT_ID — handler guard missing");
|
|
190
|
+
}
|
|
191
|
+
const dir = resolve(PLATFORM_ROOT, "..", "data/accounts", ACCOUNT_ID);
|
|
192
|
+
if (!existsSync(dir)) {
|
|
193
|
+
throw new Error(`Account directory not found: ${dir}`);
|
|
194
|
+
}
|
|
195
|
+
return dir;
|
|
196
|
+
}
|
|
197
|
+
async function readAccountConfig() {
|
|
198
|
+
const configPath = join(getAccountDir(), "account.json");
|
|
199
|
+
const content = await readFile(configPath, "utf-8");
|
|
200
|
+
return JSON.parse(content);
|
|
201
|
+
}
|
|
202
|
+
const STAGING_ROOT = resolve(PLATFORM_ROOT, "../premium-plugins");
|
|
203
|
+
const PLUGINS_DIR = resolve(PLATFORM_ROOT, "plugins");
|
|
204
|
+
const CORE_PLUGINS = ["admin", "memory", "docs", "cloudflare"];
|
|
205
|
+
// users.json lives under CONFIG_DIR (persistent) — see paths.ts comment for
|
|
206
|
+
// the regression that motivated the move. Both platform/ui and this MCP plugin
|
|
207
|
+
// resolve the same file via brand-aware $HOME/<configDir>, so the device-level
|
|
208
|
+
// admin auth store is single-pathed across both processes.
|
|
209
|
+
const USERS_FILE = resolve(CONFIG_DIR, "users.json");
|
|
210
|
+
/** Maximum number of admin users allowed per tier. */
|
|
211
|
+
const MAX_ADMINS_BY_TIER = {
|
|
212
|
+
solo: 1,
|
|
213
|
+
family: 5,
|
|
214
|
+
pro: 5,
|
|
215
|
+
};
|
|
216
|
+
const MAX_ADMINS_DEFAULT = 5;
|
|
217
|
+
function hashPin(pin) {
|
|
218
|
+
return createHash("sha256").update(pin).digest("hex");
|
|
219
|
+
}
|
|
220
|
+
function readUsersJson() {
|
|
221
|
+
if (!existsSync(USERS_FILE)) {
|
|
222
|
+
throw new Error("users.json not found — run the seed script first");
|
|
223
|
+
}
|
|
224
|
+
const raw = readFileSync(USERS_FILE, "utf-8").trim();
|
|
225
|
+
if (!raw)
|
|
226
|
+
return [];
|
|
227
|
+
return JSON.parse(raw);
|
|
228
|
+
}
|
|
229
|
+
function writeUsersJson(users) {
|
|
230
|
+
writeFileSync(USERS_FILE, JSON.stringify(users, null, 2) + "\n", "utf-8");
|
|
231
|
+
}
|
|
232
|
+
function generateUniquePin(users, maxRetries = 10) {
|
|
233
|
+
const existingPins = new Set(users.map(u => u.pin));
|
|
234
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
235
|
+
const raw = String(randomInt(0, 10000)).padStart(4, "0");
|
|
236
|
+
const hashed = hashPin(raw);
|
|
237
|
+
if (!existingPins.has(hashed)) {
|
|
238
|
+
return raw;
|
|
239
|
+
}
|
|
240
|
+
console.error(`[admin] PIN collision during admin-add: rejecting duplicate (attempt ${i + 1}/${maxRetries})`);
|
|
241
|
+
}
|
|
242
|
+
throw new Error("Could not generate a unique PIN after multiple attempts. Specify a PIN manually.");
|
|
243
|
+
}
|
|
244
|
+
const VALID_PLUGIN_NAME = /^[a-z0-9-]+$/;
|
|
245
|
+
/** Parse YAML frontmatter from markdown content. Returns key-value pairs. */
|
|
246
|
+
function parseFrontmatter(content) {
|
|
247
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
248
|
+
if (!match)
|
|
249
|
+
return {};
|
|
250
|
+
const result = {};
|
|
251
|
+
let currentKey = "";
|
|
252
|
+
let currentArray = null;
|
|
253
|
+
for (const line of match[1].split("\n")) {
|
|
254
|
+
const kvMatch = line.match(/^(\w[\w-]*):\s*(.*)$/);
|
|
255
|
+
if (kvMatch) {
|
|
256
|
+
if (currentArray && currentKey) {
|
|
257
|
+
result[currentKey] = currentArray;
|
|
258
|
+
currentArray = null;
|
|
259
|
+
}
|
|
260
|
+
const [, key, rawValue] = kvMatch;
|
|
261
|
+
const value = rawValue.replace(/^["']|["']$/g, "").trim();
|
|
262
|
+
if (value) {
|
|
263
|
+
result[key] = value;
|
|
264
|
+
currentKey = key;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
// Key with no inline value — next lines may be array items
|
|
268
|
+
currentKey = key;
|
|
269
|
+
currentArray = [];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else if (currentArray !== null) {
|
|
273
|
+
const itemMatch = line.match(/^\s*-\s+(.+)$/);
|
|
274
|
+
if (itemMatch) {
|
|
275
|
+
currentArray.push(itemMatch[1].trim());
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (currentArray && currentKey) {
|
|
280
|
+
result[currentKey] = currentArray;
|
|
281
|
+
}
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
// ===================================================================
|
|
285
|
+
// System tools
|
|
286
|
+
// ===================================================================
|
|
287
|
+
function checkPort(port, timeoutMs = 1000) {
|
|
288
|
+
return new Promise((res) => {
|
|
289
|
+
const socket = createConnection(port, "127.0.0.1");
|
|
290
|
+
socket.setTimeout(timeoutMs);
|
|
291
|
+
socket.once("connect", () => { socket.destroy(); res(true); });
|
|
292
|
+
socket.once("error", () => { socket.destroy(); res(false); });
|
|
293
|
+
socket.once("timeout", () => { socket.destroy(); res(false); });
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
eagerTool(server, "system-status", "Check health of all Maxy platform services: Neo4j, Ollama, Cloudflare tunnel, crontab (Maxy cron entries), VNC, Chrome (CDP), specialist agents, and deployed brand identity.", {}, async () => {
|
|
297
|
+
if (!ACCOUNT_ID)
|
|
298
|
+
return refuseNoAccount("system-status");
|
|
299
|
+
const checks = {};
|
|
300
|
+
try {
|
|
301
|
+
// NEO4J_URI must be explicit. The outer try/catch surfaces the
|
|
302
|
+
// unset condition as `checks.neo4j = "unreachable: NEO4J_URI unset..."`
|
|
303
|
+
// so system-status still reports cleanly — the misconfig appears in the
|
|
304
|
+
// check output instead of taking down the whole tool.
|
|
305
|
+
const neo4jUri = process.env.NEO4J_URI;
|
|
306
|
+
if (!neo4jUri) {
|
|
307
|
+
throw new Error("NEO4J_URI unset (no silent default)");
|
|
308
|
+
}
|
|
309
|
+
// NOTE: the port-replace below only works when the URI ends in :7687.
|
|
310
|
+
// For non-default bolt ports (e.g. :7688 on realagent) the HTTP port is
|
|
311
|
+
// bolt - 213 (see graph-proxy.ts). Pre-existing fragility — flagged as a
|
|
312
|
+
// follow-up in.docs/neo4j-uri-audit.md. Not in scope.
|
|
313
|
+
const res = await fetch(neo4jUri.replace("bolt://", "http://").replace("7687", "7474"), { signal: AbortSignal.timeout(3000) });
|
|
314
|
+
checks.neo4j = res.ok ? "healthy" : `unhealthy (${res.status})`;
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
checks.neo4j = `unreachable: ${err instanceof Error ? err.message : String(err)}`;
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
const ollamaUrl = process.env.OLLAMA_URL ?? "http://localhost:11434";
|
|
321
|
+
const res = await fetch(`${ollamaUrl}/api/tags`, {
|
|
322
|
+
signal: AbortSignal.timeout(3000),
|
|
323
|
+
});
|
|
324
|
+
if (res.ok) {
|
|
325
|
+
const data = (await res.json());
|
|
326
|
+
const models = data.models?.map((m) => m.name).join(", ") ?? "none";
|
|
327
|
+
checks.ollama = `healthy (models: ${models})`;
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
checks.ollama = `unhealthy (${res.status})`;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
catch (err) {
|
|
334
|
+
checks.ollama = `unreachable: ${err instanceof Error ? err.message : String(err)}`;
|
|
335
|
+
}
|
|
336
|
+
// Cloudflare tunnel: lightweight process check (full status via tunnel-status in cloudflare plugin)
|
|
337
|
+
try {
|
|
338
|
+
execFileSync("pgrep", ["-x", "cloudflared"], { timeout: 2000 });
|
|
339
|
+
checks.cloudflare = "running";
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
// pgrep exits non-zero if no process found
|
|
343
|
+
try {
|
|
344
|
+
execFileSync("which", ["cloudflared"], { encoding: "utf-8", timeout: 3000 });
|
|
345
|
+
checks.cloudflare = "installed but not running";
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
checks.cloudflare = "not installed";
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// Crontab — brand cron entries registered by the installer
|
|
352
|
+
try {
|
|
353
|
+
const crontabOutput = execFileSync("crontab", ["-l"], {
|
|
354
|
+
encoding: "utf-8",
|
|
355
|
+
timeout: 3000,
|
|
356
|
+
});
|
|
357
|
+
const cronBeginMarker = `# BEGIN ${BRAND_NAME.toUpperCase()} CRONS`;
|
|
358
|
+
const cronEndMarker = `# END ${BRAND_NAME.toUpperCase()} CRONS`;
|
|
359
|
+
const beginIdx = crontabOutput.indexOf(cronBeginMarker);
|
|
360
|
+
const endIdx = crontabOutput.indexOf(cronEndMarker);
|
|
361
|
+
if (beginIdx === -1 || endIdx === -1) {
|
|
362
|
+
checks.crontab = `no ${BRAND_NAME} crons registered — run the installer to register them`;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
const block = crontabOutput.slice(beginIdx, endIdx);
|
|
366
|
+
const entries = block
|
|
367
|
+
.split("\n")
|
|
368
|
+
.filter((line) => line.trim() && !line.startsWith("#"));
|
|
369
|
+
if (entries.length === 0) {
|
|
370
|
+
checks.crontab = `${BRAND_NAME} cron block present but empty`;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
const names = entries.map((line) => {
|
|
374
|
+
const commentMatch = line.match(/#\s*(.+)$/);
|
|
375
|
+
if (commentMatch)
|
|
376
|
+
return commentMatch[1].trim();
|
|
377
|
+
const scriptMatch = line.match(/([^/\s]+)\.js/);
|
|
378
|
+
if (scriptMatch)
|
|
379
|
+
return scriptMatch[1];
|
|
380
|
+
return line.trim().split(/\s+/).slice(-1)[0];
|
|
381
|
+
});
|
|
382
|
+
checks.crontab = `${entries.length} registered: ${names.join(", ")}`;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
catch {
|
|
387
|
+
checks.crontab = "no crontab configured for this user";
|
|
388
|
+
}
|
|
389
|
+
// VNC display server (this brand's rfbPort)
|
|
390
|
+
checks.vnc = (await checkPort(BRAND_CONFIG.rfbPort)) ? "running" : "not running";
|
|
391
|
+
// Chrome CDP (this brand's cdpPort); personal-assistant
|
|
392
|
+
// browser tools depend on this.
|
|
393
|
+
const chromeUp = await checkPort(BRAND_CONFIG.cdpPort);
|
|
394
|
+
checks.chrome = chromeUp
|
|
395
|
+
? "running"
|
|
396
|
+
: `not running — personal-assistant browser tools degraded (CDP port ${BRAND_CONFIG.cdpPort} not listening)`;
|
|
397
|
+
// WiFi — current connection state
|
|
398
|
+
try {
|
|
399
|
+
const wifiScan = execFileSync("nmcli", ["-t", "-f", "ACTIVE,SSID,SIGNAL", "device", "wifi", "list"], { encoding: "utf-8", timeout: 5000 });
|
|
400
|
+
const activeLine = wifiScan.split("\n").find((l) => l.startsWith("yes:"));
|
|
401
|
+
if (activeLine) {
|
|
402
|
+
const fields = activeLine.split(/(?<!\\):/).map((f) => f.replace(/\\:/g, ":"));
|
|
403
|
+
checks.wifi = `connected to ${fields[1]} (${fields[2]}%)`;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
checks.wifi = "not connected";
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
catch {
|
|
410
|
+
checks.wifi = "not available";
|
|
411
|
+
}
|
|
412
|
+
// Specialist agents — read AGENTS.md registry, verify files exist
|
|
413
|
+
try {
|
|
414
|
+
const accountDir = getAccountDir();
|
|
415
|
+
const agentsMdPath = join(accountDir, "agents/admin/AGENTS.md");
|
|
416
|
+
const specialistsAgentsDir = join(accountDir, "specialists/agents");
|
|
417
|
+
if (!existsSync(agentsMdPath)) {
|
|
418
|
+
checks.specialists = "not configured (AGENTS.md missing)";
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
const content = readFileSync(agentsMdPath, "utf-8");
|
|
422
|
+
const entries = content.match(/^- \*\*specialists:([^*]+)\*\*/gm);
|
|
423
|
+
if (!entries || entries.length === 0) {
|
|
424
|
+
checks.specialists = "not configured (AGENTS.md empty)";
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
const lines = [];
|
|
428
|
+
for (const entry of entries) {
|
|
429
|
+
const nameMatch = entry.match(/specialists:([^*]+)/);
|
|
430
|
+
if (!nameMatch)
|
|
431
|
+
continue;
|
|
432
|
+
const name = nameMatch[1];
|
|
433
|
+
const fileExists = existsSync(join(specialistsAgentsDir, `${name}.md`));
|
|
434
|
+
let status = fileExists ? "ok" : "missing file";
|
|
435
|
+
if (name === "personal-assistant" && !chromeUp) {
|
|
436
|
+
status = "degraded — chrome not running";
|
|
437
|
+
}
|
|
438
|
+
lines.push(` ${name}: ${status}`);
|
|
439
|
+
}
|
|
440
|
+
checks.specialists = `${entries.length} registered\n${lines.join("\n")}`;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
checks.specialists = "error reading specialist registry";
|
|
446
|
+
}
|
|
447
|
+
// OS hostname — the device's actual network name, used for URL construction
|
|
448
|
+
try {
|
|
449
|
+
checks.hostname = osHostname();
|
|
450
|
+
}
|
|
451
|
+
catch (err) {
|
|
452
|
+
console.error("[system-status] os.hostname() failed, falling back to brand.hostname", err);
|
|
453
|
+
checks.hostname = "unknown (os.hostname failed)";
|
|
454
|
+
}
|
|
455
|
+
// Task 142: `port` shown to the operator is the brand's public port
|
|
456
|
+
// (the one external clients reach via `.local`), not the internal
|
|
457
|
+
// loopback. Loud-fail if absent (Task 139 doctrine).
|
|
458
|
+
checks.port = String(requirePortEnv("MAXY_BRAND_PORT", { tag: "system-status" }));
|
|
459
|
+
console.error(`[system-status] port=${checks.port} hostname=${checks.hostname}`);
|
|
460
|
+
// Local URL — pre-computed for agent URL construction (avoids hostname/port assembly errors)
|
|
461
|
+
checks.localUrl = `http://${checks.hostname}.local:${checks.port}`;
|
|
462
|
+
// Brand identity — read build-time manifest stamped by the bundler
|
|
463
|
+
try {
|
|
464
|
+
const brandPath = resolve(PLATFORM_ROOT, "config/brand.json");
|
|
465
|
+
if (!existsSync(brandPath)) {
|
|
466
|
+
checks.brand = "not configured (dev environment)";
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
const brand = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
470
|
+
checks.brand = `${brand.productName ?? "unknown"} (hostname: ${brand.hostname ?? "unknown"})`;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
catch (err) {
|
|
474
|
+
checks.brand = `error reading brand config: ${err instanceof Error ? err.message : String(err)}`;
|
|
475
|
+
}
|
|
476
|
+
// configDir — the brand-specific config directory name (e.g. ".maxy", ".realagent").
|
|
477
|
+
// Resolved from brand.json at module load. Exposed here so skills can reference
|
|
478
|
+
// the actual value instead of deriving it from the brand name via LLM inference.
|
|
479
|
+
checks.configDir = BRAND_CONFIG.configDir;
|
|
480
|
+
const formatted = Object.entries(checks)
|
|
481
|
+
.map(([service, status]) => `${service}: ${status}`)
|
|
482
|
+
.join("\n");
|
|
483
|
+
return { content: [{ type: "text", text: formatted }] };
|
|
484
|
+
});
|
|
485
|
+
eagerTool(server, "public-hostname", "Resolve this account's canonical public hostname. Reads cloudflared ingress + alias-domains.json — the same files the platform server trusts to route. Returns a single deterministic answer; use this immediately after publish-site to construct the full URL.", {}, async () => {
|
|
486
|
+
if (!ACCOUNT_ID)
|
|
487
|
+
return refuseNoAccount("public-hostname");
|
|
488
|
+
const TAG = "[admin:public-hostname]";
|
|
489
|
+
try {
|
|
490
|
+
const result = resolvePublicHostname(CONFIG_DIR);
|
|
491
|
+
if (result.hostname !== null) {
|
|
492
|
+
console.error(`${TAG} resolved accountId=${ACCOUNT_ID} hostname=${result.hostname} source=${result.source}`);
|
|
493
|
+
const body = `hostname: ${result.hostname}\n` +
|
|
494
|
+
`isApex: ${result.isApex}\n` +
|
|
495
|
+
`source: ${result.source}\n` +
|
|
496
|
+
`usage: paste \`https://${result.hostname}<path-slug>\` to the operator — the <path-slug> comes from publish-site.`;
|
|
497
|
+
return { content: [{ type: "text", text: body }] };
|
|
498
|
+
}
|
|
499
|
+
console.error(`${TAG} empty accountId=${ACCOUNT_ID} reason=${result.reason} files-checked=cloudflared-config.yml,alias-domains.json`);
|
|
500
|
+
return {
|
|
501
|
+
content: [{
|
|
502
|
+
type: "text",
|
|
503
|
+
text: `hostname: (none)\nreason: ${result.reason}\n` +
|
|
504
|
+
`No Cloudflare tunnel is configured for this account. Run the cloudflare skill before publishing externally.`,
|
|
505
|
+
}],
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
catch (err) {
|
|
509
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
510
|
+
console.error(`${TAG} error accountId=${ACCOUNT_ID} message="${errMsg.replace(/"/g, "'")}"`);
|
|
511
|
+
return {
|
|
512
|
+
content: [{ type: "text", text: `error resolving public hostname: ${errMsg}` }],
|
|
513
|
+
isError: true,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
server.tool("publish-site", "Publish an already-extracted static-site tree under <accountDir>/sites/<slug>/. Validates the slug, scans the source for symlinks, refuses on ambiguous landing pages, performs a single mv, then refreshes llms.txt + llms-full.txt at the site root via the AEO writer (best-effort — failure never unwinds the mv). Returns the canonical path slug; pair with public-hostname to build the full URL. Refusals are structured (unsafe-slug | destination-occupied | symlink-in-source | zero-html | ambiguous-html), each carrying a fixed operator message.", {
|
|
518
|
+
source: z
|
|
519
|
+
.string()
|
|
520
|
+
.min(1)
|
|
521
|
+
.describe("Absolute path to the extracted source directory (typically the output of unzip-attachment under <accountDir>/extracted/<id>/). Must be a directory tree of HTML + assets."),
|
|
522
|
+
slug: z
|
|
523
|
+
.string()
|
|
524
|
+
.min(1)
|
|
525
|
+
.describe("Operator-supplied path under <accountDir>/sites/. One or more `/`-separated segments; each segment matches /^[a-z0-9_][a-z0-9_.-]{0,99}$/i, no leading dot, no `..`."),
|
|
526
|
+
siteName: z
|
|
527
|
+
.string()
|
|
528
|
+
.optional()
|
|
529
|
+
.describe("Optional display name used in the generated llms.txt header. Defaults to the last slug segment."),
|
|
530
|
+
siteDescription: z
|
|
531
|
+
.string()
|
|
532
|
+
.optional()
|
|
533
|
+
.describe("Optional one-line description rendered as a blockquote under the llms.txt header."),
|
|
534
|
+
}, async (args) => {
|
|
535
|
+
if (!ACCOUNT_ID)
|
|
536
|
+
return refuseNoAccount("publish-site");
|
|
537
|
+
const accountDir = getAccountDir();
|
|
538
|
+
try {
|
|
539
|
+
const result = await publishSite({
|
|
540
|
+
accountId: ACCOUNT_ID,
|
|
541
|
+
accountDir,
|
|
542
|
+
source: args.source,
|
|
543
|
+
slug: args.slug,
|
|
544
|
+
siteName: args.siteName,
|
|
545
|
+
siteDescription: args.siteDescription,
|
|
546
|
+
}, { getSession });
|
|
547
|
+
if (!result.ok) {
|
|
548
|
+
const body = `refused: ${result.refusal}\n` +
|
|
549
|
+
`detail: ${JSON.stringify(result.detail)}\n` +
|
|
550
|
+
refusalGuidance(result.refusal);
|
|
551
|
+
return { content: [{ type: "text", text: body }] };
|
|
552
|
+
}
|
|
553
|
+
const aeoLine = result.aeo.ok
|
|
554
|
+
? `aeo: ok wrote=${result.aeo.indexPath} indexBytes=${result.aeo.indexBytes}`
|
|
555
|
+
: `aeo: failed reason=${result.aeo.reason}`;
|
|
556
|
+
const body = `pathSlug: ${result.pathSlug}\n` +
|
|
557
|
+
`kind: ${result.kind}\n` +
|
|
558
|
+
`movedFiles: ${result.movedFiles}\n` +
|
|
559
|
+
`destination: ${result.destination}\n` +
|
|
560
|
+
`${aeoLine}\n` +
|
|
561
|
+
`usage: call public-hostname next and concatenate \`https://<hostname>${result.pathSlug}\` to surface the full URL to the operator.`;
|
|
562
|
+
return { content: [{ type: "text", text: body }] };
|
|
563
|
+
}
|
|
564
|
+
catch (err) {
|
|
565
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
566
|
+
process.stderr.write(`[publish-site] error accountId=${ACCOUNT_ID} message="${errMsg.replace(/"/g, "'")}"\n`);
|
|
567
|
+
return {
|
|
568
|
+
content: [
|
|
569
|
+
{ type: "text", text: `publish-site failed: ${errMsg}` },
|
|
570
|
+
],
|
|
571
|
+
isError: true,
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
eagerTool(server, "remote-auth-status", "Check whether the remote access password is configured. When not configured, emits a device-bound URL affordance (maxy-device-url fenced block) pointing at the password setup page — this URL opens on the device's own screen when the operator clicks it. The agent never constructs the password file path or runs shell commands — this tool is the single authority.", {}, async () => {
|
|
576
|
+
if (!ACCOUNT_ID)
|
|
577
|
+
return refuseNoAccount("remote-auth-status");
|
|
578
|
+
const TAG = "[remote-auth-status]";
|
|
579
|
+
// Task 142: `.local` URL is a display surface — read the brand's
|
|
580
|
+
// public port. The loopback fetch reads PLATFORM_PORT (internal).
|
|
581
|
+
const brandPort = parseInt(MAXY_BRAND_PORT, 10);
|
|
582
|
+
const internalPort = parseInt(PLATFORM_PORT, 10);
|
|
583
|
+
const setupUrl = `http://${osHostname()}.local:${brandPort}/__remote-auth/setup`;
|
|
584
|
+
try {
|
|
585
|
+
const res = await fetch(`http://127.0.0.1:${internalPort}/api/remote-auth/status`, {
|
|
586
|
+
signal: AbortSignal.timeout(5000),
|
|
587
|
+
});
|
|
588
|
+
const body = await res.json();
|
|
589
|
+
const configured = body.configured === true;
|
|
590
|
+
console.error(`${TAG} configured=${configured} brandPort=${brandPort} internalPort=${internalPort}`);
|
|
591
|
+
// Shape the response for both the agent (deciding what to say) and
|
|
592
|
+
// the user (seeing the device-URL button when they need to act).
|
|
593
|
+
// Configured → plain status, no URL. Unconfigured → include the
|
|
594
|
+
// fenced block so the agent can surface the button verbatim.
|
|
595
|
+
const text = configured
|
|
596
|
+
? `Remote access password is configured.`
|
|
597
|
+
: `Remote access password is not configured. The admin interface will refuse to expose over the tunnel until one is set.\n\n` +
|
|
598
|
+
`${deviceUrlBlock({ url: setupUrl, intent: "Set remote access password", hostname: osHostname() })}\n\n` +
|
|
599
|
+
`Ask the operator to set a password — either by clicking the button above (opens the setup page on the device) or by telling you one you can pass to \`remote-auth-set-password\`.`;
|
|
600
|
+
return {
|
|
601
|
+
content: [{ type: "text", text }],
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
catch (err) {
|
|
605
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
606
|
+
console.error(`${TAG} failed to check remote-auth status: ${errMsg}`);
|
|
607
|
+
return {
|
|
608
|
+
content: [{
|
|
609
|
+
type: "text",
|
|
610
|
+
text: `Cannot verify remote authentication — the web server at http://127.0.0.1:${internalPort} is not reachable: ${errMsg}. Ensure the ${BRAND_NAME} platform is running.`,
|
|
611
|
+
}],
|
|
612
|
+
isError: true,
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
eagerTool(server, "brand-settings", "Read the brand/styling configuration (name, tagline, colours, fonts, plugin sets). Reads from config/brand.json (stamped by the bundler at install time).", {}, async () => {
|
|
617
|
+
if (!ACCOUNT_ID)
|
|
618
|
+
return refuseNoAccount("brand-settings");
|
|
619
|
+
try {
|
|
620
|
+
const brandPath = resolve(PLATFORM_ROOT, "config", "brand.json");
|
|
621
|
+
if (!existsSync(brandPath)) {
|
|
622
|
+
return { content: [{ type: "text", text: "No brand.json found — platform not properly installed." }], isError: true };
|
|
623
|
+
}
|
|
624
|
+
const brand = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
625
|
+
return { content: [{ type: "text", text: JSON.stringify(brand, null, 2) }] };
|
|
626
|
+
}
|
|
627
|
+
catch (err) {
|
|
628
|
+
return {
|
|
629
|
+
content: [{ type: "text", text: `Failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
630
|
+
isError: true,
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
eagerTool(server, "account-manage", "Read the account configuration (tier, domains, settings).", {}, async () => {
|
|
635
|
+
if (!ACCOUNT_ID)
|
|
636
|
+
return refuseNoAccount("account-manage");
|
|
637
|
+
try {
|
|
638
|
+
const config = await readAccountConfig();
|
|
639
|
+
return {
|
|
640
|
+
content: [{ type: "text", text: JSON.stringify(config, null, 2) }],
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
catch (err) {
|
|
644
|
+
return {
|
|
645
|
+
content: [{ type: "text", text: `Failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
646
|
+
isError: true,
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
eagerTool(server, "capabilities-here", "Returns the live install set on the current account as a single JSON object: enabledPlugins (account config), tier, adminModel, publicModel, installedPlatformSpecialists (disk), installedPremiumSpecialists (disk, gated by brand.shipsPremiumBundles), registeredAgentTypes (Claude Code agent registry under $CLAUDE_CONFIG_DIR/agents/), and the brand block. Call this whenever you are about to make a claim about what this account can do, what is enabled, or what specialists are dispatchable. Do not infer install state from the platform-architecture skill — that skill is the catalogue of what the platform can ship, not what is enabled here.", {}, async () => {
|
|
651
|
+
if (!ACCOUNT_ID)
|
|
652
|
+
return refuseNoAccount("capabilities-here");
|
|
653
|
+
const requestId = randomUUID();
|
|
654
|
+
const t0 = Date.now();
|
|
655
|
+
process.stderr.write(`[capabilities-here] op=invoke accountId=${ACCOUNT_ID} requestId=${requestId}\n`);
|
|
656
|
+
try {
|
|
657
|
+
const accountConfigPath = join(getAccountDir(), "account.json");
|
|
658
|
+
const brandConfigPath = resolve(PLATFORM_ROOT, "config", "brand.json");
|
|
659
|
+
const premiumPluginsRoot = resolve(PLATFORM_ROOT, "..", "premium-plugins");
|
|
660
|
+
const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
661
|
+
const result = await resolveCapabilitiesHere({
|
|
662
|
+
accountId: ACCOUNT_ID,
|
|
663
|
+
accountConfigPath,
|
|
664
|
+
brandConfigPath,
|
|
665
|
+
platformRoot: PLATFORM_ROOT,
|
|
666
|
+
premiumPluginsRoot,
|
|
667
|
+
claudeConfigDir,
|
|
668
|
+
}, new Date().toISOString());
|
|
669
|
+
const elapsed = Date.now() - t0;
|
|
670
|
+
process.stderr.write(`[capabilities-here] op=resolve requestId=${requestId} enabledPlugins=${result.enabledPlugins.length} platformSpecialists=${result.installedPlatformSpecialists.length} premiumSpecialists=${result.installedPremiumSpecialists.length} agentTypes=${result.registeredAgentTypes.length} elapsedMs=${elapsed}\n`);
|
|
671
|
+
const body = JSON.stringify(result, null, 2);
|
|
672
|
+
process.stderr.write(`[capabilities-here] op=return requestId=${requestId} bytesOut=${body.length}\n`);
|
|
673
|
+
return { content: [{ type: "text", text: body }] };
|
|
674
|
+
}
|
|
675
|
+
catch (err) {
|
|
676
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
677
|
+
process.stderr.write(`[capabilities-here] op=error requestId=${requestId} reason=${msg}\n`);
|
|
678
|
+
return {
|
|
679
|
+
content: [{ type: "text", text: `capabilities-here failed: ${msg}` }],
|
|
680
|
+
isError: true,
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
eagerTool(server, "account-update", "Update a user-configurable setting in account.json. Valid fields: outputStyle (default|explanatory), thinkingView (default|expanded|collapsed), effort (low|medium|high|max|auto), adminModel (any Anthropic model ID), publicModel (any Anthropic model ID), defaultAgent (slug of an existing public agent, or empty string to clear). Changes take effect on the next session.", {
|
|
685
|
+
field: z.enum(["outputStyle", "thinkingView", "effort", "adminModel", "publicModel", "defaultAgent"]),
|
|
686
|
+
value: z.string(),
|
|
687
|
+
}, async ({ field, value }) => {
|
|
688
|
+
if (!ACCOUNT_ID)
|
|
689
|
+
return refuseNoAccount("account-update");
|
|
690
|
+
const VALID = {
|
|
691
|
+
outputStyle: ["default", "explanatory"],
|
|
692
|
+
thinkingView: ["default", "expanded", "collapsed"],
|
|
693
|
+
effort: ["low", "medium", "high", "max", "auto"],
|
|
694
|
+
};
|
|
695
|
+
// defaultAgent: non-empty slug must reference an existing agent; empty string clears the field
|
|
696
|
+
if (field === "defaultAgent") {
|
|
697
|
+
const slug = value.trim();
|
|
698
|
+
if (slug) {
|
|
699
|
+
const agentConfigPath = join(getAccountDir(), "agents", slug, "config.json");
|
|
700
|
+
if (!existsSync(agentConfigPath)) {
|
|
701
|
+
return {
|
|
702
|
+
content: [{ type: "text", text: `Agent '${slug}' not found — no config.json in agents/${slug}/` }],
|
|
703
|
+
isError: true,
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
// empty slug is valid — handled below as a delete operation
|
|
708
|
+
}
|
|
709
|
+
// Model fields accept any non-empty string (model IDs change frequently)
|
|
710
|
+
const FREE_FORM_FIELDS = ["adminModel", "publicModel"];
|
|
711
|
+
if (FREE_FORM_FIELDS.includes(field)) {
|
|
712
|
+
if (!value.trim()) {
|
|
713
|
+
return {
|
|
714
|
+
content: [{ type: "text", text: `Invalid value for ${field}. Must be a non-empty model ID.` }],
|
|
715
|
+
isError: true,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
else if (field !== "defaultAgent" && !VALID[field].includes(value)) {
|
|
720
|
+
console.error(`[admin:account-update] rejected field=${field} value="${value}" valid=[${VALID[field].join(", ")}]`);
|
|
721
|
+
return {
|
|
722
|
+
content: [{ type: "text", text: `Invalid value "${value}" for ${field}. Valid values: ${VALID[field].join(", ")}` }],
|
|
723
|
+
isError: true,
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
try {
|
|
727
|
+
const configPath = join(getAccountDir(), "account.json");
|
|
728
|
+
const config = await readAccountConfig();
|
|
729
|
+
const oldDefault = field === "defaultAgent" ? config.defaultAgent ?? "(none)" : undefined;
|
|
730
|
+
if (field === "defaultAgent" && !value.trim()) {
|
|
731
|
+
delete config.defaultAgent;
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
config[field] = value;
|
|
735
|
+
}
|
|
736
|
+
await writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
737
|
+
console.error(`[admin:account-update] wrote field=${field} value="${value}" path=${configPath}`);
|
|
738
|
+
if (field === "defaultAgent") {
|
|
739
|
+
if (!value.trim()) {
|
|
740
|
+
return {
|
|
741
|
+
content: [{ type: "text", text: `Default agent cleared (was "${oldDefault}"). Visitors to the root URL will see the first available agent, or a "no agents" message if none exist. Takes effect on next page load.` }],
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
return {
|
|
745
|
+
content: [{ type: "text", text: `Default agent changed from "${oldDefault}" to "${value}". Takes effect on next page load.` }],
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
return {
|
|
749
|
+
content: [{ type: "text", text: `Updated ${field} to "${value}". Takes effect on next session.` }],
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
catch (err) {
|
|
753
|
+
return {
|
|
754
|
+
content: [{ type: "text", text: `Failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
755
|
+
isError: true,
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
// Plugin enable/disable: deterministic write to account.json.enabledPlugins.
|
|
760
|
+
// IDENTITY.md doctrine forbids the agent's direct Edit on account.json,
|
|
761
|
+
// so the agent must not toggle enablement by hand-editing the file. This
|
|
762
|
+
// tool is the legitimate path: validates the plugin name, refuses core plugins,
|
|
763
|
+
// confirms the plugin directory exists, and atomically updates the array.
|
|
764
|
+
// Entitlement-bearing fields (tier, purchasedPlugins) are NOT writable here.
|
|
765
|
+
server.tool("plugin-toggle-enabled", "Enable or disable a plugin in this account by adding/removing its name from account.json's enabledPlugins array. Validates the plugin exists under platform/plugins/, refuses to disable core plugins (admin, memory, docs, cloudflare), and writes atomically. Takes effect on next session start. Does NOT change purchasedPlugins or tier — those derive from the signed entitlement payload.", {
|
|
766
|
+
pluginName: z.string().describe("Plugin slug (lowercase a-z0-9-)."),
|
|
767
|
+
action: z.enum(["enable", "disable"]).describe("enable adds to enabledPlugins; disable removes."),
|
|
768
|
+
}, async ({ pluginName, action }) => {
|
|
769
|
+
if (!ACCOUNT_ID)
|
|
770
|
+
return refuseNoAccount("plugin-toggle-enabled");
|
|
771
|
+
const TAG = "[admin:plugin-toggle-enabled]";
|
|
772
|
+
if (!VALID_PLUGIN_NAME.test(pluginName)) {
|
|
773
|
+
return { content: [{ type: "text", text: `${TAG} Invalid plugin name "${pluginName}". Must match ${VALID_PLUGIN_NAME}.` }], isError: true };
|
|
774
|
+
}
|
|
775
|
+
if (CORE_PLUGINS.includes(pluginName)) {
|
|
776
|
+
return { content: [{ type: "text", text: `${TAG} "${pluginName}" is a core plugin and cannot be toggled.` }], isError: true };
|
|
777
|
+
}
|
|
778
|
+
const pluginDir = resolve(PLUGINS_DIR, pluginName);
|
|
779
|
+
if (!existsSync(pluginDir) || !existsSync(join(pluginDir, "PLUGIN.md"))) {
|
|
780
|
+
return { content: [{ type: "text", text: `${TAG} Plugin "${pluginName}" not installed at ${pluginDir} (no PLUGIN.md). Install via premium-deliver or platform release.` }], isError: true };
|
|
781
|
+
}
|
|
782
|
+
try {
|
|
783
|
+
const configPath = join(getAccountDir(), "account.json");
|
|
784
|
+
const config = await readAccountConfig();
|
|
785
|
+
const current = Array.isArray(config.enabledPlugins) ? config.enabledPlugins : [];
|
|
786
|
+
let next;
|
|
787
|
+
if (action === "enable") {
|
|
788
|
+
if (current.includes(pluginName)) {
|
|
789
|
+
return { content: [{ type: "text", text: `${TAG} "${pluginName}" is already enabled.` }] };
|
|
790
|
+
}
|
|
791
|
+
next = [...current, pluginName];
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
if (!current.includes(pluginName)) {
|
|
795
|
+
return { content: [{ type: "text", text: `${TAG} "${pluginName}" is not enabled — nothing to disable.` }] };
|
|
796
|
+
}
|
|
797
|
+
next = current.filter((n) => n !== pluginName);
|
|
798
|
+
}
|
|
799
|
+
config.enabledPlugins = next;
|
|
800
|
+
await writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
801
|
+
console.error(`${TAG} ${action}d plugin=${pluginName} path=${configPath}`);
|
|
802
|
+
return { content: [{ type: "text", text: `Plugin "${pluginName}" ${action}d. Takes effect on next session.` }] };
|
|
803
|
+
}
|
|
804
|
+
catch (err) {
|
|
805
|
+
return { content: [{ type: "text", text: `${TAG} Failed: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
// ===================================================================
|
|
809
|
+
// Admin user management tools
|
|
810
|
+
// ===================================================================
|
|
811
|
+
eagerTool(server, "admin-add", "Add a new admin user to this account. Creates a device-level user entry (users.json) and adds them to this account's admins list (account.json). PIN must be at least 4 digits. If no PIN is provided, a unique 4-digit PIN is generated. Returns the userId and PIN to share with the new admin.\n\nIMPORTANT — retry behaviour: if the user already stated a specific PIN earlier in the conversation and a first admin-add call failed (e.g. tier cap reached, PIN collision), every retry MUST re-pass that PIN as the `pin` parameter. Omitting `pin` on the retry auto-generates a different 4-digit PIN, silently substituting what the user asked for.", {
|
|
812
|
+
name: z.string().describe("Display name for the new admin (stored on the AdminUser node in Neo4j)."),
|
|
813
|
+
pin: z.string().optional().describe("Optional PIN (minimum 4 digits). If omitted, a unique 4-digit PIN is generated."),
|
|
814
|
+
}, async ({ name, pin: rawPin }) => {
|
|
815
|
+
if (!ACCOUNT_ID)
|
|
816
|
+
return refuseNoAccount("admin-add");
|
|
817
|
+
const TAG = "[admin]";
|
|
818
|
+
if (!name.trim()) {
|
|
819
|
+
return { content: [{ type: "text", text: `${TAG} Name is required.` }], isError: true };
|
|
820
|
+
}
|
|
821
|
+
let users;
|
|
822
|
+
try {
|
|
823
|
+
users = readUsersJson();
|
|
824
|
+
}
|
|
825
|
+
catch (err) {
|
|
826
|
+
return { content: [{ type: "text", text: `${TAG} ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
827
|
+
}
|
|
828
|
+
// Enforce per-tier admin limit. Effective tier comes from the signed
|
|
829
|
+
// entitlement payload — editing account.json.tier directly
|
|
830
|
+
// has no effect; the verifier uses the signed value and emits a
|
|
831
|
+
// [entitlement] tampered: line if disk and signed diverge.
|
|
832
|
+
try {
|
|
833
|
+
const config = await readAccountConfig();
|
|
834
|
+
const currentAdmins = (config.admins ?? []);
|
|
835
|
+
const entitlement = await currentEntitlement();
|
|
836
|
+
const tier = entitlement.tier;
|
|
837
|
+
const maxAdmins = MAX_ADMINS_BY_TIER[tier] ?? MAX_ADMINS_DEFAULT;
|
|
838
|
+
if (currentAdmins.length >= maxAdmins) {
|
|
839
|
+
return { content: [{ type: "text", text: `${TAG} Admin limit reached (${maxAdmins} for ${tier || "this"} tier). Remove an existing admin before adding a new one.` }], isError: true };
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
catch (err) {
|
|
843
|
+
console.error(`${TAG} failed to check admin limit: ${err instanceof Error ? err.message : String(err)}`);
|
|
844
|
+
// Fail open would be unsafe — fail closed
|
|
845
|
+
return { content: [{ type: "text", text: `${TAG} Unable to verify admin limit — cannot add admin.` }], isError: true };
|
|
846
|
+
}
|
|
847
|
+
// Resolve the calling user's identity from the session environment
|
|
848
|
+
const callerUserId = process.env.USER_ID;
|
|
849
|
+
// PIN: use provided or generate. Constraint: minimum 4 digits, no upper bound.
|
|
850
|
+
let plaintextPin;
|
|
851
|
+
if (rawPin) {
|
|
852
|
+
if (rawPin.length < 4) {
|
|
853
|
+
return { content: [{ type: "text", text: `${TAG} PIN must be at least 4 digits.` }], isError: true };
|
|
854
|
+
}
|
|
855
|
+
const hashed = hashPin(rawPin);
|
|
856
|
+
if (users.some(u => u.pin === hashed)) {
|
|
857
|
+
return { content: [{ type: "text", text: `${TAG} That PIN is already in use. Choose a different PIN.` }], isError: true };
|
|
858
|
+
}
|
|
859
|
+
plaintextPin = rawPin;
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
try {
|
|
863
|
+
plaintextPin = generateUniquePin(users);
|
|
864
|
+
}
|
|
865
|
+
catch (err) {
|
|
866
|
+
return { content: [{ type: "text", text: `${TAG} ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
const pinHash = hashPin(plaintextPin);
|
|
870
|
+
const userId = crypto.randomUUID();
|
|
871
|
+
// Three-store admin auth invariant: users.json
|
|
872
|
+
// (device-level PIN auth) and account.json admins[] (account-level role)
|
|
873
|
+
// route through the shared `admins-write` helper so the dual write has a
|
|
874
|
+
// single chokepoint. Per-leg `[admins-write]` and legacy `[admin-auth-store]`
|
|
875
|
+
// log lines fire so existing dashboards continue to grep. Neo4j AdminUser
|
|
876
|
+
// (display + graph identity) writes below remain inline because they have
|
|
877
|
+
// no dual-file invariant.
|
|
878
|
+
const userIdShort = userId.slice(0, 8);
|
|
879
|
+
const authResult = writeAdminEntry({
|
|
880
|
+
userId,
|
|
881
|
+
pin: pinHash,
|
|
882
|
+
role: "admin",
|
|
883
|
+
usersFile: USERS_FILE,
|
|
884
|
+
accountDir: getAccountDir(),
|
|
885
|
+
caller: "admin-add",
|
|
886
|
+
});
|
|
887
|
+
console.error(`[admin-auth-store] action=add userId=${userIdShort} result=${authResult.usersJsonResult} store=users${authResult.usersError ? ` error=${authResult.usersError}` : ""}`);
|
|
888
|
+
if (authResult.usersJsonResult !== "ok") {
|
|
889
|
+
return { content: [{ type: "text", text: `${TAG} Failed to write users.json: ${authResult.usersError ?? "unknown error"}` }], isError: true };
|
|
890
|
+
}
|
|
891
|
+
console.error(`[admin-auth-store] action=add userId=${userIdShort} result=${authResult.accountJsonResult} store=account${authResult.accountError ? ` error=${authResult.accountError}` : ""}`);
|
|
892
|
+
if (authResult.accountJsonResult === "fail") {
|
|
893
|
+
return { content: [{ type: "text", text: `${TAG} users.json updated; account.json write FAILED — manual reconciliation needed: ${authResult.accountError ?? "unknown error"}` }], isError: true };
|
|
894
|
+
}
|
|
895
|
+
// 3. Write to Neo4j (graph-level): AdminUser + Person + OWNS atomically,
|
|
896
|
+
// plus ADMIN_OF edge to the LocalBusiness for this account.
|
|
897
|
+
// deterministic identity creation: never delegate node
|
|
898
|
+
// creation to the LLM. Person reuse rule mirrors writeAdminUserAndPerson
|
|
899
|
+
// in platform/ui/app/lib/neo4j-store.ts (case-insensitive exact match
|
|
900
|
+
// on givenName + familyName; partial-name ambiguity does NOT match —
|
|
901
|
+
// rationalisation is a separate agent-mediated concern).
|
|
902
|
+
// Neo4j-leg failure now returns is_error: true with the
|
|
903
|
+
// [admin-auth-store] line; previously it set a soft warning string and
|
|
904
|
+
// returned success, which is what hid the Adam Mackay incident from
|
|
905
|
+
// the recovery agent. The user is still functional via users.json +
|
|
906
|
+
// account.json, but the graph state is divergent and the operator
|
|
907
|
+
// must know.
|
|
908
|
+
let personReused = false;
|
|
909
|
+
try {
|
|
910
|
+
const session = getSession();
|
|
911
|
+
try {
|
|
912
|
+
const createdAt = new Date().toISOString();
|
|
913
|
+
const trimmedName = name.trim();
|
|
914
|
+
const firstSpace = trimmedName.search(/\s/);
|
|
915
|
+
const givenName = firstSpace === -1 ? trimmedName : trimmedName.slice(0, firstSpace).trim();
|
|
916
|
+
const familyName = firstSpace === -1 ? null : (trimmedName.slice(firstSpace + 1).trim() || null);
|
|
917
|
+
// Task 636 — :Person is vector-indexed; embed the admin-personal Person
|
|
918
|
+
// at write time so it is findable by semantic memory-search, not only
|
|
919
|
+
// after a reindex. A failed embed sets null (audit catches it) and the
|
|
920
|
+
// write proceeds — embedding must never block PIN setup.
|
|
921
|
+
let personEmbedding = null;
|
|
922
|
+
try {
|
|
923
|
+
personEmbedding = await embed(`[Person] ${[givenName, familyName].filter(Boolean).join(" ")} role: admin-personal`);
|
|
924
|
+
}
|
|
925
|
+
catch (err) {
|
|
926
|
+
process.stderr.write(`[graph-write] warn reason=embed-failed labels=Person agent=admin-add detail=${err instanceof Error ? err.message : String(err)}\n`);
|
|
927
|
+
}
|
|
928
|
+
// stamp `accountId` on every AdminUser at MERGE time, both
|
|
929
|
+
// ON CREATE and ON MATCH (the latter via COALESCE so a pre-existing
|
|
930
|
+
// value isn't overwritten if it differs — which would itself be a
|
|
931
|
+
// graph-invariant violation worth surfacing). Pre-897 the missing
|
|
932
|
+
// accountId fingerprint produced :AdminUser nodes that migration 004
|
|
933
|
+
// pruned silently, costing the admin pin during onboarding.
|
|
934
|
+
const result = await session.run(`MERGE (au:AdminUser {userId: $userId})
|
|
935
|
+
ON CREATE SET au.accountId = $accountId,
|
|
936
|
+
au.name = $name,
|
|
937
|
+
au.createdAt = $createdAt
|
|
938
|
+
ON MATCH SET au.accountId = COALESCE(au.accountId, $accountId),
|
|
939
|
+
au.name = $name,
|
|
940
|
+
au.updatedAt = $createdAt
|
|
941
|
+
WITH au
|
|
942
|
+
MATCH (b:LocalBusiness {accountId: $accountId})
|
|
943
|
+
MERGE (au)-[r:ADMIN_OF]->(b)
|
|
944
|
+
ON CREATE SET r.role = 'admin', r.grantedAt = $createdAt
|
|
945
|
+
WITH au
|
|
946
|
+
OPTIONAL MATCH (existingPerson:Person {accountId: $accountId})
|
|
947
|
+
WHERE toLower(existingPerson.givenName) = toLower($givenName)
|
|
948
|
+
AND coalesce(toLower(existingPerson.familyName), '') = coalesce(toLower($familyName), '')
|
|
949
|
+
WITH au, existingPerson
|
|
950
|
+
CALL {
|
|
951
|
+
WITH au, existingPerson
|
|
952
|
+
WITH au, existingPerson WHERE existingPerson IS NOT NULL
|
|
953
|
+
MERGE (au)-[:OWNS]->(existingPerson)
|
|
954
|
+
RETURN true AS reused
|
|
955
|
+
UNION
|
|
956
|
+
WITH au, existingPerson
|
|
957
|
+
WITH au WHERE existingPerson IS NULL
|
|
958
|
+
CREATE (newPerson:Person {
|
|
959
|
+
accountId: $accountId,
|
|
960
|
+
givenName: $givenName,
|
|
961
|
+
familyName: $familyName,
|
|
962
|
+
role: 'admin-personal',
|
|
963
|
+
scope: 'admin',
|
|
964
|
+
embedding: $personEmbedding,
|
|
965
|
+
createdAt: $createdAt
|
|
966
|
+
})
|
|
967
|
+
MERGE (au)-[:OWNS]->(newPerson)
|
|
968
|
+
RETURN false AS reused
|
|
969
|
+
}
|
|
970
|
+
RETURN reused`, { userId, name: trimmedName, createdAt, accountId: ACCOUNT_ID, givenName, familyName, personEmbedding });
|
|
971
|
+
if (result.records.length > 0) {
|
|
972
|
+
personReused = result.records[0].get("reused");
|
|
973
|
+
}
|
|
974
|
+
// post-write assertion mirroring the one in neo4j-store.ts.
|
|
975
|
+
// MATCH back the AdminUser we just wrote and verify every required
|
|
976
|
+
// field landed. Loud-fail the tool call if accountId or name is null
|
|
977
|
+
// so a Cypher regression that drops the field is grep-detectable.
|
|
978
|
+
const verify = await session.run(`MATCH (au:AdminUser {userId: $userId})
|
|
979
|
+
RETURN coalesce(au.accountId, '') AS accountId,
|
|
980
|
+
coalesce(au.name, '') AS name`, { userId });
|
|
981
|
+
const verifiedAccountId = verify.records[0]?.get("accountId") || "";
|
|
982
|
+
const verifiedName = verify.records[0]?.get("name") || "";
|
|
983
|
+
if (!verifiedAccountId || !verifiedName) {
|
|
984
|
+
throw new Error(`post-write assertion failed: AdminUser userId=${userIdShort} accountId=${verifiedAccountId || "(null)"} name=${verifiedName || "(null)"} — required fields missing after MERGE`);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
finally {
|
|
988
|
+
await session.close();
|
|
989
|
+
}
|
|
990
|
+
console.error(`[admin] admin-add success userId=${userIdShort} accountId=${ACCOUNT_ID} name=${name.trim()} required-fields=ok personReused=${personReused}`);
|
|
991
|
+
}
|
|
992
|
+
catch (err) {
|
|
993
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
994
|
+
console.error(`[admin-auth-store] action=add userId=${userIdShort} result=fail store=neo4j error=${errMsg}`);
|
|
995
|
+
return {
|
|
996
|
+
content: [{
|
|
997
|
+
type: "text",
|
|
998
|
+
text: `${TAG} users.json + account.json updated for userId ${userId} (PIN: ${plaintextPin}); Neo4j sync FAILED — manual reconciliation needed: ${errMsg}`,
|
|
999
|
+
}],
|
|
1000
|
+
isError: true,
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
console.error(`${TAG} [admin-identity] adminuser-bound userId=${userIdShort} name=${name.trim()} personReused=${personReused}`);
|
|
1004
|
+
console.error(`${TAG} admin added: userId=${userId} userName=${name.trim()} accountId=${ACCOUNT_ID} role=admin addedBy=${callerUserId ?? "unknown"}`);
|
|
1005
|
+
return {
|
|
1006
|
+
content: [{
|
|
1007
|
+
type: "text",
|
|
1008
|
+
text: `Admin added successfully.\n\n- **Name:** ${name.trim()}\n- **userId:** ${userId}\n- **PIN:** ${plaintextPin}\n- **Role:** admin\n\nShare the PIN with ${name.trim()} so they can log in.`,
|
|
1009
|
+
}],
|
|
1010
|
+
};
|
|
1011
|
+
});
|
|
1012
|
+
eagerTool(server, "admin-remove", "Remove an admin from this account. Removes them from the account's admins list (account.json) and deletes the ADMIN_OF relationship in Neo4j. Does NOT remove the device-level user entry (they may admin other accounts). Cannot remove the last admin on the account.", {
|
|
1013
|
+
userId: z.string().describe("The userId of the admin to remove (use admin-list to find userIds)"),
|
|
1014
|
+
}, async ({ userId }) => {
|
|
1015
|
+
if (!ACCOUNT_ID)
|
|
1016
|
+
return refuseNoAccount("admin-remove");
|
|
1017
|
+
const TAG = "[admin]";
|
|
1018
|
+
const callerUserId = process.env.USER_ID;
|
|
1019
|
+
// Read account.json and validate
|
|
1020
|
+
let config;
|
|
1021
|
+
let admins;
|
|
1022
|
+
try {
|
|
1023
|
+
config = await readAccountConfig();
|
|
1024
|
+
admins = (config.admins ?? []);
|
|
1025
|
+
}
|
|
1026
|
+
catch (err) {
|
|
1027
|
+
return { content: [{ type: "text", text: `${TAG} Failed to read account config: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
1028
|
+
}
|
|
1029
|
+
const targetIndex = admins.findIndex(a => a.userId === userId);
|
|
1030
|
+
if (targetIndex === -1) {
|
|
1031
|
+
return { content: [{ type: "text", text: `${TAG} User ${userId} is not an admin of this account.` }], isError: true };
|
|
1032
|
+
}
|
|
1033
|
+
if (admins.length <= 1) {
|
|
1034
|
+
return { content: [{ type: "text", text: `${TAG} Cannot remove the last admin. At least one admin must remain on the account.` }], isError: true };
|
|
1035
|
+
}
|
|
1036
|
+
// Resolve the admin's name from Neo4j (canonical) for the confirmation
|
|
1037
|
+
// message. Best-effort — fall back to userId if the graph is unreachable.
|
|
1038
|
+
let removedName = userId;
|
|
1039
|
+
try {
|
|
1040
|
+
const session = getSession();
|
|
1041
|
+
try {
|
|
1042
|
+
const result = await session.run(`MATCH (au:AdminUser {userId: $userId}) RETURN au.name AS name LIMIT 1`, { userId });
|
|
1043
|
+
if (result.records.length > 0) {
|
|
1044
|
+
const name = result.records[0].get("name");
|
|
1045
|
+
if (name && name.trim())
|
|
1046
|
+
removedName = name.trim();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
finally {
|
|
1050
|
+
await session.close();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
catch { /* name lookup is best-effort */ }
|
|
1054
|
+
// 1. Remove from account.json — single-file write through the shared
|
|
1055
|
+
// chokepoint helper. users.json is intentionally untouched (the user may
|
|
1056
|
+
// admin other accounts on this device); the helper logs `usersJsonResult=skip`.
|
|
1057
|
+
const removeResult = removeAdminFromAccount({
|
|
1058
|
+
userId,
|
|
1059
|
+
accountDir: getAccountDir(),
|
|
1060
|
+
caller: "admin-remove",
|
|
1061
|
+
});
|
|
1062
|
+
if (removeResult.accountJsonResult === "fail") {
|
|
1063
|
+
return { content: [{ type: "text", text: `${TAG} Failed to write account.json: ${removeResult.accountError ?? "unknown error"}` }], isError: true };
|
|
1064
|
+
}
|
|
1065
|
+
// 2. Delete ADMIN_OF relationship in Neo4j — partial failure is a warning
|
|
1066
|
+
let neo4jWarning = "";
|
|
1067
|
+
try {
|
|
1068
|
+
const session = getSession();
|
|
1069
|
+
try {
|
|
1070
|
+
await session.run(`MATCH (au:AdminUser {userId: $userId})-[r:ADMIN_OF]->(b:LocalBusiness {accountId: $accountId})
|
|
1071
|
+
DELETE r`, { userId, accountId: ACCOUNT_ID });
|
|
1072
|
+
}
|
|
1073
|
+
finally {
|
|
1074
|
+
await session.close();
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
catch (err) {
|
|
1078
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
1079
|
+
console.error(`${TAG} Neo4j sync failed during admin-remove: userId=${userId} error=${errMsg}`);
|
|
1080
|
+
neo4jWarning = ` Note: Neo4j relationship deletion failed (${errMsg}) — will be reconciled on next seed.`;
|
|
1081
|
+
}
|
|
1082
|
+
console.error(`${TAG} admin removed: userId=${userId} accountId=${ACCOUNT_ID} removedBy=${callerUserId ?? "unknown"}`);
|
|
1083
|
+
return {
|
|
1084
|
+
content: [{
|
|
1085
|
+
type: "text",
|
|
1086
|
+
text: `Removed ${removedName} from this account's admin list. Their PIN still works for any other accounts they administer.${neo4jWarning}`,
|
|
1087
|
+
}],
|
|
1088
|
+
};
|
|
1089
|
+
});
|
|
1090
|
+
eagerTool(server, "admin-list", "List all admins for this account with their names and roles.", {}, async () => {
|
|
1091
|
+
if (!ACCOUNT_ID)
|
|
1092
|
+
return refuseNoAccount("admin-list");
|
|
1093
|
+
const TAG = "[admin]";
|
|
1094
|
+
let admins;
|
|
1095
|
+
try {
|
|
1096
|
+
const config = await readAccountConfig();
|
|
1097
|
+
admins = (config.admins ?? []);
|
|
1098
|
+
}
|
|
1099
|
+
catch (err) {
|
|
1100
|
+
return { content: [{ type: "text", text: `${TAG} Failed to read account config: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
1101
|
+
}
|
|
1102
|
+
if (admins.length === 0) {
|
|
1103
|
+
return { content: [{ type: "text", text: `${TAG} No admins configured for this account.` }] };
|
|
1104
|
+
}
|
|
1105
|
+
// Enrich with names from Neo4j AdminUser (canonical). Best
|
|
1106
|
+
// effort — render "(unknown)" for any userId without a graph entry.
|
|
1107
|
+
const userMap = new Map();
|
|
1108
|
+
try {
|
|
1109
|
+
const session = getSession();
|
|
1110
|
+
try {
|
|
1111
|
+
const result = await session.run(`UNWIND $userIds AS uid
|
|
1112
|
+
MATCH (au:AdminUser {userId: uid})
|
|
1113
|
+
RETURN au.userId AS userId, au.name AS name`, { userIds: admins.map(a => a.userId) });
|
|
1114
|
+
for (const record of result.records) {
|
|
1115
|
+
const uid = record.get("userId");
|
|
1116
|
+
const name = record.get("name");
|
|
1117
|
+
if (name && name.trim())
|
|
1118
|
+
userMap.set(uid, name.trim());
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
finally {
|
|
1122
|
+
await session.close();
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
catch { /* name lookup is best-effort — userIds shown when graph is unreachable */ }
|
|
1126
|
+
const lines = admins.map(a => {
|
|
1127
|
+
const name = userMap.get(a.userId) ?? "(unknown)";
|
|
1128
|
+
return `- **${name}** — role: ${a.role}, userId: ${a.userId}`;
|
|
1129
|
+
});
|
|
1130
|
+
return {
|
|
1131
|
+
content: [{ type: "text", text: `Admins for this account:\n\n${lines.join("\n")}` }],
|
|
1132
|
+
};
|
|
1133
|
+
});
|
|
1134
|
+
eagerTool(server, "admin-update-pin", "Update an existing admin user's PIN. Defaults to the calling admin if no userId is given. PIN must be at least 4 digits and unique across all users on the device. PINs are device-level: updating another admin's PIN does not require shared account membership — any admin on the device can rotate any other admin's PIN, matching the existing trust model used by admin-remove.", {
|
|
1135
|
+
userId: z.string().optional().describe("The userId of the admin whose PIN to update. Defaults to the caller (the admin invoking this tool)."),
|
|
1136
|
+
newPin: z.string().describe("The new PIN. Minimum 4 digits, no upper bound."),
|
|
1137
|
+
}, async ({ userId: targetUserId, newPin }) => {
|
|
1138
|
+
if (!ACCOUNT_ID)
|
|
1139
|
+
return refuseNoAccount("admin-update-pin");
|
|
1140
|
+
const TAG = "[admin-update-pin]";
|
|
1141
|
+
const callerUserId = process.env.USER_ID;
|
|
1142
|
+
const userId = targetUserId ?? callerUserId;
|
|
1143
|
+
const userIdLabel = userId ? userId.slice(0, 8) : "unknown";
|
|
1144
|
+
if (!userId) {
|
|
1145
|
+
console.error(`${TAG} userId=${userIdLabel} result=user-not-found reason=no-caller-context`);
|
|
1146
|
+
return { content: [{ type: "text", text: `${TAG} No userId supplied and no caller context — cannot update.` }], isError: true };
|
|
1147
|
+
}
|
|
1148
|
+
if (newPin.length < 4) {
|
|
1149
|
+
console.error(`${TAG} userId=${userIdLabel} result=too-short`);
|
|
1150
|
+
return { content: [{ type: "text", text: `${TAG} PIN must be at least 4 digits.` }], isError: true };
|
|
1151
|
+
}
|
|
1152
|
+
let users;
|
|
1153
|
+
try {
|
|
1154
|
+
users = readUsersJson();
|
|
1155
|
+
}
|
|
1156
|
+
catch (err) {
|
|
1157
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
1158
|
+
console.error(`${TAG} userId=${userIdLabel} result=user-not-found reason=users-json-read-failed`);
|
|
1159
|
+
console.error(`[admin-auth-store] action=update-pin userId=${userIdLabel} result=fail store=users error=${errMsg}`);
|
|
1160
|
+
return { content: [{ type: "text", text: `${TAG} ${errMsg}` }], isError: true };
|
|
1161
|
+
}
|
|
1162
|
+
const targetIndex = users.findIndex(u => u.userId === userId);
|
|
1163
|
+
if (targetIndex === -1) {
|
|
1164
|
+
console.error(`${TAG} userId=${userIdLabel} result=user-not-found`);
|
|
1165
|
+
console.error(`[admin-auth-store] action=update-pin userId=${userIdLabel} result=fail store=users error=user-not-found`);
|
|
1166
|
+
return { content: [{ type: "text", text: `${TAG} User ${userId} not found in users.json.` }], isError: true };
|
|
1167
|
+
}
|
|
1168
|
+
const newHash = hashPin(newPin);
|
|
1169
|
+
const collidesWithOther = users.some((u, i) => i !== targetIndex && u.pin === newHash);
|
|
1170
|
+
if (collidesWithOther) {
|
|
1171
|
+
console.error(`${TAG} userId=${userIdLabel} result=collision`);
|
|
1172
|
+
console.error(`[admin-auth-store] action=update-pin userId=${userIdLabel} result=fail store=users error=pin-collision`);
|
|
1173
|
+
return { content: [{ type: "text", text: `${TAG} That PIN is already in use by another user. Choose a different PIN.` }], isError: true };
|
|
1174
|
+
}
|
|
1175
|
+
users[targetIndex].pin = newHash;
|
|
1176
|
+
try {
|
|
1177
|
+
writeUsersJson(users);
|
|
1178
|
+
}
|
|
1179
|
+
catch (err) {
|
|
1180
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
1181
|
+
console.error(`[admin-auth-store] action=update-pin userId=${userIdLabel} result=fail store=users error=${errMsg}`);
|
|
1182
|
+
return { content: [{ type: "text", text: `${TAG} Failed to write users.json: ${errMsg}` }], isError: true };
|
|
1183
|
+
}
|
|
1184
|
+
console.error(`${TAG} userId=${userIdLabel} result=ok`);
|
|
1185
|
+
console.error(`[admin-auth-store] action=update-pin userId=${userIdLabel} result=ok store=users`);
|
|
1186
|
+
const self = userId === callerUserId;
|
|
1187
|
+
return {
|
|
1188
|
+
content: [{ type: "text", text: `PIN updated${self ? "" : ` for userId ${userId}`}. The new PIN takes effect on the next login.` }],
|
|
1189
|
+
};
|
|
1190
|
+
});
|
|
1191
|
+
server.tool("agent-image", "Upload, update, or remove an agent's image. action=set: copy the file at filePath to the agent's assets directory and update config.json with image URL and shape. action=remove: delete the image file and clear the image fields from config.json. imageShape: 'circle' for avatars/icons, 'rounded' for logos.", {
|
|
1192
|
+
agentSlug: z.string().describe("Agent slug (e.g. 'coaching', 'sales')"),
|
|
1193
|
+
action: z.enum(["set", "remove"]),
|
|
1194
|
+
filePath: z.string().optional().describe("Absolute path to the image file (required for action=set)"),
|
|
1195
|
+
imageShape: z.enum(["circle", "rounded"]).optional().describe("Image shape: circle for avatars, rounded for logos (required for action=set)"),
|
|
1196
|
+
}, async ({ agentSlug, action, filePath, imageShape }) => {
|
|
1197
|
+
if (!ACCOUNT_ID)
|
|
1198
|
+
return refuseNoAccount("agent-image");
|
|
1199
|
+
const VALID_IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"];
|
|
1200
|
+
try {
|
|
1201
|
+
const accountDir = getAccountDir();
|
|
1202
|
+
const agentDir = resolve(accountDir, "agents", agentSlug);
|
|
1203
|
+
const configPath = resolve(agentDir, "config.json");
|
|
1204
|
+
if (!existsSync(configPath)) {
|
|
1205
|
+
return {
|
|
1206
|
+
content: [{ type: "text", text: `Agent '${agentSlug}' not found — no config.json at agents/${agentSlug}/` }],
|
|
1207
|
+
isError: true,
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
if (action === "set") {
|
|
1211
|
+
if (!filePath) {
|
|
1212
|
+
return {
|
|
1213
|
+
content: [{ type: "text", text: "filePath is required for action=set" }],
|
|
1214
|
+
isError: true,
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
if (!imageShape) {
|
|
1218
|
+
return {
|
|
1219
|
+
content: [{ type: "text", text: "imageShape is required for action=set — use 'circle' for avatars/icons or 'rounded' for logos" }],
|
|
1220
|
+
isError: true,
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
if (!existsSync(filePath)) {
|
|
1224
|
+
return {
|
|
1225
|
+
content: [{ type: "text", text: `File not found: ${filePath}` }],
|
|
1226
|
+
isError: true,
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
// Validate image extension
|
|
1230
|
+
const ext = filePath.toLowerCase().split(".").pop();
|
|
1231
|
+
if (!ext || !VALID_IMAGE_EXTENSIONS.includes(`.${ext}`)) {
|
|
1232
|
+
return {
|
|
1233
|
+
content: [{ type: "text", text: `Not a valid image file. Supported formats: ${VALID_IMAGE_EXTENSIONS.join(", ")}` }],
|
|
1234
|
+
isError: true,
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
// Copy file to agent assets directory
|
|
1238
|
+
const assetsDir = resolve(agentDir, "assets");
|
|
1239
|
+
const { mkdirSync: mkdirSyncFs, copyFileSync, writeFileSync: writeFileSyncFs, renameSync } = await import("node:fs");
|
|
1240
|
+
mkdirSyncFs(assetsDir, { recursive: true });
|
|
1241
|
+
const filename = `agent-image.${ext}`;
|
|
1242
|
+
const destPath = resolve(assetsDir, filename);
|
|
1243
|
+
copyFileSync(filePath, destPath);
|
|
1244
|
+
// Atomic config update: read → modify → write temp → rename
|
|
1245
|
+
const configRaw = await readFile(configPath, "utf-8");
|
|
1246
|
+
let config;
|
|
1247
|
+
try {
|
|
1248
|
+
config = JSON.parse(configRaw);
|
|
1249
|
+
}
|
|
1250
|
+
catch {
|
|
1251
|
+
config = {};
|
|
1252
|
+
}
|
|
1253
|
+
config.image = `/agent-assets/${agentSlug}/${filename}`;
|
|
1254
|
+
config.imageShape = imageShape;
|
|
1255
|
+
const tmpPath = configPath + ".tmp";
|
|
1256
|
+
writeFileSyncFs(tmpPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
1257
|
+
renameSync(tmpPath, configPath);
|
|
1258
|
+
console.error(`[agent-config] ${agentSlug}: image=${config.image} imageShape=${imageShape} (set)`);
|
|
1259
|
+
return {
|
|
1260
|
+
content: [{ type: "text", text: `Image set for agent '${agentSlug}':\n File: ${destPath}\n URL: ${config.image}\n Shape: ${imageShape}\n\nThe image is now accessible at ${config.image} and will appear in the public chat header.` }],
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
// action === "remove"
|
|
1264
|
+
const configRaw = await readFile(configPath, "utf-8");
|
|
1265
|
+
let config;
|
|
1266
|
+
try {
|
|
1267
|
+
config = JSON.parse(configRaw);
|
|
1268
|
+
}
|
|
1269
|
+
catch {
|
|
1270
|
+
config = {};
|
|
1271
|
+
}
|
|
1272
|
+
// Delete the image file if it exists
|
|
1273
|
+
if (typeof config.image === "string") {
|
|
1274
|
+
const filename = config.image.split("/").pop();
|
|
1275
|
+
if (filename) {
|
|
1276
|
+
const imgPath = resolve(agentDir, "assets", filename);
|
|
1277
|
+
if (existsSync(imgPath)) {
|
|
1278
|
+
const { unlinkSync } = await import("node:fs");
|
|
1279
|
+
unlinkSync(imgPath);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
// Remove image fields from config
|
|
1284
|
+
delete config.image;
|
|
1285
|
+
delete config.imageShape;
|
|
1286
|
+
const { writeFileSync: writeFileSyncRm, renameSync: renameSyncRm } = await import("node:fs");
|
|
1287
|
+
const tmpPath = configPath + ".tmp";
|
|
1288
|
+
writeFileSyncRm(tmpPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
1289
|
+
renameSyncRm(tmpPath, configPath);
|
|
1290
|
+
console.error(`[agent-config] ${agentSlug}: image removed`);
|
|
1291
|
+
return {
|
|
1292
|
+
content: [{ type: "text", text: `Image removed for agent '${agentSlug}'. The public chat header will fall back to the account brand logo.` }],
|
|
1293
|
+
};
|
|
1294
|
+
}
|
|
1295
|
+
catch (err) {
|
|
1296
|
+
console.error(`[agent-config] agent-image failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1297
|
+
return {
|
|
1298
|
+
content: [{ type: "text", text: `Failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
1299
|
+
isError: true,
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
// ---------------------------------------------------------------------------
|
|
1304
|
+
// Agent config tools — deterministic reads for agent configuration
|
|
1305
|
+
// ---------------------------------------------------------------------------
|
|
1306
|
+
server.tool("agent-config-read", "Read the full config.json for a specific public agent by slug. Returns the complete configuration including slug, displayName, model, plugins, status, and any other fields.", {
|
|
1307
|
+
slug: z.string().describe("Agent slug (directory name under agents/)"),
|
|
1308
|
+
}, async ({ slug }) => {
|
|
1309
|
+
if (!ACCOUNT_ID)
|
|
1310
|
+
return refuseNoAccount("agent-config-read");
|
|
1311
|
+
const TAG = "[admin:agent-config-read]";
|
|
1312
|
+
// Path traversal guard
|
|
1313
|
+
if (slug.includes("/") || slug.includes("\\") || slug.includes("..")) {
|
|
1314
|
+
console.error(`${TAG} rejected slug="${slug}" — contains path separator or traversal sequence`);
|
|
1315
|
+
return {
|
|
1316
|
+
content: [{ type: "text", text: `Invalid agent slug: "${slug}" — slug must not contain path separators or traversal sequences` }],
|
|
1317
|
+
isError: true,
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
try {
|
|
1321
|
+
const accountDir = getAccountDir();
|
|
1322
|
+
const configPath = resolve(accountDir, "agents", slug, "config.json");
|
|
1323
|
+
if (!existsSync(configPath)) {
|
|
1324
|
+
console.error(`${TAG} agent not found: slug="${slug}"`);
|
|
1325
|
+
return {
|
|
1326
|
+
content: [{ type: "text", text: `Agent "${slug}" not found — no config.json at agents/${slug}/` }],
|
|
1327
|
+
isError: true,
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
1331
|
+
JSON.parse(raw); // validate JSON before returning
|
|
1332
|
+
return {
|
|
1333
|
+
content: [{ type: "text", text: raw }],
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1336
|
+
catch (err) {
|
|
1337
|
+
console.error(`${TAG} failed for slug="${slug}": ${err instanceof Error ? err.message : String(err)}`);
|
|
1338
|
+
return {
|
|
1339
|
+
content: [{ type: "text", text: `Failed to read config for agent "${slug}": ${err instanceof Error ? err.message : String(err)}` }],
|
|
1340
|
+
isError: true,
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
server.tool("agent-list", "List all public (non-admin) agents with their full configuration: slug, displayName, model, plugins, status, and whether each is the account's default agent.", {}, async () => {
|
|
1345
|
+
if (!ACCOUNT_ID)
|
|
1346
|
+
return refuseNoAccount("agent-list");
|
|
1347
|
+
const TAG = "[admin:agent-list]";
|
|
1348
|
+
try {
|
|
1349
|
+
const accountDir = getAccountDir();
|
|
1350
|
+
const agentsDir = resolve(accountDir, "agents");
|
|
1351
|
+
if (!existsSync(agentsDir)) {
|
|
1352
|
+
return {
|
|
1353
|
+
content: [{ type: "text", text: JSON.stringify({ agents: [], skipped: [] }, null, 2) }],
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
// Best-effort defaultAgent lookup — don't fail the whole list if account.json is unreadable
|
|
1357
|
+
let defaultAgent;
|
|
1358
|
+
try {
|
|
1359
|
+
const accountConfig = await readAccountConfig();
|
|
1360
|
+
defaultAgent = accountConfig.defaultAgent;
|
|
1361
|
+
}
|
|
1362
|
+
catch (err) {
|
|
1363
|
+
console.error(`${TAG} failed to read account config for defaultAgent lookup: ${err instanceof Error ? err.message : String(err)}`);
|
|
1364
|
+
}
|
|
1365
|
+
const agents = [];
|
|
1366
|
+
const skipped = [];
|
|
1367
|
+
const entries = readdirSync(agentsDir, { withFileTypes: true });
|
|
1368
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
1369
|
+
if (!entry.isDirectory())
|
|
1370
|
+
continue;
|
|
1371
|
+
if (entry.name === "admin")
|
|
1372
|
+
continue;
|
|
1373
|
+
const configPath = resolve(agentsDir, entry.name, "config.json");
|
|
1374
|
+
if (!existsSync(configPath))
|
|
1375
|
+
continue;
|
|
1376
|
+
try {
|
|
1377
|
+
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
1378
|
+
agents.push({
|
|
1379
|
+
slug: entry.name,
|
|
1380
|
+
displayName: config.displayName ?? entry.name,
|
|
1381
|
+
model: config.model,
|
|
1382
|
+
plugins: config.plugins,
|
|
1383
|
+
status: config.status,
|
|
1384
|
+
isDefault: entry.name === defaultAgent,
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
catch (err) {
|
|
1388
|
+
console.error(`${TAG} failed to parse config.json for agent "${entry.name}" — skipping: ${err instanceof Error ? err.message : String(err)}`);
|
|
1389
|
+
skipped.push(entry.name);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
return {
|
|
1393
|
+
content: [{ type: "text", text: JSON.stringify({ agents, skipped }, null, 2) }],
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
catch (err) {
|
|
1397
|
+
console.error(`${TAG} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1398
|
+
return {
|
|
1399
|
+
content: [{ type: "text", text: `Failed to list agents: ${err instanceof Error ? err.message : String(err)}` }],
|
|
1400
|
+
isError: true,
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
eagerTool(server, "logs-read", "Read recent logs. Stream logs (type=agent-stream/error/session/public) are per-session — pass `sessionKey` (preferred) or the legacy `sessionId` alias to retrieve a single session's log from first [spawn] to final [process-exit]. type=agent-stream: per-session tool-use/tool-result archive (every `[tool-use]` and `[tool-result]` pair with full input + output JSON, plus raw Claude stream-json, agent events, and MCP server stderr via tee). USE THIS when investigating what an agent ACTUALLY did with its tools — server.log only carries `[persist] tool-call persisted` markers, not bodies. (`type=system` is a backwards-compatible alias for the same archive.) type=session: SSE events sent to client. type=error: Claude subprocess stderr (raw — NODE_DEBUG HTTP/NET/UNDICI traces land in agent-stream via the stream tee, not here). type=heartbeat: platform event dispatcher (check-due-events cron). type=public: public agent diagnostic log. type=server: platform server log. type=mcp: MCP server stderr (per-plugin raw). type=vnc: VNC browser viewer lifecycle.", {
|
|
1405
|
+
type: z.enum(["agent-stream", "system", "session", "error", "heartbeat", "public", "server", "mcp", "vnc"]).optional(),
|
|
1406
|
+
lines: z.number().optional(),
|
|
1407
|
+
sessionKey: z.string().optional(),
|
|
1408
|
+
sessionId: z.string().optional(),
|
|
1409
|
+
}, async ({ type, lines = 50, sessionKey, sessionId }) => {
|
|
1410
|
+
if (!ACCOUNT_ID)
|
|
1411
|
+
return refuseNoAccount("logs-read");
|
|
1412
|
+
try {
|
|
1413
|
+
// Account-scoped per-session log dir. `<installDir>/data/accounts/
|
|
1414
|
+
// <accountId>/logs/` mirrors the resolution in
|
|
1415
|
+
// `platform/scripts/logs-read.sh`. This dir may not exist on a Pi
|
|
1416
|
+
// where no claude session has yet tee'd stream output — that is NOT
|
|
1417
|
+
// a fatal condition for platform-scoped types like `server` / `vnc`,
|
|
1418
|
+
// which resolve against CONFIG_DIR below. Task 579 — the previous
|
|
1419
|
+
// early-existence check returned "Log directory does not exist" for
|
|
1420
|
+
// every type, including those whose actual target file lived
|
|
1421
|
+
// elsewhere. Each branch now checks its own resolved path.
|
|
1422
|
+
const LOG_DIR = resolve(getAccountDir(), "logs");
|
|
1423
|
+
// sessionKey is the single identifier on disk.
|
|
1424
|
+
// `sessionId` is retained as a legacy alias that maps to the
|
|
1425
|
+
// sessionKey-named file will collapse the alias in the UI.
|
|
1426
|
+
const idForResolve = sessionKey ?? sessionId;
|
|
1427
|
+
if (idForResolve) {
|
|
1428
|
+
if (!existsSync(LOG_DIR)) {
|
|
1429
|
+
return {
|
|
1430
|
+
content: [{
|
|
1431
|
+
type: "text",
|
|
1432
|
+
text: `No per-session logs for this account yet (resolved dir does not exist on disk): ${LOG_DIR}. The directory is created on first claude session spawn.`,
|
|
1433
|
+
}],
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
const prefixMap = {
|
|
1437
|
+
"agent-stream": "claude-agent-stream",
|
|
1438
|
+
system: "claude-agent-stream", // backwards-compatible alias for agent-stream
|
|
1439
|
+
error: "claude-agent-stderr",
|
|
1440
|
+
session: "sse-events",
|
|
1441
|
+
public: "public-agent-stream",
|
|
1442
|
+
};
|
|
1443
|
+
const resolvedType = type ?? "agent-stream";
|
|
1444
|
+
const prefix = prefixMap[resolvedType];
|
|
1445
|
+
if (!prefix) {
|
|
1446
|
+
return {
|
|
1447
|
+
content: [{ type: "text", text: `type=${resolvedType} is not per-session. Valid per-session types: agent-stream, error, session, public. For platform-scoped types (server, vnc, heartbeat, mcp) omit the id.` }],
|
|
1448
|
+
isError: true,
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
const fileName = `${prefix}-${idForResolve}.log`;
|
|
1452
|
+
const filePath = resolve(LOG_DIR, fileName);
|
|
1453
|
+
if (existsSync(filePath)) {
|
|
1454
|
+
const result = execFileSync("tail", ["-n", String(lines), filePath], { timeout: 5000 }).toString();
|
|
1455
|
+
return { content: [{ type: "text", text: `# ${fileName}\n\n${result}` }] };
|
|
1456
|
+
}
|
|
1457
|
+
// Emit missing-on-resolve so the writer-side existence contract is
|
|
1458
|
+
// the authoritative signal. One such line on any device is a P0.
|
|
1459
|
+
try {
|
|
1460
|
+
const ts = new Date().toISOString();
|
|
1461
|
+
appendFileSync(resolve(CONFIG_DIR, "logs", "server.log"), `${ts} [log-tee] missing-on-resolve sessionKey=${idForResolve.slice(0, 8)} surface=mcp-logs-read reason="file-not-found-in-LOG_DIR"\n`);
|
|
1462
|
+
}
|
|
1463
|
+
catch {
|
|
1464
|
+
// best-effort
|
|
1465
|
+
}
|
|
1466
|
+
return {
|
|
1467
|
+
content: [{
|
|
1468
|
+
type: "text",
|
|
1469
|
+
text: `No log file found for id=${idForResolve} type=${resolvedType}. tried=[${filePath}] reason=file-not-found`,
|
|
1470
|
+
}],
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
// Note: no early existence check on LOG_DIR here. Platform-scoped
|
|
1474
|
+
// types (server, vnc, heartbeat) resolve against CONFIG_DIR below
|
|
1475
|
+
// and must run even when the account log dir has not been created
|
|
1476
|
+
// yet. Account-scoped types check LOG_DIR before they reach for it.
|
|
1477
|
+
// --- Session-key filtered mode: grep across log files ---
|
|
1478
|
+
if (sessionKey) {
|
|
1479
|
+
const prefixes = {
|
|
1480
|
+
"agent-stream": "claude-agent-stream-",
|
|
1481
|
+
system: "claude-agent-stream-", // backwards-compatible alias
|
|
1482
|
+
error: "claude-agent-stderr-",
|
|
1483
|
+
session: "sse-events-",
|
|
1484
|
+
public: "public-agent-stream-",
|
|
1485
|
+
mcp: "mcp-",
|
|
1486
|
+
};
|
|
1487
|
+
// When a type is explicitly provided, search only that type's files.
|
|
1488
|
+
// When type is omitted, search all prefix-based log types (excludes heartbeat — no session context).
|
|
1489
|
+
// server and vnc are single-file (configDir-scoped), so they have no prefix search;
|
|
1490
|
+
// their matches are produced by dedicated blocks below.
|
|
1491
|
+
const searchPrefixes = type && type !== "heartbeat" && type !== "server" && type !== "vnc" && prefixes[type]
|
|
1492
|
+
? { [type]: prefixes[type] }
|
|
1493
|
+
: (type === "server" || type === "vnc") ? {} : prefixes;
|
|
1494
|
+
// LOG_DIR may not exist on a Pi with no per-session logs yet. The
|
|
1495
|
+
// platform-scoped fallback dirs (CONFIG_DIR/logs/) are searched
|
|
1496
|
+
// below; this branch simply contributes nothing rather than
|
|
1497
|
+
// throwing on readdir.
|
|
1498
|
+
const allFiles = existsSync(LOG_DIR)
|
|
1499
|
+
? readdirSync(LOG_DIR).filter(f => f.endsWith(".log"))
|
|
1500
|
+
: [];
|
|
1501
|
+
const sections = [];
|
|
1502
|
+
// Search account-scoped prefix-based log files
|
|
1503
|
+
for (const [logType, prefix] of Object.entries(searchPrefixes)) {
|
|
1504
|
+
const typeFiles = allFiles
|
|
1505
|
+
.filter(f => f.startsWith(prefix))
|
|
1506
|
+
.sort(); // chronological by date suffix
|
|
1507
|
+
for (const file of typeFiles) {
|
|
1508
|
+
const filePath = resolve(LOG_DIR, file);
|
|
1509
|
+
try {
|
|
1510
|
+
const result = execFileSync("grep", ["-F", sessionKey, filePath], { timeout: 5000 }).toString().trim();
|
|
1511
|
+
if (result) {
|
|
1512
|
+
sections.push(`## ${file} (${logType})\n${result}`);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
catch (grepErr) {
|
|
1516
|
+
// grep exits 1 when no lines match — that's not an error
|
|
1517
|
+
const exitCode = grepErr.status;
|
|
1518
|
+
if (exitCode !== 1)
|
|
1519
|
+
throw grepErr;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
// Search server.log (platform-scoped, in configDir — not account-scoped)
|
|
1524
|
+
const includeServer = !type || type === "server";
|
|
1525
|
+
if (includeServer) {
|
|
1526
|
+
const serverLog = resolve(CONFIG_DIR, "logs", "server.log");
|
|
1527
|
+
if (existsSync(serverLog)) {
|
|
1528
|
+
try {
|
|
1529
|
+
const result = execFileSync("grep", ["-F", sessionKey, serverLog], { timeout: 5000 }).toString().trim();
|
|
1530
|
+
if (result) {
|
|
1531
|
+
sections.push(`## server.log (server)\n${result}`);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
catch (grepErr) {
|
|
1535
|
+
const exitCode = grepErr.status;
|
|
1536
|
+
if (exitCode !== 1)
|
|
1537
|
+
throw grepErr;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
// Search vnc-boot.log (platform-scoped, in configDir) — the
|
|
1542
|
+
// consolidated VNC browser viewer lifecycle log.
|
|
1543
|
+
const includeVnc = !type || type === "vnc";
|
|
1544
|
+
if (includeVnc) {
|
|
1545
|
+
const vncLog = resolve(CONFIG_DIR, "logs", "vnc-boot.log");
|
|
1546
|
+
if (existsSync(vncLog)) {
|
|
1547
|
+
try {
|
|
1548
|
+
const result = execFileSync("grep", ["-F", sessionKey, vncLog], { timeout: 5000 }).toString().trim();
|
|
1549
|
+
if (result) {
|
|
1550
|
+
sections.push(`## vnc-boot.log (vnc)\n${result}`);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
catch (grepErr) {
|
|
1554
|
+
const exitCode = grepErr.status;
|
|
1555
|
+
if (exitCode !== 1)
|
|
1556
|
+
throw grepErr;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (sections.length === 0) {
|
|
1561
|
+
return { content: [{ type: "text", text: `No log lines found for session key "${sessionKey}".` }] };
|
|
1562
|
+
}
|
|
1563
|
+
return { content: [{ type: "text", text: `# Session timeline: ${sessionKey}\n\n${sections.join("\n\n")}` }] };
|
|
1564
|
+
}
|
|
1565
|
+
// --- Standard mode: tail most recent file of the requested type ---
|
|
1566
|
+
const resolvedType = type ?? "agent-stream";
|
|
1567
|
+
// Heartbeat log is a single fixed file, not prefix-based
|
|
1568
|
+
if (resolvedType === "heartbeat") {
|
|
1569
|
+
const logFile = resolve(LOG_DIR, "check-due-events.log");
|
|
1570
|
+
if (!existsSync(logFile)) {
|
|
1571
|
+
return { content: [{ type: "text", text: "No heartbeat log found yet. The platform cron may not have run." }] };
|
|
1572
|
+
}
|
|
1573
|
+
const result = execFileSync("tail", ["-n", String(lines), logFile], {
|
|
1574
|
+
timeout: 5000,
|
|
1575
|
+
}).toString();
|
|
1576
|
+
return { content: [{ type: "text", text: `# check-due-events.log\n\n${result}` }] };
|
|
1577
|
+
}
|
|
1578
|
+
// Server log is a single fixed file in configDir (platform-scoped, not account-scoped)
|
|
1579
|
+
if (resolvedType === "server") {
|
|
1580
|
+
const serverLog = resolve(CONFIG_DIR, "logs", "server.log");
|
|
1581
|
+
if (!existsSync(serverLog)) {
|
|
1582
|
+
return { content: [{ type: "text", text: `No server log found at ${serverLog}` }] };
|
|
1583
|
+
}
|
|
1584
|
+
const result = execFileSync("tail", ["-n", String(lines), serverLog], {
|
|
1585
|
+
timeout: 5000,
|
|
1586
|
+
}).toString();
|
|
1587
|
+
return { content: [{ type: "text", text: `# server.log\n\n${result}` }] };
|
|
1588
|
+
}
|
|
1589
|
+
// VNC log is a single platform-scoped file covering the full
|
|
1590
|
+
// browser viewer lifecycle — see tool description for signals.
|
|
1591
|
+
if (resolvedType === "vnc") {
|
|
1592
|
+
const vncLogFile = resolve(CONFIG_DIR, "logs", "vnc-boot.log");
|
|
1593
|
+
if (!existsSync(vncLogFile)) {
|
|
1594
|
+
return { content: [{ type: "text", text: `No vnc-boot log found at ${vncLogFile}` }] };
|
|
1595
|
+
}
|
|
1596
|
+
const result = execFileSync("tail", ["-n", String(lines), vncLogFile], {
|
|
1597
|
+
timeout: 5000,
|
|
1598
|
+
}).toString();
|
|
1599
|
+
return { content: [{ type: "text", text: `# vnc-boot.log\n\n${result}` }] };
|
|
1600
|
+
}
|
|
1601
|
+
// agent-stream and the legacy system alias both map to
|
|
1602
|
+
// claude-agent-stream-. The fall-through default also covers them.
|
|
1603
|
+
const prefix = resolvedType === "error" ? "claude-agent-stderr-"
|
|
1604
|
+
: resolvedType === "session" ? "sse-events-"
|
|
1605
|
+
: resolvedType === "public" ? "public-agent-stream-"
|
|
1606
|
+
: resolvedType === "mcp" ? "mcp-"
|
|
1607
|
+
: "claude-agent-stream-";
|
|
1608
|
+
// Find the most recently modified file with the matching prefix.
|
|
1609
|
+
// LOG_DIR may not exist yet on a Pi with no per-session logs; return
|
|
1610
|
+
// the resolved path in the error envelope so the operator can
|
|
1611
|
+
// verify on disk in one step rather than re-tracing the resolver.
|
|
1612
|
+
if (!existsSync(LOG_DIR)) {
|
|
1613
|
+
return {
|
|
1614
|
+
content: [{
|
|
1615
|
+
type: "text",
|
|
1616
|
+
text: `No per-session logs for this account yet (resolved dir does not exist on disk): ${LOG_DIR}. The directory is created on first claude session spawn.`,
|
|
1617
|
+
}],
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
const match = readdirSync(LOG_DIR)
|
|
1621
|
+
.filter(f => f.startsWith(prefix) && f.endsWith(".log"))
|
|
1622
|
+
.map(f => ({ file: f, mtime: statSync(resolve(LOG_DIR, f)).mtimeMs }))
|
|
1623
|
+
.sort((a, b) => b.mtime - a.mtime)[0];
|
|
1624
|
+
if (!match) {
|
|
1625
|
+
return { content: [{ type: "text", text: `No log file found for type '${resolvedType}' (resolved dir: ${LOG_DIR}, prefix: ${prefix})` }] };
|
|
1626
|
+
}
|
|
1627
|
+
const logFile = resolve(LOG_DIR, match.file);
|
|
1628
|
+
const result = execFileSync("tail", ["-n", String(lines), logFile], {
|
|
1629
|
+
timeout: 5000,
|
|
1630
|
+
}).toString();
|
|
1631
|
+
return { content: [{ type: "text", text: `# ${match.file}\n\n${result}` }] };
|
|
1632
|
+
}
|
|
1633
|
+
catch (err) {
|
|
1634
|
+
return { content: [{ type: "text", text: `Failed to read logs: ${err instanceof Error ? err.message : String(err)}` }] };
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
// operator-authored skills are written to disk as a plugin so the
|
|
1638
|
+
// existing plugin-manifest loader picks them up (parsePluginFrontmatter +
|
|
1639
|
+
// assemblePublicPluginContent + loadEmbeddedPlugins all read from
|
|
1640
|
+
// <PLATFORM_ROOT>/plugins/<dir>/). Canonical = <accountDir>/plugins/<plugin>
|
|
1641
|
+
// survives installer rmSync (data/ excluded); the mirror under
|
|
1642
|
+
// <PLATFORM_ROOT>/plugins/<plugin> is rehydrated at admin session start by
|
|
1643
|
+
// autoDeliverUserPlugins. The agent supplies pluginName/skillName/body —
|
|
1644
|
+
// path is computed by this tool from ACCOUNT_ID. Symmetric write counterpart
|
|
1645
|
+
// to plugin-read.
|
|
1646
|
+
eagerTool(server, "store-skill", "Save an operator-authored skill on disk as part of an admin-managed plugin. " +
|
|
1647
|
+
"The skill becomes immediately discoverable by the admin agent (and the public agent if publicEmbed=true). " +
|
|
1648
|
+
"Path is computed internally from the active account; the agent supplies content + names only. " +
|
|
1649
|
+
"Re-running for the same skillName overwrites in place (drops orphan reference files).", {
|
|
1650
|
+
pluginName: z.string().describe("Plugin directory name in lowercase kebab-case (e.g. 'beacons-skills'). Must not collide with a shipped plugin name."),
|
|
1651
|
+
skillName: z.string().describe("Skill directory name in lowercase kebab-case (e.g. 'lead-capture')."),
|
|
1652
|
+
description: z.string().describe("One-sentence skill description used in SKILL.md frontmatter and as the trigger hint for the agent."),
|
|
1653
|
+
publicEmbed: z.boolean().describe("True to embed this skill in the public agent's system prompt; false for admin-only."),
|
|
1654
|
+
body: z.string().describe("SKILL.md body content WITHOUT frontmatter. Frontmatter (name, description, publicEmbed) is composed by the tool."),
|
|
1655
|
+
references: z.array(z.object({
|
|
1656
|
+
filename: z.string().describe("Reference filename matching ^[a-z0-9-]+\\.md$ (no path separators)."),
|
|
1657
|
+
content: z.string().describe("Reference file body content."),
|
|
1658
|
+
})).default([]).describe("Optional reference files written under skills/<skillName>/references/."),
|
|
1659
|
+
}, async ({ pluginName, skillName, description, publicEmbed, body, references }) => {
|
|
1660
|
+
if (!ACCOUNT_ID)
|
|
1661
|
+
return refuseNoAccount("store-skill");
|
|
1662
|
+
const KEBAB_RE = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
1663
|
+
const REF_RE = /^[a-z0-9-]+\.md$/;
|
|
1664
|
+
if (!KEBAB_RE.test(pluginName)) {
|
|
1665
|
+
console.error(`[store-skill] ERROR pluginName=${pluginName} reason=invalid-kebab path=-`);
|
|
1666
|
+
return { content: [{ type: "text", text: `pluginName must be lowercase kebab-case (1-64 chars, no leading/trailing hyphen): "${pluginName}"` }], isError: true };
|
|
1667
|
+
}
|
|
1668
|
+
if (!KEBAB_RE.test(skillName)) {
|
|
1669
|
+
console.error(`[store-skill] ERROR pluginName=${pluginName} skillName=${skillName} reason=invalid-kebab path=-`);
|
|
1670
|
+
return { content: [{ type: "text", text: `skillName must be lowercase kebab-case (1-64 chars, no leading/trailing hyphen): "${skillName}"` }], isError: true };
|
|
1671
|
+
}
|
|
1672
|
+
for (const ref of references) {
|
|
1673
|
+
if (!REF_RE.test(ref.filename)) {
|
|
1674
|
+
console.error(`[store-skill] ERROR pluginName=${pluginName} skillName=${skillName} reason=invalid-ref-filename ref=${ref.filename} path=-`);
|
|
1675
|
+
return { content: [{ type: "text", text: `reference filename must match ^[a-z0-9-]+\\.md$: "${ref.filename}"` }], isError: true };
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
const accountDir = getAccountDir();
|
|
1679
|
+
const canonicalPluginDir = resolve(accountDir, "plugins", pluginName);
|
|
1680
|
+
const mirrorPluginDir = resolve(PLATFORM_ROOT, "plugins", pluginName);
|
|
1681
|
+
const canonicalPluginMd = resolve(canonicalPluginDir, "PLUGIN.md");
|
|
1682
|
+
const mirrorPluginMd = resolve(mirrorPluginDir, "PLUGIN.md");
|
|
1683
|
+
// Collision: mirror dir exists from a shipped plugin (no canonical mirror).
|
|
1684
|
+
// Refuse rather than silently shadow.
|
|
1685
|
+
if (existsSync(mirrorPluginMd) && !existsSync(canonicalPluginMd)) {
|
|
1686
|
+
console.error(`[store-skill] ERROR pluginName=${pluginName} skillName=${skillName} reason=collision-with-shipped path=${mirrorPluginDir}`);
|
|
1687
|
+
return { content: [{ type: "text", text: `pluginName "${pluginName}" collides with a shipped plugin. Choose a different pluginName.` }], isError: true };
|
|
1688
|
+
}
|
|
1689
|
+
const skillDir = resolve(canonicalPluginDir, "skills", skillName);
|
|
1690
|
+
const action = existsSync(resolve(skillDir, "SKILL.md")) ? "overwrite" : "create";
|
|
1691
|
+
try {
|
|
1692
|
+
mkdirSync(canonicalPluginDir, { recursive: true });
|
|
1693
|
+
// Compose PLUGIN.md only on first write. embed=["admin","public"] +
|
|
1694
|
+
// optional=false matches assemblePublicPluginContent / loadEmbeddedPlugins
|
|
1695
|
+
// expectations. metadata is single-line JSON (parsePluginFrontmatter at
|
|
1696
|
+
// plugin-manifest.ts:67 expects single-line) — multi-line silently falls
|
|
1697
|
+
// back to platform={}.
|
|
1698
|
+
if (!existsSync(canonicalPluginMd)) {
|
|
1699
|
+
const pluginMd = `---
|
|
1700
|
+
name: ${pluginName}
|
|
1701
|
+
description: "Operator-authored plugin"
|
|
1702
|
+
tools: []
|
|
1703
|
+
hidden: []
|
|
1704
|
+
requires: []
|
|
1705
|
+
metadata: {"platform":{"embed":["admin","public"],"optional":false}}
|
|
1706
|
+
---
|
|
1707
|
+
|
|
1708
|
+
# ${pluginName}
|
|
1709
|
+
|
|
1710
|
+
Operator-authored plugin. Skills under \`skills/\` were created via the admin skill-builder.
|
|
1711
|
+
`;
|
|
1712
|
+
writeFileSync(canonicalPluginMd, pluginMd);
|
|
1713
|
+
}
|
|
1714
|
+
// Reset skill dir before write so removed reference files don't linger.
|
|
1715
|
+
if (existsSync(skillDir)) {
|
|
1716
|
+
rmSync(skillDir, { recursive: true, force: true });
|
|
1717
|
+
}
|
|
1718
|
+
mkdirSync(skillDir, { recursive: true });
|
|
1719
|
+
// Normalise description — strip newlines and tabs to keep YAML
|
|
1720
|
+
// frontmatter on a single line. parsePluginFrontmatter uses a
|
|
1721
|
+
// single-line regex; an embedded newline (or `\n---\n`) would
|
|
1722
|
+
// otherwise corrupt the frontmatter parse and silently drop body
|
|
1723
|
+
// content from the agent prompt.
|
|
1724
|
+
const singleLineDescription = description.replace(/[\r\n\t]+/g, " ").trim();
|
|
1725
|
+
const escapedDescription = singleLineDescription.replace(/"/g, '\\"');
|
|
1726
|
+
const skillMd = `---
|
|
1727
|
+
name: ${skillName}
|
|
1728
|
+
description: "${escapedDescription}"
|
|
1729
|
+
publicEmbed: ${publicEmbed}
|
|
1730
|
+
---
|
|
1731
|
+
|
|
1732
|
+
${body}
|
|
1733
|
+
`;
|
|
1734
|
+
writeFileSync(resolve(skillDir, "SKILL.md"), skillMd);
|
|
1735
|
+
let refCount = 0;
|
|
1736
|
+
if (references.length > 0) {
|
|
1737
|
+
const refsDir = resolve(skillDir, "references");
|
|
1738
|
+
mkdirSync(refsDir, { recursive: true });
|
|
1739
|
+
for (const ref of references) {
|
|
1740
|
+
writeFileSync(resolve(refsDir, ref.filename), ref.content);
|
|
1741
|
+
refCount++;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
// Write the `.user-mirror` marker to CANONICAL first — cpSync will
|
|
1745
|
+
// carry it into the platform-side mirror as part of the same recursive
|
|
1746
|
+
// copy. This eliminates the post-cpSync writeFileSync race: if cpSync
|
|
1747
|
+
// succeeds, the marker is already in target; if cpSync fails partway,
|
|
1748
|
+
// canonical's marker is intact and the next autoDeliverUserPlugins
|
|
1749
|
+
// call retries the copy. autoDeliverUserPlugins relies on the marker
|
|
1750
|
+
// arriving with the source tree — never writes its own marker.
|
|
1751
|
+
writeFileSync(resolve(canonicalPluginDir, ".user-mirror"), `pluginName=${pluginName}\nsource=${canonicalPluginDir}\n`);
|
|
1752
|
+
// Mirror to <PLATFORM_ROOT>/plugins/<pluginName>/ so the change is
|
|
1753
|
+
// visible to the loader without a session restart.
|
|
1754
|
+
mkdirSync(mirrorPluginDir, { recursive: true });
|
|
1755
|
+
cpSync(canonicalPluginDir, mirrorPluginDir, { recursive: true, force: true });
|
|
1756
|
+
const bodyBytes = Buffer.byteLength(body, "utf-8");
|
|
1757
|
+
console.log(`[store-skill] write pluginName=${pluginName} skillName=${skillName} publicEmbed=${publicEmbed} path=${canonicalPluginDir} bodyBytes=${bodyBytes} referenceCount=${refCount} action=${action}`);
|
|
1758
|
+
return {
|
|
1759
|
+
content: [{
|
|
1760
|
+
type: "text",
|
|
1761
|
+
text: `Skill "${skillName}" saved to plugin "${pluginName}" (${action}). publicEmbed=${publicEmbed}, references=${refCount}. Active immediately for the admin agent${publicEmbed ? "; surfaces in the public agent on next session start" : ""}.`,
|
|
1762
|
+
}],
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
catch (err) {
|
|
1766
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1767
|
+
console.error(`[store-skill] ERROR pluginName=${pluginName} skillName=${skillName} reason=${msg.slice(0, 120)} path=${canonicalPluginDir}`);
|
|
1768
|
+
return { content: [{ type: "text", text: `Failed to write skill: ${msg}` }], isError: true };
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
eagerTool(server, "plugin-read", "Read a plugin definition (PLUGIN.md) or one of its reference files.", {
|
|
1772
|
+
pluginName: z.string().describe("Name of the plugin directory (e.g. 'sales', 'business-assistant')"),
|
|
1773
|
+
file: z.string().optional().describe("Specific file to read (e.g. 'references/pricing.md'). Defaults to PLUGIN.md."),
|
|
1774
|
+
}, async ({ pluginName, file }) => {
|
|
1775
|
+
if (!ACCOUNT_ID)
|
|
1776
|
+
return refuseNoAccount("plugin-read");
|
|
1777
|
+
try {
|
|
1778
|
+
const resolvedFile = file ?? "PLUGIN.md";
|
|
1779
|
+
// Task 516 — plugin-read is the raw-SKILL.md read path that would
|
|
1780
|
+
// otherwise bypass the skill-load authoring gate. Block the admin seat
|
|
1781
|
+
// from reading any content-producer-owned authoring skill's files
|
|
1782
|
+
// (SKILL.md or its references); the slug is extracted from the file
|
|
1783
|
+
// path or pluginName. Same fail-open contract as skill-load.
|
|
1784
|
+
const authoringSlug = skillSlugFromReadArgs(pluginName, resolvedFile);
|
|
1785
|
+
if (adminAuthoringSkillBlock(authoringSlug, process.env)) {
|
|
1786
|
+
console.log(`[admin-skill-gate] role=admin skill=${authoringSlug} decision=block reason=content-producer-owned`);
|
|
1787
|
+
return { content: [{ type: "text", text: AUTHORING_DISPATCH_HINT }], isError: true };
|
|
1788
|
+
}
|
|
1789
|
+
const pluginPath = resolve(PLATFORM_ROOT, "plugins", pluginName, resolvedFile);
|
|
1790
|
+
if (!existsSync(pluginPath)) {
|
|
1791
|
+
// when the agent's pluginName/file combination misses
|
|
1792
|
+
// a skill that DOES live under `plugins/*/skills/<slug>/SKILL.md`,
|
|
1793
|
+
// surface the corrected pluginName AND the canonical file path so
|
|
1794
|
+
// the next call is deterministic. Both wrong-`file` and wrong-`pluginName`
|
|
1795
|
+
// shapes feed through `computePluginReadHint`.
|
|
1796
|
+
const hint = computePluginReadHint(PLATFORM_ROOT, pluginName, resolvedFile);
|
|
1797
|
+
const hintText = hint ? ` Did you mean pluginName="${hint.pluginName}", file="${hint.file}"?` : "";
|
|
1798
|
+
console.log(`[plugin-read] ${pluginName}/${resolvedFile} not-found hint=${hint ? hint.pluginName : "none"}`);
|
|
1799
|
+
return {
|
|
1800
|
+
content: [{ type: "text", text: `Plugin file not found: ${pluginPath}.${hintText}` }],
|
|
1801
|
+
isError: true,
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
console.log(`[plugin-read] ${pluginName}/${resolvedFile}`);
|
|
1805
|
+
const rawContent = await readFile(pluginPath, "utf-8");
|
|
1806
|
+
// Brand-substitute every plugin file before it reaches the agent —
|
|
1807
|
+
// PLUGIN.md, skills/<name>/SKILL.md, references/*.md all flow through
|
|
1808
|
+
// here. Missing brand.json hard-throws (Tasks 787/788 doctrine).
|
|
1809
|
+
const content = substituteBrandPlaceholders(rawContent, pluginPath);
|
|
1810
|
+
// Append file inventory on default calls (PLUGIN.md) so agents can discover
|
|
1811
|
+
// skill and reference paths without guessing
|
|
1812
|
+
if (resolvedFile === "PLUGIN.md") {
|
|
1813
|
+
const pluginRoot = resolve(PLATFORM_ROOT, "plugins", pluginName);
|
|
1814
|
+
const skills = [];
|
|
1815
|
+
const references = [];
|
|
1816
|
+
const scanDir = (base, prefix, target) => {
|
|
1817
|
+
const scanPath = resolve(pluginRoot, base);
|
|
1818
|
+
if (!existsSync(scanPath))
|
|
1819
|
+
return;
|
|
1820
|
+
try {
|
|
1821
|
+
const walk = (current, rel) => {
|
|
1822
|
+
for (const entry of readdirSync(current)) {
|
|
1823
|
+
const full = resolve(current, entry);
|
|
1824
|
+
try {
|
|
1825
|
+
const stat = statSync(full);
|
|
1826
|
+
if (stat.isDirectory()) {
|
|
1827
|
+
walk(full, `${rel}${entry}/`);
|
|
1828
|
+
}
|
|
1829
|
+
else if (entry.endsWith(".md")) {
|
|
1830
|
+
target.push(`${prefix}${rel}${entry}`);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
catch { /* skip unreadable entries */ }
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
walk(scanPath, "");
|
|
1837
|
+
}
|
|
1838
|
+
catch { /* skip unreadable directories */ }
|
|
1839
|
+
};
|
|
1840
|
+
scanDir("skills", "skills/", skills);
|
|
1841
|
+
scanDir("references", "references/", references);
|
|
1842
|
+
let inventory = "";
|
|
1843
|
+
if (skills.length > 0)
|
|
1844
|
+
inventory += `\nSkills: ${skills.join(", ")}`;
|
|
1845
|
+
if (references.length > 0)
|
|
1846
|
+
inventory += `\nReferences: ${references.join(", ")}`;
|
|
1847
|
+
return { content: [{ type: "text", text: content + inventory }] };
|
|
1848
|
+
}
|
|
1849
|
+
return { content: [{ type: "text", text: content }] };
|
|
1850
|
+
}
|
|
1851
|
+
catch (err) {
|
|
1852
|
+
return {
|
|
1853
|
+
content: [{ type: "text", text: `Failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
1854
|
+
isError: true,
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
// agent-side `Glob` fallthrough when "set up cloudflare" maps a
|
|
1859
|
+
// SKILL.md to the wrong plugin: skill-find walks
|
|
1860
|
+
// `${PLATFORM_ROOT}/plugins/*/skills/<skillName>/SKILL.md` once and returns
|
|
1861
|
+
// the owner. With one tool call the agent learns the correct plugin name.
|
|
1862
|
+
//
|
|
1863
|
+
// `skill-load` (below) is the canonical single-call surface that
|
|
1864
|
+
// most agents want (resolve + read body in one shot). `skill-find` is kept
|
|
1865
|
+
// for callers that need only the path (e.g. tooling that lists owners
|
|
1866
|
+
// without reading the body).
|
|
1867
|
+
server.tool("skill-find", "Find which plugin owns a skill by name. Walks plugins/*/skills/<skillName>/SKILL.md and returns the owning plugin (unique), every candidate (ambiguous), or not-found. For the common resolve-and-read case, prefer `skill-load skillName=<name>` — it returns the SKILL.md body in the same call.", {
|
|
1868
|
+
skillName: z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "skillName must be lowercase kebab-case (a-z, 0-9, -)"),
|
|
1869
|
+
}, async ({ skillName }) => {
|
|
1870
|
+
if (!ACCOUNT_ID)
|
|
1871
|
+
return refuseNoAccount("skill-find");
|
|
1872
|
+
const start = Date.now();
|
|
1873
|
+
const result = findSkillOwners(PLATFORM_ROOT, skillName);
|
|
1874
|
+
const ms = Date.now() - start;
|
|
1875
|
+
console.log(`[skill-find] skillName=${skillName} result=${result.status} candidates=${result.candidates.length} ms=${ms}`);
|
|
1876
|
+
if (result.status === "unique") {
|
|
1877
|
+
const [{ pluginName, file }] = result.candidates;
|
|
1878
|
+
return {
|
|
1879
|
+
content: [{
|
|
1880
|
+
type: "text",
|
|
1881
|
+
text: `pluginName="${pluginName}" file="${file}"\nTo read the body in one call, use: skill-load skillName="${skillName}"`,
|
|
1882
|
+
}],
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
if (result.status === "ambiguous") {
|
|
1886
|
+
const lines = result.candidates.map(c => ` pluginName="${c.pluginName}" file="${c.file}"`).join("\n");
|
|
1887
|
+
return {
|
|
1888
|
+
content: [{
|
|
1889
|
+
type: "text",
|
|
1890
|
+
text: `Ambiguous — skill "${skillName}" exists in ${result.candidates.length} plugins:\n${lines}`,
|
|
1891
|
+
}],
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
return {
|
|
1895
|
+
content: [{ type: "text", text: `not_found — no plugin owns a skill named "${skillName}"` }],
|
|
1896
|
+
isError: true,
|
|
1897
|
+
};
|
|
1898
|
+
});
|
|
1899
|
+
// `skill-load` collapses skill resolve+read into one call.
|
|
1900
|
+
//
|
|
1901
|
+
// Why: 21 prose call sites previously said *"Load `admin/skills/plainly/SKILL.md`
|
|
1902
|
+
// via `plugin-read`"*. The LLM kept passing the path as `pluginName`, tripping
|
|
1903
|
+
// the not-found branch with the corrected-pluginName hint.
|
|
1904
|
+
// The recurring failure is recorded in the corrections ledger. One slug-arg
|
|
1905
|
+
// tool removes the path-format ambiguity at the source.
|
|
1906
|
+
//
|
|
1907
|
+
// Shape mirrors `plugin-read` (eagerTool registration, same brand-substitution
|
|
1908
|
+
// call) so SKILL.md bodies are byte-identical regardless of which tool reads
|
|
1909
|
+
// them. `plugin-read` is retained for `references/*` and `PLUGIN.md` reads —
|
|
1910
|
+
// those are plugin-scoped by nature and the path-as-pluginName failure pattern
|
|
1911
|
+
// is specific to skills (addressed by slug in prose).
|
|
1912
|
+
eagerTool(server, "skill-load", "Load a plugin skill's SKILL.md body by skill name. One call: resolves the owning plugin and reads the body, with brand placeholders substituted. Returns the SKILL.md body when exactly one plugin owns the skill, a candidate list when multiple plugins own it (ambiguous), or an error when no plugin owns it.", {
|
|
1913
|
+
skillName: z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "skillName must be lowercase kebab-case (a-z, 0-9, -)"),
|
|
1914
|
+
}, async ({ skillName }) => {
|
|
1915
|
+
if (!ACCOUNT_ID)
|
|
1916
|
+
return refuseNoAccount("skill-load");
|
|
1917
|
+
// Task 516 — the admin seat may not load content-producer-owned
|
|
1918
|
+
// authoring skills inline; it must dispatch content-producer instead.
|
|
1919
|
+
// The gate is a pure name+env check before any filesystem read, and
|
|
1920
|
+
// fails open for non-admin / unidentified seats (content-producer's own
|
|
1921
|
+
// spawns carry MAXY_SPECIALIST and resolve normally).
|
|
1922
|
+
if (adminAuthoringSkillBlock(skillName, process.env)) {
|
|
1923
|
+
console.log(`[admin-skill-gate] role=admin skill=${skillName} decision=block reason=content-producer-owned`);
|
|
1924
|
+
return { content: [{ type: "text", text: AUTHORING_DISPATCH_HINT }], isError: true };
|
|
1925
|
+
}
|
|
1926
|
+
const start = Date.now();
|
|
1927
|
+
try {
|
|
1928
|
+
const outcome = await loadSkill(PLATFORM_ROOT, skillName);
|
|
1929
|
+
if (outcome.status === "ambiguous") {
|
|
1930
|
+
const ms = Date.now() - start;
|
|
1931
|
+
console.log(`[skill-load] skillName=${skillName} result=ambiguous pluginName=none file=none bodyBytes=0 ms=${ms}`);
|
|
1932
|
+
const lines = outcome.candidates.map(c => ` pluginName="${c.pluginName}" file="${c.file}"`).join("\n");
|
|
1933
|
+
return {
|
|
1934
|
+
content: [{
|
|
1935
|
+
type: "text",
|
|
1936
|
+
text: `Ambiguous — skill "${skillName}" exists in ${outcome.candidates.length} plugins:\n${lines}\nUse plugin-read with one of the listed pluginName/file pairs.`,
|
|
1937
|
+
}],
|
|
1938
|
+
isError: true,
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
if (outcome.status === "not-found") {
|
|
1942
|
+
const ms = Date.now() - start;
|
|
1943
|
+
console.log(`[skill-load] skillName=${skillName} result=not-found pluginName=none file=none bodyBytes=0 ms=${ms}`);
|
|
1944
|
+
return {
|
|
1945
|
+
content: [{ type: "text", text: `not_found — no plugin owns a skill named "${skillName}"` }],
|
|
1946
|
+
isError: true,
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
const content = substituteBrandPlaceholders(outcome.body, outcome.absolutePath);
|
|
1950
|
+
// prepend a skill-input-contract notice when the skill's
|
|
1951
|
+
// frontmatter declares `requiredInputs:`. The notice tells the agent
|
|
1952
|
+
// to route missing inputs through AskUserQuestion (per IDENTITY.md
|
|
1953
|
+
// "Skill-input resolution"); the embedded `<!-- skill-input-contract
|
|
1954
|
+
// requiredInputs=... -->` marker is the per-turn keying signal that
|
|
1955
|
+
// parseClaudeStream uses to fire [skill-input-resolution] /
|
|
1956
|
+
// [skill-input-missing] observability lines.
|
|
1957
|
+
const requiredInputs = parseRequiredInputs(outcome.body);
|
|
1958
|
+
let bodyOut = content;
|
|
1959
|
+
if (requiredInputs) {
|
|
1960
|
+
const slotLabels = requiredInputs.map(s => s.join(" | ")).join(", ");
|
|
1961
|
+
const marker = JSON.stringify(requiredInputs);
|
|
1962
|
+
const notice = `<!-- skill-input-contract requiredInputs=${marker} -->\nREQUIRED INPUTS: ${slotLabels}\nIf the operator has not supplied each of these inputs, your next tool call MUST be AskUserQuestion. Do not use memory-search, conversation-search, graph-read, or work-get to guess the missing input.\n<!-- /skill-input-contract -->\n\n`;
|
|
1963
|
+
bodyOut = notice + content;
|
|
1964
|
+
}
|
|
1965
|
+
const ms = Date.now() - start;
|
|
1966
|
+
const reqLog = requiredInputs ? ` requiredInputs=${JSON.stringify(requiredInputs)}` : "";
|
|
1967
|
+
console.log(`[skill-load] skillName=${skillName} result=unique pluginName=${outcome.pluginName} file=${outcome.file} bodyBytes=${bodyOut.length}${reqLog} ms=${ms}`);
|
|
1968
|
+
return { content: [{ type: "text", text: bodyOut }] };
|
|
1969
|
+
}
|
|
1970
|
+
catch (err) {
|
|
1971
|
+
const ms = Date.now() - start;
|
|
1972
|
+
console.log(`[skill-load] skillName=${skillName} result=read-error pluginName=unknown file=unknown bodyBytes=0 ms=${ms}`);
|
|
1973
|
+
return {
|
|
1974
|
+
content: [{ type: "text", text: `Failed to load skill "${skillName}": ${err instanceof Error ? err.message : String(err)}` }],
|
|
1975
|
+
isError: true,
|
|
1976
|
+
};
|
|
1977
|
+
}
|
|
1978
|
+
});
|
|
1979
|
+
// the inline UI-component tool is gone from the admin surface
|
|
1980
|
+
// on native Claude Code. The PTY runtime has no host bridge for the UI
|
|
1981
|
+
// primitives the legacy tool wrapped; calling it logged a "rendered"
|
|
1982
|
+
// sentinel that read like a successful render to the agent while the
|
|
1983
|
+
// chat surface saw nothing. Admin flows now use plain markdown for
|
|
1984
|
+
// reviewable artefacts and the `file-presentation` skill for downloadable
|
|
1985
|
+
// artefacts (written under output/ and delivered by stating their location).
|
|
1986
|
+
// The :Component / :KnowledgeDocument
|
|
1987
|
+
// persistence pipeline is preserved for historical conversations that
|
|
1988
|
+
// already carry the rows; no new conversations write to it.
|
|
1989
|
+
eagerTool(server, "session-reset", "Reset the current session. Compacts conversation history to memory, clears the visible conversation, " +
|
|
1990
|
+
"and starts a fresh session with a new greeting. Call when the user asks to start a new session, " +
|
|
1991
|
+
"clear the conversation, or start fresh.", {}, async () => {
|
|
1992
|
+
if (!ACCOUNT_ID)
|
|
1993
|
+
return refuseNoAccount("session-reset");
|
|
1994
|
+
return { content: [{ type: "text", text: "reset" }] };
|
|
1995
|
+
});
|
|
1996
|
+
eagerTool(server, "session-resume", "Resume a previous session. Loads the selected session's message history into the chat timeline " +
|
|
1997
|
+
"and routes new messages to that conversation. Call after the user selects a session from the " +
|
|
1998
|
+
"session-list results. Pass the sessionId from the selected session.", { sessionId: z.string().uuid().describe("The sessionId of the session to resume") }, async () => {
|
|
1999
|
+
if (!ACCOUNT_ID)
|
|
2000
|
+
return refuseNoAccount("session-resume");
|
|
2001
|
+
return { content: [{ type: "text", text: "resumed" }] };
|
|
2002
|
+
});
|
|
2003
|
+
server.tool("remote-auth-set-password", "Set the remote access password. Hashes with scrypt and writes to the platform's brand-specific config directory with mode 0600. " +
|
|
2004
|
+
"Validates strength (8+ chars, digit, special character, no spaces anywhere). " +
|
|
2005
|
+
"Protects the admin interface when exposed over the tunnel — has no effect on the public endpoint or the tunnel itself. " +
|
|
2006
|
+
"Set before configuring the Cloudflare tunnel — the post-restart `curl -I https://<admin-hostname>` verification fails if remote-auth is not configured.", { password: z.string() }, async ({ password }) => {
|
|
2007
|
+
if (!ACCOUNT_ID)
|
|
2008
|
+
return refuseNoAccount("remote-auth-set-password");
|
|
2009
|
+
// Validate strength — same rules as the web server's validatePasswordStrength
|
|
2010
|
+
const checks = [
|
|
2011
|
+
{ label: "at least 8 characters", met: password.length >= 8 },
|
|
2012
|
+
{ label: "contains a number", met: /\d/.test(password) },
|
|
2013
|
+
{ label: "contains a special character", met: /[^A-Za-z0-9]/.test(password) },
|
|
2014
|
+
{ label: "no spaces", met: password.length > 0 && !/\s/.test(password) },
|
|
2015
|
+
];
|
|
2016
|
+
const failed = checks.filter((c) => !c.met);
|
|
2017
|
+
if (failed.length > 0) {
|
|
2018
|
+
return {
|
|
2019
|
+
content: [{ type: "text", text: `Password requirements not met: ${failed.map((c) => c.label).join(", ")}` }],
|
|
2020
|
+
isError: true,
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
try {
|
|
2024
|
+
const { scrypt, randomBytes } = await import("node:crypto");
|
|
2025
|
+
const salt = randomBytes(32);
|
|
2026
|
+
const hash = await new Promise((res, rej) => {
|
|
2027
|
+
scrypt(password, salt, 64, { N: 16384, r: 8, p: 1 }, (err, key) => {
|
|
2028
|
+
if (err)
|
|
2029
|
+
rej(err);
|
|
2030
|
+
else
|
|
2031
|
+
res(key);
|
|
2032
|
+
});
|
|
2033
|
+
});
|
|
2034
|
+
const stored = `${salt.toString("hex")}:${hash.toString("hex")}`;
|
|
2035
|
+
const pwPath = REMOTE_PASSWORD_FILE;
|
|
2036
|
+
await writeFile(pwPath, stored, { mode: 0o600 });
|
|
2037
|
+
return { content: [{ type: "text", text: "Remote access password set." }] };
|
|
2038
|
+
}
|
|
2039
|
+
catch (err) {
|
|
2040
|
+
return {
|
|
2041
|
+
content: [{ type: "text", text: `Failed to set password: ${err instanceof Error ? err.message : String(err)}` }],
|
|
2042
|
+
isError: true,
|
|
2043
|
+
};
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
// ===================================================================
|
|
2047
|
+
// Utility tools
|
|
2048
|
+
// ===================================================================
|
|
2049
|
+
eagerTool(server, "qr-generate", "Generate a QR code PNG from text or a URL. Writes the PNG under accounts/<accountId>/output/qr/ and returns the file path. Pass outputPath to write to a specific location instead (used by the brochure pipeline for qr-listing.png / qr-video.png).", {
|
|
2050
|
+
data: z.string().describe("The text or URL to encode in the QR code"),
|
|
2051
|
+
outputPath: z
|
|
2052
|
+
.string()
|
|
2053
|
+
.optional()
|
|
2054
|
+
.describe("Absolute file path to save the PNG. Defaults to <accountDir>/output/qr/qr-<timestamp>.png."),
|
|
2055
|
+
width: z.number().optional().describe("Width in pixels (default 300)"),
|
|
2056
|
+
}, async ({ data, outputPath, width }) => {
|
|
2057
|
+
if (!ACCOUNT_ID)
|
|
2058
|
+
return refuseNoAccount("qr-generate");
|
|
2059
|
+
try {
|
|
2060
|
+
const options = { width: width ?? 300, margin: 2 };
|
|
2061
|
+
const dest = outputPath ?? (() => {
|
|
2062
|
+
const qrDir = join(getAccountDir(), "output", "qr");
|
|
2063
|
+
mkdirSync(qrDir, { recursive: true });
|
|
2064
|
+
return join(qrDir, `qr-${Date.now()}.png`);
|
|
2065
|
+
})();
|
|
2066
|
+
await QRCode.toFile(dest, data, options);
|
|
2067
|
+
return {
|
|
2068
|
+
content: [
|
|
2069
|
+
{
|
|
2070
|
+
type: "text",
|
|
2071
|
+
text: `QR code saved to ${dest}`,
|
|
2072
|
+
},
|
|
2073
|
+
],
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
catch (err) {
|
|
2077
|
+
return {
|
|
2078
|
+
content: [
|
|
2079
|
+
{
|
|
2080
|
+
type: "text",
|
|
2081
|
+
text: `QR generation failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
2082
|
+
},
|
|
2083
|
+
],
|
|
2084
|
+
isError: true,
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
// ===================================================================
|
|
2089
|
+
// WiFi management
|
|
2090
|
+
// ===================================================================
|
|
2091
|
+
eagerTool(server, "wifi", "Manage WiFi connections on this device. Actions: " +
|
|
2092
|
+
"scan (list visible networks with signal strength and security), " +
|
|
2093
|
+
"connect (join a network by SSID and password — warn user first if signal is below 30%), " +
|
|
2094
|
+
"status (current WiFi connection details), " +
|
|
2095
|
+
"saved (list remembered networks), " +
|
|
2096
|
+
"forget (remove a saved network — if the user is forgetting their currently active WiFi " +
|
|
2097
|
+
"connection, warn them that they may lose connectivity before calling this action).", {
|
|
2098
|
+
action: z.enum(["scan", "connect", "status", "saved", "forget"]).describe("The WiFi operation to perform"),
|
|
2099
|
+
ssid: z.string().optional().describe("Network name — required for connect and forget actions"),
|
|
2100
|
+
password: z.string().optional().describe("Network password — required for connect action (WPA/WPA2/WPA3 PSK)"),
|
|
2101
|
+
}, async ({ action, ssid, password }) => {
|
|
2102
|
+
if (!ACCOUNT_ID)
|
|
2103
|
+
return refuseNoAccount("wifi");
|
|
2104
|
+
/** Parse nmcli terse output into rows of colon-separated fields.
|
|
2105
|
+
* nmcli -t escapes literal colons in values as \: — split on
|
|
2106
|
+
* unescaped colons only, then unescape the fields. */
|
|
2107
|
+
const parseNmcliLines = (output) => output.split("\n").filter(Boolean).map((l) => l.split(/(?<!\\):/).map((f) => f.replace(/\\:/g, ":")));
|
|
2108
|
+
const logPrefix = "[wifi]";
|
|
2109
|
+
try {
|
|
2110
|
+
switch (action) {
|
|
2111
|
+
// ── scan ──────────────────────────────────────────────────
|
|
2112
|
+
case "scan": {
|
|
2113
|
+
const raw = execFileSync("nmcli", ["-t", "-f", "SSID,SIGNAL,SECURITY", "device", "wifi", "list", "--rescan", "yes"], { encoding: "utf-8", timeout: 15000 });
|
|
2114
|
+
const lines = parseNmcliLines(raw);
|
|
2115
|
+
// Filter hidden networks (empty SSID) and deduplicate by SSID
|
|
2116
|
+
const seen = new Set();
|
|
2117
|
+
const networks = [];
|
|
2118
|
+
for (const [name, sig, sec] of lines) {
|
|
2119
|
+
if (!name || seen.has(name))
|
|
2120
|
+
continue;
|
|
2121
|
+
seen.add(name);
|
|
2122
|
+
networks.push({ ssid: name, signal: parseInt(sig, 10) || 0, security: sec || "open" });
|
|
2123
|
+
}
|
|
2124
|
+
// Sort by signal strength descending
|
|
2125
|
+
networks.sort((a, b) => b.signal - a.signal);
|
|
2126
|
+
console.error(`${logPrefix} action="scan" result="ok" networks=${networks.length}`);
|
|
2127
|
+
if (networks.length === 0) {
|
|
2128
|
+
return {
|
|
2129
|
+
content: [{ type: "text", text: "No WiFi networks found. Make sure your router is powered on and within range." }],
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
const formatted = networks
|
|
2133
|
+
.map((n) => `${n.ssid} (${n.signal}% ${n.security})`)
|
|
2134
|
+
.join("\n");
|
|
2135
|
+
return {
|
|
2136
|
+
content: [{ type: "text", text: `# WiFi Networks\n\n${formatted}` }],
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
// ── connect ──────────────────────────────────────────────
|
|
2140
|
+
case "connect": {
|
|
2141
|
+
if (!ssid) {
|
|
2142
|
+
return {
|
|
2143
|
+
content: [{ type: "text", text: "SSID is required for connect action." }],
|
|
2144
|
+
isError: true,
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2147
|
+
if (!password) {
|
|
2148
|
+
return {
|
|
2149
|
+
content: [{ type: "text", text: "Password is required for connect action." }],
|
|
2150
|
+
isError: true,
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2153
|
+
// Check signal strength before connecting (cherry-pick 1)
|
|
2154
|
+
try {
|
|
2155
|
+
const scanRaw = execFileSync("nmcli", ["-t", "-f", "SSID,SIGNAL", "device", "wifi", "list"], { encoding: "utf-8", timeout: 10000 });
|
|
2156
|
+
const scanLines = parseNmcliLines(scanRaw);
|
|
2157
|
+
const match = scanLines.find(([name]) => name === ssid);
|
|
2158
|
+
const signal = match ? parseInt(match[1], 10) || 0 : 0;
|
|
2159
|
+
if (signal > 0 && signal < 30) {
|
|
2160
|
+
// Include warning in result but proceed with connection
|
|
2161
|
+
console.error(`${logPrefix} action="connect" ssid="${ssid}" signal=${signal} warning="weak_signal"`);
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
catch {
|
|
2165
|
+
// Scan check is best-effort — proceed with connect regardless
|
|
2166
|
+
}
|
|
2167
|
+
execFileSync("nmcli", ["device", "wifi", "connect", ssid, "password", password, "--wait", "30"], { encoding: "utf-8", timeout: 35000 });
|
|
2168
|
+
console.error(`${logPrefix} action="connect" ssid="${ssid}" result="connecting" password=[REDACTED]`);
|
|
2169
|
+
// Post-connect verification: confirm IP assignment on wlan0 (cherry-pick 2)
|
|
2170
|
+
let ip = "";
|
|
2171
|
+
try {
|
|
2172
|
+
const deviceInfo = execFileSync("nmcli", ["-t", "-f", "IP4.ADDRESS", "device", "show", "wlan0"], { encoding: "utf-8", timeout: 5000 });
|
|
2173
|
+
const ipLine = deviceInfo.split("\n").find((l) => l.startsWith("IP4.ADDRESS"));
|
|
2174
|
+
if (ipLine) {
|
|
2175
|
+
// Format: IP4.ADDRESS[1]:192.168.1.100/24
|
|
2176
|
+
ip = ipLine.split(":").slice(1).join(":").split("/")[0].trim();
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
catch {
|
|
2180
|
+
// IP check failed — connection may still be establishing
|
|
2181
|
+
}
|
|
2182
|
+
if (ip) {
|
|
2183
|
+
console.error(`${logPrefix} action="connect" ssid="${ssid}" result="connected" ip="${ip}"`);
|
|
2184
|
+
// Check if signal was weak and include warning
|
|
2185
|
+
let warning = "";
|
|
2186
|
+
try {
|
|
2187
|
+
const scanRaw = execFileSync("nmcli", ["-t", "-f", "SSID,SIGNAL", "device", "wifi", "list"], { encoding: "utf-8", timeout: 5000 });
|
|
2188
|
+
const match = parseNmcliLines(scanRaw).find(([name]) => name === ssid);
|
|
2189
|
+
const signal = match ? parseInt(match[1], 10) || 0 : 0;
|
|
2190
|
+
if (signal > 0 && signal < 30) {
|
|
2191
|
+
warning = `\n\nWarning: Signal strength is weak (${signal}%). Connection may be unreliable.`;
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
catch {
|
|
2195
|
+
// Signal check is best-effort
|
|
2196
|
+
}
|
|
2197
|
+
return {
|
|
2198
|
+
content: [{
|
|
2199
|
+
type: "text",
|
|
2200
|
+
text: `Connected to ${ssid}. IP address: ${ip}. You can safely unplug ethernet.${warning}`,
|
|
2201
|
+
}],
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
else {
|
|
2205
|
+
console.error(`${logPrefix} action="connect" ssid="${ssid}" result="connected_no_ip"`);
|
|
2206
|
+
return {
|
|
2207
|
+
content: [{
|
|
2208
|
+
type: "text",
|
|
2209
|
+
text: `Connected to ${ssid} but no IP address was assigned. Stay on ethernet. The network may require additional configuration — check with your network administrator.`,
|
|
2210
|
+
}],
|
|
2211
|
+
};
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
// ── status ───────────────────────────────────────────────
|
|
2215
|
+
case "status": {
|
|
2216
|
+
// Check if wlan0 exists
|
|
2217
|
+
let deviceStatus;
|
|
2218
|
+
try {
|
|
2219
|
+
deviceStatus = execFileSync("nmcli", ["-t", "-f", "DEVICE,TYPE,STATE", "device", "status"], { encoding: "utf-8", timeout: 5000 });
|
|
2220
|
+
}
|
|
2221
|
+
catch (err) {
|
|
2222
|
+
console.error(`${logPrefix} action="status" result="failed" error="${err instanceof Error ? err.message : String(err)}"`);
|
|
2223
|
+
return {
|
|
2224
|
+
content: [{ type: "text", text: `WiFi status check failed: ${err instanceof Error ? err.message : String(err)}` }],
|
|
2225
|
+
isError: true,
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
const wifiDevice = parseNmcliLines(deviceStatus).find(([, type]) => type === "wifi");
|
|
2229
|
+
if (!wifiDevice) {
|
|
2230
|
+
console.error(`${logPrefix} action="status" result="no_hardware"`);
|
|
2231
|
+
return {
|
|
2232
|
+
content: [{ type: "text", text: "No WiFi hardware detected on this device." }],
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2235
|
+
if (wifiDevice[2] !== "connected") {
|
|
2236
|
+
console.error(`${logPrefix} action="status" result="not_connected" state="${wifiDevice[2]}"`);
|
|
2237
|
+
return {
|
|
2238
|
+
content: [{ type: "text", text: `WiFi is not connected. Device state: ${wifiDevice[2]}.` }],
|
|
2239
|
+
};
|
|
2240
|
+
}
|
|
2241
|
+
// Get detailed connection info
|
|
2242
|
+
const details = execFileSync("nmcli", ["-t", "-f", "GENERAL.CONNECTION,IP4.ADDRESS,IP4.GATEWAY,GENERAL.HWADDR", "device", "show", "wlan0"], { encoding: "utf-8", timeout: 5000 });
|
|
2243
|
+
const detailLines = parseNmcliLines(details);
|
|
2244
|
+
const conn = detailLines.find(([k]) => k === "GENERAL.CONNECTION")?.[1] ?? "unknown";
|
|
2245
|
+
const ipAddr = detailLines.find(([k]) => k.startsWith("IP4.ADDRESS"))?.[1] ?? "none";
|
|
2246
|
+
const gateway = detailLines.find(([k]) => k.startsWith("IP4.GATEWAY"))?.[1] ?? "none";
|
|
2247
|
+
// Get signal strength
|
|
2248
|
+
let signal = "unknown";
|
|
2249
|
+
try {
|
|
2250
|
+
const scanRaw = execFileSync("nmcli", ["-t", "-f", "SSID,SIGNAL", "device", "wifi", "list"], { encoding: "utf-8", timeout: 5000 });
|
|
2251
|
+
const match = parseNmcliLines(scanRaw).find(([name]) => name === conn);
|
|
2252
|
+
if (match)
|
|
2253
|
+
signal = `${match[1]}%`;
|
|
2254
|
+
}
|
|
2255
|
+
catch {
|
|
2256
|
+
// Signal lookup is best-effort
|
|
2257
|
+
}
|
|
2258
|
+
console.error(`${logPrefix} action="status" result="connected" ssid="${conn}"`);
|
|
2259
|
+
return {
|
|
2260
|
+
content: [{
|
|
2261
|
+
type: "text",
|
|
2262
|
+
text: `WiFi: connected\nSSID: ${conn}\nIP: ${ipAddr}\nGateway: ${gateway}\nSignal: ${signal}`,
|
|
2263
|
+
}],
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
// ── saved ────────────────────────────────────────────────
|
|
2267
|
+
case "saved": {
|
|
2268
|
+
const raw = execFileSync("nmcli", ["-t", "-f", "NAME,TYPE", "connection", "show"], { encoding: "utf-8", timeout: 5000 });
|
|
2269
|
+
const wifiConns = parseNmcliLines(raw).filter(([, type]) => type === "802-11-wireless");
|
|
2270
|
+
console.error(`${logPrefix} action="saved" count=${wifiConns.length}`);
|
|
2271
|
+
if (wifiConns.length === 0) {
|
|
2272
|
+
return {
|
|
2273
|
+
content: [{ type: "text", text: "No saved WiFi networks." }],
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
const formatted = wifiConns.map(([name]) => name).join("\n");
|
|
2277
|
+
return {
|
|
2278
|
+
content: [{ type: "text", text: `# Saved WiFi Networks\n\n${formatted}` }],
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
// ── forget ───────────────────────────────────────────────
|
|
2282
|
+
case "forget": {
|
|
2283
|
+
if (!ssid) {
|
|
2284
|
+
return {
|
|
2285
|
+
content: [{ type: "text", text: "SSID is required for forget action." }],
|
|
2286
|
+
isError: true,
|
|
2287
|
+
};
|
|
2288
|
+
}
|
|
2289
|
+
execFileSync("nmcli", ["connection", "delete", ssid], { encoding: "utf-8", timeout: 10000 });
|
|
2290
|
+
console.error(`${logPrefix} action="forget" ssid="${ssid}" result="ok"`);
|
|
2291
|
+
return {
|
|
2292
|
+
content: [{
|
|
2293
|
+
type: "text",
|
|
2294
|
+
text: `Forgotten network: ${ssid}. It will no longer auto-connect.`,
|
|
2295
|
+
}],
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
default:
|
|
2299
|
+
return {
|
|
2300
|
+
content: [{ type: "text", text: `Unknown WiFi action: ${action}` }],
|
|
2301
|
+
isError: true,
|
|
2302
|
+
};
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
catch (err) {
|
|
2306
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
2307
|
+
console.error(`${logPrefix} action="${action}" ssid="${ssid ?? ""}" result="failed" error="${errMsg}"`);
|
|
2308
|
+
// Parse common nmcli error patterns into user-friendly messages
|
|
2309
|
+
if (errMsg.includes("NetworkManager is not running")) {
|
|
2310
|
+
return {
|
|
2311
|
+
content: [{ type: "text", text: "NetworkManager is not running. Start it with: sudo systemctl start NetworkManager" }],
|
|
2312
|
+
isError: true,
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
if (errMsg.includes("No network with SSID") || errMsg.includes("not found")) {
|
|
2316
|
+
return {
|
|
2317
|
+
content: [{ type: "text", text: `Network '${ssid}' not found — it may be out of range or the name may be incorrect.` }],
|
|
2318
|
+
isError: true,
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
if (errMsg.includes("Secrets were required") || errMsg.includes("802-11-wireless-security.psk")) {
|
|
2322
|
+
return {
|
|
2323
|
+
content: [{ type: "text", text: `Authentication failed for '${ssid}' — the password may be incorrect.` }],
|
|
2324
|
+
isError: true,
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
if (errMsg.includes("no wifi device found") || errMsg.includes("Wi-Fi device not found")) {
|
|
2328
|
+
return {
|
|
2329
|
+
content: [{ type: "text", text: "No WiFi hardware detected on this device." }],
|
|
2330
|
+
isError: true,
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
if (errMsg.includes("ENOENT")) {
|
|
2334
|
+
return {
|
|
2335
|
+
content: [{ type: "text", text: "nmcli not found — NetworkManager may not be installed on this device." }],
|
|
2336
|
+
isError: true,
|
|
2337
|
+
};
|
|
2338
|
+
}
|
|
2339
|
+
if (errMsg.includes("ETIMEDOUT") || errMsg.includes("timed out") || errMsg.includes("Timeout")) {
|
|
2340
|
+
return {
|
|
2341
|
+
content: [{ type: "text", text: `WiFi operation timed out. The adapter may be busy — try again.` }],
|
|
2342
|
+
isError: true,
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
return {
|
|
2346
|
+
content: [{ type: "text", text: `WiFi ${action} failed: ${errMsg}` }],
|
|
2347
|
+
isError: true,
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
// ===================================================================
|
|
2352
|
+
// Premium plugin tools
|
|
2353
|
+
// ===================================================================
|
|
2354
|
+
server.tool("premium-list", "List available premium plugins and their delivery status. Returns structured data " +
|
|
2355
|
+
"for each premium plugin in the staging area: name, type (standalone/bundle), description, " +
|
|
2356
|
+
"purchase status, and delivery status (per sub-plugin for bundles).", {}, async () => {
|
|
2357
|
+
if (!ACCOUNT_ID)
|
|
2358
|
+
return refuseNoAccount("premium-list");
|
|
2359
|
+
try {
|
|
2360
|
+
if (!existsSync(STAGING_ROOT)) {
|
|
2361
|
+
return {
|
|
2362
|
+
content: [{ type: "text", text: "No premium plugins available. The staging directory does not exist — premium plugins become available after the next platform update." }],
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
const config = await readAccountConfig();
|
|
2366
|
+
// Effective purchasedPlugins from signed entitlement.
|
|
2367
|
+
const entitlement = await currentEntitlement();
|
|
2368
|
+
const purchased = entitlement.purchasedPlugins;
|
|
2369
|
+
const enabled = Array.isArray(config.enabledPlugins) ? config.enabledPlugins : [];
|
|
2370
|
+
const entries = readdirSync(STAGING_ROOT, { withFileTypes: true })
|
|
2371
|
+
.filter(e => e.isDirectory())
|
|
2372
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
2373
|
+
if (entries.length === 0) {
|
|
2374
|
+
return {
|
|
2375
|
+
content: [{ type: "text", text: "No premium plugins found in the staging area." }],
|
|
2376
|
+
};
|
|
2377
|
+
}
|
|
2378
|
+
const plugins = [];
|
|
2379
|
+
for (const entry of entries) {
|
|
2380
|
+
const stagingDir = resolve(STAGING_ROOT, entry.name);
|
|
2381
|
+
const bundlePath = join(stagingDir, "BUNDLE.md");
|
|
2382
|
+
const pluginPath = join(stagingDir, "PLUGIN.md");
|
|
2383
|
+
if (existsSync(bundlePath)) {
|
|
2384
|
+
// Bundle
|
|
2385
|
+
const fm = parseFrontmatter(readFileSync(bundlePath, "utf-8"));
|
|
2386
|
+
const subPlugins = (Array.isArray(fm.plugins) ? fm.plugins : [])
|
|
2387
|
+
.filter(name => VALID_PLUGIN_NAME.test(name));
|
|
2388
|
+
const subStatus = subPlugins.map(name => ({
|
|
2389
|
+
name,
|
|
2390
|
+
delivered: existsSync(join(PLUGINS_DIR, name, "PLUGIN.md")),
|
|
2391
|
+
enabled: enabled.includes(name),
|
|
2392
|
+
}));
|
|
2393
|
+
plugins.push({
|
|
2394
|
+
name: entry.name,
|
|
2395
|
+
type: "bundle",
|
|
2396
|
+
description: typeof fm.description === "string" ? fm.description : "",
|
|
2397
|
+
purchased: purchased.includes(entry.name),
|
|
2398
|
+
subPlugins: subStatus,
|
|
2399
|
+
});
|
|
2400
|
+
}
|
|
2401
|
+
else if (existsSync(pluginPath)) {
|
|
2402
|
+
// Standalone
|
|
2403
|
+
const fm = parseFrontmatter(readFileSync(pluginPath, "utf-8"));
|
|
2404
|
+
plugins.push({
|
|
2405
|
+
name: entry.name,
|
|
2406
|
+
type: "standalone",
|
|
2407
|
+
description: typeof fm.description === "string" ? fm.description : "",
|
|
2408
|
+
purchased: purchased.includes(entry.name),
|
|
2409
|
+
delivered: existsSync(join(PLUGINS_DIR, entry.name, "PLUGIN.md")),
|
|
2410
|
+
enabled: enabled.includes(entry.name),
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2413
|
+
// Skip directories that have neither BUNDLE.md nor PLUGIN.md
|
|
2414
|
+
}
|
|
2415
|
+
return {
|
|
2416
|
+
content: [{ type: "text", text: JSON.stringify(plugins, null, 2) }],
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
catch (err) {
|
|
2420
|
+
return {
|
|
2421
|
+
content: [{ type: "text", text: `Failed to list premium plugins: ${err instanceof Error ? err.message : String(err)}` }],
|
|
2422
|
+
isError: true,
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
});
|
|
2426
|
+
server.tool("premium-deliver", "Deliver a purchased premium plugin. Copies plugin files from the staging area to the active " +
|
|
2427
|
+
"plugin directory, verifies each copy, updates enabledPlugins in account.json, and scans for " +
|
|
2428
|
+
"agent templates. Handles both standalone plugins and bundles (auto-detected). Idempotent — " +
|
|
2429
|
+
"already-delivered sub-plugins are skipped. Returns a structured result with per-sub-plugin " +
|
|
2430
|
+
"status and available templates.", {
|
|
2431
|
+
pluginName: z.string().describe("Name of the premium plugin to deliver (e.g. 'real-agent', 'teaching')"),
|
|
2432
|
+
}, async ({ pluginName }) => {
|
|
2433
|
+
if (!ACCOUNT_ID)
|
|
2434
|
+
return refuseNoAccount("premium-deliver");
|
|
2435
|
+
const TAG = "[premium-deliver]";
|
|
2436
|
+
// --- Validate plugin name ---
|
|
2437
|
+
if (!pluginName || !VALID_PLUGIN_NAME.test(pluginName)) {
|
|
2438
|
+
return {
|
|
2439
|
+
content: [{ type: "text", text: `${TAG} Invalid plugin name "${pluginName}". Must match [a-z0-9-].` }],
|
|
2440
|
+
isError: true,
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
// --- Guard against clobbering core plugins ---
|
|
2444
|
+
if (CORE_PLUGINS.includes(pluginName)) {
|
|
2445
|
+
return {
|
|
2446
|
+
content: [{ type: "text", text: `${TAG} "${pluginName}" is a core plugin and cannot be delivered as a premium plugin.` }],
|
|
2447
|
+
isError: true,
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
// --- Check staging directory ---
|
|
2451
|
+
if (!existsSync(STAGING_ROOT)) {
|
|
2452
|
+
return {
|
|
2453
|
+
content: [{ type: "text", text: `${TAG} Premium plugins staging directory does not exist. Premium plugins become available after the next platform update.` }],
|
|
2454
|
+
isError: true,
|
|
2455
|
+
};
|
|
2456
|
+
}
|
|
2457
|
+
const stagingDir = resolve(STAGING_ROOT, pluginName);
|
|
2458
|
+
if (!existsSync(stagingDir)) {
|
|
2459
|
+
return {
|
|
2460
|
+
content: [{ type: "text", text: `${TAG} No premium plugin named "${pluginName}" found in the staging area.` }],
|
|
2461
|
+
isError: true,
|
|
2462
|
+
};
|
|
2463
|
+
}
|
|
2464
|
+
// --- Read account config ---
|
|
2465
|
+
let config;
|
|
2466
|
+
try {
|
|
2467
|
+
config = await readAccountConfig();
|
|
2468
|
+
}
|
|
2469
|
+
catch (err) {
|
|
2470
|
+
return {
|
|
2471
|
+
content: [{ type: "text", text: `${TAG} Failed to read account config: ${err instanceof Error ? err.message : String(err)}` }],
|
|
2472
|
+
isError: true,
|
|
2473
|
+
};
|
|
2474
|
+
}
|
|
2475
|
+
// Effective purchasedPlugins from signed entitlement. The
|
|
2476
|
+
// raw account.json value is ignored on commercial installs; verifier
|
|
2477
|
+
// returns the signed list (or [] on anonymous-fallback).
|
|
2478
|
+
const entitlement = await resolveEntitlement(ENTITLEMENT_BRAND, {
|
|
2479
|
+
accountId: typeof config.accountId === "string" ? config.accountId : "",
|
|
2480
|
+
customerEmail: typeof config.customerEmail === "string" ? config.customerEmail : undefined,
|
|
2481
|
+
tier: typeof config.tier === "string" ? config.tier : undefined,
|
|
2482
|
+
purchasedPlugins: Array.isArray(config.purchasedPlugins) ? config.purchasedPlugins : undefined,
|
|
2483
|
+
});
|
|
2484
|
+
const purchased = entitlement.purchasedPlugins;
|
|
2485
|
+
// --- Check purchase status ---
|
|
2486
|
+
if (!purchased.includes(pluginName)) {
|
|
2487
|
+
return {
|
|
2488
|
+
content: [{ type: "text", text: `${TAG} "${pluginName}" is not in purchasedPlugins. Record the purchase first.` }],
|
|
2489
|
+
isError: true,
|
|
2490
|
+
};
|
|
2491
|
+
}
|
|
2492
|
+
// --- Detect type: bundle vs standalone ---
|
|
2493
|
+
const bundlePath = join(stagingDir, "BUNDLE.md");
|
|
2494
|
+
const pluginMdPath = join(stagingDir, "PLUGIN.md");
|
|
2495
|
+
const isBundle = existsSync(bundlePath);
|
|
2496
|
+
const isStandalone = !isBundle && existsSync(pluginMdPath);
|
|
2497
|
+
if (!isBundle && !isStandalone) {
|
|
2498
|
+
return {
|
|
2499
|
+
content: [{ type: "text", text: `${TAG} Staging directory "${pluginName}" contains neither BUNDLE.md nor PLUGIN.md. Invalid premium plugin.` }],
|
|
2500
|
+
isError: true,
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
const items = [];
|
|
2504
|
+
if (isBundle) {
|
|
2505
|
+
const fm = parseFrontmatter(readFileSync(bundlePath, "utf-8"));
|
|
2506
|
+
const subPluginNames = Array.isArray(fm.plugins) ? fm.plugins : [];
|
|
2507
|
+
if (subPluginNames.length === 0) {
|
|
2508
|
+
return {
|
|
2509
|
+
content: [{ type: "text", text: `${TAG} BUNDLE.md for "${pluginName}" has an empty or missing plugins array.` }],
|
|
2510
|
+
isError: true,
|
|
2511
|
+
};
|
|
2512
|
+
}
|
|
2513
|
+
for (const sub of subPluginNames) {
|
|
2514
|
+
if (!VALID_PLUGIN_NAME.test(sub)) {
|
|
2515
|
+
return {
|
|
2516
|
+
content: [{ type: "text", text: `${TAG} Sub-plugin name "${sub}" in BUNDLE.md contains invalid characters. Aborting delivery.` }],
|
|
2517
|
+
isError: true,
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
if (CORE_PLUGINS.includes(sub)) {
|
|
2521
|
+
return {
|
|
2522
|
+
content: [{ type: "text", text: `${TAG} Sub-plugin "${sub}" collides with a core plugin name. Aborting delivery.` }],
|
|
2523
|
+
isError: true,
|
|
2524
|
+
};
|
|
2525
|
+
}
|
|
2526
|
+
items.push({ name: sub, sourcePath: resolve(stagingDir, "plugins", sub) });
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
else {
|
|
2530
|
+
items.push({ name: pluginName, sourcePath: stagingDir });
|
|
2531
|
+
}
|
|
2532
|
+
const results = [];
|
|
2533
|
+
const newlyEnabled = [];
|
|
2534
|
+
for (const item of items) {
|
|
2535
|
+
const destPath = resolve(PLUGINS_DIR, item.name);
|
|
2536
|
+
// Already delivered — skip (preserves user's enable/disable state)
|
|
2537
|
+
if (existsSync(join(destPath, "PLUGIN.md"))) {
|
|
2538
|
+
console.log(`${TAG} ${item.name} already delivered — skipping`);
|
|
2539
|
+
results.push({ name: item.name, status: "skipped" });
|
|
2540
|
+
continue;
|
|
2541
|
+
}
|
|
2542
|
+
// Validate source
|
|
2543
|
+
if (!existsSync(join(item.sourcePath, "PLUGIN.md"))) {
|
|
2544
|
+
const msg = `Source PLUGIN.md missing at ${item.sourcePath}`;
|
|
2545
|
+
console.error(`${TAG} FAILED ${item.name}: ${msg}`);
|
|
2546
|
+
results.push({ name: item.name, status: "failed", error: msg });
|
|
2547
|
+
continue;
|
|
2548
|
+
}
|
|
2549
|
+
// Copy
|
|
2550
|
+
try {
|
|
2551
|
+
cpSync(item.sourcePath, destPath, { recursive: true });
|
|
2552
|
+
console.log(`${TAG} copied ${item.name} from staging`);
|
|
2553
|
+
}
|
|
2554
|
+
catch (err) {
|
|
2555
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2556
|
+
console.error(`${TAG} FAILED to copy ${item.name}: ${msg}`);
|
|
2557
|
+
results.push({ name: item.name, status: "failed", error: msg });
|
|
2558
|
+
continue;
|
|
2559
|
+
}
|
|
2560
|
+
// Verify
|
|
2561
|
+
const verifyPath = join(destPath, "PLUGIN.md");
|
|
2562
|
+
if (!existsSync(verifyPath)) {
|
|
2563
|
+
console.error(`${TAG} FAILED to verify ${item.name}: PLUGIN.md missing after copy`);
|
|
2564
|
+
results.push({ name: item.name, status: "failed", error: "PLUGIN.md missing after copy" });
|
|
2565
|
+
continue;
|
|
2566
|
+
}
|
|
2567
|
+
// Count skills
|
|
2568
|
+
const skillsDir = join(destPath, "skills");
|
|
2569
|
+
let skillCount = 0;
|
|
2570
|
+
if (existsSync(skillsDir)) {
|
|
2571
|
+
skillCount = readdirSync(skillsDir, { withFileTypes: true })
|
|
2572
|
+
.filter(e => e.isDirectory()).length;
|
|
2573
|
+
}
|
|
2574
|
+
console.log(`${TAG} verified ${item.name} (${skillCount} skills)`);
|
|
2575
|
+
results.push({ name: item.name, status: "delivered", skills: skillCount });
|
|
2576
|
+
newlyEnabled.push(item.name);
|
|
2577
|
+
}
|
|
2578
|
+
// --- Update enabledPlugins (only add newly delivered, deduplicate) ---
|
|
2579
|
+
if (newlyEnabled.length > 0) {
|
|
2580
|
+
try {
|
|
2581
|
+
// Re-read config to reduce race window
|
|
2582
|
+
const freshConfig = await readAccountConfig();
|
|
2583
|
+
const freshEnabled = Array.isArray(freshConfig.enabledPlugins)
|
|
2584
|
+
? freshConfig.enabledPlugins
|
|
2585
|
+
: [];
|
|
2586
|
+
const merged = [...new Set([...freshEnabled, ...newlyEnabled])];
|
|
2587
|
+
freshConfig.enabledPlugins = merged;
|
|
2588
|
+
const configPath = join(getAccountDir(), "account.json");
|
|
2589
|
+
await writeFile(configPath, JSON.stringify(freshConfig, null, 2) + "\n", "utf-8");
|
|
2590
|
+
console.log(`${TAG} updated enabledPlugins: added ${newlyEnabled.join(", ")}`);
|
|
2591
|
+
}
|
|
2592
|
+
catch (err) {
|
|
2593
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2594
|
+
console.error(`${TAG} FAILED to update account.json: ${msg}`);
|
|
2595
|
+
return {
|
|
2596
|
+
content: [{
|
|
2597
|
+
type: "text",
|
|
2598
|
+
text: `${TAG} Plugins were copied but account.json update failed: ${msg}\n\nDelivery results:\n${JSON.stringify(results, null, 2)}`,
|
|
2599
|
+
}],
|
|
2600
|
+
isError: true,
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
const templates = [];
|
|
2605
|
+
// For bundles, templates live in the staging agents/ dir; for standalone, in the delivered plugin
|
|
2606
|
+
const agentsSearchDirs = [];
|
|
2607
|
+
if (isBundle) {
|
|
2608
|
+
const bundleAgentsDir = join(stagingDir, "agents");
|
|
2609
|
+
if (existsSync(bundleAgentsDir))
|
|
2610
|
+
agentsSearchDirs.push(bundleAgentsDir);
|
|
2611
|
+
}
|
|
2612
|
+
else {
|
|
2613
|
+
const pluginAgentsDir = join(PLUGINS_DIR, pluginName, "agents");
|
|
2614
|
+
if (existsSync(pluginAgentsDir))
|
|
2615
|
+
agentsSearchDirs.push(pluginAgentsDir);
|
|
2616
|
+
}
|
|
2617
|
+
for (const agentsDir of agentsSearchDirs) {
|
|
2618
|
+
const subdirs = readdirSync(agentsDir, { withFileTypes: true })
|
|
2619
|
+
.filter(e => e.isDirectory());
|
|
2620
|
+
for (const sub of subdirs) {
|
|
2621
|
+
const templateJsonPath = join(agentsDir, sub.name, "template.json");
|
|
2622
|
+
if (!existsSync(templateJsonPath))
|
|
2623
|
+
continue;
|
|
2624
|
+
try {
|
|
2625
|
+
const templateData = JSON.parse(readFileSync(templateJsonPath, "utf-8"));
|
|
2626
|
+
const identityExists = existsSync(join(agentsDir, sub.name, "IDENTITY.md"));
|
|
2627
|
+
const soulExists = existsSync(join(agentsDir, sub.name, "SOUL.md"));
|
|
2628
|
+
if (!identityExists || !soulExists) {
|
|
2629
|
+
console.log(`${TAG} template ${sub.name} incomplete — missing ${!identityExists ? "IDENTITY.md" : "SOUL.md"}, skipping`);
|
|
2630
|
+
continue;
|
|
2631
|
+
}
|
|
2632
|
+
templates.push({
|
|
2633
|
+
directory: join(agentsDir, sub.name),
|
|
2634
|
+
displayName: templateData.displayName ?? sub.name,
|
|
2635
|
+
description: templateData.description ?? "",
|
|
2636
|
+
suggestedSlug: templateData.suggestedSlug,
|
|
2637
|
+
});
|
|
2638
|
+
}
|
|
2639
|
+
catch {
|
|
2640
|
+
console.log(`${TAG} template ${sub.name} has invalid template.json, skipping`);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
// --- Build structured result ---
|
|
2645
|
+
const delivered = results.filter(r => r.status === "delivered");
|
|
2646
|
+
const skipped = results.filter(r => r.status === "skipped");
|
|
2647
|
+
const failed = results.filter(r => r.status === "failed");
|
|
2648
|
+
const totalSkills = delivered.reduce((sum, r) => sum + (r.skills ?? 0), 0);
|
|
2649
|
+
const output = {
|
|
2650
|
+
pluginName,
|
|
2651
|
+
type: isBundle ? "bundle" : "standalone",
|
|
2652
|
+
delivered: delivered.map(r => ({ name: r.name, skills: r.skills })),
|
|
2653
|
+
skipped: skipped.map(r => r.name),
|
|
2654
|
+
failed: failed.map(r => ({ name: r.name, error: r.error })),
|
|
2655
|
+
totalDelivered: delivered.length,
|
|
2656
|
+
totalSkipped: skipped.length,
|
|
2657
|
+
totalFailed: failed.length,
|
|
2658
|
+
totalSkills,
|
|
2659
|
+
templates: templates.map(t => ({
|
|
2660
|
+
displayName: t.displayName,
|
|
2661
|
+
description: t.description,
|
|
2662
|
+
suggestedSlug: t.suggestedSlug,
|
|
2663
|
+
directory: t.directory,
|
|
2664
|
+
})),
|
|
2665
|
+
};
|
|
2666
|
+
return {
|
|
2667
|
+
content: [{ type: "text", text: JSON.stringify(output, null, 2) }],
|
|
2668
|
+
};
|
|
2669
|
+
});
|
|
2670
|
+
// ===================================================================
|
|
2671
|
+
// Action approval tools (EU AI Act Article 14 — human oversight)
|
|
2672
|
+
//
|
|
2673
|
+
// Hook queues require-review actions to {accountDir}/pending-actions/.
|
|
2674
|
+
// These tools let the admin list, approve, reject, or edit pending actions.
|
|
2675
|
+
// On approval, the target plugin MCP server is spawned directly (dispatchStep
|
|
2676
|
+
// pattern) to execute the original tool call.
|
|
2677
|
+
// ===================================================================
|
|
2678
|
+
let _pendingDir;
|
|
2679
|
+
function getPendingDir() {
|
|
2680
|
+
if (!_pendingDir)
|
|
2681
|
+
_pendingDir = resolve(getAccountDir(), "pending-actions");
|
|
2682
|
+
return _pendingDir;
|
|
2683
|
+
}
|
|
2684
|
+
function readPendingActions() {
|
|
2685
|
+
const pendingDir = getPendingDir();
|
|
2686
|
+
if (!existsSync(pendingDir))
|
|
2687
|
+
return [];
|
|
2688
|
+
const files = readdirSync(pendingDir)
|
|
2689
|
+
.filter(f => f.endsWith(".json") && !f.startsWith("."));
|
|
2690
|
+
const actions = [];
|
|
2691
|
+
for (const file of files) {
|
|
2692
|
+
try {
|
|
2693
|
+
const raw = readFileSync(resolve(pendingDir, file), "utf-8");
|
|
2694
|
+
const parsed = JSON.parse(raw);
|
|
2695
|
+
if (parsed.state === "pending") {
|
|
2696
|
+
actions.push(parsed);
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
catch (err) {
|
|
2700
|
+
console.error(`[approval] Failed to read pending action ${file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
return actions.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
2704
|
+
}
|
|
2705
|
+
function readPendingAction(actionId) {
|
|
2706
|
+
const filePath = resolve(getPendingDir(), `${actionId}.json`);
|
|
2707
|
+
if (!existsSync(filePath))
|
|
2708
|
+
return null;
|
|
2709
|
+
try {
|
|
2710
|
+
return JSON.parse(readFileSync(filePath, "utf-8"));
|
|
2711
|
+
}
|
|
2712
|
+
catch {
|
|
2713
|
+
return null;
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
function resolvePendingAction(actionId, state, editedInput) {
|
|
2717
|
+
const filePath = resolve(getPendingDir(), `${actionId}.json`);
|
|
2718
|
+
if (!existsSync(filePath))
|
|
2719
|
+
return false;
|
|
2720
|
+
try {
|
|
2721
|
+
const action = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
2722
|
+
if (action.state !== "pending")
|
|
2723
|
+
return false;
|
|
2724
|
+
action.state = state;
|
|
2725
|
+
action.resolvedAt = new Date().toISOString();
|
|
2726
|
+
if (editedInput)
|
|
2727
|
+
action.editedInput = editedInput;
|
|
2728
|
+
writeFileSync(filePath, JSON.stringify(action, null, 2), "utf-8");
|
|
2729
|
+
return true;
|
|
2730
|
+
}
|
|
2731
|
+
catch {
|
|
2732
|
+
return false;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
function cleanupPendingAction(actionId) {
|
|
2736
|
+
const pendingDir = getPendingDir();
|
|
2737
|
+
const filePath = resolve(pendingDir, `${actionId}.json`);
|
|
2738
|
+
try {
|
|
2739
|
+
if (existsSync(filePath)) {
|
|
2740
|
+
const archiveDir = resolve(pendingDir, "resolved");
|
|
2741
|
+
if (!existsSync(archiveDir)) {
|
|
2742
|
+
mkdirSync(archiveDir, { recursive: true });
|
|
2743
|
+
}
|
|
2744
|
+
renameSync(filePath, resolve(archiveDir, `${actionId}.json`));
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
catch (err) {
|
|
2748
|
+
console.error(`[approval] Failed to archive pending action ${actionId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
async function persistApprovalToolCall(opts) {
|
|
2752
|
+
// Write doctrine: a ToolCall without its owning Conversation is
|
|
2753
|
+
// noise — every admin tool call belongs to a chat. When sessionId is
|
|
2754
|
+
// missing or its Conversation cannot be matched, we log and skip the
|
|
2755
|
+
// persist rather than create an orphan ToolCall node. The legacy
|
|
2756
|
+
// OPTIONAL-MATCH + FOREACH pattern created orphans silently.
|
|
2757
|
+
if (!opts.sessionId) {
|
|
2758
|
+
console.error(`[approval] ToolCall skipped (no sessionId): tool=${opts.toolName} state=${opts.approvalState}`);
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
if (!ACCOUNT_ID) {
|
|
2762
|
+
// Boot-tolerance refusal handlers gate every caller, so reaching here is
|
|
2763
|
+
// a guard regression rather than a steady-state condition. Throw loud so
|
|
2764
|
+
// the missing handler-level guard is identified, not silently default to
|
|
2765
|
+
// empty-string accountId (which would mint orphan ToolCall nodes).
|
|
2766
|
+
throw new Error(`[approval] persistApprovalToolCall reached without ACCOUNT_ID — handler guard missing for tool=${opts.toolName}`);
|
|
2767
|
+
}
|
|
2768
|
+
const session = getSession();
|
|
2769
|
+
try {
|
|
2770
|
+
const optionalFields = [
|
|
2771
|
+
opts.originalInput != null ? ", originalInput: $originalInput" : "",
|
|
2772
|
+
].join("");
|
|
2773
|
+
const res = await session.run(`MATCH (c:Conversation {sessionId: $sessionId})
|
|
2774
|
+
CREATE (c)-[:HAS_TOOL_CALL]->(tc:ToolCall {
|
|
2775
|
+
callId: $callId,
|
|
2776
|
+
toolName: $toolName,
|
|
2777
|
+
pluginName: $pluginName,
|
|
2778
|
+
input: $input,
|
|
2779
|
+
output: $output,
|
|
2780
|
+
isError: $isError,
|
|
2781
|
+
agentType: 'admin',
|
|
2782
|
+
accountId: $accountId,
|
|
2783
|
+
approvalState: $approvalState,
|
|
2784
|
+
sessionId: $sessionId,
|
|
2785
|
+
createdBySource: 'admin-approval',
|
|
2786
|
+
startedAt: datetime($startedAt),
|
|
2787
|
+
completedAt: datetime($completedAt)
|
|
2788
|
+
${optionalFields}
|
|
2789
|
+
})`, {
|
|
2790
|
+
callId: randomUUID(),
|
|
2791
|
+
toolName: opts.toolName,
|
|
2792
|
+
pluginName: opts.pluginName,
|
|
2793
|
+
input: opts.input.slice(0, 300),
|
|
2794
|
+
output: opts.output.slice(0, 300),
|
|
2795
|
+
isError: opts.isError,
|
|
2796
|
+
accountId: ACCOUNT_ID,
|
|
2797
|
+
approvalState: opts.approvalState,
|
|
2798
|
+
sessionId: opts.sessionId,
|
|
2799
|
+
startedAt: new Date().toISOString(),
|
|
2800
|
+
completedAt: new Date().toISOString(),
|
|
2801
|
+
...(opts.originalInput != null ? { originalInput: opts.originalInput.slice(0, 300) } : {}),
|
|
2802
|
+
});
|
|
2803
|
+
if (res.summary.counters.updates().nodesCreated === 0) {
|
|
2804
|
+
console.error(`[approval] ToolCall skipped (conversation ${opts.sessionId} not found): tool=${opts.toolName}`);
|
|
2805
|
+
return;
|
|
2806
|
+
}
|
|
2807
|
+
console.error(`[approval] ToolCall persisted: ${opts.toolName} state=${opts.approvalState}`);
|
|
2808
|
+
}
|
|
2809
|
+
catch (err) {
|
|
2810
|
+
console.error(`[approval] ToolCall persist failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2811
|
+
}
|
|
2812
|
+
finally {
|
|
2813
|
+
await session.close();
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
/**
|
|
2817
|
+
* Spawn a plugin MCP server and execute a tool call directly.
|
|
2818
|
+
* Same pattern as workflow-execute.ts dispatchStep.
|
|
2819
|
+
*/
|
|
2820
|
+
async function dispatchApprovedAction(plugin, tool, args, timeoutMs = 30_000) {
|
|
2821
|
+
const serverPath = resolve(PLATFORM_ROOT, "plugins", plugin, "mcp", "dist", "index.js");
|
|
2822
|
+
// Path traversal check
|
|
2823
|
+
const pluginsRoot = resolve(PLATFORM_ROOT, "plugins");
|
|
2824
|
+
if (!serverPath.startsWith(pluginsRoot + "/")) {
|
|
2825
|
+
throw new Error(`Invalid plugin name: "${plugin}" — path traversal blocked`);
|
|
2826
|
+
}
|
|
2827
|
+
if (!existsSync(serverPath)) {
|
|
2828
|
+
throw new Error(`Plugin MCP server not found: ${serverPath}`);
|
|
2829
|
+
}
|
|
2830
|
+
const { Client } = await import("@modelcontextprotocol/sdk/client/index.js");
|
|
2831
|
+
const { StdioClientTransport } = await import("@modelcontextprotocol/sdk/client/stdio.js");
|
|
2832
|
+
const env = {};
|
|
2833
|
+
for (const [k, v] of Object.entries(process.env)) {
|
|
2834
|
+
if (v !== undefined)
|
|
2835
|
+
env[k] = v;
|
|
2836
|
+
}
|
|
2837
|
+
env.PLATFORM_ROOT = PLATFORM_ROOT;
|
|
2838
|
+
if (!ACCOUNT_ID) {
|
|
2839
|
+
throw new Error("dispatchApprovedAction called without ACCOUNT_ID — handler guard missing");
|
|
2840
|
+
}
|
|
2841
|
+
env.ACCOUNT_ID = ACCOUNT_ID;
|
|
2842
|
+
const transport = new StdioClientTransport({
|
|
2843
|
+
command: process.execPath,
|
|
2844
|
+
args: [serverPath],
|
|
2845
|
+
env,
|
|
2846
|
+
stderr: "pipe",
|
|
2847
|
+
});
|
|
2848
|
+
let childStderr = "";
|
|
2849
|
+
const stderrStream = transport.stderr;
|
|
2850
|
+
if (stderrStream) {
|
|
2851
|
+
stderrStream.on("data", (chunk) => {
|
|
2852
|
+
if (childStderr.length < 4096) {
|
|
2853
|
+
childStderr += chunk.toString("utf-8").slice(0, 4096 - childStderr.length);
|
|
2854
|
+
}
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
const client = new Client({ name: "approval-executor", version: "1.0.0" });
|
|
2858
|
+
let timedOut = false;
|
|
2859
|
+
const timeout = setTimeout(() => {
|
|
2860
|
+
timedOut = true;
|
|
2861
|
+
client.close().catch(() => { });
|
|
2862
|
+
}, timeoutMs);
|
|
2863
|
+
try {
|
|
2864
|
+
await client.connect(transport);
|
|
2865
|
+
const result = await client.callTool({ name: tool, arguments: args });
|
|
2866
|
+
const contentArr = Array.isArray(result.content) ? result.content : [];
|
|
2867
|
+
const text = contentArr
|
|
2868
|
+
.filter((c) => c.type === "text")
|
|
2869
|
+
.map((c) => c.text)
|
|
2870
|
+
.join("\n");
|
|
2871
|
+
return { text, isError: result.isError === true };
|
|
2872
|
+
}
|
|
2873
|
+
catch (err) {
|
|
2874
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2875
|
+
const stderrSuffix = childStderr ? `\nChild stderr: ${childStderr.trim()}` : "";
|
|
2876
|
+
if (timedOut) {
|
|
2877
|
+
throw new Error(`Tool "${tool}" on plugin "${plugin}" timed out after ${timeoutMs}ms${stderrSuffix}`);
|
|
2878
|
+
}
|
|
2879
|
+
throw new Error(`Tool "${tool}" on plugin "${plugin}" failed: ${msg}${stderrSuffix}`);
|
|
2880
|
+
}
|
|
2881
|
+
finally {
|
|
2882
|
+
clearTimeout(timeout);
|
|
2883
|
+
await client.close().catch(() => { });
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
eagerTool(server, "action-pending", "List actions that are queued for human approval. Returns each pending action's ID, " +
|
|
2887
|
+
"tool name, input summary, and when it was queued. Use this to review what the agent " +
|
|
2888
|
+
"wanted to do before approving or rejecting.", {}, async () => {
|
|
2889
|
+
if (!ACCOUNT_ID)
|
|
2890
|
+
return refuseNoAccount("action-pending");
|
|
2891
|
+
const actions = readPendingActions();
|
|
2892
|
+
if (actions.length === 0) {
|
|
2893
|
+
return {
|
|
2894
|
+
content: [{ type: "text", text: "No pending actions. All actions are either approved, rejected, or auto-executed." }],
|
|
2895
|
+
};
|
|
2896
|
+
}
|
|
2897
|
+
const lines = actions.map((a) => {
|
|
2898
|
+
const inputSummary = JSON.stringify(a.hookPayload?.tool_input ?? {}).slice(0, 200);
|
|
2899
|
+
return `- **${a.actionId}** | ${a.toolName} | queued ${a.createdAt}\n Input: ${inputSummary}`;
|
|
2900
|
+
});
|
|
2901
|
+
return {
|
|
2902
|
+
content: [{ type: "text", text: `## Pending Actions (${actions.length})\n\n${lines.join("\n\n")}` }],
|
|
2903
|
+
};
|
|
2904
|
+
});
|
|
2905
|
+
eagerTool(server, "action-approve", "Approve a pending action and execute it immediately. The original tool call is " +
|
|
2906
|
+
"executed via the target plugin's MCP server. The result is returned and an audit " +
|
|
2907
|
+
"record is written to Neo4j with approvalState: approved.", {
|
|
2908
|
+
actionId: z.string().describe("The action ID to approve (from action-pending)"),
|
|
2909
|
+
sessionId: z.string().optional().describe("Current conversation ID for audit trail linking"),
|
|
2910
|
+
}, async ({ actionId, sessionId }) => {
|
|
2911
|
+
if (!ACCOUNT_ID)
|
|
2912
|
+
return refuseNoAccount("action-approve");
|
|
2913
|
+
const action = readPendingAction(actionId);
|
|
2914
|
+
if (!action) {
|
|
2915
|
+
return {
|
|
2916
|
+
content: [{ type: "text", text: `Action ${actionId} not found. It may have already been resolved or the ID is incorrect.` }],
|
|
2917
|
+
isError: true,
|
|
2918
|
+
};
|
|
2919
|
+
}
|
|
2920
|
+
if (action.state !== "pending") {
|
|
2921
|
+
return {
|
|
2922
|
+
content: [{ type: "text", text: `Action ${actionId} is already ${action.state}. Cannot approve a resolved action.` }],
|
|
2923
|
+
isError: true,
|
|
2924
|
+
};
|
|
2925
|
+
}
|
|
2926
|
+
if (!action.pluginName) {
|
|
2927
|
+
return {
|
|
2928
|
+
content: [{ type: "text", text: `Action ${actionId} has no plugin name — cannot determine which MCP server to execute.` }],
|
|
2929
|
+
isError: true,
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
// Mark as approved before execution
|
|
2933
|
+
if (!resolvePendingAction(actionId, "approved")) {
|
|
2934
|
+
return {
|
|
2935
|
+
content: [{ type: "text", text: `Failed to update action ${actionId} state. The file may have been modified concurrently.` }],
|
|
2936
|
+
isError: true,
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
const toolInput = action.hookPayload?.tool_input ?? {};
|
|
2940
|
+
console.error(`[approval] Executing approved action: ${action.toolName} plugin=${action.pluginName} actionId=${actionId}`);
|
|
2941
|
+
try {
|
|
2942
|
+
const result = await dispatchApprovedAction(action.pluginName, action.toolName, toolInput);
|
|
2943
|
+
// Persist audit record
|
|
2944
|
+
await persistApprovalToolCall({
|
|
2945
|
+
toolName: action.toolName,
|
|
2946
|
+
pluginName: action.pluginName,
|
|
2947
|
+
input: JSON.stringify(toolInput),
|
|
2948
|
+
output: result.text,
|
|
2949
|
+
isError: result.isError,
|
|
2950
|
+
approvalState: "approved",
|
|
2951
|
+
sessionId,
|
|
2952
|
+
});
|
|
2953
|
+
cleanupPendingAction(actionId);
|
|
2954
|
+
return {
|
|
2955
|
+
content: [{ type: "text", text: `Action approved and executed.\n\nTool: ${action.toolName}\nResult:\n${result.text}` }],
|
|
2956
|
+
isError: result.isError,
|
|
2957
|
+
};
|
|
2958
|
+
}
|
|
2959
|
+
catch (err) {
|
|
2960
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
2961
|
+
console.error(`[approval] Execution failed for ${actionId}: ${errMsg}`);
|
|
2962
|
+
await persistApprovalToolCall({
|
|
2963
|
+
toolName: action.toolName,
|
|
2964
|
+
pluginName: action.pluginName,
|
|
2965
|
+
input: JSON.stringify(toolInput),
|
|
2966
|
+
output: errMsg,
|
|
2967
|
+
isError: true,
|
|
2968
|
+
approvalState: "approved",
|
|
2969
|
+
sessionId,
|
|
2970
|
+
});
|
|
2971
|
+
return {
|
|
2972
|
+
content: [{ type: "text", text: `Action approved but execution failed: ${errMsg}` }],
|
|
2973
|
+
isError: true,
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
});
|
|
2977
|
+
eagerTool(server, "action-reject", "Reject a pending action. The action is not executed. An audit record is written " +
|
|
2978
|
+
"to Neo4j with approvalState: rejected.", {
|
|
2979
|
+
actionId: z.string().describe("The action ID to reject (from action-pending)"),
|
|
2980
|
+
reason: z.string().optional().describe("Optional reason for rejection"),
|
|
2981
|
+
sessionId: z.string().optional().describe("Current conversation ID for audit trail linking"),
|
|
2982
|
+
}, async ({ actionId, reason, sessionId }) => {
|
|
2983
|
+
if (!ACCOUNT_ID)
|
|
2984
|
+
return refuseNoAccount("action-reject");
|
|
2985
|
+
const action = readPendingAction(actionId);
|
|
2986
|
+
if (!action) {
|
|
2987
|
+
return {
|
|
2988
|
+
content: [{ type: "text", text: `Action ${actionId} not found. It may have already been resolved or the ID is incorrect.` }],
|
|
2989
|
+
isError: true,
|
|
2990
|
+
};
|
|
2991
|
+
}
|
|
2992
|
+
if (action.state !== "pending") {
|
|
2993
|
+
return {
|
|
2994
|
+
content: [{ type: "text", text: `Action ${actionId} is already ${action.state}. Cannot reject a resolved action.` }],
|
|
2995
|
+
isError: true,
|
|
2996
|
+
};
|
|
2997
|
+
}
|
|
2998
|
+
if (!resolvePendingAction(actionId, "rejected")) {
|
|
2999
|
+
return {
|
|
3000
|
+
content: [{ type: "text", text: `Failed to update action ${actionId} state.` }],
|
|
3001
|
+
isError: true,
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
const reasonSuffix = reason ? ` Reason: ${reason}` : "";
|
|
3005
|
+
console.error(`[approval] Action rejected: ${action.toolName} actionId=${actionId}${reasonSuffix}`);
|
|
3006
|
+
await persistApprovalToolCall({
|
|
3007
|
+
toolName: action.toolName,
|
|
3008
|
+
pluginName: action.pluginName ?? "unknown",
|
|
3009
|
+
input: JSON.stringify(action.hookPayload?.tool_input ?? {}),
|
|
3010
|
+
output: `Rejected by admin.${reasonSuffix}`,
|
|
3011
|
+
isError: false,
|
|
3012
|
+
approvalState: "rejected",
|
|
3013
|
+
sessionId,
|
|
3014
|
+
});
|
|
3015
|
+
cleanupPendingAction(actionId);
|
|
3016
|
+
return {
|
|
3017
|
+
content: [{ type: "text", text: `Action rejected. ${action.toolName} will not be executed.${reasonSuffix}` }],
|
|
3018
|
+
};
|
|
3019
|
+
});
|
|
3020
|
+
eagerTool(server, "action-edit", "Edit a pending action's input and then execute the modified version. The original " +
|
|
3021
|
+
"input is preserved in the audit trail. Use this when the admin wants to modify the " +
|
|
3022
|
+
"action (e.g., change the email subject) before approving.", {
|
|
3023
|
+
actionId: z.string().describe("The action ID to edit (from action-pending)"),
|
|
3024
|
+
editedInput: z.string().describe("The modified tool input as a JSON string"),
|
|
3025
|
+
sessionId: z.string().optional().describe("Current conversation ID for audit trail linking"),
|
|
3026
|
+
}, async ({ actionId, editedInput, sessionId }) => {
|
|
3027
|
+
if (!ACCOUNT_ID)
|
|
3028
|
+
return refuseNoAccount("action-edit");
|
|
3029
|
+
const action = readPendingAction(actionId);
|
|
3030
|
+
if (!action) {
|
|
3031
|
+
return {
|
|
3032
|
+
content: [{ type: "text", text: `Action ${actionId} not found.` }],
|
|
3033
|
+
isError: true,
|
|
3034
|
+
};
|
|
3035
|
+
}
|
|
3036
|
+
if (action.state !== "pending") {
|
|
3037
|
+
return {
|
|
3038
|
+
content: [{ type: "text", text: `Action ${actionId} is already ${action.state}. Cannot edit a resolved action.` }],
|
|
3039
|
+
isError: true,
|
|
3040
|
+
};
|
|
3041
|
+
}
|
|
3042
|
+
if (!action.pluginName) {
|
|
3043
|
+
return {
|
|
3044
|
+
content: [{ type: "text", text: `Action ${actionId} has no plugin name — cannot determine which MCP server to execute.` }],
|
|
3045
|
+
isError: true,
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
let parsedInput;
|
|
3049
|
+
try {
|
|
3050
|
+
parsedInput = JSON.parse(editedInput);
|
|
3051
|
+
}
|
|
3052
|
+
catch {
|
|
3053
|
+
return {
|
|
3054
|
+
content: [{ type: "text", text: `Invalid JSON in editedInput. Please provide valid JSON for the tool input.` }],
|
|
3055
|
+
isError: true,
|
|
3056
|
+
};
|
|
3057
|
+
}
|
|
3058
|
+
const originalInput = action.hookPayload?.tool_input ?? {};
|
|
3059
|
+
// Mark as approved with the edited input
|
|
3060
|
+
if (!resolvePendingAction(actionId, "approved", parsedInput)) {
|
|
3061
|
+
return {
|
|
3062
|
+
content: [{ type: "text", text: `Failed to update action ${actionId} state.` }],
|
|
3063
|
+
isError: true,
|
|
3064
|
+
};
|
|
3065
|
+
}
|
|
3066
|
+
console.error(`[approval] Executing edited action: ${action.toolName} plugin=${action.pluginName} actionId=${actionId}`);
|
|
3067
|
+
try {
|
|
3068
|
+
const result = await dispatchApprovedAction(action.pluginName, action.toolName, parsedInput);
|
|
3069
|
+
await persistApprovalToolCall({
|
|
3070
|
+
toolName: action.toolName,
|
|
3071
|
+
pluginName: action.pluginName,
|
|
3072
|
+
input: JSON.stringify(parsedInput),
|
|
3073
|
+
output: result.text,
|
|
3074
|
+
isError: result.isError,
|
|
3075
|
+
approvalState: "approved",
|
|
3076
|
+
originalInput: JSON.stringify(originalInput),
|
|
3077
|
+
sessionId,
|
|
3078
|
+
});
|
|
3079
|
+
cleanupPendingAction(actionId);
|
|
3080
|
+
return {
|
|
3081
|
+
content: [{ type: "text", text: `Action edited, approved, and executed.\n\nTool: ${action.toolName}\nResult:\n${result.text}` }],
|
|
3082
|
+
isError: result.isError,
|
|
3083
|
+
};
|
|
3084
|
+
}
|
|
3085
|
+
catch (err) {
|
|
3086
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
3087
|
+
console.error(`[approval] Edited execution failed for ${actionId}: ${errMsg}`);
|
|
3088
|
+
await persistApprovalToolCall({
|
|
3089
|
+
toolName: action.toolName,
|
|
3090
|
+
pluginName: action.pluginName,
|
|
3091
|
+
input: JSON.stringify(parsedInput),
|
|
3092
|
+
output: errMsg,
|
|
3093
|
+
isError: true,
|
|
3094
|
+
approvalState: "approved",
|
|
3095
|
+
originalInput: JSON.stringify(originalInput),
|
|
3096
|
+
sessionId,
|
|
3097
|
+
});
|
|
3098
|
+
return {
|
|
3099
|
+
content: [{ type: "text", text: `Action edited and approved but execution failed: ${errMsg}` }],
|
|
3100
|
+
isError: true,
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
// Task 619 — native-CC admin PIN identity gate. Eager-loaded so it is visible
|
|
3105
|
+
// from the first turn: the operator must authenticate before any other tool is
|
|
3106
|
+
// reachable (the PreToolUse pin-identity-gate hook enforces that; this tool is
|
|
3107
|
+
// the agent-callable PIN-submit surface and returns the operator's profile).
|
|
3108
|
+
eagerTool(server, "admin-identity-authenticate", "Authenticate the current operator by PIN. MUST be the first tool you call in a session: submit the operator's PIN to bind their identity. No other tool is reachable until this succeeds. Returns the authenticated operator's profile.", { pin: z.string().describe("The operator's PIN, exactly as they typed it.") }, async ({ pin }) => ({
|
|
3109
|
+
content: [{ type: "text", text: await runAuthenticate(pin) }],
|
|
3110
|
+
}));
|
|
3111
|
+
// Cleanup on exit (SIGTERM for systemd service stops on Pi)
|
|
3112
|
+
const cleanup = async () => {
|
|
3113
|
+
await closeDriver();
|
|
3114
|
+
process.exit(0);
|
|
3115
|
+
};
|
|
3116
|
+
process.on("SIGINT", cleanup);
|
|
3117
|
+
process.on("SIGTERM", cleanup);
|
|
3118
|
+
const transport = new StdioServerTransport();
|
|
3119
|
+
await server.connect(transport);
|
|
3120
|
+
//# sourceMappingURL=index.js.map
|