@agent-native/core 0.192.0 → 0.192.1-nightly-20260926122223
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/calendar/actions/cancel-booking.ts +12 -4
- package/corpus/templates/calendar/actions/list-bookings.ts +23 -2
- package/corpus/templates/calendar/actions/list-events.ts +42 -29
- package/corpus/templates/calendar/actions/update-booking-link.ts +27 -1
- package/corpus/templates/calendar/app/hooks/use-bookings.ts +9 -2
- package/corpus/templates/calendar/app/i18n/en-US.ts +8 -0
- package/corpus/templates/calendar/app/lib/booking-sorting.ts +7 -0
- package/corpus/templates/calendar/app/lib/event-colors.ts +29 -4
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +99 -19
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +5 -11
- package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +5 -0
- package/corpus/templates/calendar/changelog/2026-09-25-ambiguous-zoom-bookings-need-review.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-bookings-list-shows-newest-bookings-first.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-canceling-a-booking-now-resolves-its-zoom-meeting-first.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-colleague-events-use-sidebar-colors.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-public-booking-pages-reject-malformed-meeting-settings-befor.md +6 -0
- package/corpus/templates/calendar/changelog/2026-09-25-shared-booking-cancellations-require-editor-access-and-unres.md +6 -0
- package/corpus/templates/calendar/server/db/schema.ts +5 -0
- package/corpus/templates/calendar/server/handlers/bookings.ts +142 -26
- package/corpus/templates/calendar/server/lib/booking-link-utils.ts +46 -1
- package/corpus/templates/calendar/server/lib/zoom.ts +66 -1
- package/corpus/templates/calendar/server/plugins/db.ts +13 -0
- package/corpus/templates/calendar/shared/api.ts +4 -0
- package/corpus/templates/clips/app/components/capture-install-options.tsx +9 -6
- package/corpus/templates/clips/app/components/clips-command-menu.tsx +4 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +5 -4
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +4 -0
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -30
- package/corpus/templates/clips/changelog/2026-09-26-desktop-platform-icon.md +6 -0
- package/corpus/templates/clips/changelog/2026-09-26-the-empty-comments-state-now-explains-how-screen-recordings-.md +6 -0
- package/corpus/templates/design/app/routes/design-systems.tsx +2 -4
- package/corpus/templates/design/app/routes/design.$id.tsx +2 -1
- package/corpus/templates/design/app/routes/public-design-meta.ts +0 -39
- package/corpus/templates/design/app/routes/templates.tsx +2 -4
- package/corpus/templates/design/app/routes/visual-edit_.$id.tsx +2 -1
- package/corpus/templates/design/changelog/2026-09-26-opening-shared-designs-no-longer-fails-during-client-startup.md +6 -0
- package/corpus/templates/design/package.json +1 -1
- package/corpus/templates/design/scripts/check-client-server-boundary.ts +55 -0
- package/corpus/templates/design/server/lib/public-design-meta.server.ts +40 -0
- package/dist/automation/index.d.ts +1 -1
- package/dist/client/settings/UsageSection.js +18 -5
- package/dist/client/settings/recent-prompt-groups.d.ts +12 -0
- package/dist/client/settings/recent-prompt-groups.js +20 -0
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +13 -13
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts +1 -1
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,10 +5,8 @@ import type { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
|
5
5
|
import enUSMessages from "@/i18n/en-US";
|
|
6
6
|
|
|
7
7
|
import { getDb, schema } from "../../server/db";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
publicDesignMetaLoaderData,
|
|
11
|
-
} from "./public-design-meta";
|
|
8
|
+
import { publicDesignMetaLoaderData } from "../../server/lib/public-design-meta.server";
|
|
9
|
+
import { designResourceMeta } from "./public-design-meta";
|
|
12
10
|
|
|
13
11
|
export { default } from "../pages/DesignSystems";
|
|
14
12
|
|
|
@@ -2,8 +2,9 @@ import type { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
|
2
2
|
|
|
3
3
|
import enUSMessages from "@/i18n/en-US";
|
|
4
4
|
|
|
5
|
+
import { loadPublicDesignMeta } from "../../server/lib/public-design-meta.server";
|
|
5
6
|
import DesignEditorRoute from "../pages/DesignEditor";
|
|
6
|
-
import { designResourceMeta
|
|
7
|
+
import { designResourceMeta } from "./public-design-meta";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Keep the route module itself as a React Fast Refresh boundary. A bare
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { getConfiguredAppBasePath } from "@agent-native/core/server";
|
|
2
1
|
import {
|
|
3
|
-
SSR_QUERY_CACHE_KEY_HEADER,
|
|
4
2
|
buildResourceSocialMeta,
|
|
5
3
|
normalizeDocumentTitle,
|
|
6
4
|
type SocialMetaDescriptor,
|
|
7
5
|
} from "@agent-native/core/shared";
|
|
8
|
-
import { and, eq } from "drizzle-orm";
|
|
9
|
-
import { data } from "react-router";
|
|
10
|
-
|
|
11
|
-
import { getDb, schema } from "../../server/db";
|
|
12
6
|
|
|
13
7
|
export interface PublicDesignMetaData {
|
|
14
8
|
resource: { title: string; description: string | null } | null;
|
|
@@ -16,39 +10,6 @@ export interface PublicDesignMetaData {
|
|
|
16
10
|
basePath: string;
|
|
17
11
|
}
|
|
18
12
|
|
|
19
|
-
export function publicDesignMetaLoaderData(payload: PublicDesignMetaData) {
|
|
20
|
-
return data(payload, {
|
|
21
|
-
headers: { [SSR_QUERY_CACHE_KEY_HEADER]: "query" },
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function loadPublicDesignMeta(
|
|
26
|
-
id: string | undefined,
|
|
27
|
-
requestUrl: string,
|
|
28
|
-
): Promise<PublicDesignMetaData> {
|
|
29
|
-
const [resource] = id
|
|
30
|
-
? await getDb()
|
|
31
|
-
.select({
|
|
32
|
-
title: schema.designs.title,
|
|
33
|
-
description: schema.designs.description,
|
|
34
|
-
})
|
|
35
|
-
.from(schema.designs)
|
|
36
|
-
.where(
|
|
37
|
-
and(
|
|
38
|
-
eq(schema.designs.id, id),
|
|
39
|
-
eq(schema.designs.visibility, "public"),
|
|
40
|
-
),
|
|
41
|
-
)
|
|
42
|
-
.limit(1)
|
|
43
|
-
: [];
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
resource: resource ?? null,
|
|
47
|
-
origin: new URL(requestUrl).origin,
|
|
48
|
-
basePath: getConfiguredAppBasePath(),
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
13
|
export function designResourceMeta(
|
|
53
14
|
loaderData: PublicDesignMetaData | undefined,
|
|
54
15
|
fallbackTitle: string,
|
|
@@ -5,10 +5,8 @@ import type { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
|
5
5
|
import enUSMessages from "@/i18n/en-US";
|
|
6
6
|
|
|
7
7
|
import { getDb, schema } from "../../server/db";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
publicDesignMetaLoaderData,
|
|
11
|
-
} from "./public-design-meta";
|
|
8
|
+
import { publicDesignMetaLoaderData } from "../../server/lib/public-design-meta.server";
|
|
9
|
+
import { designResourceMeta } from "./public-design-meta";
|
|
12
10
|
|
|
13
11
|
export { default } from "../pages/Templates";
|
|
14
12
|
|
|
@@ -2,8 +2,9 @@ import type { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
|
2
2
|
|
|
3
3
|
import enUSMessages from "@/i18n/en-US";
|
|
4
4
|
|
|
5
|
+
import { loadPublicDesignMeta } from "../../server/lib/public-design-meta.server";
|
|
5
6
|
import DesignEditorRoute from "../pages/DesignEditor";
|
|
6
|
-
import { designResourceMeta
|
|
7
|
+
import { designResourceMeta } from "./public-design-meta";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* The skill's local editor has its own route so a capability can authorize this
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "agent-native dev --inspect",
|
|
8
|
-
"build": "agent-native build",
|
|
8
|
+
"build": "agent-native build && tsx scripts/check-client-server-boundary.ts",
|
|
9
9
|
"start": "agent-native start",
|
|
10
10
|
"test": "vitest --run",
|
|
11
11
|
"typecheck": "agent-native typecheck && pnpm exec tsc --noEmit -p app/components/design/bridge/tsconfig.json",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const clientRoot = path.resolve(
|
|
6
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
7
|
+
"../build/client",
|
|
8
|
+
);
|
|
9
|
+
const textAsset = /\.(?:css|html|js|json|map|mjs)$/i;
|
|
10
|
+
const forbidden = [
|
|
11
|
+
["PGlite database client", "__agentNativePgliteClients"],
|
|
12
|
+
["server database module", /server[\\/]db(?:[\\/.'"?]|$)/i],
|
|
13
|
+
] as const;
|
|
14
|
+
|
|
15
|
+
async function textAssets(directory: string): Promise<string[]> {
|
|
16
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
17
|
+
const paths = await Promise.all(
|
|
18
|
+
entries.map((entry) => {
|
|
19
|
+
const filePath = path.join(directory, entry.name);
|
|
20
|
+
return entry.isDirectory()
|
|
21
|
+
? textAssets(filePath)
|
|
22
|
+
: textAsset.test(entry.name)
|
|
23
|
+
? [filePath]
|
|
24
|
+
: [];
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
return paths.flat();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const assets = await textAssets(clientRoot);
|
|
31
|
+
if (assets.length === 0) {
|
|
32
|
+
throw new Error(`No text assets found in client build: ${clientRoot}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const leaks: string[] = [];
|
|
36
|
+
for (const asset of assets) {
|
|
37
|
+
const source = await readFile(asset, "utf8");
|
|
38
|
+
for (const [label, pattern] of forbidden) {
|
|
39
|
+
if (
|
|
40
|
+
typeof pattern === "string"
|
|
41
|
+
? source.includes(pattern)
|
|
42
|
+
: pattern.test(source)
|
|
43
|
+
) {
|
|
44
|
+
leaks.push(`${path.relative(clientRoot, asset)}: ${label}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (leaks.length > 0) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`Server database code found in client assets:\n${leaks.join("\n")}`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log(`Checked ${assets.length} client assets for server database code.`);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getConfiguredAppBasePath } from "@agent-native/core/server";
|
|
2
|
+
import { SSR_QUERY_CACHE_KEY_HEADER } from "@agent-native/core/shared";
|
|
3
|
+
import { and, eq } from "drizzle-orm";
|
|
4
|
+
import { data } from "react-router";
|
|
5
|
+
|
|
6
|
+
import type { PublicDesignMetaData } from "../../app/routes/public-design-meta";
|
|
7
|
+
import { getDb, schema } from "../db";
|
|
8
|
+
|
|
9
|
+
export function publicDesignMetaLoaderData(payload: PublicDesignMetaData) {
|
|
10
|
+
return data(payload, {
|
|
11
|
+
headers: { [SSR_QUERY_CACHE_KEY_HEADER]: "query" },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function loadPublicDesignMeta(
|
|
16
|
+
id: string | undefined,
|
|
17
|
+
requestUrl: string,
|
|
18
|
+
): Promise<PublicDesignMetaData> {
|
|
19
|
+
const [resource] = id
|
|
20
|
+
? await getDb()
|
|
21
|
+
.select({
|
|
22
|
+
title: schema.designs.title,
|
|
23
|
+
description: schema.designs.description,
|
|
24
|
+
})
|
|
25
|
+
.from(schema.designs)
|
|
26
|
+
.where(
|
|
27
|
+
and(
|
|
28
|
+
eq(schema.designs.id, id),
|
|
29
|
+
eq(schema.designs.visibility, "public"),
|
|
30
|
+
),
|
|
31
|
+
)
|
|
32
|
+
.limit(1)
|
|
33
|
+
: [];
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
resource: resource ?? null,
|
|
37
|
+
origin: new URL(requestUrl).origin,
|
|
38
|
+
basePath: getConfiguredAppBasePath(),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -186,8 +186,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
|
|
|
186
186
|
duplicate?: undefined;
|
|
187
187
|
eventId?: undefined;
|
|
188
188
|
} | {
|
|
189
|
+
error?: undefined;
|
|
189
190
|
accepted: boolean;
|
|
190
191
|
duplicate: boolean;
|
|
191
192
|
eventId: string;
|
|
192
|
-
error?: undefined;
|
|
193
193
|
}>;
|
|
@@ -12,6 +12,7 @@ import { withBuilderUtmTrackingParams } from "../../shared/builder-link-tracking
|
|
|
12
12
|
import { BuilderReferralInviteRow } from "../BuilderReferralInviteRow.js";
|
|
13
13
|
import { useT } from "../i18n.js";
|
|
14
14
|
import { useActionMutation, useActionQuery } from "../use-action.js";
|
|
15
|
+
import { groupRecentPrompts, } from "./recent-prompt-groups.js";
|
|
15
16
|
const builderAddCreditsUrl = withBuilderUtmTrackingParams("https://builder.io/account/subscription?signupSource=agent-native", { content: "usage_credit_balance" });
|
|
16
17
|
const LOOKBACKS = [
|
|
17
18
|
{ value: 7, label: "7d" },
|
|
@@ -110,21 +111,33 @@ function appLabel(value) {
|
|
|
110
111
|
return normalized.replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
111
112
|
}
|
|
112
113
|
function Trend({ daily, billing, }) {
|
|
114
|
+
const t = useT();
|
|
113
115
|
if (daily.length === 0) {
|
|
114
116
|
return (_jsx("div", { className: "flex h-32 items-center justify-center rounded-lg border border-dashed border-border/70 text-sm text-muted-foreground", children: "No usage recorded in this lookback." }));
|
|
115
117
|
}
|
|
116
118
|
const values = daily.map((day) => usageAmount(day.costCents, billing, day.builderCredits, day.estimatedBuilderCredits));
|
|
117
|
-
const max = Math.max(...values, 0
|
|
119
|
+
const max = Math.max(...values, 0);
|
|
120
|
+
const scaleMax = max || 1;
|
|
118
121
|
const points = values.map((value, index) => {
|
|
119
122
|
const x = daily.length === 1 ? 50 : (index / (daily.length - 1)) * 100;
|
|
120
|
-
const y =
|
|
123
|
+
const y = 100 - (value / scaleMax) * 100;
|
|
121
124
|
return `${x.toFixed(2)},${y.toFixed(2)}`;
|
|
122
125
|
});
|
|
123
126
|
const line = points
|
|
124
127
|
.map((point, index) => `${index === 0 ? "M" : "L"} ${point}`)
|
|
125
128
|
.join(" ");
|
|
126
|
-
const area = `${line} L 100,
|
|
127
|
-
|
|
129
|
+
const area = `${line} L 100,100 L 0,100 Z`;
|
|
130
|
+
const axisLabel = billing.unit === "usd"
|
|
131
|
+
? "USD"
|
|
132
|
+
: t("agentChat.usage.builderCredits", {
|
|
133
|
+
defaultValue: "Builder credits",
|
|
134
|
+
});
|
|
135
|
+
const axisTicks = [max, max / 2, 0];
|
|
136
|
+
return (_jsx("div", { className: "overflow-hidden rounded-lg border border-border/70 bg-muted/20 px-3 pb-2 pt-3", children: _jsxs("div", { className: "flex gap-2", children: [_jsx("div", { className: "flex h-32 w-3 shrink-0 items-center justify-center", children: _jsx("span", { "aria-hidden": "true", className: "[writing-mode:vertical-rl] rotate-180 whitespace-nowrap text-[10px] text-muted-foreground", children: axisLabel }) }), _jsx("div", { role: "group", "aria-label": axisLabel, className: "flex h-32 w-12 shrink-0 flex-col justify-between text-right text-[10px] tabular-nums text-muted-foreground", children: axisTicks.map((value, index) => (_jsx("span", { children: billing.unit === "usd"
|
|
137
|
+
? formatUsdCost(value)
|
|
138
|
+
: value.toLocaleString(undefined, {
|
|
139
|
+
maximumFractionDigits: 3,
|
|
140
|
+
}) }, index))) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("svg", { "aria-label": "Daily usage trend", className: "h-32 w-full text-primary", viewBox: "0 0 100 100", preserveAspectRatio: "none", role: "img", children: [_jsx("path", { d: "M 0 0 H 100 M 0 50 H 100 M 0 100 H 100", className: "fill-none stroke-border/60", strokeWidth: "0.5", vectorEffect: "non-scaling-stroke" }), _jsx("path", { d: area, className: "fill-current opacity-10" }), _jsx("path", { d: line, className: "fill-none stroke-current", strokeWidth: "1.5", vectorEffect: "non-scaling-stroke" })] }), _jsxs("div", { className: "flex justify-between text-[11px] text-muted-foreground", children: [_jsx("span", { children: new Date(`${daily[0].date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) }), _jsx("span", { children: new Date(`${daily.at(-1).date}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }) })] })] })] }) }));
|
|
128
141
|
}
|
|
129
142
|
function MetricCard({ label, value, detail, accent = false, }) {
|
|
130
143
|
return (_jsxs("div", { className: "min-w-0 rounded-lg border border-border/70 bg-card px-4 py-4", children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: label }), _jsx("div", { className: `mt-1 truncate text-xl font-semibold tracking-[-0.02em] tabular-nums ${accent ? "text-primary" : "text-foreground"}`, children: value }), _jsx("div", { className: "mt-1 truncate text-xs text-muted-foreground", children: detail })] }));
|
|
@@ -339,6 +352,6 @@ export function UsageSection({ appId = null, viewAllHref, }) {
|
|
|
339
352
|
costCents: day.otherCostCents ?? 0,
|
|
340
353
|
calls: day.otherCalls ?? 0,
|
|
341
354
|
tokens: 0,
|
|
342
|
-
})), billing: { unit: "usd", label: "USD" } })] })) : null] }) })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Top usage drivers" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Breakdowns stay collapsed until you need them." })] }), _jsx(IconChevronDown, { className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })] }), _jsxs("div", { className: "grid gap-6 border-t border-border/70 px-4 py-4 md:grid-cols-2", children: [_jsx(DriverList, { title: "By workflow", rows: data.byLabel, billing: billing }), _jsx(DriverList, { title: "By model", rows: data.byModel, billing: billing })] })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Recent prompts" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Latest recorded prompts for the selected app and user scope." })] }), _jsxs("span", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [data.recent.length, _jsx(IconChevronDown, { className: "size-4 transition-transform group-open:rotate-180" })] })] }), _jsx("div", { className: "border-t border-border/70", children: data.recent.length === 0 ? (_jsx("p", { className: "px-4 py-5 text-sm text-muted-foreground", children: "No recent prompts recorded." })) : (_jsx("div", { className: "divide-y divide-border/60", children: data.recent.map((entry) => (_jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [entry.label, " \u00B7 ", entry.model] }),
|
|
355
|
+
})), billing: { unit: "usd", label: "USD" } })] })) : null] }) })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Top usage drivers" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Breakdowns stay collapsed until you need them." })] }), _jsx(IconChevronDown, { className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })] }), _jsxs("div", { className: "grid gap-6 border-t border-border/70 px-4 py-4 md:grid-cols-2", children: [_jsx(DriverList, { title: "By workflow", rows: data.byLabel, billing: billing }), _jsx(DriverList, { title: "By model", rows: data.byModel, billing: billing })] })] }), _jsxs("details", { className: "group rounded-lg border border-border/70 bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-4 outline-none transition-colors hover:bg-accent/30 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-sm font-semibold text-foreground", children: "Recent prompts" }), _jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: "Latest recorded prompts for the selected app and user scope." })] }), _jsxs("span", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [data.recent.length, _jsx(IconChevronDown, { className: "size-4 transition-transform group-open:rotate-180" })] })] }), _jsx("div", { className: "border-t border-border/70", children: data.recent.length === 0 ? (_jsx("p", { className: "px-4 py-5 text-sm text-muted-foreground", children: "No recent prompts recorded." })) : (_jsx("div", { className: "divide-y divide-border/60", children: groupRecentPrompts(data.recent).map(({ entry, count }) => (_jsxs("div", { className: "px-4 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-[11px] text-muted-foreground", children: [_jsxs("span", { children: [entry.label, " \u00B7 ", entry.model] }), _jsxs("span", { className: "flex items-center gap-2", children: [entry.ownerEmail, count > 1 ? (_jsxs(Badge, { variant: "secondary", children: ["\u00D7", count] })) : null] })] }), _jsx("p", { className: "mt-1 line-clamp-2 text-sm text-foreground", children: entry.prompt ??
|
|
343
356
|
"Prompt text was not captured for this call." })] }, entry.id))) })) })] }), _jsx(UsageAlertsSection, { appId: appId }), viewAllHref ? (_jsx("div", { className: "flex justify-end", children: _jsx(Button, { asChild: true, variant: "link", size: "sm", className: "gap-1.5", children: _jsxs(Link, { to: viewAllHref, children: ["View all usage", _jsx(IconArrowUpRight, {})] }) }) })) : null] })) : null] }));
|
|
344
357
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RecentPromptEntry {
|
|
2
|
+
id: number;
|
|
3
|
+
ownerEmail: string;
|
|
4
|
+
app: string;
|
|
5
|
+
label: string;
|
|
6
|
+
model: string;
|
|
7
|
+
prompt: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function groupRecentPrompts<T extends RecentPromptEntry>(entries: readonly T[]): Array<{
|
|
10
|
+
entry: T;
|
|
11
|
+
count: number;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function groupRecentPrompts(entries) {
|
|
2
|
+
const groups = new Map();
|
|
3
|
+
for (const entry of entries) {
|
|
4
|
+
const key = entry.prompt === null
|
|
5
|
+
? JSON.stringify(["uncaptured", entry.id])
|
|
6
|
+
: JSON.stringify([
|
|
7
|
+
entry.ownerEmail.toLowerCase(),
|
|
8
|
+
entry.app,
|
|
9
|
+
entry.label,
|
|
10
|
+
entry.model,
|
|
11
|
+
entry.prompt,
|
|
12
|
+
]);
|
|
13
|
+
const group = groups.get(key);
|
|
14
|
+
if (group)
|
|
15
|
+
group.count += 1;
|
|
16
|
+
else
|
|
17
|
+
groups.set(key, { entry, count: 1 });
|
|
18
|
+
}
|
|
19
|
+
return [...groups.values()];
|
|
20
|
+
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
|
|
14
14
|
*/
|
|
15
15
|
export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
16
|
-
error: string;
|
|
17
16
|
ok?: undefined;
|
|
17
|
+
error: string;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
|
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
-
error?: undefined;
|
|
45
|
-
ok?: undefined;
|
|
46
44
|
summary: import("./types.js").TraceSummary;
|
|
47
45
|
spans: import("./types.js").TraceSpan[];
|
|
48
46
|
id?: undefined;
|
|
49
|
-
} | {
|
|
50
47
|
error?: undefined;
|
|
51
48
|
ok?: undefined;
|
|
49
|
+
} | {
|
|
52
50
|
summary?: undefined;
|
|
53
51
|
spans?: undefined;
|
|
54
52
|
id: string;
|
|
55
|
-
|
|
53
|
+
error?: undefined;
|
|
56
54
|
ok?: undefined;
|
|
55
|
+
} | {
|
|
57
56
|
summary?: undefined;
|
|
58
57
|
spans?: undefined;
|
|
59
58
|
id?: undefined;
|
|
60
59
|
error: any;
|
|
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
|
}>>;
|
|
@@ -76,8 +76,9 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
78
|
id?: undefined;
|
|
79
|
+
message?: undefined;
|
|
79
80
|
deleted?: undefined;
|
|
80
|
-
|
|
81
|
+
found?: 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
96
|
id?: undefined;
|
|
97
|
-
|
|
97
|
+
message?: undefined;
|
|
98
98
|
count?: undefined;
|
|
99
|
+
deleted?: undefined;
|
|
99
100
|
providers?: 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
|
count?: undefined;
|
|
108
|
+
deleted?: undefined;
|
|
109
109
|
providers?: 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
|
-
|
|
116
|
+
message?: undefined;
|
|
117
117
|
count?: undefined;
|
|
118
|
-
providers?: undefined;
|
|
119
118
|
found?: undefined;
|
|
119
|
+
providers?: undefined;
|
|
120
|
+
provider?: undefined;
|
|
120
121
|
deleted: boolean;
|
|
121
122
|
id: string;
|
|
122
123
|
registered?: undefined;
|
|
123
124
|
label?: undefined;
|
|
124
|
-
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
deleted?: undefined;
|
|
127
|
-
provider?: undefined;
|
|
128
126
|
count?: undefined;
|
|
129
|
-
|
|
127
|
+
deleted?: undefined;
|
|
130
128
|
found?: undefined;
|
|
129
|
+
providers?: undefined;
|
|
130
|
+
provider?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -311,9 +311,10 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
-
|
|
314
|
+
message?: undefined;
|
|
315
315
|
id?: undefined;
|
|
316
316
|
deleted?: undefined;
|
|
317
|
+
found?: undefined;
|
|
317
318
|
providers: {
|
|
318
319
|
id: string;
|
|
319
320
|
label: string;
|
|
@@ -324,46 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
324
325
|
updatedAt: number;
|
|
325
326
|
}[];
|
|
326
327
|
count: number;
|
|
327
|
-
|
|
328
|
+
provider?: undefined;
|
|
328
329
|
registered?: undefined;
|
|
329
330
|
label?: undefined;
|
|
330
|
-
message?: undefined;
|
|
331
331
|
} | {
|
|
332
|
+
message?: undefined;
|
|
332
333
|
id?: undefined;
|
|
333
334
|
deleted?: undefined;
|
|
334
|
-
providers?: undefined;
|
|
335
335
|
count?: undefined;
|
|
336
|
+
providers?: undefined;
|
|
336
337
|
found: boolean;
|
|
337
338
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
338
339
|
registered?: undefined;
|
|
339
340
|
label?: undefined;
|
|
340
|
-
message?: undefined;
|
|
341
341
|
} | {
|
|
342
|
-
|
|
342
|
+
message?: undefined;
|
|
343
343
|
deleted?: undefined;
|
|
344
|
-
providers?: undefined;
|
|
345
344
|
count?: undefined;
|
|
345
|
+
providers?: undefined;
|
|
346
|
+
provider?: undefined;
|
|
346
347
|
found: boolean;
|
|
347
348
|
id: string;
|
|
348
349
|
registered?: undefined;
|
|
349
350
|
label?: undefined;
|
|
350
|
-
message?: undefined;
|
|
351
351
|
} | {
|
|
352
|
-
|
|
353
|
-
providers?: undefined;
|
|
352
|
+
message?: undefined;
|
|
354
353
|
count?: undefined;
|
|
355
354
|
found?: 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
362
|
deleted?: undefined;
|
|
364
|
-
providers?: undefined;
|
|
365
363
|
count?: undefined;
|
|
366
364
|
found?: undefined;
|
|
365
|
+
providers?: undefined;
|
|
366
|
+
provider?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|
|
@@ -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
|
@@ -57,16 +57,16 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
|
|
|
57
57
|
/** POST /_agent-native/secrets/:key — write a secret. */
|
|
58
58
|
export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
59
59
|
error: string;
|
|
60
|
-
status?: undefined;
|
|
61
60
|
ok?: undefined;
|
|
61
|
+
status?: undefined;
|
|
62
62
|
} | {
|
|
63
63
|
ok: boolean;
|
|
64
64
|
status: string;
|
|
65
65
|
error?: undefined;
|
|
66
66
|
} | {
|
|
67
|
+
ok?: undefined;
|
|
67
68
|
error: string;
|
|
68
69
|
removed?: undefined;
|
|
69
|
-
ok?: undefined;
|
|
70
70
|
} | {
|
|
71
71
|
ok: boolean;
|
|
72
72
|
removed: boolean;
|
|
@@ -77,9 +77,9 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
77
77
|
* or the current stored value without changing anything.
|
|
78
78
|
*/
|
|
79
79
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
80
|
+
ok?: undefined;
|
|
80
81
|
error: string;
|
|
81
82
|
note?: undefined;
|
|
82
|
-
ok?: undefined;
|
|
83
83
|
} | {
|
|
84
84
|
ok: boolean;
|
|
85
85
|
note?: undefined;
|
|
@@ -56,10 +56,10 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
|
|
|
56
56
|
ok: boolean;
|
|
57
57
|
error: string;
|
|
58
58
|
} | {
|
|
59
|
+
error?: undefined;
|
|
59
60
|
ok: boolean;
|
|
60
61
|
key: string;
|
|
61
62
|
baseUrlKey?: string;
|
|
62
63
|
scope: AgentEngineApiKeyScope;
|
|
63
|
-
error?: undefined;
|
|
64
64
|
}>>;
|
|
65
65
|
export {};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* static suggestion list in `model-config.ts`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
8
|
-
error: string;
|
|
9
8
|
ok?: undefined;
|
|
9
|
+
error: string;
|
|
10
10
|
models?: undefined;
|
|
11
11
|
} | {
|
|
12
12
|
error?: undefined;
|
|
@@ -419,8 +419,8 @@ export declare function createPublicRemoteAgentsHandler(discover?: PublicAgentDi
|
|
|
419
419
|
error: string;
|
|
420
420
|
agents?: undefined;
|
|
421
421
|
} | {
|
|
422
|
-
agents: Omit<import("./agent-discovery.js").DiscoveredAgent, "auth" | "kind">[];
|
|
423
422
|
error?: undefined;
|
|
423
|
+
agents: Omit<import("./agent-discovery.js").DiscoveredAgent, "auth" | "kind">[];
|
|
424
424
|
}>>;
|
|
425
425
|
export declare function getBuilderConnectErrorDisposition(error: unknown, connectAttemptId: string | null): "correlated" | "legacy" | null;
|
|
426
426
|
export declare function getBuilderConnectErrorKey(ownerEmail: string, connectAttemptId?: string | null): string;
|
|
@@ -2,6 +2,7 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
2
2
|
resourceType: string;
|
|
3
3
|
resourceId: string;
|
|
4
4
|
}, {
|
|
5
|
+
role?: undefined;
|
|
5
6
|
ownerEmail: any;
|
|
6
7
|
visibility: any;
|
|
7
8
|
shares: any[];
|
|
@@ -11,7 +12,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
11
12
|
supportsGroupShares?: boolean;
|
|
12
13
|
};
|
|
13
14
|
orgId?: undefined;
|
|
14
|
-
role?: undefined;
|
|
15
15
|
agentReadable?: undefined;
|
|
16
16
|
} | {
|
|
17
17
|
ownerEmail: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.192.
|
|
3
|
+
"version": "0.192.1-nightly-20260926122223",
|
|
4
4
|
"description": "The agentic application framework for building autonomous agents with intuitive UIs",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|