{"_id":"@axessai/sdk","_rev":"2-afaa35c472c3a000ab0871367bae0405","name":"@axessai/sdk","dist-tags":{"latest":"0.0.1"},"versions":{"1.0.0":{"name":"@axessai/sdk","version":"1.0.0","keywords":["axess","ai","sdk","events"],"author":{"name":"Axess AI"},"license":"ISC","_id":"@axessai/sdk@1.0.0","maintainers":[{"name":"tarekdemachkie","email":"tarek.demachkie@gmail.com"}],"homepage":"https://github.com/yourusername/axessai-wasp#readme","bugs":{"url":"https://github.com/yourusername/axessai-wasp/issues"},"dist":{"shasum":"8b12e78dd5f817173890f34363760ab274b25478","tarball":"https://registry.npmjs.org/@axessai/sdk/-/sdk-1.0.0.tgz","fileCount":12,"integrity":"sha512-JnWePjJQ4zKBrfT2/Y6B9JDVoMvSyOTngPDdaCRUgSiYPeMpzB0C248Iq6G1DyjclPp8bcwcIq74zNEOJkRVxQ==","signatures":[{"sig":"MEUCICeZHOpE0TqM6nCiRpf7Zrphp2MaD8LlhoG3f9vVppj4AiEAiHkr6YhZjbsurbuvt6XcDBPKW7ryc73aZa0QD4Q3B6Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75037},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"bcf72bccb7d644fbb80d8994cd3b69814e72cf4e","scripts":{"lint":"eslint \"src/**/*.{ts,js}\" || true","test":"jest","build":"tsc","prepare":"npm run build","publish":"npm publish","release":"npm run build && npm run test && npm publish","prebuild":"npm run sync-types","sync-types":"node scripts/sync-types.js","prepublishOnly":"npm run test"},"_npmUser":{"name":"tarekdemachkie","email":"tarek.demachkie@gmail.com"},"repository":{"url":"git+https://github.com/yourusername/axessai-wasp.git","type":"git"},"_npmVersion":"10.9.2","description":"SDK to integrate with Axess AI's event system","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.22.4","axios":"^1.6.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.56.0","ts-jest":"^29.3.1","typescript":"^5.3.3","@types/jest":"^29.5.14","@types/node":"^20.10.6","@jest/globals":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1743907204450_0.24960284358953433","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@axessai/sdk","version":"0.0.1","description":"SDK to integrate with Axess AI's event system","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"sync-types":"node scripts/sync-types.js","prebuild":"npm run sync-types","build":"tsc","prepare":"npm run build","test":"jest","lint":"eslint \"src/**/*.{ts,js}\" || true","prepublishOnly":"npm run test","publish":"npm publish","release":"npm run build && npm run test && npm publish"},"author":{"name":"Axess AI"},"license":"ISC","dependencies":{"axios":"^1.6.5","zod":"^3.22.4"},"devDependencies":{"@jest/globals":"^29.7.0","@types/jest":"^29.5.14","@types/node":"^20.10.6","eslint":"^8.56.0","jest":"^29.7.0","ts-jest":"^29.3.1","typescript":"^5.3.3"},"keywords":["axess","ai","sdk","events"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/yourusername/axessai-wasp.git"},"_id":"@axessai/sdk@0.0.1","gitHead":"bcf72bccb7d644fbb80d8994cd3b69814e72cf4e","bugs":{"url":"https://github.com/yourusername/axessai-wasp/issues"},"homepage":"https://github.com/yourusername/axessai-wasp#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-NaZVr34/SqTmHJlx4WHi4g4wKq8zt5Jpy/rBwcHWDRnYk9QDhRQOuBE9OnbibQvFdPtcpWC9h47YtnPS+bNLYA==","shasum":"d3afb4a39e5f84f0c326fb4a60fa00ae4d551140","tarball":"https://registry.npmjs.org/@axessai/sdk/-/sdk-0.0.1.tgz","fileCount":12,"unpackedSize":75037,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDZlpUTmaYE0THCtMlW5YRqGcWv2ucdilHM5hLjofDCVgIgBj6/VagJNctClRUPXNuuimmse26tCPkKwY6gXHd6f94="}]},"_npmUser":{"name":"tarekdemachkie","email":"tarek.demachkie@gmail.com"},"directories":{},"maintainers":[{"name":"tarekdemachkie","email":"tarek.demachkie@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.0.1_1743907345642_0.6941654853362329"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-06T02:40:04.389Z","modified":"2025-04-06T02:42:26.068Z","1.0.0":"2025-04-06T02:40:04.627Z","0.0.1":"2025-04-06T02:42:25.856Z"},"bugs":{"url":"https://github.com/yourusername/axessai-wasp/issues"},"author":{"name":"Axess AI"},"license":"ISC","homepage":"https://github.com/yourusername/axessai-wasp#readme","keywords":["axess","ai","sdk","events"],"repository":{"type":"git","url":"git+https://github.com/yourusername/axessai-wasp.git"},"description":"SDK to integrate with Axess AI's event system","maintainers":[{"name":"tarekdemachkie","email":"tarek.demachkie@gmail.com"}],"readme":"# Axess AI JavaScript SDK\n\nA JavaScript/TypeScript SDK for interacting with the Axess AI event system.\n\n## Installation\n\n```bash\nnpm install @axessai/sdk\n# or\nyarn add @axessai/sdk\n```\n\n## Usage\n\n### Initialize the SDK\n\n```typescript\nimport { AxessSDK } from \"@axessai/sdk\";\n\n// Initialize with required API key\nconst axess = new AxessSDK({\n  apiKey: \"your-api-key\",\n  // Optional configuration\n  apiUrl: \"https://custom-api-url.com\", // Custom API URL if needed\n  timeout: 15000, // Custom timeout in milliseconds\n});\n```\n\nOr use the factory function:\n\n```typescript\nimport { createAxessSDK } from \"@axessai/sdk\";\n\nconst axess = createAxessSDK({\n  apiKey: \"your-api-key\",\n});\n```\n\n### Sending Events\n\nSend events to your Axess AI system:\n\n```typescript\n// Send a task:start event\nawait axess.sendEvent(\"task:start\", {\n  agentId: \"agent-123\", // The agentId is required in every event\n  taskId: \"task-456\",\n  title: \"Process document\",\n  description: \"Extract information from the uploaded document\",\n  input: {\n    prompt: \"Extract the main topics from this document\",\n    artifacts: [\n      {\n        id: \"doc-1\",\n        type: \"document\",\n        url: \"https://example.com/document.pdf\",\n        name: \"Financial Report.pdf\",\n      },\n    ],\n  },\n});\n\n// Send a task:complete event\nawait axess.sendEvent(\"task:complete\", {\n  agentId: \"agent-123\", // The agentId is required in every event\n  taskId: \"task-456\",\n  output: {\n    response: \"Document processing complete. Found 3 main topics.\",\n    artifacts: [\n      {\n        id: \"result-1\",\n        type: \"json\",\n        url: \"https://example.com/results.json\",\n        name: \"extraction_results.json\",\n      },\n    ],\n  },\n  tokenUsage: {\n    totalTokens: 1500,\n    promptTokens: 500,\n    completionTokens: 1000,\n  },\n});\n```\n\n### TypeScript Support\n\nThe SDK includes full TypeScript support with type definitions for all event types:\n\n```typescript\nimport { AgentEventName, AgentEventSchemaType } from \"@axessai/sdk\";\n\n// Type-safe event data\nfunction processEvent<T extends AgentEventName>(\n  eventName: T,\n  data: AgentEventSchemaType<T>\n) {\n  // Process event...\n}\n```\n\n### Get Available Event Types\n\n```typescript\n// Get all available event types\nconst eventTypes = axess.getEventTypes();\nconsole.log(eventTypes);\n// ['task:queued', 'task:start', 'task:complete', ...]\n```\n\n## Error Handling\n\nThe SDK will validate events before sending them and throw errors for invalid events:\n\n```typescript\ntry {\n  await axess.sendEvent(\"task:start\", {\n    /* ... */\n  });\n} catch (error) {\n  console.error(\"Failed to send event:\", error.message);\n}\n```\n\n## Type Synchronization\n\nThis SDK automatically synchronizes event type definitions from the main Axess AI application. This ensures that:\n\n1. The SDK and the main application always use the same event types\n2. When new event types are added to the main application, they are automatically available in the SDK\n\nFor developers working on the SDK:\n\n- Event types are defined in `src/generated/` directory\n- These files are automatically generated and should not be edited directly\n- To update types, run `npm run sync-types` or build the SDK with `npm run build`\n- Generated files are excluded from Git to avoid merge conflicts\n\n## API Reference\n\n### AxessSDK Class\n\n#### Constructor\n\n- `constructor(options: AxessSDKOptions)` - Create a new SDK instance\n\n#### Methods\n\n- `sendEvent<T extends AgentEventName>(eventName: T, eventData: AgentEventSchemaType<T>, options?: SendEventOptions): Promise<any>` - Send an event\n- `getEventTypes(): AgentEventName[]` - Get all available event types\n\n### Events\n\nThe SDK supports the following events:\n\n- Task Events: `task:queued`, `task:start`, `task:complete`, `task:failure`, `task:feedback`\n- Action Events: `task:action:queued`, `task:action:start`, `task:action:complete`, `task:action:failure`\n- Intervention Events: `task:action:intervention:requested`, `task:action:intervention:start`, `task:action:intervention:complete`\n- Escalation Events: `task:action:escalation:requested`, `task:action:escalation:start`, `task:action:escalation:handled`\n\n## License\n\nISC\n","readmeFilename":"README.md"}