@rubytech/create-maxy-code 0.1.75 → 0.1.80

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.
Files changed (127) hide show
  1. package/dist/__tests__/plugin-install.test.js +2 -2
  2. package/dist/lib/plugin-install.js +1 -1
  3. package/package.json +1 -1
  4. package/payload/platform/config/brand.json +1 -1
  5. package/payload/platform/lib/graph-write/dist/index.js +1 -1
  6. package/payload/platform/lib/graph-write/src/index.ts +1 -1
  7. package/payload/platform/package.json +1 -1
  8. package/payload/platform/plugins/.claude-plugin/marketplace.json +101 -1
  9. package/payload/platform/plugins/admin/mcp/dist/index.js +1 -1
  10. package/payload/platform/plugins/admin/skills/commitment-followthrough/SKILL.md +1 -1
  11. package/payload/platform/plugins/admin/skills/session-management/SKILL.md +1 -1
  12. package/payload/platform/plugins/business-assistant/PLUGIN.md +1 -1
  13. package/payload/platform/plugins/business-assistant/references/task-management.md +13 -13
  14. package/payload/platform/plugins/docs/references/admin-session.md +7 -6
  15. package/payload/platform/plugins/docs/references/internals.md +2 -2
  16. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  17. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts +2 -0
  18. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts.map +1 -0
  19. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js +57 -0
  20. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js.map +1 -0
  21. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts.map +1 -1
  22. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +9 -1
  23. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -1
  24. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
  25. package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +2 -2
  26. package/payload/platform/plugins/projects/PLUGIN.md +3 -3
  27. package/payload/platform/plugins/projects/references/sprint.md +2 -2
  28. package/payload/platform/plugins/scheduling/skills/briefing/SKILL.md +2 -2
  29. package/payload/platform/plugins/tasks/.claude-plugin/plugin.json +1 -1
  30. package/payload/platform/plugins/work/.claude-plugin/plugin.json +17 -0
  31. package/payload/platform/plugins/{tasks → work}/.mcp.json +2 -2
  32. package/payload/platform/plugins/work/PLUGIN.md +120 -0
  33. package/payload/platform/plugins/work/mcp/dist/index.d.ts +2 -0
  34. package/payload/platform/plugins/work/mcp/dist/index.d.ts.map +1 -0
  35. package/payload/platform/plugins/work/mcp/dist/index.js +543 -0
  36. package/payload/platform/plugins/work/mcp/dist/index.js.map +1 -0
  37. package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts +7 -0
  38. package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts.map +1 -0
  39. package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js +24 -0
  40. package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js.map +1 -0
  41. package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts +5 -0
  42. package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts.map +1 -0
  43. package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js +40 -0
  44. package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js.map +1 -0
  45. package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts +17 -0
  46. package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts.map +1 -0
  47. package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js +76 -0
  48. package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js.map +1 -0
  49. package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts +29 -0
  50. package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts.map +1 -0
  51. package/payload/platform/plugins/work/mcp/dist/tools/project-create.js +235 -0
  52. package/payload/platform/plugins/work/mcp/dist/tools/project-create.js.map +1 -0
  53. package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts +40 -0
  54. package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts.map +1 -0
  55. package/payload/platform/plugins/work/mcp/dist/tools/project-get.js +125 -0
  56. package/payload/platform/plugins/work/mcp/dist/tools/project-get.js.map +1 -0
  57. package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts +26 -0
  58. package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts.map +1 -0
  59. package/payload/platform/plugins/work/mcp/dist/tools/project-list.js +81 -0
  60. package/payload/platform/plugins/work/mcp/dist/tools/project-list.js.map +1 -0
  61. package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts +19 -0
  62. package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts.map +1 -0
  63. package/payload/platform/plugins/work/mcp/dist/tools/project-update.js +102 -0
  64. package/payload/platform/plugins/work/mcp/dist/tools/project-update.js.map +1 -0
  65. package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts +20 -0
  66. package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts.map +1 -0
  67. package/payload/platform/plugins/work/mcp/dist/tools/session-list.js +37 -0
  68. package/payload/platform/plugins/work/mcp/dist/tools/session-list.js.map +1 -0
  69. package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts +12 -0
  70. package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts.map +1 -0
  71. package/payload/platform/plugins/work/mcp/dist/tools/session-name.js +28 -0
  72. package/payload/platform/plugins/work/mcp/dist/tools/session-name.js.map +1 -0
  73. package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts +16 -0
  74. package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts.map +1 -0
  75. package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js +33 -0
  76. package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js.map +1 -0
  77. package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts +63 -0
  78. package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts.map +1 -0
  79. package/payload/platform/plugins/work/mcp/dist/tools/work-create.js +141 -0
  80. package/payload/platform/plugins/work/mcp/dist/tools/work-create.js.map +1 -0
  81. package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts +19 -0
  82. package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts.map +1 -0
  83. package/payload/platform/plugins/work/mcp/dist/tools/work-get.js +51 -0
  84. package/payload/platform/plugins/work/mcp/dist/tools/work-get.js.map +1 -0
  85. package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts +18 -0
  86. package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts.map +1 -0
  87. package/payload/platform/plugins/work/mcp/dist/tools/work-list.js +66 -0
  88. package/payload/platform/plugins/work/mcp/dist/tools/work-list.js.map +1 -0
  89. package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts +21 -0
  90. package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts.map +1 -0
  91. package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js +54 -0
  92. package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js.map +1 -0
  93. package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts +12 -0
  94. package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts.map +1 -0
  95. package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js +59 -0
  96. package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js.map +1 -0
  97. package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts +32 -0
  98. package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts.map +1 -0
  99. package/payload/platform/plugins/work/mcp/dist/tools/work-update.js +112 -0
  100. package/payload/platform/plugins/work/mcp/dist/tools/work-update.js.map +1 -0
  101. package/payload/platform/plugins/{tasks → work}/mcp/package.json +1 -1
  102. package/payload/platform/scripts/conversation-id-allowlist.txt +4 -4
  103. package/payload/platform/scripts/seed-neo4j.sh +1 -1
  104. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  105. package/payload/platform/services/claude-session-manager/dist/http-server.js +34 -5
  106. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  107. package/payload/platform/services/claude-session-manager/dist/index.js +32 -0
  108. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  109. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +33 -1
  110. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  111. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +202 -39
  112. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  113. package/payload/platform/services/claude-session-manager/dist/specialist-drift.d.ts.map +1 -1
  114. package/payload/platform/services/claude-session-manager/dist/specialist-drift.js +10 -4
  115. package/payload/platform/services/claude-session-manager/dist/specialist-drift.js.map +1 -1
  116. package/payload/platform/templates/agents/admin/IDENTITY.md +21 -37
  117. package/payload/platform/templates/specialists/agents/database-operator.md +2 -2
  118. package/payload/platform/templates/specialists/agents/librarian.md +1 -1
  119. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
  120. package/payload/platform/templates/specialists/agents/project-manager.md +3 -3
  121. package/payload/premium-plugins/real-agent/plugins/leads/PLUGIN.md +1 -1
  122. package/payload/server/{chunk-ITQ55PCQ.js → chunk-TFEIFU7F.js} +1 -1
  123. package/payload/server/{chunk-HZ77KMTV.js → chunk-W33UUYYR.js} +1 -4
  124. package/payload/server/{cloudflare-task-tracker-PZBX7X3D.js → cloudflare-task-tracker-7P355PSD.js} +1 -1
  125. package/payload/server/maxy-edge.js +1 -1
  126. package/payload/server/server.js +50 -18
  127. package/payload/platform/plugins/tasks/PLUGIN.md +0 -120
