diff --git a/vendor/dynamic-apps/docs/content/docs/_architecture-diagram.astro b/vendor/dynamic-apps/docs/content/docs/_architecture-diagram.astro index 768849a..9eb0b22 100644 --- a/vendor/dynamic-apps/docs/content/docs/_architecture-diagram.astro +++ b/vendor/dynamic-apps/docs/content/docs/_architecture-diagram.astro @@ -1,4 +1,4 @@ - + @@ -25,5 +25,5 @@ - V8 isolate + agentOS VM diff --git a/vendor/dynamic-apps/docs/content/docs/architecture.mdx b/vendor/dynamic-apps/docs/content/docs/architecture.mdx index 70c70be..648f0ce 100644 --- a/vendor/dynamic-apps/docs/content/docs/architecture.mdx +++ b/vendor/dynamic-apps/docs/content/docs/architecture.mdx @@ -23,7 +23,8 @@ The request lifecycle looks like: Requests reach your routing server, where `appsRouter` executes them in a cached agentOS VM embedded in the same process. There is no network hop to -another service, and warm requests never touch storage. +another service, and warm requests never touch storage. Apps export fetch +handlers; Dynamic Apps owns any listener inside the VM. ## Deployment is separate from serving @@ -35,11 +36,11 @@ supply another store. ## App-defined actors An app may also export a RivetKit registry. Those app-defined actors use normal -Rivet routing for durable state, actions, events, and connections, while the -same app's ordinary HTTP handler still runs through the agentOS VM. +Rivet routing for durable state, actions, events, and connections. Dynamic Apps +imports the app once into a cached server process, then sends both ordinary HTTP +and Rivet callbacks through that process. agentOS provides the filesystem, process, environment, and network permission -boundary for direct requests. App-defined actor workers share the host process, -so run one trust domain per container for mutually untrusted tenants. +boundary for direct requests and app-defined actor workers. diff --git a/vendor/dynamic-apps/docs/content/docs/core.mdx b/vendor/dynamic-apps/docs/content/docs/core.mdx index 033f52c..dd6ce32 100644 --- a/vendor/dynamic-apps/docs/content/docs/core.mdx +++ b/vendor/dynamic-apps/docs/content/docs/core.mdx @@ -45,4 +45,9 @@ change for the entire lifetime of every serving process. Call `await dynamicApps.dispose()` during shutdown to release subscriptions, build resources, cached runtimes, and agentOS contexts. +Deployed app entrypoints only export a Fetch handler; they never bind a port. +If Core loads an actor-enabled release, provide its `server.environment` and a +shared `serverRuntime`. The standard `@rivet-dev/dynamic-apps` package supplies +that actor runtime automatically. + Get started with the [Quickstart (Core)](/dynamic-apps/docs/quickstart-core). diff --git a/vendor/dynamic-apps/docs/content/docs/deploy.mdx b/vendor/dynamic-apps/docs/content/docs/deploy.mdx index c4a48bc..8e39890 100644 --- a/vendor/dynamic-apps/docs/content/docs/deploy.mdx +++ b/vendor/dynamic-apps/docs/content/docs/deploy.mdx @@ -44,29 +44,20 @@ await deployApp({ An app needs two things: - A `package.json`. -- An entrypoint that either listens on the `PORT` environment variable or - default-exports a `fetch` handler. +- An entrypoint that default-exports a `fetch` handler. -**Listen on `PORT`:** +Dynamic Apps owns the HTTP listener. Application code must not call `serve()`, +`listen()`, or `registry.start()`. + +With Hono, export the app directly: ```ts -import { serve } from "@hono/node-server"; import { Hono } from "hono"; const app = new Hono(); app.get("/", (c) => c.json({ ok: true })); -serve({ fetch: app.fetch, port: Number(process.env.PORT ?? 3000) }); -``` - -**Or export a `fetch` handler:** - -```ts -export default { - fetch() { - return new Response("hello"); - }, -}; +export default app; ``` ## Build and repair loop diff --git a/vendor/dynamic-apps/docs/content/docs/generate.mdx b/vendor/dynamic-apps/docs/content/docs/generate.mdx index ffd5632..4764f28 100644 --- a/vendor/dynamic-apps/docs/content/docs/generate.mdx +++ b/vendor/dynamic-apps/docs/content/docs/generate.mdx @@ -45,7 +45,7 @@ generated code compiles and serves on the first try more often. | Skill | What the model learns | | --- | --- | -| `webServerSkill` | The supported TypeScript HTTP server layout: `package.json`, `tsconfig.json`, and a Hono entrypoint. | +| `webServerSkill` | The supported TypeScript Fetch-handler layout: `package.json`, `tsconfig.json`, and a Hono entrypoint with no application-owned listener. | | `rivetActorsSkill` | The same layout plus Rivet Actors: durable state, actions, and HTTP routes backed by actors. | More skills will be added over time. diff --git a/vendor/dynamic-apps/docs/content/docs/multiplayer.mdx b/vendor/dynamic-apps/docs/content/docs/multiplayer.mdx index 0d587db..e6598f4 100644 --- a/vendor/dynamic-apps/docs/content/docs/multiplayer.mdx +++ b/vendor/dynamic-apps/docs/content/docs/multiplayer.mdx @@ -9,7 +9,7 @@ import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro"; ## Example generated code - + ## Deploy and connect diff --git a/vendor/dynamic-apps/docs/content/docs/quickstart.mdx b/vendor/dynamic-apps/docs/content/docs/quickstart.mdx index d8f5fcb..1b0789b 100644 --- a/vendor/dynamic-apps/docs/content/docs/quickstart.mdx +++ b/vendor/dynamic-apps/docs/content/docs/quickstart.mdx @@ -33,7 +33,8 @@ npm pkg set type=module Mount the private Rivet callback separately from application traffic. The callback lets Rivet reach your server to manage deployments. Ordinary app -requests are served by `appsRouter` through a cached agentOS VM. +requests are served by `appsRouter` through agentOS. Generated app code only +exports a Fetch handler; it does not create its own listener. diff --git a/vendor/dynamic-apps/docs/content/docs/sqlite.mdx b/vendor/dynamic-apps/docs/content/docs/sqlite.mdx index 020a411..6b29166 100644 --- a/vendor/dynamic-apps/docs/content/docs/sqlite.mdx +++ b/vendor/dynamic-apps/docs/content/docs/sqlite.mdx @@ -9,7 +9,7 @@ import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro"; ## Example generated code - + ## Deploy and connect diff --git a/vendor/dynamic-apps/docs/content/docs/workflows.mdx b/vendor/dynamic-apps/docs/content/docs/workflows.mdx index 882c7ed..063c022 100644 --- a/vendor/dynamic-apps/docs/content/docs/workflows.mdx +++ b/vendor/dynamic-apps/docs/content/docs/workflows.mdx @@ -9,7 +9,7 @@ import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro"; ## Example generated code - + ## Deploy and connect diff --git a/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/package.json index 7174e19..dc4c4ae 100644 --- a/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/package.json @@ -9,11 +9,10 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "2.0.11", - "hono": "4.12.9" + "hono": "4.13.5" }, "devDependencies": { - "@types/node": "22.19.15", - "typescript": "5.7.3" + "@types/node": "22.20.1", + "typescript": "5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/src/index.ts b/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/src/index.ts index 88dc11a..234b318 100644 --- a/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/src/index.ts +++ b/vendor/dynamic-apps/examples/apps-ai-builder/fixtures/app/src/index.ts @@ -1,4 +1,3 @@ -import { serve } from "@hono/node-server"; import { Hono } from "hono"; const app = new Hono(); @@ -9,7 +8,4 @@ app.get("/", (context) => }), ); -serve({ - fetch: app.fetch, - port: Number(process.env.PORT ?? 3000), -}); +export default app; diff --git a/vendor/dynamic-apps/examples/apps-ai-builder/package.json b/vendor/dynamic-apps/examples/apps-ai-builder/package.json index e1ed9ab..1f71d7e 100644 --- a/vendor/dynamic-apps/examples/apps-ai-builder/package.json +++ b/vendor/dynamic-apps/examples/apps-ai-builder/package.json @@ -8,16 +8,16 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@ai-sdk/anthropic": "^4.0.19", - "@hono/node-server": "^2.0.11", + "@ai-sdk/anthropic": "^4.0.46", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "ai": "^7.0.37", - "hono": "^4.12.9", - "zod": "^4.1.0" + "ai": "^7.0.86", + "hono": "^4.13.5", + "zod": "^4.5.4" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-ai-builder/src/server.ts b/vendor/dynamic-apps/examples/apps-ai-builder/src/server.ts index f385648..0959d72 100644 --- a/vendor/dynamic-apps/examples/apps-ai-builder/src/server.ts +++ b/vendor/dynamic-apps/examples/apps-ai-builder/src/server.ts @@ -8,8 +8,8 @@ import { webServerSkill, } from "@rivet-dev/dynamic-apps"; import { generateObject } from "ai"; -import { z } from "zod"; import { Hono } from "hono"; +import { z } from "zod"; const editablePaths = [ "package.json", diff --git a/vendor/dynamic-apps/examples/apps-core-quickstart/package.json b/vendor/dynamic-apps/examples/apps-core-quickstart/package.json index e0ae2bb..5077bd6 100644 --- a/vendor/dynamic-apps/examples/apps-core-quickstart/package.json +++ b/vendor/dynamic-apps/examples/apps-core-quickstart/package.json @@ -8,13 +8,13 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps-core": "workspace:*", - "hono": "^4.12.9" + "hono": "^4.13.5" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-core-quickstart/src/server.ts b/vendor/dynamic-apps/examples/apps-core-quickstart/src/server.ts index a801a78..999f9b8 100644 --- a/vendor/dynamic-apps/examples/apps-core-quickstart/src/server.ts +++ b/vendor/dynamic-apps/examples/apps-core-quickstart/src/server.ts @@ -1,3 +1,4 @@ +// docs:start setup import { serve } from "@hono/node-server"; import { type ActiveRelease, @@ -19,12 +20,6 @@ const dynamicApps = createDynamicApps({ ...input.artifact, bytes: new Uint8Array(input.artifact.bytes), }, - regions: input.regions ?? ["local"], - scaling: { - minReplicas: input.scaling?.minReplicas ?? 0, - maxReplicas: input.scaling?.maxReplicas ?? 1, - targetConcurrency: input.scaling?.targetConcurrency ?? 8, - }, maxRequestBytes: 1024 * 1024, maxResponseBytes: 4 * 1024 * 1024, }; @@ -38,8 +33,6 @@ const dynamicApps = createDynamicApps({ return release ? { ...release, - regions: [...release.regions], - scaling: { ...release.scaling }, artifact: { ...release.artifact, bytes: new Uint8Array(release.artifact.bytes), @@ -57,21 +50,9 @@ const dynamicApps = createDynamicApps({ }; }, }); +// docs:end setup -const app = new Hono(); -app.route("/apps", dynamicApps.appsRouter); - -let server: ReturnType | undefined; -let shuttingDown = false; -const shutdown = async () => { - if (shuttingDown) return; - shuttingDown = true; - await dynamicApps.dispose(); - server?.close(); -}; -process.once("SIGINT", () => void shutdown()); -process.once("SIGTERM", () => void shutdown()); - +// docs:start deploy await dynamicApps.deployApp({ appId: "hello", files: { @@ -89,10 +70,13 @@ await dynamicApps.deployApp({ `, }, }); +// docs:end deploy + +// docs:start routing +const app = new Hono(); +app.route("/apps", dynamicApps.appsRouter); -const hostIndex = process.argv.indexOf("--host"); -const hostname = hostIndex >= 0 ? process.argv[hostIndex + 1] : "127.0.0.1"; -if (!hostname) throw new Error("--host requires a value"); const port = Number(process.env.PORT ?? 3000); -server = serve({ fetch: app.fetch, hostname, port }); -console.log(`Dynamic Apps Core listening on http://${hostname}:${port}`); +serve({ fetch: app.fetch, port }); +console.log(`Dynamic Apps Core listening on http://localhost:${port}`); +// docs:end routing diff --git a/vendor/dynamic-apps/examples/apps-hello-world/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-hello-world/fixtures/app/package.json index 29af844..18a47cf 100644 --- a/vendor/dynamic-apps/examples/apps-hello-world/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-hello-world/fixtures/app/package.json @@ -3,10 +3,7 @@ "version": "0.0.0", "private": true, "main": "src/index.ts", - "scripts": { - "check-types": "node --check src/index.mjs" - }, "dependencies": { - "hono": "^4.12.9" + "hono": "4.13.5" } } diff --git a/vendor/dynamic-apps/examples/apps-hello-world/package.json b/vendor/dynamic-apps/examples/apps-hello-world/package.json index 993787f..bc1dd38 100644 --- a/vendor/dynamic-apps/examples/apps-hello-world/package.json +++ b/vendor/dynamic-apps/examples/apps-hello-world/package.json @@ -9,13 +9,13 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "hono": "^4.12.9" + "hono": "^4.13.5" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-hello-world/src/deploy.ts b/vendor/dynamic-apps/examples/apps-hello-world/src/deploy.ts index 0798c4d..0bb836c 100644 --- a/vendor/dynamic-apps/examples/apps-hello-world/src/deploy.ts +++ b/vendor/dynamic-apps/examples/apps-hello-world/src/deploy.ts @@ -12,7 +12,7 @@ await deployApp({ type: "module", main: "src/index.ts", dependencies: { - hono: "^4.12.9", + hono: "4.13.5", }, }), "src/index.ts": ` diff --git a/vendor/dynamic-apps/examples/apps-multiplayer/README.md b/vendor/dynamic-apps/examples/apps-multiplayer/README.md new file mode 100644 index 0000000..73b3a97 --- /dev/null +++ b/vendor/dynamic-apps/examples/apps-multiplayer/README.md @@ -0,0 +1,15 @@ +# Dynamic Apps: Multiplayer + +The deployed app defines one keyed room actor. Clients share player positions +and receive realtime events whenever a player joins or moves. + +Run the example with Node.js 22 or newer: + +```sh +pnpm --dir examples/apps-multiplayer start +# In another terminal: +pnpm --dir examples/apps-multiplayer client +``` + +The app's ordinary HTTP handler is available at +`http://localhost:3000/apps/multiplayer-room/`. diff --git a/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/package.json index 7da6914..7466f95 100644 --- a/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/package.json @@ -5,8 +5,7 @@ "type": "module", "main": "src/index.ts", "dependencies": { - "@hono/node-server": "2.1.1", - "hono": "4.13.3", + "hono": "4.13.5", "rivetkit": "2.3.11" } } diff --git a/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/src/index.ts b/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/src/index.ts index 9be651b..6debf36 100644 --- a/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/src/index.ts +++ b/vendor/dynamic-apps/examples/apps-multiplayer/fixtures/app/src/index.ts @@ -1,4 +1,3 @@ -import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { actor, event, setup } from "rivetkit"; @@ -30,15 +29,4 @@ app.get("/", (c) => c.json({ message: "Use the RivetKit client to join a room." }), ); -// Dynamic Apps runs the actors in serverless mode and waits for this listener. -if (process.env.RIVETKIT_RUNTIME_MODE === "serverless") { - await new Promise((resolve, reject) => { - const server = serve( - { fetch: app.fetch, port: Number(process.env.PORT), hostname: "0.0.0.0" }, - () => resolve(), - ); - server.once("error", reject); - }); -} - export default app; diff --git a/vendor/dynamic-apps/examples/apps-multiplayer/package.json b/vendor/dynamic-apps/examples/apps-multiplayer/package.json index dad4ae8..121dd3f 100644 --- a/vendor/dynamic-apps/examples/apps-multiplayer/package.json +++ b/vendor/dynamic-apps/examples/apps-multiplayer/package.json @@ -9,14 +9,14 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "hono": "^4.12.9", + "hono": "^4.13.5", "rivetkit": "2.3.11" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-sqlite/README.md b/vendor/dynamic-apps/examples/apps-sqlite/README.md new file mode 100644 index 0000000..50da64a --- /dev/null +++ b/vendor/dynamic-apps/examples/apps-sqlite/README.md @@ -0,0 +1,15 @@ +# Dynamic Apps: SQLite + +The deployed app defines a RivetKit actor backed by SQLite. The client deploys +the app, connects to its namespace, and writes and reads real database rows. + +Run the example with Node.js 22 or newer: + +```sh +pnpm --dir examples/apps-sqlite start +# In another terminal: +pnpm --dir examples/apps-sqlite client +``` + +The app's ordinary HTTP handler is available at +`http://localhost:3000/apps/sqlite-notes/`. diff --git a/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/package.json index 52522ca..99541d2 100644 --- a/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/package.json @@ -5,8 +5,7 @@ "type": "module", "main": "src/index.ts", "dependencies": { - "@hono/node-server": "2.1.1", - "hono": "4.13.3", + "hono": "4.13.5", "rivetkit": "2.3.11" } } diff --git a/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/src/index.ts b/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/src/index.ts index 553a9ef..bb90691 100644 --- a/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/src/index.ts +++ b/vendor/dynamic-apps/examples/apps-sqlite/fixtures/app/src/index.ts @@ -1,4 +1,3 @@ -import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { actor, setup } from "rivetkit"; import { db } from "rivetkit/db"; @@ -33,15 +32,4 @@ app.get("/", (c) => c.json({ message: "Use the RivetKit client to add notes." }), ); -// Dynamic Apps runs the actors in serverless mode and waits for this listener. -if (process.env.RIVETKIT_RUNTIME_MODE === "serverless") { - await new Promise((resolve, reject) => { - const server = serve( - { fetch: app.fetch, port: Number(process.env.PORT), hostname: "0.0.0.0" }, - () => resolve(), - ); - server.once("error", reject); - }); -} - export default app; diff --git a/vendor/dynamic-apps/examples/apps-sqlite/package.json b/vendor/dynamic-apps/examples/apps-sqlite/package.json index 84bdb1d..f4165d5 100644 --- a/vendor/dynamic-apps/examples/apps-sqlite/package.json +++ b/vendor/dynamic-apps/examples/apps-sqlite/package.json @@ -9,14 +9,14 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "hono": "^4.12.9", + "hono": "^4.13.5", "rivetkit": "2.3.11" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-static-website/README.md b/vendor/dynamic-apps/examples/apps-static-website/README.md new file mode 100644 index 0000000..68ecae1 --- /dev/null +++ b/vendor/dynamic-apps/examples/apps-static-website/README.md @@ -0,0 +1,14 @@ +# Dynamic Apps: Static Website + +A directory with `index.html` and no `package.json` is served directly. CSS, +JavaScript, SVG, and other assets are included in the immutable release. A +package with a build script is treated as a built static site when it emits +`dist/index.html`. + +Run the example with Node.js 22 or newer: + +```sh +pnpm --dir examples/apps-static-website start +``` + +Open `http://localhost:3000/apps/static-website/`. diff --git a/vendor/dynamic-apps/examples/apps-static-website/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-static-website/fixtures/app/package.json index 2119d84..a04f703 100644 --- a/vendor/dynamic-apps/examples/apps-static-website/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-static-website/fixtures/app/package.json @@ -5,6 +5,6 @@ "type": "module", "main": "src/index.ts", "dependencies": { - "hono": "4.13.3" + "hono": "4.13.5" } } diff --git a/vendor/dynamic-apps/examples/apps-static-website/package.json b/vendor/dynamic-apps/examples/apps-static-website/package.json index 3e6e165..e67ed73 100644 --- a/vendor/dynamic-apps/examples/apps-static-website/package.json +++ b/vendor/dynamic-apps/examples/apps-static-website/package.json @@ -8,13 +8,13 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "hono": "^4.12.9" + "hono": "^4.13.5" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } } diff --git a/vendor/dynamic-apps/examples/apps-workflows/README.md b/vendor/dynamic-apps/examples/apps-workflows/README.md new file mode 100644 index 0000000..dd73f04 --- /dev/null +++ b/vendor/dynamic-apps/examples/apps-workflows/README.md @@ -0,0 +1,15 @@ +# Dynamic Apps: Workflows + +The deployed app defines a keyed job actor whose durable workflow starts when +the actor is created, sleeps, and resumes before marking the job complete. + +Run the example with Node.js 22 or newer: + +```sh +pnpm --dir examples/apps-workflows start +# In another terminal: +pnpm --dir examples/apps-workflows client +``` + +The app's ordinary HTTP handler is available at +`http://localhost:3000/apps/durable-workflow/`. diff --git a/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/package.json b/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/package.json index fd1f12c..f2abde4 100644 --- a/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/package.json +++ b/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/package.json @@ -5,8 +5,7 @@ "type": "module", "main": "src/index.ts", "dependencies": { - "@hono/node-server": "2.1.1", - "hono": "4.13.3", + "hono": "4.13.5", "rivetkit": "2.3.11" } } diff --git a/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/src/index.ts b/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/src/index.ts index 3b5439e..b1b2403 100644 --- a/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/src/index.ts +++ b/vendor/dynamic-apps/examples/apps-workflows/fixtures/app/src/index.ts @@ -1,4 +1,3 @@ -import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { actor, setup } from "rivetkit"; import { workflow } from "rivetkit/workflow"; @@ -34,15 +33,4 @@ app.get("/", (c) => c.json({ message: "Use the RivetKit client to read orders." }), ); -// Dynamic Apps runs the actors in serverless mode and waits for this listener. -if (process.env.RIVETKIT_RUNTIME_MODE === "serverless") { - await new Promise((resolve, reject) => { - const server = serve( - { fetch: app.fetch, port: Number(process.env.PORT), hostname: "0.0.0.0" }, - () => resolve(), - ); - server.once("error", reject); - }); -} - export default app; diff --git a/vendor/dynamic-apps/examples/apps-workflows/package.json b/vendor/dynamic-apps/examples/apps-workflows/package.json index aa1d619..3aad4d3 100644 --- a/vendor/dynamic-apps/examples/apps-workflows/package.json +++ b/vendor/dynamic-apps/examples/apps-workflows/package.json @@ -9,14 +9,14 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@hono/node-server": "^2.0.11", + "@hono/node-server": "^2.1.1", "@rivet-dev/dynamic-apps": "workspace:*", - "hono": "^4.12.9", + "hono": "^4.13.5", "rivetkit": "2.3.11" }, "devDependencies": { - "@types/node": "^22.19.15", - "tsx": "^4.20.6", - "typescript": "^5.7.3" + "@types/node": "^22.20.1", + "tsx": "^4.23.13", + "typescript": "^5.9.3" } }