@rubytech/create-maxy-code 0.1.23 → 0.1.26
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/index.js +63 -16
- package/package.json +1 -1
- package/payload/platform/plugins/admin/PLUGIN.md +50 -23
- package/payload/platform/plugins/admin/skills/admin-user-management/SKILL.md +47 -0
- package/payload/platform/plugins/admin/skills/commitment-followthrough/SKILL.md +60 -0
- package/payload/platform/plugins/admin/skills/file-presentation/SKILL.md +67 -0
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +111 -126
- package/payload/platform/plugins/admin/skills/session-management/SKILL.md +62 -0
- package/payload/platform/plugins/cloudflare/references/dashboard-guide.md +37 -0
- package/payload/platform/plugins/cloudflare/references/manual-setup.md +81 -1
- package/payload/platform/plugins/cloudflare/scripts/__tests__/tunnel-ingress.test.ts +241 -0
- package/payload/platform/plugins/cloudflare/scripts/setup-tunnel.sh +267 -28
- package/payload/platform/plugins/cloudflare/scripts/tunnel-ingress.ts +291 -0
- package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +42 -0
- package/payload/platform/plugins/contacts/PLUGIN.md +18 -9
- package/payload/platform/plugins/deep-research/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/deep-research/PLUGIN.md +7 -1
- 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/strategic-reading/SKILL.md +69 -0
- package/payload/platform/plugins/docs/references/deployment.md +3 -2
- package/payload/platform/plugins/docs/references/platform.md +2 -0
- package/payload/platform/plugins/docs/references/troubleshooting.md +12 -0
- package/payload/platform/plugins/email/PLUGIN.md +18 -9
- 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 +185 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +1 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +34 -111
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +7 -2
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +7 -2
- package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +1 -1
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +2 -0
- package/payload/platform/plugins/memory/PLUGIN.md +64 -29
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +3 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +105 -4
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +16 -3
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
- package/payload/platform/plugins/memory/skills/archive-crawler/SKILL.md +67 -0
- package/payload/platform/plugins/memory/skills/concept-synthesis/SKILL.md +80 -0
- package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +2 -0
- package/payload/platform/plugins/memory/skills/document-ingest/SKILL.md +2 -0
- package/payload/platform/plugins/outlook/PLUGIN.md +14 -7
- package/payload/platform/plugins/replicate/PLUGIN.md +6 -3
- package/payload/platform/plugins/scheduling/PLUGIN.md +19 -8
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts +7 -3
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +7 -3
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
- package/payload/platform/plugins/scheduling/skills/briefing/SKILL.md +75 -0
- package/payload/platform/plugins/scheduling/skills/daily-prep/SKILL.md +61 -0
- package/payload/platform/plugins/tasks/PLUGIN.md +28 -14
- package/payload/platform/plugins/telegram/PLUGIN.md +6 -3
- package/payload/platform/plugins/waitlist/PLUGIN.md +12 -6
- package/payload/platform/plugins/whatsapp/PLUGIN.md +25 -13
- package/payload/platform/plugins/workflows/PLUGIN.md +16 -8
- package/payload/platform/scripts/conversation-id-allowlist.txt +0 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +27 -2
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +27 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +36 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +41 -3
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +25 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js +54 -3
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/tool-surface.d.ts +25 -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 +149 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.js.map +1 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +38 -284
- package/payload/platform/templates/agents/admin/SOUL.md +4 -4
- package/payload/platform/templates/specialists/agents/content-producer.md +24 -69
- package/payload/platform/templates/specialists/agents/database-operator.md +49 -155
- package/payload/platform/templates/specialists/agents/personal-assistant.md +27 -177
- package/payload/platform/templates/specialists/agents/project-manager.md +29 -96
- package/payload/platform/templates/specialists/agents/research-assistant.md +36 -78
- package/payload/premium-plugins/real-agency/agents/compliance.md +14 -0
- package/payload/premium-plugins/real-agency/agents/negotiator.md +22 -0
- package/payload/premium-plugins/real-agency/agents/valuer.md +16 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/.claude-plugin/plugin.json +1 -1
- package/payload/premium-plugins/real-agency/plugins/estate-business/PLUGIN.md +44 -13
- package/payload/premium-plugins/real-agency/plugins/estate-business/skills/commission-calculator/SKILL.md +40 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/skills/month-end-close/SKILL.md +69 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/skills/payment-batch-stager/SKILL.md +42 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/skills/period-reconciler/SKILL.md +42 -0
- package/payload/premium-plugins/real-agency/plugins/estate-sales/.claude-plugin/plugin.json +1 -1
- package/payload/premium-plugins/real-agency/plugins/estate-sales/PLUGIN.md +32 -13
- package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/chase-progression/SKILL.md +107 -0
- package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/risk-scorer/SKILL.md +42 -0
- package/payload/premium-plugins/real-agency/plugins/leads/.claude-plugin/plugin.json +1 -1
- package/payload/premium-plugins/real-agency/plugins/leads/PLUGIN.md +40 -10
- package/payload/premium-plugins/real-agency/plugins/leads/skills/chain-progression-tracker/SKILL.md +51 -0
- package/payload/premium-plugins/real-agency/plugins/leads/skills/diary-builder/SKILL.md +38 -0
- package/payload/premium-plugins/real-agency/plugins/leads/skills/enquiry-triage/SKILL.md +36 -0
- package/payload/premium-plugins/real-agency/plugins/leads/skills/morning-round/SKILL.md +72 -0
- package/payload/premium-plugins/real-agency/plugins/listings/.claude-plugin/plugin.json +1 -1
- package/payload/premium-plugins/real-agency/plugins/listings/PLUGIN.md +82 -12
- package/payload/premium-plugins/real-agency/plugins/listings/skills/comparable-finder/SKILL.md +52 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/epc-checker/SKILL.md +38 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/listing-copy-writer/SKILL.md +55 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/local-market-stats/SKILL.md +33 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/new-instruction/SKILL.md +78 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/particulars-builder/SKILL.md +48 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/portal-launch-scheduler/SKILL.md +49 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/pricing-scenario-builder/SKILL.md +35 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/supplier-booker/SKILL.md +39 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/talk-track-composer/SKILL.md +36 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/terms-of-business-drafter/SKILL.md +54 -0
- package/payload/premium-plugins/real-agency/plugins/listings/skills/valuation-prep/SKILL.md +69 -0
- package/payload/premium-plugins/real-agency/plugins/loop/PLUGIN.md +35 -0
- package/payload/premium-plugins/real-agency/plugins/loop/skills/compliance-flag-checker/SKILL.md +53 -0
- package/payload/premium-plugins/real-agency/plugins/loop/skills/priority-ranker/SKILL.md +40 -0
- package/payload/premium-plugins/real-agency/plugins/loop/skills/tone-matched-drafter/SKILL.md +53 -0
- package/payload/premium-plugins/real-agency/plugins/loop/skills/variance-narrator/SKILL.md +50 -0
- package/payload/premium-plugins/real-agency/plugins/loop/skills/vendor-research/SKILL.md +54 -0
- package/payload/server/{chunk-2ZNKHCQB.js → chunk-2MRZBQMH.js} +1 -1
- package/payload/server/{chunk-GPUCA2RQ.js → chunk-NL7QLVAD.js} +0 -192
- package/payload/server/{chunk-IDKWGLM5.js → chunk-YPZFYTYP.js} +1 -247
- package/payload/server/{cloudflare-task-tracker-LYI5BTYI.js → cloudflare-task-tracker-QVOGHKWV.js} +2 -2
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/package.json +0 -2
- package/payload/server/public/assets/{Checkbox-D1OQD43b.js → Checkbox-YIF0payo.js} +1 -1
- package/payload/server/public/assets/{admin-czNBxWor.js → admin-DW8IJcLc.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-BcwgT80u.js → architectureDiagram-Q4EWVU46-Bz8mlxZZ.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-BMSyZUQA.js → blockDiagram-DXYQGD6D-DwV8Z8-i.js} +1 -1
- package/payload/server/public/assets/{brand-2cku8WFs.css → brand-DqiRNMlu.css} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-DPRGY1jJ.js → c4Diagram-AHTNJAMY-DiUTejMp.js} +1 -1
- package/payload/server/public/assets/channel-PtVtoBEL.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-B7oQ3g1c.js → chunk-336JU56O-4mHZpBXe.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-C1P0yFXw.js → chunk-426QAEUC-Cbv0vrN9.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-LI7kOJd0.js → chunk-4TB4RGXK-BvLhId_2.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-CXQRGTQE.js → chunk-5FUZZQ4R-bBafOTkw.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-NSyzpXRy.js → chunk-5PVQY5BW-B0NqBKVy.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-voNwxbDs.js → chunk-EDXVE4YY-CFd4SqI6.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-CMEMPzYY.js → chunk-ENJZ2VHE-ajf2sb6c.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-hEbwu-pe.js → chunk-ICPOFSXX-pWg6bug7.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-DxskDrLs.js → chunk-OYMX7WX6-OjEd-17c.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-D7TKgUo0.js → chunk-U2HBQHQK-DbEFSPoh.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-BvPUQEPm.js → chunk-X2U36JSP-COdNwrBb.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-BY-RWQUW.js → chunk-YZCP3GAM-CHMWuY9B.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-DZvOYDY6.js → chunk-ZZ45TVLE-B-uDLQOB.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-RVH_SEhY.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Cm3rAb93.js +1 -0
- package/payload/server/public/assets/clone-BjY0Wzht.js +1 -0
- package/payload/server/public/assets/{dagre-KV5264BT-Cnj0mUZl.js → dagre-KV5264BT-CMEzmhIL.js} +1 -1
- package/payload/server/public/assets/{dagre-Bt-fpckL.js → dagre-bhIG_KnW.js} +1 -1
- package/payload/server/public/assets/data-K_kS__sL.js +1 -0
- package/payload/server/public/assets/{device-url-actions-Bjz3Xzbm.js → device-url-actions-AcOyLSeF.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-DjLzvOlx.js → diagram-5BDNPKRD-6RIoQhIL.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-DTfuRd-T.js → diagram-G4DWMVQ6-BSp36TVv.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-BaL2mCnx.js → diagram-MMDJMWI5-D54fo52D.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-C5InWY5R.js → diagram-TYMM5635-CWL8z-Pq.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-DO7BXTpn.js → erDiagram-SMLLAGMA-AnnHBo3z.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-DDdAKfLf.js → flowDiagram-DWJPFMVM-laWmBl5o.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-arJD8Utm.js → ganttDiagram-T4ZO3ILL-B94ko8ie.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-C55GH-OS.js → gitGraphDiagram-UUTBAWPF-DxzL1fxZ.js} +1 -1
- package/payload/server/public/assets/graph-DeEigyO_.js +1 -0
- package/payload/server/public/assets/graph-labels-C7I5QvNv.js +1 -0
- package/payload/server/public/assets/{graphlib-DL9PM7Ex.js → graphlib-CY-zIElM.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-BMSGqUbG.js → infoDiagram-42DDH7IO-BMTajIIr.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-Dw6BZ6BG.js → ishikawaDiagram-UXIWVN3A-B_QauE5O.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DrywUGXw.js → journeyDiagram-VCZTEJTY-DmlqSIih.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-DuwtVBBc.js → kanban-definition-6JOO6SKY-ZGDQT7xB.js} +1 -1
- package/payload/server/public/assets/{line-JAksyKHj.js → line-D13opgep.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-BMq-ApBW.js → mermaid-parser.core-C650Sual.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-tH4oX0Kh.js → mermaid.core-BqnQoXTp.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-D1OiiJga.js → mindmap-definition-QFDTVHPH-BS_8y-tY.js} +1 -1
- package/payload/server/public/assets/{page-BZpoS7iR.js → page-B_rpjIRr.js} +1 -1
- package/payload/server/public/assets/{page-CkvBvezS.js → page-qSH972X0.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-Ckwm69PW.js → pieDiagram-DEJITSTG-B5OmNvBO.js} +1 -1
- package/payload/server/public/assets/{public-C-dTMgXu.js → public-DDsYgotk.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-COw3yZ1j.js → quadrantDiagram-34T5L4WZ-DTYITdNo.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-DqGzM4K-.js → requirementDiagram-MS252O5E-CRZWxH06.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-D-l1c_Pl.js → sankeyDiagram-XADWPNL6-DazRENhe.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-BeIi0DtJ.js → sequenceDiagram-FGHM5R23-BcHTxmPy.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-C-jgegLk.js → stateDiagram-FHFEXIEX-DYU7nbqg.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BgljVtlp.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-BGFKkYmi.js → timeline-definition-GMOUNBTQ-BKGmqkST.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-5NuIhJLS.js → vennDiagram-DHZGUBPP-BXvLPmX7.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-Be9ytVut.js → wardleyDiagram-NUSXRM2D-BCclUa3Z.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DCyHg41R.js → xychartDiagram-5P7HB3ND-C-Xp-Eoc.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +1152 -2564
- package/payload/platform/scripts/check-sdk-oauth.mjs +0 -185
- package/payload/server/public/assets/channel-fxEghWew.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-BsWzGW0N.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BGVa3h90.js +0 -1
- package/payload/server/public/assets/clone-Khvocke2.js +0 -1
- package/payload/server/public/assets/data-DBd-Buhp.js +0 -1
- package/payload/server/public/assets/graph-DUtVdnZ6.js +0 -1
- package/payload/server/public/assets/graph-labels-Dxfue-fP.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BaMs8Znv.js +0 -1
- /package/payload/server/public/assets/{brand-CSQuxS9w.js → brand-Bm671owU.js} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { serve } from '@hono/node-server';
|
|
2
2
|
import { spawn as ptySpawn } from 'node-pty';
|
|
3
|
+
import { join } from 'node:path';
|
|
3
4
|
import { loadConfig } from './config.js';
|
|
4
5
|
import { buildHttpApp } from './http-server.js';
|
|
5
6
|
import { SessionStore } from './session-store.js';
|
|
7
|
+
import { loadToolSurface, ToolSurfaceError } from './tool-surface.js';
|
|
6
8
|
const TAG = '[claude-session-manager]';
|
|
7
9
|
const log = (line) => console.log(`${TAG} ${line}`);
|
|
8
10
|
function spawnPtyAdapter(cmd, args, env, cwd) {
|
|
@@ -27,6 +29,30 @@ async function main() {
|
|
|
27
29
|
log(`boot port=${config.port} persistDir=${config.persistDir} spawnCwd=${config.spawnCwd}`);
|
|
28
30
|
log(`host hostname=${config.host.hostname} lanIPv4=${config.host.lanIPv4 ?? 'unresolved'} adminUrl=${config.host.adminUrl} tunnelUrl=${config.host.tunnelUrl ?? 'none'}` +
|
|
29
31
|
(config.host.lanIPv4Diagnostic ? ` diagnostic=${JSON.stringify(config.host.lanIPv4Diagnostic)}` : ''));
|
|
32
|
+
// Task 005 — load the tool surface once at boot. Refuse to start if any
|
|
33
|
+
// PLUGIN.md tool entry lacks a publicAllowlist field (or has a malformed
|
|
34
|
+
// one). The HTTP listener is only bound after this returns successfully,
|
|
35
|
+
// so a malformed manifest never silently produces public spawns.
|
|
36
|
+
const platformRoot = process.env.PLATFORM_ROOT ?? process.env.MAXY_PLATFORM_ROOT;
|
|
37
|
+
if (!platformRoot) {
|
|
38
|
+
log('boot-failed reason=platform-root-missing detail="PLATFORM_ROOT env var not set; cannot locate plugins/"');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
const pluginsRoot = join(platformRoot, 'plugins');
|
|
42
|
+
let toolSurface;
|
|
43
|
+
try {
|
|
44
|
+
toolSurface = loadToolSurface(pluginsRoot);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
if (err instanceof ToolSurfaceError) {
|
|
48
|
+
log(`boot-failed reason=${err.reason} tool=${err.detail}`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
log(`boot-failed reason=tool-surface-load detail=${err instanceof Error ? err.message : String(err)}`);
|
|
52
|
+
}
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
log(`tool-surface admin=${toolSurface.admin.size} public=${toolSurface.public.size}`);
|
|
30
56
|
const app = buildHttpApp({
|
|
31
57
|
store,
|
|
32
58
|
spawnCwd: config.spawnCwd,
|
|
@@ -37,6 +63,7 @@ async function main() {
|
|
|
37
63
|
logger: log,
|
|
38
64
|
spawnPty: (cmd, args, env) => spawnPtyAdapter(cmd, args, env, config.spawnCwd),
|
|
39
65
|
host: config.host,
|
|
66
|
+
toolSurface,
|
|
40
67
|
});
|
|
41
68
|
serve({ fetch: app.fetch, port: config.port, hostname: '127.0.0.1' }, (info) => {
|
|
42
69
|
log(`listening address=127.0.0.1:${info.port}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MA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,QAAQ,EAAE,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;QAC7E,GAAG,CAAC,+BAA+B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,EAAE;QAClC,GAAG,CAAC,mBAAmB,MAAM,aAAa,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACzD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;YAC5B,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACrB,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,sCAAsC,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAA;IACD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAA;IAChD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;AAChD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Logger, PtyHandle, Role, Channel } from './types.js';
|
|
2
2
|
import { SessionStore, type StoredSession } from './session-store.js';
|
|
3
|
+
import { type OnboardingPayload } from './system-prompt.js';
|
|
3
4
|
import type { HostResolution } from './config.js';
|
|
5
|
+
import type { ToolSurface } from './tool-surface.js';
|
|
4
6
|
export type SpawnResult = {
|
|
5
7
|
ok: true;
|
|
6
8
|
session: StoredSession;
|
|
@@ -23,6 +25,12 @@ export interface SpawnDeps {
|
|
|
23
25
|
* `lanIPv4` is null. One edit to this block changes the doctrine for
|
|
24
26
|
* every agent in every session. */
|
|
25
27
|
host: HostResolution;
|
|
28
|
+
/** Task 005 — precomputed tool surface for both roles. Loaded once at
|
|
29
|
+
* manager boot from a directory walk of platform/plugins/<name>/PLUGIN.md.
|
|
30
|
+
* The boot path refuses to start if any tool's PLUGIN.md entry lacks a
|
|
31
|
+
* publicAllowlist field, so by the time pty-spawner sees this struct, the
|
|
32
|
+
* per-tool decisions are guaranteed complete. */
|
|
33
|
+
toolSurface: ToolSurface;
|
|
26
34
|
}
|
|
27
35
|
export interface SpawnArgs {
|
|
28
36
|
senderId: string;
|
|
@@ -38,7 +46,35 @@ export interface SpawnArgs {
|
|
|
38
46
|
* When omitted or empty, argv is byte-identical to today — existing
|
|
39
47
|
* Maxy installs with no channel plugins pay nothing for the addition. */
|
|
40
48
|
channels?: string[];
|
|
49
|
+
/** Task 043 — admin onboarding directive. When provided, the manager
|
|
50
|
+
* appends a third sentinel-wrapped section (`<onboarding-state>`) to the
|
|
51
|
+
* --append-system-prompt block at PTY spawn time. The operator's first
|
|
52
|
+
* /input therefore carries only their raw text; the directive is part
|
|
53
|
+
* of the system prompt, not the user transcript. Resumed sessions and
|
|
54
|
+
* step-9 (complete) sessions never receive this payload. */
|
|
55
|
+
onboarding?: OnboardingPayload;
|
|
56
|
+
/** Task 043 — for observability log line only. The admin UI wrapper
|
|
57
|
+
* resolves accountId server-side; the manager echoes the first 8 chars
|
|
58
|
+
* in `[onboarding-prompt]` so a tail can correlate the spawn with the
|
|
59
|
+
* source account without persisting the full id. Public/non-admin
|
|
60
|
+
* spawns omit this. */
|
|
61
|
+
accountId?: string;
|
|
62
|
+
/** Task 010 — operator-selected permission mode. When set to anything
|
|
63
|
+
* other than `default`, the manager appends `--permission-mode <mode>`
|
|
64
|
+
* to the spawn argv so the claude CLI starts the session in that mode.
|
|
65
|
+
* `default` (or omitted) leaves argv byte-identical to today. */
|
|
66
|
+
permissionMode?: PermissionMode;
|
|
67
|
+
/** Task 051 — per-session attachment directory for role=public. When set,
|
|
68
|
+
* pty-spawner pre-creates the directory and appends `--add-dir <dir>` plus
|
|
69
|
+
* `--allowed-tools "Read(<dir>/**)"` to argv so claude can read public-chat
|
|
70
|
+
* uploads referenced in the dispatched turn. Ignored for non-public roles.
|
|
71
|
+
* The directory is per-(accountId, senderId) and deterministic; the bridge
|
|
72
|
+
* passes it at session-creation time so it covers every turn in the
|
|
73
|
+
* session, not just the first turn carrying attachments. */
|
|
74
|
+
attachmentDir?: string;
|
|
41
75
|
}
|
|
76
|
+
export type PermissionMode = 'default' | 'acceptEdits' | 'plan' | 'auto';
|
|
77
|
+
export declare const PERMISSION_MODES: readonly PermissionMode[];
|
|
42
78
|
export declare function spawnClaudeSession(deps: SpawnDeps, args: SpawnArgs): Promise<SpawnResult>;
|
|
43
79
|
export interface DeleteDeps {
|
|
44
80
|
store: SessionStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pty-spawner.d.ts","sourceRoot":"","sources":["../src/pty-spawner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pty-spawner.d.ts","sourceRoot":"","sources":["../src/pty-spawner.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAElE,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAErE,OAAO,EAAoD,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAA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AgB,EAAE,SAAS,cAAc,EAA+C,CAAA;AAErG,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAsH/F;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAqBzC"}
|
|
@@ -9,14 +9,16 @@
|
|
|
9
9
|
// child is killed (if alive) before the error surfaces to the caller. The
|
|
10
10
|
// `[claude-session-manager] spawn-failed` line names the reason.
|
|
11
11
|
import { randomUUID } from 'node:crypto';
|
|
12
|
+
import { mkdirSync } from 'node:fs';
|
|
12
13
|
import { startUrlCapture } from './url-capture.js';
|
|
13
14
|
import { deriveJsonlPath } from './jsonl-path.js';
|
|
14
|
-
import { composeAppendSystemPrompt } from './system-prompt.js';
|
|
15
|
+
import { composeAppendSystemPrompt, renderOnboardingBlock } from './system-prompt.js';
|
|
16
|
+
export const PERMISSION_MODES = ['default', 'acceptEdits', 'plan', 'auto'];
|
|
15
17
|
export async function spawnClaudeSession(deps, args) {
|
|
16
18
|
const sessionId = randomUUID();
|
|
17
19
|
const startedAt = new Date().toISOString();
|
|
18
20
|
const start = Date.now();
|
|
19
|
-
const appendSystemPrompt = composeAppendSystemPrompt(deps.host);
|
|
21
|
+
const appendSystemPrompt = composeAppendSystemPrompt(deps.host, args.onboarding);
|
|
20
22
|
if (!appendSystemPrompt) {
|
|
21
23
|
const stderrTail = deps.host.lanIPv4Diagnostic ?? 'append-system-prompt unresolved';
|
|
22
24
|
deps.logger(`spawn-failed reason=host-context-unresolved stderr-tail=${JSON.stringify(stderrTail)}`);
|
|
@@ -36,6 +38,35 @@ export async function spawnClaudeSession(deps, args) {
|
|
|
36
38
|
argv.push('--channels', ch);
|
|
37
39
|
}
|
|
38
40
|
}
|
|
41
|
+
// Task 005 — per-role tool-allowlist argv. The set is precomputed at boot
|
|
42
|
+
// and never inferred per call; this loop just renders it. Sorted output
|
|
43
|
+
// gives byte-stable argv for snapshot tests and grep-friendly log lines.
|
|
44
|
+
const allowedSet = args.role === 'public' ? deps.toolSurface.public : deps.toolSurface.admin;
|
|
45
|
+
const allowed = Array.from(allowedSet).sort();
|
|
46
|
+
for (const tool of allowed) {
|
|
47
|
+
argv.push('--allowed-tools', tool);
|
|
48
|
+
}
|
|
49
|
+
// Observability — sample up to 5 excluded tool names so an operator
|
|
50
|
+
// grepping the spawn log can see at a glance what a public role cannot
|
|
51
|
+
// touch. Admin role excludes nothing; the field is still emitted (empty)
|
|
52
|
+
// so the line shape is uniform across roles.
|
|
53
|
+
const excludedSample = args.role === 'public'
|
|
54
|
+
? Array.from(deps.toolSurface.admin).filter((t) => !deps.toolSurface.public.has(t)).sort().slice(0, 5).join(',')
|
|
55
|
+
: '';
|
|
56
|
+
deps.logger(`tool-allowlist role=${args.role} count=${allowed.length} excluded=${excludedSample}`);
|
|
57
|
+
if (args.permissionMode && args.permissionMode !== 'default') {
|
|
58
|
+
argv.push('--permission-mode', args.permissionMode);
|
|
59
|
+
}
|
|
60
|
+
// Task 051 — public-chat attachment passthrough. Pre-create the per-session
|
|
61
|
+
// upload dir (so --add-dir does not fail on a missing path), then grant
|
|
62
|
+
// claude scoped Read access to it. The Read allow-rule mirrors the dir, so
|
|
63
|
+
// a `Read("/etc/passwd")` call from the PTY is refused by claude's
|
|
64
|
+
// permissions layer regardless of any operator instruction in the turn.
|
|
65
|
+
if (args.role === 'public' && args.attachmentDir) {
|
|
66
|
+
mkdirSync(args.attachmentDir, { recursive: true });
|
|
67
|
+
argv.push('--add-dir', args.attachmentDir);
|
|
68
|
+
argv.push('--allowed-tools', `Read(${args.attachmentDir}/**)`);
|
|
69
|
+
}
|
|
39
70
|
let pty;
|
|
40
71
|
try {
|
|
41
72
|
pty = deps.spawnPty(deps.claudeBin, argv, {
|
|
@@ -74,8 +105,15 @@ export async function spawnClaudeSession(deps, args) {
|
|
|
74
105
|
session.exited = true;
|
|
75
106
|
deps.logger(`kill pid=${pty.pid} reason=process-exited exit-code=0`);
|
|
76
107
|
});
|
|
77
|
-
deps.logger(`spawn pid=${pty.pid} sessionUrl=${url} jsonlPath=${jsonlPath ?? 'unknown'} senderId=${args.senderId} role=${args.role} channel=${args.channel} latency-ms=${Date.now() - start}`);
|
|
108
|
+
deps.logger(`spawn pid=${pty.pid} sessionUrl=${url} jsonlPath=${jsonlPath ?? 'unknown'} senderId=${args.senderId} role=${args.role} channel=${args.channel} permissionMode=${args.permissionMode ?? 'default'} latency-ms=${Date.now() - start}`);
|
|
78
109
|
deps.logger(`[pty-spawn] sessionId=${sessionId} appendSystemPromptBytes=${Buffer.byteLength(appendSystemPrompt, 'utf8')} hostname=${deps.host.hostname} lanIPv4=${deps.host.lanIPv4} adminUrl=${deps.host.adminUrl} tunnelUrl=${deps.host.tunnelUrl ?? 'none'}`);
|
|
110
|
+
if (args.onboarding) {
|
|
111
|
+
const rendered = renderOnboardingBlock(args.onboarding.step);
|
|
112
|
+
if (rendered) {
|
|
113
|
+
const accountIdShort = args.accountId ? args.accountId.slice(0, 8) : '';
|
|
114
|
+
deps.logger(`[onboarding-prompt] step=${rendered.label} bytes=${Buffer.byteLength(rendered.block, 'utf8')} sessionId=${sessionId.slice(0, 8)} accountId=${accountIdShort}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
79
117
|
resolve({ ok: true, session });
|
|
80
118
|
},
|
|
81
119
|
onTimeout: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pty-spawner.js","sourceRoot":"","sources":["../src/pty-spawner.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,yEAAyE;AACzE,0DAA0D;AA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AAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AACpC,CAAC"}
|
|
@@ -4,6 +4,30 @@ export interface HostContext {
|
|
|
4
4
|
adminUrl: string;
|
|
5
5
|
tunnelUrl: string | null;
|
|
6
6
|
}
|
|
7
|
+
/** Onboarding state forwarded by the admin UI wrapper to the manager.
|
|
8
|
+
* `step` is the raw value returned by `loadOnboardingStep(accountId)` —
|
|
9
|
+
* 0..8 = in-progress, 9 = complete, -1 = no node (defensive), null =
|
|
10
|
+
* Neo4j unreachable. Task 043 moves the onboarding directive from PTY
|
|
11
|
+
* keystrokes (where the Claude CLI's Ink TextInput interpreted each
|
|
12
|
+
* `\n` in a multi-line block as Enter, dropping the bytes before they
|
|
13
|
+
* reached the agent) into the spawn-time append-system-prompt block. */
|
|
14
|
+
export interface OnboardingPayload {
|
|
15
|
+
step: number | null;
|
|
16
|
+
}
|
|
7
17
|
export declare const ATTACHMENT_CEILING_BYTES = 31457280;
|
|
8
|
-
export declare function composeAppendSystemPrompt(host: HostContext): string | null;
|
|
18
|
+
export declare function composeAppendSystemPrompt(host: HostContext, onboarding?: OnboardingPayload): string | null;
|
|
19
|
+
export interface RenderedOnboardingBlock {
|
|
20
|
+
/** Block body without a leading newline; callers join with `\n`. */
|
|
21
|
+
block: string;
|
|
22
|
+
/** Label for observability: `<n>` for in-progress steps, `missing` for
|
|
23
|
+
* step === -1, `graph-unreachable` for step === null. Never emitted
|
|
24
|
+
* for the complete (step === 9) case — that returns null. */
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/** Render the onboarding-state section for a given step. Returns null when
|
|
28
|
+
* the agent should see no onboarding block (step === 9 = complete). The
|
|
29
|
+
* prose contract — declarative two-tool sequence, forbidden preamble
|
|
30
|
+
* phrasings — is pinned by tests in `__tests__/system-prompt.test.ts`
|
|
31
|
+
* and `platform/ui/app/lib/__tests__/onboarding-prompt-complete-onboarding.test.ts`. */
|
|
32
|
+
export declare function renderOnboardingBlock(step: number | null): RenderedOnboardingBlock | null;
|
|
9
33
|
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED;;;;;;yEAMyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,eAAO,MAAM,wBAAwB,WAAa,CAAA;AAElD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,EACjB,UAAU,CAAC,EAAE,iBAAiB,GAC7B,MAAM,GAAG,IAAI,CAmBf;AAED,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb;;kEAE8D;IAC9D,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;yFAIyF;AACzF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,uBAAuB,GAAG,IAAI,CASzF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Composes the `--append-system-prompt` block injected into every spawned
|
|
2
|
-
// `claude --verbose --remote-control` PTY.
|
|
2
|
+
// `claude --verbose --remote-control` PTY. Three sentinel-wrapped sections:
|
|
3
3
|
//
|
|
4
4
|
// <host> ... </host> — hostname, LAN IPv4, admin URL,
|
|
5
5
|
// tunnel URL (or "none")
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
// — 30 MiB SendUserFile ceiling and
|
|
8
8
|
// the tunnel-link workaround for
|
|
9
9
|
// oversize files
|
|
10
|
+
// <onboarding-state> ... </onboarding-state>
|
|
11
|
+
// — optional. Present only when the
|
|
12
|
+
// caller supplies an `onboarding`
|
|
13
|
+
// payload AND the resolved step
|
|
14
|
+
// is anything other than 9
|
|
15
|
+
// (complete). Task 043.
|
|
10
16
|
//
|
|
11
17
|
// The block is the only doctrine surface that survives Claude Code SDK
|
|
12
18
|
// upgrades. Per Task 037, no skill carries a copy; one edit here changes the
|
|
@@ -16,11 +22,11 @@
|
|
|
16
22
|
// caller passes that case as `null` to indicate the spawner should reject
|
|
17
23
|
// with `host-context-unresolved` rather than emit a malformed block.
|
|
18
24
|
export const ATTACHMENT_CEILING_BYTES = 31_457_280; // 30 MiB, mirrors the SDK uploader
|
|
19
|
-
export function composeAppendSystemPrompt(host) {
|
|
25
|
+
export function composeAppendSystemPrompt(host, onboarding) {
|
|
20
26
|
if (!host.lanIPv4)
|
|
21
27
|
return null;
|
|
22
28
|
const tunnelLine = host.tunnelUrl ? host.tunnelUrl : 'none';
|
|
23
|
-
|
|
29
|
+
const sections = [
|
|
24
30
|
'<host>',
|
|
25
31
|
`hostname: ${host.hostname}`,
|
|
26
32
|
`lan-ipv4: ${host.lanIPv4}`,
|
|
@@ -30,6 +36,51 @@ export function composeAppendSystemPrompt(host) {
|
|
|
30
36
|
'<attachment-ceiling>',
|
|
31
37
|
'SendUserFile and any inline attachment surface accept at most 30 MiB per file. Over that ceiling, write the file under <spawn-cwd>/output/ and send the operator the public URL at <tunnel-url>/files/<relative-path>; never call SendUserFile with a file whose on-disk size exceeds 30 MiB. The tool returns "N files delivered to user" even when the byte upload silently fails, so the response is not evidence of delivery.',
|
|
32
38
|
'</attachment-ceiling>',
|
|
39
|
+
];
|
|
40
|
+
if (onboarding) {
|
|
41
|
+
const rendered = renderOnboardingBlock(onboarding.step);
|
|
42
|
+
if (rendered)
|
|
43
|
+
sections.push(rendered.block);
|
|
44
|
+
}
|
|
45
|
+
return sections.join('\n');
|
|
46
|
+
}
|
|
47
|
+
/** Render the onboarding-state section for a given step. Returns null when
|
|
48
|
+
* the agent should see no onboarding block (step === 9 = complete). The
|
|
49
|
+
* prose contract — declarative two-tool sequence, forbidden preamble
|
|
50
|
+
* phrasings — is pinned by tests in `__tests__/system-prompt.test.ts`
|
|
51
|
+
* and `platform/ui/app/lib/__tests__/onboarding-prompt-complete-onboarding.test.ts`. */
|
|
52
|
+
export function renderOnboardingBlock(step) {
|
|
53
|
+
if (step === 9)
|
|
54
|
+
return null;
|
|
55
|
+
if (step === null) {
|
|
56
|
+
return { block: renderUnreachableBlock(), label: 'graph-unreachable' };
|
|
57
|
+
}
|
|
58
|
+
if (step < 0) {
|
|
59
|
+
return { block: renderIncompleteBlock(-1), label: 'missing' };
|
|
60
|
+
}
|
|
61
|
+
return { block: renderIncompleteBlock(step), label: String(step) };
|
|
62
|
+
}
|
|
63
|
+
function renderIncompleteBlock(currentStep) {
|
|
64
|
+
const stepAttr = currentStep < 0 ? 'missing' : String(currentStep);
|
|
65
|
+
const resumeStep = currentStep < 0 ? 0 : currentStep + 1;
|
|
66
|
+
// Task 038 Outcome E1 — declarative, no menu phrasing, no pre-skill preamble.
|
|
67
|
+
// Two-tool contract: first `skill-load(name=onboarding)`, then
|
|
68
|
+
// `render-component` for the next step. Operator-visible drift (any "let
|
|
69
|
+
// me check", "let me figure out", "let me list" preamble) is the
|
|
70
|
+
// failure mode the precision-check rule `onboarding-skill-drift` watches
|
|
71
|
+
// for; the prose below names it so the agent treats the constraint as
|
|
72
|
+
// structural rather than stylistic.
|
|
73
|
+
return [
|
|
74
|
+
`<onboarding-state currentStep="${stepAttr}" resumeStep="${resumeStep}">`,
|
|
75
|
+
`Onboarding is incomplete. Your first tool call this turn is \`skill-load\` with \`skillName=onboarding\`. Your second tool call is \`render-component\` for step ${resumeStep}, exactly as the skill body directs. Do not greet, do not summarise, do not write a preamble (\`let me check\`, \`let me figure out\`, \`let me list\` and similar phrasings are forbidden). The skill body is the only authority for what the operator sees next.`,
|
|
76
|
+
`</onboarding-state>`,
|
|
77
|
+
].join('\n');
|
|
78
|
+
}
|
|
79
|
+
function renderUnreachableBlock() {
|
|
80
|
+
return [
|
|
81
|
+
`<onboarding-state currentStep="unknown" graphUnreachable="true">`,
|
|
82
|
+
`Neo4j is unreachable, so onboarding state cannot be read. Do not assume onboarding is complete. Tell the operator the graph is unreachable, name the symptom in one line, and stop — do not improvise an onboarding flow without state, and do not silently skip the step the operator was on.`,
|
|
83
|
+
`</onboarding-state>`,
|
|
33
84
|
].join('\n');
|
|
34
85
|
}
|
|
35
86
|
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,2EAA2E;AAC3E,oEAAoE;AACpE,mDAAmD;AACnD,6EAA6E;AAC7E,4EAA4E;AAC5E,4DAA4D;AAC5D,+CAA+C;AAC/C,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,sEAAsE;AACtE,mEAAmE;AACnE,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,0DAA0D;AAC1D,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,qEAAqE;AAoBrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAA,CAAC,mCAAmC;AAEtF,MAAM,UAAU,yBAAyB,CACvC,IAAiB,EACjB,UAA8B;IAE9B,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAA;IAC3D,MAAM,Q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AC,CAAC,WAAW,GAAG,CAAC,CAAA;IACxD,8EAA8E;IAC9E,+DAA+D;IAC/D,yEAAyE;IACzE,iEAAiE;IACjE,yEAAyE;IACzE,sEAAsE;IACtE,oCAAoC;IACpC,OAAO;QACL,kCAAkC,QAAQ,iBAAiB,UAAU,IAAI;QACzE,oKAAoK,UAAU,oQAAoQ;QAClb,qBAAqB;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED,SAAS,sBAAsB;IAC7B,OAAO;QACL,kEAAkE;QAClE,gSAAgS;QAChS,qBAAqB;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ToolSurface {
|
|
2
|
+
admin: ReadonlySet<string>;
|
|
3
|
+
public: ReadonlySet<string>;
|
|
4
|
+
}
|
|
5
|
+
export declare class ToolSurfaceError extends Error {
|
|
6
|
+
readonly reason: string;
|
|
7
|
+
readonly detail: string;
|
|
8
|
+
constructor(reason: string, detail: string);
|
|
9
|
+
}
|
|
10
|
+
interface ToolEntry {
|
|
11
|
+
name: string;
|
|
12
|
+
publicAllowlist: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Parse the tools: block out of a PLUGIN.md frontmatter body. Returns an
|
|
15
|
+
* empty array when the frontmatter has no tools: key or declares `tools: []`.
|
|
16
|
+
* Throws ToolSurfaceError on any malformed entry (missing name, missing or
|
|
17
|
+
* non-boolean publicAllowlist). */
|
|
18
|
+
export declare function parseToolsBlock(frontmatter: string, pluginDir: string): ToolEntry[];
|
|
19
|
+
/** Walk a plugins root directory, parse every <name>/PLUGIN.md, and return
|
|
20
|
+
* the {admin, public} sets of fully qualified tool names. Throws on the
|
|
21
|
+
* first malformed manifest — the caller (the manager boot) must exit
|
|
22
|
+
* non-zero so the operator sees the gap. */
|
|
23
|
+
export declare function loadToolSurface(pluginsRoot: string): ToolSurface;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=tool-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-surface.d.ts","sourceRoot":"","sources":["../src/tool-surface.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED,qBAAa,gBAAiB,SAAQ,KAAK;aACb,MAAM,EAAE,MAAM;aAAkB,MAAM,EAAE,MAAM;gBAA9C,MAAM,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAI3E;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,OAAO,CAAA;CACzB;AAYD;;;oCAGoC;AACpC,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,CAsEnF;AAED;;;6CAG6C;AAC7C,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CA0BhE"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Tool-surface resolver — Task 005.
|
|
2
|
+
//
|
|
3
|
+
// Loaded once at manager boot from a directory walk of every
|
|
4
|
+
// platform/plugins/<name>/PLUGIN.md. The frontmatter of each PLUGIN.md
|
|
5
|
+
// declares a list of tools; every tool entry must specify both `name` and
|
|
6
|
+
// `publicAllowlist: <bool>`. The resolver produces two sets of fully
|
|
7
|
+
// qualified tool names (`mcp__<plugin-dir>__<tool>`):
|
|
8
|
+
//
|
|
9
|
+
// - admin: every tool, every plugin.
|
|
10
|
+
// - public: subset where publicAllowlist === true.
|
|
11
|
+
//
|
|
12
|
+
// A tool missing the publicAllowlist field is a refusal-to-boot condition,
|
|
13
|
+
// not a silent default. The decision belongs at the tool's declaration
|
|
14
|
+
// site; defaulting either way hides the question from the writer.
|
|
15
|
+
//
|
|
16
|
+
// The parser uses a hand-rolled YAML-ish walker over the frontmatter block
|
|
17
|
+
// — there is no js-yaml dependency in this service today and the schema
|
|
18
|
+
// is intentionally narrow (a sequence of `- name: <s>` + `publicAllowlist:
|
|
19
|
+
// <bool>` pairs). Anything outside that shape is rejected loudly.
|
|
20
|
+
import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
export class ToolSurfaceError extends Error {
|
|
23
|
+
reason;
|
|
24
|
+
detail;
|
|
25
|
+
constructor(reason, detail) {
|
|
26
|
+
super(`${reason}: ${detail}`);
|
|
27
|
+
this.reason = reason;
|
|
28
|
+
this.detail = detail;
|
|
29
|
+
this.name = 'ToolSurfaceError';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
|
|
33
|
+
function extractFrontmatter(raw, pluginDir) {
|
|
34
|
+
const m = raw.match(FRONTMATTER_RE);
|
|
35
|
+
if (!m) {
|
|
36
|
+
throw new ToolSurfaceError('frontmatter-missing', `${pluginDir}/PLUGIN.md has no '---' delimited frontmatter`);
|
|
37
|
+
}
|
|
38
|
+
return m[1];
|
|
39
|
+
}
|
|
40
|
+
/** Parse the tools: block out of a PLUGIN.md frontmatter body. Returns an
|
|
41
|
+
* empty array when the frontmatter has no tools: key or declares `tools: []`.
|
|
42
|
+
* Throws ToolSurfaceError on any malformed entry (missing name, missing or
|
|
43
|
+
* non-boolean publicAllowlist). */
|
|
44
|
+
export function parseToolsBlock(frontmatter, pluginDir) {
|
|
45
|
+
const lines = frontmatter.split(/\r?\n/);
|
|
46
|
+
let i = 0;
|
|
47
|
+
while (i < lines.length) {
|
|
48
|
+
const line = lines[i];
|
|
49
|
+
// Skip blank lines and other top-level keys until we hit `tools:`.
|
|
50
|
+
if (/^tools:\s*\[\s*\]\s*$/.test(line))
|
|
51
|
+
return [];
|
|
52
|
+
if (/^tools:\s*$/.test(line)) {
|
|
53
|
+
i++;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
58
|
+
if (i >= lines.length)
|
|
59
|
+
return [];
|
|
60
|
+
const out = [];
|
|
61
|
+
let current = null;
|
|
62
|
+
const flush = () => {
|
|
63
|
+
if (!current)
|
|
64
|
+
return;
|
|
65
|
+
if (typeof current.name !== 'string' || current.name.length === 0) {
|
|
66
|
+
throw new ToolSurfaceError('tool-name-missing', `${pluginDir}/PLUGIN.md has a tool entry with no name`);
|
|
67
|
+
}
|
|
68
|
+
if (typeof current.publicAllowlist !== 'boolean') {
|
|
69
|
+
if (current.publicAllowlist === undefined) {
|
|
70
|
+
throw new ToolSurfaceError('public-allowlist-missing', `${pluginDir}/${current.name} — every tool must declare publicAllowlist: <true|false>`);
|
|
71
|
+
}
|
|
72
|
+
throw new ToolSurfaceError('public-allowlist-not-boolean', `${pluginDir}/${current.name} — publicAllowlist must be a YAML boolean (true|false), got ${JSON.stringify(current.publicAllowlist)}`);
|
|
73
|
+
}
|
|
74
|
+
out.push(current);
|
|
75
|
+
current = null;
|
|
76
|
+
};
|
|
77
|
+
for (; i < lines.length; i++) {
|
|
78
|
+
const line = lines[i];
|
|
79
|
+
if (line.length === 0)
|
|
80
|
+
continue;
|
|
81
|
+
// A top-level key (no leading space) ends the tools block.
|
|
82
|
+
if (/^[A-Za-z_]/.test(line))
|
|
83
|
+
break;
|
|
84
|
+
const newEntry = line.match(/^\s+-\s+name:\s*(.+?)\s*$/);
|
|
85
|
+
if (newEntry) {
|
|
86
|
+
flush();
|
|
87
|
+
current = { name: newEntry[1] };
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
// A list item that does NOT lead with `name:` is malformed — the entry
|
|
91
|
+
// has no name field. Surface it loudly rather than silently ignoring.
|
|
92
|
+
const orphanListItem = line.match(/^\s+-\s+(?!name:)/);
|
|
93
|
+
if (orphanListItem) {
|
|
94
|
+
throw new ToolSurfaceError('tool-name-missing', `${pluginDir}/PLUGIN.md tool entry lacks a name field`);
|
|
95
|
+
}
|
|
96
|
+
const allowlist = line.match(/^\s+publicAllowlist:\s*(.+?)\s*$/);
|
|
97
|
+
if (allowlist && current) {
|
|
98
|
+
const v = allowlist[1].trim();
|
|
99
|
+
if (v === 'true')
|
|
100
|
+
current.publicAllowlist = true;
|
|
101
|
+
else if (v === 'false')
|
|
102
|
+
current.publicAllowlist = false;
|
|
103
|
+
else
|
|
104
|
+
current.publicAllowlist = v;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// Other per-entry fields (e.g. nested name on its own line, or unknown
|
|
108
|
+
// keys we don't care about) are ignored — only name and publicAllowlist
|
|
109
|
+
// affect the resolver.
|
|
110
|
+
}
|
|
111
|
+
flush();
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
/** Walk a plugins root directory, parse every <name>/PLUGIN.md, and return
|
|
115
|
+
* the {admin, public} sets of fully qualified tool names. Throws on the
|
|
116
|
+
* first malformed manifest — the caller (the manager boot) must exit
|
|
117
|
+
* non-zero so the operator sees the gap. */
|
|
118
|
+
export function loadToolSurface(pluginsRoot) {
|
|
119
|
+
if (!existsSync(pluginsRoot)) {
|
|
120
|
+
throw new ToolSurfaceError('plugins-root-missing', pluginsRoot);
|
|
121
|
+
}
|
|
122
|
+
const admin = new Set();
|
|
123
|
+
const pub = new Set();
|
|
124
|
+
const entries = readdirSync(pluginsRoot).sort();
|
|
125
|
+
for (const plugin of entries) {
|
|
126
|
+
const pluginDir = join(pluginsRoot, plugin);
|
|
127
|
+
try {
|
|
128
|
+
if (!statSync(pluginDir).isDirectory())
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const manifestPath = join(pluginDir, 'PLUGIN.md');
|
|
135
|
+
if (!existsSync(manifestPath))
|
|
136
|
+
continue;
|
|
137
|
+
const raw = readFileSync(manifestPath, 'utf-8');
|
|
138
|
+
const frontmatter = extractFrontmatter(raw, plugin);
|
|
139
|
+
const tools = parseToolsBlock(frontmatter, plugin);
|
|
140
|
+
for (const t of tools) {
|
|
141
|
+
const qualified = `mcp__${plugin}__${t.name}`;
|
|
142
|
+
admin.add(qualified);
|
|
143
|
+
if (t.publicAllowlist)
|
|
144
|
+
pub.add(qualified);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { admin, public: pub };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=tool-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-surface.js","sourceRoot":"","sources":["../src/tool-surface.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,EAAE;AACF,6DAA6D;AAC7D,uEAAuE;AACvE,0EAA0E;AAC1E,qEAAqE;AACrE,sDAAsD;AACtD,EAAE;AACF,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,2EAA2E;AAC3E,kEAAkE;AAElE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAOhC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACb;IAAgC;IAA5D,YAA4B,MAAc,EAAkB,MAAc;QACxE,KAAK,CAAC,GAAG,MAAM,KAAK,MAAM,EAAE,CAAC,CAAA;QADH,WAAM,GAAN,MAAM,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAQ;QAExE,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;IAChC,CAAC;CACF;AAOD,MAAM,cAAc,GAAG,6BAA6B,CAAA;AAEpD,SAAS,kBAAkB,CAAC,GAAW,EAAE,SAAiB;IACxD,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAC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