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,360 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AvailsyncError,
|
|
3
|
+
createAvailsyncClient,
|
|
4
|
+
parseResource,
|
|
5
|
+
type FetchLike,
|
|
6
|
+
} from './index';
|
|
7
|
+
|
|
8
|
+
function jsonResponse(body: unknown, init: ResponseInit = {}) {
|
|
9
|
+
return new Response(JSON.stringify(body), {
|
|
10
|
+
status: init.status ?? 200,
|
|
11
|
+
headers: { 'content-type': 'application/json', ...(init.headers ?? {}) },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function makeFetch(responses: Array<Response | Error>) {
|
|
16
|
+
const calls: Array<{ url: string; init: RequestInit }> = [];
|
|
17
|
+
const fetchLike: FetchLike = async (url, init = {}) => {
|
|
18
|
+
calls.push({ url: String(url), init });
|
|
19
|
+
const next = responses.shift();
|
|
20
|
+
if (!next) throw new Error('No mocked response available');
|
|
21
|
+
if (next instanceof Error) throw next;
|
|
22
|
+
return next;
|
|
23
|
+
};
|
|
24
|
+
return { fetchLike, calls };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('@availsync/node', () => {
|
|
28
|
+
test('parses repo and project resource strings', () => {
|
|
29
|
+
expect(parseResource('repo:owner/repo')).toEqual({
|
|
30
|
+
resourceType: 'repo',
|
|
31
|
+
resourceKey: 'owner/repo',
|
|
32
|
+
});
|
|
33
|
+
expect(parseResource('project:homepage')).toEqual({
|
|
34
|
+
resourceType: 'project',
|
|
35
|
+
resourceKey: 'homepage',
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('rejects invalid resource strings before making requests', async () => {
|
|
40
|
+
const { fetchLike, calls } = makeFetch([]);
|
|
41
|
+
const client = createAvailsyncClient({
|
|
42
|
+
apiKey: 'avs_live_test_secret',
|
|
43
|
+
agentId: 'agent-1',
|
|
44
|
+
fetch: fetchLike,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
await expect(client.work.start({ resource: 'owner/repo' })).rejects.toMatchObject({
|
|
48
|
+
code: 'invalid_resource',
|
|
49
|
+
});
|
|
50
|
+
expect(calls).toHaveLength(0);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('start sends expected headers and work run payload', async () => {
|
|
54
|
+
const { fetchLike, calls } = makeFetch([
|
|
55
|
+
jsonResponse({
|
|
56
|
+
action: 'proceed',
|
|
57
|
+
claim: { id: 'claim-1', expires_at: '2026-05-13T10:45:00.000Z' },
|
|
58
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
59
|
+
reason: 'Work slot claimed',
|
|
60
|
+
}),
|
|
61
|
+
]);
|
|
62
|
+
const client = createAvailsyncClient({
|
|
63
|
+
apiKey: 'avs_live_test_secret',
|
|
64
|
+
agentId: 'agent-1',
|
|
65
|
+
baseUrl: 'https://availsync.test/',
|
|
66
|
+
fetch: fetchLike,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const result = await client.work.start({
|
|
70
|
+
resource: 'repo:owner/repo',
|
|
71
|
+
durationMinutes: 45,
|
|
72
|
+
reason: 'scheduled Codex run',
|
|
73
|
+
idempotencyKey: 'run-1',
|
|
74
|
+
metadata: { source: 'test' },
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(result.action).toBe('proceed');
|
|
78
|
+
expect(calls).toHaveLength(1);
|
|
79
|
+
expect(calls[0].url).toBe('https://availsync.test/v1/work/run/start');
|
|
80
|
+
expect(calls[0].init.method).toBe('POST');
|
|
81
|
+
expect(calls[0].init.headers).toMatchObject({
|
|
82
|
+
Authorization: 'Bearer avs_live_test_secret',
|
|
83
|
+
'Content-Type': 'application/json',
|
|
84
|
+
'Idempotency-Key': 'run-1',
|
|
85
|
+
});
|
|
86
|
+
expect(JSON.parse(String(calls[0].init.body))).toMatchObject({
|
|
87
|
+
agent_id: 'agent-1',
|
|
88
|
+
resource_type: 'repo',
|
|
89
|
+
resource_key: 'owner/repo',
|
|
90
|
+
duration_minutes: 45,
|
|
91
|
+
reason: 'scheduled Codex run',
|
|
92
|
+
client_name: '@availsync/node',
|
|
93
|
+
metadata: { source: 'test' },
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('withClaim does not run callback when start returns skip_run', async () => {
|
|
98
|
+
const { fetchLike, calls } = makeFetch([
|
|
99
|
+
jsonResponse({
|
|
100
|
+
action: 'skip_run',
|
|
101
|
+
reason: 'Another agent is already working',
|
|
102
|
+
retry_after: '2026-05-13T11:00:00.000Z',
|
|
103
|
+
blocking_claim: { id: 'claim-blocking' },
|
|
104
|
+
}),
|
|
105
|
+
]);
|
|
106
|
+
const client = createAvailsyncClient({
|
|
107
|
+
apiKey: 'avs_live_test_secret',
|
|
108
|
+
agentId: 'agent-1',
|
|
109
|
+
fetch: fetchLike,
|
|
110
|
+
});
|
|
111
|
+
const callback = jest.fn();
|
|
112
|
+
|
|
113
|
+
const result = await client.work.withClaim('repo:owner/repo', { reason: 'test' }, callback);
|
|
114
|
+
|
|
115
|
+
expect(result).toMatchObject({
|
|
116
|
+
action: 'skip_run',
|
|
117
|
+
reason: 'Another agent is already working',
|
|
118
|
+
blockingClaim: { id: 'claim-blocking' },
|
|
119
|
+
});
|
|
120
|
+
expect(callback).not.toHaveBeenCalled();
|
|
121
|
+
expect(calls).toHaveLength(1);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('withClaim runs callback on proceed and finishes claim afterwards', async () => {
|
|
125
|
+
const { fetchLike, calls } = makeFetch([
|
|
126
|
+
jsonResponse({
|
|
127
|
+
action: 'proceed',
|
|
128
|
+
claim: { id: 'claim-1', expires_at: '2026-05-13T10:45:00.000Z' },
|
|
129
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
130
|
+
}),
|
|
131
|
+
jsonResponse({
|
|
132
|
+
action: 'finished',
|
|
133
|
+
claim: { id: 'claim-1', status: 'released' },
|
|
134
|
+
}),
|
|
135
|
+
]);
|
|
136
|
+
const client = createAvailsyncClient({
|
|
137
|
+
apiKey: 'avs_live_test_secret',
|
|
138
|
+
agentId: 'agent-1',
|
|
139
|
+
fetch: fetchLike,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const result = await client.work.withClaim('repo:owner/repo', { reason: 'test' }, async () => 'done');
|
|
143
|
+
|
|
144
|
+
expect(result).toMatchObject({ action: 'proceed', result: 'done' });
|
|
145
|
+
expect(calls).toHaveLength(2);
|
|
146
|
+
expect(calls[1].url).toBe('https://availsync.dev/v1/work/run/finish');
|
|
147
|
+
expect(JSON.parse(String(calls[1].init.body))).toMatchObject({
|
|
148
|
+
claim_id: 'claim-1',
|
|
149
|
+
outcome: 'finished',
|
|
150
|
+
client_name: '@availsync/node',
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test('withClaim runs callback in observe mode without finishing a null claim', async () => {
|
|
155
|
+
const { fetchLike, calls } = makeFetch([
|
|
156
|
+
jsonResponse({
|
|
157
|
+
action: 'proceed',
|
|
158
|
+
claim: null,
|
|
159
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
160
|
+
reason: 'Observe-only mode lets the run proceed',
|
|
161
|
+
shadow_mode: true,
|
|
162
|
+
would_have_blocked: true,
|
|
163
|
+
shadow_decision: {
|
|
164
|
+
action: 'skip_run',
|
|
165
|
+
reason: 'Another agent is already working',
|
|
166
|
+
retry_after: '2026-05-13T11:00:00.000Z',
|
|
167
|
+
blocking_claim: { id: 'claim-blocking' },
|
|
168
|
+
rule_applied: 'priority',
|
|
169
|
+
},
|
|
170
|
+
}),
|
|
171
|
+
]);
|
|
172
|
+
const client = createAvailsyncClient({
|
|
173
|
+
apiKey: 'avs_live_test_secret',
|
|
174
|
+
agentId: 'agent-1',
|
|
175
|
+
fetch: fetchLike,
|
|
176
|
+
});
|
|
177
|
+
const callback = jest.fn(async ({ claim, shadow }) => {
|
|
178
|
+
expect(claim).toBeNull();
|
|
179
|
+
expect(shadow.wouldHaveBlocked).toBe(true);
|
|
180
|
+
return 'observed';
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const result = await client.work.withClaim('repo:owner/repo', { reason: 'test' }, callback);
|
|
184
|
+
|
|
185
|
+
expect(result).toMatchObject({
|
|
186
|
+
action: 'proceed',
|
|
187
|
+
claim: null,
|
|
188
|
+
result: 'observed',
|
|
189
|
+
shadowMode: true,
|
|
190
|
+
wouldHaveBlocked: true,
|
|
191
|
+
shadowDecision: {
|
|
192
|
+
action: 'skip_run',
|
|
193
|
+
blocking_claim: { id: 'claim-blocking' },
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
expect(callback).toHaveBeenCalledTimes(1);
|
|
197
|
+
expect(calls).toHaveLength(1);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
test('withClaim finishes claim after callback throws and rethrows original error', async () => {
|
|
201
|
+
const { fetchLike, calls } = makeFetch([
|
|
202
|
+
jsonResponse({
|
|
203
|
+
action: 'proceed',
|
|
204
|
+
claim: { id: 'claim-1', expires_at: '2026-05-13T10:45:00.000Z' },
|
|
205
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
206
|
+
}),
|
|
207
|
+
jsonResponse({
|
|
208
|
+
action: 'finished',
|
|
209
|
+
claim: { id: 'claim-1', status: 'released' },
|
|
210
|
+
}),
|
|
211
|
+
]);
|
|
212
|
+
const client = createAvailsyncClient({
|
|
213
|
+
apiKey: 'avs_live_test_secret',
|
|
214
|
+
agentId: 'agent-1',
|
|
215
|
+
fetch: fetchLike,
|
|
216
|
+
});
|
|
217
|
+
const original = new Error('agent failed');
|
|
218
|
+
|
|
219
|
+
await expect(
|
|
220
|
+
client.work.withClaim('repo:owner/repo', { reason: 'test' }, async () => {
|
|
221
|
+
throw original;
|
|
222
|
+
}),
|
|
223
|
+
).rejects.toBe(original);
|
|
224
|
+
expect(calls).toHaveLength(2);
|
|
225
|
+
expect(JSON.parse(String(calls[1].init.body))).toMatchObject({
|
|
226
|
+
claim_id: 'claim-1',
|
|
227
|
+
outcome: 'error',
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
test('withClaim does not mark successful work as error when finished cleanup fails', async () => {
|
|
232
|
+
const { fetchLike, calls } = makeFetch([
|
|
233
|
+
jsonResponse({
|
|
234
|
+
action: 'proceed',
|
|
235
|
+
claim: { id: 'claim-1', expires_at: '2026-05-13T10:45:00.000Z' },
|
|
236
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
237
|
+
}),
|
|
238
|
+
jsonResponse({ error: 'internal_error', message: 'finish failed' }, { status: 500 }),
|
|
239
|
+
]);
|
|
240
|
+
const client = createAvailsyncClient({
|
|
241
|
+
apiKey: 'avs_live_test_secret',
|
|
242
|
+
agentId: 'agent-1',
|
|
243
|
+
fetch: fetchLike,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
await expect(
|
|
247
|
+
client.work.withClaim('repo:owner/repo', { reason: 'test' }, async () => 'done'),
|
|
248
|
+
).rejects.toMatchObject({
|
|
249
|
+
code: 'internal_error',
|
|
250
|
+
status: 500,
|
|
251
|
+
});
|
|
252
|
+
expect(calls).toHaveLength(2);
|
|
253
|
+
expect(JSON.parse(String(calls[1].init.body))).toMatchObject({
|
|
254
|
+
claim_id: 'claim-1',
|
|
255
|
+
outcome: 'finished',
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test('withClaim preserves callback error when error cleanup also fails', async () => {
|
|
260
|
+
const { fetchLike, calls } = makeFetch([
|
|
261
|
+
jsonResponse({
|
|
262
|
+
action: 'proceed',
|
|
263
|
+
claim: { id: 'claim-1', expires_at: '2026-05-13T10:45:00.000Z' },
|
|
264
|
+
resource: { resource_type: 'repo', resource_key: 'owner/repo' },
|
|
265
|
+
}),
|
|
266
|
+
jsonResponse({ error: 'internal_error', message: 'finish failed' }, { status: 500 }),
|
|
267
|
+
]);
|
|
268
|
+
const client = createAvailsyncClient({
|
|
269
|
+
apiKey: 'avs_live_test_secret',
|
|
270
|
+
agentId: 'agent-1',
|
|
271
|
+
fetch: fetchLike,
|
|
272
|
+
});
|
|
273
|
+
const original = new Error('agent failed first');
|
|
274
|
+
|
|
275
|
+
await expect(
|
|
276
|
+
client.work.withClaim('repo:owner/repo', { reason: 'test' }, async () => {
|
|
277
|
+
throw original;
|
|
278
|
+
}),
|
|
279
|
+
).rejects.toBe(original);
|
|
280
|
+
expect(calls).toHaveLength(2);
|
|
281
|
+
expect(JSON.parse(String(calls[1].init.body))).toMatchObject({
|
|
282
|
+
claim_id: 'claim-1',
|
|
283
|
+
outcome: 'error',
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test('extend and finish map API responses', async () => {
|
|
288
|
+
const { fetchLike } = makeFetch([
|
|
289
|
+
jsonResponse({
|
|
290
|
+
action: 'extended',
|
|
291
|
+
claim: { id: 'claim-1', renewal_count: 1 },
|
|
292
|
+
expires_at: '2026-05-13T11:00:00.000Z',
|
|
293
|
+
}),
|
|
294
|
+
jsonResponse({
|
|
295
|
+
action: 'already_finished',
|
|
296
|
+
claim: { id: 'claim-1', status: 'released' },
|
|
297
|
+
}),
|
|
298
|
+
]);
|
|
299
|
+
const client = createAvailsyncClient({
|
|
300
|
+
apiKey: 'avs_live_test_secret',
|
|
301
|
+
agentId: 'agent-1',
|
|
302
|
+
fetch: fetchLike,
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
await expect(client.work.extend('claim-1', { durationMinutes: 30 })).resolves.toMatchObject({
|
|
306
|
+
action: 'extended',
|
|
307
|
+
claim: { id: 'claim-1' },
|
|
308
|
+
});
|
|
309
|
+
await expect(client.work.finish('claim-1')).resolves.toMatchObject({
|
|
310
|
+
action: 'already_finished',
|
|
311
|
+
claim: { id: 'claim-1' },
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
test('API and network failures become AvailsyncError without exposing secrets', async () => {
|
|
316
|
+
const api = createAvailsyncClient({
|
|
317
|
+
apiKey: 'secret-api-key',
|
|
318
|
+
agentId: 'agent-1',
|
|
319
|
+
fetch: makeFetch([
|
|
320
|
+
jsonResponse({ error: 'invalid_key', message: 'Invalid API key' }, { status: 401 }),
|
|
321
|
+
]).fetchLike,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
const apiError = await api.work.start({ resource: 'repo:owner/repo' }).catch((error) => error);
|
|
325
|
+
expect(apiError).toMatchObject({
|
|
326
|
+
name: 'AvailsyncError',
|
|
327
|
+
status: 401,
|
|
328
|
+
code: 'invalid_key',
|
|
329
|
+
});
|
|
330
|
+
expect(String(apiError.message)).not.toContain('secret-api-key');
|
|
331
|
+
|
|
332
|
+
const network = createAvailsyncClient({
|
|
333
|
+
apiKey: 'secret-api-key',
|
|
334
|
+
agentId: 'agent-1',
|
|
335
|
+
fetch: makeFetch([new Error('connect ECONNREFUSED')]).fetchLike,
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const networkError = await network.work.start({ resource: 'repo:owner/repo' }).catch((error) => error);
|
|
339
|
+
expect(networkError).toBeInstanceOf(AvailsyncError);
|
|
340
|
+
expect(String(networkError.message)).not.toContain('secret-api-key');
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
test('requests time out with a typed AvailsyncError', async () => {
|
|
344
|
+
const fetchLike: FetchLike = async (_url, init = {}) =>
|
|
345
|
+
new Promise((_resolve, reject) => {
|
|
346
|
+
init.signal?.addEventListener('abort', () => reject(new Error('aborted')), { once: true });
|
|
347
|
+
});
|
|
348
|
+
const client = createAvailsyncClient({
|
|
349
|
+
apiKey: 'secret-api-key',
|
|
350
|
+
agentId: 'agent-1',
|
|
351
|
+
timeoutMs: 1,
|
|
352
|
+
fetch: fetchLike,
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
await expect(client.work.start({ resource: 'repo:owner/repo' })).rejects.toMatchObject({
|
|
356
|
+
code: 'timeout',
|
|
357
|
+
status: null,
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
});
|