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.
- package/.adal/skills/stripe-best-practices/SKILL.md +42 -0
- package/.adal/skills/stripe-best-practices/references/billing.md +36 -0
- package/.adal/skills/stripe-best-practices/references/connect.md +48 -0
- package/.adal/skills/stripe-best-practices/references/payments.md +79 -0
- package/.adal/skills/stripe-best-practices/references/security.md +109 -0
- package/.adal/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.adal/skills/stripe-projects/SKILL.md +139 -0
- package/.adal/skills/upgrade-stripe/SKILL.md +185 -0
- package/.agents/skills/stripe-best-practices/SKILL.md +42 -0
- package/.agents/skills/stripe-best-practices/references/billing.md +36 -0
- package/.agents/skills/stripe-best-practices/references/connect.md +48 -0
- package/.agents/skills/stripe-best-practices/references/payments.md +79 -0
- package/.agents/skills/stripe-best-practices/references/security.md +109 -0
- package/.agents/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.agents/skills/stripe-projects/SKILL.md +139 -0
- package/.agents/skills/upgrade-stripe/SKILL.md +185 -0
- package/.augment/skills/stripe-best-practices/SKILL.md +42 -0
- package/.augment/skills/stripe-best-practices/references/billing.md +36 -0
- package/.augment/skills/stripe-best-practices/references/connect.md +48 -0
- package/.augment/skills/stripe-best-practices/references/payments.md +79 -0
- package/.augment/skills/stripe-best-practices/references/security.md +109 -0
- package/.augment/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.augment/skills/stripe-projects/SKILL.md +139 -0
- package/.augment/skills/upgrade-stripe/SKILL.md +185 -0
- package/.bob/skills/stripe-best-practices/SKILL.md +42 -0
- package/.bob/skills/stripe-best-practices/references/billing.md +36 -0
- package/.bob/skills/stripe-best-practices/references/connect.md +48 -0
- package/.bob/skills/stripe-best-practices/references/payments.md +79 -0
- package/.bob/skills/stripe-best-practices/references/security.md +109 -0
- package/.bob/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.bob/skills/stripe-projects/SKILL.md +139 -0
- package/.bob/skills/upgrade-stripe/SKILL.md +185 -0
- package/.claude/settings.local.json +7 -0
- package/.claude/skills/stripe-best-practices/SKILL.md +42 -0
- package/.claude/skills/stripe-best-practices/references/billing.md +36 -0
- package/.claude/skills/stripe-best-practices/references/connect.md +48 -0
- package/.claude/skills/stripe-best-practices/references/payments.md +79 -0
- package/.claude/skills/stripe-best-practices/references/security.md +109 -0
- package/.claude/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.claude/skills/stripe-projects/SKILL.md +139 -0
- package/.claude/skills/upgrade-stripe/SKILL.md +185 -0
- package/.codebuddy/skills/stripe-best-practices/SKILL.md +42 -0
- package/.codebuddy/skills/stripe-best-practices/references/billing.md +36 -0
- package/.codebuddy/skills/stripe-best-practices/references/connect.md +48 -0
- package/.codebuddy/skills/stripe-best-practices/references/payments.md +79 -0
- package/.codebuddy/skills/stripe-best-practices/references/security.md +109 -0
- package/.codebuddy/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.codebuddy/skills/stripe-projects/SKILL.md +139 -0
- package/.codebuddy/skills/upgrade-stripe/SKILL.md +185 -0
- package/.commandcode/skills/stripe-best-practices/SKILL.md +42 -0
- package/.commandcode/skills/stripe-best-practices/references/billing.md +36 -0
- package/.commandcode/skills/stripe-best-practices/references/connect.md +48 -0
- package/.commandcode/skills/stripe-best-practices/references/payments.md +79 -0
- package/.commandcode/skills/stripe-best-practices/references/security.md +109 -0
- package/.commandcode/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.commandcode/skills/stripe-projects/SKILL.md +139 -0
- package/.commandcode/skills/upgrade-stripe/SKILL.md +185 -0
- package/.continue/skills/stripe-best-practices/SKILL.md +42 -0
- package/.continue/skills/stripe-best-practices/references/billing.md +36 -0
- package/.continue/skills/stripe-best-practices/references/connect.md +48 -0
- package/.continue/skills/stripe-best-practices/references/payments.md +79 -0
- package/.continue/skills/stripe-best-practices/references/security.md +109 -0
- package/.continue/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.continue/skills/stripe-projects/SKILL.md +139 -0
- package/.continue/skills/upgrade-stripe/SKILL.md +185 -0
- package/.cortex/skills/stripe-best-practices/SKILL.md +42 -0
- package/.cortex/skills/stripe-best-practices/references/billing.md +36 -0
- package/.cortex/skills/stripe-best-practices/references/connect.md +48 -0
- package/.cortex/skills/stripe-best-practices/references/payments.md +79 -0
- package/.cortex/skills/stripe-best-practices/references/security.md +109 -0
- package/.cortex/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.cortex/skills/stripe-projects/SKILL.md +139 -0
- package/.cortex/skills/upgrade-stripe/SKILL.md +185 -0
- package/.crush/skills/stripe-best-practices/SKILL.md +42 -0
- package/.crush/skills/stripe-best-practices/references/billing.md +36 -0
- package/.crush/skills/stripe-best-practices/references/connect.md +48 -0
- package/.crush/skills/stripe-best-practices/references/payments.md +79 -0
- package/.crush/skills/stripe-best-practices/references/security.md +109 -0
- package/.crush/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.crush/skills/stripe-projects/SKILL.md +139 -0
- package/.crush/skills/upgrade-stripe/SKILL.md +185 -0
- package/.env.example +20 -0
- package/.factory/skills/stripe-best-practices/SKILL.md +42 -0
- package/.factory/skills/stripe-best-practices/references/billing.md +36 -0
- package/.factory/skills/stripe-best-practices/references/connect.md +48 -0
- package/.factory/skills/stripe-best-practices/references/payments.md +79 -0
- package/.factory/skills/stripe-best-practices/references/security.md +109 -0
- package/.factory/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.factory/skills/stripe-projects/SKILL.md +139 -0
- package/.factory/skills/upgrade-stripe/SKILL.md +185 -0
- package/.goose/skills/stripe-best-practices/SKILL.md +42 -0
- package/.goose/skills/stripe-best-practices/references/billing.md +36 -0
- package/.goose/skills/stripe-best-practices/references/connect.md +48 -0
- package/.goose/skills/stripe-best-practices/references/payments.md +79 -0
- package/.goose/skills/stripe-best-practices/references/security.md +109 -0
- package/.goose/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.goose/skills/stripe-projects/SKILL.md +139 -0
- package/.goose/skills/upgrade-stripe/SKILL.md +185 -0
- package/.iflow/skills/stripe-best-practices/SKILL.md +42 -0
- package/.iflow/skills/stripe-best-practices/references/billing.md +36 -0
- package/.iflow/skills/stripe-best-practices/references/connect.md +48 -0
- package/.iflow/skills/stripe-best-practices/references/payments.md +79 -0
- package/.iflow/skills/stripe-best-practices/references/security.md +109 -0
- package/.iflow/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.iflow/skills/stripe-projects/SKILL.md +139 -0
- package/.iflow/skills/upgrade-stripe/SKILL.md +185 -0
- package/.junie/skills/stripe-best-practices/SKILL.md +42 -0
- package/.junie/skills/stripe-best-practices/references/billing.md +36 -0
- package/.junie/skills/stripe-best-practices/references/connect.md +48 -0
- package/.junie/skills/stripe-best-practices/references/payments.md +79 -0
- package/.junie/skills/stripe-best-practices/references/security.md +109 -0
- package/.junie/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.junie/skills/stripe-projects/SKILL.md +139 -0
- package/.junie/skills/upgrade-stripe/SKILL.md +185 -0
- package/.kilocode/skills/stripe-best-practices/SKILL.md +42 -0
- package/.kilocode/skills/stripe-best-practices/references/billing.md +36 -0
- package/.kilocode/skills/stripe-best-practices/references/connect.md +48 -0
- package/.kilocode/skills/stripe-best-practices/references/payments.md +79 -0
- package/.kilocode/skills/stripe-best-practices/references/security.md +109 -0
- package/.kilocode/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.kilocode/skills/stripe-projects/SKILL.md +139 -0
- package/.kilocode/skills/upgrade-stripe/SKILL.md +185 -0
- package/.kiro/skills/stripe-best-practices/SKILL.md +42 -0
- package/.kiro/skills/stripe-best-practices/references/billing.md +36 -0
- package/.kiro/skills/stripe-best-practices/references/connect.md +48 -0
- package/.kiro/skills/stripe-best-practices/references/payments.md +79 -0
- package/.kiro/skills/stripe-best-practices/references/security.md +109 -0
- package/.kiro/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.kiro/skills/stripe-projects/SKILL.md +139 -0
- package/.kiro/skills/upgrade-stripe/SKILL.md +185 -0
- package/.kode/skills/stripe-best-practices/SKILL.md +42 -0
- package/.kode/skills/stripe-best-practices/references/billing.md +36 -0
- package/.kode/skills/stripe-best-practices/references/connect.md +48 -0
- package/.kode/skills/stripe-best-practices/references/payments.md +79 -0
- package/.kode/skills/stripe-best-practices/references/security.md +109 -0
- package/.kode/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.kode/skills/stripe-projects/SKILL.md +139 -0
- package/.kode/skills/upgrade-stripe/SKILL.md +185 -0
- package/.mcpjam/skills/stripe-best-practices/SKILL.md +42 -0
- package/.mcpjam/skills/stripe-best-practices/references/billing.md +36 -0
- package/.mcpjam/skills/stripe-best-practices/references/connect.md +48 -0
- package/.mcpjam/skills/stripe-best-practices/references/payments.md +79 -0
- package/.mcpjam/skills/stripe-best-practices/references/security.md +109 -0
- package/.mcpjam/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.mcpjam/skills/stripe-projects/SKILL.md +139 -0
- package/.mcpjam/skills/upgrade-stripe/SKILL.md +185 -0
- package/.mux/skills/stripe-best-practices/SKILL.md +42 -0
- package/.mux/skills/stripe-best-practices/references/billing.md +36 -0
- package/.mux/skills/stripe-best-practices/references/connect.md +48 -0
- package/.mux/skills/stripe-best-practices/references/payments.md +79 -0
- package/.mux/skills/stripe-best-practices/references/security.md +109 -0
- package/.mux/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.mux/skills/stripe-projects/SKILL.md +139 -0
- package/.mux/skills/upgrade-stripe/SKILL.md +185 -0
- package/.neovate/skills/stripe-best-practices/SKILL.md +42 -0
- package/.neovate/skills/stripe-best-practices/references/billing.md +36 -0
- package/.neovate/skills/stripe-best-practices/references/connect.md +48 -0
- package/.neovate/skills/stripe-best-practices/references/payments.md +79 -0
- package/.neovate/skills/stripe-best-practices/references/security.md +109 -0
- package/.neovate/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.neovate/skills/stripe-projects/SKILL.md +139 -0
- package/.neovate/skills/upgrade-stripe/SKILL.md +185 -0
- package/.nixpacksignore +14 -0
- package/.openhands/skills/stripe-best-practices/SKILL.md +42 -0
- package/.openhands/skills/stripe-best-practices/references/billing.md +36 -0
- package/.openhands/skills/stripe-best-practices/references/connect.md +48 -0
- package/.openhands/skills/stripe-best-practices/references/payments.md +79 -0
- package/.openhands/skills/stripe-best-practices/references/security.md +109 -0
- package/.openhands/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.openhands/skills/stripe-projects/SKILL.md +139 -0
- package/.openhands/skills/upgrade-stripe/SKILL.md +185 -0
- package/.pi/skills/stripe-best-practices/SKILL.md +42 -0
- package/.pi/skills/stripe-best-practices/references/billing.md +36 -0
- package/.pi/skills/stripe-best-practices/references/connect.md +48 -0
- package/.pi/skills/stripe-best-practices/references/payments.md +79 -0
- package/.pi/skills/stripe-best-practices/references/security.md +109 -0
- package/.pi/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.pi/skills/stripe-projects/SKILL.md +139 -0
- package/.pi/skills/upgrade-stripe/SKILL.md +185 -0
- package/.pochi/skills/stripe-best-practices/SKILL.md +42 -0
- package/.pochi/skills/stripe-best-practices/references/billing.md +36 -0
- package/.pochi/skills/stripe-best-practices/references/connect.md +48 -0
- package/.pochi/skills/stripe-best-practices/references/payments.md +79 -0
- package/.pochi/skills/stripe-best-practices/references/security.md +109 -0
- package/.pochi/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.pochi/skills/stripe-projects/SKILL.md +139 -0
- package/.pochi/skills/upgrade-stripe/SKILL.md +185 -0
- package/.qoder/skills/stripe-best-practices/SKILL.md +42 -0
- package/.qoder/skills/stripe-best-practices/references/billing.md +36 -0
- package/.qoder/skills/stripe-best-practices/references/connect.md +48 -0
- package/.qoder/skills/stripe-best-practices/references/payments.md +79 -0
- package/.qoder/skills/stripe-best-practices/references/security.md +109 -0
- package/.qoder/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.qoder/skills/stripe-projects/SKILL.md +139 -0
- package/.qoder/skills/upgrade-stripe/SKILL.md +185 -0
- package/.qwen/skills/stripe-best-practices/SKILL.md +42 -0
- package/.qwen/skills/stripe-best-practices/references/billing.md +36 -0
- package/.qwen/skills/stripe-best-practices/references/connect.md +48 -0
- package/.qwen/skills/stripe-best-practices/references/payments.md +79 -0
- package/.qwen/skills/stripe-best-practices/references/security.md +109 -0
- package/.qwen/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.qwen/skills/stripe-projects/SKILL.md +139 -0
- package/.qwen/skills/upgrade-stripe/SKILL.md +185 -0
- package/.roo/skills/stripe-best-practices/SKILL.md +42 -0
- package/.roo/skills/stripe-best-practices/references/billing.md +36 -0
- package/.roo/skills/stripe-best-practices/references/connect.md +48 -0
- package/.roo/skills/stripe-best-practices/references/payments.md +79 -0
- package/.roo/skills/stripe-best-practices/references/security.md +109 -0
- package/.roo/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.roo/skills/stripe-projects/SKILL.md +139 -0
- package/.roo/skills/upgrade-stripe/SKILL.md +185 -0
- package/.trae/skills/stripe-best-practices/SKILL.md +42 -0
- package/.trae/skills/stripe-best-practices/references/billing.md +36 -0
- package/.trae/skills/stripe-best-practices/references/connect.md +48 -0
- package/.trae/skills/stripe-best-practices/references/payments.md +79 -0
- package/.trae/skills/stripe-best-practices/references/security.md +109 -0
- package/.trae/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.trae/skills/stripe-projects/SKILL.md +139 -0
- package/.trae/skills/upgrade-stripe/SKILL.md +185 -0
- package/.vibe/skills/stripe-best-practices/SKILL.md +42 -0
- package/.vibe/skills/stripe-best-practices/references/billing.md +36 -0
- package/.vibe/skills/stripe-best-practices/references/connect.md +48 -0
- package/.vibe/skills/stripe-best-practices/references/payments.md +79 -0
- package/.vibe/skills/stripe-best-practices/references/security.md +109 -0
- package/.vibe/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.vibe/skills/stripe-projects/SKILL.md +139 -0
- package/.vibe/skills/upgrade-stripe/SKILL.md +185 -0
- package/.windsurf/skills/stripe-best-practices/SKILL.md +42 -0
- package/.windsurf/skills/stripe-best-practices/references/billing.md +36 -0
- package/.windsurf/skills/stripe-best-practices/references/connect.md +48 -0
- package/.windsurf/skills/stripe-best-practices/references/payments.md +79 -0
- package/.windsurf/skills/stripe-best-practices/references/security.md +109 -0
- package/.windsurf/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.windsurf/skills/stripe-projects/SKILL.md +139 -0
- package/.windsurf/skills/upgrade-stripe/SKILL.md +185 -0
- package/.zencoder/skills/stripe-best-practices/SKILL.md +42 -0
- package/.zencoder/skills/stripe-best-practices/references/billing.md +36 -0
- package/.zencoder/skills/stripe-best-practices/references/connect.md +48 -0
- package/.zencoder/skills/stripe-best-practices/references/payments.md +79 -0
- package/.zencoder/skills/stripe-best-practices/references/security.md +109 -0
- package/.zencoder/skills/stripe-best-practices/references/treasury.md +16 -0
- package/.zencoder/skills/stripe-projects/SKILL.md +139 -0
- package/.zencoder/skills/upgrade-stripe/SKILL.md +185 -0
- package/AUDIT.md +95 -0
- package/BLOCKERS.md +0 -0
- package/COOLIFY.md +51 -0
- package/MCP_SETUP.md +23 -0
- package/PRODUCTION_CHECKLIST.md +246 -0
- package/README.md +47 -0
- package/ROADMAP.md +91 -0
- package/docs/superpowers/plans/2026-05-11-availsync-frontend-sales-flow.md +2445 -0
- package/frontend/.env.example +2 -0
- package/frontend/app/admin/layout.tsx +13 -0
- package/frontend/app/admin/page.tsx +747 -0
- package/frontend/app/app/activity/page.tsx +257 -0
- package/frontend/app/app/agents/[agentId]/page.tsx +21 -0
- package/frontend/app/app/agents/page.tsx +1155 -0
- package/frontend/app/app/audit/page.tsx +225 -0
- package/frontend/app/app/availability/page.tsx +840 -0
- package/frontend/app/app/holds/page.tsx +262 -0
- package/frontend/app/app/layout.tsx +19 -0
- package/frontend/app/app/onboarding/page.tsx +10 -0
- package/frontend/app/app/onboarding/verify/page.tsx +309 -0
- package/frontend/app/app/page.tsx +508 -0
- package/frontend/app/app/settings/page.tsx +399 -0
- package/frontend/app/app/work/page.tsx +426 -0
- package/frontend/app/changelog/page.tsx +93 -0
- package/frontend/app/checkout/page.tsx +25 -0
- package/frontend/app/docs/api/page.tsx +157 -0
- package/frontend/app/docs/page.tsx +296 -0
- package/frontend/app/docs/pilot/page.tsx +127 -0
- package/frontend/app/docs/quickstart/page.tsx +318 -0
- package/frontend/app/docs/reliability/page.tsx +78 -0
- package/frontend/app/docs/sdk/node/page.tsx +166 -0
- package/frontend/app/globals.css +57 -0
- package/frontend/app/icon.png +0 -0
- package/frontend/app/layout.tsx +87 -0
- package/frontend/app/login/page.tsx +14 -0
- package/frontend/app/page.tsx +47 -0
- package/frontend/app/pricing/page.tsx +66 -0
- package/frontend/app/privacy/page.tsx +52 -0
- package/frontend/app/robots.ts +26 -0
- package/frontend/app/security/page.tsx +74 -0
- package/frontend/app/signup/page.tsx +14 -0
- package/frontend/app/sitemap.ts +14 -0
- package/frontend/app/terms/page.tsx +51 -0
- package/frontend/components/brand/AvailsyncLogo.tsx +56 -0
- package/frontend/components/checkout/CheckoutClient.tsx +100 -0
- package/frontend/components/dashboard/AgentForm.tsx +59 -0
- package/frontend/components/dashboard/AppShell.tsx +291 -0
- package/frontend/components/dashboard/AvailabilityChecker.tsx +117 -0
- package/frontend/components/dashboard/AvailabilityWindowForm.tsx +40 -0
- package/frontend/components/dashboard/HoldForm.tsx +133 -0
- package/frontend/components/dashboard/MetricCard.tsx +10 -0
- package/frontend/components/login/LoginForm.tsx +95 -0
- package/frontend/components/marketing/AgentCoordinationStory.tsx +1530 -0
- package/frontend/components/marketing/Faq.tsx +41 -0
- package/frontend/components/marketing/Hero.tsx +73 -0
- package/frontend/components/marketing/HowItWorks.tsx +28 -0
- package/frontend/components/marketing/ObserveModeTeaser.tsx +41 -0
- package/frontend/components/marketing/PricingTeaser.tsx +23 -0
- package/frontend/components/marketing/ProblemSolution.tsx +36 -0
- package/frontend/components/marketing/SiteFooter.tsx +59 -0
- package/frontend/components/marketing/SiteHeader.tsx +45 -0
- package/frontend/components/marketing/UseCases.tsx +27 -0
- package/frontend/components/onboarding/OnboardingClient.tsx +278 -0
- package/frontend/components/pricing/PricingCards.tsx +65 -0
- package/frontend/components/privacy/CookieConsent.tsx +230 -0
- package/frontend/components/privacy/CookieSettingsButton.tsx +15 -0
- package/frontend/components/seo/JsonLd.tsx +10 -0
- package/frontend/components/signup/SignupForm.tsx +55 -0
- package/frontend/components/ui/Badge.tsx +23 -0
- package/frontend/components/ui/Button.tsx +37 -0
- package/frontend/components/ui/Card.tsx +11 -0
- package/frontend/components/ui/ConfirmDialog.tsx +77 -0
- package/frontend/components/ui/EmptyState.tsx +24 -0
- package/frontend/components/ui/Input.tsx +14 -0
- package/frontend/components/ui/KeyDisplay.tsx +49 -0
- package/frontend/components/ui/Select.tsx +14 -0
- package/frontend/components/ui/Skeleton.tsx +24 -0
- package/frontend/components/ui/Tabs.tsx +19 -0
- package/frontend/components/ui/Textarea.tsx +14 -0
- package/frontend/components/ui/Toast.tsx +78 -0
- package/frontend/components/waitlist/WaitlistDialog.tsx +128 -0
- package/frontend/lib/api.ts +1282 -0
- package/frontend/lib/billing.ts +6 -0
- package/frontend/lib/cookieConsent.ts +113 -0
- package/frontend/lib/format.ts +16 -0
- package/frontend/lib/plans.ts +62 -0
- package/frontend/lib/schemas.ts +108 -0
- package/frontend/lib/seo.ts +376 -0
- package/frontend/lib/setupGuides.ts +630 -0
- package/frontend/lib/storage.ts +30 -0
- package/frontend/next-env.d.ts +6 -0
- package/frontend/next.config.mjs +13 -0
- package/frontend/package-lock.json +14409 -0
- package/frontend/package.json +41 -0
- package/frontend/playwright.config.ts +20 -0
- package/frontend/postcss.config.mjs +8 -0
- package/frontend/public/.gitkeep +0 -0
- package/frontend/public/brand/availsync-logo-board.png +0 -0
- package/frontend/public/brand/availsync-logo-dark.png +0 -0
- package/frontend/public/brand/availsync-mark-dark.png +0 -0
- package/frontend/public/brand/availsync-wordmark-dark.png +0 -0
- package/frontend/public/marketing/hero-agent-coordination.png +0 -0
- package/frontend/tailwind.config.ts +53 -0
- package/frontend/tests/smoke.spec.ts +89 -0
- package/frontend/tsconfig.json +23 -0
- package/jest.config.js +7 -0
- package/nixpacks.toml +11 -0
- package/package.json +53 -0
- package/packages/mcp/LICENSE +21 -0
- package/packages/mcp/README.md +60 -0
- package/packages/mcp/jest.config.cjs +8 -0
- package/packages/mcp/package.json +54 -0
- package/packages/mcp/src/helpers.ts +38 -0
- package/packages/mcp/src/index.test.ts +60 -0
- package/packages/mcp/src/index.ts +387 -0
- package/packages/mcp/tsconfig.json +20 -0
- package/packages/mcp/tsconfig.test.json +12 -0
- package/packages/node/LICENSE +21 -0
- package/packages/node/README.md +120 -0
- package/packages/node/jest.config.cjs +8 -0
- package/packages/node/package.json +46 -0
- package/packages/node/src/index.test.ts +360 -0
- package/packages/node/src/index.ts +402 -0
- package/packages/node/tsconfig.json +20 -0
- package/packages/node/tsconfig.test.json +12 -0
- package/plan.md +923 -0
- package/skills/stripe-best-practices/SKILL.md +42 -0
- package/skills/stripe-best-practices/references/billing.md +36 -0
- package/skills/stripe-best-practices/references/connect.md +48 -0
- package/skills/stripe-best-practices/references/payments.md +79 -0
- package/skills/stripe-best-practices/references/security.md +109 -0
- package/skills/stripe-best-practices/references/treasury.md +16 -0
- package/skills/stripe-projects/SKILL.md +139 -0
- package/skills/upgrade-stripe/SKILL.md +185 -0
- package/skills-lock.json +20 -0
- package/src/core/availability.ts +178 -0
- package/src/core/conflict.ts +209 -0
- package/src/core/work.ts +490 -0
- package/src/db/client.ts +17 -0
- package/src/db/migrations/001_init.sql +88 -0
- package/src/db/migrations/002_stripe.sql +2 -0
- package/src/db/migrations/003_workspace_auth.sql +19 -0
- package/src/db/migrations/004_agent_mcp_status.sql +2 -0
- package/src/db/migrations/005_hold_event_actor.sql +4 -0
- package/src/db/migrations/006_agent_activity.sql +35 -0
- package/src/db/migrations/007_work_coordination.sql +60 -0
- package/src/db/migrations/008_work_claim_leases.sql +20 -0
- package/src/db/migrations/009_billing_subscription_state.sql +23 -0
- package/src/db/migrations/010_agent_api_key_prefix.sql +10 -0
- package/src/db/migrations/011_org_verified_and_work_event_retention.sql +11 -0
- package/src/db/migrations/012_agent_enforcement_mode.sql +12 -0
- package/src/db/migrations/013_support_tickets.sql +21 -0
- package/src/db/migrations/014_paid_plan_waitlist.sql +23 -0
- package/src/db/migrations/015_agent_last_seen.sql +2 -0
- package/src/db/migrations.ts +164 -0
- package/src/db/run-migrations.ts +13 -0
- package/src/index.ts +183 -0
- package/src/lib/activity.ts +137 -0
- package/src/lib/apiKeys.ts +32 -0
- package/src/lib/appInfo.ts +26 -0
- package/src/lib/billingConfig.ts +3 -0
- package/src/lib/env.ts +75 -0
- package/src/lib/logger.ts +8 -0
- package/src/lib/plans.ts +204 -0
- package/src/mcp/server.js +5 -0
- package/src/mcp/server.ts +350 -0
- package/src/middleware/auth.ts +342 -0
- package/src/middleware/requestId.ts +16 -0
- package/src/routes/account.ts +168 -0
- package/src/routes/activity.ts +126 -0
- package/src/routes/admin.ts +514 -0
- package/src/routes/audit.ts +68 -0
- package/src/routes/auth.ts +203 -0
- package/src/routes/availability.ts +325 -0
- package/src/routes/billing.ts +406 -0
- package/src/routes/conflicts.ts +131 -0
- package/src/routes/holds.ts +437 -0
- package/src/routes/mcp.ts +57 -0
- package/src/routes/metrics.ts +39 -0
- package/src/routes/onboarding.ts +273 -0
- package/src/routes/orgs.ts +981 -0
- package/src/routes/preferences.ts +132 -0
- package/src/routes/session.ts +16 -0
- package/src/routes/support.ts +77 -0
- package/src/routes/value.ts +186 -0
- package/src/routes/waitlist.ts +63 -0
- package/src/routes/work.ts +1578 -0
- package/src/server.ts +36 -0
- package/src/types/index.ts +109 -0
- package/tests/integration/activity.route.test.ts +103 -0
- package/tests/integration/admin.route.test.ts +143 -0
- package/tests/integration/agent-keys.route.test.ts +237 -0
- package/tests/integration/availability.route.test.ts +125 -0
- package/tests/integration/billing.route.test.ts +393 -0
- package/tests/integration/conflicts.route.test.ts +131 -0
- package/tests/integration/flows.test.ts +154 -0
- package/tests/integration/helpers.ts +134 -0
- package/tests/integration/holds.route.test.ts +185 -0
- package/tests/integration/metrics.route.test.ts +100 -0
- package/tests/integration/onboarding.verify.route.test.ts +163 -0
- package/tests/integration/preferences.route.test.ts +53 -0
- package/tests/integration/session.route.test.ts +97 -0
- package/tests/integration/system.route.test.ts +92 -0
- package/tests/integration/value.route.test.ts +235 -0
- package/tests/integration/work.route.test.ts +745 -0
- package/tests/setup.ts +4 -0
- package/tests/smoke.sh +62 -0
- package/tests/unit/auth.test.ts +114 -0
- package/tests/unit/availability.test.ts +149 -0
- package/tests/unit/conflict.test.ts +118 -0
- package/tests/unit/env.test.ts +69 -0
- package/tests/unit/migrations.test.ts +135 -0
- package/tests/unit/request-id.test.ts +37 -0
- package/tmp-mobile-agents.png +0 -0
- package/tmp-next-mobile.err.log +10 -0
- package/tmp-next-mobile.log +5 -0
- 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,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,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
|
+
}
|