@rubytech/create-maxy-code 0.1.312 → 0.1.314

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 (134) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
  3. package/payload/platform/lib/graph-style/dist/index.js +5 -3
  4. package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
  5. package/payload/platform/lib/graph-style/src/index.ts +5 -3
  6. package/payload/platform/neo4j/schema.cypher +7 -17
  7. package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
  8. package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +1 -0
  9. package/payload/platform/plugins/admin/skills/file-presentation/SKILL.md +1 -1
  10. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +39 -5
  11. package/payload/platform/plugins/admin/skills/professional-document/SKILL.md +1 -1
  12. package/payload/platform/plugins/docs/references/admin-session.md +2 -0
  13. package/payload/platform/plugins/docs/references/admin-ui.md +3 -3
  14. package/payload/platform/plugins/docs/references/memory-guide.md +1 -1
  15. package/payload/platform/plugins/docs/references/quickbooks.md +29 -0
  16. package/payload/platform/plugins/graph-viewer/mcp/dist/index.js +1 -1
  17. package/payload/platform/plugins/graph-viewer/mcp/dist/index.js.map +1 -1
  18. package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.d.ts.map +1 -1
  19. package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js +8 -7
  20. package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js.map +1 -1
  21. package/payload/platform/plugins/graph-viewer/skills/render-graph/SKILL.md +8 -5
  22. package/payload/platform/plugins/memory/mcp/dist/index.js +2 -0
  23. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  24. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.d.ts +2 -0
  25. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.d.ts.map +1 -0
  26. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js +146 -0
  27. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js.map +1 -0
  28. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js +4 -0
  29. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js.map +1 -1
  30. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +1 -0
  31. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
  32. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts +66 -0
  33. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts.map +1 -0
  34. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js +102 -0
  35. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js.map +1 -0
  36. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +9 -0
  37. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts.map +1 -1
  38. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +6 -1
  39. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -1
  40. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js +1 -0
  41. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js.map +1 -1
  42. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.d.ts +9 -0
  43. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.d.ts.map +1 -1
  44. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js +25 -1
  45. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js.map +1 -1
  46. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  47. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +21 -0
  48. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  49. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
  50. package/payload/platform/plugins/memory/references/schema-construction.md +37 -15
  51. package/payload/platform/plugins/quickbooks/.claude-plugin/plugin.json +21 -0
  52. package/payload/platform/plugins/quickbooks/PLUGIN.md +91 -0
  53. package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +159 -0
  54. package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/package.json +3 -0
  55. package/payload/platform/plugins/quickbooks/mcp/dist/index.d.ts +2 -0
  56. package/payload/platform/plugins/quickbooks/mcp/dist/index.d.ts.map +1 -0
  57. package/payload/platform/plugins/quickbooks/mcp/dist/index.js +218 -0
  58. package/payload/platform/plugins/quickbooks/mcp/dist/index.js.map +1 -0
  59. package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.d.ts +37 -0
  60. package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.d.ts.map +1 -0
  61. package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.js +75 -0
  62. package/payload/platform/plugins/quickbooks/mcp/dist/lib/oauth.js.map +1 -0
  63. package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.d.ts +39 -0
  64. package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.d.ts.map +1 -0
  65. package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.js +178 -0
  66. package/payload/platform/plugins/quickbooks/mcp/dist/lib/qbo-client.js.map +1 -0
  67. package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.d.ts +36 -0
  68. package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.d.ts.map +1 -0
  69. package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.js +107 -0
  70. package/payload/platform/plugins/quickbooks/mcp/dist/lib/secrets.js.map +1 -0
  71. package/payload/platform/plugins/quickbooks/mcp/package.json +19 -0
  72. package/payload/platform/plugins/quickbooks/skills/quickbooks/SKILL.md +37 -0
  73. package/payload/platform/scripts/check-no-esm-require.mjs +4 -0
  74. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  75. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +16 -0
  76. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  77. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  78. package/payload/platform/services/claude-session-manager/dist/http-server.js +53 -3
  79. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  80. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +4 -0
  81. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  82. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +6 -0
  83. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  84. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts +10 -0
  85. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts.map +1 -1
  86. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js +15 -0
  87. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js.map +1 -1
  88. package/payload/platform/services/webchat-channel/dist/instructions.d.ts.map +1 -1
  89. package/payload/platform/services/webchat-channel/dist/instructions.js +8 -1
  90. package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
  91. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  92. package/payload/platform/services/whatsapp-channel/dist/notification.js +8 -1
  93. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  94. package/payload/platform/templates/specialists/agents/content-producer.md +1 -1
  95. package/payload/server/{chunk-J6WDAWFJ.js → chunk-Q7EWROVN.js} +4 -0
  96. package/payload/server/maxy-edge.js +1 -1
  97. package/payload/server/public/assets/AccessGate-B_sL5-0I.js +1 -0
  98. package/payload/server/public/assets/{AdminLoginScreens-B8s2TbT7.js → AdminLoginScreens-BgicJfUu.js} +1 -1
  99. package/payload/server/public/assets/AdminShell-C0gZ5JKc.js +1 -0
  100. package/payload/server/public/assets/{Checkbox-B_sOAyv1.js → Checkbox-BJdwS4v2.js} +1 -1
  101. package/payload/server/public/assets/OperatorConversations-DPlZIELy.js +1 -0
  102. package/payload/server/public/assets/{admin-gZEndvJT.js → admin-DAFDivnO.js} +1 -1
  103. package/payload/server/public/assets/audio-attachment-mime-h53tpH_4.js +30 -0
  104. package/payload/server/public/assets/{brand-BcNavK6q.css → brand-bye0l_rp.css} +1 -1
  105. package/payload/server/public/assets/{browser-BUlB5_MD.js → browser-CmFjVZYo.js} +1 -1
  106. package/payload/server/public/assets/chat-CSw2u48Q.js +1 -0
  107. package/payload/server/public/assets/data-C4v6AdQ-.js +1 -0
  108. package/payload/server/public/assets/graph-BJyMQdRx.js +51 -0
  109. package/payload/server/public/assets/graph-labels-BTpv_U3g.js +1 -0
  110. package/payload/server/public/assets/operator-Bj88rdnI.js +1 -0
  111. package/payload/server/public/assets/page-hmlVCBRQ.js +1 -0
  112. package/payload/server/public/assets/{public-G_-UI9nB.js → public-IRKxc9hu.js} +3 -3
  113. package/payload/server/public/assets/{public-next-C8_nExQB.js → public-next-DqQ4PZLk.js} +1 -1
  114. package/payload/server/public/assets/{useSelectionMode-Bf6Rt-sl.js → useSelectionMode-CTJhWnNp.js} +1 -1
  115. package/payload/server/public/browser.html +6 -6
  116. package/payload/server/public/chat.html +8 -8
  117. package/payload/server/public/data.html +5 -5
  118. package/payload/server/public/graph.html +8 -8
  119. package/payload/server/public/index.html +9 -9
  120. package/payload/server/public/operator.html +10 -10
  121. package/payload/server/public/public-next.html +9 -9
  122. package/payload/server/public/public.html +7 -7
  123. package/payload/server/server.js +1387 -824
  124. package/payload/server/public/assets/AccessGate-Dh5A79FU.js +0 -1
  125. package/payload/server/public/assets/AdminShell-Cu1zlb6L.js +0 -1
  126. package/payload/server/public/assets/OperatorConversations-hm0Gpu_Q.js +0 -1
  127. package/payload/server/public/assets/audio-attachment-mime-B0b89VnH.js +0 -30
  128. package/payload/server/public/assets/chat-BnceaVl7.js +0 -1
  129. package/payload/server/public/assets/data-3Nl3P5wt.js +0 -1
  130. package/payload/server/public/assets/graph-DMCKpW6P.js +0 -51
  131. package/payload/server/public/assets/graph-labels-AZLGoVy8.js +0 -1
  132. package/payload/server/public/assets/operator-BF4F7k23.js +0 -1
  133. package/payload/server/public/assets/page-DQUEst1o.js +0 -1
  134. /package/payload/server/public/assets/{brand-BQ_u9UdS.js → brand-DqQPSWa7.js} +0 -0
