{"_id":"@eistatistik/tour-agent-core","name":"@eistatistik/tour-agent-core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@eistatistik/tour-agent-core","version":"0.1.0","description":"Headless core runtime for TourAgent with custom UI support","main":"src/index.js","module":"src/index.js","types":"index.d.ts","bin":{"tour-agent":"cli.mjs"},"exports":{".":{"types":"./index.d.ts","import":"./src/index.js","default":"./src/index.js"}},"unpkg":"dist/tour-agent-core.js","jsdelivr":"dist/tour-agent-core.js","scripts":{"build":"node build.mjs","dev":"node build.mjs --watch","prepublishOnly":"npm run build"},"keywords":["tour","agent","onboarding","ai","overlay","headless"],"license":"MIT","devDependencies":{"esbuild":"^0.25.0"},"_id":"@eistatistik/tour-agent-core@0.1.0","gitHead":"c46875200faab2e1e2c9a634d00740f418366074","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-mia+meZmupUdOaFB2zhiINIe7AME4k3JNQahrwp8m79QhmhkIRNzIHH+SQAv6M3TjQD4YMa2R3j20gm5ap3vDw==","shasum":"3d691c13a4884b9808a4bf0473a75da756815664","tarball":"https://registry.npmjs.org/@eistatistik/tour-agent-core/-/tour-agent-core-0.1.0.tgz","fileCount":17,"unpackedSize":234062,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAbZNgkpi4fk6dzkbhOx0lIi83A/Ibuz+iYDbYPmemH6AiAlQQgsyhtc95ci5suJzlZc3u3Xpf4xaJrlg/414RlTYw=="}]},"_npmUser":{"name":"eistatistik","email":"istabot.info@gmail.com"},"directories":{},"maintainers":[{"name":"eistatistik","email":"istabot.info@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tour-agent-core_0.1.0_1774886717263_0.8202105298882543"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-30T16:05:17.165Z","0.1.0":"2026-03-30T16:05:17.399Z","modified":"2026-03-30T16:05:17.585Z"},"maintainers":[{"name":"eistatistik","email":"istabot.info@gmail.com"}],"description":"Headless core runtime for TourAgent with custom UI support","keywords":["tour","agent","onboarding","ai","overlay","headless"],"license":"MIT","readme":"# @xtatistix/tour-agent-core\n\nHeadless TourAgent runtime for teams that want to bring their own UI.\n\nThis package owns:\n\n- DOM parsing\n- self-healing\n- local AI matching\n- OpenAI tour generation\n- overlay rendering\n- persisted cross-page tour sessions\n\nThis package does not mount the floating widget UI. Your app calls `startPreset` or `startPrompt` from your own buttons, command palette, chat UI, or custom panel.\n\n## Install\n\n```bash\nnpm install @xtatistix/tour-agent-core\n```\n\n## Example\n\n```tsx\n'use client';\n\nimport { useEffect } from 'react';\nimport { destroy, init, startPrompt } from '@xtatistix/tour-agent-core';\n\nexport function CustomTourUI() {\n  useEffect(() => {\n    init({\n      apiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY,\n      session: {\n        storage: 'sessionStorage',\n        resumeOnInit: true,\n        followNavigation: true,\n      },\n    });\n\n    return () => destroy();\n  }, []);\n\n  return (\n    <button onClick={() => startPrompt('How do I export this report?')}>\n      Ask TourAgent\n    </button>\n  );\n}\n```\n\n## Session Continuity\n\n- Active tours are persisted in browser storage until they finish, fail, or are closed.\n- `sessionStorage` is the default persistence layer for same-tab persistence and refresh resume.\n- Cross-page navigation following is opt-in via `session.followNavigation: true`.\n- Free-text prompt tours can replan from the new page after navigation to continue from the current DOM.\n- When `followNavigation` is left disabled, tours remain page-scoped and do not try to resume after route changes.\n- The package only persists the runtime `followNavigation` preference; other session options remain per-initialization config.\n\n## Session Config API\n\n```ts\ngetSessionConfig()\nsetSessionConfig({ followNavigation: true })\nresetSessionConfig()\n```\n\n## Static Tour CLI\n\nThe core package also ships a CLI for generating static preset tours from a natural-language prompt.\n\n```bash\ntour-agent --static -m \"Bir kullanıcının nasıl rapor ekleyeceğini gösteren turu bana çıkar\" -o ./generated/report-tour.json\n```\n\nThe CLI writes a JSON array of `TourDefinition` objects. Because it does not inspect a live DOM, its output should be reviewed and aligned with your application’s real `data-tour-id` values before use.\n\nDetailed usage is documented in [docs/static-tour-cli.md](/Users/mert/tour-agent/docs/static-tour-cli.md).\n","readmeFilename":"README.md","_rev":"1-acc486ce5258bcd23fa52b996fe6ccf0"}