@rubytech/create-sitedesk-code 0.1.387 → 0.1.389

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 (296) hide show
  1. package/dist/__tests__/joblogic-excluded.test.js +39 -0
  2. package/dist/index.js +21 -0
  3. package/package.json +1 -1
  4. package/payload/platform/config/brand.json +3 -3
  5. package/payload/platform/plugins/.claude-plugin/marketplace.json +0 -10
  6. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +21 -2
  7. package/payload/platform/plugins/docs/references/admin-session.md +4 -0
  8. package/payload/platform/plugins/docs/references/admin-ui.md +18 -1
  9. package/payload/platform/plugins/docs/references/joblogic.md +2 -0
  10. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +7 -3
  11. package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +2 -0
  12. package/payload/platform/plugins/work/PLUGIN.md +3 -0
  13. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.d.ts +2 -0
  14. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.d.ts.map +1 -0
  15. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.js +98 -0
  16. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.js.map +1 -0
  17. package/payload/platform/plugins/work/mcp/dist/index.js +16 -0
  18. package/payload/platform/plugins/work/mcp/dist/index.js.map +1 -1
  19. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.d.ts +53 -0
  20. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.d.ts.map +1 -0
  21. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.js +80 -0
  22. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.js.map +1 -0
  23. package/payload/platform/plugins/work/mcp/package.json +2 -1
  24. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  25. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
  26. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  27. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  28. package/payload/platform/services/claude-session-manager/dist/http-server.js +98 -8
  29. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  30. package/payload/platform/services/claude-session-manager/dist/pricing.d.ts +45 -0
  31. package/payload/platform/services/claude-session-manager/dist/pricing.d.ts.map +1 -0
  32. package/payload/platform/services/claude-session-manager/dist/pricing.js +57 -0
  33. package/payload/platform/services/claude-session-manager/dist/pricing.js.map +1 -0
  34. package/payload/platform/services/claude-session-manager/dist/session-metering.d.ts +38 -0
  35. package/payload/platform/services/claude-session-manager/dist/session-metering.d.ts.map +1 -0
  36. package/payload/platform/services/claude-session-manager/dist/session-metering.js +292 -0
  37. package/payload/platform/services/claude-session-manager/dist/session-metering.js.map +1 -0
  38. package/payload/platform/templates/specialists/agents/project-manager.md +1 -1
  39. package/payload/premium-plugins/.claude-plugin/marketplace.json +0 -15
  40. package/payload/server/public/assets/{AdminLoginScreens-BejIjbmU.js → AdminLoginScreens-CerrEc_m.js} +1 -1
  41. package/payload/server/public/assets/AdminShell-cRTvNRbo.js +1 -0
  42. package/payload/server/public/assets/{Checkbox-1F1tzqca.js → Checkbox-Dh2pLMFN.js} +1 -1
  43. package/payload/server/public/assets/{Transcript-DkGa4CQH.js → Transcript-B_GVJujB.js} +1 -1
  44. package/payload/server/public/assets/{admin-DqQARkjy.js → admin-BXaYelnR.js} +1 -1
  45. package/payload/server/public/assets/{browser-nDtEK6RC.js → browser-fhjGE7fH.js} +1 -1
  46. package/payload/server/public/assets/calendar-PnZudAtc.js +1 -0
  47. package/payload/server/public/assets/chat-Dy_zrjKS.js +1 -0
  48. package/payload/server/public/assets/chevron-left-IB6TmMZ_.js +1 -0
  49. package/payload/server/public/assets/data-B2IcjAj6.js +1 -0
  50. package/payload/server/public/assets/{graph-DFyicKd7.js → graph-CycO3tkW.js} +2 -2
  51. package/payload/server/public/assets/{graph-labels-D3BQdcpD.js → graph-labels-DlSsSpBV.js} +1 -1
  52. package/payload/server/public/assets/{operator-BxrjWdT9.js → operator-L4kBC-zS.js} +1 -1
  53. package/payload/server/public/assets/page-D5E-Ng4D.js +1 -0
  54. package/payload/server/public/assets/page-M8sD9LOi.js +32 -0
  55. package/payload/server/public/assets/{public-DbdqfdYq.js → public-BmnajF3K.js} +1 -1
  56. package/payload/server/public/assets/{rotate-ccw-BkX8HODe.js → rotate-ccw-W5HhvAbo.js} +1 -1
  57. package/payload/server/public/assets/useSubAccountSwitcher-D1TI1xvd.css +1 -0
  58. package/payload/server/public/assets/useSubAccountSwitcher-UqZbmzYy.js +9 -0
  59. package/payload/server/public/browser.html +4 -4
  60. package/payload/server/public/calendar.html +5 -5
  61. package/payload/server/public/chat.html +8 -8
  62. package/payload/server/public/data.html +7 -7
  63. package/payload/server/public/graph.html +8 -8
  64. package/payload/server/public/index.html +10 -10
  65. package/payload/server/public/operator.html +10 -10
  66. package/payload/server/public/public.html +8 -8
  67. package/payload/server/server.js +444 -315
  68. package/payload/platform/plugins/joblogic/.claude-plugin/plugin.json +0 -21
  69. package/payload/platform/plugins/joblogic/PLUGIN.md +0 -182
  70. package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/index.js +0 -193
  71. package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/package.json +0 -3
  72. package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts +0 -2
  73. package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts.map +0 -1
  74. package/payload/platform/plugins/joblogic/mcp/dist/index.js +0 -229
  75. package/payload/platform/plugins/joblogic/mcp/dist/index.js.map +0 -1
  76. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts +0 -31
  77. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts.map +0 -1
  78. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js +0 -78
  79. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js.map +0 -1
  80. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts +0 -35
  81. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts.map +0 -1
  82. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js +0 -106
  83. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js.map +0 -1
  84. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts +0 -8
  85. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts.map +0 -1
  86. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js +0 -41
  87. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js.map +0 -1
  88. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts +0 -21
  89. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts.map +0 -1
  90. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js +0 -47
  91. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js.map +0 -1
  92. package/payload/platform/plugins/joblogic/mcp/package.json +0 -10
  93. package/payload/platform/plugins/joblogic/skills/joblogic/SKILL.md +0 -32
  94. package/payload/platform/plugins/sales/.claude-plugin/plugin.json +0 -8
  95. package/payload/platform/plugins/sales/PLUGIN.md +0 -106
  96. package/payload/platform/plugins/sales/references/close-tracking.md +0 -69
  97. package/payload/platform/plugins/sales/references/comparisons.md +0 -99
  98. package/payload/platform/plugins/sales/references/competitive-positioning.md +0 -51
  99. package/payload/platform/plugins/sales/references/faq.md +0 -73
  100. package/payload/platform/plugins/sales/references/objection-handling.md +0 -157
  101. package/payload/platform/plugins/sales/references/pricing.md +0 -101
  102. package/payload/premium-plugins/teaching/.claude-plugin/plugin.json +0 -8
  103. package/payload/premium-plugins/teaching/PLUGIN.md +0 -58
  104. package/payload/premium-plugins/teaching/skills/interactive-tutor/SKILL.md +0 -59
  105. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/assessment.md +0 -70
  106. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +0 -43
  107. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +0 -83
  108. package/payload/premium-plugins/teaching/skills/lesson-planner/SKILL.md +0 -48
  109. package/payload/premium-plugins/teaching/skills/lesson-planner/references/context-gathering.md +0 -41
  110. package/payload/premium-plugins/teaching/skills/lesson-planner/references/plan-structure.md +0 -94
  111. package/payload/premium-plugins/teaching/skills/study-pack-builder/SKILL.md +0 -52
  112. package/payload/premium-plugins/teaching/skills/study-pack-builder/references/disaggregation.md +0 -49
  113. package/payload/premium-plugins/teaching/skills/study-pack-builder/references/materials.md +0 -116
  114. package/payload/premium-plugins/venture-studio/.claude-plugin/plugin.json +0 -8
  115. package/payload/premium-plugins/venture-studio/PLUGIN.md +0 -128
  116. package/payload/premium-plugins/venture-studio/bin/scaffold.sh +0 -116
  117. package/payload/premium-plugins/venture-studio/skills/brand-pack/SKILL.md +0 -256
  118. package/payload/premium-plugins/venture-studio/skills/brand-pack/references/color-psychology.md +0 -118
  119. package/payload/premium-plugins/venture-studio/skills/investor-data-room/SKILL.md +0 -436
  120. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/business-plan-template.md +0 -64
  121. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitive-battlecard.md +0 -37
  122. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitor-analysis.md +0 -32
  123. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/compliance-research-checklist.md +0 -53
  124. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/data-room-structure.md +0 -88
  125. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/deck-blueprint-template.md +0 -39
  126. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/design-tokens-application.md +0 -79
  127. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/html-pdf-pipeline.md +0 -236
  128. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/internal-workings-scrub.md +0 -33
  129. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/monetization-strategy.md +0 -35
  130. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/pricing-strategy.md +0 -37
  131. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/strategy-frameworks.md +0 -46
  132. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/termsheet-template.md +0 -88
  133. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/index.html +0 -1565
  134. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/render-pdf.mjs +0 -91
  135. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/term_sheet.html +0 -715
  136. package/payload/premium-plugins/venture-studio/skills/legal-essentials/SKILL.md +0 -65
  137. package/payload/premium-plugins/venture-studio/skills/office-hours/SKILL.md +0 -587
  138. package/payload/premium-plugins/venture-studio/skills/prototype-host/SKILL.md +0 -179
  139. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/cloudflared-ingress-edit.md +0 -81
  140. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/scaffold-frameworks.md +0 -60
  141. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/systemd-user-service.md +0 -104
  142. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/SKILL.md +0 -342
  143. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/aarrr-metrics.md +0 -275
  144. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/assumption-testing.md +0 -93
  145. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/boolean-search.md +0 -308
  146. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/build-measure-learn.md +0 -262
  147. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/business-model-canvas.md +0 -171
  148. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/commitment-signals.md +0 -246
  149. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/design-thinking.md +0 -183
  150. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/earlyvangelist.md +0 -190
  151. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/first-principles.md +0 -58
  152. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/fishbone.md +0 -114
  153. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/five-whys.md +0 -43
  154. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/ice-scoring.md +0 -237
  155. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/innovation-accounting.md +0 -290
  156. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/jtbd.md +0 -105
  157. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/landing-page.md +0 -361
  158. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-sizing.md +0 -58
  159. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-type.md +0 -167
  160. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mom-test.md +0 -193
  161. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mvp-types.md +0 -200
  162. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/og-images.md +0 -239
  163. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pareto.md +0 -103
  164. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/persona-development.md +0 -291
  165. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pivot-types.md +0 -225
  166. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/positioning-statement.md +0 -179
  167. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/prd.md +0 -363
  168. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pre-mortem.md +0 -74
  169. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/problem-validation.md +0 -253
  170. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/product-market-fit.md +0 -256
  171. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/research-synthesis.md +0 -276
  172. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/strategy-red-team.md +0 -41
  173. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/three-engines-of-growth.md +0 -248
  174. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/validation-tests.md +0 -89
  175. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/value-proposition-canvas.md +0 -121
  176. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/win-loss-analysis.md +0 -242
  177. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/workflow-mapping.md +0 -271
  178. package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +0 -21
  179. package/payload/premium-plugins/writer-craft/PLUGIN.md +0 -134
  180. package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +0 -108
  181. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts +0 -8
  182. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts.map +0 -1
  183. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js +0 -71
  184. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js.map +0 -1
  185. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/package.json +0 -7
  186. package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/index.js +0 -193
  187. package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/package.json +0 -3
  188. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts +0 -51
  189. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts.map +0 -1
  190. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js +0 -196
  191. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js.map +0 -1
  192. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/package.json +0 -7
  193. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts +0 -3
  194. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts.map +0 -1
  195. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js +0 -58
  196. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js.map +0 -1
  197. package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts +0 -3
  198. package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts.map +0 -1
  199. package/payload/premium-plugins/writer-craft/mcp/dist/index.js +0 -403
  200. package/payload/premium-plugins/writer-craft/mcp/dist/index.js.map +0 -1
  201. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts +0 -14
  202. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts.map +0 -1
  203. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js +0 -47
  204. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js.map +0 -1
  205. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts +0 -117
  206. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts.map +0 -1
  207. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js +0 -138
  208. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js.map +0 -1
  209. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts +0 -90
  210. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts.map +0 -1
  211. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js +0 -609
  212. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js.map +0 -1
  213. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts +0 -19
  214. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts.map +0 -1
  215. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js +0 -124
  216. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js.map +0 -1
  217. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts +0 -38
  218. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts.map +0 -1
  219. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js +0 -93
  220. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js.map +0 -1
  221. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts +0 -61
  222. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +0 -1
  223. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js +0 -171
  224. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js.map +0 -1
  225. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts +0 -35
  226. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts.map +0 -1
  227. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js +0 -127
  228. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js.map +0 -1
  229. package/payload/premium-plugins/writer-craft/mcp/package-lock.json +0 -1327
  230. package/payload/premium-plugins/writer-craft/mcp/package.json +0 -19
  231. package/payload/premium-plugins/writer-craft/mcp/scripts/smoke.mjs +0 -420
  232. package/payload/premium-plugins/writer-craft/mcp/src/index.ts +0 -457
  233. package/payload/premium-plugins/writer-craft/mcp/src/lib/neo4j.ts +0 -56
  234. package/payload/premium-plugins/writer-craft/mcp/src/lib/voice-corpus.ts +0 -154
  235. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +0 -833
  236. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-ingest-session-text.ts +0 -153
  237. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +0 -148
  238. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +0 -270
  239. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +0 -181
  240. package/payload/premium-plugins/writer-craft/mcp/tsconfig.json +0 -8
  241. package/payload/premium-plugins/writer-craft/skills/citation-style/SKILL.md +0 -94
  242. package/payload/premium-plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +0 -77
  243. package/payload/premium-plugins/writer-craft/skills/citation-style/references/citation-rules.md +0 -103
  244. package/payload/premium-plugins/writer-craft/skills/citation-style/references/journal-article-models.md +0 -74
  245. package/payload/premium-plugins/writer-craft/skills/citation-style/references/other-source-models.md +0 -146
  246. package/payload/premium-plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +0 -70
  247. package/payload/premium-plugins/writer-craft/skills/editorial-practice/SKILL.md +0 -108
  248. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/copyediting.md +0 -73
  249. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +0 -85
  250. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +0 -78
  251. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/line-editing.md +0 -55
  252. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/self-editing.md +0 -89
  253. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +0 -114
  254. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +0 -73
  255. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +0 -76
  256. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +0 -67
  257. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +0 -86
  258. package/payload/premium-plugins/writer-craft/skills/point-of-view/SKILL.md +0 -97
  259. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +0 -72
  260. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +0 -91
  261. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +0 -71
  262. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +0 -85
  263. package/payload/premium-plugins/writer-craft/skills/prose-craft/SKILL.md +0 -100
  264. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +0 -72
  265. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/repetition.md +0 -71
  266. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +0 -64
  267. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/word-economy.md +0 -93
  268. package/payload/premium-plugins/writer-craft/skills/reader-engagement/SKILL.md +0 -100
  269. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +0 -79
  270. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +0 -81
  271. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +0 -67
  272. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +0 -94
  273. package/payload/premium-plugins/writer-craft/skills/review-manuscript/SKILL.md +0 -111
  274. package/payload/premium-plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +0 -119
  275. package/payload/premium-plugins/writer-craft/skills/review-prose/SKILL.md +0 -99
  276. package/payload/premium-plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +0 -112
  277. package/payload/premium-plugins/writer-craft/skills/review-scene/SKILL.md +0 -99
  278. package/payload/premium-plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +0 -95
  279. package/payload/premium-plugins/writer-craft/skills/story-architecture/SKILL.md +0 -106
  280. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +0 -118
  281. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +0 -66
  282. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +0 -87
  283. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +0 -82
  284. package/payload/premium-plugins/writer-craft/skills/story-blueprint/SKILL.md +0 -133
  285. package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +0 -118
  286. package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +0 -128
  287. package/payload/premium-plugins/writer-craft/skills/voice-mirror/SKILL.md +0 -241
  288. package/payload/server/public/assets/AdminShell-D2-uBSB5.js +0 -1
  289. package/payload/server/public/assets/calendar-CO4Bwmho.js +0 -1
  290. package/payload/server/public/assets/chat-DeIge_bC.js +0 -1
  291. package/payload/server/public/assets/chevron-left-DhVdq0aN.js +0 -1
  292. package/payload/server/public/assets/data-B1GIdzHk.js +0 -1
  293. package/payload/server/public/assets/page-ByDLq_o1.js +0 -1
  294. package/payload/server/public/assets/page-D-Ep4bXd.js +0 -32
  295. package/payload/server/public/assets/useSubAccountSwitcher-DMbRhLPv.js +0 -9
  296. package/payload/server/public/assets/useSubAccountSwitcher-DS0iqSkP.css +0 -1