@@ -0,0 +1,107 @@
1
+ // QuickBooks Online per-account secret store.
2
+ //
3
+ // Plain 0600 JSON, NOT the encrypted outlook TokenStore. Two processes read and
4
+ // write this store: the MCP tool server (this package) and the UI server's
5
+ // callback route (platform/ui/server/routes/quickbooks.ts). They never import
6
+ // across the build-tree boundary — they agree on the on-disk shape defined here
7
+ // and in the callback route. Plain JSON keeps that contract trivially shareable;
8
+ // the secrets/ dir is brand-isolated and delete-protected (admin/files.ts), the
9
+ // same protection the cloudflare token store relies on.
10
+ import { mkdirSync, readFileSync, writeFileSync, existsSync, rmSync, } from "node:fs";
11
+ import { resolve, join } from "node:path";
12
+ /** A consent state nonce: URL-safe characters only, never a path fragment. */
13
+ const STATE_RE = /^[A-Za-z0-9_-]+$/;
14
+ function accountsDir(platformRoot) {
15
+ return resolve(platformRoot, "..", "data/accounts");
16
+ }
17
+ export function accountSecretsDir(platformRoot, accountId) {
18
+ return join(accountsDir(platformRoot), accountId, "secrets");
19
+ }
20
+ function storePath(platformRoot, accountId) {
21
+ return join(accountSecretsDir(platformRoot, accountId), "quickbooks.json");
22
+ }
23
+ function pendingDir(platformRoot, accountId) {
24
+ return join(accountSecretsDir(platformRoot, accountId), "quickbooks-pending");
25
+ }
26
+ function pendingPath(platformRoot, accountId, state) {
27
+ if (!STATE_RE.test(state)) {
28
+ throw new Error(`invalid consent state nonce: ${JSON.stringify(state)}`);
29
+ }
30
+ return join(pendingDir(platformRoot, accountId), `${state}.json`);
31
+ }
32
+ export function readStore(platformRoot, accountId) {
33
+ const file = storePath(platformRoot, accountId);
34
+ if (!existsSync(file))
35
+ return null;
36
+ try {
37
+ return JSON.parse(readFileSync(file, "utf-8"));
38
+ }
39
+ catch {
40
+ return null;
41
+ }
42
+ }
43
+ function writeStore(platformRoot, accountId, store) {
44
+ const dir = accountSecretsDir(platformRoot, accountId);
45
+ mkdirSync(dir, { recursive: true });
46
+ writeFileSync(storePath(platformRoot, accountId), JSON.stringify(store, null, 2), {
47
+ mode: 0o600,
48
+ });
49
+ }
50
+ export function setCredentials(platformRoot, accountId, creds) {
51
+ const prev = readStore(platformRoot, accountId);
52
+ writeStore(platformRoot, accountId, {
53
+ clientId: creds.clientId,
54
+ clientSecret: creds.clientSecret,
55
+ environment: creds.environment,
56
+ connections: prev?.connections ?? {},
57
+ });
58
+ }
59
+ export function upsertConnection(platformRoot, accountId, realmId, conn) {
60
+ const store = readStore(platformRoot, accountId);
61
+ if (!store) {
62
+ throw new Error("cannot store a connection before credentials are set");
63
+ }
64
+ store.connections[realmId] = conn;
65
+ writeStore(platformRoot, accountId, store);
66
+ }
67
+ export function removeConnection(platformRoot, accountId, realmId) {
68
+ const store = readStore(platformRoot, accountId);
69
+ if (!store)
70
+ return;
71
+ delete store.connections[realmId];
72
+ writeStore(platformRoot, accountId, store);
73
+ }
74
+ export function writePending(platformRoot, accountId, pending) {
75
+ const file = pendingPath(platformRoot, accountId, pending.state);
76
+ mkdirSync(pendingDir(platformRoot, accountId), { recursive: true });
77
+ writeFileSync(file, JSON.stringify(pending, null, 2), { mode: 0o600 });
78
+ }
79
+ export function readPending(platformRoot, accountId, state) {
80
+ let file;
81
+ try {
82
+ file = pendingPath(platformRoot, accountId, state);
83
+ }
84
+ catch {
85
+ return null;
86
+ }
87
+ if (!existsSync(file))
88
+ return null;
89
+ try {
90
+ return JSON.parse(readFileSync(file, "utf-8"));
91
+ }
92
+ catch {
93
+ return null;
94
+ }
95
+ }
96
+ export function deletePending(platformRoot, accountId, state) {
97
+ let file;
98
+ try {
99
+ file = pendingPath(platformRoot, accountId, state);
100
+ }
101
+ catch {
102
+ return;
103
+ }
104
+ if (existsSync(file))
105
+ rmSync(file);
106
+ }
107
+ //# sourceMappingURL=secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/lib/secrets.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,wDAAwD;AAExD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA4B1C,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC,SAAS,WAAW,CAAC,YAAoB;IACvC,OAAO,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAoB,EAAE,SAAiB;IACvE,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,SAAS,CAAC,YAAoB,EAAE,SAAiB;IACxD,OAAO,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,UAAU,CAAC,YAAoB,EAAE,SAAiB;IACzD,OAAO,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,WAAW,CAAC,YAAoB,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C;AACzE,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,YAAoB,EACpB,SAAiB,EACjB,KAAa;IAEb,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAc,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,SAAiB,EACjB,KAAa;IAEb,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@maxy/quickbooks",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "start": "node dist/index.js"
10
+ },
11
+ "dependencies": {
12
+ "@modelcontextprotocol/sdk": "^1.12.1",
13
+ "zod": "^3.24.0"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "^5.7.0",
17
+ "@types/node": "^22.0.0"
18
+ }
19
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: quickbooks
3
+ description: Connect QuickBooks Online and work with the books. Use when the operator wants to link QuickBooks, read invoices/customers/bills/reports, or create and update accounting records. Covers the one-time Intuit app registration and per-company consent relay, then the agent-driven read/write surface.
4
+ ---
5
+
6
+ # QuickBooks Online connector
7
+
8
+ QuickBooks Online lives in Intuit's cloud. Maxy never owns the OAuth app — the operator brings their own Intuit app, and a human consents per company. After that, reads and writes are yours.
9
+
10
+ Success is: the operator's credentials are stored, at least one company shows up under `quickbooks-connections`, and a `quickbooks-query` returns that company's data.
11
+
12
+ ## The two human steps (relay these — never click for them)
13
+
14
+ **1. Register an Intuit app.** The operator (not the agent) does this once at https://developer.intuit.com. They create an app, enable the Accounting scope, and copy its **client ID** and **client secret**. In the app's Keys & OAuth settings they add a **Redirect URI** that must be exactly the brand's public site URL followed by `/api/quickbooks/callback` (for example `https://app.<brand-domain>/api/quickbooks/callback`). Intuit rejects `localhost` for production, which is why the callback rides the public host. For a first run, the sandbox keys (free, up to five sandbox companies) are the right starting point.
15
+
16
+ **2. Consent per company.** You generate the consent link with `quickbooks-authorize-url`; a human opens it, signs into Intuit, and authorizes one company. Intuit redirects their browser back to the callback, which stores the refresh token. Repeat per company for the accountant case (one Intuit app can hold many company grants).
17
+
18
+ ## Procedure
19
+
20
+ 1. Once the operator has the client ID and secret, store them: `quickbooks-credentials-set` with `environment` set to `sandbox` or `production`.
21
+ 2. Generate the consent link: `quickbooks-authorize-url` with `redirectUri` set to the **exact** registered redirect URI. Hand the returned URL to a human. The link is valid 15 minutes.
22
+ 3. After they authorize, confirm with `quickbooks-connections` — the company's `realmId` should appear.
23
+ 4. Read and write against that `realmId`.
24
+
25
+ ## Working with the books
26
+
27
+ - **Read anything** with `quickbooks-query`, e.g. `SELECT * FROM Invoice WHERE TxnDate > '2026-01-01'`, `SELECT * FROM Customer`, `SELECT * FROM Bill MAXRESULTS 50`.
28
+ - **Reports** with `quickbooks-report`, e.g. `ProfitAndLoss` with `{ start_date, end_date }`, or `BalanceSheet`.
29
+ - **Write** with the entity tools (`quickbooks-invoice-create`, `quickbooks-customer-create`, `quickbooks-bill-create`, `quickbooks-payment-create`) or the generic `quickbooks-entity-create` for anything else. Updates require the record's current `Id` and `SyncToken` in the body (read it back first with a query).
30
+
31
+ ## Keeping connections healthy
32
+
33
+ A refresh token dies silently after about 100 days of inactivity or if the operator revokes it. Run `quickbooks-token-audit` periodically; `alive=false` means that company needs the consent relay run again before it is used. Reads are metered (a free monthly allowance) and writes are free — prefer a targeted query over pulling everything.
34
+
35
+ ## What stays the operator's job
36
+
37
+ Moving an Intuit app from sandbox to production requires Intuit's production security assessment. That is the operator's responsibility and is not automated here.
@@ -63,6 +63,10 @@ const ALLOWLIST = new Set([
63
63
  // tree and sets MAXY_PLATFORM_ROOT before the route module (and its
64
64
  // data-path/attachments deps) read the env at import.
65
65
  'platform/ui/server/routes/admin/__tests__/files-write.test.ts',
66
+ // Same vi.hoisted pattern: the public-reader test builds a tmp DATA_ROOT
67
+ // before the `data-path` mock fires, so the serve endpoint reads real
68
+ // sidecar fixtures written under it.
69
+ 'platform/ui/server/routes/__tests__/public-reader.test.ts',
66
70
  ])
