{"_id":"@asyncify-hq/agent","_rev":"5-d8c2b2e052aeccdd873a30caf90a5ff5","name":"@asyncify-hq/agent","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@asyncify-hq/agent","version":"0.1.0","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"author":{"name":"Shubam Patil"},"license":"MIT","_id":"@asyncify-hq/agent@0.1.0","maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"homepage":"https://asyncify.org","bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"dist":{"shasum":"04ad0f570d81c0670b14c72077758e9dcf65678e","tarball":"https://registry.npmjs.org/@asyncify-hq/agent/-/agent-0.1.0.tgz","fileCount":6,"integrity":"sha512-Jd2IaGYNUuTZ93mwXq8FdyhHVQhHgwGrdnB/ZUIXcVYYzP1jArhd5aQAYIDfx88MKsWfnvUOB9vNJ1XwfWlzKw==","signatures":[{"sig":"MEYCIQChcSx/2gAT6Qb3IOsD0z8qDNllkXLP42G98iMmKMrRFQIhANOMlL6nsKVaJ/ul/c8Yhmx8RHDyTR+HBdBARkepFOX3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20476},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9177f58b764b2da5405a9c514179edef6c0568e1","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"shubam14dec","email":"shubamp981@gmail.com"},"repository":{"url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","type":"git","directory":"packages/agent"},"_npmVersion":"11.6.2","description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.0_1783451746811_0.9831211826740063","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@asyncify-hq/agent","version":"0.2.0","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"author":{"name":"Shubam Patil"},"license":"MIT","_id":"@asyncify-hq/agent@0.2.0","maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"homepage":"https://asyncify.org","bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"dist":{"shasum":"361d05d8b2f4400a6034418d4227c4d887382518","tarball":"https://registry.npmjs.org/@asyncify-hq/agent/-/agent-0.2.0.tgz","fileCount":6,"integrity":"sha512-VmpyOK+UCgGF6EVZg4oqckJqn3NMEShYL0r2INmMT4mJ/af/P/2Uo+cqVoRmIsszUlHqHekHdWQShq6mtZVIaQ==","signatures":[{"sig":"MEYCIQD0LzSoBmdr1ZXARm17i5BkBVSu0XfrhNfHWU2V3wWSBQIhAOkQ2bNBozKHIpBy1e8fkvLRq9V50zfCQyBHOLerigGN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23058},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d3a0132777bb3b7d8d1485df18d5a8ff0b5021e8","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"shubam14dec","email":"shubamp981@gmail.com"},"repository":{"url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","type":"git","directory":"packages/agent"},"_npmVersion":"11.6.2","description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.0_1783631494092_0.40783175709545705","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@asyncify-hq/agent","version":"0.2.1","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"author":{"name":"Shubam Patil"},"license":"MIT","_id":"@asyncify-hq/agent@0.2.1","maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"homepage":"https://asyncify.org","bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"dist":{"shasum":"ceab6f1fbec4f6aca7ee4698ff6ecdffc61b19cd","tarball":"https://registry.npmjs.org/@asyncify-hq/agent/-/agent-0.2.1.tgz","fileCount":6,"integrity":"sha512-fScBguBWXCQCO4WY64JRh0qFoy33zX5scXLcEPSHnkA7OdrOj2HMpZefc5Ftbg5zb6u3RbtpvSQ6jm/CMxdWHA==","signatures":[{"sig":"MEYCIQCUegwTol/Yf3bOUSwHOlVaaZsfLTQTZ3CMeXmdjZhUfAIhAI+edIBq3lojJNqww2VWcd4GlP4J3y3I6aZIHzi3nRwi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asyncify-hq%2fagent@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23920},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c8f45d4ba9a2c31116f9b7e68506cef4e13ca919","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d6a7e996-cdaf-4d05-a79c-338ed831ec05"}},"repository":{"url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","type":"git","directory":"packages/agent"},"_npmVersion":"11.16.0","description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.1_1783637585126_0.17167358594018012","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@asyncify-hq/agent","version":"0.3.0","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"author":{"name":"Shubam Patil"},"license":"MIT","_id":"@asyncify-hq/agent@0.3.0","maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"homepage":"https://asyncify.org","bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"dist":{"shasum":"d60d9315343c1f96024f4876eccf5e9dfe2d083f","tarball":"https://registry.npmjs.org/@asyncify-hq/agent/-/agent-0.3.0.tgz","fileCount":6,"integrity":"sha512-rhdIw13JO4GFE4+9RIDJuR2TKujmtIdyY7/FQ7LPf3FkcgGmocBHCtUmVlyGhYW+rmJS9BNOXOsrYjamr2EMlg==","signatures":[{"sig":"MEQCIHUCE1zvXa989GbxHD0Wy09f1HjvKCVZIEHk7WuOK2jzAiBrrshgQC4z46mwYZIOY7wT5hAKtr94Vnr2jiKB1gT6gA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asyncify-hq%2fagent@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":27838},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"ebdde3d0186070c70c05ee1597e1ad646f73da21","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d6a7e996-cdaf-4d05-a79c-338ed831ec05"}},"repository":{"url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","type":"git","directory":"packages/agent"},"_npmVersion":"11.16.0","description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.3.0_1783814937466_0.8119544397396232","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@asyncify-hq/agent","version":"0.4.0","description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"homepage":"https://asyncify.org","repository":{"type":"git","url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","directory":"packages/agent"},"license":"MIT","author":{"name":"Shubam Patil"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","prepublishOnly":"npm run build"},"devDependencies":{"@types/node":"^20.0.0","tsup":"^8.3.5","typescript":"^5.7.2"},"engines":{"node":">=18"},"gitHead":"a60a8ad5b6521c05dc7b6f1ad64b3c109b265904","_id":"@asyncify-hq/agent@0.4.0","bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-hx4qHQ3tqOC6NhZ+QxXg3k7p2CglH/MjZPuVZXayPPQCpkB5pVJR6IpcA8D3yOm1lVjuMcMfcA4i6++MiXIN8w==","shasum":"34cafd68e5375855ec6e94eb23c15e69ca829f6f","tarball":"https://registry.npmjs.org/@asyncify-hq/agent/-/agent-0.4.0.tgz","fileCount":6,"unpackedSize":30158,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asyncify-hq%2fagent@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGsxJXCJLKoNxUyAnVguvhui4UYXSEnDY91uVvgwX0kvAiAhVxxr/Nht/IAjBJWCpSHB5YoQ363hXXcpcPzWn6Z0Dg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d6a7e996-cdaf-4d05-a79c-338ed831ec05"}},"directories":{},"maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.4.0_1783869871698_0.2531786000613694"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T19:15:46.651Z","modified":"2026-07-12T15:24:32.156Z","0.1.0":"2026-07-07T19:15:46.952Z","0.2.0":"2026-07-09T21:11:34.247Z","0.2.1":"2026-07-09T22:53:05.384Z","0.3.0":"2026-07-12T00:08:57.612Z","0.4.0":"2026-07-12T15:24:31.892Z"},"bugs":{"url":"https://github.com/shubam14dec/Scalable-Notification-System/issues"},"author":{"name":"Shubam Patil"},"license":"MIT","homepage":"https://asyncify.org","keywords":["agents","ai-agents","conversations","chat","notifications","asyncify"],"repository":{"type":"git","url":"git+https://github.com/shubam14dec/Scalable-Notification-System.git","directory":"packages/agent"},"description":"Agent SDK for Asyncify — receive normalized conversation events from any channel, reply, and fire notification workflows mid-conversation","maintainers":[{"name":"shubam14dec","email":"shubamp981@gmail.com"}],"readme":"# @asyncify-hq/agent\n\nBuild the brain; Asyncify handles the channels. This SDK receives\nnormalized conversation events from Asyncify (any channel — in-app today,\nmore coming), lets your code reply, and batches **signals** — conversation\nmetadata, workflow triggers, resolution — into the single HTTP response.\n\nZero dependencies. Works with plain Node `http`, Express, Fastify, or any\nframework that exposes the raw request.\n\n## Quickstart\n\n1. Register an agent (dashboard → Agents, or the API) with the URL your\n   handler will listen on. Copy the signing secret — it is shown once.\n\n2. Write the brain:\n\n```ts\nimport http from 'node:http';\nimport { defineAgent, createHandler } from '@asyncify-hq/agent';\n\nconst support = defineAgent({\n  async onMessage(ctx) {\n    // ctx.history is pre-shaped for LLM SDKs: [{ role, content }, ...]\n    if (ctx.message.text.toLowerCase().includes('order')) {\n      ctx.metadata.set('topic', 'orders');\n      // fire a real notification workflow, mid-conversation\n      ctx.trigger('order-replacement', { payload: { order: '#1042' } });\n      return 'So sorry! A replacement is on the way — confirmation email incoming.';\n    }\n    if (ctx.message.text.toLowerCase().includes('thanks')) {\n      ctx.resolve('customer satisfied');\n      return 'Anytime!';\n    }\n    return `You said: ${ctx.message.text}`;\n  },\n});\n\nhttp\n  .createServer(createHandler(support, { signingSecret: process.env.ASYNCIFY_AGENT_SECRET! }))\n  .listen(4100);\n```\n\n3. Send a message from the `<AgentChat />` widget (`@asyncify-hq/react`)\n   or the API — your handler answers, Asyncify delivers.\n\n## Buttons & clicks\n\nOffer tappable choices with a reply; a tap comes back as an **action**\nevent. The platform renders them natively per channel — widget buttons,\nTelegram inline keyboards (retired after the tap), a numbered options\nlist in email:\n\n```ts\nconst support = defineAgent({\n  onMessage(ctx) {\n    ctx.reply('How should we fix this?', {\n      buttons: [\n        { id: 'resend', label: 'Resend the order' },\n        { id: 'human', label: 'Talk to a human' },\n      ],\n    });\n  },\n  onAction(ctx) {\n    if (ctx.action?.id === 'resend') {\n      ctx.trigger('order-replacement');\n      return 'Done — confirmation on the way.';\n    }\n    return 'You got it — a teammate will pick this up shortly.';\n  },\n});\n```\n\nAgents without `onAction` receive clicks as plain messages — nothing\nbreaks if you skip it.\n\n## Adding an LLM\n\n`ctx.history` maps directly onto chat-completion messages:\n\n```ts\nconst { text } = await generateText({\n  model: openai('gpt-4o-mini'),\n  system: 'You are a support agent for Acme.',\n  messages: [...ctx.history, { role: 'user', content: ctx.message.text }],\n});\nreturn text;\n```\n\n## Security\n\nEvery request is HMAC-SHA256 signed (`x-asyncify-signature` over\n`timestamp.body`, replay-protected by `x-asyncify-timestamp`). The handler\nrejects anything unsigned or stale; `verifySignature` is exported if you\nneed to verify manually.\n","readmeFilename":"README.md"}