@@ -1,31 +0,0 @@
1
- import type { JlStore, JlEnvironment } from "./secrets.js";
2
- /** Strip credential-shaped substrings and cap length before an upstream error
3
- * body is put into a thrown message that may reach a tool response/transcript. */
4
- export declare function sanitizeErrorBody(text: string): string;
5
- export declare function identityBaseFor(env: JlEnvironment): string;
6
- export declare function apiBaseFor(env: JlEnvironment): string;
7
- export type FetchLike = (url: string, init: {
8
- method: string;
9
- headers: Record<string, string>;
10
- body?: string;
11
- }) => Promise<{
12
- ok: boolean;
13
- status: number;
14
- text: () => Promise<string>;
15
- }>;
16
- export interface Token {
17
- accessToken: string;
18
- expiresIn: number;
19
- }
20
- export declare function acquireToken(store: JlStore, opts?: {
21
- fetchImpl?: FetchLike;
22
- }): Promise<Token>;
23
- /** Return a valid bearer, refreshing if cached is stale or force=true.
24
- * reason drives the op=token-refresh line; first acquisition logs op=token-acquire only. */
25
- export declare function getBearer(store: JlStore, accountId: string, opts?: {
26
- force?: boolean;
27
- fetchImpl?: FetchLike;
28
- }): Promise<string>;
29
- /** Test seam: clear the per-process cache. */
30
- export declare function _resetTokenCache(): void;
31
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAa3D;mFACmF;AACnF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1D;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAErD;AAED,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KACrE,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAM3E,MAAM,WAAW,KAAK;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CA6BvG;AAQD;6FAC6F;AAC7F,wBAAsB,SAAS,CAC7B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,8CAA8C;AAC9C,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -1,78 +0,0 @@
1
- const IDENTITY_BASE = {
2
- uat: "https://uatidentityserver.joblogic.com",
3
- production: "https://identityserver.joblogic.com",
4
- };
5
- const API_BASE = {
6
- uat: "https://uatapi.joblogic.com",
7
- production: "https://api.joblogic.com",
8
- };
9
- /** Refresh when the cached token is within this window of expiry. */
10
- const REFRESH_THRESHOLD_MS = 120_000;
11
- /** Strip credential-shaped substrings and cap length before an upstream error
12
- * body is put into a thrown message that may reach a tool response/transcript. */
13
- export function sanitizeErrorBody(text) {
14
- return text
15
- .replace(/client_secret=[^&\s"]*/gi, "client_secret=***")
16
- .replace(/client_id=[^&\s"]*/gi, "client_id=***")
17
- .replace(/Bearer\s+[A-Za-z0-9._-]+/gi, "Bearer ***")
18
- .slice(0, 300);
19
- }
20
- export function identityBaseFor(env) {
21
- return IDENTITY_BASE[env];
22
- }
23
- export function apiBaseFor(env) {
24
- return API_BASE[env];
25
- }
26
- export async function acquireToken(store, opts = {}) {
27
- const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
28
- const url = `${identityBaseFor(store.environment)}/connect/token`;
29
- const body = new URLSearchParams({
30
- grant_type: "client_credentials",
31
- client_id: store.clientId,
32
- client_secret: store.clientSecret,
33
- }).toString();
34
- const started = Date.now();
35
- const res = await fetchImpl(url, {
36
- method: "POST",
37
- headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" },
38
- body,
39
- });
40
- const text = await res.text();
41
- // The token request carried client_secret; some identity servers echo request
42
- // params in a 4xx body. Strip secrets and cap length before the message can
43
- // reach a tool response / transcript.
44
- if (!res.ok)
45
- throw new Error(`token endpoint ${res.status}: ${sanitizeErrorBody(text)}`);
46
- let raw;
47
- try {
48
- raw = JSON.parse(text);
49
- }
50
- catch {
51
- throw new Error(`token endpoint non-JSON: ${text}`);
52
- }
53
- if (!raw.access_token)
54
- throw new Error(`token endpoint missing access_token: ${text}`);
55
- const expiresIn = raw.expires_in ?? 3600;
56
- process.stderr.write(`[joblogic] op=token-acquire ok=true expiresInS=${expiresIn} ms=${Date.now() - started}\n`);
57
- return { accessToken: raw.access_token, expiresIn };
58
- }
59
- const tokenCache = new Map();
60
- /** Return a valid bearer, refreshing if cached is stale or force=true.
61
- * reason drives the op=token-refresh line; first acquisition logs op=token-acquire only. */
62
- export async function getBearer(store, accountId, opts = {}) {
63
- const cached = tokenCache.get(accountId);
64
- const fresh = cached && cached.expiresAt - REFRESH_THRESHOLD_MS > Date.now();
65
- if (fresh && !opts.force)
66
- return cached.accessToken;
67
- if (cached) {
68
- process.stderr.write(`[joblogic] op=token-refresh reason=${opts.force ? "401" : "pre-expiry"} ok=true\n`);
69
- }
70
- const tok = await acquireToken(store, { fetchImpl: opts.fetchImpl });
71
- tokenCache.set(accountId, { accessToken: tok.accessToken, expiresAt: Date.now() + tok.expiresIn * 1000 });
72
- return tok.accessToken;
73
- }
74
- /** Test seam: clear the per-process cache. */
75
- export function _resetTokenCache() {
76
- tokenCache.clear();
77
- }
78
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAKA,MAAM,aAAa,GAAkC;IACnD,GAAG,EAAE,wCAAwC;IAC7C,UAAU,EAAE,qCAAqC;CAClD,CAAC;AACF,MAAM,QAAQ,GAAkC;IAC9C,GAAG,EAAE,6BAA6B;IAClC,UAAU,EAAE,0BAA0B;CACvC,CAAC;AACF,qEAAqE;AACrE,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC;mFACmF;AACnF,M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;IACD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACrE,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,SAAS,GAAG,IAAI,EAAE,CAAC,CAAC;IAC1G,OAAO,GAAG,CAAC,WAAW,CAAC;AACzB,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,gBAAgB;IAC9B,UAAU,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -1,35 +0,0 @@
1
- import type { JlStore } from "./secrets.js";
2
- import { type FetchLike } from "./auth.js";
3
- export type AccessFaultKind = "auth" | "whitelist" | "network";
4
- export declare function classifyAccessFault(status: number): AccessFaultKind;
5
- export interface BaseArgs {
6
- store: JlStore;
7
- accountId: string;
8
- method: "GET" | "POST";
9
- /** path under /api/v1/, e.g. "Customer/GetAll". */
10
- path: string;
11
- /** entity label for the observability line. */
12
- entity: string;
13
- /** tool name for the observability line. */
14
- tool: string;
15
- /** extra query params (merged with tenantId). */
16
- query?: Record<string, string>;
17
- /** request body for POST. tenantId is also injected into the body for writes. */
18
- body?: Record<string, unknown>;
19
- }
20
- /** A read or generic call. Performs one silent re-acquire on a 401. */
21
- export declare function jlRequest(args: BaseArgs, opts?: {
22
- fetchImpl?: FetchLike;
23
- }): Promise<unknown>;
24
- /** A create with idempotency. idemKey lookup short-circuits a duplicate send.
25
- * platformRoot is threaded explicitly (the ledger lives under the account secrets dir). */
26
- export interface JlCreateArgs extends Omit<BaseArgs, "method"> {
27
- platformRoot: string;
28
- idemKey: string;
29
- /** field on the response carrying the new record id (default "id"). */
30
- idField?: string;
31
- }
32
- export declare function jlCreate(args: JlCreateArgs, opts?: {
33
- fetchImpl?: FetchLike;
34
- }): Promise<unknown>;
35
- //# sourceMappingURL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AO,GAAG,OAAO,CAAC,OAAO,CAAC,CAoCzG"}
@@ -1,106 +0,0 @@
1
- // JobLogic REST wrapper. Injects Bearer + tenantId on every call, emits the
2
- // observability lifeline, classifies any 401/403/network failure as an
3
- // access-fault, and performs exactly one silent token re-acquire on a 401.
4
- import { randomBytes } from "node:crypto";
5
- import { apiBaseFor, getBearer, sanitizeErrorBody } from "./auth.js";
6
- import { lookupIdem, recordIdem } from "./idempotency.js";
7
- export function classifyAccessFault(status) {
8
- if (status === 401)
9
- return "auth";
10
- if (status === 403)
11
- return "whitelist";
12
- return "network"; // status 0 / connect failure
13
- }
14
- function reqId() {
15
- return randomBytes(6).toString("hex");
16
- }
17
- async function doFetch(args, accessToken, fetchImpl) {
18
- const params = new URLSearchParams({ tenantId: args.store.tenantId, ...(args.query ?? {}) });
19
- const url = `${apiBaseFor(args.store.environment)}/api/v1/${args.path}?${params.toString()}`;
20
- const headers = { Authorization: `Bearer ${accessToken}`, Accept: "application/json" };
21
- let bodyStr;
22
- if (args.body !== undefined) {
23
- headers["Content-Type"] = "application/json";
24
- bodyStr = JSON.stringify({ tenantId: args.store.tenantId, ...args.body });
25
- }
26
- try {
27
- const res = await fetchImpl(url, { method: args.method, headers, body: bodyStr });
28
- return { ok: res.ok, status: res.status, text: await res.text() };
29
- }
30
- catch (err) {
31
- // connect-level failure → network access-fault
32
- process.stderr.write(`[joblogic] op=access-fault kind=network tool=${args.tool} entity=${args.entity} detail=${err.message}\n`);
33
- throw new Error(`access-fault kind=network: ${err.message}`);
34
- }
35
- }
36
- /** A read or generic call. Performs one silent re-acquire on a 401. */
37
- export async function jlRequest(args, opts = {}) {
38
- const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
39
- const id = reqId();
40
- const isWrite = args.method === "POST";
41
- process.stderr.write(isWrite
42
- ? `[joblogic] op=mutation reqId=${id} tool=${args.tool} entity=${args.entity} verb=update\n`
43
- : `[joblogic] op=request reqId=${id} tool=${args.tool} entity=${args.entity}\n`);
44
- let bearer = await getBearer(args.store, args.accountId, { fetchImpl });
45
- const started = Date.now();
46
- let res = await doFetch(args, bearer, fetchImpl);
47
- if (res.status === 401) {
48
- bearer = await getBearer(args.store, args.accountId, { force: true, fetchImpl });
49
- res = await doFetch(args, bearer, fetchImpl);
50
- }
51
- const ms = Date.now() - started;
52
- if (!res.ok) {
53
- if (res.status === 401 || res.status === 403) {
54
- process.stderr.write(`[joblogic] op=access-fault kind=${classifyAccessFault(res.status)} tool=${args.tool} entity=${args.entity}\n`);
55
- }
56
- process.stderr.write(`[joblogic] op=response reqId=${id} status=${res.status} ms=${ms} rows=-\n`);
57
- throw new Error(`JobLogic ${args.method} ${args.path} ${res.status}: ${sanitizeErrorBody(res.text)}`);
58
- }
59
- let parsed;
60
- try {
61
- parsed = JSON.parse(res.text);
62
- }
63
- catch {
64
- throw new Error(`JobLogic ${args.path} non-JSON: ${res.text}`);
65
- }
66
- const data = parsed.data;
67
- const rows = Array.isArray(data) ? data.length : "-";
68
- process.stderr.write(`[joblogic] op=response reqId=${id} status=${res.status} ms=${ms} rows=${rows}\n`);
69
- return parsed;
70
- }
71
- export async function jlCreate(args, opts = {}) {
72
- const id = reqId();
73
- const hit = lookupIdem(args.platformRoot, args.accountId, args.idemKey);
74
- if (hit) {
75
- process.stderr.write(`[joblogic] op=idem-hit reqId=${id} tool=${args.tool} existingId=${hit.recordId}\n`);
76
- return { idempotent: true, id: hit.recordId, entity: hit.entity };
77
- }
78
- const result = await jlRequest({
79
- store: args.store,
80
- accountId: args.accountId,
81
- method: "POST",
82
- path: args.path,
83
- entity: args.entity,
84
- tool: args.tool,
85
- query: args.query,
86
- body: args.body,
87
- }, opts);
88
- const writtenId = extractId(result, args.idField);
89
- if (!writtenId) {
90
- // A 2xx with no extractable record id means the ledger cannot be written, so
91
- // a retry of the same idemKey would duplicate. Fail loudly (the response
92
- // shape / idField is provisional until UAT-confirmed) rather than silently
93
- // leaving an idempotency hole.
94
- process.stderr.write(`[joblogic] op=idem-record-fail reqId=${id} tool=${args.tool} entity=${args.entity} reason=id-unextractable\n`);
95
- throw new Error(`${args.tool}: create returned success but no '${args.idField ?? "id"}' could be extracted from the response — a retry would NOT be idempotent. Confirm the response shape / idField against UAT.`);
96
- }
97
- recordIdem(args.platformRoot, args.accountId, args.idemKey, args.entity, writtenId);
98
- process.stderr.write(`[joblogic] op=response reqId=${id} status=created id=${writtenId}\n`);
99
- return result;
100
- }
101
- function extractId(result, idField = "id") {
102
- const r = result;
103
- const v = r?.[idField] ?? r?.data?.[idField];
104
- return v == null ? null : String(v);
105
- }
106
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,uEAAuE;AACvE,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAkB,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI1D,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,WAAW,CAAC;IACvC,OAAO,SAAS,CAAC,CAAC,6BAA6B;AACjD,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAkBD,KAAK,UAAU,OAAO,CACpB,IAAc,EACd,WAAmB,EACnB,SAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7F,MAAM,GA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ED,SAAS,SAAS,CAAC,MAAe,EAAE,OAAO,GAAG,IAAI;IAChD,MAAM,CAAC,GAAG,MAAiC,CAAC;IAC5C,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,IAAK,CAAC,EAAE,IAA4C,EAAE,CAAC,OAAO,CAAC,CAAC;IACtF,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC"}
@@ -1,8 +0,0 @@
1
- export interface IdemRecord {
2
- entity: string;
3
- recordId: string;
4
- ts: number;
5
- }
6
- export declare function lookupIdem(platformRoot: string, accountId: string, idemKey: string): IdemRecord | null;
7
- export declare function recordIdem(platformRoot: string, accountId: string, idemKey: string, entity: string, recordId: string): void;
8
- //# sourceMappingURL=idempotency.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idempotency.d.ts","sourceRoot":"","sources":["../../src/lib/idempotency.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAUD,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAatG;AAED,wBAAgB,UAAU,CACxB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,IAAI,CAKN"}
@@ -1,41 +0,0 @@
1
- // Local idempotency ledger. JobLogic exposes no idempotency header, so a create
2
- // retry (tool retry, or a write whose response was lost to a timeout) would
3
- // duplicate. Each create computes/accepts an idemKey; the ledger maps it to the
4
- // record id JobLogic returned. A hit short-circuits the send entirely.
5
- import { mkdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { accountSecretsDir } from "./secrets.js";
8
- /** idemKey filename safety — no path fragments. */
9
- const KEY_RE = /^[A-Za-z0-9_.:-]+$/;
10
- function ledgerDir(platformRoot, accountId) {
11
- return join(accountSecretsDir(platformRoot, accountId), "joblogic-idem");
12
- }
13
- function ledgerPath(platformRoot, accountId, idemKey) {
14
- if (!KEY_RE.test(idemKey))
15
- throw new Error(`invalid idemKey: ${JSON.stringify(idemKey)}`);
16
- return join(ledgerDir(platformRoot, accountId), `${idemKey}.json`);
17
- }
18
- export function lookupIdem(platformRoot, accountId, idemKey) {
19
- let file;
20
- try {
21
- file = ledgerPath(platformRoot, accountId, idemKey);
22
- }
23
- catch {
24
- return null;
25
- }
26
- if (!existsSync(file))
27
- return null;
28
- try {
29
- return JSON.parse(readFileSync(file, "utf-8"));
30
- }
31
- catch {
32
- return null;
33
- }
34
- }
35
- export function recordIdem(platformRoot, accountId, idemKey, entity, recordId) {
36
- const file = ledgerPath(platformRoot, accountId, idemKey);
37
- mkdirSync(ledgerDir(platformRoot, accountId), { recursive: true });
38
- const rec = { entity, recordId, ts: Date.now() };
39
- writeFileSync(file, JSON.stringify(rec), { mode: 0o600 });
40
- }
41
- //# sourceMappingURL=idempotency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idempotency.js","sourceRoot":"","sources":["../../src/lib/idempotency.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,mDAAmD;AACnD,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAQpC,SAAS,SAAS,CAAC,YAAoB,EAAE,SAAiB;IACxD,OAAO,I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EAAE,EAAE,CAAC;IAC7D,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5D,CAAC"}
@@ -1,21 +0,0 @@
1
- export type JlEnvironment = "uat" | "production";
2
- export interface JlStore {
3
- clientId: string;
4
- clientSecret: string;
5
- /** Company tenant id — required on every JobLogic API call (tenant-scoped credential). */
6
- tenantId: string;
7
- environment: JlEnvironment;
8
- /** Sender phone (E.164) → JobLogic engineer id, for write attribution. Config, not a secret. */
9
- engineerMap: Record<string, string>;
10
- }
11
- export declare function accountSecretsDir(platformRoot: string, accountId: string): string;
12
- export declare function readStore(platformRoot: string, accountId: string): JlStore | null;
13
- export declare function setCredentials(platformRoot: string, accountId: string, creds: {
14
- clientId: string;
15
- clientSecret: string;
16
- tenantId: string;
17
- environment: JlEnvironment;
18
- }): void;
19
- export declare function setEngineerMap(platformRoot: string, accountId: string, entries: Record<string, string>): void;
20
- export declare function resolveEngineer(store: JlStore, senderPhone: string): string | null;
21
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/lib/secrets.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,YAAY,CAAC;AAEjD,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;IAC3B,gGAAgG;IAChG,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAKD,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjF;AAKD,wBAAgB,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAUjF;AAOD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,aAAa,CAAA;CAAE,GAC9F,IAAI,CAGN;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,IAAI,CAIN;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAElF"}
@@ -1,47 +0,0 @@
1
- // JobLogic per-account secret store. Plain 0600 JSON in the brand-isolated,
2
- // delete-protected secrets/ dir (the quickbooks + cloudflare precedent). Never
3
- // thrown from on read — a missing/corrupt store yields null so module init and
4
- // tool enumeration survive a no-creds account.
5
- import { mkdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
6
- import { resolve, join } from "node:path";
7
- function accountsDir(platformRoot) {
8
- return resolve(platformRoot, "..", "data/accounts");
9
- }
10
- export function accountSecretsDir(platformRoot, accountId) {
11
- return join(accountsDir(platformRoot), accountId, "secrets");
12
- }
13
- function storePath(platformRoot, accountId) {
14
- return join(accountSecretsDir(platformRoot, accountId), "joblogic.json");
15
- }
16
- export function readStore(platformRoot, accountId) {
17
- const file = storePath(platformRoot, accountId);
18
- if (!existsSync(file))
19
- return null;
20
- try {
21
- const parsed = JSON.parse(readFileSync(file, "utf-8"));
22
- if (!parsed.clientId || !parsed.clientSecret || !parsed.tenantId || !parsed.environment)
23
- return null;
24
- return { engineerMap: {}, ...parsed };
25
- }
26
- catch {
27
- return null;
28
- }
29
- }
30
- function writeStore(platformRoot, accountId, store) {
31
- mkdirSync(accountSecretsDir(platformRoot, accountId), { recursive: true });
32
- writeFileSync(storePath(platformRoot, accountId), JSON.stringify(store, null, 2), { mode: 0o600 });
33
- }
34
- export function setCredentials(platformRoot, accountId, creds) {
35
- const prev = readStore(platformRoot, accountId);
36
- writeStore(platformRoot, accountId, { ...creds, engineerMap: prev?.engineerMap ?? {} });
37
- }
38
- export function setEngineerMap(platformRoot, accountId, entries) {
39
- const prev = readStore(platformRoot, accountId);
40
- if (!prev)
41
- throw new Error("cannot set engineer map before credentials are set");
42
- writeStore(platformRoot, accountId, { ...prev, engineerMap: { ...prev.engineerMap, ...entries } });
43
- }
44
- export function resolveEngineer(store, senderPhone) {
45
- return store.engineerMap[senderPhone] ?? null;
46
- }
47
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/lib/secrets.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,+CAA+C;AAC/C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAc1C,SAAS,WAAW,CAAC,YAAoB;IACvC,OAAO,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,YAAoB,EAAE,SAAiB;IACvE,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC;AACD,SAAS,SAAS,CAAC,YAAoB,EAAE,SAAiB;IACxD,OAAO,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,YAAoB,EAAE,SAAiB;IAC/D,M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AG,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACjF,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc,EAAE,WAAmB;IACjE,OAAO,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;AAChD,CAAC"}
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@maxy/joblogic",
3
- "version": "0.1.0",
4
- "private": true,
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "scripts": { "build": "tsc", "start": "node dist/index.js" },
8
- "dependencies": { "@modelcontextprotocol/sdk": "^1.12.1", "zod": "^3.24.0" },
9
- "devDependencies": { "typescript": "^5.7.0", "@types/node": "^22.0.0" }
10
- }
@@ -1,32 +0,0 @@
1
- ---
2
- name: joblogic
3
- description: Connect JobLogic and drive the field-service job lifecycle. Use when the operator wants to link JobLogic, read customers/sites/jobs/visits/quotes/invoices/assets/timesheets, or make writes (create a visit, log job costs, set a job status, raise an invoice) from instructions sent by field staff. Covers the one-time JobLogic Support onboarding and source-IP whitelisting, then the agent-driven read/write surface.
4
- ---
5
-
6
- # JobLogic connector
7
-
8
- JobLogic is the operator's field-service system of record. This connector is bespoke to one account: it does nothing on any other install. The agent reads and writes across the job lifecycle under one company credential. Field staff never call JobLogic themselves; they send a voice note or message to this install, the agent interprets it, and this install makes the write. So only this install's outbound IP ever touches JobLogic.
9
-
10
- Success is: the credentials are stored, `joblogic-connection-status` acquires a token, and a read such as `joblogic-customer-list` returns the company's data from UAT.
11
-
12
- ## What the operator does once (relay this; the agent cannot do it)
13
-
14
- The agent cannot raise a support ticket or whitelist an IP. The operator does this once with JobLogic.
15
-
16
- - **Raise a JobLogic Support ticket** for API access. Ask for a UAT (test) account first, then production. JobLogic Support issues a `client_id` and `client_secret` (OAuth client_credentials) and tells the operator the company `tenantId`.
17
- - **Whitelist the install's outbound source IP.** JobLogic filters API calls by the public IP they originate from. The install's inbound tunnel does not fix the outbound IP, and a laptop's public IP is usually dynamic. The operator resolves one of: run the install from one location with a stable ISP IP and register that IP; route the connector's outbound through a fixed-egress proxy with a static IP and register that; or confirm with JobLogic that production drops the per-IP filter. Until one holds, calls fail and the logs show `op=access-fault kind=whitelist`.
18
-
19
- ## What the agent does after that
20
-
21
- - **Store the credentials.** Run `joblogic-credentials-set` with the `client_id`, `client_secret`, `tenantId`, and `environment` (`uat` first). They are written only to this account's secrets file, never echoed.
22
- - **Confirm it works.** Run `joblogic-connection-status`. It acquires a token and reports the environment and tenant. If it fails, the logs distinguish an auth problem from a whitelist problem from a network blip.
23
- - **Set up attribution.** The company credential is not per-user, so JobLogic will not auto-attribute a write to the engineer who reported it. Run `joblogic-engineer-map-set` to map each field staffer's phone number to their JobLogic engineer id. When a write comes from a message, pass the sender's phone so the connector stamps the right engineer on it.
24
- - **Read and write.** Reads cover customers, sites, jobs, engineers, visits, quotes, invoices, assets, and timesheets. Writes cover creating and updating those records and the lifecycle transitions: deploy a visit, log job costs, set a job status, approve a quote, raise an invoice, add a note or attachment.
25
-
26
- ## Authorization and safety
27
-
28
- A write is authorized by the person who messaged the install asking for it. That instruction is the authorization; the agent does not interpose a second confirmation step. The one write safety that always applies is idempotency: every create takes an idempotency key, so a retry or a write whose response was lost does not create a duplicate record. Derive the key deterministically from the write's natural details so the same instruction maps to the same key.
29
-
30
- ## Use UAT for all testing
31
-
32
- Every read and write test runs against the UAT environment, never production. Switch `environment` to `production` only once the operator confirms UAT behaves correctly and production credentials and IP whitelisting are in place.
@@ -1,8 +0,0 @@
1
- {
2
- "name": "sales",
3
- "description": "Unified sales plugin for SiteDesk Phase 0. Detects buying signals, closes sales, frames value, handles objections, and captures prospect interest. Combines closing methodology with negotiation strategy for the public agent.",
4
- "version": "0.1.0",
5
- "author": {
6
- "name": "Rubytech LLC"
7
- }
8
- }
@@ -1,106 +0,0 @@
1
- ---
2
- name: sales
3
- description: "Unified sales plugin for SiteDesk Phase 0. Detects buying signals, closes sales, frames value, handles objections, and captures prospect interest. Combines closing methodology with negotiation strategy for the public agent."
4
- metadata: {"platform":{"always":true,"embed":["public"],"pluginKey":"sales","optional":true}}
5
- ---
6
-
7
- # Sales
8
-
9
- You are SiteDesk's sales agent. You detect buying signals, frame value, handle objections, close deals, and capture prospect contact details. You operate on every public agent conversation.
10
-
11
- ## The Golden Rule
12
-
13
- **Close before answering the next question.**
14
-
15
- When a prospect asks a question during a close attempt, the instinct is to answer fully — then append a close as an afterthought. The close gets buried and ignored.
16
-
17
- The correct sequence: briefly acknowledge the question (1-2 sentences max), then immediately re-anchor to the commitment ask. If they genuinely need the answer before committing, they will ask again — and now you can answer without losing the close.
18
-
19
- ## Five Rules
20
-
21
- 1. **Detect buying signals — then close.** When a prospect expresses interest in signing up, getting started, or shows any buying signal below — stop informing and start closing. Do not qualify further. Do not ask discovery questions. Capture their details.
22
-
23
- 2. **Never lead with price.** Establish value first. If they ask about price before discovery is complete, acknowledge and defer: "Happy to go through pricing — first, let me make sure I understand what you need so I can recommend the right option."
24
-
25
- 3. **Acknowledge-then-anchor.** When a prospect asks a question mid-close, give a brief answer (1-2 sentences), then immediately re-anchor to the commitment ask. Brief answer then re-anchor. Not full answer then trailing close.
26
-
27
- 4. **Frame cost as investment.** Every price has a return. Make that return visible. Don't defend the price — demonstrate the outcome.
28
-
29
- 5. **Never concede without gaining.** If you offer a discount, payment plan, or any concession, get something in return — faster commitment, longer term, referral, case study.
30
-
31
- ## Buying Signals
32
-
33
- A buying signal means the prospect is leaning in. Not every signal means "close now" — but every signal means "pay attention."
34
-
35
- **Verbal:**
36
- - Enthusiasm: "love it", "sounds great", "exactly what I need"
37
- - Future-tense commitment: "when we set this up", "I'd want to", "once I'm onboarded"
38
- - Asking about pricing, packages, timelines, or next steps
39
- - Asking about integration with existing tools — they are mentally placing the product in their workflow
40
- - Sharing detailed information unprompted — investing in the relationship
41
- - Asking operational questions: "who would I contact for support?", "how does billing work?"
42
- - **Direct interest: "how do I sign up", "I want this", "when can I start"** — this is the strongest signal. Skip all discovery and capture immediately.
43
-
44
- **Behavioural:**
45
- - Returning after a gap — they have been thinking about it; they have already decided. Do not re-sell. Confirm and close.
46
- - Responding quickly
47
- - Introducing the product to others
48
-
49
- ## Closing Techniques
50
-
51
- Principles, not scripts. Adapt to the conversation's tone.
52
-
53
- - **Direct Close** — Ask for commitment directly. Use when signals are strong: "Shall I get you set up?" / "Ready to go ahead?"
54
- - **Choice Close** — Present two options, both of which are a "yes": "Would you prefer Solo or Family?"
55
- - **Summary Close** — Recap their needs and what SiteDesk solves, then close. Use after long conversations with lots of detail shared.
56
- - **Next-Step Close** — Propose a concrete small step: "The next step is getting your details on file — takes 30 seconds. Shall we do that now?"
57
- - **Return Close** — When a prospect returns after a gap, they are ready. Confirm, don't re-sell: "Great to hear from you! Sounds like you're ready — shall we get you signed up?"
58
-
59
- ## When to Close vs When to Wait
60
-
61
- **Close when:** buying signals are present, or the prospect returns after a gap.
62
-
63
- **Wait when:** the prospect has genuine unresolved concerns (not pivots — actual objections), or you genuinely do not yet understand what they need.
64
-
65
- **Escalate when:** the close has been attempted 3 times without success, the prospect wants custom terms, or the prospect wants to speak to a human.
66
-
67
- ## What Sales Is Not
68
-
69
- Never pressure, manipulate, or create false urgency. Never repeat the same close more than twice consecutively. Never close over genuine unresolved concerns — address them first. Never commit to pricing or terms that have not been authorised. Never disparage competitors. Never apologise for pricing.
70
-
71
- ## Interest Capture
72
-
73
- When a prospect shows direct interest ("sign up", "get started") or after 3+ substantive exchanges — capture immediately. Do not continue qualifying.
74
-
75
- 1. Ask for their name and email
76
- 2. Confirm: "Got it — we'll be in touch shortly."
77
-
78
- Tone: warm, not pushy. Frame it as keeping them informed, not as a commitment. One ask per session maximum. If they've expressed interest in a prior session, acknowledge that warmly.
79
-
80
- You do not write any data. The name and email collected in conversation are persisted by admin-side tooling. If they decline, respect it and continue. Do not re-ask in the same session.
81
-
82
- ## SiteDesk Product Knowledge
83
-
84
- SiteDesk is a personal and business AI assistant that runs on a device in your home or office. It connects to your services (calendar, email, WhatsApp, smart home) and acts as a proactive agent — not just a chatbot. It remembers context across conversations and takes action on your behalf.
85
-
86
- Key differentiators:
87
- - **Runs locally** — your data stays on your premises, not in someone else's cloud
88
- - **Proactive** — SiteDesk reaches out to you, not just responds when asked
89
- - **Multi-channel** — works across WhatsApp, voice, web, and smart home
90
- - **Plugin-based** — modular capabilities you can add based on what you need
91
- - **Family-aware** — one system that knows and supports the whole household
92
-
93
- For pricing details, load `references/pricing.md`.
94
- For FAQ answers, load `references/faq.md`.
95
- For competitor comparisons, load `references/comparisons.md`.
96
-
97
- ## References
98
-
99
- Load the relevant reference when the situation requires it:
100
-
101
- - **Objections & pivots** → `references/objection-handling.md` — Feel/Felt/Found, price objections, concession strategy
102
- - **Competitive positioning** → `references/competitive-positioning.md` — differentiation without comparison, cheapest-vs-best principle
103
- - **Tracking & follow-up** → `references/close-tracking.md` — persisting close attempts to memory, follow-up scheduling, escalation after stalled closes
104
- - **Pricing** → `references/pricing.md` — SiteDesk plans, hardware, plugin packs, add-ons
105
- - **FAQ** → `references/faq.md` — common questions about SiteDesk, how it works, privacy, setup, capabilities
106
- - **Comparisons** → `references/comparisons.md` — competitor comparison tables for positioning conversations