{"_id":"@ai-operations/ops-connectors","name":"@ai-operations/ops-connectors","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ai-operations/ops-connectors","version":"0.1.0","description":"Connector SDK for AI Operations OS — Gmail, Calendar, X/Twitter, Shopify with resilient fetch and retry","private":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","clean":"rm -rf dist"},"dependencies":{"@ai-operations/shared-types":"*"},"devDependencies":{"typescript":"^5.7.0"},"repository":{"type":"git","url":"git+https://github.com/zanderone1980/ai-operations-os.git","directory":"packages/ops-connectors"},"bugs":{"url":"https://github.com/zanderone1980/ai-operations-os/issues"},"author":{"name":"Alex Pinkevich","email":"alex@zanderpinkdesign.com"},"license":"MIT","publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"keywords":["ai-ops","ai-agents","workflow","automation","safety"],"_id":"@ai-operations/ops-connectors@0.1.0","gitHead":"5479e60c372e0d4d5269e3fd1f87915563e9a87d","homepage":"https://github.com/zanderone1980/ai-operations-os#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-GFWt50o7OfvIWIwX9z7lLU/nbBMLBJRk8/eYy2DGpX9j1nMWqjkJ6VdEoDmb6mlN6yJFEcbNhJaJnK22rGdV3A==","shasum":"a76fa9ea036becfbf5b395729666c6c1180d3403","tarball":"https://registry.npmjs.org/@ai-operations/ops-connectors/-/ops-connectors-0.1.0.tgz","fileCount":58,"unpackedSize":279223,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIES1Oz7b7pehTQAvfdhsbn51ikjEg/AZta0Wpa9SgTSsAiEA26C6QH8zonGfuXgj02euFdb8UQzSRGv/Fshsp3MS6uQ="}]},"_npmUser":{"name":"alexpinkone","email":"pinkevich1980@gmail.com"},"directories":{},"maintainers":[{"name":"alexpinkone","email":"pinkevich1980@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ops-connectors_0.1.0_1773153571363_0.37986344322715815"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-10T14:39:31.239Z","0.1.0":"2026-03-10T14:39:31.493Z","modified":"2026-03-10T14:39:31.752Z"},"maintainers":[{"name":"alexpinkone","email":"pinkevich1980@gmail.com"}],"description":"Connector SDK for AI Operations OS — Gmail, Calendar, X/Twitter, Shopify with resilient fetch and retry","homepage":"https://github.com/zanderone1980/ai-operations-os#readme","keywords":["ai-ops","ai-agents","workflow","automation","safety"],"repository":{"type":"git","url":"git+https://github.com/zanderone1980/ai-operations-os.git","directory":"packages/ops-connectors"},"author":{"name":"Alex Pinkevich","email":"alex@zanderpinkdesign.com"},"bugs":{"url":"https://github.com/zanderone1980/ai-operations-os/issues"},"license":"MIT","readme":"# @ai-operations/ops-connectors\n\n> Connector framework with Gmail, Calendar, X/Twitter, and Shopify integrations for AI Operations OS.\n\nPart of [AI Operations OS](https://github.com/zanderone1980/ai-operations-os) — autonomous business workflow orchestration with safety enforcement.\n\n## Install\n\n```\nnpm install @ai-operations/ops-connectors\n```\n\n## Quick Start\n\n```ts\nimport { ConnectorRegistry, GmailConnector, resilientFetch, RateLimiter } from '@ai-operations/ops-connectors';\n\nconst registry = new ConnectorRegistry();\nregistry.register(new GmailConnector({ name: 'gmail', enabled: true, credentials: { token: '...' } }));\n\nconst gmail = registry.get('gmail');\nconst result = await gmail.execute('send', { to: 'user@example.com', body: 'Hello!' });\n```\n\n## API\n\n### `BaseConnector` (abstract)\n\nAbstract base class for all connectors. Subclasses implement `supportedOperations`, `execute`, and `healthCheck`.\n\n```ts\nabstract get supportedOperations(): string[]\nabstract execute(operation: string, input: Record<string, unknown>): Promise<ConnectorResult>\nabstract healthCheck(): Promise<boolean>\nsupportsOperation(operation: string): boolean\nisEnabled(): boolean\n```\n\n- `ConnectorConfig` — `{ name: string; enabled: boolean; credentials?: Record<string, string> }`\n- `ConnectorResult` — `{ success: boolean; data?: Record<string, unknown>; error?: string }`\n\n### Connector Implementations\n\n| Connector | Class | Operations |\n|-----------|-------|-----------|\n| Gmail | `GmailConnector` | send, read, list, search |\n| Google Calendar | `CalendarConnector` | create_event, update_event, cancel_event, list |\n| X / Twitter | `XTwitterConnector` | post, delete, search |\n| Shopify | `ShopifyConnector` | fulfill, refund, list, get |\n\n### `ConnectorRegistry`\n\nCentral registry for managing connector instances with bulk health checks.\n\n```ts\nregister(connector: BaseConnector): void\nget(name: string): BaseConnector | undefined\nlist(): BaseConnector[]\nhealthCheckAll(): Promise<Map<string, boolean>>\n```\n\n### `resilientFetch(url, init?, options?): Promise<FetchAttemptResult>`\n\nRetry-aware HTTP client with exponential backoff, 429 Retry-After support, request timeouts, and jitter.\n\n```ts\nconst { response, attempts, totalDurationMs } = await resilientFetch(\n  'https://api.example.com/data',\n  { method: 'GET', headers: { Authorization: 'Bearer token' } },\n  { maxRetries: 3, timeoutMs: 10000 },\n);\n```\n\n- `ResilientFetchOptions` — `{ maxRetries?, initialDelayMs?, maxDelayMs?, timeoutMs?, retryableStatuses? }`\n\n### `RateLimiter`\n\nSliding-window rate limiter for per-connector request throttling.\n\n```ts\nconst limiter = new RateLimiter({ maxRequests: 100, windowMs: 60000 });\nif (limiter.canProceed()) {\n  limiter.record();\n  await fetch(...);\n}\nawait limiter.waitAndRecord(); // Block until a slot opens\n```\n\n## Related Packages\n\n- [`@ai-operations/shared-types`](../shared-types) — Core types consumed by connectors\n- [`@ai-operations/ops-core`](../ops-core) — WorkflowEngine that executes connector operations\n- [`@ai-operations/cord-adapter`](../cord-adapter) — Safety gate evaluated before connector execution\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-aa7db111dbbd39e36b3c87ef74da585c"}