{"_id":"@akka-bot/sdk","_rev":"2-2e7358c39656183b6ccfb22d8f239b40","name":"@akka-bot/sdk","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@akka-bot/sdk","version":"0.1.0","keywords":["akka","whatsapp","bot","command","sdk","marketplace"],"license":"MIT","_id":"@akka-bot/sdk@0.1.0","maintainers":[{"name":"hexarkk","email":"hexagononyt@gmail.com"}],"homepage":"https://github.com/snailsquid/akka-sdk#readme","bugs":{"url":"https://github.com/snailsquid/akka-sdk/issues"},"dist":{"shasum":"7ebf95e28e4d2e68e2fb21ac0db9fd9b41d35ef3","tarball":"https://registry.npmjs.org/@akka-bot/sdk/-/sdk-0.1.0.tgz","fileCount":8,"integrity":"sha512-796SEGlhtAd0GQd3wbs5A8gm4u67aItY9BlDtEnU8lTqniaf1uZxqoIIVhh1b/BXrVvKDqdmopJbxcc154NfEA==","signatures":[{"sig":"MEUCIERUOR6MT9J/ci6q3Rn0ZtMKHAutniNsh4Tjo1+wCl99AiEA1EL6Mb9/4CLG73N5yNu4hxPiYWS/KGI86um2+0Gj32w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13913},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.0","node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"34d0330fd04787b56866f435bc74f3d79ff8c9bc","scripts":{"test":"bun test","build":"tsc && cp dist/index.d.ts dist/index.d.cts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"hexarkk","email":"hexagononyt@gmail.com"},"repository":{"url":"git+https://github.com/snailsquid/akka-sdk.git","type":"git"},"_npmVersion":"10.9.4","description":"Akka WhatsApp Command Platform SDK — build commands for the Akka marketplace","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1780261706622_0.25652455253468043","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@akka-bot/sdk","version":"0.1.3","description":"Akka WhatsApp Command Platform SDK — build commands for the Akka marketplace","keywords":["akka","whatsapp","bot","command","sdk","marketplace"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/snailsquid/akka-sdk.git"},"bugs":{"url":"https://github.com/snailsquid/akka-sdk/issues"},"homepage":"https://github.com/snailsquid/akka-sdk#readme","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 && esbuild src/index.ts --bundle --format=esm --outfile=dist/index.js && esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.cjs && cp dist/index.d.ts dist/index.d.cts","prepublishOnly":"npm run build","test":"bun test","typecheck":"tsc --noEmit"},"devDependencies":{"esbuild":"^0.25.0","@types/bun":"latest","typescript":"^5.8.0"},"engines":{"node":">=18","bun":">=1.0"},"_id":"@akka-bot/sdk@0.1.3","gitHead":"800b9cc1d9ce86b5ad1875ade69badc383aa1baa","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-rS/wWAHtrAJwjzN6nHQfPq5mZ4lOAts3txWT+BnedAH9CdJPXtY1aU5XhFC3px/t4Yu7UM/CO5ET54R3+FrBjQ==","shasum":"93992f9397bdd0439aa925a21b7a34e9bd04668c","tarball":"https://registry.npmjs.org/@akka-bot/sdk/-/sdk-0.1.3.tgz","fileCount":9,"unpackedSize":14510,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDN7YwHx/TbinsxqmBxrQeuhWvZcshf4TFxdZQVT7QE7QIhAKVTlhgS19CZYOaQlqWvOc35WSA0acnGieSBsRytBR4k"}]},"_npmUser":{"name":"hexarkk","email":"hexagononyt@gmail.com"},"directories":{},"maintainers":[{"name":"hexarkk","email":"hexagononyt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.3_1780262774445_0.516271116344891"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-31T21:08:26.505Z","modified":"2026-05-31T21:26:14.737Z","0.1.0":"2026-05-31T21:08:26.780Z","0.1.3":"2026-05-31T21:26:14.620Z"},"bugs":{"url":"https://github.com/snailsquid/akka-sdk/issues"},"license":"MIT","homepage":"https://github.com/snailsquid/akka-sdk#readme","keywords":["akka","whatsapp","bot","command","sdk","marketplace"],"repository":{"type":"git","url":"git+https://github.com/snailsquid/akka-sdk.git"},"description":"Akka WhatsApp Command Platform SDK — build commands for the Akka marketplace","maintainers":[{"name":"hexarkk","email":"hexagononyt@gmail.com"}],"readme":"# @akka-bot/sdk\n\nAkka WhatsApp Command Platform SDK — build commands for the Akka marketplace.\n\n## Installation\n\n```bash\nnpm install @akka-bot/sdk\n# or\nbun add @akka-bot/sdk\n```\n\n## Quick Start\n\nCreate a GitHub repository with your command code, then export a command definition as the default export:\n\n```typescript\nimport { command } from \"@akka/sdk\";\n\nexport default command({\n  name: \"Echo\",\n  description: \"Echoes back your message\",\n  usage: \".echo [text]\",\n  async handle(ctx) {\n    await ctx.send(ctx.args.join(\" \") || \"Hello from Akka!\");\n  }\n});\n```\n\nThen register your repository in the [Akka Developer Portal](https://akka.dev/developers).\n\n## API\n\n### `command(definition)`\n\nValidates a `CommandDefinition` and returns it. Throws if required fields are missing.\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `name` | `string` | ✅ | Display name in marketplace |\n| `description` | `string` | ✅ | Short description |\n| `usage` | `string` | ✅ | Usage example, e.g. `.echo [text]` |\n| `handle` | `(ctx: CommandContext) => Promise<void>` | ✅ | The command handler |\n\n### `CommandContext`\n\nInjected into `handle(ctx)` at execution time:\n\n| Method / Property | Signature | Description |\n|---|---|---|\n| `send` | `(text: string) => Promise<void>` | Send a WhatsApp message |\n| `react` | `(emoji: string) => Promise<void>` | React to the user's message |\n| `schedule` | `(duration: string, cb: () => Promise<void>) => Promise<void>` | Schedule delayed execution |\n| `fetch` | `(url: string, opts?: RequestInit) => Promise<Response>` | HTTP request |\n| `userId` | `string` (readonly) | Anonymized user ID |\n| `args` | `string[]` (readonly) | Parsed arguments |\n| `message` | `string` (readonly) | Full message text |\n| `contactId` | `number` (readonly) | Internal contact ID |\n\n### Duration format for `schedule()`\n\n| Example | Meaning |\n|---|---|\n| `\"30s\"` | 30 seconds |\n| `\"10m\"` | 10 minutes |\n| `\"2h\"` | 2 hours |\n| `\"1d\"` | 1 day |\n\n## Examples\n\n### Weather Command\n\n```typescript\nimport { command } from \"@akka/sdk\";\n\nexport default command({\n  name: \"Weather\",\n  description: \"Get current weather for any city\",\n  usage: \".weather [city]\",\n  async handle(ctx) {\n    const city = ctx.args[0] ?? \"London\";\n    const res = await ctx.fetch(`https://wttr.in/${city}?format=%C+%t`);\n    const text = await res.text();\n    await ctx.send(`🌤 ${city}: ${text}`);\n  },\n});\n```\n\n### Reminder Command\n\n```typescript\nimport { command } from \"@akka/sdk\";\n\nexport default command({\n  name: \"Remind Me\",\n  description: \"Set a reminder with natural durations\",\n  usage: \".remind me 10m check email\",\n  async handle(ctx) {\n    const [duration, ...rest] = ctx.args;\n    const message = rest.join(\" \");\n\n    await ctx.schedule(duration, async () => {\n      await ctx.send(`⏰ Reminder: ${message}`);\n    });\n    await ctx.send(`✅ I'll remind you in ${duration}`);\n  },\n});\n```\n\n## Publishing to the Marketplace\n\n1. Push your command code to a **public GitHub repository**.\n2. Each command module must have a default export created with `command()`.\n3. Register your repository in the [Akka Developer Portal](https://akka.dev/developers).\n4. Akka will clone your repo, validate the command, and list it in the marketplace.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}