67
71
 
68
72
  const REQUIRE_CALL_RE = /\brequire\s*\(/
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAiB7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAkLtD,CAAA"}
1
+ {"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAkB7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAiMtD,CAAA"}
@@ -16,6 +16,7 @@ export const MAXY_MCP_PLUGINS = [
16
16
  "graph-viewer",
17
17
  "memory",
18
18
  "outlook",
19
+ "quickbooks",
19
20
  "replicate",
20
21
  "scheduling",
21
22
  "telegram",
@@ -155,6 +156,21 @@ export const CANONICAL_MAXY_TOOL_NAMES = [
155
156
  "mcp__plugin_outlook_outlook__outlook-mail-list",
156
157
  "mcp__plugin_outlook_outlook__outlook-mail-search",
157
158
  "mcp__plugin_outlook_outlook__outlook-mailbox-info",
159
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-authorize-url",
160
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-bill-create",
161
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-connections",
162
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-credentials-set",
163
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-customer-create",
164
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-customer-update",
165
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-disconnect",
166
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-entity-create",
167
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-entity-update",
168
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-invoice-create",
169
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-invoice-update",
170
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-payment-create",
171
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-query",
172
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-report",
173
+ "mcp__plugin_quickbooks_quickbooks__quickbooks-token-audit",
158
174
  "mcp__plugin_replicate_replicate__image-generate",
159
175
  "mcp__plugin_replicate_replicate__replicate-key-store",
160
176
  "mcp__plugin_replicate_replicate__replicate-key-verify",
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AA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IAChD,kEAAkE;IAClE,uDAAuD;IACvD,oDAAoD;IACpD,oDAAoD;IACpD,qDAAqD;IACrD,oDAAoD;IACpD,kDAAkD;IAClD,gDAAgD;IAChD,yCAAyC;IACzC,uCAAuC;IACvC,oCAAoC;IACpC,qCAAqC;IACrC,uCAAuC;IACvC,qCAAqC;IACrC,qCAAqC;IACrC,sCAAsC;IACtC,oCAAoC;IACpC,iCAAiC;IACjC,kCAAkC;IAClC,mCAAmC;IACnC,oCAAoC;IACpC,oCAAoC;IACpC,kDAAkD;IAClD,kDAAkD;IAClD,mDAAmD;IACnD,+CAA+C;IAC/C,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,oDAAoD;CACrD,CAAA"}
1
+ {"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,OAAO;IACP,KAAK;IACL,SAAS;IACT,UAAU;IACV,OAAO;IACP,OAAO;IACP,cAAc;IACd,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,UAAU;IACV,MAAM;IACN,WAAW;CACZ,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,yCAAyC;IACzC,yCAAyC;IACzC,yCAAyC;IACzC,sCAAsC;IACtC,yCAAyC;IACzC,wCAAwC;IACxC,oCAAoC;IACpC,qCAAqC;IACrC,uCAAuC;IACvC,2CAA2C;IAC3C,4CAA4C;IAC5C,qCAAqC;IACrC,yCAAyC;IACzC,4CAA4C;IAC5C,oCAAoC;IACpC,sCAAsC;IACtC,0CAA0C;IAC1C,uCAAuC;IACvC,sCAAsC;IACtC,sDA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AM,GAAG,MAAM,GAAG,IAAI,CAe5F;AAwJD;;;kEAGkE;AAClE,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG;IAC3B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACpD;;;+CAG2C;IAC3C,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAChD,CAAA;AAmBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CA6sEpD"}
@@ -191,6 +191,14 @@ const AUTO_ARCHIVE_SPECIALIST = 'database-operator';
191
191
  export function forkArgvSegment(fromSessionId, newSessionId, model) {
192
192
  return ['--resume', fromSessionId, '--fork-session', '--session-id', newSessionId, '--model', model];
193
193
  }
194
+ // Task 928 — the re-seat fork carries an optional permission mode (pushed as the
195
+ // `--permission-mode` argv flag) and an optional effort (merged into the
196
+ // per-spawn inline `--settings` as `effortLevel`). Both are validated here as a
197
+ // shape defence-in-depth: the UI route is the authoritative allowlist gate, but
198
+ // a malformed value must never reach the child argv. Mirrors the canonical sets
199
+ // in webchat.ts / rc-daemon. `dontAsk` and `max` are excluded (not fork-writable).
200
+ const FORK_PERMISSION_MODES = new Set(['default', 'acceptEdits', 'plan', 'auto', 'bypassPermissions']);
201
+ const FORK_EFFORT_LEVELS = new Set(['low', 'medium', 'high', 'xhigh']);
194
202
  // Task 879 — the re-seated fork inherits the source's history, including the
195
203
  // source's earlier self-identification on the OLD model. The rc-spawn path does
196
204
  // not compose --append-system-prompt (only fresh spawnSession does), so the
@@ -762,6 +770,11 @@ export function buildHttpApp(deps) {
762
770
  const personId = typeof body.personId === 'string' && body.personId.length > 0 && body.personId.length <= 128
763
771
  ? body.personId
764
772
  : undefined;
773
+ // Task 884 — open-mode visitor anchor (the maxy_visitor cookie). Validated
774
+ // as a UUID, the same shape /api/session mints; absent on gated spawns.
775
+ const visitorId = typeof body.visitorId === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(body.visitorId)
776
+ ? body.visitorId
777
+ : undefined;
765
778
  // Task 756 — the per-conversation webchat native channel for a public
766
779
  // spawn. Shape-validated here (all three fields are non-empty strings, the
767
780
  // gateway is loopback http) before it reaches the spawn, which composes it
@@ -849,6 +862,7 @@ export function buildHttpApp(deps) {
849
862
  conversationNodeId,
850
863
  sliceToken,
851
864
  personId,
865
+ visitorId,
852
866
  webchatChannel,
853
867
  });
854
868
  if (!result.ok) {
@@ -1768,6 +1782,11 @@ export function buildHttpApp(deps) {
1768
1782
  // path to import the models lib, so it guards on shape, not the exact list).
1769
1783
  const forkFromSessionId = typeof body.forkFromSessionId === 'string' && UUID_PATTERN.test(body.forkFromSessionId) ? body.forkFromSessionId : null;
1770
1784
  const reseatModel = typeof body.model === 'string' && /^claude-[a-z0-9.-]+(\[1m\])?$/i.test(body.model) ? body.model : null;
1785
+ // Task 928 — fork-carried levers. `null` when the field is present but not in
1786
+ // the allowlist (rejected below, on the fork path only); `undefined` when
1787
+ // absent (the fork keeps the settings-resolved mode / the harness default effort).
1788
+ const reseatPermissionMode = typeof body.permissionMode === 'string' ? (FORK_PERMISSION_MODES.has(body.permissionMode) ? body.permissionMode : null) : undefined;
1789
+ const reseatEffort = typeof body.effort === 'string' ? (FORK_EFFORT_LEVELS.has(body.effort) ? body.effort : null) : undefined;
1771
1790
  // Task 626 — per-visitor slice ringfence for the public session-end review
1772
1791
  // rc session. Shape-gated identically to /public-spawn so a body-controlled
1773
1792
  // value cannot reach the child env. Absent on channel-admin / LinkedIn.
@@ -1864,6 +1883,17 @@ export function buildHttpApp(deps) {
1864
1883
  timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
1865
1884
  return c.json({ error: 're-seat target id already exists' }, 400);
1866
1885
  }
1886
+ // Task 928 — a present-but-disallowed mode/effort is a hard reject (no
1887
+ // spawn), not a silent drop, so a UI bug cannot land a fork on an
1888
+ // unintended lever.
1889
+ if (reseatPermissionMode === null) {
1890
+ timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
1891
+ return c.json({ error: 're-seat permissionMode is not allowed' }, 400);
1892
+ }
1893
+ if (reseatEffort === null) {
1894
+ timed(deps.logger, 'POST', '/rc-spawn', 400, Date.now() - start);
1895
+ return c.json({ error: 're-seat effort is not allowed' }, 400);
1896
+ }
1867
1897
  }
1868
1898
  // Task 896 — a plain resume (NOT a fork spawn) of a re-seated source id must
1869
1899
  // not start a second live process beside the fork. Resolve the marker chain
@@ -1936,6 +1966,11 @@ export function buildHttpApp(deps) {
1936
1966
  // ordinary fresh/resume single-id push is replaced by the fork segment.
1937
1967
  if (forkFromSessionId !== null && reseatModel !== null && sessionId) {
1938
1968
  argv.push(...forkArgvSegment(forkFromSessionId, sessionId, reseatModel));
1969
+ // Task 928 — the picked permission mode rides the fork as the canonical CLI
1970
+ // flag (the same flag the daemon spawn uses). Absent => the fork keeps the
1971
+ // settings-resolved mode, unchanged from a model-only re-seat.
1972
+ if (reseatPermissionMode)
1973
+ argv.push('--permission-mode', reseatPermissionMode);
1939
1974
  // Task 879 — authoritative current-model signal for the fork only.
1940
1975
  appendSegments.push(reseatIdentityPrompt(reseatModel));
1941
1976
  }
@@ -1949,7 +1984,14 @@ export function buildHttpApp(deps) {
1949
1984
  // waived so the disclaimer is suppressed whatever mode the session resolves
1950
1985
  // to. Per Task 574 doctrine the waiver is per-spawn (never written into
1951
1986
  // settings.json / .claude.json, which would permanently waive it).
1952
- argv.push('--settings', JSON.stringify({ skipDangerousModePermissionPrompt: true, skipAutoPermissionPrompt: true }));
1987
+ // Task 928 the picked effort rides the fork in the SAME per-spawn inline
1988
+ // settings (never the shared settings.json — that would change every later
1989
+ // spawn's effort fleet-wide). effortLevel only when this is a fork with a
1990
+ // valid effort; a model-only or mode-only re-seat leaves it unset.
1991
+ const inlineSettings = { skipDangerousModePermissionPrompt: true, skipAutoPermissionPrompt: true };
1992
+ if (forkFromSessionId !== null && reseatEffort)
1993
+ inlineSettings.effortLevel = reseatEffort;
1994
+ argv.push('--settings', JSON.stringify(inlineSettings));
1953
1995
  // Task 677 P2 — admin WhatsApp native channel. When the caller supplies
1954
1996
  // waChannel, register the per-sender channel server in its own --mcp-config
1955
1997
  // (additive; rc-spawn carries no --strict-mcp-config) and activate it as a
@@ -2117,12 +2159,15 @@ export function buildHttpApp(deps) {
2117
2159
  // settings.json permissions.defaultMode (else 'default'); mirror that
2118
2160
  // resolution for the classification sidecar and the lifeline.
2119
2161
  const settingsPermissionMode = resolveSettingsPermissionMode(deps.claudeConfigDir);
2162
+ // Task 928 — when the fork carries a picked mode, the argv flag governs (not
2163
+ // settings.json), so the lifeline and the sidecar must report the picked mode.
2164
+ const effectiveRcPermissionMode = forkFromSessionId !== null && reseatPermissionMode ? reseatPermissionMode : settingsPermissionMode;
2120
2165
  // Step 2 — the exact claude argv (the inner command). The systemd-run
2121
2166
  // wrap is composed by the spawnPty adapter; logging the inner argv
2122
2167
  // here is enough for an operator to reproduce by hand. The wrapped
2123
2168
  // argv is fully reconstructible from this line + the spawn adapter
2124
2169
  // source (Task 250 / 556).
2125
- deps.logger(`[rc-spawn] op=argv unitToken=${unitToken} cwd=${deps.spawnCwd} permissionMode=${settingsPermissionMode} argv=${JSON.stringify([deps.claudeBin, ...argv])}`);
2170
+ deps.logger(`[rc-spawn] op=argv unitToken=${unitToken} cwd=${deps.spawnCwd} permissionMode=${effectiveRcPermissionMode} argv=${JSON.stringify([deps.claudeBin, ...argv])}`);
2126
2171
  emitRcLife(deps.logger, 'argv', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
2127
2172
  cwd: deps.spawnCwd,
2128
2173
  argv: JSON.stringify([deps.claudeBin, ...argv]),
@@ -2222,7 +2267,7 @@ export function buildHttpApp(deps) {
2222
2267
  // choice); the /chat chip renders this. effectivePermissionMode
2223
2268
  // stays null: the Task 278 tail is auto-only and rc-spawn
2224
2269
  // passes no --debug=auto-mode.
2225
- permissionMode: settingsPermissionMode,
2270
+ permissionMode: effectiveRcPermissionMode,
2226
2271
  effectivePermissionMode: null,
2227
2272
  model: null,
2228
2273
  hidden: false,
@@ -2235,6 +2280,11 @@ export function buildHttpApp(deps) {
2235
2280
  // Task 865 — admin-webchat author identity from the rc-spawn body;
2236
2281
  // null for public and one-shot sessions, which carry none.
2237
2282
  adminUserId: adminUserId ?? null,
2283
+ // Task 884 — open-mode anchor + per-agent scope are stamped only on
2284
+ // the /public-spawn path; the rc-spawn write carries neither, so
2285
+ // both are null here.
2286
+ visitorId: null,
2287
+ agentSlug: null,
2238
2288
  }, deps.logger);
2239
2289
  deps.watcher.refreshSidecar?.(sessionId);
2240
2290
  }