@@ -3,7 +3,7 @@ name: librarian
3
3
  description: "Foreground ingester for the memory graph. Owns external-archive and document ingestion — PDFs, web pages, plain text, conversation transcripts (WhatsApp / Telegram / Signal / iMessage / Slack / LinkedIn DMs / Zoom / meeting minutes), LinkedIn Basic Data Exports, and post-unzip trees the admin agent forwards. Loads `document-ingest`, `conversation-archive`, `conversation-archive-enrich`, and `linkedin-import` skills. Returns to the admin agent with a structured outcome line; never interacts with the operator directly except through the dispatching agent."
4
4
  summary: "Owns foreground ingest of documents, conversation transcripts, and external archives into the memory graph."
5
5
  model: claude-sonnet-4-5
6
- tools: mcp__memory__memory-ingest-extract, mcp__memory__memory-ingest, mcp__memory__memory-ingest-web, mcp__memory__memory-classify, mcp__memory__memory-archive-write, mcp__memory__memory-write, mcp__memory__memory-update, mcp__memory__memory-search, mcp__memory__conversation-archive-derive-insights, mcp__memory__conversation-archive-enrich-rejection, mcp__graph__maxy-graph-read_neo4j_cypher, mcp__graph__maxy-graph-write_neo4j_cypher, mcp__contacts__contact-create, mcp__tasks__task-create, Read, Bash
6
+ tools: mcp__memory__memory-ingest-extract, mcp__memory__memory-ingest, mcp__memory__memory-ingest-web, mcp__memory__memory-classify, mcp__memory__memory-archive-write, mcp__memory__memory-write, mcp__memory__memory-update, mcp__memory__memory-search, mcp__memory__conversation-archive-derive-insights, mcp__memory__conversation-archive-enrich-rejection, mcp__graph__maxy-graph-read_neo4j_cypher, mcp__graph__maxy-graph-write_neo4j_cypher, mcp__contacts__contact-create, mcp__work__work-create, Read, Bash
7
7
  ---
