availsync 0.1.0

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 (460) hide show
  1. package/.adal/skills/stripe-best-practices/SKILL.md +42 -0
  2. package/.adal/skills/stripe-best-practices/references/billing.md +36 -0
  3. package/.adal/skills/stripe-best-practices/references/connect.md +48 -0
  4. package/.adal/skills/stripe-best-practices/references/payments.md +79 -0
  5. package/.adal/skills/stripe-best-practices/references/security.md +109 -0
  6. package/.adal/skills/stripe-best-practices/references/treasury.md +16 -0
  7. package/.adal/skills/stripe-projects/SKILL.md +139 -0
  8. package/.adal/skills/upgrade-stripe/SKILL.md +185 -0
  9. package/.agents/skills/stripe-best-practices/SKILL.md +42 -0
  10. package/.agents/skills/stripe-best-practices/references/billing.md +36 -0
  11. package/.agents/skills/stripe-best-practices/references/connect.md +48 -0
  12. package/.agents/skills/stripe-best-practices/references/payments.md +79 -0
  13. package/.agents/skills/stripe-best-practices/references/security.md +109 -0
  14. package/.agents/skills/stripe-best-practices/references/treasury.md +16 -0
  15. package/.agents/skills/stripe-projects/SKILL.md +139 -0
  16. package/.agents/skills/upgrade-stripe/SKILL.md +185 -0
  17. package/.augment/skills/stripe-best-practices/SKILL.md +42 -0
  18. package/.augment/skills/stripe-best-practices/references/billing.md +36 -0
  19. package/.augment/skills/stripe-best-practices/references/connect.md +48 -0
  20. package/.augment/skills/stripe-best-practices/references/payments.md +79 -0
  21. package/.augment/skills/stripe-best-practices/references/security.md +109 -0
  22. package/.augment/skills/stripe-best-practices/references/treasury.md +16 -0
  23. package/.augment/skills/stripe-projects/SKILL.md +139 -0
  24. package/.augment/skills/upgrade-stripe/SKILL.md +185 -0
  25. package/.bob/skills/stripe-best-practices/SKILL.md +42 -0
  26. package/.bob/skills/stripe-best-practices/references/billing.md +36 -0
  27. package/.bob/skills/stripe-best-practices/references/connect.md +48 -0
  28. package/.bob/skills/stripe-best-practices/references/payments.md +79 -0
  29. package/.bob/skills/stripe-best-practices/references/security.md +109 -0
  30. package/.bob/skills/stripe-best-practices/references/treasury.md +16 -0
  31. package/.bob/skills/stripe-projects/SKILL.md +139 -0
  32. package/.bob/skills/upgrade-stripe/SKILL.md +185 -0
  33. package/.claude/settings.local.json +7 -0
  34. package/.claude/skills/stripe-best-practices/SKILL.md +42 -0
  35. package/.claude/skills/stripe-best-practices/references/billing.md +36 -0
  36. package/.claude/skills/stripe-best-practices/references/connect.md +48 -0
  37. package/.claude/skills/stripe-best-practices/references/payments.md +79 -0
  38. package/.claude/skills/stripe-best-practices/references/security.md +109 -0
  39. package/.claude/skills/stripe-best-practices/references/treasury.md +16 -0
  40. package/.claude/skills/stripe-projects/SKILL.md +139 -0
  41. package/.claude/skills/upgrade-stripe/SKILL.md +185 -0
  42. package/.codebuddy/skills/stripe-best-practices/SKILL.md +42 -0
  43. package/.codebuddy/skills/stripe-best-practices/references/billing.md +36 -0
  44. package/.codebuddy/skills/stripe-best-practices/references/connect.md +48 -0
  45. package/.codebuddy/skills/stripe-best-practices/references/payments.md +79 -0
  46. package/.codebuddy/skills/stripe-best-practices/references/security.md +109 -0
  47. package/.codebuddy/skills/stripe-best-practices/references/treasury.md +16 -0
  48. package/.codebuddy/skills/stripe-projects/SKILL.md +139 -0
  49. package/.codebuddy/skills/upgrade-stripe/SKILL.md +185 -0
  50. package/.commandcode/skills/stripe-best-practices/SKILL.md +42 -0
  51. package/.commandcode/skills/stripe-best-practices/references/billing.md +36 -0
  52. package/.commandcode/skills/stripe-best-practices/references/connect.md +48 -0
  53. package/.commandcode/skills/stripe-best-practices/references/payments.md +79 -0
  54. package/.commandcode/skills/stripe-best-practices/references/security.md +109 -0
  55. package/.commandcode/skills/stripe-best-practices/references/treasury.md +16 -0
  56. package/.commandcode/skills/stripe-projects/SKILL.md +139 -0
  57. package/.commandcode/skills/upgrade-stripe/SKILL.md +185 -0
  58. package/.continue/skills/stripe-best-practices/SKILL.md +42 -0
  59. package/.continue/skills/stripe-best-practices/references/billing.md +36 -0
  60. package/.continue/skills/stripe-best-practices/references/connect.md +48 -0
  61. package/.continue/skills/stripe-best-practices/references/payments.md +79 -0
  62. package/.continue/skills/stripe-best-practices/references/security.md +109 -0
  63. package/.continue/skills/stripe-best-practices/references/treasury.md +16 -0
  64. package/.continue/skills/stripe-projects/SKILL.md +139 -0
  65. package/.continue/skills/upgrade-stripe/SKILL.md +185 -0
  66. package/.cortex/skills/stripe-best-practices/SKILL.md +42 -0
  67. package/.cortex/skills/stripe-best-practices/references/billing.md +36 -0
  68. package/.cortex/skills/stripe-best-practices/references/connect.md +48 -0
  69. package/.cortex/skills/stripe-best-practices/references/payments.md +79 -0
  70. package/.cortex/skills/stripe-best-practices/references/security.md +109 -0
  71. package/.cortex/skills/stripe-best-practices/references/treasury.md +16 -0
  72. package/.cortex/skills/stripe-projects/SKILL.md +139 -0
  73. package/.cortex/skills/upgrade-stripe/SKILL.md +185 -0
  74. package/.crush/skills/stripe-best-practices/SKILL.md +42 -0
  75. package/.crush/skills/stripe-best-practices/references/billing.md +36 -0
  76. package/.crush/skills/stripe-best-practices/references/connect.md +48 -0
  77. package/.crush/skills/stripe-best-practices/references/payments.md +79 -0
  78. package/.crush/skills/stripe-best-practices/references/security.md +109 -0
  79. package/.crush/skills/stripe-best-practices/references/treasury.md +16 -0
  80. package/.crush/skills/stripe-projects/SKILL.md +139 -0
  81. package/.crush/skills/upgrade-stripe/SKILL.md +185 -0
  82. package/.env.example +20 -0
  83. package/.factory/skills/stripe-best-practices/SKILL.md +42 -0
  84. package/.factory/skills/stripe-best-practices/references/billing.md +36 -0
  85. package/.factory/skills/stripe-best-practices/references/connect.md +48 -0
  86. package/.factory/skills/stripe-best-practices/references/payments.md +79 -0
  87. package/.factory/skills/stripe-best-practices/references/security.md +109 -0
  88. package/.factory/skills/stripe-best-practices/references/treasury.md +16 -0
  89. package/.factory/skills/stripe-projects/SKILL.md +139 -0
  90. package/.factory/skills/upgrade-stripe/SKILL.md +185 -0
  91. package/.goose/skills/stripe-best-practices/SKILL.md +42 -0
  92. package/.goose/skills/stripe-best-practices/references/billing.md +36 -0
  93. package/.goose/skills/stripe-best-practices/references/connect.md +48 -0
  94. package/.goose/skills/stripe-best-practices/references/payments.md +79 -0
  95. package/.goose/skills/stripe-best-practices/references/security.md +109 -0
  96. package/.goose/skills/stripe-best-practices/references/treasury.md +16 -0
  97. package/.goose/skills/stripe-projects/SKILL.md +139 -0
  98. package/.goose/skills/upgrade-stripe/SKILL.md +185 -0
  99. package/.iflow/skills/stripe-best-practices/SKILL.md +42 -0
  100. package/.iflow/skills/stripe-best-practices/references/billing.md +36 -0
  101. package/.iflow/skills/stripe-best-practices/references/connect.md +48 -0
  102. package/.iflow/skills/stripe-best-practices/references/payments.md +79 -0
  103. package/.iflow/skills/stripe-best-practices/references/security.md +109 -0
  104. package/.iflow/skills/stripe-best-practices/references/treasury.md +16 -0
  105. package/.iflow/skills/stripe-projects/SKILL.md +139 -0
  106. package/.iflow/skills/upgrade-stripe/SKILL.md +185 -0
  107. package/.junie/skills/stripe-best-practices/SKILL.md +42 -0
  108. package/.junie/skills/stripe-best-practices/references/billing.md +36 -0
  109. package/.junie/skills/stripe-best-practices/references/connect.md +48 -0
  110. package/.junie/skills/stripe-best-practices/references/payments.md +79 -0
  111. package/.junie/skills/stripe-best-practices/references/security.md +109 -0
  112. package/.junie/skills/stripe-best-practices/references/treasury.md +16 -0
  113. package/.junie/skills/stripe-projects/SKILL.md +139 -0
  114. package/.junie/skills/upgrade-stripe/SKILL.md +185 -0
  115. package/.kilocode/skills/stripe-best-practices/SKILL.md +42 -0
  116. package/.kilocode/skills/stripe-best-practices/references/billing.md +36 -0
  117. package/.kilocode/skills/stripe-best-practices/references/connect.md +48 -0
  118. package/.kilocode/skills/stripe-best-practices/references/payments.md +79 -0
  119. package/.kilocode/skills/stripe-best-practices/references/security.md +109 -0
  120. package/.kilocode/skills/stripe-best-practices/references/treasury.md +16 -0
  121. package/.kilocode/skills/stripe-projects/SKILL.md +139 -0
  122. package/.kilocode/skills/upgrade-stripe/SKILL.md +185 -0
  123. package/.kiro/skills/stripe-best-practices/SKILL.md +42 -0
  124. package/.kiro/skills/stripe-best-practices/references/billing.md +36 -0
  125. package/.kiro/skills/stripe-best-practices/references/connect.md +48 -0
  126. package/.kiro/skills/stripe-best-practices/references/payments.md +79 -0
  127. package/.kiro/skills/stripe-best-practices/references/security.md +109 -0
  128. package/.kiro/skills/stripe-best-practices/references/treasury.md +16 -0
  129. package/.kiro/skills/stripe-projects/SKILL.md +139 -0
  130. package/.kiro/skills/upgrade-stripe/SKILL.md +185 -0
  131. package/.kode/skills/stripe-best-practices/SKILL.md +42 -0
  132. package/.kode/skills/stripe-best-practices/references/billing.md +36 -0
  133. package/.kode/skills/stripe-best-practices/references/connect.md +48 -0
  134. package/.kode/skills/stripe-best-practices/references/payments.md +79 -0
  135. package/.kode/skills/stripe-best-practices/references/security.md +109 -0
  136. package/.kode/skills/stripe-best-practices/references/treasury.md +16 -0
  137. package/.kode/skills/stripe-projects/SKILL.md +139 -0
  138. package/.kode/skills/upgrade-stripe/SKILL.md +185 -0
  139. package/.mcpjam/skills/stripe-best-practices/SKILL.md +42 -0
  140. package/.mcpjam/skills/stripe-best-practices/references/billing.md +36 -0
  141. package/.mcpjam/skills/stripe-best-practices/references/connect.md +48 -0
  142. package/.mcpjam/skills/stripe-best-practices/references/payments.md +79 -0
  143. package/.mcpjam/skills/stripe-best-practices/references/security.md +109 -0
  144. package/.mcpjam/skills/stripe-best-practices/references/treasury.md +16 -0
  145. package/.mcpjam/skills/stripe-projects/SKILL.md +139 -0
  146. package/.mcpjam/skills/upgrade-stripe/SKILL.md +185 -0
  147. package/.mux/skills/stripe-best-practices/SKILL.md +42 -0
  148. package/.mux/skills/stripe-best-practices/references/billing.md +36 -0
  149. package/.mux/skills/stripe-best-practices/references/connect.md +48 -0
  150. package/.mux/skills/stripe-best-practices/references/payments.md +79 -0
  151. package/.mux/skills/stripe-best-practices/references/security.md +109 -0
  152. package/.mux/skills/stripe-best-practices/references/treasury.md +16 -0
  153. package/.mux/skills/stripe-projects/SKILL.md +139 -0
  154. package/.mux/skills/upgrade-stripe/SKILL.md +185 -0
  155. package/.neovate/skills/stripe-best-practices/SKILL.md +42 -0
  156. package/.neovate/skills/stripe-best-practices/references/billing.md +36 -0
  157. package/.neovate/skills/stripe-best-practices/references/connect.md +48 -0
  158. package/.neovate/skills/stripe-best-practices/references/payments.md +79 -0
  159. package/.neovate/skills/stripe-best-practices/references/security.md +109 -0
  160. package/.neovate/skills/stripe-best-practices/references/treasury.md +16 -0
  161. package/.neovate/skills/stripe-projects/SKILL.md +139 -0
  162. package/.neovate/skills/upgrade-stripe/SKILL.md +185 -0
  163. package/.nixpacksignore +14 -0
  164. package/.openhands/skills/stripe-best-practices/SKILL.md +42 -0
  165. package/.openhands/skills/stripe-best-practices/references/billing.md +36 -0
  166. package/.openhands/skills/stripe-best-practices/references/connect.md +48 -0
  167. package/.openhands/skills/stripe-best-practices/references/payments.md +79 -0
  168. package/.openhands/skills/stripe-best-practices/references/security.md +109 -0
  169. package/.openhands/skills/stripe-best-practices/references/treasury.md +16 -0
  170. package/.openhands/skills/stripe-projects/SKILL.md +139 -0
  171. package/.openhands/skills/upgrade-stripe/SKILL.md +185 -0
  172. package/.pi/skills/stripe-best-practices/SKILL.md +42 -0
  173. package/.pi/skills/stripe-best-practices/references/billing.md +36 -0
  174. package/.pi/skills/stripe-best-practices/references/connect.md +48 -0
  175. package/.pi/skills/stripe-best-practices/references/payments.md +79 -0
  176. package/.pi/skills/stripe-best-practices/references/security.md +109 -0
  177. package/.pi/skills/stripe-best-practices/references/treasury.md +16 -0
  178. package/.pi/skills/stripe-projects/SKILL.md +139 -0
  179. package/.pi/skills/upgrade-stripe/SKILL.md +185 -0
  180. package/.pochi/skills/stripe-best-practices/SKILL.md +42 -0
  181. package/.pochi/skills/stripe-best-practices/references/billing.md +36 -0
  182. package/.pochi/skills/stripe-best-practices/references/connect.md +48 -0
  183. package/.pochi/skills/stripe-best-practices/references/payments.md +79 -0
  184. package/.pochi/skills/stripe-best-practices/references/security.md +109 -0
  185. package/.pochi/skills/stripe-best-practices/references/treasury.md +16 -0
  186. package/.pochi/skills/stripe-projects/SKILL.md +139 -0
  187. package/.pochi/skills/upgrade-stripe/SKILL.md +185 -0
  188. package/.qoder/skills/stripe-best-practices/SKILL.md +42 -0
  189. package/.qoder/skills/stripe-best-practices/references/billing.md +36 -0
  190. package/.qoder/skills/stripe-best-practices/references/connect.md +48 -0
  191. package/.qoder/skills/stripe-best-practices/references/payments.md +79 -0
  192. package/.qoder/skills/stripe-best-practices/references/security.md +109 -0
  193. package/.qoder/skills/stripe-best-practices/references/treasury.md +16 -0
  194. package/.qoder/skills/stripe-projects/SKILL.md +139 -0
  195. package/.qoder/skills/upgrade-stripe/SKILL.md +185 -0
  196. package/.qwen/skills/stripe-best-practices/SKILL.md +42 -0
  197. package/.qwen/skills/stripe-best-practices/references/billing.md +36 -0
  198. package/.qwen/skills/stripe-best-practices/references/connect.md +48 -0
  199. package/.qwen/skills/stripe-best-practices/references/payments.md +79 -0
  200. package/.qwen/skills/stripe-best-practices/references/security.md +109 -0
  201. package/.qwen/skills/stripe-best-practices/references/treasury.md +16 -0
  202. package/.qwen/skills/stripe-projects/SKILL.md +139 -0
  203. package/.qwen/skills/upgrade-stripe/SKILL.md +185 -0
  204. package/.roo/skills/stripe-best-practices/SKILL.md +42 -0
  205. package/.roo/skills/stripe-best-practices/references/billing.md +36 -0
  206. package/.roo/skills/stripe-best-practices/references/connect.md +48 -0
  207. package/.roo/skills/stripe-best-practices/references/payments.md +79 -0
  208. package/.roo/skills/stripe-best-practices/references/security.md +109 -0
  209. package/.roo/skills/stripe-best-practices/references/treasury.md +16 -0
  210. package/.roo/skills/stripe-projects/SKILL.md +139 -0
  211. package/.roo/skills/upgrade-stripe/SKILL.md +185 -0
  212. package/.trae/skills/stripe-best-practices/SKILL.md +42 -0
  213. package/.trae/skills/stripe-best-practices/references/billing.md +36 -0
  214. package/.trae/skills/stripe-best-practices/references/connect.md +48 -0
  215. package/.trae/skills/stripe-best-practices/references/payments.md +79 -0
  216. package/.trae/skills/stripe-best-practices/references/security.md +109 -0
  217. package/.trae/skills/stripe-best-practices/references/treasury.md +16 -0
  218. package/.trae/skills/stripe-projects/SKILL.md +139 -0
  219. package/.trae/skills/upgrade-stripe/SKILL.md +185 -0
  220. package/.vibe/skills/stripe-best-practices/SKILL.md +42 -0
  221. package/.vibe/skills/stripe-best-practices/references/billing.md +36 -0
  222. package/.vibe/skills/stripe-best-practices/references/connect.md +48 -0
  223. package/.vibe/skills/stripe-best-practices/references/payments.md +79 -0
  224. package/.vibe/skills/stripe-best-practices/references/security.md +109 -0
  225. package/.vibe/skills/stripe-best-practices/references/treasury.md +16 -0
  226. package/.vibe/skills/stripe-projects/SKILL.md +139 -0
  227. package/.vibe/skills/upgrade-stripe/SKILL.md +185 -0
  228. package/.windsurf/skills/stripe-best-practices/SKILL.md +42 -0
  229. package/.windsurf/skills/stripe-best-practices/references/billing.md +36 -0
  230. package/.windsurf/skills/stripe-best-practices/references/connect.md +48 -0
  231. package/.windsurf/skills/stripe-best-practices/references/payments.md +79 -0
  232. package/.windsurf/skills/stripe-best-practices/references/security.md +109 -0
  233. package/.windsurf/skills/stripe-best-practices/references/treasury.md +16 -0
  234. package/.windsurf/skills/stripe-projects/SKILL.md +139 -0
  235. package/.windsurf/skills/upgrade-stripe/SKILL.md +185 -0
  236. package/.zencoder/skills/stripe-best-practices/SKILL.md +42 -0
  237. package/.zencoder/skills/stripe-best-practices/references/billing.md +36 -0
  238. package/.zencoder/skills/stripe-best-practices/references/connect.md +48 -0
  239. package/.zencoder/skills/stripe-best-practices/references/payments.md +79 -0
  240. package/.zencoder/skills/stripe-best-practices/references/security.md +109 -0
  241. package/.zencoder/skills/stripe-best-practices/references/treasury.md +16 -0
  242. package/.zencoder/skills/stripe-projects/SKILL.md +139 -0
  243. package/.zencoder/skills/upgrade-stripe/SKILL.md +185 -0
  244. package/AUDIT.md +95 -0
  245. package/BLOCKERS.md +0 -0
  246. package/COOLIFY.md +51 -0
  247. package/MCP_SETUP.md +23 -0
  248. package/PRODUCTION_CHECKLIST.md +246 -0
  249. package/README.md +47 -0
  250. package/ROADMAP.md +91 -0
  251. package/docs/superpowers/plans/2026-05-11-availsync-frontend-sales-flow.md +2445 -0
  252. package/frontend/.env.example +2 -0
  253. package/frontend/app/admin/layout.tsx +13 -0
  254. package/frontend/app/admin/page.tsx +747 -0
  255. package/frontend/app/app/activity/page.tsx +257 -0
  256. package/frontend/app/app/agents/[agentId]/page.tsx +21 -0
  257. package/frontend/app/app/agents/page.tsx +1155 -0
  258. package/frontend/app/app/audit/page.tsx +225 -0
  259. package/frontend/app/app/availability/page.tsx +840 -0
  260. package/frontend/app/app/holds/page.tsx +262 -0
  261. package/frontend/app/app/layout.tsx +19 -0
  262. package/frontend/app/app/onboarding/page.tsx +10 -0
  263. package/frontend/app/app/onboarding/verify/page.tsx +309 -0
  264. package/frontend/app/app/page.tsx +508 -0
  265. package/frontend/app/app/settings/page.tsx +399 -0
  266. package/frontend/app/app/work/page.tsx +426 -0
  267. package/frontend/app/changelog/page.tsx +93 -0
  268. package/frontend/app/checkout/page.tsx +25 -0
  269. package/frontend/app/docs/api/page.tsx +157 -0
  270. package/frontend/app/docs/page.tsx +296 -0
  271. package/frontend/app/docs/pilot/page.tsx +127 -0
  272. package/frontend/app/docs/quickstart/page.tsx +318 -0
  273. package/frontend/app/docs/reliability/page.tsx +78 -0
  274. package/frontend/app/docs/sdk/node/page.tsx +166 -0
  275. package/frontend/app/globals.css +57 -0
  276. package/frontend/app/icon.png +0 -0
  277. package/frontend/app/layout.tsx +87 -0
  278. package/frontend/app/login/page.tsx +14 -0
  279. package/frontend/app/page.tsx +47 -0
  280. package/frontend/app/pricing/page.tsx +66 -0
  281. package/frontend/app/privacy/page.tsx +52 -0
  282. package/frontend/app/robots.ts +26 -0
  283. package/frontend/app/security/page.tsx +74 -0
  284. package/frontend/app/signup/page.tsx +14 -0
  285. package/frontend/app/sitemap.ts +14 -0
  286. package/frontend/app/terms/page.tsx +51 -0
  287. package/frontend/components/brand/AvailsyncLogo.tsx +56 -0
  288. package/frontend/components/checkout/CheckoutClient.tsx +100 -0
  289. package/frontend/components/dashboard/AgentForm.tsx +59 -0
  290. package/frontend/components/dashboard/AppShell.tsx +291 -0
  291. package/frontend/components/dashboard/AvailabilityChecker.tsx +117 -0
  292. package/frontend/components/dashboard/AvailabilityWindowForm.tsx +40 -0
  293. package/frontend/components/dashboard/HoldForm.tsx +133 -0
  294. package/frontend/components/dashboard/MetricCard.tsx +10 -0
  295. package/frontend/components/login/LoginForm.tsx +95 -0
  296. package/frontend/components/marketing/AgentCoordinationStory.tsx +1530 -0
  297. package/frontend/components/marketing/Faq.tsx +41 -0
  298. package/frontend/components/marketing/Hero.tsx +73 -0
  299. package/frontend/components/marketing/HowItWorks.tsx +28 -0
  300. package/frontend/components/marketing/ObserveModeTeaser.tsx +41 -0
  301. package/frontend/components/marketing/PricingTeaser.tsx +23 -0
  302. package/frontend/components/marketing/ProblemSolution.tsx +36 -0
  303. package/frontend/components/marketing/SiteFooter.tsx +59 -0
  304. package/frontend/components/marketing/SiteHeader.tsx +45 -0
  305. package/frontend/components/marketing/UseCases.tsx +27 -0
  306. package/frontend/components/onboarding/OnboardingClient.tsx +278 -0
  307. package/frontend/components/pricing/PricingCards.tsx +65 -0
  308. package/frontend/components/privacy/CookieConsent.tsx +230 -0
  309. package/frontend/components/privacy/CookieSettingsButton.tsx +15 -0
  310. package/frontend/components/seo/JsonLd.tsx +10 -0
  311. package/frontend/components/signup/SignupForm.tsx +55 -0
  312. package/frontend/components/ui/Badge.tsx +23 -0
  313. package/frontend/components/ui/Button.tsx +37 -0
  314. package/frontend/components/ui/Card.tsx +11 -0
  315. package/frontend/components/ui/ConfirmDialog.tsx +77 -0
  316. package/frontend/components/ui/EmptyState.tsx +24 -0
  317. package/frontend/components/ui/Input.tsx +14 -0
  318. package/frontend/components/ui/KeyDisplay.tsx +49 -0
  319. package/frontend/components/ui/Select.tsx +14 -0
  320. package/frontend/components/ui/Skeleton.tsx +24 -0
  321. package/frontend/components/ui/Tabs.tsx +19 -0
  322. package/frontend/components/ui/Textarea.tsx +14 -0
  323. package/frontend/components/ui/Toast.tsx +78 -0
  324. package/frontend/components/waitlist/WaitlistDialog.tsx +128 -0
  325. package/frontend/lib/api.ts +1282 -0
  326. package/frontend/lib/billing.ts +6 -0
  327. package/frontend/lib/cookieConsent.ts +113 -0
  328. package/frontend/lib/format.ts +16 -0
  329. package/frontend/lib/plans.ts +62 -0
  330. package/frontend/lib/schemas.ts +108 -0
  331. package/frontend/lib/seo.ts +376 -0
  332. package/frontend/lib/setupGuides.ts +630 -0
  333. package/frontend/lib/storage.ts +30 -0
  334. package/frontend/next-env.d.ts +6 -0
  335. package/frontend/next.config.mjs +13 -0
  336. package/frontend/package-lock.json +14409 -0
  337. package/frontend/package.json +41 -0
  338. package/frontend/playwright.config.ts +20 -0
  339. package/frontend/postcss.config.mjs +8 -0
  340. package/frontend/public/.gitkeep +0 -0
  341. package/frontend/public/brand/availsync-logo-board.png +0 -0
  342. package/frontend/public/brand/availsync-logo-dark.png +0 -0
  343. package/frontend/public/brand/availsync-mark-dark.png +0 -0
  344. package/frontend/public/brand/availsync-wordmark-dark.png +0 -0
  345. package/frontend/public/marketing/hero-agent-coordination.png +0 -0
  346. package/frontend/tailwind.config.ts +53 -0
  347. package/frontend/tests/smoke.spec.ts +89 -0
  348. package/frontend/tsconfig.json +23 -0
  349. package/jest.config.js +7 -0
  350. package/nixpacks.toml +11 -0
  351. package/package.json +53 -0
  352. package/packages/mcp/LICENSE +21 -0
  353. package/packages/mcp/README.md +60 -0
  354. package/packages/mcp/jest.config.cjs +8 -0
  355. package/packages/mcp/package.json +54 -0
  356. package/packages/mcp/src/helpers.ts +38 -0
  357. package/packages/mcp/src/index.test.ts +60 -0
  358. package/packages/mcp/src/index.ts +387 -0
  359. package/packages/mcp/tsconfig.json +20 -0
  360. package/packages/mcp/tsconfig.test.json +12 -0
  361. package/packages/node/LICENSE +21 -0
  362. package/packages/node/README.md +120 -0
  363. package/packages/node/jest.config.cjs +8 -0
  364. package/packages/node/package.json +46 -0
  365. package/packages/node/src/index.test.ts +360 -0
  366. package/packages/node/src/index.ts +402 -0
  367. package/packages/node/tsconfig.json +20 -0
  368. package/packages/node/tsconfig.test.json +12 -0
  369. package/plan.md +923 -0
  370. package/skills/stripe-best-practices/SKILL.md +42 -0
  371. package/skills/stripe-best-practices/references/billing.md +36 -0
  372. package/skills/stripe-best-practices/references/connect.md +48 -0
  373. package/skills/stripe-best-practices/references/payments.md +79 -0
  374. package/skills/stripe-best-practices/references/security.md +109 -0
  375. package/skills/stripe-best-practices/references/treasury.md +16 -0
  376. package/skills/stripe-projects/SKILL.md +139 -0
  377. package/skills/upgrade-stripe/SKILL.md +185 -0
  378. package/skills-lock.json +20 -0
  379. package/src/core/availability.ts +178 -0
  380. package/src/core/conflict.ts +209 -0
  381. package/src/core/work.ts +490 -0
  382. package/src/db/client.ts +17 -0
  383. package/src/db/migrations/001_init.sql +88 -0
  384. package/src/db/migrations/002_stripe.sql +2 -0
  385. package/src/db/migrations/003_workspace_auth.sql +19 -0
  386. package/src/db/migrations/004_agent_mcp_status.sql +2 -0
  387. package/src/db/migrations/005_hold_event_actor.sql +4 -0
  388. package/src/db/migrations/006_agent_activity.sql +35 -0
  389. package/src/db/migrations/007_work_coordination.sql +60 -0
  390. package/src/db/migrations/008_work_claim_leases.sql +20 -0
  391. package/src/db/migrations/009_billing_subscription_state.sql +23 -0
  392. package/src/db/migrations/010_agent_api_key_prefix.sql +10 -0
  393. package/src/db/migrations/011_org_verified_and_work_event_retention.sql +11 -0
  394. package/src/db/migrations/012_agent_enforcement_mode.sql +12 -0
  395. package/src/db/migrations/013_support_tickets.sql +21 -0
  396. package/src/db/migrations/014_paid_plan_waitlist.sql +23 -0
  397. package/src/db/migrations/015_agent_last_seen.sql +2 -0
  398. package/src/db/migrations.ts +164 -0
  399. package/src/db/run-migrations.ts +13 -0
  400. package/src/index.ts +183 -0
  401. package/src/lib/activity.ts +137 -0
  402. package/src/lib/apiKeys.ts +32 -0
  403. package/src/lib/appInfo.ts +26 -0
  404. package/src/lib/billingConfig.ts +3 -0
  405. package/src/lib/env.ts +75 -0
  406. package/src/lib/logger.ts +8 -0
  407. package/src/lib/plans.ts +204 -0
  408. package/src/mcp/server.js +5 -0
  409. package/src/mcp/server.ts +350 -0
  410. package/src/middleware/auth.ts +342 -0
  411. package/src/middleware/requestId.ts +16 -0
  412. package/src/routes/account.ts +168 -0
  413. package/src/routes/activity.ts +126 -0
  414. package/src/routes/admin.ts +514 -0
  415. package/src/routes/audit.ts +68 -0
  416. package/src/routes/auth.ts +203 -0
  417. package/src/routes/availability.ts +325 -0
  418. package/src/routes/billing.ts +406 -0
  419. package/src/routes/conflicts.ts +131 -0
  420. package/src/routes/holds.ts +437 -0
  421. package/src/routes/mcp.ts +57 -0
  422. package/src/routes/metrics.ts +39 -0
  423. package/src/routes/onboarding.ts +273 -0
  424. package/src/routes/orgs.ts +981 -0
  425. package/src/routes/preferences.ts +132 -0
  426. package/src/routes/session.ts +16 -0
  427. package/src/routes/support.ts +77 -0
  428. package/src/routes/value.ts +186 -0
  429. package/src/routes/waitlist.ts +63 -0
  430. package/src/routes/work.ts +1578 -0
  431. package/src/server.ts +36 -0
  432. package/src/types/index.ts +109 -0
  433. package/tests/integration/activity.route.test.ts +103 -0
  434. package/tests/integration/admin.route.test.ts +143 -0
  435. package/tests/integration/agent-keys.route.test.ts +237 -0
  436. package/tests/integration/availability.route.test.ts +125 -0
  437. package/tests/integration/billing.route.test.ts +393 -0
  438. package/tests/integration/conflicts.route.test.ts +131 -0
  439. package/tests/integration/flows.test.ts +154 -0
  440. package/tests/integration/helpers.ts +134 -0
  441. package/tests/integration/holds.route.test.ts +185 -0
  442. package/tests/integration/metrics.route.test.ts +100 -0
  443. package/tests/integration/onboarding.verify.route.test.ts +163 -0
  444. package/tests/integration/preferences.route.test.ts +53 -0
  445. package/tests/integration/session.route.test.ts +97 -0
  446. package/tests/integration/system.route.test.ts +92 -0
  447. package/tests/integration/value.route.test.ts +235 -0
  448. package/tests/integration/work.route.test.ts +745 -0
  449. package/tests/setup.ts +4 -0
  450. package/tests/smoke.sh +62 -0
  451. package/tests/unit/auth.test.ts +114 -0
  452. package/tests/unit/availability.test.ts +149 -0
  453. package/tests/unit/conflict.test.ts +118 -0
  454. package/tests/unit/env.test.ts +69 -0
  455. package/tests/unit/migrations.test.ts +135 -0
  456. package/tests/unit/request-id.test.ts +37 -0
  457. package/tmp-mobile-agents.png +0 -0
  458. package/tmp-next-mobile.err.log +10 -0
  459. package/tmp-next-mobile.log +5 -0
  460. package/tsconfig.json +16 -0
