wizards 0.1.9

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 (308) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +170 -0
  3. package/apps/runtime/dist/agents/architect.js +453 -0
  4. package/apps/runtime/dist/agents/project-assistant.js +354 -0
  5. package/apps/runtime/dist/agents/subscription.js +206 -0
  6. package/apps/runtime/dist/agents/thought.js +21 -0
  7. package/apps/runtime/dist/agents/website.js +197 -0
  8. package/apps/runtime/dist/app.js +153 -0
  9. package/apps/runtime/dist/auth/account.js +121 -0
  10. package/apps/runtime/dist/auth/index.js +329 -0
  11. package/apps/runtime/dist/auth/keys.js +55 -0
  12. package/apps/runtime/dist/auth/local-ticket.js +23 -0
  13. package/apps/runtime/dist/authoring/example.js +73 -0
  14. package/apps/runtime/dist/authoring/guide.js +259 -0
  15. package/apps/runtime/dist/authoring/ops.js +117 -0
  16. package/apps/runtime/dist/cli/autostart.js +134 -0
  17. package/apps/runtime/dist/cli/clients.js +44 -0
  18. package/apps/runtime/dist/cli/environment.js +81 -0
  19. package/apps/runtime/dist/cli/exec.js +45 -0
  20. package/apps/runtime/dist/cli/home.js +74 -0
  21. package/apps/runtime/dist/cli/machine.js +145 -0
  22. package/apps/runtime/dist/cli/main.js +125 -0
  23. package/apps/runtime/dist/cli/setup.js +273 -0
  24. package/apps/runtime/dist/cli/start.js +190 -0
  25. package/apps/runtime/dist/cli/status.js +120 -0
  26. package/apps/runtime/dist/cli/ui.js +12 -0
  27. package/apps/runtime/dist/cli/update.js +58 -0
  28. package/apps/runtime/dist/connectors/builtin.js +70 -0
  29. package/apps/runtime/dist/connectors/external.js +400 -0
  30. package/apps/runtime/dist/connectors/gmail.js +107 -0
  31. package/apps/runtime/dist/connectors/imap.js +217 -0
  32. package/apps/runtime/dist/connectors/index.js +266 -0
  33. package/apps/runtime/dist/connectors/mail.js +72 -0
  34. package/apps/runtime/dist/connectors/outlook.js +90 -0
  35. package/apps/runtime/dist/credits/credits.js +103 -0
  36. package/apps/runtime/dist/credits/estimate.js +132 -0
  37. package/apps/runtime/dist/db/adopt.js +149 -0
  38. package/apps/runtime/dist/db/client.js +146 -0
  39. package/apps/runtime/dist/db/control-schema.js +70 -0
  40. package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +47 -0
  41. package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +41 -0
  42. package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +1 -0
  43. package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +3 -0
  44. package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +6 -0
  45. package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +311 -0
  46. package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +599 -0
  47. package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +607 -0
  48. package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +311 -0
  49. package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +350 -0
  50. package/apps/runtime/dist/db/migrations/control/meta/_journal.json +41 -0
  51. package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +188 -0
  52. package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +1 -0
  53. package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +1 -0
  54. package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +52 -0
  55. package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +6 -0
  56. package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +1323 -0
  57. package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +1330 -0
  58. package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +1337 -0
  59. package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +1605 -0
  60. package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +1645 -0
  61. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +41 -0
  62. package/apps/runtime/dist/db/schema.js +278 -0
  63. package/apps/runtime/dist/documents/parse.js +230 -0
  64. package/apps/runtime/dist/engenty/connections-external/build-connector.js +193 -0
  65. package/apps/runtime/dist/engenty/connections-external/errors.js +11 -0
  66. package/apps/runtime/dist/engenty/connections-external/import-service.js +270 -0
  67. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +34 -0
  68. package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +185 -0
  69. package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +63 -0
  70. package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +130 -0
  71. package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +143 -0
  72. package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +143 -0
  73. package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +119 -0
  74. package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +88 -0
  75. package/apps/runtime/dist/engenty/connections-external/registry-client.js +336 -0
  76. package/apps/runtime/dist/engenty/connections-external/registry-source.js +82 -0
  77. package/apps/runtime/dist/engenty/connections-external/types.js +7 -0
  78. package/apps/runtime/dist/engenty/connections-github/connector.js +209 -0
  79. package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +359 -0
  80. package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +94 -0
  81. package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +290 -0
  82. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +567 -0
  83. package/apps/runtime/dist/engenty/connections-google/definitions.js +11 -0
  84. package/apps/runtime/dist/engenty/connections-google/shared.js +73 -0
  85. package/apps/runtime/dist/engenty/connections-hubspot/connector.js +140 -0
  86. package/apps/runtime/dist/engenty/connections-microsoft/action.js +17 -0
  87. package/apps/runtime/dist/engenty/connections-microsoft/graph.js +114 -0
  88. package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +286 -0
  89. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +464 -0
  90. package/apps/runtime/dist/engenty/connections-s3/s3.js +328 -0
  91. package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +86 -0
  92. package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +150 -0
  93. package/apps/runtime/dist/engenty/connections-sdk/registry.js +89 -0
  94. package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +84 -0
  95. package/apps/runtime/dist/engenty/connections-sdk/types.js +30 -0
  96. package/apps/runtime/dist/engenty/connections-slack/connector.js +360 -0
  97. package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +178 -0
  98. package/apps/runtime/dist/engenty/csv-import/import-sources.js +87 -0
  99. package/apps/runtime/dist/engenty/csv-import/parse-csv.js +129 -0
  100. package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +20 -0
  101. package/apps/runtime/dist/engenty/csv-import/types.js +1 -0
  102. package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +159 -0
  103. package/apps/runtime/dist/engenty/doc-converter/interface.js +9 -0
  104. package/apps/runtime/dist/engenty/doc-converter/page-break.js +92 -0
  105. package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +72 -0
  106. package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +30 -0
  107. package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +4 -0
  108. package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +73 -0
  109. package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +63 -0
  110. package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +40 -0
  111. package/apps/runtime/dist/engenty/search-index/chunks.js +164 -0
  112. package/apps/runtime/dist/engenty/search-index/contracts.js +9 -0
  113. package/apps/runtime/dist/engenty/shims/connections-sdk.js +39 -0
  114. package/apps/runtime/dist/engenty/shims/plugin-sdk.js +1 -0
  115. package/apps/runtime/dist/engenty/shims/web-ingest.js +3 -0
  116. package/apps/runtime/dist/engenty/web-ingest/ssrf.js +277 -0
  117. package/apps/runtime/dist/engine/asks.js +60 -0
  118. package/apps/runtime/dist/engine/events.js +46 -0
  119. package/apps/runtime/dist/engine/input.js +170 -0
  120. package/apps/runtime/dist/engine/prepare.js +51 -0
  121. package/apps/runtime/dist/engine/requirements.js +124 -0
  122. package/apps/runtime/dist/engine/resources.js +89 -0
  123. package/apps/runtime/dist/engine/runner.js +560 -0
  124. package/apps/runtime/dist/engine/steps.js +598 -0
  125. package/apps/runtime/dist/engine/template.js +183 -0
  126. package/apps/runtime/dist/engine/types.js +3 -0
  127. package/apps/runtime/dist/env.js +224 -0
  128. package/apps/runtime/dist/files/blobs.js +22 -0
  129. package/apps/runtime/dist/files/objects.js +86 -0
  130. package/apps/runtime/dist/files/storage.js +95 -0
  131. package/apps/runtime/dist/geocode.js +58 -0
  132. package/apps/runtime/dist/harness/claude.js +138 -0
  133. package/apps/runtime/dist/harness/codex.js +228 -0
  134. package/apps/runtime/dist/harness/cursor.js +93 -0
  135. package/apps/runtime/dist/harness/env.js +124 -0
  136. package/apps/runtime/dist/harness/gemini.js +126 -0
  137. package/apps/runtime/dist/harness/index.js +99 -0
  138. package/apps/runtime/dist/harness/model.js +267 -0
  139. package/apps/runtime/dist/harness/prompt.js +121 -0
  140. package/apps/runtime/dist/harness/terminal.js +193 -0
  141. package/apps/runtime/dist/harness/types.js +7 -0
  142. package/apps/runtime/dist/index.js +76 -0
  143. package/apps/runtime/dist/limits.js +57 -0
  144. package/apps/runtime/dist/link-preview.js +59 -0
  145. package/apps/runtime/dist/manage.js +151 -0
  146. package/apps/runtime/dist/mcp/auth.js +102 -0
  147. package/apps/runtime/dist/mcp/bridge.js +59 -0
  148. package/apps/runtime/dist/mcp/handler.js +42 -0
  149. package/apps/runtime/dist/mcp/scopes.js +5 -0
  150. package/apps/runtime/dist/mcp/tools.js +401 -0
  151. package/apps/runtime/dist/media/ffmpeg.js +121 -0
  152. package/apps/runtime/dist/media/generate.js +120 -0
  153. package/apps/runtime/dist/media/marking.js +121 -0
  154. package/apps/runtime/dist/media/transcribe.js +30 -0
  155. package/apps/runtime/dist/model-errors.js +3 -0
  156. package/apps/runtime/dist/models.js +489 -0
  157. package/apps/runtime/dist/plugin.js +61 -0
  158. package/apps/runtime/dist/render/chromium.js +85 -0
  159. package/apps/runtime/dist/render/convert.js +161 -0
  160. package/apps/runtime/dist/render/downloads.js +277 -0
  161. package/apps/runtime/dist/render/guard.js +25 -0
  162. package/apps/runtime/dist/routes/api.js +74 -0
  163. package/apps/runtime/dist/routes/delivery.js +52 -0
  164. package/apps/runtime/dist/routes/internal.js +49 -0
  165. package/apps/runtime/dist/routes/marketplace.js +36 -0
  166. package/apps/runtime/dist/routes/runs.js +805 -0
  167. package/apps/runtime/dist/routes/studio.js +702 -0
  168. package/apps/runtime/dist/routes/wizard-stream.js +30 -0
  169. package/apps/runtime/dist/running.js +39 -0
  170. package/apps/runtime/dist/sandbox/agentos.js +191 -0
  171. package/apps/runtime/dist/sandbox/docker.js +77 -0
  172. package/apps/runtime/dist/sandbox/index.js +30 -0
  173. package/apps/runtime/dist/sandbox/types.js +1 -0
  174. package/apps/runtime/dist/secrets/crypto.js +28 -0
  175. package/apps/runtime/dist/secrets/signing.js +34 -0
  176. package/apps/runtime/dist/secrets/vault.js +59 -0
  177. package/apps/runtime/dist/services/architect.js +92 -0
  178. package/apps/runtime/dist/services/brand.js +20 -0
  179. package/apps/runtime/dist/services/cloud.js +52 -0
  180. package/apps/runtime/dist/services/draft-events.js +27 -0
  181. package/apps/runtime/dist/services/errors.js +24 -0
  182. package/apps/runtime/dist/services/files.js +129 -0
  183. package/apps/runtime/dist/services/links.js +16 -0
  184. package/apps/runtime/dist/services/marketplace.js +292 -0
  185. package/apps/runtime/dist/services/package.js +202 -0
  186. package/apps/runtime/dist/services/profile.js +23 -0
  187. package/apps/runtime/dist/services/project-files.js +266 -0
  188. package/apps/runtime/dist/services/project-index.js +109 -0
  189. package/apps/runtime/dist/services/projects.js +181 -0
  190. package/apps/runtime/dist/services/runs.js +224 -0
  191. package/apps/runtime/dist/services/shares.js +129 -0
  192. package/apps/runtime/dist/services/widgets.js +34 -0
  193. package/apps/runtime/dist/services/wizards.js +342 -0
  194. package/apps/runtime/dist/settings.js +16 -0
  195. package/apps/runtime/dist/store/index.js +279 -0
  196. package/apps/runtime/dist/tenants/control.js +106 -0
  197. package/apps/runtime/dist/tenants/tenant.js +26 -0
  198. package/apps/runtime/dist/tools/browser.js +380 -0
  199. package/apps/runtime/dist/tools/connector.js +204 -0
  200. package/apps/runtime/dist/tools/index.js +234 -0
  201. package/apps/runtime/dist/tools/mail.js +104 -0
  202. package/apps/runtime/dist/tools/net-guard.js +59 -0
  203. package/apps/runtime/dist/tools/project.js +53 -0
  204. package/apps/runtime/dist/tools/shared.js +42 -0
  205. package/apps/runtime/dist/tools/store.js +238 -0
  206. package/apps/runtime/dist/update.js +118 -0
  207. package/apps/runtime/dist/widgets/bundle.js +99 -0
  208. package/apps/runtime/dist/widgets/render.js +312 -0
  209. package/apps/runtime/dist/widgets/runtime.js +84 -0
  210. package/apps/runtime/dist/widgets/script.js +30 -0
  211. package/apps/runtime/dist/widgets/step.js +192 -0
  212. package/apps/web/dist/ai-labels/ai-black.svg +20 -0
  213. package/apps/web/dist/ai-labels/ai-generated-black.svg +31 -0
  214. package/apps/web/dist/ai-labels/ai-generated-white.svg +32 -0
  215. package/apps/web/dist/ai-labels/ai-modified-black.svg +30 -0
  216. package/apps/web/dist/ai-labels/ai-modified-white.svg +31 -0
  217. package/apps/web/dist/ai-labels/ai-white.svg +21 -0
  218. package/apps/web/dist/assets/ChangelogDialog-O00vEnbm.js +1 -0
  219. package/apps/web/dist/assets/ChatPanel-CH9ry0Hp.js +1 -0
  220. package/apps/web/dist/assets/CreditsDialog-DRzecwUw.js +1 -0
  221. package/apps/web/dist/assets/EditorPage-BRnBf02Q.js +2 -0
  222. package/apps/web/dist/assets/FlowPreview-DDOj8IAH.js +1 -0
  223. package/apps/web/dist/assets/HomePage-CAGTTG3N.js +1 -0
  224. package/apps/web/dist/assets/ImportWizard-0RRrAnX3.js +1 -0
  225. package/apps/web/dist/assets/LocalRuntime-BrP-ENHg.css +1 -0
  226. package/apps/web/dist/assets/LocalRuntime-C-TBYrzs.js +16 -0
  227. package/apps/web/dist/assets/NewWizardPage-kI90h3_9.js +2 -0
  228. package/apps/web/dist/assets/PublicRunner-CKRDeIVd.js +1 -0
  229. package/apps/web/dist/assets/RunnerView-Rc4H8wYH.js +2 -0
  230. package/apps/web/dist/assets/SettingsPage-CESMuZxq.js +2 -0
  231. package/apps/web/dist/assets/SetupPage-D1rrYU14.js +1 -0
  232. package/apps/web/dist/assets/SharePage-COTAmOgh.js +1 -0
  233. package/apps/web/dist/assets/api-BY28cjGY.js +10 -0
  234. package/apps/web/dist/assets/arrow-left-UpjOBfQp.js +1 -0
  235. package/apps/web/dist/assets/arrow-right-CucQycEy.js +1 -0
  236. package/apps/web/dist/assets/changelog-p3wsaDDS.js +1 -0
  237. package/apps/web/dist/assets/check-Bjx41xbB.js +1 -0
  238. package/apps/web/dist/assets/createLucideIcon-DBu2Ovxj.js +1 -0
  239. package/apps/web/dist/assets/definition-cy7uvY5L.js +55 -0
  240. package/apps/web/dist/assets/engenty-CWIFpgKq.js +1 -0
  241. package/apps/web/dist/assets/esm-D1OEhjTK.js +7 -0
  242. package/apps/web/dist/assets/external-link-CRg6DVdO.js +1 -0
  243. package/apps/web/dist/assets/fluffy-engenty-CJ3wCQgT.js +456 -0
  244. package/apps/web/dist/assets/index-CQ_q9iMO.css +1 -0
  245. package/apps/web/dist/assets/index-D0gxh90t.js +10 -0
  246. package/apps/web/dist/assets/jsx-runtime-Dk72oS4N.js +1 -0
  247. package/apps/web/dist/assets/meta-BbSdtTUa.js +1 -0
  248. package/apps/web/dist/assets/mic-CeqQ89Dj.js +1 -0
  249. package/apps/web/dist/assets/oss-credits-cPuZUFHD.js +1 -0
  250. package/apps/web/dist/assets/outputs-D6pxH6ve.js +69 -0
  251. package/apps/web/dist/assets/plus-HA210wXA.js +1 -0
  252. package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +1 -0
  253. package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +98 -0
  254. package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +1 -0
  255. package/apps/web/dist/assets/type-BzYgVWKL.js +1 -0
  256. package/apps/web/dist/assets/ui-Ddwl35A6.js +1 -0
  257. package/apps/web/dist/assets/upload-DsgLfQ3U.js +1 -0
  258. package/apps/web/dist/assets/video-Dk1fuTDl.js +1 -0
  259. package/apps/web/dist/assets/wand-sparkles-Bf97fs8T.js +1 -0
  260. package/apps/web/dist/embed.js +102 -0
  261. package/apps/web/dist/favicon.svg +1 -0
  262. package/apps/web/dist/icons/apple-touch-icon.png +0 -0
  263. package/apps/web/dist/icons/icon-192.png +0 -0
  264. package/apps/web/dist/icons/icon-512.png +0 -0
  265. package/apps/web/dist/icons/icon-maskable-512.png +0 -0
  266. package/apps/web/dist/index.html +46 -0
  267. package/apps/web/dist/install.sh +532 -0
  268. package/apps/web/dist/manifest.webmanifest +20 -0
  269. package/apps/web/dist/sw.js +15 -0
  270. package/bin/wizards.mjs +13 -0
  271. package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +77 -0
  272. package/node_modules/@engenty-wizards/shared/dist/connectors.js +2 -0
  273. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +1415 -0
  274. package/node_modules/@engenty-wizards/shared/dist/definition.js +762 -0
  275. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +5 -0
  276. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +132 -0
  277. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +11 -0
  278. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +209 -0
  279. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +532 -0
  280. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +216 -0
  281. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +3 -0
  282. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +3 -0
  283. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +14 -0
  284. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +166 -0
  285. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +33 -0
  286. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +99 -0
  287. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +35 -0
  288. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +86 -0
  289. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +20 -0
  290. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +133 -0
  291. package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +298 -0
  292. package/node_modules/@engenty-wizards/shared/dist/marketplace.js +211 -0
  293. package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +7 -0
  294. package/node_modules/@engenty-wizards/shared/dist/merge.js +40 -0
  295. package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +74 -0
  296. package/node_modules/@engenty-wizards/shared/dist/projects.js +96 -0
  297. package/node_modules/@engenty-wizards/shared/dist/run.d.ts +219 -0
  298. package/node_modules/@engenty-wizards/shared/dist/run.js +1 -0
  299. package/node_modules/@engenty-wizards/shared/dist/store.d.ts +100 -0
  300. package/node_modules/@engenty-wizards/shared/dist/store.js +44 -0
  301. package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +16 -0
  302. package/node_modules/@engenty-wizards/shared/dist/workspace.js +51 -0
  303. package/node_modules/@engenty-wizards/shared/package.json +10 -0
  304. package/package.json +62 -0
  305. package/plugin/.claude-plugin/plugin.json +9 -0
  306. package/plugin/.mcp.json +8 -0
  307. package/plugin/commands/wizard.md +8 -0
  308. package/plugin/skills/build-wizard/SKILL.md +27 -0
