{"_id":"@atisse/core","_rev":"3-056d17e7fa731340b7940a4326b4052f","name":"@atisse/core","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@atisse/core","version":"1.0.0","_id":"@atisse/core@1.0.0","maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"dist":{"shasum":"690f61905f850dcd06af801b54954c5d08df81ef","tarball":"https://registry.npmjs.org/@atisse/core/-/core-1.0.0.tgz","fileCount":11,"integrity":"sha512-LHwcETEBeIb/Vz3OnDnQYvrOUYZ7BB7RbkRGLupsu9p9fNjv2T7nr7U8ZebKKOVOsZvczrwsewELNKyjIeI7bw==","signatures":[{"sig":"MEUCIBq+S9f5LguXjQAAIIDOM977YhEO4LydxEJcoyhEozKWAiEA2L5GY5A68Widw2WVr/AHOD2Gse6qXXNBq2cABDzar/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":193961},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./testing":{"types":"./dist/testing/mock-provider.d.ts","import":"./dist/testing/mock-provider.js","require":"./dist/testing/mock-provider.cjs"}},"gitHead":"766fc1f9364cd3ca6750ca4c1dc4110f5b613b73","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"_npmVersion":"11.17.0","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^4.4.3"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.5.0","devDependencies":{"vitest":"^4.1.8","@types/node":"^25.9.3"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0_1781528298965_0.7902902505516862","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@atisse/core","version":"1.0.1","keywords":["llm","ai","orchestration","execution-kernel","lifecycle","state-machine","typescript","provider"],"author":"Abdulkadir Karadas(saferias)","license":"MIT","_id":"@atisse/core@1.0.1","maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"homepage":"https://github.com/abdulkadirkaradas/atisse#readme","bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"dist":{"shasum":"58dbba7a27f687e4a6da0e05a0ce32fa885e11ff","tarball":"https://registry.npmjs.org/@atisse/core/-/core-1.0.1.tgz","fileCount":13,"integrity":"sha512-qlZtHKHjAHEjUdxzUXGdXoOqVAsgAKOrFgiFWZob+5QIKIAcimdvxOGeiS2K/SZMrbhHmcA/OxMLz+WQ53X/iQ==","signatures":[{"sig":"MEYCIQDtoO1/c7dvgoxRwajm1rzoC2ggE3IGCNxChxSWlfU8jwIhANM9z0GujSE1tKru9sDv96O2ysjtvZ0NKG07wcEDiXEI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206557},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./testing":{"types":"./dist/testing/mock-provider.d.ts","import":"./dist/testing/mock-provider.js","require":"./dist/testing/mock-provider.cjs"}},"scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"repository":{"url":"git+https://github.com/abdulkadirkaradas/atisse.git","type":"git","directory":"packages/core"},"directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^4.4.3"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","@types/node":"^25.9.3"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.1_1781790861799_0.19239135346783365","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"_id":"@atisse/core@1.1.0","bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"dist":{"shasum":"53f0bed390c859d632e46613df5ead88a081346d","tarball":"https://registry.npmjs.org/@atisse/core/-/core-1.1.0.tgz","fileCount":13,"integrity":"sha512-WykJQwSAu5C6dG+KEzAVm9coRXZPriQjNawvKimVNAHauMTL7K1fyJ29ZsMRfpNiJHayWz20Cxd15j9DOWcEog==","signatures":[{"sig":"MEUCIQD8tBsOrt8Dlhnz31Yf93gpcPaiLcFR/8n7BfgrFVJk4AIgIU2nqRnwm64IcLw4bKF6XzjvcjsTsreH6It7w7Jx2OA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID9k21excKm9LqXAqpq3nDAZdohs+RxMcjWqMQtuDJ5XAiAh8IrKBFiTWmQoJfundOf10A60+wMu1GAjmdfwu45qhQ=="}],"unpackedSize":214567},"main":"./dist/index.js","name":"@atisse/core","type":"module","types":"./dist/index.d.ts","author":"Abdulkadir Karadas(saferias)","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./testing":{"types":"./dist/testing/mock-provider.d.ts","import":"./dist/testing/mock-provider.js","require":"./dist/testing/mock-provider.cjs"}},"license":"MIT","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"version":"1.1.0","_npmUser":{"name":"softendo","email":"kadirkaradas5@gmail.com"},"homepage":"https://github.com/abdulkadirkaradas/atisse#readme","keywords":["llm","ai","orchestration","execution-kernel","lifecycle","state-machine","typescript","provider"],"repository":{"url":"git+https://github.com/abdulkadirkaradas/atisse.git","type":"git","directory":"packages/core"},"directories":{},"maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"_nodeVersion":"24.19.0","dependencies":{"zod":"^4.6.2"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^5.0.0","@types/node":"^26.5.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.1.0_1789407444179_0.12331046050430339"}}},"time":{"created":"2026-06-15T12:58:18.835Z","modified":"2026-09-14T17:37:24.415Z","1.0.0":"2026-06-15T12:58:19.136Z","1.0.1":"2026-06-18T13:54:21.976Z","1.1.0":"2026-09-14T17:37:24.279Z"},"bugs":{"url":"https://github.com/abdulkadirkaradas/atisse/issues"},"author":"Abdulkadir Karadas(saferias)","license":"MIT","homepage":"https://github.com/abdulkadirkaradas/atisse#readme","keywords":["llm","ai","orchestration","execution-kernel","lifecycle","state-machine","typescript","provider"],"repository":{"url":"git+https://github.com/abdulkadirkaradas/atisse.git","type":"git","directory":"packages/core"},"maintainers":[{"name":"softendo","email":"kadirkaradas5@gmail.com"}],"readme":"# @atisse/core\n\n[![npm version](https://img.shields.io/npm/v/@atisse/core.svg)](https://www.npmjs.com/package/@atisse/core)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE)\n\nA lightweight, production-grade execution kernel for managing the LLM interaction lifecycle. Provides the orchestrator, pipeline, state machine, retry logic, hook system, and event bus that all adapter packages plug into.\n\n## Features\n\n- Lifecycle-managed pipeline with explicit state machine transitions\n- Retry policy with configurable backoff, jitter, and max attempts\n- Timeout policy per generate, tool, and total run\n- Tool execution loop with configurable round limits\n- Fallback provider support for high-availability setups\n- Hook system with before/after hooks for run, generate, and tool phases\n- Event bus with typed events for observability\n- Profile system for per-run configuration overrides\n- Streaming support via `AsyncIterable<StreamChunk>`\n- Cancellation via `AbortSignal`\n- Session memory adapter integration\n- Context provider injection pipeline\n- Zero runtime dependencies beyond `zod`\n\n## Installation\n\n```bash\nnpm install @atisse/core\n# or\npnpm add @atisse/core\n```\n\n## Quick Start\n\n```typescript\nimport { Orchestrator } from '@atisse/core';\n\n// A provider adapter is required — see @atisse/provider-openai or @atisse/provider-anthropic\nconst orchestrator = new Orchestrator({\n  provider: myProvider,\n  systemPrompt: 'You are a helpful assistant.',\n});\n\nconst result = await orchestrator.run({\n  prompt: 'What is the capital of France?',\n  sessionId: 'session-123',\n});\n\nconsole.log(result.text);\n// Output: The capital of France is Paris.\n```\n\n### With streaming\n\n```typescript\nconst stream = await orchestrator.run({\n  prompt: 'Tell me a story.',\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  if (chunk.type === 'text') {\n    process.stdout.write(chunk.delta);\n  }\n}\n```\n\n### With event listeners\n\n```typescript\nconst unsub = orchestrator.on('run.completed', (event) => {\n  console.log(`Run ${event.runId} completed in ${event.durationMs}ms`);\n});\n\nconst result = await orchestrator.run({ prompt: 'Hello' });\nunsub(); // Remove listener when done\n```\n\n## API Reference\n\n`@atisse/core` package exports the following types and classes:\n\n<details>\n<summary>Click to expand</summary>\n\n### `Orchestrator`\n\nThe main entry point. Created with an `OrchestratorConfig` and exposes `run()` and `on()`.\n\n**Constructor**\n\n```typescript\nnew Orchestrator(config: OrchestratorConfig)\n```\n\nValidates configuration eagerly — throws `ConfigValidationError` on invalid input.\n\n**Key Methods**\n\n| Method | Signature                                                                     | Description                                                                                                |\n| ------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `run`  | `(input: RunInput & { stream?: false }) => Promise<RunOutput>`                | Execute a single prompt interaction. Returns structured output with text, tool results, usage, and timing. |\n| `run`  | `(input: RunInput & { stream: true }) => Promise<AsyncIterable<StreamChunk>>` | Execute with streaming. Yields text deltas, tool calls, and a completion event.                            |\n| `on`   | `<T>(type: T, listener) => () => void`                                        | Register a typed event listener. Returns an unsubscribe function.                                          |\n\n**`OrchestratorConfig` fields**\n\n| Field              | Type                                  | Required | Description                                   |\n| ------------------ | ------------------------------------- | -------- | --------------------------------------------- |\n| `provider`         | `AIProvider`                          | Yes      | Primary LLM provider                          |\n| `fallbackProvider` | `AIProvider`                          | No       | Fallback provider on primary failure          |\n| `systemPrompt`     | `string`                              | No       | System-level instruction                      |\n| `tools`            | `Tool[]`                              | No       | Tool definitions with execute implementations |\n| `contextProviders` | `ContextProvider[]`                   | No       | Context injection providers                   |\n| `memoryAdapter`    | `MemoryAdapter`                       | No       | Session memory persistence                    |\n| `retry`            | `Partial<RetryPolicy>`                | No       | Retry configuration                           |\n| `timeout`          | `Partial<TimeoutPolicy>`              | No       | Timeout configuration                         |\n| `toolPolicy`       | `Partial<ToolPolicy>`                 | No       | Tool execution policy                         |\n| `hooks`            | `Partial<HookRegistry>`               | No       | Lifecycle hooks                               |\n| `profiles`         | `Record<string, OrchestratorProfile>` | No       | Named configuration profiles                  |\n| `logger`           | `Logger`                              | No       | Logger instance                               |\n\n**`RunInput` fields**\n\n| Field       | Type                      | Description                         |\n| ----------- | ------------------------- | ----------------------------------- |\n| `prompt`    | `string`                  | User prompt (always `role: 'user'`) |\n| `profile`   | `string`                  | Profile name to apply               |\n| `sessionId` | `string`                  | Session identifier for memory       |\n| `stream`    | `boolean`                 | Enable streaming mode               |\n| `metadata`  | `Record<string, unknown>` | Arbitrary metadata                  |\n| `signal`    | `AbortSignal`             | Cancellation signal                 |\n\n### `OrchestratorError` hierarchy\n\nAll errors thrown by the kernel extend `OrchestratorError`. Key subtypes:\n\n| Class                            | Code                          | Retryable |\n| -------------------------------- | ----------------------------- | --------- |\n| `ProviderRateLimitError`         | `PROVIDER_RATE_LIMIT`         | Yes       |\n| `ProviderTimeoutError`           | `PROVIDER_TIMEOUT`            | Yes       |\n| `ProviderUnavailableError`       | `PROVIDER_UNAVAILABLE`        | Yes       |\n| `ProviderAuthError`              | `PROVIDER_AUTH_FAILED`        | No        |\n| `ProviderMalformedResponseError` | `PROVIDER_MALFORMED_RESPONSE` | No        |\n| `ToolExecutionError`             | `TOOL_EXECUTION_FAILED`       | Yes       |\n| `ToolValidationError`            | `TOOL_VALIDATION_FAILED`      | No        |\n| `ToolNotFoundError`              | `TOOL_NOT_FOUND`              | No        |\n| `ContextLoadError`               | `CONTEXT_LOAD_FAILED`         | Yes       |\n| `MaxRetriesExceededError`        | `MAX_RETRIES_EXCEEDED`        | No        |\n| `ConfigValidationError`          | `CONFIG_VALIDATION_FAILED`    | No        |\n| `TimeoutExceededError`           | `TIMEOUT_EXCEEDED`            | No        |\n| `RunCancelledError`              | `RUN_CANCELLED`               | No        |\n\n</details>\n\n### Testing utilities\n\n```typescript\nimport { MockProvider } from '@atisse/core/testing';\n\nconst mock = new MockProvider();\nmock.enqueue({ text: 'Mock response' });\nconst result = await mock.generate({ messages: [] });\n```\n\n`MockProvider` supports configurable response queues, streaming, failure injection, and call inspection.\n\n### Additional exports\n\n- `LifecycleState` — `'INITIALIZED' | 'CONTEXT_INJECTING' | 'CONTEXT_INJECTED' | 'PROMPT_COMPOSED' | 'GENERATING' | 'TOOL_EXECUTING' | 'RETRYING' | 'FALLBACKING' | 'COMPLETING' | 'COMPLETED' | 'FAILED'`\n- `LifecycleStateMachine` — State machine for lifecycle transitions\n- `StreamChunk` — Discriminated union for streaming: `text`, `tool_call`, `tool_result`, `done`, `error`\n- All type interfaces: `AIProvider`, `MemoryAdapter`, `ContextProvider`, `Tool`, `HookRegistry`, `Logger`, etc.\n\n## Monorepo Ecosystem\n\n`@atisse/*` packages are part of the [atisse](https://github.com/abdulkadirkaradas/atisse) monorepo.\n\n- **[@atisse/context-rag](../context-rag)** — RAG context provider\n- **[@atisse/memory-inmemory](../memory-inmemory)** — In-memory memory adapter\n- **[@atisse/memory-redis](../memory-redis)** — Redis memory adapter\n- **[@atisse/provider-anthropic](../provider-anthropic)** — Anthropic Claude provider\n- **[@atisse/provider-openai](../provider-openai)** — OpenAI GPT provider\n\n## License\n\nMIT © [Abdulkadir Karadas(saferias)](https://github.com/abdulkadirkaradas)\n","readmeFilename":""}