{"_id":"@8xlabsai/hekaya-shared-types","_rev":"2-cd53e1619070d08f2f245a16163c6146","name":"@8xlabsai/hekaya-shared-types","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@8xlabsai/hekaya-shared-types","version":"0.2.0","license":"MIT","_id":"@8xlabsai/hekaya-shared-types@0.2.0","maintainers":[{"name":"batout","email":"amr.z.abdo@gmail.com"}],"homepage":"https://github.com/8xlabs-ai/hekaya.ai#readme","bugs":{"url":"https://github.com/8xlabs-ai/hekaya.ai/issues"},"dist":{"shasum":"cd93bf9b92f3434c5ee4f5f966602a8809d9197f","tarball":"https://registry.npmjs.org/@8xlabsai/hekaya-shared-types/-/hekaya-shared-types-0.2.0.tgz","fileCount":8,"integrity":"sha512-nhNY7aTujMEun5KdhYSI8Tc8FsBceJhZfQKSYgBt03YUEP0Nl/irB6X4KNnbL8bVOsp24W221wtg5wG13+Qhzw==","signatures":[{"sig":"MEUCIFzw5Qh/8yrZLIffZV64b9ODT1GB/gDgJSpIEPYDo0zIAiEAzh4q82PxwtbVNT2EQMu7YBD0VAmlbOe81We/jdDESMY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9274},"main":"./src/index.ts","type":"module","_from":"file:8xlabsai-hekaya-shared-types-0.2.0.tgz","types":"./src/index.ts","exports":{".":"./src/index.ts"},"scripts":{"typecheck":"tsc --noEmit"},"_npmUser":{"name":"batout","email":"amr.z.abdo@gmail.com"},"_resolved":"/tmp/34f81c6aa7a21b9cc7aee06c7b019330/8xlabsai-hekaya-shared-types-0.2.0.tgz","_integrity":"sha512-nhNY7aTujMEun5KdhYSI8Tc8FsBceJhZfQKSYgBt03YUEP0Nl/irB6X4KNnbL8bVOsp24W221wtg5wG13+Qhzw==","repository":{"url":"git+https://github.com/8xlabs-ai/hekaya.ai.git","type":"git","directory":"packages/shared-types"},"_npmVersion":"10.8.2","description":"Hekaya WebSocket protocol + shared TypeScript types (visitor / agent / actions / demos).","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3","@hekaya/config-tsconfig":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hekaya-shared-types_0.2.0_1778374199192_0.9716233587619163","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@8xlabsai/hekaya-shared-types","version":"0.2.1","description":"Hekaya WebSocket protocol + shared TypeScript types (visitor / agent / actions / demos).","license":"MIT","type":"module","main":"./src/index.ts","types":"./src/index.ts","exports":{".":"./src/index.ts"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/8xlabs-ai/hekaya.ai.git","directory":"packages/shared-types"},"devDependencies":{"typescript":"^5.6.3","@hekaya/config-tsconfig":"0.0.0"},"scripts":{"typecheck":"tsc --noEmit"},"_id":"@8xlabsai/hekaya-shared-types@0.2.1","bugs":{"url":"https://github.com/8xlabs-ai/hekaya.ai/issues"},"homepage":"https://github.com/8xlabs-ai/hekaya.ai#readme","_integrity":"sha512-G/87h/aOXaMhiPBJ4OC8qc003X0ne9ZVjfAYccdhoOka89LXtnFfnHgX68gWl7mwAsq4Nd0p7bMU6gIn+1z3Gw==","_resolved":"/tmp/cca99caaa8a295332c36fd332b707ab8/8xlabsai-hekaya-shared-types-0.2.1.tgz","_from":"file:8xlabsai-hekaya-shared-types-0.2.1.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-G/87h/aOXaMhiPBJ4OC8qc003X0ne9ZVjfAYccdhoOka89LXtnFfnHgX68gWl7mwAsq4Nd0p7bMU6gIn+1z3Gw==","shasum":"f571a2be8ecff363c8f624dfdc42ae85f3a700fc","tarball":"https://registry.npmjs.org/@8xlabsai/hekaya-shared-types/-/hekaya-shared-types-0.2.1.tgz","fileCount":9,"unpackedSize":11766,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAbGcBDgyxqtQ6NHL6Qgq6rKdcjg5FRRBwWicz+sTUmtAiEAt7LbaAXuQ4zvZF/RhrYjNxmy8yizd4ydHYtb6U1lhxk="}]},"_npmUser":{"name":"batout","email":"amr.z.abdo@gmail.com"},"directories":{},"maintainers":[{"name":"batout","email":"amr.z.abdo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hekaya-shared-types_0.2.1_1778374815441_0.6994910891215571"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-10T00:49:59.091Z","modified":"2026-05-10T01:00:15.739Z","0.2.0":"2026-05-10T00:49:59.351Z","0.2.1":"2026-05-10T01:00:15.617Z"},"bugs":{"url":"https://github.com/8xlabs-ai/hekaya.ai/issues"},"license":"MIT","homepage":"https://github.com/8xlabs-ai/hekaya.ai#readme","repository":{"type":"git","url":"git+https://github.com/8xlabs-ai/hekaya.ai.git","directory":"packages/shared-types"},"description":"Hekaya WebSocket protocol + shared TypeScript types (visitor / agent / actions / demos).","maintainers":[{"name":"batout","email":"amr.z.abdo@gmail.com"}],"readme":"# @8xlabsai/hekaya-shared-types\n\n[![npm version](https://img.shields.io/npm/v/@8xlabsai/hekaya-shared-types.svg)](https://www.npmjs.com/package/@8xlabsai/hekaya-shared-types)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nWebSocket protocol + shared TypeScript types for the [Hekaya](https://github.com/8xlabs-ai/hekaya.ai) AI sales-agent platform. Used by the embeddable widget runtime, the orchestrator, the Chrome extension recorder, and the dashboard — keeps the wire format consistent across all five surfaces.\n\n## Install\n\n```bash\npnpm add @8xlabsai/hekaya-shared-types\n# or\nnpm install @8xlabsai/hekaya-shared-types\n# or\nyarn add @8xlabsai/hekaya-shared-types\n```\n\n## Quickstart\n\nType a custom WebSocket client that talks to the Hekaya orchestrator:\n\n```ts\nimport type {\n  ClientToServer,\n  ServerToClient,\n  AgentResponse,\n  AgentAction,\n  SelectorTuple,\n} from '@8xlabsai/hekaya-shared-types';\n\nconst ws = new WebSocket('wss://api.hekaya.ai/ws?session=...');\n\nws.onmessage = (event) => {\n  const msg: ServerToClient = JSON.parse(event.data);\n\n  if (msg.type === 'agent_response') {\n    const reply = msg as AgentResponse;\n    console.log('reply:', reply.delta);\n    reply.actions?.forEach(handleAction);\n  } else if (msg.type === 'agent_demo_offer') {\n    console.log('demo offer:', msg.demo_slug, msg.demo_kind);\n  } else if (msg.type === 'escalation') {\n    console.log('escalation:', msg.kind);\n  }\n};\n\nfunction handleAction(action: AgentAction): void {\n  // resolve selector tuple, execute step, send action_ack\n}\n\nfunction send(msg: ClientToServer): void {\n  ws.send(JSON.stringify(msg));\n}\n```\n\n## What's exported\n\n- **WebSocket frames** — `VisitorMessage`, `SessionStart`, `SessionContext`, `ActionAck`, `PersonaSwitch`, `DemoStart`, `DemoEvent`, `AgentResponse`, `AgentDemoOffer`, `AgentVoiceTurn`, `Escalation`.\n- **Discriminated unions** — `ClientToServer`, `ServerToClient`.\n- **Action shapes** — `AgentAction` (kinds: navigate / highlight / click / fill / scroll / wait), `SelectorTuple` (3-tier), `Selector` (5 kinds: aria_role_text / data_attr / text / css / xpath).\n- **Citation + bilingual narration** — `Citation`, narration `{ ar, en }`.\n\n## Versioning\n\nSemver. Major bump = wire-protocol breaking change (rare; coordinated with widget + orchestrator).\n\n## Source\n\nMonorepo: [github.com/8xlabs-ai/hekaya.ai](https://github.com/8xlabs-ai/hekaya.ai) → `packages/shared-types/`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}