@agent-native/core 0.120.0 → 0.120.1
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/core/CHANGELOG.md +7 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +45 -0
- package/corpus/core/src/client/use-chat-models.ts +45 -0
- package/corpus/core/src/server/analytics.ts +15 -0
- package/corpus/core/src/server/auth.ts +17 -13
- package/corpus/core/src/server/better-auth-instance.ts +13 -1
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/assets/changelog/2026-07-23-new-chat-aligns-with-sidebar-controls.md +6 -0
- package/corpus/templates/forms/.agents/skills/form-publishing/SKILL.md +9 -3
- package/corpus/templates/forms/AGENTS.md +11 -1
- package/corpus/templates/forms/README.md +24 -1
- package/corpus/templates/forms/actions/update-form.ts +12 -5
- package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +199 -1
- package/corpus/templates/forms/app/i18n/en-US.ts +13 -1
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +35 -4
- package/corpus/templates/forms/app/pages/FormFillPage.tsx +7 -16
- package/corpus/templates/forms/changelog/2026-07-23-forms-can-branch-into-follow-up-questions-and-route-response.md +6 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +22 -31
- package/corpus/templates/forms/server/lib/integrations.ts +11 -2
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +26 -5
- package/corpus/templates/forms/server/lib/validate-fields.ts +48 -11
- package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/forms/shared/conditional.ts +67 -0
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +35 -0
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/use-chat-models.d.ts +1 -0
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +33 -0
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +6 -6
- package/dist/provider-api/actions/provider-api.d.ts +9 -9
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/server/analytics.d.ts +8 -0
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/analytics.js +16 -0
- package/dist/server/analytics.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -4
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +8 -0
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +10 -1
- package/dist/server/better-auth-instance.js.map +1 -1
- package/package.json +1 -1
- package/src/client/MultiTabAssistantChat.tsx +45 -0
- package/src/client/use-chat-models.ts +45 -0
- package/src/server/analytics.ts +15 -0
- package/src/server/auth.ts +17 -13
- package/src/server/better-auth-instance.ts +13 -1
package/src/server/auth.ts
CHANGED
|
@@ -98,6 +98,7 @@ import {
|
|
|
98
98
|
type WorkspaceAppAudience,
|
|
99
99
|
} from "../shared/workspace-app-audience.js";
|
|
100
100
|
import { isValidWorkspaceAppIdFormat } from "../shared/workspace-app-id.js";
|
|
101
|
+
import { injectAnalyticsIntoHtml } from "./analytics.js";
|
|
101
102
|
import { signupAttributionFromCookieHeader } from "./attribution.js";
|
|
102
103
|
import { getBetterAuth, getBetterAuthSync } from "./better-auth-instance.js";
|
|
103
104
|
import type { BetterAuthConfig } from "./better-auth-instance.js";
|
|
@@ -1646,20 +1647,23 @@ function injectLoginSocialImageMeta(loginHtml: string, event: H3Event): string {
|
|
|
1646
1647
|
}
|
|
1647
1648
|
|
|
1648
1649
|
function loginHtmlResponse(loginHtml: string, event: H3Event): Response {
|
|
1649
|
-
return new Response(
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1650
|
+
return new Response(
|
|
1651
|
+
injectAnalyticsIntoHtml(injectLoginSocialImageMeta(loginHtml, event)),
|
|
1652
|
+
{
|
|
1653
|
+
status: 200,
|
|
1654
|
+
headers: {
|
|
1655
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
1656
|
+
// The sign-in document is part of the public server shell. Keep it on the
|
|
1657
|
+
// same long-fresh/long-SWR CDN policy as React Router SSR so hosted
|
|
1658
|
+
// template roots do not invoke origin just to render anonymous login UI.
|
|
1659
|
+
// The login markup is env-INDEPENDENT (a Google-only app always renders
|
|
1660
|
+
// a working button); the analytics script is public build configuration,
|
|
1661
|
+
// not user/session state. Never downgrade this to private/no-store.
|
|
1662
|
+
...DEFAULT_SSR_CACHE_HEADERS,
|
|
1663
|
+
"X-Robots-Tag": "noindex, nofollow",
|
|
1664
|
+
},
|
|
1661
1665
|
},
|
|
1662
|
-
|
|
1666
|
+
);
|
|
1663
1667
|
}
|
|
1664
1668
|
|
|
1665
1669
|
function isHtmlDocumentRequest(event: H3Event, pathname: string): boolean {
|
|
@@ -1109,6 +1109,18 @@ async function createBetterAuthInstance(
|
|
|
1109
1109
|
return auth as unknown as BetterAuthInstance;
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Configure the local auth connection with the same write contention settings
|
|
1114
|
+
* as the shared app connection. Better Auth uses its own SQLite handle, so the
|
|
1115
|
+
* app connection's busy timeout does not protect first-run account creation.
|
|
1116
|
+
*/
|
|
1117
|
+
export function configureLocalSqlite(sqlite: {
|
|
1118
|
+
pragma(statement: string): unknown;
|
|
1119
|
+
}): void {
|
|
1120
|
+
sqlite.pragma("busy_timeout = 10000");
|
|
1121
|
+
sqlite.pragma("journal_mode = WAL");
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1112
1124
|
async function buildDatabaseConfig(
|
|
1113
1125
|
dialect: string,
|
|
1114
1126
|
): Promise<BetterAuthOptions["database"]> {
|
|
@@ -1182,7 +1194,7 @@ async function buildDatabaseConfig(
|
|
|
1182
1194
|
const { default: Database } = await import("better-sqlite3");
|
|
1183
1195
|
const filePath = url.replace(/^file:/, "");
|
|
1184
1196
|
const sqlite = new Database(filePath);
|
|
1185
|
-
sqlite
|
|
1197
|
+
configureLocalSqlite(sqlite);
|
|
1186
1198
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
1187
1199
|
const db = drizzle(sqlite, { schema: sqliteAuthSchema });
|
|
1188
1200
|
const { drizzleAdapter } = await import("better-auth/adapters/drizzle");
|