@@ -0,0 +1,140 @@
1
+ import { defineConnector, } from "../shims/connections-sdk.js";
2
+ import { z } from "zod";
3
+ const HUBSPOT_API = "https://api.hubapi.com";
4
+ function parseCredentials(accessToken) {
5
+ let parsed;
6
+ try {
7
+ parsed = JSON.parse(accessToken);
8
+ }
9
+ catch {
10
+ throw new Error("hubspot_credentials_invalid: stored credentials are not JSON");
11
+ }
12
+ if (!parsed.access_token?.trim()) {
13
+ throw new Error("hubspot_credentials_invalid: missing access_token");
14
+ }
15
+ return { access_token: parsed.access_token.trim() };
16
+ }
17
+ async function errorExcerpt(res) {
18
+ const body = await res.text().catch(() => "");
19
+ return body.replace(/\s+/g, " ").trim().slice(0, 200) || res.statusText;
20
+ }
21
+ async function hubspotJson(ctx, path, init) {
22
+ const creds = parseCredentials(ctx.accessToken);
23
+ const res = await ctx.fetchImpl(`${HUBSPOT_API}${path}`, {
24
+ ...init,
25
+ headers: {
26
+ Authorization: `Bearer ${creds.access_token}`,
27
+ "content-type": "application/json",
28
+ ...(init?.headers ?? {}),
29
+ },
30
+ });
31
+ if (!res.ok) {
32
+ throw new Error(`hubspot_api_error (${res.status}): ${await errorExcerpt(res)}`);
33
+ }
34
+ return (await res.json());
35
+ }
36
+ function mapContact(contact) {
37
+ const p = contact.properties ?? {};
38
+ const displayName = [p.firstname, p.lastname].filter(Boolean).join(" ").trim() ||
39
+ p.email ||
40
+ null;
41
+ return {
42
+ company: p.company ?? null,
43
+ display_name: displayName,
44
+ email: p.email ?? null,
45
+ first_name: p.firstname ?? null,
46
+ hubspot_id: contact.id,
47
+ last_name: p.lastname ?? null,
48
+ phone: p.phone ?? null,
49
+ title: p.jobtitle ?? null,
50
+ };
51
+ }
52
+ function connectorAction(def) {
53
+ return {
54
+ description: def.description,
55
+ group: def.group,
56
+ handler: (input, ctx) => def.handler(def.inputSchema.parse(input), ctx),
57
+ id: def.id,
58
+ inputSchema: def.inputSchema,
59
+ providerScopes: [],
60
+ summary: def.summary,
61
+ };
62
+ }
63
+ export async function verifyHubSpotCredentials(raw, fetchImpl) {
64
+ const token = raw.access_token?.trim();
65
+ if (!token) {
66
+ throw new Error("missing access_token");
67
+ }
68
+ const res = await fetchImpl(`${HUBSPOT_API}/crm/v3/objects/contacts?limit=1`, {
69
+ headers: { Authorization: `Bearer ${token}` },
70
+ });
71
+ if (!res.ok) {
72
+ throw new Error(`hubspot_verify_failed (${res.status}): ${await errorExcerpt(res)}`);
73
+ }
74
+ // Account details require a separate scopes-heavy call; use a stable label.
75
+ return { label: "HubSpot" };
76
+ }
77
+ export const hubspotConnector = defineConnector({
78
+ actions: [
79
+ connectorAction({
80
+ description: "List HubSpot CRM contacts. Returns compact rows for import: display name, first/last name, email, phone, company, title, hubspot_id.",
81
+ group: "read",
82
+ handler: async (input, ctx) => {
83
+ const params = new URLSearchParams({
84
+ limit: String(input.page_size ?? 100),
85
+ properties: [
86
+ "email",
87
+ "firstname",
88
+ "lastname",
89
+ "phone",
90
+ "company",
91
+ "jobtitle",
92
+ ].join(","),
93
+ });
94
+ if (input.page_token) {
95
+ params.set("after", input.page_token);
96
+ }
97
+ const data = await hubspotJson(ctx, `/crm/v3/objects/contacts?${params.toString()}`);
98
+ return {
99
+ contacts: (data.results ?? []).map(mapContact),
100
+ next_page_token: data.paging?.next?.after ?? null,
101
+ };
102
+ },
103
+ id: "list_contacts",
104
+ inputSchema: z.object({
105
+ page_size: z
106
+ .number()
107
+ .int()
108
+ .min(1)
109
+ .max(100)
110
+ .optional()
111
+ .describe("Page size (1–100). Defaults to 100."),
112
+ page_token: z
113
+ .string()
114
+ .optional()
115
+ .describe("Pagination cursor from a previous list_contacts call."),
116
+ }),
117
+ summary: "List HubSpot contacts",
118
+ }),
119
+ ],
120
+ auth: {
121
+ kind: "api_key",
122
+ apiKey: {
123
+ fields: [
124
+ {
125
+ key: "access_token",
126
+ label: "Private app access token",
127
+ placeholder: "pat-…",
128
+ secret: true,
129
+ },
130
+ ],
131
+ verify: verifyHubSpotCredentials,
132
+ },
133
+ },
134
+ description: "Import contacts from HubSpot CRM using a private app access token.",
135
+ icon: "🔌",
136
+ id: "hubspot",
137
+ moduleId: "connections-hubspot",
138
+ name: "HubSpot",
139
+ toolPrefix: "hubspot",
140
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Typed action builder: `ConnectorAction[]` erases the input type to
3
+ * `unknown`, so handlers written against concrete inputs would violate
4
+ * strictFunctionTypes. This wrapper parses the raw input with the action's
5
+ * zod schema (also applying schema defaults) before invoking the typed `run`.
6
+ */
7
+ export function action(def) {
8
+ return {
9
+ description: def.description,
10
+ group: def.group,
11
+ handler: (raw, ctx) => def.run(def.inputSchema.parse(raw), ctx),
12
+ id: def.id,
13
+ inputSchema: def.inputSchema,
14
+ providerScopes: def.providerScopes,
15
+ summary: def.summary,
16
+ };
17
+ }
@@ -0,0 +1,114 @@
1
+ export const GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0";
2
+ /**
3
+ * Shared Microsoft identity platform OAuth config (tenant `common`, so both
4
+ * org and personal Microsoft accounts can connect). Both connectors reuse it;
5
+ * per-action `providerScopes` add the Graph delegated permissions on top of
6
+ * these base identity scopes.
7
+ */
8
+ export const MICROSOFT_OAUTH2 = {
9
+ authUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
10
+ baseScopes: ["openid", "email", "offline_access", "User.Read"],
11
+ clientIdEnv: "MICROSOFT_OAUTH_CLIENT_ID",
12
+ clientSecretEnv: "MICROSOFT_OAUTH_CLIENT_SECRET",
13
+ resolveAccount: async (accessToken, fetchImpl) => {
14
+ const res = await fetchImpl(`${GRAPH_BASE_URL}/me`, {
15
+ headers: { Authorization: `Bearer ${accessToken}` },
16
+ });
17
+ if (!res.ok) {
18
+ throw new Error(`microsoft_graph_error (${res.status}): failed to resolve account via /me`);
19
+ }
20
+ const me = (await res.json());
21
+ return {
22
+ externalId: me.id,
23
+ label: me.userPrincipalName ?? me.mail ?? "Microsoft account",
24
+ };
25
+ },
26
+ tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
27
+ };
28
+ async function graphError(res) {
29
+ let excerpt = "";
30
+ try {
31
+ excerpt = (await res.text()).replace(/\s+/g, " ").trim().slice(0, 300);
32
+ }
33
+ catch {
34
+ // ignore body read failures — status alone is enough
35
+ }
36
+ return new Error(`microsoft_graph_error (${res.status}): ${excerpt || res.statusText}`);
37
+ }
38
+ /**
39
+ * JSON request against Microsoft Graph. `path` is relative to the v1.0 base
40
+ * (must start with `/`). Returns the parsed JSON body, or `null` for
41
+ * 202/204-style empty responses.
42
+ */
43
+ export async function graphJson(ctx, path, init) {
44
+ const res = await ctx.fetchImpl(`${GRAPH_BASE_URL}${path}`, {
45
+ headers: {
46
+ Accept: "application/json",
47
+ Authorization: `Bearer ${ctx.accessToken}`,
48
+ ...(init?.body === undefined
49
+ ? {}
50
+ : { "Content-Type": "application/json" }),
51
+ },
52
+ method: init?.method ?? "GET",
53
+ ...(init?.body === undefined ? {} : { body: JSON.stringify(init.body) }),
54
+ });
55
+ if (!res.ok) {
56
+ throw await graphError(res);
57
+ }
58
+ if (res.status === 204 ||
59
+ res.status === 202 ||
60
+ res.headers.get("content-length") === "0") {
61
+ return null;
62
+ }
63
+ const text = await res.text();
64
+ if (!text) {
65
+ return null;
66
+ }
67
+ return JSON.parse(text);
68
+ }
69
+ /** Raw (non-JSON) Graph request — used for file content and uploads. */
70
+ export async function graphRaw(ctx, path, init) {
71
+ const res = await ctx.fetchImpl(`${GRAPH_BASE_URL}${path}`, {
72
+ headers: {
73
+ Authorization: `Bearer ${ctx.accessToken}`,
74
+ ...(init?.contentType ? { "Content-Type": init.contentType } : {}),
75
+ },
76
+ method: init?.method ?? "GET",
77
+ ...(init?.body === undefined ? {} : { body: init.body }),
78
+ });
79
+ if (!res.ok) {
80
+ throw await graphError(res);
81
+ }
82
+ return res;
83
+ }
84
+ /** Very small HTML → plain-text conversion for message/event bodies. */
85
+ export function htmlToText(html) {
86
+ return html
87
+ .replace(/<style[\s\S]*?<\/style>/gi, " ")
88
+ .replace(/<script[\s\S]*?<\/script>/gi, " ")
89
+ .replace(/<head[\s\S]*?<\/head>/gi, " ")
90
+ .replace(/<!--[\s\S]*?-->/g, " ")
91
+ .replace(/<br\s*\/?>/gi, "\n")
92
+ .replace(/<\/(p|div|tr|li|blockquote|h[1-6])>/gi, "\n")
93
+ .replace(/<[^>]+>/g, " ")
94
+ .replace(/&nbsp;/gi, " ")
95
+ .replace(/&amp;/gi, "&")
96
+ .replace(/&lt;/gi, "<")
97
+ .replace(/&gt;/gi, ">")
98
+ .replace(/&quot;/gi, '"')
99
+ .replace(/&#0?39;/g, "'")
100
+ .replace(/[ \t]+/g, " ")
101
+ .replace(/ *\n */g, "\n")
102
+ .replace(/\n{3,}/g, "\n\n")
103
+ .trim();
104
+ }
105
+ /** Body from a Graph message/event `itemBody`, normalized to plain text. */
106
+ export function bodyToText(body) {
107
+ const content = body?.content ?? "";
108
+ if (!content) {
109
+ return "";
110
+ }
111
+ return body?.contentType?.toLowerCase() === "html"
112
+ ? htmlToText(content)
113
+ : content;
114
+ }
@@ -0,0 +1,286 @@
1
+ import { defineConnector } from "../shims/connections-sdk.js";
2
+ import { z } from "zod";
3
+ import { action } from "./action.js";
4
+ import { GRAPH_BASE_URL, graphJson, graphRaw, MICROSOFT_OAUTH2, } from "./graph.js";
5
+ const MAX_SEARCH_TOP = 25;
6
+ const MAX_CONTENT_CHARS = 50_000;
7
+ const ITEM_SELECT = "id,name,file,folder,size,lastModifiedDateTime,webUrl";
8
+ function mapItem(item) {
9
+ return {
10
+ childCount: item.folder?.childCount ?? null,
11
+ id: item.id,
12
+ isFolder: Boolean(item.folder),
13
+ lastModifiedDateTime: item.lastModifiedDateTime ?? null,
14
+ mimeType: item.file?.mimeType ?? null,
15
+ name: item.name ?? null,
16
+ size: item.size ?? null,
17
+ webUrl: item.webUrl ?? null,
18
+ };
19
+ }
20
+ const TEXTISH_MIME_PREFIXES = ["text/"];
21
+ const TEXTISH_MIME_TYPES = new Set([
22
+ "application/json",
23
+ "application/ld+json",
24
+ "application/javascript",
25
+ "application/typescript",
26
+ "application/x-javascript",
27
+ "application/xml",
28
+ "application/x-sh",
29
+ "application/x-yaml",
30
+ "application/yaml",
31
+ "application/csv",
32
+ "application/sql",
33
+ "application/rtf",
34
+ "image/svg+xml",
35
+ ]);
36
+ function toCapabilityEntry(item) {
37
+ return {
38
+ kind: item.folder ? "folder" : "file",
39
+ mime_type: item.file?.mimeType ?? null,
40
+ modified_at: item.lastModifiedDateTime ?? null,
41
+ name: item.name ?? "",
42
+ ref: item.id ?? "",
43
+ size: item.size ?? null,
44
+ web_url: item.webUrl ?? null,
45
+ };
46
+ }
47
+ /** Turn a Graph `@odata.nextLink` (a full URL) into a graphJson-relative path. */
48
+ function nextLinkToCursor(nextLink) {
49
+ if (!nextLink) {
50
+ return null;
51
+ }
52
+ return nextLink.startsWith(GRAPH_BASE_URL)
53
+ ? nextLink.slice(GRAPH_BASE_URL.length)
54
+ : nextLink;
55
+ }
56
+ function isTextishMimeType(mimeType) {
57
+ const normalized = mimeType.toLowerCase().split(";")[0].trim();
58
+ return (TEXTISH_MIME_PREFIXES.some((p) => normalized.startsWith(p)) ||
59
+ TEXTISH_MIME_TYPES.has(normalized) ||
60
+ normalized.endsWith("+json") ||
61
+ normalized.endsWith("+xml"));
62
+ }
63
+ export const microsoftOneDriveConnector = defineConnector({
64
+ actions: [
65
+ // ── read ────────────────────────────────────────────────────────────
66
+ action({
67
+ description: "Search files and folders across the user's OneDrive by name/content query.",
68
+ group: "read",
69
+ id: "search_files",
70
+ inputSchema: z.object({
71
+ q: z.string().describe("Search text (matches names and file content)."),
72
+ top: z
73
+ .number()
74
+ .int()
75
+ .min(1)
76
+ .max(MAX_SEARCH_TOP)
77
+ .optional()
78
+ .describe("Max results to return (1–25, default 10)."),
79
+ }),
80
+ providerScopes: ["Files.Read"],
81
+ run: async (input, ctx) => {
82
+ const top = Math.min(Math.max(input.top ?? 10, 1), MAX_SEARCH_TOP);
83
+ const q = encodeURIComponent(input.q.replace(/'/g, "''"));
84
+ const data = await graphJson(ctx, `/me/drive/root/search(q='${q}')?$top=${top}&$select=${ITEM_SELECT}`);
85
+ return { items: (data.value ?? []).map(mapItem) };
86
+ },
87
+ summary: "Search OneDrive files",
88
+ }),
89
+ action({
90
+ description: "Get metadata for a single OneDrive item (file or folder) by id.",
91
+ group: "read",
92
+ id: "get_item",
93
+ inputSchema: z.object({
94
+ item_id: z.string().describe("OneDrive item id."),
95
+ }),
96
+ providerScopes: ["Files.Read"],
97
+ run: async (input, ctx) => {
98
+ const item = await graphJson(ctx, `/me/drive/items/${encodeURIComponent(input.item_id)}?$select=${ITEM_SELECT},parentReference`);
99
+ return {
100
+ ...mapItem(item),
101
+ parent: item.parentReference
102
+ ? {
103
+ id: item.parentReference.id ?? null,
104
+ path: item.parentReference.path ?? null,
105
+ }
106
+ : null,
107
+ };
108
+ },
109
+ summary: "Get a OneDrive item",
110
+ }),
111
+ action({
112
+ description: "List the children of a OneDrive folder (defaults to the drive root).",
113
+ group: "read",
114
+ id: "list_children",
115
+ inputSchema: z.object({
116
+ item_id: z
117
+ .string()
118
+ .optional()
119
+ .describe("Folder item id. Omit to list the drive root."),
120
+ top: z
121
+ .number()
122
+ .int()
123
+ .min(1)
124
+ .max(MAX_SEARCH_TOP)
125
+ .optional()
126
+ .describe("Max children to return (1–25, default 25)."),
127
+ }),
128
+ providerScopes: ["Files.Read"],
129
+ run: async (input, ctx) => {
130
+ const top = Math.min(Math.max(input.top ?? MAX_SEARCH_TOP, 1), MAX_SEARCH_TOP);
131
+ const base = input.item_id
132
+ ? `/me/drive/items/${encodeURIComponent(input.item_id)}/children`
133
+ : "/me/drive/root/children";
134
+ const data = await graphJson(ctx, `${base}?$top=${top}&$select=${ITEM_SELECT}`);
135
+ return { items: (data.value ?? []).map(mapItem) };
136
+ },
137
+ summary: "List OneDrive folder children",
138
+ }),
139
+ action({
140
+ description: "Read the content of a text-like OneDrive file (capped at ~50KB). Office documents are not converted — their webUrl is returned instead.",
141
+ group: "read",
142
+ id: "read_file_content",
143
+ inputSchema: z.object({
144
+ item_id: z.string().describe("OneDrive file item id."),
145
+ }),
146
+ providerScopes: ["Files.Read"],
147
+ run: async (input, ctx) => {
148
+ const encodedId = encodeURIComponent(input.item_id);
149
+ const item = await graphJson(ctx, `/me/drive/items/${encodedId}?$select=${ITEM_SELECT}`);
150
+ if (item.folder) {
151
+ throw new Error("read_file_content: item is a folder — use list_children instead");
152
+ }
153
+ const mimeType = item.file?.mimeType ?? "";
154
+ if (!(mimeType && isTextishMimeType(mimeType))) {
155
+ return {
156
+ id: item.id,
157
+ mimeType: mimeType || null,
158
+ name: item.name ?? null,
159
+ reason: "File content is not plain text (e.g. an Office document or binary). Open it via webUrl instead.",
160
+ supported: false,
161
+ webUrl: item.webUrl ?? null,
162
+ };
163
+ }
164
+ const res = await graphRaw(ctx, `/me/drive/items/${encodedId}/content`);
165
+ const text = await res.text();
166
+ const truncated = text.length > MAX_CONTENT_CHARS;
167
+ return {
168
+ content: truncated ? text.slice(0, MAX_CONTENT_CHARS) : text,
169
+ id: item.id,
170
+ mimeType,
171
+ name: item.name ?? null,
172
+ size: item.size ?? null,
173
+ supported: true,
174
+ truncated,
175
+ };
176
+ },
177
+ summary: "Read a OneDrive text file's content",
178
+ }),
179
+ // ── write ───────────────────────────────────────────────────────────
180
+ action({
181
+ description: "Upload (create or overwrite) a text file in OneDrive under the given parent folder.",
182
+ group: "write",
183
+ id: "upload_file",
184
+ inputSchema: z.object({
185
+ content_text: z.string().describe("File content (plain text)."),
186
+ name: z
187
+ .string()
188
+ .describe("File name including extension (e.g. notes.md)."),
189
+ parent_id: z
190
+ .string()
191
+ .default("root")
192
+ .describe('Parent folder item id (default "root").'),
193
+ }),
194
+ providerScopes: ["Files.ReadWrite"],
195
+ run: async (input, ctx) => {
196
+ const encodedName = encodeURIComponent(input.name);
197
+ const path = input.parent_id === "root"
198
+ ? `/me/drive/root:/${encodedName}:/content`
199
+ : `/me/drive/items/${encodeURIComponent(input.parent_id)}:/${encodedName}:/content`;
200
+ const res = await graphRaw(ctx, path, {
201
+ body: input.content_text,
202
+ contentType: "text/plain",
203
+ method: "PUT",
204
+ });
205
+ const item = (await res.json());
206
+ return mapItem(item);
207
+ },
208
+ summary: "Upload a text file to OneDrive",
209
+ }),
210
+ ],
211
+ auth: { kind: "oauth2", oauth2: MICROSOFT_OAUTH2 },
212
+ description: "OneDrive files via Microsoft Graph: search, browse, read text file content, and upload text files.",
213
+ files: {
214
+ rootLabel: () => "OneDrive",
215
+ async list(ctx, input) {
216
+ // A cursor is a ready-to-follow @odata.nextLink path (already carries
217
+ // $top/$select/$skiptoken), so follow it verbatim.
218
+ const path = input.cursor
219
+ ? input.cursor
220
+ : `${input.folder_ref
221
+ ? `/me/drive/items/${encodeURIComponent(input.folder_ref)}/children`
222
+ : "/me/drive/root/children"}?$top=${input.limit ?? 100}&$select=${ITEM_SELECT}`;
223
+ const data = await graphJson(ctx, path);
224
+ return {
225
+ entries: (data.value ?? []).map(toCapabilityEntry),
226
+ next_cursor: nextLinkToCursor(data["@odata.nextLink"]),
227
+ };
228
+ },
229
+ async read(ctx, input) {
230
+ const encodedId = encodeURIComponent(input.file_ref);
231
+ const item = await graphJson(ctx, `/me/drive/items/${encodedId}?$select=${ITEM_SELECT}`);
232
+ if (item.folder) {
233
+ throw new Error("onedrive_read: item is a folder");
234
+ }
235
+ const cap = input.max_bytes ?? 20_000_000;
236
+ if ((item.size ?? 0) > cap) {
237
+ throw new Error(`onedrive_file_too_large: ${item.size} bytes exceeds the ${cap} byte cap`);
238
+ }
239
+ // /content 302-redirects to a pre-authenticated download URL; fetch
240
+ // follows it transparently.
241
+ const res = await graphRaw(ctx, `/me/drive/items/${encodedId}/content`);
242
+ const mimeType = item.file?.mimeType ?? "application/octet-stream";
243
+ if (isTextishMimeType(mimeType)) {
244
+ const content = await res.text();
245
+ return {
246
+ content,
247
+ kind: "text",
248
+ mime_type: mimeType,
249
+ name: item.name ?? null,
250
+ size: item.size ?? content.length,
251
+ truncated: false,
252
+ };
253
+ }
254
+ const buffer = new Uint8Array(await res.arrayBuffer());
255
+ return {
256
+ content_base64: Buffer.from(buffer).toString("base64"),
257
+ kind: "base64",
258
+ mime_type: mimeType,
259
+ name: item.name ?? null,
260
+ size: item.size ?? buffer.byteLength,
261
+ truncated: false,
262
+ };
263
+ },
264
+ async search(ctx, input) {
265
+ const q = encodeURIComponent(input.query.replace(/'/g, "''"));
266
+ const base = input.folder_ref
267
+ ? `/me/drive/items/${encodeURIComponent(input.folder_ref)}`
268
+ : "/me/drive/root";
269
+ const data = await graphJson(ctx, `${base}/search(q='${q}')?$top=${input.limit ?? 100}&$select=${ITEM_SELECT}`);
270
+ return {
271
+ entries: (data.value ?? []).map(toCapabilityEntry),
272
+ next_cursor: null,
273
+ };
274
+ },
275
+ async stat(ctx, input) {
276
+ const item = await graphJson(ctx, `/me/drive/items/${encodeURIComponent(input.ref)}?$select=${ITEM_SELECT}`);
277
+ return toCapabilityEntry(item);
278
+ },
279
+ },
280
+ filesProviderScopes: ["Files.Read"],
281
+ icon: "logo:microsoft-onedrive",
282
+ id: "microsoft-onedrive",
283
+ moduleId: "connections-microsoft",
284
+ name: "Microsoft OneDrive",
285
+ toolPrefix: "onedrive",
286
+ });