8
8
 
9
9
  # Librarian
@@ -32,7 +32,7 @@ Each domain has a small set of tools and, where it exists, a skill that drives t
32
32
 
33
33
  **Timezones are not optional.** Scheduling output is rendered in the user's locale timezone from `UserProfile.timezone` (IANA). Storage is UTC. If timezone is unset, the scheduling tool errors; set it via `profile-update` with `profileFields: { timezone: "Europe/London" }`. There is no UTC fallback.
34
34
 
35
- **Graph adjacency at write time.** Wrapped writers (`schedule-event`, `contact-create`, `task-create`) reject zero-edge calls. Resolve target elementIds via `memory-search` and pass them in the create call. The current admin session's Conversation satisfies the rule automatically when you are inside a session.
35
+ **Graph adjacency at write time.** Wrapped writers (`schedule-event`, `contact-create`, `work-create`) reject zero-edge calls. Resolve target elementIds via `memory-search` and pass them in the create call. The current admin session's Conversation satisfies the rule automatically when you are inside a session.
36
36
 
37
37
  **WhatsApp ToS.** Automated broadcast is forbidden. The platform blocks broadcast for WhatsApp regardless of channel config; do not try to design around it.
38
38
 
@@ -3,7 +3,7 @@ name: project-manager
3
3
  description: "Project and task management. Creating, tracking, and completing tasks and projects, naming sessions, building and running workflows, and linking work to people and entities. Delegate when a task involves organising work, tracking progress, or composing multi-step workflows."
4
4
  summary: "Manages your tasks, projects, sessions, and workflows: linking work to people and goals, and keeping everything organised."
5
5
  model: claude-sonnet-4-6
6
- tools: mcp__tasks__task-create, mcp__tasks__task-update, mcp__tasks__task-list, mcp__tasks__task-get, mcp__tasks__task-relate, mcp__tasks__task-complete, mcp__tasks__task-ready, mcp__tasks__project-create, mcp__tasks__project-list, mcp__tasks__project-get, mcp__tasks__project-update, mcp__tasks__project-complete, mcp__tasks__session-list, mcp__tasks__session-name, mcp__workflows__workflow-create, mcp__workflows__workflow-list, mcp__workflows__workflow-get, mcp__workflows__workflow-update, mcp__workflows__workflow-delete, mcp__workflows__workflow-validate, mcp__workflows__workflow-execute, mcp__workflows__workflow-runs, mcp__memory__memory-search
6
+ tools: mcp__work__work-create, mcp__work__work-update, mcp__work__work-list, mcp__work__work-get, mcp__work__work-relate, mcp__work__work-complete, mcp__work__work-ready, mcp__work__project-create, mcp__work__project-list, mcp__work__project-get, mcp__work__project-update, mcp__work__project-complete, mcp__work__session-list, mcp__work__session-name, mcp__workflows__workflow-create, mcp__workflows__workflow-list, mcp__workflows__workflow-get, mcp__workflows__workflow-update, mcp__workflows__workflow-delete, mcp__workflows__workflow-validate, mcp__workflows__workflow-execute, mcp__workflows__workflow-runs, mcp__memory__memory-search
7
7
  ---
8
8
 
9
9
  # Project Manager
@@ -22,7 +22,7 @@ These three rules win when anything else in this prompt conflicts with them.
22
22
 
