{"_id":"@afuchat1/engagera","_rev":"6-d93d17b853cdd2c0338f62d84e89eb3d","name":"@afuchat1/engagera","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.1":{"name":"@afuchat1/engagera","version":"0.1.1","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","_id":"@afuchat1/engagera@0.1.1","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"homepage":"https://github.com/afuchat1/sdk#readme","bugs":{"url":"https://github.com/afuchat1/sdk/issues"},"dist":{"shasum":"195167308feeac2e7e0ee4ea62a88461730fbbbf","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.1.1.tgz","fileCount":29,"integrity":"sha512-YyrAFuy0Za6wYzHB7qqvSZz02To5gt3L/dazTGXXHUcmXIX9I5wsTwEc6Npt4B0WcVX7Z2gFHodz5t9uQxul4g==","signatures":[{"sig":"MEYCIQCUWQLhFuThCHFRculURuAxIgcmRxG+WzrY/Feab6PTSAIhANAyOCjq+Su2efNx1zHNkWx8xJM2+2WisoOcDznFje9/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53555},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"52ed6f0fb1734596eaabe31181e0cc36297efadc","scripts":{"dev":"tsc --watch --project tsconfig.build.json","build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"repository":{"url":"git+https://github.com/afuchat1/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engagera_0.1.1_1784542164411_0.8817350518809881","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@afuchat1/engagera","version":"0.1.2","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","_id":"@afuchat1/engagera@0.1.2","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"homepage":"https://github.com/afuchat1/sdk#readme","bugs":{"url":"https://github.com/afuchat1/sdk/issues"},"dist":{"shasum":"2bb418ae591d17a518681696daa1799e28d353f2","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.1.2.tgz","fileCount":29,"integrity":"sha512-kDyo9VoUBffKjzZCPlOtEQ1FHM71PMkqbxhl2Q+Q5v70qzb39J5jdjmfcbeIkBAKLZb7IW35y+lfQB2whFVwAg==","signatures":[{"sig":"MEUCIQD7cRPd13nlzZ6rUXdNloukIAyhvvEnRhE+sRwVfswVRQIgeEp4P5Z2KYp+x0/9zz/yKFqQlYIUT69EVWmb6Wed7RY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53598},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"56aa57e4e8133cd6ce97a7aab52ef29f1d25ceec","scripts":{"dev":"tsc --watch --project tsconfig.build.json","build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"repository":{"url":"git+https://github.com/afuchat1/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engagera_0.1.2_1784542449287_0.7835234672907423","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@afuchat1/engagera","version":"0.1.3","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","_id":"@afuchat1/engagera@0.1.3","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"homepage":"https://engagera.afuchat.com","bugs":{"url":"https://github.com/afuchat1/EngageraAi/issues"},"dist":{"shasum":"c4b16bf2827b492fe9d33ca24e64d488922dd0f5","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.1.3.tgz","fileCount":29,"integrity":"sha512-d8Q/KP51f/iqi5+qKsbpRPF1NvLk3ds6fcqkvh10Ne5O46pd918jBB85/oTEPE0mNKY38lcm05hn/b5X8ih50A==","signatures":[{"sig":"MEYCIQC/vDbI4M538wW9FriCQT8v7cLNWSVMLbC1J1VUTM3PMQIhAJ+ZRUHvXvAT9T+UG81cP5+4Q3w19d0ykgf4C1E8RRHA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53650},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"ecc2d2113c053a47551ca457bb25e07e776aa683","scripts":{"dev":"tsc --watch --project tsconfig.build.json","build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"repository":{"url":"git+https://github.com/afuchat1/EngageraAi.git","type":"git"},"_npmVersion":"10.8.2","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engagera_0.1.3_1784741038611_0.33951220827869233","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@afuchat1/engagera","version":"0.1.4","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","_id":"@afuchat1/engagera@0.1.4","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"homepage":"https://engagera.afuchat.com","bugs":{"url":"https://github.com/afuchat1/EngageraAi/issues"},"dist":{"shasum":"fcd61613e84ac68c2f2798878c4b5204bf872e27","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.1.4.tgz","fileCount":29,"integrity":"sha512-4aEfM4MJABI0SGXUf1ReTenNDYQ5nUgL8+a3+JzGVyyEiZ5w79ofCl4eJ29vp2Byo4eOP8KXcdAtZ2lZE6QEfQ==","signatures":[{"sig":"MEUCIFfSlSQLe1x1K2oogs7Yu0SM4HYTnZDVoJu8vajwY+mNAiEAs6CgC4kTeGBeVSQrOZblim7OYnE1h0f3vDt4gBufQHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53658},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"2e38700c250d47ac88f1bade93922a9f59656f18","scripts":{"dev":"tsc --watch --project tsconfig.build.json","build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"repository":{"url":"git+https://github.com/afuchat1/EngageraAi.git","type":"git"},"_npmVersion":"10.8.2","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engagera_0.1.4_1784741218760_0.9942306407115875","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@afuchat1/engagera","version":"0.1.5","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","_id":"@afuchat1/engagera@0.1.5","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"homepage":"https://engagera.afuchat.com","bugs":{"url":"https://github.com/afuchat1/EngageraAi/issues"},"dist":{"shasum":"d5d53a8eb86b6f15aa4fb062343294109d24e9a0","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.1.5.tgz","fileCount":29,"integrity":"sha512-xh39DBkFYT7x9CPiFpeSpO7xiGjRG6fqKbhc+hBoaZI5vkLaBTiide9PISu5uaZEmW0tytyvqFWYfizfN5aLbA==","signatures":[{"sig":"MEUCIQD7GOlzcscs0ERv0QtZnzcFqzmoyquxwASqnjC40bcODAIgeTQevxgUfGVHiIeSH05h8LQECjuykWlIj6qaD1w2Vlw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55038},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"96d122a1480b320f4cfc7d9d53226156555e3372","scripts":{"dev":"tsc --watch --project tsconfig.build.json","build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"repository":{"url":"git+https://github.com/afuchat1/EngageraAi.git","type":"git"},"_npmVersion":"10.8.2","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engagera_0.1.5_1784767822500_0.65832478831043","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@afuchat1/engagera","version":"0.2.0","description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsc --project tsconfig.build.json && node scripts/build-cjs.mjs","dev":"tsc --watch --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"license":"MIT","homepage":"https://engagera.afuchat.com","repository":{"type":"git","url":"git+https://github.com/afuchat1/EngageraAi.git"},"_id":"@afuchat1/engagera@0.2.0","gitHead":"62a770f94a879babf3faaf823b6dd1fc77f16215","bugs":{"url":"https://github.com/afuchat1/EngageraAi/issues"},"_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-n6g5u8zKcyd/9qaZo+yvPp6v0Ybr9uCvxhu/PiPJmSElErDTZLzCsPpmxYSCycf8oexj/QOFF7m1x6QshYFlzQ==","shasum":"23b22bdd107538d6b5486608c9ba067572b5a8ad","tarball":"https://registry.npmjs.org/@afuchat1/engagera/-/engagera-0.2.0.tgz","fileCount":38,"unpackedSize":86760,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDddCd0vvlGYi8MdYqkYkPZs5fCAP7GWouuaVr83GrgFQIhANEIgxQQU/qiNJ4X++PDJH4/1AXN/0dBTbU6Drb5nGh6"}]},"_npmUser":{"name":"afuproducts","email":"hello@afuchat.com"},"directories":{},"maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/engagera_0.2.0_1785959269081_0.4790482251459107"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T10:09:24.196Z","modified":"2026-08-05T19:47:49.471Z","0.1.1":"2026-07-20T10:09:24.559Z","0.1.2":"2026-07-20T10:14:09.451Z","0.1.3":"2026-07-22T17:23:58.734Z","0.1.4":"2026-07-22T17:26:58.906Z","0.1.5":"2026-07-23T00:50:22.634Z","0.2.0":"2026-08-05T19:47:49.294Z"},"bugs":{"url":"https://github.com/afuchat1/EngageraAi/issues"},"license":"MIT","homepage":"https://engagera.afuchat.com","keywords":["afuchat","afubot","search","crawler","spider","ai","streaming","sdk"],"repository":{"type":"git","url":"git+https://github.com/afuchat1/EngageraAi.git"},"description":"The official Engagera AI SDK — build AI-powered chat and search engines with AfuBot","maintainers":[{"name":"afuproducts","email":"hello@afuchat.com"}],"readme":"# @afuchat1/engagera\n\nThe official TypeScript SDK for [Engagera](https://engagera.afuchat.com). Chat and **AfuBot**, our optional live web crawler, are separate capabilities.\n\n[![npm version](https://img.shields.io/npm/v/@afuchat1/engagera)](https://www.npmjs.com/package/@afuchat1/engagera)\n[![license](https://img.shields.io/npm/l/@afuchat1/engagera)](LICENSE)\n\nTwo building blocks:\n\n| | What it does | Streaming? |\n|---|---|---|\n| **`client.afubot`** | Crawls the live web — spiders pages, extracts titles, images & snippets, returns cited sources | ✗ Synchronous |\n| **`client.chat`** | AI completions; web crawling is opt-in with `useAfuBot` | ✓ Token-by-token SSE |\n\n---\n\n## Installation\n\n```bash\nnpm install @afuchat1/engagera\n# or\npnpm add @afuchat1/engagera\n# or\nyarn add @afuchat1/engagera\n```\n\n## Quick start\n\n```ts\nimport Engagera from \"@afuchat1/engagera\";\n\nconst client = new Engagera({ apiKey: \"eng_...\" });\n```\n\nGet your API key from the [Engagera dashboard](https://engagera.com/dashboard).\n\n---\n\n## AfuBot — Web Crawler / Spider\n\nAfuBot is a crawler, not an AI streamer. Pass it a query; it spiders relevant\nlive pages, extracts structured data (og:images, titles, snippets), and returns\neverything in one synchronous response. Use it to build search engines,\nnews aggregators, and research tools.\n\n### One-shot search\n\n```ts\nconst result = await client.afubot.search(\"SpaceX Starship latest launch\");\n\nconsole.log(result.answer);       // synthesised answer from crawled content\nconsole.log(result.searchQuery);  // query AfuBot issued internally\nconsole.log(result.sources);      // crawled pages: url, title, image, snippet\n```\n\n### Source object\n\n```ts\nresult.sources.forEach(source => {\n  console.log(source.url);      // \"https://space.com/...\"\n  console.log(source.title);    // \"SpaceX Starship completes...\"\n  console.log(source.image);    // og:image extracted from the live page\n  console.log(source.snippet);  // text preview\n});\n```\n\n### Search with options\n\n```ts\nconst result = await client.afubot.search({\n  query: \"best electric cars 2025\",\n  contextHint: \"focus on range and charging speed\",\n  conversationId: \"abc-123\",   // carry context across searches\n  model: \"engagera-pro\",\n});\n```\n\n### Build a search engine\n\n```ts\nasync function search(userQuery: string) {\n  const { sources, answer } = await client.afubot.search(userQuery);\n\n  return {\n    answer,\n    cards: sources.map(s => ({\n      title:     s.title,\n      url:       s.url,\n      thumbnail: s.image,\n      preview:   s.snippet,\n    })),\n  };\n}\n```\n\n---\n\n## Chat — AI Completions\n\nGeneral-purpose AI completions. Chat does not crawl the web by default.\nUse `useAfuBot: true` only when you explicitly want to add AfuBot live\ncrawling to a chat request, or use the standalone `client.afubot` resource.\n\nAPI requests are a separate product boundary from the Engagera platform:\ndeveloper API calls do not read or write platform memories, settings,\ndocuments, or conversation history. Any application instructions or dataset\ncontext must be supplied and controlled by the developer's own environment.\n\n### Non-streaming\n\n```ts\nconst reply = await client.chat.create({\n  messages: [\n    { role: \"system\", content: \"You are a helpful assistant.\" },\n    { role: \"user\",   content: \"What happened in tech this week?\" },\n  ],\n  useAfuBot: true,\n});\n\nconsole.log(reply.content);  // full AI answer\nconsole.log(reply.sources);  // pages AfuBot crawled when explicitly enabled\n```\n\n### Streaming — token-by-token\n\n```ts\nfor await (const event of client.chat.stream({\n  messages: [{ role: \"user\", content: \"Summarise today's AI news\" }],\n})) {\n  switch (event.type) {\n    case \"text\":\n      process.stdout.write(event.text);  // token arrives\n      break;\n    case \"sources\":\n      console.log(event.sources);        // AfuBot finished crawling\n      break;\n    case \"done\":\n      console.log(\"\\n✓\", event.usage);\n      break;\n    case \"error\":\n      console.error(event.message);\n      break;\n  }\n}\n```\n\n### Multi-turn conversation\n\n```ts\nlet conversationId: string | undefined;\n\nasync function ask(question: string) {\n  const reply = await client.chat.create({\n    messages: [{ role: \"user\", content: question }],\n    conversationId,\n  });\n  conversationId = reply.conversationId;\n  return reply.content;\n}\n\nawait ask(\"Who won the last World Cup?\");\nawait ask(\"And the one before that?\");  // context maintained\n```\n\n---\n\n### Advanced reasoning\n\nUse `engagera-reason` for deep analysis, planning, trade-off evaluation, and\ncareful multi-step problem solving. Reasoning runs privately on the server and\nonly the final answer is returned. Internal notes, routing, and providers are\nnever exposed.\n\n```ts\nconst reply = await client.chat.create({\n  model: \"engagera-reason\",\n  messages: [\n    { role: \"user\", content: \"Compare these architectures and recommend one.\" },\n  ],\n});\n```\n\n---\n\n## Models\n\n| Model | Description |\n|---|---|\n| `engagera-lite` | Fast answers for lightweight tasks |\n| `engagera-pro` | Default — best all-around model |\n| `engagera-reason` | Deep reasoning and analysis |\n| `engagera-code` | Production software engineering |\n| `engagera-vision` | Image and document understanding |\n| `engagera-image` | Image generation and editing |\n\nLegacy `engagera-2.0` and `engagera-2.1` aliases remain accepted for existing clients.\n\n---\n\n## Error handling\n\n```ts\nimport Engagera, {\n  EngageraError,\n  EngageraAuthError,\n  EngageraRateLimitError,\n  EngageraStreamError,\n} from \"@afuchat1/engagera\";\n\ntry {\n  const result = await client.afubot.search(\"...\");\n} catch (err) {\n  if (err instanceof EngageraAuthError)      console.error(\"Invalid API key\");\n  if (err instanceof EngageraRateLimitError) console.error(\"Rate limit hit\");\n  if (err instanceof EngageraStreamError)    console.error(\"Stream broke:\", err.message);\n  if (err instanceof EngageraError)          console.error(\"API error:\", err.status, err.message);\n}\n```\n\n---\n\n## Configuration\n\n```ts\nconst client = new Engagera({\n  apiKey:       \"eng_...\",         // required\n  baseUrl:      \"https://...\",     // optional — for self-hosted deployments\n  defaultModel: \"engagera-pro\",    // optional — used when no model is specified\n  timeout:      60_000,            // optional — ms (default: 120 000 / 2 min)\n});\n```\n\n---\n\n## TypeScript\n\nWritten in TypeScript, ships full declarations. All methods, parameters,\nand events are typed — no `any` in your consumer code.\n\n```ts\nimport type {\n  AfuBotSearchResult,\n  AfuBotSearchParams,\n  Source,\n  ChatStreamEvent,\n  ChatResponse,\n  Message,\n  Usage,\n} from \"@afuchat1/engagera\";\n```\n\n---\n\n## Runtime support\n\nZero dependencies — uses native `fetch`. Works in:\n\n- **Node.js** 18+\n- **Browsers**\n- **Edge runtimes** — Cloudflare Workers, Vercel Edge, Deno\n- **Bun**\n\n---\n\n## Publishing / self-hosting\n\nThe `baseUrl` option lets you point the SDK at your own backend:\n\n```ts\nconst client = new Engagera({\n  apiKey:  \"your-key\",\n  baseUrl: \"https://your-own-api.com/v1\",\n});\n```\n\n---\n\n## License\n\nMIT © AfuChat\n","readmeFilename":"README.md"}