@agent-native/core 0.168.1 → 0.168.2
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/netlify.toml +4 -4
- package/corpus/templates/assets/netlify.toml +4 -1
- package/corpus/templates/brain/netlify.toml +4 -1
- package/corpus/templates/calendar/netlify.toml +4 -1
- package/corpus/templates/chat/netlify.toml +4 -1
- package/corpus/templates/clips/netlify.toml +4 -1
- package/corpus/templates/content/netlify.toml +4 -1
- package/corpus/templates/crm/netlify.toml +6 -1
- package/corpus/templates/design/netlify.toml +4 -1
- package/corpus/templates/dispatch/netlify.toml +4 -1
- package/corpus/templates/factory/netlify.toml +4 -1
- package/corpus/templates/forms/netlify.toml +4 -1
- package/corpus/templates/macros/netlify.toml +3 -3
- package/corpus/templates/mail/actions/view-screen.ts +80 -8
- package/corpus/templates/mail/app/components/email/EmailList.tsx +3 -1
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +1 -35
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +16 -8
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +146 -87
- package/corpus/templates/mail/app/global.css +21 -0
- package/corpus/templates/mail/app/hooks/use-emails.ts +6 -0
- package/corpus/templates/mail/app/hooks/use-navigation-state.ts +2 -0
- package/corpus/templates/mail/app/lib/inbox-tabs.ts +5 -0
- package/corpus/templates/mail/app/lib/label-colors.ts +47 -0
- package/corpus/templates/mail/app/pages/InboxPage.tsx +25 -8
- package/corpus/templates/mail/netlify.toml +4 -1
- package/corpus/templates/mail/server/handlers/emails.ts +27 -2
- package/corpus/templates/plan/netlify.toml +4 -1
- package/corpus/templates/slides/netlify.toml +4 -1
- package/corpus/templates/tasks/netlify.toml +6 -1
- package/dist/app-config/migration.d.ts +5 -0
- package/dist/app-config/migration.js +11 -0
- package/dist/app-config/schema.d.ts +4 -0
- package/dist/app-config/schema.js +2 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/db/migrations.js +10 -2
- package/dist/deploy/build.js +6 -0
- package/dist/deploy/netlify-static-headers.d.ts +3 -0
- package/dist/deploy/netlify-static-headers.js +60 -0
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
- package/dist/provider-api/actions/provider-api.d.ts +17 -17
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/chat/netlify.toml +4 -1
- package/dist/vite/client.js +2 -0
- package/package.json +2 -1
- package/src/templates/chat/netlify.toml +4 -1
|
@@ -1743,10 +1743,13 @@ export const listLabels = defineEventHandler(async (_event: H3Event) => {
|
|
|
1743
1743
|
totalCount: number;
|
|
1744
1744
|
}
|
|
1745
1745
|
>();
|
|
1746
|
+
let successfulAccountReads = 0;
|
|
1747
|
+
let failedAccountReads = 0;
|
|
1746
1748
|
// Fetch labels from each account sequentially to avoid race conditions on the shared map
|
|
1747
1749
|
for (const { accessToken } of accountTokens) {
|
|
1748
1750
|
try {
|
|
1749
1751
|
const res = await gmailListLabels(accessToken);
|
|
1752
|
+
successfulAccountReads += 1;
|
|
1750
1753
|
for (const label of res.labels || []) {
|
|
1751
1754
|
if (!label.id || !label.name) continue;
|
|
1752
1755
|
const gmailId = label.id;
|
|
@@ -1791,7 +1794,25 @@ export const listLabels = defineEventHandler(async (_event: H3Event) => {
|
|
|
1791
1794
|
});
|
|
1792
1795
|
}
|
|
1793
1796
|
}
|
|
1794
|
-
} catch {
|
|
1797
|
+
} catch {
|
|
1798
|
+
// A partial label map is not safe to return because it drops labels
|
|
1799
|
+
// from accounts that failed and makes counts look authoritative.
|
|
1800
|
+
failedAccountReads += 1;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
if (failedAccountReads > 0) {
|
|
1804
|
+
console.warn(
|
|
1805
|
+
`[listLabels] ${failedAccountReads} Gmail account label read(s) failed`,
|
|
1806
|
+
);
|
|
1807
|
+
}
|
|
1808
|
+
if (
|
|
1809
|
+
accountTokens.length === 0 ||
|
|
1810
|
+
successfulAccountReads === 0 ||
|
|
1811
|
+
failedAccountReads > 0
|
|
1812
|
+
) {
|
|
1813
|
+
console.error("[listLabels] Gmail label fetch failed");
|
|
1814
|
+
setResponseStatus(_event, 502);
|
|
1815
|
+
return { error: "Unable to load Gmail labels. Please retry." };
|
|
1795
1816
|
}
|
|
1796
1817
|
const labels: Label[] = Array.from(labelMap.values());
|
|
1797
1818
|
|
|
@@ -1821,7 +1842,11 @@ export const listLabels = defineEventHandler(async (_event: H3Event) => {
|
|
|
1821
1842
|
}
|
|
1822
1843
|
|
|
1823
1844
|
return labels;
|
|
1824
|
-
} catch {
|
|
1845
|
+
} catch {
|
|
1846
|
+
console.error("[listLabels] Gmail label request failed");
|
|
1847
|
+
setResponseStatus(_event, 502);
|
|
1848
|
+
return { error: "Unable to load Gmail labels. Please retry." };
|
|
1849
|
+
}
|
|
1825
1850
|
}
|
|
1826
1851
|
return readLabels(email);
|
|
1827
1852
|
});
|
|
@@ -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 && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter plan migrate:production; fi"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter plan build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter plan migrate:production; fi"
|
|
4
4
|
publish = "templates/plan/dist"
|
|
5
5
|
functions = "templates/plan/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -15,6 +15,9 @@ AGENT_CHAT_DURABLE_BACKGROUND = "true"
|
|
|
15
15
|
AGENT_NATIVE_HOSTED_HARNESS = "true"
|
|
16
16
|
AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
|
|
17
17
|
AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
|
|
18
|
+
# Production release migrations own schema setup; request functions must skip
|
|
19
|
+
# migration probes on every serverless invocation.
|
|
20
|
+
AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
|
|
18
21
|
|
|
19
22
|
# A2A/MCP calls may include plan generation, artifact serialization, and
|
|
20
23
|
# feedback polling. Keep this aligned with other agent-heavy hosted templates.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs slides"
|
|
3
3
|
# Rebuild Core explicitly so a cached Netlify install cannot bundle an older
|
|
4
4
|
# agent loop or A2A handler into Slides' server functions.
|
|
5
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && pnpm --filter @agent-native/core build && NITRO_PRESET=netlify pnpm --filter slides build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter slides migrate:production; fi"
|
|
5
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && pnpm --filter @agent-native/core build && NITRO_PRESET=netlify pnpm --filter slides build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter slides migrate:production; fi"
|
|
6
6
|
publish = "templates/slides/dist"
|
|
7
7
|
functions = "templates/slides/.netlify/functions-internal"
|
|
8
8
|
|
|
@@ -18,6 +18,9 @@ AGENT_CHAT_DURABLE_BACKGROUND = "true"
|
|
|
18
18
|
AGENT_NATIVE_HOSTED_HARNESS = "true"
|
|
19
19
|
AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
|
|
20
20
|
AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
|
|
21
|
+
# Production release migrations own schema setup; request functions must skip
|
|
22
|
+
# migration probes on every serverless invocation.
|
|
23
|
+
AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
|
|
21
24
|
|
|
22
25
|
# Function wall for the non-agent long-request paths (deck import/export,
|
|
23
26
|
# image generation). Agent chat opts into the separate Netlify background
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs tasks"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter tasks build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter tasks migrate:production; fi"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter tasks build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter tasks migrate:production; fi"
|
|
4
4
|
publish = "templates/tasks/dist"
|
|
5
5
|
functions = "templates/tasks/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -9,3 +9,8 @@ GA_MEASUREMENT_ID = "G-ESF7FYXGN9"
|
|
|
9
9
|
GTM_CONTAINER_ID = "GTM-N3WSTXZ"
|
|
10
10
|
NITRO_PRESET = "netlify"
|
|
11
11
|
NPM_CONFIG_PRODUCTION = "false"
|
|
12
|
+
|
|
13
|
+
[context.production.environment]
|
|
14
|
+
# Production release migrations own schema setup; request functions must skip
|
|
15
|
+
# migration probes on every serverless invocation.
|
|
16
|
+
AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const migrationConfig = z.object({
|
|
3
|
+
releaseMigrations: z.boolean().default(false).meta({
|
|
4
|
+
env: "AGENT_NATIVE_RELEASE_MIGRATIONS",
|
|
5
|
+
doc: "Treat database migrations as release-owned so request runtimes only probe an already-prepared schema.",
|
|
6
|
+
}),
|
|
7
|
+
betaSchemaOwner: z.string().trim().min(1).optional().meta({
|
|
8
|
+
env: "AGENT_NATIVE_BETA_SCHEMA_OWNER",
|
|
9
|
+
doc: "Schema owner marker embedded in a prebuilt beta server bundle.",
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
@@ -40,6 +40,10 @@ export declare const appConfigSchema: z.ZodObject<{
|
|
|
40
40
|
integrations: z.ZodPrefault<z.ZodObject<{
|
|
41
41
|
allowUnverifiedWebhooks: z.ZodDefault<z.ZodBoolean>;
|
|
42
42
|
}, z.core.$strip>>;
|
|
43
|
+
migration: z.ZodPrefault<z.ZodObject<{
|
|
44
|
+
releaseMigrations: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
+
betaSchemaOwner: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
43
47
|
privateBlob: z.ZodPrefault<z.ZodObject<{
|
|
44
48
|
provider: z.ZodOptional<z.ZodString>;
|
|
45
49
|
publicUploadFallback: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -4,6 +4,7 @@ import { agentConfig } from "./agent.js";
|
|
|
4
4
|
import { appConfig } from "./app.js";
|
|
5
5
|
import { authConfig } from "./auth.js";
|
|
6
6
|
import { integrationsConfig } from "./integrations.js";
|
|
7
|
+
import { migrationConfig } from "./migration.js";
|
|
7
8
|
import { privateBlobConfig } from "./private-blob.js";
|
|
8
9
|
import { workspaceConfig } from "./workspace.js";
|
|
9
10
|
/**
|
|
@@ -28,6 +29,7 @@ export const appConfigSchema = z.object({
|
|
|
28
29
|
app: appConfig.prefault({}),
|
|
29
30
|
auth: authConfig.prefault({}),
|
|
30
31
|
integrations: integrationsConfig.prefault({}),
|
|
32
|
+
migration: migrationConfig.prefault({}),
|
|
31
33
|
privateBlob: privateBlobConfig.prefault({}),
|
|
32
34
|
workspace: workspaceConfig.prefault({}),
|
|
33
35
|
});
|
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
-
error?: undefined;
|
|
66
65
|
states: {
|
|
67
66
|
clientId: number;
|
|
68
67
|
state: string;
|
|
69
68
|
}[];
|
|
69
|
+
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
-
error?: undefined;
|
|
81
80
|
users: {
|
|
82
81
|
clientId: number;
|
|
83
82
|
lastSeen: number;
|
|
84
83
|
}[];
|
|
84
|
+
error?: undefined;
|
|
85
85
|
}>>;
|
package/dist/db/migrations.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAppConfig } from "../app-config/index.js";
|
|
1
2
|
import { getDbExec, createDbExec, isPostgres, getDialect, getMigrationDatabaseUrl, getCloudflareD1Binding, retrySqliteBusy, } from "./client.js";
|
|
2
3
|
import { isMigrationAuthorizedRuntime } from "./migration-runtime.js";
|
|
3
4
|
// ---------------------------------------------------------------------------
|
|
@@ -250,8 +251,15 @@ function isServerlessRequestRuntime() {
|
|
|
250
251
|
* migration skipping is safe only when that runner owns schema setup.
|
|
251
252
|
*/
|
|
252
253
|
function appMigratesAtRelease() {
|
|
253
|
-
const
|
|
254
|
-
|
|
254
|
+
const { migration } = getAppConfig();
|
|
255
|
+
if (migration.releaseMigrations)
|
|
256
|
+
return true;
|
|
257
|
+
// Clips beta uses the production-owned schema but its masked prebuilt build
|
|
258
|
+
// must not run migrate:production against the fake build database. The
|
|
259
|
+
// owner marker is embedded into the deployed server bundle and therefore
|
|
260
|
+
// carries the same request-path skip decision without pretending the masked
|
|
261
|
+
// build performed the release migration.
|
|
262
|
+
return migration.betaSchemaOwner?.toLowerCase() === "production";
|
|
255
263
|
}
|
|
256
264
|
/**
|
|
257
265
|
* Run an explicit release-time migration job with migration duty enabled.
|
package/dist/deploy/build.js
CHANGED
|
@@ -34,6 +34,7 @@ import { generateActionRegistryForProject } from "../vite/action-types-plugin.js
|
|
|
34
34
|
import { createAgentNativeConfigContext, loadResolvedAgentNativeConfig, } from "../vite/agent-native-config-loader.js";
|
|
35
35
|
import { cloneServerBundleForFunction, copyDir } from "./function-bundle.js";
|
|
36
36
|
import { collectImmutableAssetPaths, IMMUTABLE_ASSET_CACHE_CONTROL, IMMUTABLE_ASSET_CACHE_HEADERS, prefixAssetPath, } from "./immutable-assets.js";
|
|
37
|
+
import { writeNetlifyStaticHeaders } from "./netlify-static-headers.js";
|
|
37
38
|
import { discoverApiRoutes, discoverPlugins, discoverActionFiles, getMissingDefaultPlugins, DEFAULT_PLUGIN_REGISTRY, } from "./route-discovery.js";
|
|
38
39
|
import { getWorkspaceCoreExports, } from "./workspace-core.js";
|
|
39
40
|
const cwd = process.cwd();
|
|
@@ -3892,6 +3893,7 @@ export function resolveNitroBuildReplacements(env = process.env, deploymentEnvir
|
|
|
3892
3893
|
// a separate server build, so embed release migration ownership here as
|
|
3893
3894
|
// well as in the Vite server bundle.
|
|
3894
3895
|
"process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
|
|
3896
|
+
"process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER": JSON.stringify(env.AGENT_NATIVE_BETA_SCHEMA_OWNER?.trim() || ""),
|
|
3895
3897
|
"process.env.AGENT_NATIVE_BUILD_DEPLOY_CONTEXT": JSON.stringify(env.CONTEXT?.trim() || env.NETLIFY_CONTEXT?.trim() || ""),
|
|
3896
3898
|
// Whether the recurring-jobs scheduled function exists is decided HERE, by
|
|
3897
3899
|
// the build env. `scheduledTriggerAvailability` cannot re-derive it later —
|
|
@@ -4087,6 +4089,10 @@ export default bundle;
|
|
|
4087
4089
|
}
|
|
4088
4090
|
}
|
|
4089
4091
|
writeSingleTemplateNetlifyRedirects(cwd);
|
|
4092
|
+
// React Router prerendered pages bypass the SSR function and are served
|
|
4093
|
+
// directly from Netlify's static backing store. Keep that artifact on the
|
|
4094
|
+
// same public SWR policy as runtime SSR and .data responses.
|
|
4095
|
+
writeNetlifyStaticHeaders(path.join(cwd, "dist"));
|
|
4090
4096
|
assertSingleTemplateNetlifyBuildOutput(cwd);
|
|
4091
4097
|
}
|
|
4092
4098
|
// Resolve remaining bare npm imports by bundling them into _libs/.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const GENERATED_NETLIFY_HEADERS_MARKER = "# Generated by @agent-native/core deploy/netlify-static-headers.ts";
|
|
2
|
+
export declare function renderNetlifyStaticHeaders(env?: Record<string, string | undefined>): string;
|
|
3
|
+
export declare function writeNetlifyStaticHeaders(publishDir: string, env?: Record<string, string | undefined>): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveSsrCacheHeaders } from "../shared/cache-control.js";
|
|
4
|
+
import { IMMUTABLE_ASSET_CACHE_CONTROL } from "./immutable-assets.js";
|
|
5
|
+
export const GENERATED_NETLIFY_HEADERS_MARKER = "# Generated by @agent-native/core deploy/netlify-static-headers.ts";
|
|
6
|
+
const LEGACY_GENERATED_NETLIFY_HEADERS_MARKER = "# Generated by @agent-native/docs scripts/generate-netlify-headers.ts";
|
|
7
|
+
function renderHeaderBlock(pathname, headers) {
|
|
8
|
+
return [
|
|
9
|
+
pathname,
|
|
10
|
+
...headers.map(([name, value]) => ` ${name}: ${value}`),
|
|
11
|
+
].join("\n");
|
|
12
|
+
}
|
|
13
|
+
export function renderNetlifyStaticHeaders(env = process.env) {
|
|
14
|
+
const ssrHeaders = resolveSsrCacheHeaders(env);
|
|
15
|
+
const ssrHeaderEntries = [
|
|
16
|
+
["Cache-Control", ssrHeaders["cache-control"]],
|
|
17
|
+
["CDN-Cache-Control", ssrHeaders["cdn-cache-control"]],
|
|
18
|
+
["Netlify-CDN-Cache-Control", ssrHeaders["netlify-cdn-cache-control"]],
|
|
19
|
+
];
|
|
20
|
+
const immutableAssetHeaders = [
|
|
21
|
+
["Cache-Control", IMMUTABLE_ASSET_CACHE_CONTROL],
|
|
22
|
+
["CDN-Cache-Control", IMMUTABLE_ASSET_CACHE_CONTROL],
|
|
23
|
+
["Netlify-CDN-Cache-Control", IMMUTABLE_ASSET_CACHE_CONTROL],
|
|
24
|
+
];
|
|
25
|
+
const internalHeaders = [
|
|
26
|
+
["Cache-Control", "no-cache, no-store"],
|
|
27
|
+
["CDN-Cache-Control", "no-cache, no-store"],
|
|
28
|
+
["Netlify-CDN-Cache-Control", "no-cache, no-store"],
|
|
29
|
+
];
|
|
30
|
+
return ([
|
|
31
|
+
GENERATED_NETLIFY_HEADERS_MARKER,
|
|
32
|
+
renderHeaderBlock("/*", ssrHeaderEntries),
|
|
33
|
+
renderHeaderBlock("/assets/*", immutableAssetHeaders),
|
|
34
|
+
renderHeaderBlock("/_agent-native/*", internalHeaders),
|
|
35
|
+
].join("\n\n") + "\n");
|
|
36
|
+
}
|
|
37
|
+
export function writeNetlifyStaticHeaders(publishDir, env = process.env) {
|
|
38
|
+
if (!fs.existsSync(publishDir)) {
|
|
39
|
+
throw new Error(`Netlify publish directory does not exist: ${publishDir}`);
|
|
40
|
+
}
|
|
41
|
+
const headersPath = path.join(publishDir, "_headers");
|
|
42
|
+
const existing = fs.existsSync(headersPath)
|
|
43
|
+
? fs.readFileSync(headersPath, "utf8").trim()
|
|
44
|
+
: "";
|
|
45
|
+
const generated = renderNetlifyStaticHeaders(env).trim();
|
|
46
|
+
const generatedStart = [
|
|
47
|
+
GENERATED_NETLIFY_HEADERS_MARKER,
|
|
48
|
+
LEGACY_GENERATED_NETLIFY_HEADERS_MARKER,
|
|
49
|
+
]
|
|
50
|
+
.map((marker) => existing.indexOf(marker))
|
|
51
|
+
.filter((index) => index >= 0)
|
|
52
|
+
.sort((a, b) => a - b)[0];
|
|
53
|
+
const existingWithoutGenerated = generatedStart === undefined
|
|
54
|
+
? existing
|
|
55
|
+
: existing.slice(0, generatedStart).trimEnd();
|
|
56
|
+
const contents = existingWithoutGenerated
|
|
57
|
+
? `${existingWithoutGenerated}\n\n${generated}`
|
|
58
|
+
: generated;
|
|
59
|
+
fs.writeFileSync(headersPath, `${contents}\n`);
|
|
60
|
+
}
|
|
@@ -17,11 +17,11 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
17
17
|
id?: undefined;
|
|
18
18
|
provider?: undefined;
|
|
19
19
|
} | {
|
|
20
|
-
error?: undefined;
|
|
21
20
|
configured?: undefined;
|
|
22
21
|
connectPath?: undefined;
|
|
23
22
|
url: string;
|
|
24
23
|
id: string;
|
|
25
24
|
provider: string;
|
|
25
|
+
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export default _default;
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
* DELETE /_agent-native/notifications/:id — delete
|
|
12
12
|
*/
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
|
-
error?: undefined;
|
|
15
14
|
count: number;
|
|
16
15
|
updated?: undefined;
|
|
16
|
+
error?: undefined;
|
|
17
17
|
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
|
-
error?: undefined;
|
|
20
19
|
count?: undefined;
|
|
21
20
|
updated: number;
|
|
21
|
+
error?: undefined;
|
|
22
22
|
ok?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
count?: undefined;
|
|
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
error: string;
|
|
27
27
|
ok?: undefined;
|
|
28
28
|
} | {
|
|
29
|
-
error?: undefined;
|
|
30
29
|
count?: undefined;
|
|
31
30
|
updated?: undefined;
|
|
32
31
|
ok: boolean;
|
|
32
|
+
error?: undefined;
|
|
33
33
|
}>>;
|
|
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
-
error?: undefined;
|
|
45
44
|
summary: import("./types.js").TraceSummary;
|
|
46
45
|
spans: import("./types.js").TraceSpan[];
|
|
47
46
|
id?: undefined;
|
|
47
|
+
error?: undefined;
|
|
48
48
|
ok?: undefined;
|
|
49
49
|
} | {
|
|
50
|
-
error?: undefined;
|
|
51
50
|
summary?: undefined;
|
|
52
51
|
spans?: undefined;
|
|
53
52
|
id: string;
|
|
53
|
+
error?: undefined;
|
|
54
54
|
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
56
|
summary?: undefined;
|
|
@@ -59,9 +59,9 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
59
59
|
error: any;
|
|
60
60
|
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
|
-
error?: undefined;
|
|
63
62
|
summary?: undefined;
|
|
64
63
|
spans?: undefined;
|
|
65
64
|
id?: undefined;
|
|
65
|
+
error?: undefined;
|
|
66
66
|
ok: boolean;
|
|
67
67
|
}>>;
|
|
@@ -75,9 +75,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
-
|
|
79
|
-
provider?: undefined;
|
|
78
|
+
message?: undefined;
|
|
80
79
|
deleted?: undefined;
|
|
80
|
+
found?: undefined;
|
|
81
|
+
id?: undefined;
|
|
81
82
|
providers: {
|
|
82
83
|
id: string;
|
|
83
84
|
label: string;
|
|
@@ -88,46 +89,45 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
88
89
|
updatedAt: number;
|
|
89
90
|
}[];
|
|
90
91
|
count: number;
|
|
91
|
-
|
|
92
|
+
provider?: undefined;
|
|
92
93
|
registered?: undefined;
|
|
93
94
|
label?: undefined;
|
|
94
|
-
message?: undefined;
|
|
95
95
|
} | {
|
|
96
|
-
|
|
97
|
-
id?: undefined;
|
|
96
|
+
message?: undefined;
|
|
98
97
|
deleted?: undefined;
|
|
98
|
+
id?: undefined;
|
|
99
99
|
providers?: undefined;
|
|
100
|
+
count?: undefined;
|
|
100
101
|
found: boolean;
|
|
101
102
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
102
103
|
registered?: undefined;
|
|
103
104
|
label?: undefined;
|
|
104
|
-
message?: undefined;
|
|
105
105
|
} | {
|
|
106
|
-
|
|
107
|
-
provider?: undefined;
|
|
106
|
+
message?: undefined;
|
|
108
107
|
deleted?: undefined;
|
|
109
108
|
providers?: undefined;
|
|
109
|
+
count?: undefined;
|
|
110
|
+
provider?: undefined;
|
|
110
111
|
found: boolean;
|
|
111
112
|
id: string;
|
|
112
113
|
registered?: undefined;
|
|
113
114
|
label?: undefined;
|
|
114
|
-
message?: undefined;
|
|
115
115
|
} | {
|
|
116
|
+
message?: undefined;
|
|
117
|
+
found?: undefined;
|
|
118
|
+
providers?: undefined;
|
|
116
119
|
count?: undefined;
|
|
117
120
|
provider?: undefined;
|
|
118
|
-
providers?: undefined;
|
|
119
|
-
found?: undefined;
|
|
120
121
|
deleted: boolean;
|
|
121
122
|
id: string;
|
|
122
123
|
registered?: undefined;
|
|
123
124
|
label?: undefined;
|
|
124
|
-
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
count?: undefined;
|
|
127
|
-
provider?: undefined;
|
|
128
126
|
deleted?: undefined;
|
|
129
|
-
providers?: undefined;
|
|
130
127
|
found?: undefined;
|
|
128
|
+
providers?: undefined;
|
|
129
|
+
count?: undefined;
|
|
130
|
+
provider?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -312,7 +312,9 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
314
|
id?: undefined;
|
|
315
|
-
|
|
315
|
+
deleted?: undefined;
|
|
316
|
+
found?: undefined;
|
|
317
|
+
message?: undefined;
|
|
316
318
|
providers: {
|
|
317
319
|
id: string;
|
|
318
320
|
label: string;
|
|
@@ -323,47 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
323
325
|
updatedAt: number;
|
|
324
326
|
}[];
|
|
325
327
|
count: number;
|
|
326
|
-
|
|
327
|
-
deleted?: undefined;
|
|
328
|
+
provider?: undefined;
|
|
328
329
|
registered?: undefined;
|
|
329
330
|
label?: undefined;
|
|
330
|
-
message?: undefined;
|
|
331
331
|
} | {
|
|
332
332
|
id?: undefined;
|
|
333
|
-
providers?: undefined;
|
|
334
333
|
count?: undefined;
|
|
334
|
+
deleted?: undefined;
|
|
335
|
+
message?: undefined;
|
|
336
|
+
providers?: undefined;
|
|
335
337
|
found: boolean;
|
|
336
338
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
337
|
-
deleted?: undefined;
|
|
338
339
|
registered?: undefined;
|
|
339
340
|
label?: undefined;
|
|
340
|
-
message?: undefined;
|
|
341
341
|
} | {
|
|
342
|
-
provider?: undefined;
|
|
343
|
-
providers?: undefined;
|
|
344
342
|
count?: undefined;
|
|
343
|
+
deleted?: undefined;
|
|
344
|
+
message?: undefined;
|
|
345
|
+
providers?: undefined;
|
|
346
|
+
provider?: undefined;
|
|
345
347
|
found: boolean;
|
|
346
348
|
id: string;
|
|
347
|
-
deleted?: undefined;
|
|
348
349
|
registered?: undefined;
|
|
349
350
|
label?: undefined;
|
|
350
|
-
message?: undefined;
|
|
351
351
|
} | {
|
|
352
|
-
provider?: undefined;
|
|
353
|
-
providers?: undefined;
|
|
354
352
|
count?: undefined;
|
|
355
353
|
found?: undefined;
|
|
354
|
+
message?: undefined;
|
|
355
|
+
providers?: undefined;
|
|
356
|
+
provider?: undefined;
|
|
356
357
|
deleted: boolean;
|
|
357
358
|
id: string;
|
|
358
359
|
registered?: undefined;
|
|
359
360
|
label?: undefined;
|
|
360
|
-
message?: undefined;
|
|
361
361
|
} | {
|
|
362
|
-
provider?: undefined;
|
|
363
|
-
providers?: undefined;
|
|
364
362
|
count?: undefined;
|
|
365
|
-
found?: undefined;
|
|
366
363
|
deleted?: undefined;
|
|
364
|
+
found?: undefined;
|
|
365
|
+
providers?: undefined;
|
|
366
|
+
provider?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|
|
@@ -27,10 +27,10 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
|
|
|
27
27
|
export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
28
28
|
error: any;
|
|
29
29
|
} | {
|
|
30
|
-
error?: undefined;
|
|
31
30
|
ok: boolean;
|
|
32
31
|
key: string;
|
|
33
32
|
baseUrlKey?: string;
|
|
34
33
|
scope: AgentEngineApiKeyScope;
|
|
34
|
+
error?: undefined;
|
|
35
35
|
}>>;
|
|
36
36
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs chat"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter chat migrate:production; fi"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter chat migrate:production; fi"
|
|
4
4
|
publish = "templates/chat/dist"
|
|
5
5
|
functions = "templates/chat/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -14,3 +14,6 @@ NPM_CONFIG_PRODUCTION = "false"
|
|
|
14
14
|
AGENT_NATIVE_HOSTED_HARNESS = "true"
|
|
15
15
|
AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
|
|
16
16
|
AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
|
|
17
|
+
# Production release migrations own schema setup; request functions must skip
|
|
18
|
+
# migration probes on every serverless invocation.
|
|
19
|
+
AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
|
package/dist/vite/client.js
CHANGED
|
@@ -2563,6 +2563,7 @@ function createNitroDevPlugin(options, appBasePath) {
|
|
|
2563
2563
|
// injected into deployed Functions. Nitro is a separate server build,
|
|
2564
2564
|
// so it needs the release ownership decision in its own replacement map.
|
|
2565
2565
|
"process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
|
|
2566
|
+
"process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER": JSON.stringify(process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER?.trim() || ""),
|
|
2566
2567
|
// Same reason as the release owner above: the recurring-jobs decision
|
|
2567
2568
|
// belongs to the build env, and Nitro is a separate server build with its
|
|
2568
2569
|
// own replacement map.
|
|
@@ -2923,6 +2924,7 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
|
|
|
2923
2924
|
// netlify.toml environment is available to the build but not injected
|
|
2924
2925
|
// into deployed Functions, so embed the decision in the server bundle.
|
|
2925
2926
|
"process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
|
|
2927
|
+
"process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER": JSON.stringify(process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER?.trim() || ""),
|
|
2926
2928
|
// Recurring jobs are turned off (and their platform scheduled trigger
|
|
2927
2929
|
// omitted) by the BUILD environment, which a deployed serverless runtime
|
|
2928
2930
|
// never sees. Embed the decision so the Automations page reports what
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.168.
|
|
3
|
+
"version": "0.168.2",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"./voice": "./dist/voice/index.js",
|
|
174
174
|
"./scripts": "./dist/scripts/index.js",
|
|
175
175
|
"./deploy/function-bundle": "./dist/deploy/function-bundle.js",
|
|
176
|
+
"./deploy/netlify-static-headers": "./dist/deploy/netlify-static-headers.js",
|
|
176
177
|
"./guards": {
|
|
177
178
|
"types": "./dist/guards/index.d.ts",
|
|
178
179
|
"default": "./dist/guards/index.js"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[build]
|
|
2
2
|
ignore = "node ./scripts/netlify-ignore-build.mjs chat"
|
|
3
|
-
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter chat migrate:production; fi"
|
|
3
|
+
command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter chat migrate:production; fi"
|
|
4
4
|
publish = "templates/chat/dist"
|
|
5
5
|
functions = "templates/chat/.netlify/functions-internal"
|
|
6
6
|
|
|
@@ -14,3 +14,6 @@ NPM_CONFIG_PRODUCTION = "false"
|
|
|
14
14
|
AGENT_NATIVE_HOSTED_HARNESS = "true"
|
|
15
15
|
AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
|
|
16
16
|
AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
|
|
17
|
+
# Production release migrations own schema setup; request functions must skip
|
|
18
|
+
# migration probes on every serverless invocation.
|
|
19
|
+
AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
|