@agent-native/core 0.141.4 → 0.141.6
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/data-querying/SKILL.md +13 -6
- package/corpus/templates/analytics/actions/get-first-party-analytics-health.ts +15 -1
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +2 -2
- package/corpus/templates/analytics/app/i18n-data.ts +328 -0
- package/corpus/templates/analytics/app/pages/DataSources.tsx +66 -30
- package/corpus/templates/analytics/changelog/2026-08-05-historical-analytics-rollups-now-repair-automatically-after-.md +6 -0
- package/corpus/templates/analytics/netlify.toml +4 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +109 -0
- package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +342 -0
- package/corpus/templates/analytics/server/lib/analytics-rollup-lock.ts +8 -0
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +11 -29
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +55 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-health.ts +117 -31
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +15 -9
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +5 -16
- package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +61 -0
- package/corpus/templates/analytics/server/plugins/db.ts +58 -187
- package/corpus/templates/analytics/server/routes/api/analytics-rollups/backfill.post.ts +53 -0
- package/corpus/templates/clips/changelog/2026-08-05-clips-overlays-now-use-clean-surfaces-without-clipped-shadow.md +6 -0
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +3 -54
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -3
- package/corpus/templates/design/actions/get-design-system.ts +3 -1
- package/corpus/templates/design/changelog/2026-08-05-missing-design-systems-now-return-a-clear-not-found-response.md +6 -0
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -2
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +5 -5
- package/corpus/templates/slides/changelog/2026-08-05-new-presentation-prompts-now-clearly-describe-presentation-g.md +6 -0
- package/dist/client/AssistantChat.js +1 -1
- package/dist/client/chat/run-recovery.d.ts +2 -1
- package/dist/client/chat/run-recovery.js +10 -3
- package/dist/client/error-format.d.ts +1 -0
- package/dist/client/error-format.js +4 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +3 -3
- package/docs/AGENTS.md +1 -1
- package/docs/content/actions.mdx +1 -1
- package/docs/content/agent-surfaces.mdx +1 -1
- package/docs/content/agents.mdx +9 -0
- package/docs/content/database.mdx +2 -2
- package/docs/content/drop-in-agent.mdx +1 -1
- package/docs/content/notifications.mdx +1 -1
- package/docs/content/routing.mdx +1 -1
- package/docs/content/server-database.mdx +437 -0
- package/docs/content/server-middleware.mdx +151 -0
- package/docs/content/server-overview.mdx +234 -0
- package/docs/content/server-plugins.mdx +147 -0
- package/docs/content/server-routes.mdx +194 -0
- package/package.json +1 -1
- package/corpus/templates/analytics/changelog/2026-08-05-historical-analytics-rollups-stay-complete-and-atomic.md +0 -6
- package/corpus/templates/analytics/changelog/2026-08-05-historical-rollups-stay-complete-while-live-events-arrive.md +0 -6
- package/docs/content/server.mdx +0 -469
|
@@ -8,6 +8,7 @@ import { useState, useEffect, useCallback, useRef } from "react";
|
|
|
8
8
|
import { saveAgentEngineApiKey, } from "../agent-engine-key.js";
|
|
9
9
|
import { agentNativePath } from "../api-path.js";
|
|
10
10
|
import { writeClipboardText } from "../clipboard.js";
|
|
11
|
+
import { isProviderAuthenticationError } from "../error-format.js";
|
|
11
12
|
import { useT } from "../i18n.js";
|
|
12
13
|
import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
|
|
13
14
|
import { cn } from "../utils.js";
|
|
@@ -215,7 +216,7 @@ export function BuilderSetupCard({ onConnected, bouncePulse, fullWidth, layout =
|
|
|
215
216
|
: "mx-auto w-full max-w-[42rem] px-3 pb-2 sm:w-fit"), children: _jsx("div", { className: cn("agent-builder-setup-card__panel rounded-lg border border-border/80 bg-background/80 shadow-sm backdrop-blur", sidebarLayout ? "p-2.5" : "p-3"), children: _jsx(BuilderSetupContent, { onConnected: onConnected, layout: layout }) }) }));
|
|
216
217
|
}
|
|
217
218
|
// ─── RunErrorRecoveryCard ─────────────────────────────────────────────────────
|
|
218
|
-
export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onDismiss, }) {
|
|
219
|
+
export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onDismiss, onProviderConnected, }) {
|
|
219
220
|
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
220
221
|
const [copyState, setCopyState] = useState("idle");
|
|
221
222
|
const [forking, setForking] = useState(false);
|
|
@@ -225,6 +226,8 @@ export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onDism
|
|
|
225
226
|
});
|
|
226
227
|
const canRecover = info.recoverable === true;
|
|
227
228
|
const shouldShowBuilderReconnect = isBuilderReconnectRunError(info);
|
|
229
|
+
const isProviderAuthError = isProviderAuthenticationError([info.message, info.details].filter(Boolean).join("\n"), info.errorCode);
|
|
230
|
+
const canRetry = canRecover || isProviderAuthError;
|
|
228
231
|
const builderReconnectResolved = shouldShowBuilderReconnect &&
|
|
229
232
|
builderReconnect.hasFetchedStatus &&
|
|
230
233
|
builderReconnect.configured;
|
|
@@ -254,6 +257,10 @@ export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onDism
|
|
|
254
257
|
window.dispatchEvent(new CustomEvent("agent-chat:new-chat"));
|
|
255
258
|
onDismiss();
|
|
256
259
|
}, [onDismiss]);
|
|
260
|
+
const handleProviderConnected = useCallback(() => {
|
|
261
|
+
onProviderConnected?.();
|
|
262
|
+
onDismiss();
|
|
263
|
+
}, [onDismiss, onProviderConnected]);
|
|
257
264
|
const handleFork = useCallback(async () => {
|
|
258
265
|
if (!onFork || forking)
|
|
259
266
|
return;
|
|
@@ -277,9 +284,9 @@ export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onDism
|
|
|
277
284
|
onDismiss();
|
|
278
285
|
}
|
|
279
286
|
}, [builderReconnectResolved, onDismiss]);
|
|
280
|
-
return (_jsxs("div", { className: "rounded-lg border border-amber-500/25 bg-amber-500/[0.06] p-3 text-sm", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-700 dark:text-amber-300", children: _jsx(IconAlertTriangle, { size: 14 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "font-medium text-foreground", children: runErrorHeadline(info) }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: info.message }), shouldShowBuilderReconnect && !builderReconnectResolved && (_jsx("p", { className: "mt-2 text-xs leading-relaxed text-muted-foreground", children: "The current Builder.io or model-provider credential was rejected. Reconnect Builder.io (free tier available), then retry this message." })), isConnectionRecoveryError && (_jsx("p", { className: "mt-2 text-xs leading-relaxed text-muted-foreground", children: "If retry lands on the same error, start a new chat session and continue from what already changed." })), (info.runId || info.errorCode || info.details) && (_jsxs("button", { type: "button", onClick: () => setDetailsOpen((v) => !v), className: "mt-2 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground", children: [_jsx(IconChevronDown, { size: 12, className: cn("transition-transform", detailsOpen && "rotate-180") }), "Details"] })), detailsOpen && (_jsxs("div", { className: "mt-2 rounded-md border border-border/60 bg-background/70 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: [info.runId && _jsxs("div", { children: ["run: ", info.runId] }), info.errorCode && _jsxs("div", { children: ["code: ", info.errorCode] }), info.details && (_jsx("pre", { className: "mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words font-mono", children: info.details }))] }))] }), _jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Dismiss", className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground", children: _jsx(IconX, { size: 14 }) })] }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [shouldShowBuilderReconnect && !builderReconnectResolved && (_jsxs("button", { type: "button", onClick: () => builderReconnect.start(), disabled: builderReconnect.connecting, className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-70", children: [builderReconnect.connecting ? (_jsx(IconLoader2, { size: 13, className: "animate-spin" })) : null, builderReconnect.connecting
|
|
287
|
+
return (_jsxs("div", { className: "rounded-lg border border-amber-500/25 bg-amber-500/[0.06] p-3 text-sm", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-700 dark:text-amber-300", children: _jsx(IconAlertTriangle, { size: 14 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "font-medium text-foreground", children: runErrorHeadline(info) }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: info.message }), isProviderAuthError && (_jsx("div", { className: "mt-3 rounded-md border border-border/70 bg-background/60 p-2.5", children: _jsx(BuilderSetupContent, { layout: "sidebar", onConnected: handleProviderConnected }) })), shouldShowBuilderReconnect && !builderReconnectResolved && (_jsx("p", { className: "mt-2 text-xs leading-relaxed text-muted-foreground", children: "The current Builder.io or model-provider credential was rejected. Reconnect Builder.io (free tier available), then retry this message." })), isConnectionRecoveryError && (_jsx("p", { className: "mt-2 text-xs leading-relaxed text-muted-foreground", children: "If retry lands on the same error, start a new chat session and continue from what already changed." })), (info.runId || info.errorCode || info.details) && (_jsxs("button", { type: "button", onClick: () => setDetailsOpen((v) => !v), className: "mt-2 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground", children: [_jsx(IconChevronDown, { size: 12, className: cn("transition-transform", detailsOpen && "rotate-180") }), "Details"] })), detailsOpen && (_jsxs("div", { className: "mt-2 rounded-md border border-border/60 bg-background/70 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: [info.runId && _jsxs("div", { children: ["run: ", info.runId] }), info.errorCode && _jsxs("div", { children: ["code: ", info.errorCode] }), info.details && (_jsx("pre", { className: "mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words font-mono", children: info.details }))] }))] }), _jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Dismiss", className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground", children: _jsx(IconX, { size: 14 }) })] }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [shouldShowBuilderReconnect && !builderReconnectResolved && (_jsxs("button", { type: "button", onClick: () => builderReconnect.start(), disabled: builderReconnect.connecting, className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-70", children: [builderReconnect.connecting ? (_jsx(IconLoader2, { size: 13, className: "animate-spin" })) : null, builderReconnect.connecting
|
|
281
288
|
? "Connecting Builder.io"
|
|
282
|
-
: "Reconnect Builder.io"] })), canRecover && (
|
|
289
|
+
: "Reconnect Builder.io"] })), canRecover && (_jsx(_Fragment, { children: _jsxs("button", { type: "button", onClick: onContinue, className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90", children: [_jsx(IconPlayerPlay, { size: 13 }), "Continue"] }) })), canRetry && (_jsxs("button", { type: "button", onClick: onRetry, className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent", children: [_jsx(IconRefresh, { size: 13 }), isQueryError ? "Diagnose and retry" : "Retry"] })), canRecover && isConnectionRecoveryError && (_jsxs("button", { type: "button", onClick: startNewChat, className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent", children: [_jsx(IconPlus, { size: 13 }), "New chat"] })), canRecover && onFork && !isConnectionRecoveryError && (_jsxs("button", { type: "button", onClick: handleFork, disabled: forking, title: "Fork this conversation into a separate chat thread.", "aria-label": "Fork this conversation into a separate chat thread", className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent disabled:cursor-wait disabled:opacity-70", children: [forking ? (_jsx(IconLoader2, { size: 13, className: "animate-spin" })) : (_jsx(IconGitFork, { size: 13 })), forking ? "Forking..." : "Fork chat"] })), _jsxs("button", { type: "button", onClick: copyDetails, className: "ml-auto inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium text-muted-foreground hover:bg-background/80 hover:text-foreground", children: [copyState === "copied" ? (_jsx(IconCheck, { size: 13 })) : copyState === "failed" ? (_jsx(IconX, { size: 13 })) : (_jsx(IconCopy, { size: 13 })), _jsx("span", { "aria-live": "polite", children: copyState === "copied"
|
|
283
290
|
? "Copied"
|
|
284
291
|
: copyState === "failed"
|
|
285
292
|
? "Copy failed"
|
|
@@ -18,4 +18,5 @@ export interface NormalizedChatError {
|
|
|
18
18
|
message: string;
|
|
19
19
|
details?: string;
|
|
20
20
|
}
|
|
21
|
+
export declare function isProviderAuthenticationError(text: string, errorCode?: string): boolean;
|
|
21
22
|
export declare function normalizeChatError(errorMessage: string, errorCode?: string): NormalizedChatError;
|
|
@@ -60,7 +60,7 @@ function isProviderRateLimit(text, errorCode) {
|
|
|
60
60
|
/\b(?:http\s*)?429\b.*\b(?:status|too many requests|rate[-_\s]?limit|no body)\b/i.test(text) ||
|
|
61
61
|
/\b(?:too many requests|rate[-_\s]?limit(?:ed| exceeded)?)\b/i.test(text));
|
|
62
62
|
}
|
|
63
|
-
function isProviderAuthenticationError(text, errorCode) {
|
|
63
|
+
export function isProviderAuthenticationError(text, errorCode) {
|
|
64
64
|
const code = normalizeErrorCode(errorCode);
|
|
65
65
|
const lower = text.toLowerCase();
|
|
66
66
|
return (code === "authentication_error" ||
|
|
@@ -72,6 +72,8 @@ function isProviderAuthenticationError(text, errorCode) {
|
|
|
72
72
|
lower.includes("invalid api key") ||
|
|
73
73
|
lower.includes("incorrect api key") ||
|
|
74
74
|
lower.includes("api key is invalid") ||
|
|
75
|
+
lower.includes("rejected the saved api key") ||
|
|
76
|
+
lower.includes("saved provider key was rejected") ||
|
|
75
77
|
(lower.includes("authentication_error") && lower.includes("api")));
|
|
76
78
|
}
|
|
77
79
|
function isConnectionError(text, errorCode) {
|
|
@@ -115,7 +117,7 @@ export function normalizeChatError(errorMessage, errorCode) {
|
|
|
115
117
|
}
|
|
116
118
|
if (isProviderAuthenticationError(text, errorCode)) {
|
|
117
119
|
return {
|
|
118
|
-
message: "The
|
|
120
|
+
message: "The saved provider key was rejected. Connect Builder.io for managed AI, or update your provider key, then retry.",
|
|
119
121
|
details: text,
|
|
120
122
|
};
|
|
121
123
|
}
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
26
26
|
* Body: { update: string (base64), requestSource?: string }
|
|
27
27
|
*/
|
|
28
28
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
29
|
-
ok?: undefined;
|
|
30
29
|
error: string;
|
|
30
|
+
ok?: undefined;
|
|
31
31
|
} | {
|
|
32
32
|
error?: undefined;
|
|
33
33
|
ok: boolean;
|
|
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
48
48
|
}>;
|
|
49
49
|
/** DELETE /_agent-native/resources/:id — delete a resource */
|
|
50
50
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
51
|
-
error: string;
|
|
52
51
|
ok?: undefined;
|
|
52
|
+
error: string;
|
|
53
53
|
} | {
|
|
54
54
|
error?: undefined;
|
|
55
55
|
ok: boolean;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -34,16 +34,16 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
|
|
|
34
34
|
/** POST /_agent-native/secrets/:key — write a secret. */
|
|
35
35
|
export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
36
36
|
error: string;
|
|
37
|
-
status?: undefined;
|
|
38
37
|
ok?: undefined;
|
|
38
|
+
status?: undefined;
|
|
39
39
|
} | {
|
|
40
40
|
ok: boolean;
|
|
41
41
|
status: string;
|
|
42
42
|
error?: undefined;
|
|
43
43
|
} | {
|
|
44
|
+
ok?: undefined;
|
|
44
45
|
error: string;
|
|
45
46
|
removed?: undefined;
|
|
46
|
-
ok?: undefined;
|
|
47
47
|
} | {
|
|
48
48
|
ok: boolean;
|
|
49
49
|
removed: boolean;
|
|
@@ -54,9 +54,9 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
54
54
|
* or the current stored value without changing anything.
|
|
55
55
|
*/
|
|
56
56
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
57
|
+
ok?: undefined;
|
|
57
58
|
error: string;
|
|
58
59
|
note?: undefined;
|
|
59
|
-
ok?: undefined;
|
|
60
60
|
} | {
|
|
61
61
|
ok: boolean;
|
|
62
62
|
note?: undefined;
|
package/docs/AGENTS.md
CHANGED
|
@@ -71,7 +71,7 @@ preserve public action, state, auth, and agent-chat runtime contracts.
|
|
|
71
71
|
| Expose tools to external agents | `content/external-agents.md`, `content/mcp-protocol.md`, `content/mcp-apps.md`, `content/mcp-clients.md` |
|
|
72
72
|
| Add integrations, setup, or secrets | `content/onboarding.md`, `content/workspace-connections.md`, `content/security.md` |
|
|
73
73
|
| Build extensions or custom widgets | `content/extensions.md`, `content/agent-web-surfaces.md` |
|
|
74
|
-
| Deploy or configure hosting | `content/deployment.md`, `content/server.md`
|
|
74
|
+
| Deploy or configure hosting | `content/deployment.md`, `content/server-overview.md` |
|
|
75
75
|
| Write agent instructions or skills | `content/skills-guide.md`, `content/writing-agent-instructions.md` |
|
|
76
76
|
|
|
77
77
|
## Rules
|
package/docs/content/actions.mdx
CHANGED
|
@@ -90,7 +90,7 @@ page. For the full surface map, see [Agent Surfaces](/docs/agent-surfaces).
|
|
|
90
90
|
|
|
91
91
|
If the UI and agent both need to do something, reach for an action — not a custom
|
|
92
92
|
route. For when a route-shaped protocol _is_ the right call, see [Prefer Actions
|
|
93
|
-
For App Operations](/docs/server#actions-first).
|
|
93
|
+
For App Operations](/docs/server-overview#actions-first).
|
|
94
94
|
|
|
95
95
|
On this page: [Start with one action](#hello-action), [Defining an action](#defining),
|
|
96
96
|
[Run context](#run-context), [Access control](#access-control),
|
|
@@ -483,7 +483,7 @@ await runAgentLoop({
|
|
|
483
483
|
|
|
484
484
|
For most apps, scheduled prompts and integration webhooks already call this loop
|
|
485
485
|
for you. Reach for it directly only when building a custom no-browser host, eval
|
|
486
|
-
runner, or server-side orchestration surface. See [Server: Production agent handler](/docs/server#agent-
|
|
486
|
+
runner, or server-side orchestration surface. See [Server: Production agent handler](/docs/server-plugins#agent-chat-plugin) for the full signature.
|
|
487
487
|
|
|
488
488
|
### Running against a folder {#folder-loop}
|
|
489
489
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Agents"
|
|
3
|
+
description: "Agent configuration, instructions, and the surfaces agents operate through."
|
|
4
|
+
draft: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agents
|
|
8
|
+
|
|
9
|
+
This section is coming soon. In the meantime, see [Writing Agent Instructions](/docs/writing-agent-instructions), [Skills](/docs/skills-guide), and [Agent Surfaces](/docs/agent-surfaces) for existing coverage.
|
|
@@ -123,7 +123,7 @@ import * as schema from "./schema.js";
|
|
|
123
123
|
export const getDb = createGetDb(schema);
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
Import `getDb` from this template-local path — `../../server/db/index.js` in routes, `../server/db/index.js` in actions — rather than from `@agent-native/core` directly. The core export returns a generic untyped instance; the template's `getDb()` carries your schema types. See [Server](/docs/server#request-context) for how actions and custom routes each import it.
|
|
126
|
+
Import `getDb` from this template-local path — `../../server/db/index.js` in routes, `../server/db/index.js` in actions — rather than from `@agent-native/core` directly. The core export returns a generic untyped instance; the template's `getDb()` carries your schema types. See [Server](/docs/server-routes#request-context) for how actions and custom routes each import it.
|
|
127
127
|
|
|
128
128
|
## Dialect-Agnostic Schema And Queries {#schema}
|
|
129
129
|
|
|
@@ -307,6 +307,6 @@ Instead of pushing directly, schema changes should be applied via SQL migrations
|
|
|
307
307
|
|
|
308
308
|
- [**Security — Data Scoping**](/docs/security#data-scoping) — how `owner_email` and access helpers scope reads and writes
|
|
309
309
|
- [**Sharing**](/docs/sharing#building) — `ownableColumns()` and the visibility model for shared resources
|
|
310
|
-
- [**Server**](/docs/server#request-context) — how actions and custom routes each import `getDb`
|
|
310
|
+
- [**Server**](/docs/server-routes#request-context) — how actions and custom routes each import `getDb`
|
|
311
311
|
- [**Deployment**](/docs/deployment#persistent-database) — connecting a persistent database per deploy target
|
|
312
312
|
- [**Actions**](/docs/actions#access-control) — a complete, paste-ready action that reads and writes through `getDb`/`schema`
|
|
@@ -15,7 +15,7 @@ You don't need to build agent-native from scratch. The agent chat, resources tab
|
|
|
15
15
|
|
|
16
16
|
<Callout tone="info">
|
|
17
17
|
|
|
18
|
-
**Prerequisite:** the server has to be running the `agent-chat-plugin` (it auto-mounts in every template). If you're starting from scratch, see [Server](/docs/server). Need the public API map instead of a tutorial? See [Component API](/docs/components).
|
|
18
|
+
**Prerequisite:** the server has to be running the `agent-chat-plugin` (it auto-mounts in every template). If you're starting from scratch, see [Server](/docs/server-overview). Need the public API map instead of a tutorial? See [Component API](/docs/components).
|
|
19
19
|
|
|
20
20
|
</Callout>
|
|
21
21
|
|
|
@@ -374,4 +374,4 @@ Automations can chain off this — e.g. _"if a critical notification fires, also
|
|
|
374
374
|
|
|
375
375
|
- [**Automations**](/docs/automations) — the most common caller of `notify()`
|
|
376
376
|
- [**Security**](/docs/security) — the `${keys.NAME}` substitution that powers the webhook channel
|
|
377
|
-
- [**Server plugins**](/docs/server) — where custom channels are registered at startup
|
|
377
|
+
- [**Server plugins**](/docs/server-plugins) — where custom channels are registered at startup
|
package/docs/content/routing.mdx
CHANGED
|
@@ -113,5 +113,5 @@ navigate(`/inbox/${threadId}`);
|
|
|
113
113
|
## What's next
|
|
114
114
|
|
|
115
115
|
- [**Client**](/docs/client) — the agent-native browser hooks and utilities
|
|
116
|
-
- [**Server**](/docs/server) — file-based server routes and the `/_agent-native/` namespace
|
|
116
|
+
- [**Server**](/docs/server-overview) — file-based server routes and the `/_agent-native/` namespace
|
|
117
117
|
- [**Context Awareness**](/docs/context-awareness) — how the agent learns the current route and selection
|