23
23
  Create when work is identified, do not ask. Pass real elementIds you resolved via `memory-search`: `AFFECTS` for entities the work modifies, `RAISED_BY` for the requestor, `BLOCKS` for source-blocks-target sequential prerequisites. `AFFECTS` doubles as conflict detection: two active tasks affecting the same entity surface a conflict. Priorities: urgent (this session), high (this week), normal (standard backlog), low (no deadline).
24
24
 
25
- Call `task-ready` before starting to check prerequisites and `AFFECTS` conflicts. Append progress to notes; never overwrite. Use `task-complete` to close, then report any tasks unblocked by the completion.
25
+ Call `work-ready` before starting to check prerequisites and `AFFECTS` conflicts. Append progress to notes; never overwrite. Use `work-complete` to close, then report any tasks unblocked by the completion.
26
26
 
27
27
  ## Projects
28
28
 
@@ -42,7 +42,7 @@ Workflows can be triggered by scheduled events through the `check-due-events` di
42
42
 
43
43
  ## Graph adjacency at write time
44
44
 
45
- `task-create`, `project-create`, and `workflow-create` reject zero-edge calls. Pass at least one of: a `raisedBy` Person elementId, at least one `affects` entity elementId, or workItems (projects). When invoked inside an admin session, the session's Conversation satisfies the rule automatically. `workflow-create` requires an active admin session: the Workflow is linked `PART_OF` the session's Conversation at creation, and calls from outside a session throw.
45
+ `work-create`, `project-create`, and `workflow-create` reject zero-edge calls. Pass at least one of: a `raisedBy` Person elementId, at least one `affects` entity elementId, or workItems (projects). When invoked inside an admin session, the session's Conversation satisfies the rule automatically. `workflow-create` requires an active admin session: the Workflow is linked `PART_OF` the session's Conversation at creation, and calls from outside a session throw.
46
46
 
47
47
  ## Domain context you do not own tools for
48
48
 
@@ -54,7 +54,7 @@ No MCP server. Skills operate via existing platform tools:
54
54
 
55
55
  - `memory-search` to retrieve domain knowledge from the knowledge base
56
56
  - `profile-read` and `profile-update` for the customisation profile
57
- - `task-create` to file an open task when a chase needs deferring
57
+ - `work-create` to file an open work item when a chase needs deferring
58
58
 
59
59
  ## References
60
60
 