@@ -0,0 +1,387 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
+ import { fileURLToPath } from 'url';
6
+ import { z } from 'zod';
7
+ import { configuredAgentId, idempotencyHeaders, parseResponseBody, requireAgentId } from './helpers.js';
8
+
9
+ type JsonObject = Record<string, unknown>;
10
+
11
+ function printHelp(): void {
12
+ console.log(`Availsync MCP server
13
+
14
+ Environment:
15
+ AVAILSYNC_API_URL Base URL for Availsync, default https://availsync.dev
16
+ AVAILSYNC_AGENT_ID Default agent UUID shown in the Availsync dashboard
17
+ AVAILSYNC_API_KEY Agent API key, stored as a runtime secret
18
+
19
+ Tools:
20
+ check_availability Check available slots before booking
21
+ preview_conflict Preview who would win before booking
22
+ book_slot Reserve a slot
23
+ release_slot Release a booked hold
24
+ check_work_slot Check whether a coding agent can work on a repo/project
25
+ claim_work_slot Start a guarded repo/project run before a coding agent starts
26
+ extend_work_slot Extend a guarded run claim while the agent is still working
27
+ release_work_slot Finish a guarded run claim
28
+ diagnose_availsync_setup Check local MCP env setup without exposing secrets
29
+
30
+ Status:
31
+ The server sends a heartbeat to Availsync on startup and then every 60 seconds.
32
+
33
+ Production flow:
34
+ heartbeat -> check_work_slot -> claim_work_slot -> extend_work_slot while working -> release_work_slot
35
+
36
+ Notes:
37
+ Tool input agent_id is optional when AVAILSYNC_AGENT_ID is set.
38
+ claim_work_slot uses /v1/work/run/start, so observe-mode agents proceed and report shadow decisions.
39
+ `);
40
+ }
41
+
42
+ function getConfig(): { apiUrl: string; apiKey: string; agentId: string | null } {
43
+ const apiUrl = process.env.AVAILSYNC_API_URL || 'https://availsync.dev';
44
+ const apiKey = process.env.AVAILSYNC_API_KEY;
45
+
46
+ if (!apiKey) {
47
+ throw new Error('AVAILSYNC_API_KEY is required');
48
+ }
49
+
50
+ return { apiUrl: apiUrl.replace(/\/$/, ''), apiKey, agentId: configuredAgentId() };
51
+ }
52
+
53
+ async function requestAvailsync(
54
+ method: string,
55
+ path: string,
56
+ body?: JsonObject,
57
+ extraHeaders: Record<string, string> = {},
58
+ ): Promise<unknown> {
59
+ const { apiUrl, apiKey } = getConfig();
60
+ const response = await fetch(`${apiUrl}${path}`, {
61
+ method,
62
+ headers: {
63
+ Authorization: `Bearer ${apiKey}`,
64
+ 'Content-Type': 'application/json',
65
+ ...extraHeaders,
66
+ },
67
+ body: body ? JSON.stringify(body) : undefined,
68
+ });
69
+
70
+ const text = await response.text();
71
+ const payload = parseResponseBody(text, response);
72
+
73
+ if (!response.ok) {
74
+ return {
75
+ status: response.status,
76
+ error: payload,
77
+ };
78
+ }
79
+
80
+ return payload;
81
+ }
82
+
83
+ async function sendHeartbeat(): Promise<void> {
84
+ await requestAvailsync('POST', '/v1/mcp/heartbeat', {
85
+ client_name: 'availsync-mcp',
86
+ });
87
+ }
88
+
89
+ function jsonContent(payload: unknown) {
90
+ return {
91
+ content: [
92
+ {
93
+ type: 'text' as const,
94
+ text: JSON.stringify(payload, null, 2),
95
+ },
96
+ ],
97
+ };
98
+ }
99
+
100
+ const usageSchema = z
101
+ .object({
102
+ provider: z.string().optional(),
103
+ model: z.string().optional(),
104
+ input_tokens: z.number().int().min(0).optional(),
105
+ output_tokens: z.number().int().min(0).optional(),
106
+ total_tokens: z.number().int().min(0).optional(),
107
+ estimated_cost_usd: z.number().min(0).optional(),
108
+ })
109
+ .optional();
110
+
111
+ const optionalAgentIdSchema = z
112
+ .string()
113
+ .uuid()
114
+ .optional()
115
+ .describe('UUID of the agent. Optional when AVAILSYNC_AGENT_ID is set in the MCP server environment.');
116
+
117
+ async function reportUsage(activityType: string, usage?: z.infer<typeof usageSchema>): Promise<void> {
118
+ if (!usage) return;
119
+ await requestAvailsync('POST', '/v1/activity/usage', {
120
+ activity_type: activityType,
121
+ client_name: 'availsync-mcp',
122
+ ...usage,
123
+ });
124
+ }
125
+
126
+ function createServer(): McpServer {
127
+ const server = new McpServer({
128
+ name: 'availsync',
129
+ version: '0.1.0',
130
+ });
131
+
132
+ server.registerTool(
133
+ 'diagnose_availsync_setup',
134
+ {
135
+ description: 'Check local Availsync MCP environment setup without exposing API keys.',
136
+ inputSchema: {},
137
+ },
138
+ async () => jsonContent({
139
+ api_url: process.env.AVAILSYNC_API_URL || 'https://availsync.dev',
140
+ agent_id_configured: Boolean(configuredAgentId()),
141
+ api_key_configured: Boolean(process.env.AVAILSYNC_API_KEY),
142
+ notes: [
143
+ 'Set AVAILSYNC_AGENT_ID to avoid passing agent_id on every tool call.',
144
+ 'Set AVAILSYNC_API_KEY as a runtime secret. It is never returned by this diagnostic.',
145
+ ],
146
+ }),
147
+ );
148
+
149
+ server.registerTool(
150
+ 'check_availability',
151
+ {
152
+ description:
153
+ 'Check available time slots for an AI scheduling agent before booking. Always call this before book_slot.',
154
+ inputSchema: {
155
+ agent_id: optionalAgentIdSchema,
156
+ from: z.string().datetime().describe('Start of search window (ISO 8601 UTC)'),
157
+ to: z.string().datetime().describe('End of search window (ISO 8601 UTC)'),
158
+ duration_minutes: z.number().describe('Required meeting duration in minutes'),
159
+ usage: usageSchema,
160
+ },
161
+ },
162
+ async ({ agent_id, from, to, duration_minutes, usage }) => {
163
+ const query = new URLSearchParams({
164
+ agent_id: requireAgentId(agent_id),
165
+ from,
166
+ to,
167
+ duration_minutes: String(duration_minutes),
168
+ });
169
+ const result = await requestAvailsync('GET', `/v1/availability?${query.toString()}`);
170
+ await reportUsage('mcp_check_availability', usage);
171
+ return jsonContent(result);
172
+ },
173
+ );
174
+
175
+ server.registerTool(
176
+ 'preview_conflict',
177
+ {
178
+ description:
179
+ 'Preview whether a proposed slot would be available, win, or lose before booking. Call this after check_availability and before book_slot.',
180
+ inputSchema: {
181
+ agent_id: optionalAgentIdSchema,
182
+ start_at: z.string().datetime(),
183
+ end_at: z.string().datetime(),
184
+ reason: z.string().max(500).optional(),
185
+ usage: usageSchema,
186
+ },
187
+ },
188
+ async ({ agent_id, start_at, end_at, reason, usage }) => {
189
+ const result = await requestAvailsync('POST', '/v1/conflicts/check', {
190
+ agent_id: requireAgentId(agent_id),
191
+ start_at,
192
+ end_at,
193
+ ...(reason ? { reason } : {}),
194
+ });
195
+ await reportUsage('mcp_preview_conflict', usage);
196
+ return jsonContent(result);
197
+ },
198
+ );
199
+
200
+ server.registerTool(
201
+ 'book_slot',
202
+ {
203
+ description:
204
+ 'Reserve a time slot. Returns confirmed hold or 409 with alternative suggestions if slot is taken by higher-priority agent.',
205
+ inputSchema: {
206
+ agent_id: optionalAgentIdSchema,
207
+ start_at: z.string().datetime(),
208
+ end_at: z.string().datetime(),
209
+ reason: z.string().max(500).optional(),
210
+ usage: usageSchema,
211
+ },
212
+ },
213
+ async ({ agent_id, start_at, end_at, reason, usage }) => {
214
+ const result = await requestAvailsync('POST', '/v1/holds', {
215
+ agent_id: requireAgentId(agent_id),
216
+ start_at,
217
+ end_at,
218
+ ...(reason ? { reason } : {}),
219
+ });
220
+ await reportUsage('mcp_book_slot', usage);
221
+ return jsonContent(result);
222
+ },
223
+ );
224
+
225
+ server.registerTool(
226
+ 'release_slot',
227
+ {
228
+ description: 'Release a previously booked hold so other agents can use the time.',
229
+ inputSchema: {
230
+ hold_id: z.string().uuid(),
231
+ usage: usageSchema,
232
+ },
233
+ },
234
+ async ({ hold_id, usage }) => {
235
+ const result = await requestAvailsync('DELETE', `/v1/holds/${hold_id}`);
236
+ await reportUsage('mcp_release_slot', usage);
237
+ return jsonContent(result);
238
+ },
239
+ );
240
+
241
+ server.registerTool(
242
+ 'check_work_slot',
243
+ {
244
+ description:
245
+ 'Check whether a coding agent can work on a repo or project before it starts. If status is would_lose, skip the run.',
246
+ inputSchema: {
247
+ agent_id: optionalAgentIdSchema,
248
+ resource_type: z.enum(['repo', 'project']),
249
+ resource_key: z.string().min(1),
250
+ label: z.string().optional(),
251
+ start_at: z.string().datetime().optional(),
252
+ duration_minutes: z.number().int().min(1).max(240).optional(),
253
+ reason: z.string().max(500).optional(),
254
+ usage: usageSchema,
255
+ },
256
+ },
257
+ async ({ agent_id, resource_type, resource_key, label, start_at, duration_minutes, reason, usage }) => {
258
+ const result = await requestAvailsync('POST', '/v1/work/check', {
259
+ agent_id: requireAgentId(agent_id),
260
+ resource_type,
261
+ resource_key,
262
+ ...(label ? { label } : {}),
263
+ ...(start_at ? { start_at } : {}),
264
+ ...(duration_minutes ? { duration_minutes } : {}),
265
+ ...(reason ? { reason } : {}),
266
+ });
267
+ await reportUsage('mcp_check_work_slot', usage);
268
+ return jsonContent(result);
269
+ },
270
+ );
271
+
272
+ server.registerTool(
273
+ 'claim_work_slot',
274
+ {
275
+ description:
276
+ 'Start a guarded repo/project run before a coding agent starts. Returns proceed, skip_run, or observe-mode shadow details.',
277
+ inputSchema: {
278
+ agent_id: optionalAgentIdSchema,
279
+ resource_type: z.enum(['repo', 'project']),
280
+ resource_key: z.string().min(1),
281
+ label: z.string().optional(),
282
+ start_at: z.string().datetime().optional(),
283
+ duration_minutes: z.number().int().min(1).max(240).optional(),
284
+ reason: z.string().max(500).optional(),
285
+ idempotency_key: z.string().min(1).max(200).optional(),
286
+ usage: usageSchema,
287
+ },
288
+ },
289
+ async ({ agent_id, resource_type, resource_key, label, start_at, duration_minutes, reason, idempotency_key, usage }) => {
290
+ const result = await requestAvailsync(
291
+ 'POST',
292
+ '/v1/work/run/start',
293
+ {
294
+ agent_id: requireAgentId(agent_id),
295
+ resource_type,
296
+ resource_key,
297
+ ...(label ? { label } : {}),
298
+ ...(start_at ? { start_at } : {}),
299
+ ...(duration_minutes ? { duration_minutes } : {}),
300
+ ...(reason ? { reason } : {}),
301
+ client_name: 'availsync-mcp',
302
+ },
303
+ idempotencyHeaders(idempotency_key),
304
+ );
305
+ await reportUsage('mcp_claim_work_slot', usage);
306
+ return jsonContent(result);
307
+ },
308
+ );
309
+
310
+ server.registerTool(
311
+ 'extend_work_slot',
312
+ {
313
+ description:
314
+ 'Extend an active guarded run claim while a coding agent is still working. Call periodically before expires_at.',
315
+ inputSchema: {
316
+ claim_id: z.string().uuid(),
317
+ duration_minutes: z.number().int().min(1).max(120).optional(),
318
+ usage: usageSchema,
319
+ },
320
+ },
321
+ async ({ claim_id, duration_minutes, usage }) => {
322
+ const result = await requestAvailsync('POST', '/v1/work/run/extend', {
323
+ claim_id,
324
+ ...(duration_minutes ? { duration_minutes } : {}),
325
+ client_name: 'availsync-mcp',
326
+ });
327
+ await reportUsage('mcp_extend_work_slot', usage);
328
+ return jsonContent(result);
329
+ },
330
+ );
331
+
332
+ server.registerTool(
333
+ 'release_work_slot',
334
+ {
335
+ description: 'Finish a guarded repo/project run claim so another coding agent can work.',
336
+ inputSchema: {
337
+ claim_id: z.string().uuid(),
338
+ outcome: z.string().trim().min(1).max(100).optional(),
339
+ reason: z.string().trim().max(500).optional(),
340
+ usage: usageSchema,
341
+ },
342
+ },
343
+ async ({ claim_id, outcome, reason, usage }) => {
344
+ const result = await requestAvailsync('POST', '/v1/work/run/finish', {
345
+ claim_id,
346
+ outcome: outcome ?? 'finished',
347
+ ...(reason ? { reason } : {}),
348
+ client_name: 'availsync-mcp',
349
+ });
350
+ await reportUsage('mcp_release_work_slot', usage);
351
+ return jsonContent(result);
352
+ },
353
+ );
354
+
355
+ return server;
356
+ }
357
+
358
+ export async function main(): Promise<void> {
359
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
360
+ printHelp();
361
+ return;
362
+ }
363
+
364
+ const server = createServer();
365
+ const transport = new StdioServerTransport();
366
+ if (!process.env.AVAILSYNC_API_KEY) {
367
+ console.error('Availsync MCP warning: AVAILSYNC_API_KEY is not set. Tools will fail until it is configured.');
368
+ }
369
+ if (!configuredAgentId()) {
370
+ console.error('Availsync MCP warning: AVAILSYNC_AGENT_ID is not set. Pass agent_id in each tool call or configure the env var.');
371
+ }
372
+ void sendHeartbeat().catch(() => {});
373
+ const heartbeat = setInterval(() => {
374
+ void sendHeartbeat().catch(() => {});
375
+ }, 60_000);
376
+ heartbeat.unref?.();
377
+ await server.connect(transport);
378
+ }
379
+
380
+ const isDirectRun = process.argv[1] ? fileURLToPath(import.meta.url) === process.argv[1] : false;
381
+
382
+ if (isDirectRun) {
383
+ main().catch((error) => {
384
+ console.error('Server error:', error);
385
+ process.exit(1);
386
+ });
387
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022", "DOM"],
7
+ "types": ["node"],
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "declarationMap": true,
11
+ "outDir": "./dist",
12
+ "rootDir": "./src",
13
+ "strict": true,
14
+ "esModuleInterop": true,
15
+ "forceConsistentCasingInFileNames": true,
16
+ "skipLibCheck": true
17
+ },
18
+ "include": ["src/**/*.ts"],
19
+ "exclude": ["src/**/*.test.ts", "dist"]
20
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "CommonJS",
5
+ "moduleResolution": "Node",
6
+ "types": ["node", "jest"],
7
+ "declaration": false,
8
+ "declarationMap": false,
9
+ "sourceMap": false
10
+ },
11
+ "include": ["src/**/*.ts"]
12
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Availsync
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,120 @@
1
+ # @availsync/node
2
+
3
+ Node SDK for Availsync coding-agent work guardrails.
4
+
5
+ Use it before Codex, Claude, Cursor, OpenClaw, cron jobs, deploy scripts, or other automations touch a protected repo or project.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @availsync/node@alpha
11
+ ```
12
+
13
+ Use the explicit `@alpha` tag for pilots. The package is public, but the SDK API should be treated as prerelease until the first production pilots confirm the shape.
14
+
15
+ ## Environment
16
+
17
+ ```bash
18
+ AVAILSYNC_API_KEY=avs_live_...
19
+ AVAILSYNC_AGENT_ID=agent_uuid
20
+ AVAILSYNC_API_URL=https://availsync.dev
21
+ ```
22
+
23
+ ## Guard a coding-agent run
24
+
25
+ ```ts
26
+ import { createAvailsyncClient } from '@availsync/node';
27
+
28
+ const availsync = createAvailsyncClient({
29
+ apiKey: process.env.AVAILSYNC_API_KEY!,
30
+ agentId: process.env.AVAILSYNC_AGENT_ID!,
31
+ baseUrl: process.env.AVAILSYNC_API_URL,
32
+ timeoutMs: 30_000,
33
+ });
34
+
35
+ const result = await availsync.work.withClaim(
36
+ 'repo:owner/repo',
37
+ { reason: 'scheduled Codex run', durationMinutes: 45 },
38
+ async ({ claim, shadow }) => {
39
+ if (shadow.wouldHaveBlocked) {
40
+ console.warn('Observe-only: Availsync would have skipped this run.');
41
+ }
42
+
43
+ const extendTimer = claim
44
+ ? setInterval(() => claim.extend({ durationMinutes: 45 }).catch(console.error), 40 * 60_000)
45
+ : null;
46
+
47
+ try {
48
+ await doWork();
49
+ } finally {
50
+ if (extendTimer) clearInterval(extendTimer);
51
+ }
52
+ },
53
+ );
54
+
55
+ if (result.action === 'skip_run') {
56
+ console.log(result.reason);
57
+ }
58
+ ```
59
+
60
+ ## API surface
61
+
62
+ - `createAvailsyncClient({ apiKey, agentId, baseUrl?, timeoutMs? })`
63
+ - `client.work.withClaim(resource, options, fn)`
64
+ - `client.work.start({ resource, durationMinutes?, reason?, idempotencyKey?, metadata? })`
65
+ - `client.work.extend(claimId, { durationMinutes? })`
66
+ - `client.work.finish(claimId, { outcome?, reason?, metadata? })`
67
+
68
+ ## Manual flow
69
+
70
+ ```ts
71
+ const started = await availsync.work.start({
72
+ resource: 'repo:owner/repo',
73
+ reason: 'deploy automation',
74
+ durationMinutes: 45,
75
+ idempotencyKey: `deploy-${process.env.GITHUB_RUN_ID}`,
76
+ });
77
+
78
+ if (started.action === 'skip_run') {
79
+ console.log(started.reason);
80
+ process.exit(0);
81
+ }
82
+
83
+ if (started.shadow_mode && started.would_have_blocked) {
84
+ console.warn('Observe-only: Availsync would have skipped this run.');
85
+ }
86
+
87
+ const extendTimer = started.claim
88
+ ? setInterval(() => availsync.work.extend(started.claim!.id, { durationMinutes: 45 }).catch(console.error), 40 * 60_000)
89
+ : null;
90
+
91
+ try {
92
+ await doWork();
93
+ } finally {
94
+ if (extendTimer) clearInterval(extendTimer);
95
+ if (started.claim) {
96
+ await availsync.work.finish(started.claim.id, { outcome: 'finished' });
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## Observe-only pilots
102
+
103
+ Set an agent to Observe in the dashboard when you want Availsync to report what it would have blocked without stopping the automation. Observe mode returns `action: "proceed"` and `claim: null`; no lease is created, so `extend` and `finish` are no-ops you should skip.
104
+
105
+ ## Error handling
106
+
107
+ The SDK throws `AvailsyncError` for auth, validation, plan-limit, network, and unexpected API errors. The error includes `code`, `status`, and safe `details` from the API response. It never logs or exposes API keys.
108
+
109
+ ## Resource scope
110
+
111
+ - `repo:owner/repo` is the safe default. Only one active agent can work in the repo.
112
+ - `project:homepage` allows parallel work, but only use it for independent work streams.
113
+ - Availsync does not yet infer dependencies between different resources.
114
+
115
+ ## Local development
116
+
117
+ ```bash
118
+ npm run build:sdk
119
+ npm run test:sdk
120
+ ```
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'node',
4
+ testMatch: ['<rootDir>/src/**/*.test.ts'],
5
+ transform: {
6
+ '^.+\\.ts$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.test.json' }],
7
+ },
8
+ };
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@availsync/node",
3
+ "version": "0.1.0-alpha.3",
4
+ "description": "Node SDK for Availsync coding-agent work guardrails.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "homepage": "https://availsync.dev",
22
+ "keywords": [
23
+ "availsync",
24
+ "ai-agents",
25
+ "coding-agents",
26
+ "guardrails",
27
+ "mcp",
28
+ "automation",
29
+ "repo-locks"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "tag": "alpha"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.json",
40
+ "prepack": "npm run build",
41
+ "typecheck": "tsc -p tsconfig.json --noEmit",
42
+ "test": "jest --config jest.config.cjs --runInBand"
43
+ },
44
+ "dependencies": {},
45
+ "devDependencies": {}
46
+ }