@agent-native/core 0.146.2 → 0.146.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +13 -10
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/analytics/actions/compose-dashboard.ts +53 -6
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +8 -2
- package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +3 -1
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +48 -9
- package/corpus/templates/analytics/actions/update-dashboard.ts +80 -6
- package/corpus/templates/analytics/changelog/2026-08-07-dashboard-creation-and-edits-now-save-faster-with-reliable-s.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +19 -19
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +21 -2
- package/corpus/templates/analytics/server/lib/bigquery.ts +59 -24
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +44 -8
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +3 -5
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +33 -69
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +90 -24
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +17 -2
- package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +2 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/assets/netlify.toml +1 -1
- package/corpus/templates/assets/package.json +1 -0
- package/corpus/templates/assets/scripts/migrate-production.ts +24 -0
- package/corpus/templates/assets/server/plugins/db.ts +1 -1
- package/corpus/templates/assets/tsconfig.json +1 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/brain/netlify.toml +1 -1
- package/corpus/templates/brain/package.json +2 -0
- package/corpus/templates/brain/scripts/migrate-production.ts +24 -0
- package/corpus/templates/brain/server/plugins/db.ts +1 -1
- package/corpus/templates/brain/tsconfig.json +1 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/calendar/netlify.toml +1 -1
- package/corpus/templates/calendar/package.json +1 -0
- package/corpus/templates/calendar/scripts/migrate-production.ts +24 -0
- package/corpus/templates/calendar/server/plugins/db.ts +1 -1
- package/corpus/templates/calendar/tsconfig.json +1 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/chat/netlify.toml +1 -1
- package/corpus/templates/chat/package.json +1 -0
- package/corpus/templates/chat/scripts/migrate-production.ts +31 -0
- package/corpus/templates/chat/tsconfig.json +1 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/clips/netlify.toml +1 -1
- package/corpus/templates/clips/package.json +1 -0
- package/corpus/templates/clips/scripts/migrate-production.ts +24 -0
- package/corpus/templates/clips/server/plugins/db.ts +1 -1
- package/corpus/templates/clips/tsconfig.json +1 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/content/netlify.toml +1 -1
- package/corpus/templates/content/package.json +2 -0
- package/corpus/templates/content/scripts/migrate-production.ts +28 -0
- package/corpus/templates/content/server/plugins/db.ts +2 -2
- package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/crm/netlify.toml +1 -1
- package/corpus/templates/crm/package.json +2 -0
- package/corpus/templates/crm/scripts/migrate-production.ts +24 -0
- package/corpus/templates/crm/server/plugins/db.ts +1 -1
- package/corpus/templates/crm/tsconfig.json +1 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/design/netlify.toml +1 -1
- package/corpus/templates/design/package.json +1 -0
- package/corpus/templates/design/scripts/migrate-production.ts +24 -0
- package/corpus/templates/design/server/plugins/db.ts +1 -1
- package/corpus/templates/design/tsconfig.json +1 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/dispatch/netlify.toml +1 -1
- package/corpus/templates/dispatch/package.json +1 -0
- package/corpus/templates/dispatch/scripts/migrate-production.ts +23 -0
- package/corpus/templates/dispatch/tsconfig.json +1 -0
- package/corpus/templates/factory/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/factory/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/factory/netlify.toml +1 -1
- package/corpus/templates/factory/package.json +1 -0
- package/corpus/templates/factory/scripts/migrate-production.ts +31 -0
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +2 -0
- package/corpus/templates/factory/tsconfig.json +1 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/forms/netlify.toml +1 -1
- package/corpus/templates/forms/package.json +2 -0
- package/corpus/templates/forms/scripts/migrate-production.ts +24 -0
- package/corpus/templates/forms/server/plugins/db.ts +1 -1
- package/corpus/templates/forms/tsconfig.json +1 -0
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/macros/netlify.toml +1 -1
- package/corpus/templates/macros/package.json +1 -0
- package/corpus/templates/macros/scripts/migrate-production.ts +24 -0
- package/corpus/templates/macros/server/plugins/db.ts +1 -1
- package/corpus/templates/macros/tsconfig.json +1 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/mail/netlify.toml +1 -1
- package/corpus/templates/mail/package.json +1 -0
- package/corpus/templates/mail/scripts/migrate-production.ts +24 -0
- package/corpus/templates/mail/server/plugins/db.ts +1 -1
- package/corpus/templates/mail/tsconfig.json +1 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/plan/netlify.toml +1 -1
- package/corpus/templates/plan/package.json +1 -0
- package/corpus/templates/plan/scripts/migrate-production.ts +24 -0
- package/corpus/templates/plan/server/plugins/00-mcp.ts +3 -2
- package/corpus/templates/plan/server/plugins/db.ts +1 -1
- package/corpus/templates/plan/tsconfig.json +1 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +56 -23
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -0
- package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +4 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +91 -25
- package/corpus/templates/slides/app/hooks/use-deck-role.ts +14 -4
- package/corpus/templates/slides/app/i18n/en-US.ts +2 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +19 -7
- package/corpus/templates/slides/app/pages/Index.tsx +11 -2
- package/corpus/templates/slides/app/root.tsx +5 -1
- package/corpus/templates/slides/netlify.toml +1 -1
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/scripts/migrate-production.ts +24 -0
- package/corpus/templates/slides/server/plugins/db.ts +1 -1
- package/corpus/templates/slides/tsconfig.json +1 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/corpus/templates/tasks/netlify.toml +1 -1
- package/corpus/templates/tasks/package.json +1 -0
- package/corpus/templates/tasks/scripts/migrate-production.ts +24 -0
- package/corpus/templates/tasks/server/plugins/db.ts +1 -1
- package/corpus/templates/tasks/tsconfig.json +1 -0
- package/dist/action.d.ts +2 -0
- package/dist/agent/production-agent.d.ts +1 -0
- package/dist/agent/production-agent.js +2 -0
- package/dist/agent/thread-data-builder.d.ts +4 -0
- package/dist/agent/thread-data-builder.js +44 -0
- package/dist/automations/service.d.ts +1 -0
- package/dist/automations/service.js +21 -2
- package/dist/cli/create.js +20 -2
- package/dist/client/agent-page/AgentJobsTab.js +3 -1
- package/dist/client/agent-page/AutomationDetailsDialog.js +9 -2
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/migrations.js +7 -13
- package/dist/jobs/actions/list-automation-runs.d.ts +1 -0
- package/dist/jobs/actions/list-automation-runs.js +9 -2
- package/dist/jobs/actions/list-recurring-jobs.js +3 -1
- package/dist/jobs/actions/manage-recurring-job.js +1 -1
- package/dist/jobs/actions/run-automation-now.js +1 -0
- package/dist/jobs/background-automation-runner.js +2 -0
- package/dist/jobs/frontmatter.d.ts +2 -0
- package/dist/jobs/frontmatter.js +4 -0
- package/dist/jobs/run-history.d.ts +4 -0
- package/dist/jobs/run-history.js +28 -8
- package/dist/jobs/run-now.d.ts +4 -1
- package/dist/jobs/run-now.js +4 -3
- package/dist/jobs/scheduler.js +18 -0
- package/dist/jobs/tools.d.ts +3 -2
- package/dist/jobs/tools.js +26 -12
- package/dist/localization/default-messages.d.ts +1 -0
- package/dist/localization/default-messages.js +1 -0
- package/dist/observability/routes.d.ts +3 -3
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/action-routes.d.ts +2 -0
- package/dist/server/action-routes.js +1 -0
- package/dist/server/agent-chat-plugin.js +3 -2
- package/dist/server/builder-browser.js +24 -8
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/dist/templates/chat/netlify.toml +1 -1
- package/dist/templates/chat/package.json +1 -0
- package/dist/templates/chat/scripts/migrate-production.ts +31 -0
- package/dist/templates/chat/tsconfig.json +1 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/dist/templates/default/package.json +1 -0
- package/dist/templates/default/scripts/migrate-production.ts +31 -0
- package/dist/templates/default/tsconfig.json +1 -0
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/dist/templates/workspace-root/AGENTS.md +2 -1
- package/dist/triggers/actions/list-automations.js +1 -1
- package/dist/triggers/actions/manage-automation.js +5 -1
- package/dist/triggers/actions.d.ts +1 -1
- package/dist/triggers/actions.js +21 -15
- package/dist/triggers/dispatcher.js +17 -2
- package/dist/triggers/routes.d.ts +1 -0
- package/dist/triggers/routes.js +1 -0
- package/docs/content/docs-components.mdx +122 -11
- package/package.json +1 -1
- package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/src/templates/chat/netlify.toml +1 -1
- package/src/templates/chat/package.json +1 -0
- package/src/templates/chat/scripts/migrate-production.ts +31 -0
- package/src/templates/chat/tsconfig.json +1 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/src/templates/default/package.json +1 -0
- package/src/templates/default/scripts/migrate-production.ts +31 -0
- package/src/templates/default/tsconfig.json +1 -0
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
- package/src/templates/workspace-root/AGENTS.md +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs macros"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} NITRO_PRESET=netlify pnpm --filter macros build"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} NITRO_PRESET=netlify pnpm --filter macros build && if [ \"${CONTEXT:-}\" = \"production\" ]; then DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} pnpm --filter macros migrate:production; fi"
|
|
4
4
|
publish = "templates/macros/dist"
|
|
5
5
|
functions = "templates/macros/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"test": "vitest --run --passWithNoTests",
|
|
11
11
|
"format.fix": "oxfmt --write .",
|
|
12
12
|
"typecheck": "agent-native typecheck",
|
|
13
|
+
"migrate:production": "tsx scripts/migrate-production.ts",
|
|
13
14
|
"action": "agent-native action",
|
|
14
15
|
"script": "agent-native script",
|
|
15
16
|
"db:push": "drizzle-kit push",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
|
|
2
|
+
import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
|
|
3
|
+
|
|
4
|
+
import { runMacrosMigrations } from "../server/plugins/db.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Release-time schema entrypoint for Macros.
|
|
8
|
+
*
|
|
9
|
+
* This script is the production owner of schema changes. It runs against the
|
|
10
|
+
* direct migration endpoint selected by core, while request functions skip
|
|
11
|
+
* all migration and ensure-table work automatically.
|
|
12
|
+
*/
|
|
13
|
+
async function main(): Promise<void> {
|
|
14
|
+
await withMigrationRuntime(async () => {
|
|
15
|
+
await runFrameworkReleaseMigrations(null);
|
|
16
|
+
await runMacrosMigrations(null);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
await main();
|
|
22
|
+
} finally {
|
|
23
|
+
await closeDbExec();
|
|
24
|
+
}
|
|
@@ -37,7 +37,7 @@ const schemaTables = Object.values(schema).filter(isDrizzleTable);
|
|
|
37
37
|
// packages/core/src/db/migrations.ts for the full rationale). Version numbers
|
|
38
38
|
// alone are not a safe identity across parallel branches that each extend
|
|
39
39
|
// this list independently.
|
|
40
|
-
const runMacrosMigrations = runMigrations(
|
|
40
|
+
export const runMacrosMigrations = runMigrations(
|
|
41
41
|
[
|
|
42
42
|
{
|
|
43
43
|
version: 1,
|
|
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
|
|
|
36
36
|
- Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
|
|
37
37
|
- `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
|
|
38
38
|
target any `@agent-native/*` package
|
|
39
|
-
-
|
|
40
|
-
|
|
39
|
+
- `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
|
|
40
|
+
dependency
|
|
41
|
+
- Invented "dispatch/core behavior" shims meant to paper over a version skew
|
|
42
|
+
or failed upgrade
|
|
41
43
|
|
|
42
44
|
This does not prohibit intentional app-owned UI customization. When public
|
|
43
45
|
props and composition are insufficient, the `customizing-agent-native` skill
|
|
@@ -100,8 +102,10 @@ inline strings in components.
|
|
|
100
102
|
- Don't confuse readable package source with app-owned code: use
|
|
101
103
|
`customizing-agent-native` and `agent-native eject` for supported ownership
|
|
102
104
|
transfer
|
|
105
|
+
- Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
|
|
106
|
+
add `pnpm.patchedDependencies` to "make the app run" after a version bump
|
|
103
107
|
- Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
|
|
104
|
-
`@agent-native/*` to
|
|
108
|
+
`@agent-native/*` to paper over a broken upgrade
|
|
105
109
|
- Don't invent local dispatch/core behavior overrides when upgrade fails —
|
|
106
110
|
run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
|
|
107
111
|
- Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested
|
|
@@ -15,8 +15,9 @@ metadata:
|
|
|
15
15
|
|
|
16
16
|
When an older Agent Native app/branch needs to run on current packages, use
|
|
17
17
|
`agent-native upgrade`. Never "fix" upgrade breakage with
|
|
18
|
-
`pnpm
|
|
19
|
-
|
|
18
|
+
`pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
|
|
19
|
+
`pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
|
|
20
|
+
or edits under `node_modules/@agent-native/*` — especially not against
|
|
20
21
|
`@agent-native/core` or `@agent-native/dispatch`.
|
|
21
22
|
|
|
22
23
|
## Why
|
|
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
|
|
|
109
110
|
|
|
110
111
|
- Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
|
|
111
112
|
`patchedDependencies` for any `@agent-native/*` package
|
|
113
|
+
- Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
|
|
114
|
+
`patches/`, for any dependency
|
|
112
115
|
- Don't edit `node_modules/@agent-native/core` or
|
|
113
116
|
`node_modules/@agent-native/dispatch`
|
|
114
117
|
- Don't invent local "dispatch behavior" shims to paper over version skew
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs mail"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} NITRO_PRESET=netlify pnpm --filter mail build"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} NITRO_PRESET=netlify pnpm --filter mail build && if [ \"${CONTEXT:-}\" = \"production\" ]; then DATABASE_URL=${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL} pnpm --filter mail migrate:production; fi"
|
|
4
4
|
publish = "templates/mail/dist"
|
|
5
5
|
functions = "templates/mail/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"test": "vitest --run",
|
|
11
11
|
"format.fix": "oxfmt --write .",
|
|
12
12
|
"typecheck": "agent-native typecheck",
|
|
13
|
+
"migrate:production": "tsx scripts/migrate-production.ts",
|
|
13
14
|
"action": "agent-native action",
|
|
14
15
|
"script": "agent-native script",
|
|
15
16
|
"db:push": "drizzle-kit push",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
|
|
2
|
+
import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
|
|
3
|
+
|
|
4
|
+
import { runMailMigrations } from "../server/plugins/db.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Release-time schema entrypoint for Mail.
|
|
8
|
+
*
|
|
9
|
+
* This script is the production owner of schema changes. It runs against the
|
|
10
|
+
* direct migration endpoint selected by core, while request functions skip
|
|
11
|
+
* all migration and ensure-table work automatically.
|
|
12
|
+
*/
|
|
13
|
+
async function main(): Promise<void> {
|
|
14
|
+
await withMigrationRuntime(async () => {
|
|
15
|
+
await runFrameworkReleaseMigrations(null);
|
|
16
|
+
await runMailMigrations(null);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
await main();
|
|
22
|
+
} finally {
|
|
23
|
+
await closeDbExec();
|
|
24
|
+
}
|
|
@@ -29,7 +29,7 @@ const schemaTables = Object.values(schema).filter(isDrizzleTable);
|
|
|
29
29
|
// packages/core/src/db/migrations.ts for the full rationale). Version numbers
|
|
30
30
|
// alone are not a safe identity across parallel branches that each extend
|
|
31
31
|
// this list independently.
|
|
32
|
-
const runMailMigrations = runMigrations(
|
|
32
|
+
export const runMailMigrations = runMigrations(
|
|
33
33
|
[
|
|
34
34
|
{
|
|
35
35
|
version: 1,
|
|
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
|
|
|
36
36
|
- Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
|
|
37
37
|
- `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
|
|
38
38
|
target any `@agent-native/*` package
|
|
39
|
-
-
|
|
40
|
-
|
|
39
|
+
- `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
|
|
40
|
+
dependency
|
|
41
|
+
- Invented "dispatch/core behavior" shims meant to paper over a version skew
|
|
42
|
+
or failed upgrade
|
|
41
43
|
|
|
42
44
|
This does not prohibit intentional app-owned UI customization. When public
|
|
43
45
|
props and composition are insufficient, the `customizing-agent-native` skill
|
|
@@ -100,8 +102,10 @@ inline strings in components.
|
|
|
100
102
|
- Don't confuse readable package source with app-owned code: use
|
|
101
103
|
`customizing-agent-native` and `agent-native eject` for supported ownership
|
|
102
104
|
transfer
|
|
105
|
+
- Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
|
|
106
|
+
add `pnpm.patchedDependencies` to "make the app run" after a version bump
|
|
103
107
|
- Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
|
|
104
|
-
`@agent-native/*` to
|
|
108
|
+
`@agent-native/*` to paper over a broken upgrade
|
|
105
109
|
- Don't invent local dispatch/core behavior overrides when upgrade fails —
|
|
106
110
|
run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
|
|
107
111
|
- Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested
|
|
@@ -15,8 +15,9 @@ metadata:
|
|
|
15
15
|
|
|
16
16
|
When an older Agent Native app/branch needs to run on current packages, use
|
|
17
17
|
`agent-native upgrade`. Never "fix" upgrade breakage with
|
|
18
|
-
`pnpm
|
|
19
|
-
|
|
18
|
+
`pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
|
|
19
|
+
`pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
|
|
20
|
+
or edits under `node_modules/@agent-native/*` — especially not against
|
|
20
21
|
`@agent-native/core` or `@agent-native/dispatch`.
|
|
21
22
|
|
|
22
23
|
## Why
|
|
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
|
|
|
109
110
|
|
|
110
111
|
- Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
|
|
111
112
|
`patchedDependencies` for any `@agent-native/*` package
|
|
113
|
+
- Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
|
|
114
|
+
`patches/`, for any dependency
|
|
112
115
|
- Don't edit `node_modules/@agent-native/core` or
|
|
113
116
|
`node_modules/@agent-native/dispatch`
|
|
114
117
|
- Don't invent local "dispatch behavior" shims to paper over version skew
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs plan"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter plan build"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter plan build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter plan migrate:production; fi"
|
|
4
4
|
publish = "templates/plan/dist"
|
|
5
5
|
functions = "templates/plan/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"build": "agent-native build",
|
|
10
10
|
"start": "agent-native start",
|
|
11
11
|
"typecheck": "agent-native typecheck",
|
|
12
|
+
"migrate:production": "tsx scripts/migrate-production.ts",
|
|
12
13
|
"action": "agent-native action",
|
|
13
14
|
"script": "agent-native script",
|
|
14
15
|
"test": "vitest --run"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
|
|
2
|
+
import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
|
|
3
|
+
|
|
4
|
+
import { runPlanMigrations } from "../server/plugins/db.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Release-time schema entrypoint for Plan.
|
|
8
|
+
*
|
|
9
|
+
* This script is the production owner of schema changes. It runs against the
|
|
10
|
+
* direct migration endpoint selected by core, while request functions skip
|
|
11
|
+
* all migration and ensure-table work automatically.
|
|
12
|
+
*/
|
|
13
|
+
async function main(): Promise<void> {
|
|
14
|
+
await withMigrationRuntime(async () => {
|
|
15
|
+
await runFrameworkReleaseMigrations(null);
|
|
16
|
+
await runPlanMigrations(null);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
await main();
|
|
22
|
+
} finally {
|
|
23
|
+
await closeDbExec();
|
|
24
|
+
}
|
|
@@ -37,8 +37,9 @@ export default function planMcpPlugin(nitroApp: any) {
|
|
|
37
37
|
{
|
|
38
38
|
...loadActionsFromStaticRegistry(actionsRegistry),
|
|
39
39
|
...(frameworkTools.isEnabled("automation")
|
|
40
|
-
? createAutomationToolEntries(
|
|
41
|
-
requireMcpOwner("manage automations"),
|
|
40
|
+
? createAutomationToolEntries(
|
|
41
|
+
() => requireMcpOwner("manage automations"),
|
|
42
|
+
"plan",
|
|
42
43
|
)
|
|
43
44
|
: {}),
|
|
44
45
|
},
|
|
@@ -30,7 +30,7 @@ const schemaTables = Object.values(schema).filter(isDrizzleTable);
|
|
|
30
30
|
// packages/core/src/db/migrations.ts for the full rationale). Version numbers
|
|
31
31
|
// alone are not a safe identity across parallel branches that each extend
|
|
32
32
|
// this list independently.
|
|
33
|
-
const runPlanMigrations = runMigrations(
|
|
33
|
+
export const runPlanMigrations = runMigrations(
|
|
34
34
|
[
|
|
35
35
|
{
|
|
36
36
|
version: 1,
|
|
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
|
|
|
36
36
|
- Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
|
|
37
37
|
- `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
|
|
38
38
|
target any `@agent-native/*` package
|
|
39
|
-
-
|
|
40
|
-
|
|
39
|
+
- `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
|
|
40
|
+
dependency
|
|
41
|
+
- Invented "dispatch/core behavior" shims meant to paper over a version skew
|
|
42
|
+
or failed upgrade
|
|
41
43
|
|
|
42
44
|
This does not prohibit intentional app-owned UI customization. When public
|
|
43
45
|
props and composition are insufficient, the `customizing-agent-native` skill
|
|
@@ -100,8 +102,10 @@ inline strings in components.
|
|
|
100
102
|
- Don't confuse readable package source with app-owned code: use
|
|
101
103
|
`customizing-agent-native` and `agent-native eject` for supported ownership
|
|
102
104
|
transfer
|
|
105
|
+
- Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
|
|
106
|
+
add `pnpm.patchedDependencies` to "make the app run" after a version bump
|
|
103
107
|
- Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
|
|
104
|
-
`@agent-native/*` to
|
|
108
|
+
`@agent-native/*` to paper over a broken upgrade
|
|
105
109
|
- Don't invent local dispatch/core behavior overrides when upgrade fails —
|
|
106
110
|
run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
|
|
107
111
|
- Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested
|
|
@@ -15,8 +15,9 @@ metadata:
|
|
|
15
15
|
|
|
16
16
|
When an older Agent Native app/branch needs to run on current packages, use
|
|
17
17
|
`agent-native upgrade`. Never "fix" upgrade breakage with
|
|
18
|
-
`pnpm
|
|
19
|
-
|
|
18
|
+
`pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
|
|
19
|
+
`pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
|
|
20
|
+
or edits under `node_modules/@agent-native/*` — especially not against
|
|
20
21
|
`@agent-native/core` or `@agent-native/dispatch`.
|
|
21
22
|
|
|
22
23
|
## Why
|
|
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
|
|
|
109
110
|
|
|
110
111
|
- Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
|
|
111
112
|
`patchedDependencies` for any `@agent-native/*` package
|
|
113
|
+
- Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
|
|
114
|
+
`patches/`, for any dependency
|
|
112
115
|
- Don't edit `node_modules/@agent-native/core` or
|
|
113
116
|
`node_modules/@agent-native/dispatch`
|
|
114
117
|
- Don't invent local "dispatch behavior" shims to paper over version skew
|
|
@@ -96,7 +96,10 @@ interface EditorToolbarProps {
|
|
|
96
96
|
onShowHistory: () => void;
|
|
97
97
|
historyButtonRef: React.RefObject<HTMLButtonElement | null>;
|
|
98
98
|
currentSlide?: Slide;
|
|
99
|
-
onUpdateSlide?: (
|
|
99
|
+
onUpdateSlide?: (
|
|
100
|
+
updates: Partial<Omit<Slide, "id">>,
|
|
101
|
+
slideIdOverride?: string,
|
|
102
|
+
) => void;
|
|
100
103
|
/** Active users on the current slide (from collab awareness) */
|
|
101
104
|
activeUsers?: CollabUser[];
|
|
102
105
|
/** Whether the agent has a durable presence entry on this slide */
|
|
@@ -352,7 +355,7 @@ export default function EditorToolbar({
|
|
|
352
355
|
// That row rides on SlideEditor, which only mounts for a real slide, so an
|
|
353
356
|
// empty deck must keep this fallback or it has no way to add one.
|
|
354
357
|
const contextToolbarVisible = canEdit && Boolean(currentSlide);
|
|
355
|
-
const { undo, redo, canUndo, canRedo } = useDecks();
|
|
358
|
+
const { undo, redo, canUndo, canRedo, getDeck } = useDecks();
|
|
356
359
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
357
360
|
const [importing, setImporting] = useState(false);
|
|
358
361
|
const { setTheme, resolvedTheme } = useTheme();
|
|
@@ -553,7 +556,7 @@ export default function EditorToolbar({
|
|
|
553
556
|
>
|
|
554
557
|
<div className="py-1.5">
|
|
555
558
|
{/* Layout section */}
|
|
556
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
559
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
557
560
|
{t("editorToolbar.layout")}
|
|
558
561
|
</div>
|
|
559
562
|
{slideLayoutOptions.map((opt) => (
|
|
@@ -573,7 +576,7 @@ export default function EditorToolbar({
|
|
|
573
576
|
|
|
574
577
|
{/* Background section */}
|
|
575
578
|
<div className="mx-2 my-1.5 border-t border-border" />
|
|
576
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
579
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
577
580
|
{t("editorToolbar.background")}
|
|
578
581
|
</div>
|
|
579
582
|
<div className="px-3 pb-2">
|
|
@@ -619,7 +622,7 @@ export default function EditorToolbar({
|
|
|
619
622
|
|
|
620
623
|
{/* Image & Assets section */}
|
|
621
624
|
<div className="mx-2 my-1.5 border-t border-border" />
|
|
622
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
625
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
623
626
|
{t("editorToolbar.media")}
|
|
624
627
|
</div>
|
|
625
628
|
<button
|
|
@@ -647,27 +650,46 @@ export default function EditorToolbar({
|
|
|
647
650
|
|
|
648
651
|
{/* Diagrams section */}
|
|
649
652
|
<div className="mx-2 my-1.5 border-t border-border" />
|
|
650
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
653
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
651
654
|
{t("editorToolbar.diagrams")}
|
|
652
655
|
</div>
|
|
653
656
|
<button
|
|
654
|
-
onClick={() => {
|
|
657
|
+
onClick={async () => {
|
|
655
658
|
if (!onUpdateSlide || !currentSlide) return;
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
+
// Pin the slide this insert targets before the async
|
|
660
|
+
// import/parse below, so navigating to another slide in the
|
|
661
|
+
// meantime can't redirect where the diagram lands.
|
|
662
|
+
const targetSlideId = currentSlide.id;
|
|
663
|
+
const defaultMermaidDefinition = `graph TD
|
|
659
664
|
A[Start] --> B{Decision}
|
|
660
665
|
B -->|Yes| C[Action A]
|
|
661
666
|
B -->|No| D[Action B]
|
|
662
667
|
C --> E[End]
|
|
663
|
-
D --> E
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
668
|
+
D --> E`;
|
|
669
|
+
try {
|
|
670
|
+
const { convertMermaidToExcalidraw } =
|
|
671
|
+
await import("./MermaidToExcalidrawPanel");
|
|
672
|
+
const data = await convertMermaidToExcalidraw(
|
|
673
|
+
defaultMermaidDefinition,
|
|
674
|
+
);
|
|
675
|
+
// The target slide may have been deleted while the import/
|
|
676
|
+
// parse above was in flight — patch-deck rejects the whole
|
|
677
|
+
// batch for a missing slide id, so re-check with the live
|
|
678
|
+
// deck (not the stale `currentSlide` this closure captured)
|
|
679
|
+
// and drop the result instead of enqueueing a dead op.
|
|
680
|
+
const stillExists = getDeck(deckId)?.slides.some(
|
|
681
|
+
(s) => s.id === targetSlideId,
|
|
682
|
+
);
|
|
683
|
+
if (!stillExists) return;
|
|
684
|
+
onUpdateSlide({ excalidrawData: data }, targetSlideId);
|
|
685
|
+
setLayoutOpen(false);
|
|
686
|
+
} catch (err) {
|
|
687
|
+
console.error("Insert Mermaid diagram failed:", err);
|
|
688
|
+
toast.error(t("editorToolbar.insertMermaidFailed"), {
|
|
689
|
+
description:
|
|
690
|
+
err instanceof Error ? err.message : undefined,
|
|
691
|
+
});
|
|
692
|
+
}
|
|
671
693
|
}}
|
|
672
694
|
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
|
|
673
695
|
>
|
|
@@ -696,6 +718,8 @@ graph TD
|
|
|
696
718
|
<button
|
|
697
719
|
onClick={async () => {
|
|
698
720
|
if (!onUpdateSlide || !currentSlide) return;
|
|
721
|
+
// Same pinning as the insert handler above.
|
|
722
|
+
const targetSlideId = currentSlide.id;
|
|
699
723
|
try {
|
|
700
724
|
const match = currentSlide.content.match(
|
|
701
725
|
/<div\s+class="mermaid"[^>]*>([\s\S]*?)<\/div>/i,
|
|
@@ -706,13 +730,22 @@ graph TD
|
|
|
706
730
|
const data = await convertMermaidToExcalidraw(
|
|
707
731
|
match[1].trim(),
|
|
708
732
|
);
|
|
709
|
-
|
|
733
|
+
// Same stale-target guard as the insert handler above.
|
|
734
|
+
const stillExists = getDeck(deckId)?.slides.some(
|
|
735
|
+
(s) => s.id === targetSlideId,
|
|
736
|
+
);
|
|
737
|
+
if (!stillExists) return;
|
|
738
|
+
onUpdateSlide({ excalidrawData: data }, targetSlideId);
|
|
710
739
|
setLayoutOpen(false);
|
|
711
|
-
} catch (err
|
|
740
|
+
} catch (err) {
|
|
712
741
|
console.error("Mermaid to Excalidraw failed:", err);
|
|
742
|
+
toast.error(t("editorToolbar.convertMermaidFailed"), {
|
|
743
|
+
description:
|
|
744
|
+
err instanceof Error ? err.message : undefined,
|
|
745
|
+
});
|
|
713
746
|
}
|
|
714
747
|
}}
|
|
715
|
-
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-[hsl(var(--accent-cyan))]
|
|
748
|
+
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-[hsl(var(--accent-cyan))] hover:bg-accent/50 transition-colors"
|
|
716
749
|
>
|
|
717
750
|
<IconTransform className="w-3 h-3" />
|
|
718
751
|
{t("editorToolbar.convertMermaidToExcalidraw")}
|
|
@@ -734,7 +767,7 @@ graph TD
|
|
|
734
767
|
|
|
735
768
|
{/* Transitions section */}
|
|
736
769
|
<div className="mx-2 my-1.5 border-t border-border" />
|
|
737
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
770
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
738
771
|
{t("editorToolbar.transition")}
|
|
739
772
|
</div>
|
|
740
773
|
<div className="px-3 pb-2.5 grid grid-cols-4 gap-1">
|
|
@@ -767,7 +800,7 @@ graph TD
|
|
|
767
800
|
{onSetAspectRatio && (
|
|
768
801
|
<>
|
|
769
802
|
<div className="mx-2 my-1.5 border-t border-border" />
|
|
770
|
-
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground
|
|
803
|
+
<div className="px-3 py-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
|
|
771
804
|
{t("editorToolbar.aspectRatio")}
|
|
772
805
|
</div>
|
|
773
806
|
<div className="px-3 pb-2.5 grid grid-cols-4 gap-1">
|
|
@@ -4409,6 +4409,7 @@ export default function SlideEditor({
|
|
|
4409
4409
|
|
|
4410
4410
|
<DrawOverlay
|
|
4411
4411
|
visible={!!drawMode}
|
|
4412
|
+
scopeKey={slideId || slide.id}
|
|
4412
4413
|
onClose={() => onExitDrawMode?.()}
|
|
4413
4414
|
onSend={(annotations, instruction, canvasSize) => {
|
|
4414
4415
|
const summary = annotations
|
|
@@ -31,7 +31,10 @@ export function SlideOverflowWarning({
|
|
|
31
31
|
<div
|
|
32
32
|
role="status"
|
|
33
33
|
aria-live="polite"
|
|
34
|
-
|
|
34
|
+
// w-max/nowrap: the containing block is the zoomed slide canvas, so at
|
|
35
|
+
// low zoom the banner would otherwise wrap to a height taller than its
|
|
36
|
+
// own -top-12 offset and spill down over the slide.
|
|
37
|
+
className="absolute -top-12 left-0 z-20 flex w-max items-center gap-2 whitespace-nowrap rounded-md border border-foreground/40 px-2 py-1 text-xs text-foreground"
|
|
35
38
|
onPointerDown={(event) => event.stopPropagation()}
|
|
36
39
|
onClick={(event) => event.stopPropagation()}
|
|
37
40
|
>
|