{"_id":"@asyncflowstate/astro","name":"@asyncflowstate/astro","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@asyncflowstate/astro","version":"3.0.0","private":false,"description":"Official Astro bindings for AsyncFlowState. Supports Astro Actions and provide framework-agnostic utilities for Astro projects.","author":{"name":"AsyncFlowState Contributors"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/devhimanshuu/asyncflowstate.git","directory":"packages/astro"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"peerDependencies":{"astro":"^4.0.0 || ^5.0.0"},"dependencies":{"@asyncflowstate/core":"3.0.0"},"devDependencies":{"astro":"^5.3.0"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","typecheck":"tsc --noEmit"},"_id":"@asyncflowstate/astro@3.0.0","bugs":{"url":"https://github.com/devhimanshuu/asyncflowstate/issues"},"homepage":"https://github.com/devhimanshuu/asyncflowstate#readme","_integrity":"sha512-nosKa2LXB/goU0QvTBiZFS7nannaivywDNUWzo8dKbB+09AAnqkq4s+ukeA+a8acPq/fVH1XRnjma9GF2PqEzg==","_resolved":"C:\\Users\\pc\\AppData\\Local\\Temp\\f572716344b310dba2d457b6f3d6fd01\\asyncflowstate-astro-3.0.0.tgz","_from":"file:asyncflowstate-astro-3.0.0.tgz","_nodeVersion":"22.17.1","_npmVersion":"11.13.0","dist":{"integrity":"sha512-nosKa2LXB/goU0QvTBiZFS7nannaivywDNUWzo8dKbB+09AAnqkq4s+ukeA+a8acPq/fVH1XRnjma9GF2PqEzg==","shasum":"6cea479469973c5724a19111846b96641207a0ef","tarball":"https://registry.npmjs.org/@asyncflowstate/astro/-/astro-3.0.0.tgz","fileCount":9,"unpackedSize":11641,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAOXInN/03Xx6XXHyEGNiGf4QUpccPAak1BLJ5m4gb/LAiAoXwGtW8md7lg3E7lwmz7SMv8pM8z269msrA0Ij79yZQ=="}]},"_npmUser":{"name":"devhimanshuu","email":"devhimanshuu@gmail.com"},"directories":{},"maintainers":[{"name":"devhimanshuu","email":"devhimanshuu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/astro_3.0.0_1777546157649_0.3388682455491858"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T10:49:17.558Z","3.0.0":"2026-04-30T10:49:17.790Z","modified":"2026-04-30T10:49:18.025Z"},"maintainers":[{"name":"devhimanshuu","email":"devhimanshuu@gmail.com"}],"description":"Official Astro bindings for AsyncFlowState. Supports Astro Actions and provide framework-agnostic utilities for Astro projects.","homepage":"https://github.com/devhimanshuu/asyncflowstate#readme","repository":{"type":"git","url":"git+https://github.com/devhimanshuu/asyncflowstate.git","directory":"packages/astro"},"author":{"name":"AsyncFlowState Contributors"},"bugs":{"url":"https://github.com/devhimanshuu/asyncflowstate/issues"},"license":"MIT","readme":"<div align=\"center\">\n  <a href=\"https://github.com/devhimanshuu/asyncflowstate\">\n    <img src=\"https://raw.githubusercontent.com/devhimanshuu/asyncflowstate/main/assets/AsyncFlowState_logo.png\" width=\"120\" height=\"120\" alt=\"AsyncFlowState Logo\" />\n  </a>\n  <h1>@asyncflowstate/astro <span style=\"font-size: 14px; background: #ff5d0122; color: #ff5d01; padding: 4px 10px; border-radius: 20px; vertical-align: middle; margin-left: 10px;\">v3.0.0 Stable</span></h1>\n  <p><b>Astro-optimized behavior orchestration for AsyncFlowState.</b></p>\n\n  <p>\n    <a href=\"https://asyncflowstate-js.pages.dev/frameworks/astro\"><img src=\"https://img.shields.io/badge/Documentation-Link-blue.svg\" alt=\"Documentation\" /></a>\n    <a href=\"https://opensource.org/licenses/MIT\"><img src=\"https://img.shields.io/badge/License-MIT-emerald.svg\" alt=\"License: MIT\" /></a>\n    <a href=\"https://www.npmjs.com/package/@asyncflowstate/astro\"><img src=\"https://img.shields.io/npm/v/@asyncflowstate/astro?color=indigo\" alt=\"NPM Version\" /></a>\n  </p>\n</div>\n\n---\n\n## Installation\n\n```bash\npnpm add @asyncflowstate/astro @asyncflowstate/core\n```\n\n## Quick Start\n\n### Basic Astro Action Flow\n\n```tsx\nimport { createAstroFlow } from \"@asyncflowstate/astro\";\n\n// Use within any Astro Island (React, Vue, Svelte, Solid)\nconst flow = createAstroFlow(async (data) => {\n  return await actions.todo.create(data);\n});\n```\n\n## Comprehensive Examples\n\n### 1. Zero-Config Optimistic UI\n\nUpdate your Astro Island state instantly while the background Action processes.\n\n```tsx\nconst flow = createAstroFlow(actions.likePost, {\n  optimisticResult: (prev) => ({ ...prev, liked: true }),\n  rollbackOnError: true,\n});\n```\n\n### 2. AI-Powered: Speculative Prefetching\n\nAstro's static nature meets dynamic intent. Pre-warm your actions based on user hover intent.\n\n```tsx\nconst flow = createAstroFlow(actions.getDetails, {\n  predictive: { prefetchOnHover: true },\n});\n\nreturn (\n  <button onMouseEnter={flow.prewarm} onClick={() => flow.execute()}>\n    View Details\n  </button>\n);\n```\n\n### 3. Edge-First Flows\n\nNative support for Astro on the Edge (Cloudflare, Vercel). Automatic detection of Edge runtime capabilities.\n\n```tsx\nconst flow = createAstroFlow(apiAction, {\n  edge: { cache: \"force-cache\" },\n});\n```\n\n### 4. Cross-Island State Sync\n\nSynchronize async state between different framework islands (e.g., React and Vue) on the same page.\n\n```tsx\nconst flow = createAstroFlow(actions.updateProfile, {\n  crossTab: { sync: true, channel: \"astro-islands-mesh\" },\n});\n```\n\n## <i class=\"fa-solid fa-sparkles text-amber-500\"></i> New in v3.0\n\n- **Flow DNA:** Self-healing actions for Astro hybrid rendering.\n- **Speculative Execution:** Predicted user intent for zero-latency interactions.\n- **Ambient Intelligence:** Background monitoring for Astro island hydration.\n- **Collaborative Mesh:** Real-time state synchronization across islands.\n- **Edge-First Logic:** Optimized for Astro Edge middleware and adapters.\n- **Telemetry Dashboard:** Live monitoring of Astro action performance.\n\n## License\n\nMIT © [AsyncFlowState Contributors](https://github.com/devhimanshuu/asyncflowstate)\n","readmeFilename":"README.md","_rev":"1-1b9d9da842e2a0a6e9e24cea53fd21ca"}