Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .changeset/fix-share-list-schema-drift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@agent-native/core": patch
"@agent-native/dispatch": patch
---

Keep share dialogs readable while additive migrations are pending, and let
ordinary iframe pages load cross-origin subresources. Improve new-project setup
and Slack identity recovery guidance. Keep Cloudflare Workers builds below the
static-header rule limit, allow local Ollama endpoints on local non-production
servers, surface provider-setting errors, keep one PGlite client across dev
reload realms, permit the optional terminal build in fresh scaffolds, and
clarify standalone deployment.
8 changes: 7 additions & 1 deletion .github/workflows/deploy-beta-sites-prebuilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ jobs:
changed_files="$(git diff --name-only "$base_sha" "$source_sha")"
# ponytail: path-based schema gate; replace with production migration
# status when GitHub Actions can access Netlify's masked secrets.
schema_files="$(printf '%s\n' "$changed_files" | rg -N '(^|/)(server/db/|packages/core/src/db/|packages/core/src/(resources|extensions|data-programs)/).+\.ts$|(^|/)store\.ts$|(^|/)(server/db/schema\.ts|server/db/migrations\.ts|server/plugins/(db|factory-migrations)\.ts|(?:scripts/)?migrate-production\.ts|drizzle(?:\.local)?\.config\.ts|netlify\.toml)$|(^|/)(migrations|supabase/migrations)/|(^|/).*schema\.ts$|(^|/).*migrations\.ts$|\.sql$' || true)"
schema_files="$(
printf '%s\n' "$changed_files" |
grep -E '(^|/)(server/db/|packages/core/src/db/|packages/core/src/(resources|extensions|data-programs)/).+\.ts$|(^|/)store\.ts$|(^|/)(server/db/schema\.ts|server/db/migrations\.ts|server/plugins/(db|factory-migrations)\.ts|(scripts/)?migrate-production\.ts|drizzle(\.local)?\.config\.ts|netlify\.toml)$|(^|/)(migrations|supabase/migrations)/|(^|/).*schema\.ts$|(^|/).*migrations\.ts$|\.sql$' || {
status=$?
[[ "$status" -eq 1 ]] || exit "$status"
}
)"
if [[ -n "$unresolved_pending_sha" ]]; then
echo "::error::Beta remains withheld for unconfirmed production migration at $unresolved_pending_sha."
if [[ -n "$schema_files" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Agent-Native is an open-source TypeScript framework for building agents that pai

## Quick start

You need [Node.js](https://nodejs.org) 22.22 or later, [pnpm](https://pnpm.io), and an LLM connection.
You need [Node.js](https://nodejs.org) 22.22 or later, [pnpm](https://pnpm.io) available on your `PATH`, and an LLM connection.

```bash
npx @agent-native/core@latest create my-agent --standalone --template chat
npx --yes @agent-native/core@latest create my-agent --standalone --template chat
cd my-agent
pnpm install
pnpm dev
Expand Down
10 changes: 9 additions & 1 deletion packages/core/bin/agent-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { createRequire } from "node:module";
import { dirname, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";

import { shouldUseSourceFallback } from "./launcher.js";
import { shouldUseSourceFallback, supportsNodeVersion } from "./launcher.js";

if (!supportsNodeVersion(process.versions.node)) {
console.error(
`agent-native requires Node.js 22.22.0 or newer, but you're on Node ${process.versions.node}.\n` +
"Upgrade Node (https://nodejs.org) and re-run. With nvm: `nvm install 22.22`.",
);
process.exit(1);
}

const binDir = dirname(fileURLToPath(import.meta.url));
const distEntry = join(binDir, "../dist/cli/index.js");
Expand Down
6 changes: 6 additions & 0 deletions packages/core/bin/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ export function shouldUseSourceFallback({
pair.sourceMtimeMs > pair.distMtimeMs,
);
}

/** @param {string} version */
export function supportsNodeVersion(version) {
const [major, minor] = version.split(".").map(Number);
return major > 22 || (major === 22 && minor >= 22);
}
15 changes: 11 additions & 4 deletions packages/core/docs/content/deploy-an-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ workspace](/docs/workspace-deployment) instead.

### Create or open the app

Create a standalone Chat app, or work from an existing app:
Follow [Getting Started](/docs/getting-started) to create a standalone Chat app,
or work from an existing app:

```bash
npx @agent-native/core@latest create my-app --standalone --template chat
Expand Down Expand Up @@ -70,9 +71,15 @@ For a local production-shaped check with Postgres and Docker, follow the

### Configure the deployment

Set `DATABASE_URL` to a persistent PostgreSQL database before the first production
deploy. A standalone app using framework auth also needs a stable
`BETTER_AUTH_SECRET`. Add the provider and integration variables your app uses.
Set `DATABASE_URL` in your deployment provider's environment settings, not only
in the local `.env`, before the first production deploy. A standalone app using
framework auth also needs a stable `BETTER_AUTH_SECRET`; generate one with
`openssl rand -hex 32` and save it in the same provider settings. Add only the
provider and integration variables your app actually uses.

The **Continue as local dev** shortcut is limited to local development. A
deployed app uses the sign-up and sign-in flow backed by that persistent
database and auth secret.

Use the [deployment environment reference](/docs/deployment-environment-variables)
for production secrets, auth, webhooks, workspace inheritance, and runtime
Expand Down
17 changes: 10 additions & 7 deletions packages/core/docs/content/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ connection URL.

### Set the connection string

Set `DATABASE_URL` in the deployment environment before the first production
deploy.
Set `DATABASE_URL` in the hosting provider's environment-variable or secret
settings before the first production deploy. A local `.env` configures your
machine only and is not uploaded by the deploy command.

### Add production secrets

Set a stable `BETTER_AUTH_SECRET` for a standalone app. A workspace also needs
`A2A_SECRET` when it uses signed cross-app requests or background handoffs. The
[deployment environment reference](/docs/deployment-environment-variables)
covers the rest of the production configuration.
Generate a stable signing secret with `openssl rand -hex 32`, then set it as
`BETTER_AUTH_SECRET` for a standalone app. A workspace also needs `A2A_SECRET`
when it uses signed cross-app requests or background handoffs. The [deployment
environment reference](/docs/deployment-environment-variables) covers the rest
of the production configuration.

</Steps>

Expand All @@ -68,7 +70,8 @@ An email provider is not required for email/password authentication. Without
one, a deployed app uses email/password signup and login, skips signup email
verification, and does not offer magic-link authentication.

Connect Resend or SendGrid before deploying if you want magic links, email
Agent-Native does not bundle an email-delivery account. Connect Resend or
SendGrid before deploying if you want magic links, email
verification, password resets, invitations, or share notifications. Set
`RESEND_API_KEY` or `SENDGRID_API_KEY` in the deployment environment; SendGrid
also needs `EMAIL_FROM`. See [Authentication](/docs/authentication) for the
Expand Down
5 changes: 3 additions & 2 deletions packages/core/docs/content/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Node.js, Vercel, Netlify, Cloudflare, or another Nitro target.

## Local quickstart {#self-host-quickstart}

Create an app, install dependencies, and build the image:
Create an app and install dependencies. Then add the `Dockerfile` from the
production image section below before building the image:

```bash
npx @agent-native/core@latest create my-app --standalone --template chat
Expand All @@ -35,7 +36,7 @@ into the image.
```dockerfile filename="Dockerfile"
FROM node:24-slim AS build
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
Expand Down
24 changes: 15 additions & 9 deletions packages/core/docs/content/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ In this guide, you'll create an agent with a chat UI and call its included

## Prerequisites

- [Node.js](https://nodejs.org) 22 or later
- [pnpm](https://pnpm.io)
- [Node.js](https://nodejs.org) 22.22 or later
- [pnpm](https://pnpm.io) installed and available on your `PATH`
- An LLM connection for the agent: Builder.io, an Anthropic or OpenAI API key,
or a local Ollama model

Expand All @@ -27,7 +27,7 @@ In this guide, you'll create an agent with a chat UI and call its included
In a new directory, start from the Chat template:

```bash
npx @agent-native/core@latest create my-app --standalone --template chat
npx --yes @agent-native/core@latest create my-app --standalone --template chat
cd my-app
pnpm install
```
Expand All @@ -44,8 +44,8 @@ Start the development server:
pnpm dev
```

The browser UI opens at `http://localhost:8080`. If it doesn't open
automatically, visit that URL in your browser.
The browser UI opens automatically. If it does not, open the local URL printed
by `pnpm dev`; the port increments when another app is already using 8080.

<Callout tone="info">

Expand Down Expand Up @@ -77,7 +77,7 @@ Hello, Alex!

## Inspect the action

Open `actions/hello.ts`:
In your local `my-app` directory, open `actions/hello.ts` in your code editor:

```ts filename="actions/hello.ts"
import { defineAction } from "@agent-native/core/action";
Expand Down Expand Up @@ -107,7 +107,8 @@ Read [Defining Actions](/docs/actions-defining) for the complete API.

## Call the action from React

Add a route at `app/routes/hello.tsx`:
The template includes `actions/hello.ts`, but not a page for it. Create
`app/routes/hello.tsx`:

```tsx filename="app/routes/hello.tsx"
import { useActionQuery } from "@agent-native/core/client/hooks";
Expand Down Expand Up @@ -139,8 +140,8 @@ export default function HelloRoute() {

<Callout tone="warning">

Restart the development server so it discovers the new route, then open
`http://localhost:8080/hello`.
Restart the development server so it discovers the new route, then append
`/hello` to the local URL printed by `pnpm dev`.

</Callout>

Expand Down Expand Up @@ -200,4 +201,9 @@ together.
Define actions for reads, writes, and approvals, then call them from the UI,
agents, and external clients.

### [Deploy an app](/docs/deploy-an-app)

Move from local development to a persistent database, production auth, and a
supported deployment target.

</Cards>
2 changes: 1 addition & 1 deletion packages/core/docs/content/locales/ar-SA/deploy-an-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ description: "أنشئ تطبيق Agent-Native وانشره على هدف Nitro.

اتبع [دليل نشر التطبيق الكامل باللغة الإنجليزية](/docs/deploy-an-app) للخطوات والأوامر الخاصة بكل موفر.

قبل النشر، اضبط قاعدة بيانات PostgreSQL دائمة و`BETTER_AUTH_SECRET` ثابتًا. اختر هدفًا من [Node.js](/docs/node-js) أو [Docker](/docs/docker) أو [Vercel](/docs/vercel) أو [Netlify](/docs/netlify) أو [Cloudflare Pages](/docs/cloudflare#cloudflare-pages) أو [Cloudflare Workers](/docs/cloudflare#cloudflare-workers) أو [AWS Amplify](/docs/aws-amplify) أو [AWS Lambda](/docs/aws-lambda) أو [Deno Deploy](/docs/deno-deploy) أو [Azure Static Web Apps](/docs/azure-static-web-apps) أو [Koyeb](/docs/koyeb) أو [Render](/docs/render).
ابدأ من [البدء](/docs/getting-started). قبل النشر، اضبط `DATABASE_URL` في إعدادات بيئة موفر الاستضافة وليس في ملف `.env` المحلي فقط. أنشئ `BETTER_AUTH_SECRET` ثابتًا باستخدام `openssl rand -hex 32` واحفظه هناك أيضًا. خيار **Continue as local dev** محلي فقط؛ يستخدم التطبيق المنشور التسجيل وتسجيل الدخول. اختر هدفًا من [Node.js](/docs/node-js) أو [Docker](/docs/docker) أو [Vercel](/docs/vercel) أو [Netlify](/docs/netlify) أو [Cloudflare Pages](/docs/cloudflare#cloudflare-pages) أو [Cloudflare Workers](/docs/cloudflare#cloudflare-workers) أو [AWS Amplify](/docs/aws-amplify) أو [AWS Lambda](/docs/aws-lambda) أو [Deno Deploy](/docs/deno-deploy) أو [Azure Static Web Apps](/docs/azure-static-web-apps) أو [Koyeb](/docs/koyeb) أو [Render](/docs/render).

لعدة تطبيقات خلف أصل واحد، استخدم [نشر مساحة عمل](/docs/workspace-deployment).
2 changes: 2 additions & 0 deletions packages/core/docs/content/locales/ar-SA/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ description: "انشر تطبيق Agent-Native أو مساحة عمل على م

تحتاج التطبيقات المستقلة إلى `BETTER_AUTH_SECRET` ثابت. تحتاج مساحات العمل التي تستخدم الطلبات الموقعة بين التطبيقات إلى `A2A_SECRET`.

اضبط هذه القيم في إعدادات بيئة موفر الاستضافة، لا في ملف `.env` المحلي فقط. أنشئ سر المصادقة باستخدام `openssl rand -hex 32`. لا يتضمن Agent-Native حسابًا لإرسال البريد؛ يجب ربط Resend أو SendGrid بشكل منفصل.

## تسليم البريد الإلكتروني اختياري، لكنه موصى به {#email-provider}

موفر البريد الإلكتروني ليس مطلوبًا لمصادقة البريد الإلكتروني وكلمة المرور. بدونه، تستخدم التطبيقات المنشورة التسجيل وتسجيل الدخول بالبريد الإلكتروني وكلمة المرور، وتتخطى التحقق من البريد عند التسجيل، ولا تعرض مصادقة الروابط السحرية.
Expand Down
4 changes: 2 additions & 2 deletions packages/core/docs/content/locales/ar-SA/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: "Localized pointer to the the Docker packaging guide."

# Docker

Read the [English Docker guide](/docs/docker) for the build steps and
provider-specific production configuration.
راجع [دليل Docker بالإنجليزية](/docs/docker) وأنشئ ملف `Dockerfile` الموضح فيه
قبل تشغيل `docker build`.

The deployment must use a persistent PostgreSQL database. Configure `DATABASE_URL`
and `BETTER_AUTH_SECRET` in the provider environment. The Nitro preset is
Expand Down
21 changes: 13 additions & 8 deletions packages/core/docs/content/locales/ar-SA/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Agent-Native هو إطار عمل TypeScript مفتوح المصدر لبناء

## المتطلبات الأساسية

- [Node.js](https://nodejs.org) 22 أو أحدث
- [pnpm](https://pnpm.io)
- [Node.js](https://nodejs.org) 22.22 أو أحدث
- [pnpm](https://pnpm.io) مثبت ومتاح في `PATH`
- اتصال LLM للوكيل: Builder.io، أو مفتاح API من Anthropic أو OpenAI، أو نموذج
Ollama محلي

Expand All @@ -26,7 +26,7 @@ Agent-Native هو إطار عمل TypeScript مفتوح المصدر لبناء
في دليل جديد، ابدأ من قالب Chat:

```bash
npx @agent-native/core@latest create my-app --standalone --template chat
npx --yes @agent-native/core@latest create my-app --standalone --template chat
cd my-app
pnpm install
```
Expand All @@ -43,8 +43,8 @@ pnpm install
pnpm dev
```

تُفتح واجهة المستخدم في المتصفح على `http://localhost:8080`. إذا لم تُفتح
تلقائيًا، فانتقل إلى هذا العنوان في متصفحك.
تُفتح واجهة المستخدم تلقائيًا. إذا لم تُفتح، فاستخدم العنوان المحلي الذي يطبعه
`pnpm dev`؛ يزداد رقم المنفذ إذا كان تطبيق آخر يستخدم 8080.

<Callout tone="info">

Expand Down Expand Up @@ -75,7 +75,7 @@ Hello, Alex!

## فحص الإجراء

افتح `actions/hello.ts`:
في دليل `my-app` المحلي، افتح `actions/hello.ts` في محرر الشفرة:

```ts filename="actions/hello.ts"
import { defineAction } from "@agent-native/core/action";
Expand Down Expand Up @@ -105,7 +105,8 @@ export default defineAction({

## استدعاء الإجراء من React

أضف مسارًا في `app/routes/hello.tsx`:
يتضمن القالب `actions/hello.ts`، لكنه لا يتضمن صفحة له. أنشئ
`app/routes/hello.tsx`:

```tsx filename="app/routes/hello.tsx"
import { useActionQuery } from "@agent-native/core/client/hooks";
Expand Down Expand Up @@ -138,7 +139,7 @@ export default function HelloRoute() {
<Callout tone="warning">

أعد تشغيل خادم التطوير كي يكتشف المسار الجديد، ثم افتح
`http://localhost:8080/hello`.
`http://localhost:<port>/hello`.

</Callout>

Expand Down Expand Up @@ -197,4 +198,8 @@ return { message: `Welcome, ${name}.` };
عرّف إجراءات للقراءة والكتابة والموافقات، ثم استدعها من واجهة المستخدم والوكلاء
والعملاء الخارجيين.

### [نشر تطبيق](/docs/deploy-an-app)

انتقل من التطوير المحلي إلى قاعدة بيانات دائمة ومصادقة إنتاجية وهدف نشر مدعوم.

</Cards>
10 changes: 10 additions & 0 deletions packages/core/docs/content/locales/ar-SA/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ export default defineConfig({
});
```

قد تسمي القوالب الجديدة الدالة المستوردة `agentNativePlugins` وتنشر نتيجتها
للمحافظة على توافق أنواع حزم Vite. وهي إضافة `agentNative` نفسها وتقبل الخيارات نفسها.

...أو تضبط `NITRO_PRESET=netlify` عند وقت البناء.

للتطبيق المستقل، ابنِ مخرجات Netlify وانشر الأصول والدوال:

```bash
NITRO_PRESET=netlify npx @agent-native/core@latest build
npx netlify deploy --prod --dir=dist --functions=.netlify/functions-internal
```

بالنسبة لمساحة عمل، انشر كل تطبيق من موقع Netlify واحد عن طريق تشغيل:

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cd my-calendar
pnpm install
```

يتطلب هذا تثبيت [Node.js](https://nodejs.org) الإصدار 22 أو أحدث و
يتطلب هذا تثبيت [Node.js](https://nodejs.org) الإصدار 22.22 أو أحدث و
[pnpm](https://pnpm.io) أولًا. راجع [بدء الاستخدام](/docs/getting-started)
إذا لم تكن قد ثبّت أيًا منهما بعد، أو لم يكن لديك اتصال بنموذج لغوي
(Builder.io، أو مفتاح Anthropic/OpenAI، أو Ollama محلي) مُعد.
Expand Down
7 changes: 6 additions & 1 deletion packages/core/docs/content/locales/ar-SA/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ export default defineConfig({
انشر عبر Vercel CLI أو عبر git push:

```bash
vercel deploy
npx vercel deploy
```

لإنشاء معاينة مؤقتة بدون تسجيل الدخول إلى Vercel، شغّل
`npx vercel deploy --temporary`. لا تحتفظ عمليات النشر المؤقتة بمتغيرات بيئة
المشروع، لذا مرّر قيم قاعدة البيانات والأسرار عبر خياري `--env` و`--build-env`
عندما تحتاج إلى أكثر من معاينة للواجهة.

بالنسبة لمساحة عمل، قم ببناء كل تطبيق في حزمة واحدة من Vercel Build Output API:

```bash
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/content/locales/de-DE/deploy-an-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ description: "Eine Agent-Native App auf einem Nitro-Ziel erstellen und bereitste

Folge dem [vollständigen englischen Leitfaden zum Bereitstellen einer App](/docs/deploy-an-app) für die Schritte und Anbieterbefehle.

Setze vor dem Deployment eine dauerhafte PostgreSQL-Datenbank und ein stabiles `BETTER_AUTH_SECRET`. Wähle [Node.js](/docs/node-js), [Docker](/docs/docker), [Vercel](/docs/vercel), [Netlify](/docs/netlify), [Cloudflare Pages](/docs/cloudflare#cloudflare-pages), [Cloudflare Workers](/docs/cloudflare#cloudflare-workers), [AWS Amplify](/docs/aws-amplify), [AWS Lambda](/docs/aws-lambda), [Deno Deploy](/docs/deno-deploy), [Azure Static Web Apps](/docs/azure-static-web-apps), [Koyeb](/docs/koyeb) oder [Render](/docs/render).
Beginne mit [Erste Schritte](/docs/getting-started). Setze vor dem Deployment `DATABASE_URL` in den Umgebungseinstellungen des Hosting-Anbieters, nicht nur in der lokalen `.env`. Erzeuge mit `openssl rand -hex 32` ein stabiles `BETTER_AUTH_SECRET` und speichere es dort ebenfalls. **Continue as local dev** gilt nur lokal; die bereitgestellte App verwendet Registrierung und Anmeldung. Wähle [Node.js](/docs/node-js), [Docker](/docs/docker), [Vercel](/docs/vercel), [Netlify](/docs/netlify), [Cloudflare Pages](/docs/cloudflare#cloudflare-pages), [Cloudflare Workers](/docs/cloudflare#cloudflare-workers), [AWS Amplify](/docs/aws-amplify), [AWS Lambda](/docs/aws-lambda), [Deno Deploy](/docs/deno-deploy), [Azure Static Web Apps](/docs/azure-static-web-apps), [Koyeb](/docs/koyeb) oder [Render](/docs/render).

Für mehrere Apps unter einer Origin nutze [Workspace-Deployment](/docs/workspace-deployment).
Loading
Loading