[{"data":1,"prerenderedAt":223},["ShallowReactive",2],{"navigation_docs":3,"-guide-agent-setup":93,"-guide-agent-setup-surround":218},[4,71],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":70},"Guide","i-lucide-book-open","\u002Fguide","1.guide",[10,14,18,22,26,30,34,38,42,46,50,54,58,62,66],{"title":11,"path":12,"stem":13},"Getting started","\u002Fguide\u002Fgetting-started","1.guide\u002F01.getting-started",{"title":15,"path":16,"stem":17},"Adoption paths","\u002Fguide\u002Fadoption","1.guide\u002F02.adoption",{"title":19,"path":20,"stem":21},"Routes and typed $fetch","\u002Fguide\u002Froutes","1.guide\u002F02.routes",{"title":23,"path":24,"stem":25},"Kyo handlers","\u002Fguide\u002Fkyo","1.guide\u002F03.kyo",{"title":27,"path":28,"stem":29},"ZIO handlers","\u002Fguide\u002Fzio","1.guide\u002F04.zio",{"title":31,"path":32,"stem":33},"Configuration and secrets","\u002Fguide\u002Fconfiguration","1.guide\u002F05.configuration",{"title":35,"path":36,"stem":37},"Application and request lifetimes","\u002Fguide\u002Flifetimes","1.guide\u002F06.lifetimes",{"title":39,"path":40,"stem":41},"Schemas","\u002Fguide\u002Fschema","1.guide\u002F07.schema",{"title":43,"path":44,"stem":45},"PostgreSQL","\u002Fguide\u002Fdatabase","1.guide\u002F08.database",{"title":47,"path":48,"stem":49},"Streaming and cancellation","\u002Fguide\u002Fstreaming","1.guide\u002F09.streaming",{"title":51,"path":52,"stem":53},"Testing","\u002Fguide\u002Ftesting","1.guide\u002F10.testing",{"title":55,"path":56,"stem":57},"Nitro storage and NuxtHub KV","\u002Fguide\u002Fstorage","1.guide\u002F11.storage",{"title":59,"path":60,"stem":61},"Debug Scala handlers","\u002Fguide\u002Fdebugging","1.guide\u002F12.debugging",{"title":63,"path":64,"stem":65},"npm build tooling","\u002Fguide\u002Fnpm-tooling","1.guide\u002F13.npm-tooling",{"title":67,"path":68,"stem":69},"Set up h34s with a coding assistant","\u002Fguide\u002Fagent-setup","1.guide\u002F14.agent-setup",false,{"title":72,"icon":73,"path":74,"stem":75,"children":76,"page":70},"Reference","i-lucide-library","\u002Freference","2.reference",[77,81,85,89],{"title":78,"path":79,"stem":80},"Architecture","\u002Freference\u002Farchitecture","2.reference\u002F1.architecture",{"title":82,"path":83,"stem":84},"Releases","\u002Freference\u002Freleases","2.reference\u002F2.releases",{"title":86,"path":87,"stem":88},"Compatibility","\u002Freference\u002Fcompatibility","2.reference\u002F3.compatibility",{"title":90,"path":91,"stem":92},"Migration guide","\u002Freference\u002Fmigration","2.reference\u002F4.migration",{"id":94,"title":67,"body":95,"description":211,"extension":212,"links":213,"meta":214,"navigation":215,"path":68,"seo":216,"stem":69,"__hash__":217},"docs\u002F1.guide\u002F14.agent-setup.md",{"type":96,"value":97,"toc":205},"minimark",[98,107,112,152,156,166,170],[99,100,101,102,106],"p",{},"Copy the prompt from the code block below into your coding assistant. The prompt asks the assistant to perform the steps of the ",[103,104,105],"a",{"href":16},"adoption guide"," on any of its three paths. Nobody has run this prompt end to end with an assistant yet, so review every change that the assistant reports.",[108,109,111],"h2",{"id":110},"before-you-start","Before you start",[113,114,115,129,149],"ol",{},[116,117,118,119,123,124,128],"li",{},"Create a classic GitHub personal access token with ",[120,121,122],"code",{},"read:packages",". ",[103,125,127],{"href":126},"\u002Freference\u002Freleases#authenticate-package-reads","Authenticate package reads"," says which account and access it needs.",[116,130,131,132,135,136,139,140,143,144,148],{},"Set ",[120,133,134],{},"GITHUB_PACKAGES_USER"," to the GitHub username that owns the token, and ",[120,137,138],{},"GITHUB_PACKAGES_TOKEN"," to the token, in your shell or secret manager. sbt reads both variables. npm reads the token through ",[120,141,142],{},".npmrc",", as in ",[103,145,147],{"href":146},"\u002Fguide\u002Fnpm-tooling#install-the-tooling","Install the tooling",".",[116,150,151],{},"Start the assistant from a shell where both variables are set. Never paste the token into the chat: the assistant needs only the variable names.",[108,153,155],{"id":154},"the-prompt","The prompt",[157,158,164],"pre",{"className":159,"code":161,"language":162,"meta":163},[160],"language-text","You are adding h34s 0.2.0-alpha.1 (Scala.js server handlers for Nuxt) to this project. Follow the\nguides `docs\u002Fcontent\u002F1.guide\u002F02.adoption.md`, `docs\u002Fcontent\u002F2.reference\u002F2.releases.md` and\n`docs\u002Fcontent\u002F1.guide\u002F13.npm-tooling.md` in the `yuri4n\u002Fh34s` GitHub repository, and these\nrules. If you cannot read a guide, ask me to paste the section.\n\n1. Ask me three things first, and wait for my answers: the effect API (Kyo or ZIO; default Kyo),\n   the Scala directory (default `scala-server`) and the Scala package. The default package is\n   the project directory's name in lower case, letters and digits only, if the result starts\n   with a letter and is not a Scala keyword. Otherwise, there is no default: ask me for a name.\n2. Never write, print or commit a token, including one you find in a file. Use only\n   environment-variable references: `${GITHUB_PACKAGES_TOKEN}` in `.npmrc`, and\n   `sys.env.get(\"GITHUB_PACKAGES_USER\")` and `sys.env.get(\"GITHUB_PACKAGES_TOKEN\")` in sbt.\n   Check whether a variable is set without printing it, for example `test -n \"$GITHUB_PACKAGES_USER\"`.\n   If one is not set, tell me its name and continue; skip the steps that download packages.\n3. Detect the path in the directory I name (default: this one). The first match wins:\n   - `h34s.config.mjs` exists: stop. The project is already set up.\n   - The directory is missing, empty, or holds only `.git`: a new project. Create a minimal\n     Nuxt 4 app with `nuxt` pinned to 4.3.1, then add the sbt build in it.\n   - `nuxt.config.*` exists: an existing Nuxt app. Add the sbt build at the Nuxt root. If\n     `build.sbt` exists there too, put the h34s settings in a new `h34s.sbt`.\n   - `build.sbt` exists and no `nuxt.config.*`: an existing sbt build. Create a minimal Nuxt 4 app\n     with `nuxt` pinned to 4.3.1 at the sbt root, and put the h34s settings in a new `h34s.sbt`\n     next to `build.sbt`. In your report, remind me that the modules my handlers depend on must\n     cross-build for Scala.js and use Scala 3.9.0.\n   - Anything else: stop and ask me.\n4. Change a file that existed before you started only by adding lines or entries; never\n   overwrite it. Never edit an existing `build.sbt`. If a file you must create, such as\n   `server\u002Fapi\u002Fhello.get.ts`, already exists, ask me.\n5. Use these versions: JDK 25 to run sbt, sbt 1.11.7, Scala 3.9.0, `sbt-scalajs` 1.22.0, Node 24,\n   `\"dev.yuri4n\" %%% \"kyo-h3-ext\" % \"0.2.0-alpha.1\"` (for ZIO, `zio-h3-ext`), pnpm 10.34.4,\n   `@yuri4n\u002Fh34s-nuxt@0.2.0-alpha.1` and `h3@1.15.4`. If `java -version` differs, tell me. If an\n   existing app's Nuxt version is not 4.3.1 or 4.4.2, stop and ask me before you change anything.\n6. Take the sbt files and the server project from \"Configure the Scala.js module\" in the adoption\n   guide, with my Scala directory. Add the resolver and credentials block from \"Authenticate\n   package reads\" on the Releases page. If `project\u002F` sets another `sbt.version` or `sbt-scalajs`\n   version, or the build already has a project named `server`, ask me.\n7. Add the two `.npmrc` lines from \"Install the tooling\" in the npm tooling guide. Skip a line\n   that `.npmrc` already holds. If `.npmrc` configures the `@yuri4n` scope or\n   `npm.pkg.github.com` in another way, ask me.\n8. Do not run `nuxi module add`. Run `pnpm add -D @yuri4n\u002Fh34s-nuxt@0.2.0-alpha.1` and\n   `pnpm add h3@1.15.4`.\n9. Write `h34s.config.mjs` from \"Write, mount and run a handler\" before you add\n   `'@yuri4n\u002Fh34s-nuxt'` to `modules` in the Nuxt config. The module stops Nuxt when that file\n   is missing. Edit the Nuxt config yourself.\n10. Use the scripts from \"Add the Nuxt module and scripts\" in the npm tooling guide. Add the\n    missing ones, and replace the ones you created, such as the `dev` and `build` scripts of a\n    new Nuxt app. If `dev` or `build` existed before you started, do not replace it; show me the\n    change instead, because `build` must run `pnpm run scala:full` before `nuxt build`.\n11. Write the handler from \"Write, mount and run a handler\" in my package, as `Hello.scala` in\n    `src\u002Fmain\u002Fscala\u002F` of my Scala directory, and its route file `server\u002Fapi\u002Fhello.get.ts`.\n    For ZIO, import `dev.yuri4n.exts.zioh3.*` instead of `dev.yuri4n.exts.kyoh3.*`, add\n    `import zio.ZIO`, and define the handler as\n    `ZHandler.define(_ => ZIO.succeed(Greeting(\"Hello from Scala\")))`.\n12. Keep `server\u002F.scala` for generated files only: a production build deletes it. If it already\n    holds files, ask me. Add the missing `.gitignore` entries: `server\u002F.scala\u002F`, `target\u002F`,\n    `project\u002Ftarget\u002F`, `project\u002Fproject\u002F`, `.bsp\u002F` and `.metals\u002F`, and for a new Nuxt app also\n    `.nuxt\u002F`, `.output\u002F` and `node_modules\u002F`.\n13. Verify: run `pnpm install`, start `pnpm dev:scala` in the background, wait until Nuxt\n    listens, request `http:\u002F\u002F127.0.0.1:3000\u002Fapi\u002Fhello` (or the port Nuxt prints), then stop the\n    server. Expect `{\"data\":{\"message\":\"Hello from Scala\"}}`.\n14. Do not commit. Report the result, every file you created or changed, and every step you\n    skipped or that I must do myself.\n","text","",[120,165,161],{"__ignoreMap":163},[108,167,169],{"id":168},"if-something-fails","If something fails",[99,171,172,173,177,178,181,182,185,186,189,190,193,194,196,197,123,200,204],{},"Start with the recovery notes at the end of ",[103,174,176],{"href":175},"\u002Fguide\u002Fadoption#write-mount-and-run-a-handler","Write, mount and run a handler",": they cover a 404, an ",[120,179,180],{},"h3"," that Nitro cannot resolve, and a missing linked module. If Nuxt stops with ",[120,183,184],{},"Missing h34s config",", create ",[120,187,188],{},"h34s.config.mjs"," next to ",[120,191,192],{},"package.json",", as in the adoption guide. For HTTP 401 or 403 from a registry, check the token and its access in ",[103,195,127],{"href":126},". For a 500 or a stack trace, see ",[103,198,199],{"href":60},"debugging",[103,201,203],{"href":202},"\u002Fguide\u002Fadoption#what-is-verified","What is verified"," says which parts of this setup have been tested.",{"title":163,"searchDepth":206,"depth":206,"links":207},2,[208,209,210],{"id":110,"depth":206,"text":111},{"id":154,"depth":206,"text":155},{"id":168,"depth":206,"text":169},"A prompt that a coding assistant follows to add h34s to a new project, an existing Nuxt app, or an existing Scala.js project.","md",null,{},true,{"title":67,"description":211},"zboPuRHjcw8R1F_BrIp4i5h1JiKhfr6GwCUwRWpXDh4",[219,221],{"title":63,"path":64,"stem":65,"description":220,"children":-1},"Configure the shared Scala.js CLI and Nuxt module, including the Nitro plugin that supplies config, storage and shutdown to Scala.",{"title":78,"path":79,"stem":80,"description":222,"children":-1},"An effect-free native layer, a Kyo core, a hand-written ZIO adapter, optional schema and storage bridges, and your application.",1792533383164]