Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vendor/integrations/docs/content/docs/flue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ npx flue init --target node
<Step title="Install the integrations">

```sh
npm add @rivet-dev/flue @rivet-dev/agentos @rivet-dev/agentos-flue rivetkit@next
npm add @rivet-dev/flue @rivet-dev/agentos @rivet-dev/agentos-flue rivetkit
```

- `@rivet-dev/labs-flue-*`: Rivet-maintained preview builds of Flue's proposed extension APIs.
Expand Down
17 changes: 10 additions & 7 deletions vendor/integrations/docs/content/docs/turso.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@ npm install rivetkit @libsql/client @tursodatabase/api

Create `.env` with your organization slug and token:

<CodeSnippet file="examples/turso/.env.example" title=".env" />
```sh title=".env"
# Your Turso organization slug from `turso org list`.
TURSO_ORG=

# Platform API token from `turso auth api-tokens mint rivet-todos`.
TURSO_PLATFORM_TOKEN=

# Group to create each actor's database in. Defaults to "default".
# TURSO_GROUP=default
```

</Step>

Expand Down Expand Up @@ -118,12 +127,6 @@ The Platform API token can create and delete every database in its organization,

`createVars` must finish within `createVarsTimeout`, which defaults to 5 seconds. Its first query opens the connection to Turso, so a node far from the database's region spends part of that budget on the round trip. Raise `options.createVarsTimeout` if starts time out. See [Options](/actors/docs/lifecycle#options).

## Testing

The test creates real Turso databases, so it reads the same environment variables and is skipped without them. It checks that each list gets its own database and that destroying a list deletes it:

<CodeSnippet file="examples/turso/tests/turso.test.ts" title="tests/turso.test.ts" />

See the [Turso Platform API](https://docs.turso.tech/api-reference/introduction) and [TypeScript reference](https://docs.turso.tech/sdk/ts/reference) for the full APIs.

## Local disk
Expand Down
2 changes: 1 addition & 1 deletion vendor/integrations/docs/content/docs/vercel-eve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cd my-agent
<Step title="Install the integrations">

```sh
npm add @rivet-dev/agentos @rivet-dev/agentos-eve @rivet-dev/workflow-world@next
npm add @rivet-dev/agentos @rivet-dev/agentos-eve @rivet-dev/workflow-world
```

- `@rivet-dev/agentos`: Provides the agentOS VM.
Expand Down
48 changes: 43 additions & 5 deletions vendor/integrations/docs/content/docs/workflow-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Start, and Vite.
<Step title="Install the World">

```sh
npm install workflow @rivet-dev/workflow-world@next
npm install workflow @rivet-dev/workflow-world
```

</Step>
Expand Down Expand Up @@ -141,7 +141,13 @@ npm test

Select the World and point it at your own HTTP server:

<CodeSnippet file="examples/workflow-sdk/.env.example" title=".env" />
```sh title=".env"
WORKFLOW_TARGET_WORLD=@rivet-dev/workflow-world
WORKFLOW_RUNTIME_URL=http://127.0.0.1:3000

# The Rivet connection uses the standard RivetKit environment variables. Local
# development needs none of them.
```

| Variable | Required | Purpose |
| --- | --- | --- |
Expand Down Expand Up @@ -169,7 +175,7 @@ rejects requests without it.

## Deploying

Deploy the app as a Rivet node like any other. See [Deploy nodes](/docs/deploy/self-host/nodes/).
Deploy the app as a Rivet node like any other. See [Deploy nodes](/docs/deploy/self-host/workers/).
Two constraints come from this World specifically:

- **The process must be long-lived.** The first World operation opens a
Expand Down Expand Up @@ -198,9 +204,41 @@ SDK.

## Testing

<CodeSnippet file="examples/workflow-sdk/vitest.integration.config.ts" title="vitest.integration.config.ts" />
```ts title="vitest.integration.config.ts"
import { workflow } from "@workflow/vitest";
import { defineConfig } from "vitest/config";

export default defineConfig({
plugins: [workflow()],
test: {
include: ["workflows/**/*.integration.test.ts"],
setupFiles: ["./vitest.setup.ts"],
testTimeout: 60_000,
},
});
```

```ts title="workflows/order.integration.test.ts"
import { waitForSleep } from "@workflow/vitest";
import { expect, test } from "vitest";
import { getRun, start } from "workflow/api";

<CodeSnippet file="examples/workflow-sdk/workflows/order.integration.test.ts" title="workflows/order.integration.test.ts" />
import { processOrder } from "./order.ts";

test("runs the workflow end to end", async () => {
const run = await start(processOrder, ["42"]);
const sleepId = await waitForSleep(run);

await getRun(run.runId).wakeUp({ correlationIds: [sleepId] });

await expect(run.returnValue).resolves.toEqual({
id: "42",
reservationId: "reservation-42",
status: "charged",
});
expect(await run.status).toBe("completed");
});
```

`waitForSleep` observes the durable sleep, `wakeUp` resumes that exact
correlation, and the assertions wait for the final persisted result.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { createRivetKit } from "@rivetkit/react";
import { useState } from "react";
import type { registry } from "./index";
import type { registry } from "../backend/index";

const { useActor } = createRivetKit<typeof registry>("http://localhost:6420");

function Counter() {
export function Counter() {
const [count, setCount] = useState(0);

// Get or create a counter actor for the key "my-counter"
const counter = useActor({
name: "counter",
key: ["my-counter"]
key: ["my-counter"],
});

// Listen to realtime events
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { Counter } from "./Counter";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<Counter />
</StrictMode>,
);

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/integrations/examples/docs/api/inspector-action.ts

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/integrations/examples/docs/api/inspector-database-rows.ts

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/integrations/examples/docs/api/inspector-queue-delete.ts

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/integrations/examples/docs/api/inspector-queue-get.ts

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/integrations/examples/docs/api/inspector-queue-post.ts

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/integrations/examples/docs/api/inspector-rpcs.ts

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/integrations/examples/docs/api/inspector-state-get.ts

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/integrations/examples/docs/api/inspector-state-patch.ts

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/integrations/examples/docs/api/inspector-summary.ts

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/integrations/examples/docs/api/inspector-traces.ts

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/integrations/examples/docs/api/inspector-workflow-replay.ts

This file was deleted.

Loading
Loading