@@ -256,7 +256,7 @@ var require_dist = __commonJS({
256
256
  if (matched.length === 0) {
257
257
  process.stderr.write(`[graph-write] reject reason=missing-provenance labels=${labelCsv} agent=${agentLabel}
258
258
  `);
259
- throw new Error(`missing-provenance: write to ${labelCsv} requires an inbound :PRODUCED edge from a :Task, :Conversation, or :Message (createdBy.agent='${agentLabel}'). Either pass producedByTaskId on the write (autonomous workflows: call task-create at the start of the flow and thread the returned taskId), or rely on the MCP wrapper's CONVERSATION_NODE_ID env-stamp injection (direct admin asks).`);
259
+ throw new Error(`missing-provenance: write to ${labelCsv} requires an inbound :PRODUCED edge from a :Task, :Conversation, or :Message (createdBy.agent='${agentLabel}'). Either pass producedByTaskId on the write (autonomous workflows: call work-create at the start of the flow and thread the returned taskId), or rely on the MCP wrapper's CONVERSATION_NODE_ID env-stamp injection (direct admin asks).`);
260
260
  }
261
261
  provenanceSourceId = matched[0].rel.targetNodeId;
262
262
  provenanceSourceLabel = matched[0].sourceLabel;
@@ -3633,6 +3633,7 @@ function walkPremiumBundles() {
3633
3633
  }
3634
3634
  const result = [];
3635
3635
  for (const bundle of entries) {
3636
+ if (bundle.startsWith(".")) continue;
3636
3637
  const bundleDir = resolve4(stagingRoot, bundle);
3637
3638
  try {
3638
3639
  if (!statSync2(bundleDir).isDirectory()) continue;
@@ -3738,9 +3739,6 @@ function reconcileEnabledPlugins(accountDir, config) {
3738
3739
  // app/lib/claude-agent/logging.ts
3739
3740
  var emitMissingOnResolve = (..._args) => null;
3740
3741
 
3741
- // app/lib/claude-agent/spawn-env.ts
3742
- var getBundleMtimeIso = (..._args) => null;
3743
-
3744
3742
  // app/lib/claude-agent/summary-helpers.ts
3745
3743
  var stripAttachmentMetaSuffix = (..._args) => null;
3746
3744
 
@@ -4435,7 +4433,6 @@ export {
4435
4433
  autoDeliverPremiumPlugins,
4436
4434
  reconcileEnabledPlugins,
4437
4435
  emitMissingOnResolve,
4438
- getBundleMtimeIso,
4439
4436
  stripAttachmentMetaSuffix,
4440
4437
  requirePortEnv,
4441
4438
  safeJson,
@@ -7,7 +7,7 @@ import {
7
7
  readTunnelState,
8
8
  recoverRunningCloudflareTasks,
9
9
  resolveUnitGoneVerdict
10
- } from "./chunk-ITQ55PCQ.js";
10
+ } from "./chunk-TFEIFU7F.js";
11
11
  import "./chunk-VGMVEYX7.js";
12
12
  import "./chunk-JSBRDJBE.js";
13
13
  export {
@@ -19,7 +19,7 @@ import {
19
19
  streamActionEvents,
20
20
  vncLog,
21
21
  websockifyLog
22
- } from "./chunk-HZ77KMTV.js";
22
+ } from "./chunk-W33UUYYR.js";
23
23
  import "./chunk-VGMVEYX7.js";
24
24
  import "./chunk-JSBRDJBE.js";
25
25
 
@@ -25,7 +25,6 @@ import {
25
25
  findMissingPlugins,
26
26
  fingerprintSessionKey,
27
27
  getAccountIdForSession,
28
- getBundleMtimeIso,
29
28
  getConversationIdForSession,
30
29
  getRoleForSession,
31
30
  getSessionKeyByConversationId,
@@ -60,7 +59,7 @@ import {
60
59
  vncLog,
61
60
  waitForExit,
62
61
  walkPremiumBundles
63
- } from "./chunk-HZ77KMTV.js";
62
+ } from "./chunk-W33UUYYR.js";
64
63
  import {
65
64
  CLOUDFLARE_TASK_DIAGNOSTICS,
66
65
  appendCloudflareSteps,
@@ -69,7 +68,7 @@ import {
69
68
  openCloudflareTask,
70
69
  readTunnelState,
71
70
  resolveUnitGoneVerdict
72
- } from "./chunk-ITQ55PCQ.js";
71
+ } from "./chunk-TFEIFU7F.js";
73
72
  import {
74
73
  GREETING_DIRECTIVE,
75
74
  deleteAgentProjection,
@@ -8059,6 +8058,12 @@ async function performSpawnWithInitialMessage(args) {
8059
8058
  console.log(`${TAG18} tunnel-url-resolved value=${tunnelUrl ?? "null"}`);
8060
8059
  const upstreamPayload = JSON.stringify({
8061
8060
  senderId: args.senderId,
8061
+ // Task 205 — pass userId through to the manager so it lands as
8062
+ // `USER_ID` in the pty child env and as `${USER_ID}` in the
8063
+ // per-spawn mcp.json placeholder map. The cookie-auth path
8064
+ // resolves it from `getUserIdForSession`; the Stop-hook recorder
8065
+ // path legitimately leaves it undefined.
8066
+ userId: args.userId,
8062
8067
  role: args.role,
8063
8068
  channel: args.channel,
8064
8069
  permissionMode: args.permissionMode,
@@ -8215,6 +8220,9 @@ app14.post("/resume", async (c) => {
8215
8220
  headers: { "content-type": "application/json" },
8216
8221
  body: JSON.stringify({
8217
8222
  senderId,
8223
+ // Task 205 — resume parity with /spawn: thread userId so the
8224
+ // respawned pty inherits the same USER_ID env.
8225
+ userId,
8218
8226
  role: "admin",
8219
8227
  channel,
8220
8228
  sessionId: body.sessionId,
@@ -8900,6 +8908,34 @@ var CLOUDFLARE_SETUP_FORM_SCHEMA = {
8900
8908
  secretFields: ["password", "session_key", "messageId"]
8901
8909
  };
8902
8910
 
8911
+ // app/lib/cloudflare-bundle-mtime.ts
8912
+ import { statSync as statSync8 } from "fs";
8913
+ var cachedBundleMtimeIso;
8914
+ function getBundleMtimeIso(entry = process.argv[1]) {
8915
+ if (cachedBundleMtimeIso !== void 0) return cachedBundleMtimeIso;
8916
+ if (!entry) {
8917
+ process.stderr.write(`[bundle-mtime] fallback reason=empty-path
8918
+ `);
8919
+ cachedBundleMtimeIso = "unknown";
8920
+ return cachedBundleMtimeIso;
8921
+ }
8922
+ try {
8923
+ cachedBundleMtimeIso = statSync8(entry).mtime.toISOString();
8924
+ } catch (e) {
8925
+ const reason = e instanceof Error ? e.message : String(e);
8926
+ process.stderr.write(`[bundle-mtime] fallback reason=stat-threw error="${reason}"
8927
+ `);
8928
+ cachedBundleMtimeIso = "unknown";
8929
+ }
8930
+ return cachedBundleMtimeIso;
8931
+ }
8932
+ function decideRetryBranch(args) {
8933
+ const { bundleMtimeIso, prior } = args;
8934
+ if (!prior || prior.outcome !== "failed") return "proceed";
8935
+ if (bundleMtimeIso === "unknown") return "surface-error";
8936
+ return bundleMtimeIso > prior.completedAt ? "re-invoke" : "surface-error";
8937
+ }
8938
+
8903
8939
  // server/routes/admin/cloudflare.ts
8904
8940
  function cloudflareStreamLogPath(accountId, correlationId) {
8905
8941
  return resolve14(ACCOUNTS_DIR, accountId, "cloudflare-stream-logs", `${correlationId}.log`);
@@ -9282,16 +9318,12 @@ app20.post("/setup", requireAdminSession, async (c) => {
9282
9318
  const bundleMtimeIso = getBundleMtimeIso();
9283
9319
  try {
9284
9320
  const prior = await findMostRecentTerminalCloudflareTask(accountId, correlationId);
9285
- if (prior && prior.outcome === "failed") {
9286
- const bundleNewer = bundleMtimeIso !== "unknown" && bundleMtimeIso > prior.completedAt;
9287
- const branch = bundleNewer ? "re-invoke" : "surface-error";
9288
- log(`retry-decision bundleMtime=${bundleMtimeIso} lastErrorAt=${prior.completedAt} branch=${branch}`);
9289
- if (branch === "surface-error") {
9290
- const literal = prior.errorMessage ?? CLOUDFLARE_TASK_DIAGNOSTICS.scriptExitedNonzero;
9291
- return err("script", literal);
9292
- }
9293
- } else {
9294
- log(`retry-decision bundleMtime=${bundleMtimeIso} lastErrorAt=none branch=proceed`);
9321
+ const branch = decideRetryBranch({ bundleMtimeIso, prior });
9322
+ const lastErrorAt = prior && prior.outcome === "failed" ? prior.completedAt : "none";
9323
+ log(`retry-decision bundleMtime=${bundleMtimeIso} lastErrorAt=${lastErrorAt} branch=${branch}`);
9324
+ if (branch === "surface-error" && prior) {
9325
+ const literal = prior.errorMessage ?? CLOUDFLARE_TASK_DIAGNOSTICS.scriptExitedNonzero;
9326
+ return err("script", literal);
9295
9327
  }
9296
9328
  } catch (e) {
9297
9329
  log(`retry-decision lookup-failed reason="${e instanceof Error ? e.message : String(e)}" branch=proceed`);
@@ -12252,7 +12284,7 @@ app33.route("/health-brand", health_default2);
12252
12284
  var admin_default = app33;
12253
12285
 
12254
12286
  // server/routes/sites.ts
12255
- import { existsSync as existsSync20, readFileSync as readFileSync18, realpathSync as realpathSync5, statSync as statSync8 } from "fs";
12287
+ import { existsSync as existsSync20, readFileSync as readFileSync18, realpathSync as realpathSync5, statSync as statSync9 } from "fs";
12256
12288
  import { resolve as resolve21 } from "path";
12257
12289
  var SAFE_SEG_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
12258
12290
  var MIME = {
@@ -12318,7 +12350,7 @@ app34.get("/:rel{.*}", (c) => {
12318
12350
  }
12319
12351
  let stat7;
12320
12352
  try {
12321
- stat7 = existsSync20(filePath) ? statSync8(filePath) : null;
12353
+ stat7 = existsSync20(filePath) ? statSync9(filePath) : null;
12322
12354
  } catch {
12323
12355
  stat7 = null;
12324
12356
  }
@@ -12502,7 +12534,7 @@ function startReaper2() {
12502
12534
 
12503
12535
  // ../lib/entitlement/src/index.ts
12504
12536
  import { createPublicKey, createHash as createHash3, verify as cryptoVerify } from "crypto";
12505
- import { existsSync as existsSync21, readFileSync as readFileSync19, statSync as statSync9 } from "fs";
12537
+ import { existsSync as existsSync21, readFileSync as readFileSync19, statSync as statSync10 } from "fs";
12506
12538
  import { resolve as resolve22 } from "path";
12507
12539
 
12508
12540
  // ../lib/entitlement/src/canonicalize.ts
@@ -12554,7 +12586,7 @@ function resolveEntitlement(brand, account) {
12554
12586
  if (!existsSync21(entitlementPath)) {
12555
12587
  return logResolved(anonymousFallback("missing"), { reason: "missing" });
12556
12588
  }
12557
- const stat7 = statSync9(entitlementPath);
12589
+ const stat7 = statSync10(entitlementPath);
12558
12590
  const key = memoKey(stat7.mtimeMs, account);
12559
12591
  if (memo && memo.key === key) {
12560
12592
  return memo.result;
@@ -13522,7 +13554,7 @@ reconcileEnabledPlugins(bootAccount?.accountDir, bootAccount?.config);
13522
13554
  (async () => {
13523
13555
  if (!bootAccount) return;
13524
13556
  try {
13525
- const { recoverRunningCloudflareTasks } = await import("./cloudflare-task-tracker-PZBX7X3D.js");
13557
+ const { recoverRunningCloudflareTasks } = await import("./cloudflare-task-tracker-7P355PSD.js");
13526
13558
  const result = await recoverRunningCloudflareTasks(
13527
13559
  bootAccount.accountId,
13528
13560
  configDirForWhatsApp,
@@ -1,120 +0,0 @@
1
- ---
2
- name: tasks
3
- description: "Graph-backed task lifecycle management. Task nodes in Neo4j with dependency tracking (BLOCKS), conflict detection (AFFECTS), and a parallel safety query (task-ready). Surfaced by memory-search."
4
- tools:
5
- - name: task-create
6
- publicAllowlist: false
7
- adminAllowlist: false
8
- - name: task-update
9
- publicAllowlist: false
10
- adminAllowlist: false
11
- - name: task-list
12
- publicAllowlist: false
13
- adminAllowlist: false
14
- - name: task-get
15
- publicAllowlist: false
16
- adminAllowlist: false
17
- - name: task-relate
18
- publicAllowlist: false
19
- adminAllowlist: false
20
- - name: task-complete
21
- publicAllowlist: false
22
- adminAllowlist: false
23
- - name: task-ready
24
- publicAllowlist: false
25
- adminAllowlist: false
26
- - name: session-list
27
- publicAllowlist: false
28
- adminAllowlist: false
29
- - name: session-name
30
- publicAllowlist: false
31
- adminAllowlist: false
32
- - name: project-create
33
- publicAllowlist: false
34
- adminAllowlist: false
35
- - name: project-list
36
- publicAllowlist: false
37
- adminAllowlist: false
38
- - name: project-get
39
- publicAllowlist: false
40
- adminAllowlist: false
41
- - name: project-update
42
- publicAllowlist: false
43
- adminAllowlist: false
44
- - name: project-complete
45
- publicAllowlist: false
46
- adminAllowlist: false
47
- metadata: {"platform":{"always":false,"embed":[],"pluginKey":"tasks"}}
48
- mcp:
49
- command: node
50
- args:
51
- - ${PLATFORM_ROOT}/lib/mcp-spawn-tee/dist/index.js
52
- - ${PLATFORM_ROOT}/plugins/tasks/mcp/dist/index.js
53
- env:
54
- MCP_SPAWN_TEE_NAME: tasks
55
- LOG_DIR: ${LOG_DIR}
56
- PLATFORM_ROOT: ${PLATFORM_ROOT}
57
- ACCOUNT_ID: ${ACCOUNT_ID}
58
- SESSION_ID: ${SESSION_ID}
59
- ---
60
-
61
- # Tasks
62
-
63
- Tasks live in the graph — not in files, not in memory. When the user identifies a piece of work, create a Task node immediately and relate it to the entities it will modify. Surface open tasks at the start of relevant conversations.
64
-
65
- ## Creating Tasks
66
-
67
- Create a task when the user states something that needs doing, when a conversation reveals a follow-up, or when a business obligation or deadline is mentioned. Don't ask — create it and confirm.
68
-
69
- When creating, link the task to the entities it will modify via `AFFECTS` relationships. If the user mentions who requested it, link via `RAISED_BY`. If the task has prerequisites ("after the materials arrive"), create a `BLOCKS` edge from the prerequisite to this task.
70
-
71
- ## Dependencies and Conflicts
72
-
73
- **BLOCKS** — sequential dependency. The target task cannot start until the source is completed. When the user says "start the kitchen refit," check for blockers and explain what's outstanding.
74
-
75
- **AFFECTS** — conflict detection. Two active tasks that both `AFFECTS` the same entity are in conflict. Surface this when either task is started: "This invoice is also being modified by [other task] — resolve that first or confirm you want both in progress."
76
-
77
- ## Before Starting a Task
78
-
79
- Check `task-ready` before moving a task to `active`. If the task has unresolved blockers, explain what's outstanding. If another active task `AFFECTS` the same entity, surface the conflict and let the user resolve it.
80
-
81
- ## During a Task
82
-
83
- Append progress to notes — never overwrite existing history. If the task creates or modifies graph entities, the `AFFECTS` relationships should already exist from creation. If not, add them.
84
-
85
- ## Completing a Task
86
-
87
- Use `task-complete` to mark done. It re-embeds the task and surfaces any tasks that were blocked by this one and are now ready. Proactively tell the user what's been unlocked: "The materials order is complete — the kitchen refit is now unblocked."
88
-
89
- ## Session Start
90
-
91
- Run `task-ready` and surface the ready set if the user has open tasks. This answers "what can I work on next without conflict?"
92
-
93
- ## Priority
94
-
95
- - `urgent` — must be handled in this session
96
- - `high` — should happen this week
97
- - `normal` — standard backlog
98
- - `low` — nice to have, no deadline pressure
99
-
100
- ## Tools
101
-
102
- - `task-create` — Create a task, optionally linked to a person (RAISED_BY) and entities (AFFECTS). For durable-action records, pass `kind` (e.g. `"onboarding-establish-owner"`, `"cloudflare-tunnel-login"`) to set status `running`; pass `inputs` with the form payload and `inputSchema` declaring any secret fields — values land on the Task as `inputs.<field>` props after `redactSecrets` strips schema-tagged keys; `inputsProvided` records the call-shape (names submitted) alongside the value-bearing `inputs.*`. Pass `raisedDuringConversationKey` to write a `:RAISED_DURING` edge to the originating Conversation when it differs from the current session.
103
- - `task-update` — Update name, description, status, priority, due date, or append a note (append-only). Pass `appendStep` to atomically append one entry to `steps[]` (call once per action phase); `errorMessage` is required when status transitions to `failed`; `completed` and `failed` transitions auto-set `completedAt`.
104
- - `task-list` — List tasks filtered by status, priority, or related entity
105
- - `task-get` — Fetch a task with full details and all relationships
106
- - `task-relate` — Add AFFECTS, BLOCKS, PART_OF, or RAISED_BY relationships. For Task targets, pass the taskId (UUID) from task-create. For other labels, pass the elementId from memory-search.
107
- - `task-complete` — Mark done, re-embed, surface newly-unblocked tasks
108
- - `task-ready` — Safe-to-start set: pending tasks with no unresolved BLOCKS and no AFFECTS conflicts
109
- - `session-list` — List recent sessions with their linked tasks
110
- - `session-name` — Set a human-readable name on the current session
111
-
112
- ## Project Tools
113
-
114
- Project tools manage `:Project:Task` nodes — multi-label nodes with structured health tracking, lifecycle phases, and parent-child relationships via `HAS_TASK`. Use these instead of manually choreographing `task-create` + `task-relate` sequences for project work.
115
-
116
- - `project-create` — Atomic project creation: parent node, child work items, dependencies, and relationships in a single transaction. Accepts tier (quick/standard/full), optional clientRef, targetDate, workItems with blocks dependencies. Max 50 work items.
117
- - `project-list` — Active projects with structured health data (green/amber/red/grey signal, completion counts, overdue/blocked counts, next action). Defaults to pending + active projects.
118
- - `project-get` — Full project detail: children with blocker status, health, relationships, lifecycle notes, timestamps.
119
- - `project-update` — Update project phase, tier, targetDate, clientRef, status, or append a note. Phase changes auto-append `[PROJECT:PHASE]` lifecycle notes.
120
- - `project-complete` — Complete a project. Returns incomplete children so you can confirm with the user before finalising. Always completes — does not gate on unfinished work.