@agent-native/core 0.161.14 → 0.161.17
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/chat/vitest.config.ts +12 -7
- package/corpus/templates/clips/app/hooks/use-recording-leave-guard.ts +70 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
- package/corpus/templates/clips/app/routes/record.tsx +42 -0
- package/corpus/templates/clips/changelog/2026-08-18-clips-now-recovers-interrupted-uploads-and-reliably-restarts.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-18-meeting-notifications-no-longer-show-decorative-left-side-lines.md +6 -0
- package/corpus/templates/clips/desktop/src/lib/updater.ts +21 -1
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +0 -4
- package/corpus/templates/clips/desktop/src/styles.css +0 -18
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +3 -1
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +6 -3
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +98 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +54 -20
- package/corpus/templates/design/app/global.css +6 -0
- package/corpus/templates/design/app/root.tsx +1 -1
- package/corpus/templates/design/changelog/2026-08-18-design-chat-context-stays-out-of-the-composer.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/slides/app/root.tsx +21 -0
- package/corpus/templates/slides/server/handlers/decks.ts +7 -3
- package/corpus/templates/slides/server/handlers/request-auth-context.ts +58 -1
- package/corpus/templates/slides/server/handlers/share.ts +7 -2
- package/corpus/templates/slides/server/handlers/uploads.ts +7 -2
- package/dist/action.d.ts +1 -0
- package/dist/action.js +1 -1
- package/dist/agent/engine/translate-anthropic.js +19 -1
- package/dist/agent/engine/types.d.ts +7 -0
- package/dist/agent/production-agent.js +60 -5
- package/dist/agent/thread-data-builder.d.ts +16 -4
- package/dist/agent/thread-data-builder.js +159 -5
- package/dist/client/agent-chat-adapter.js +13 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams.js +3 -1
- package/dist/server/cors-origins.js +24 -1
- package/dist/templates/chat/vitest.config.ts +12 -7
- package/dist/transcription/builder-transcription.js +12 -1
- package/package.json +1 -1
- package/src/templates/chat/vitest.config.ts +12 -7
|
@@ -12,6 +12,26 @@ export function isTrustedNativeAppOrigin(origin) {
|
|
|
12
12
|
export function isLocalhostOrigin(origin) {
|
|
13
13
|
return LOCALHOST_ORIGIN_RE.test(origin);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Normalize an allowlist entry or an incoming `Origin` header for exact-match
|
|
17
|
+
* comparison. This does not widen what is admitted — it is still an exact
|
|
18
|
+
* scheme+host+port match — it only tolerates formatting slop that carries no
|
|
19
|
+
* security meaning:
|
|
20
|
+
* - scheme/host casing (RFC 6454 origins are case-insensitive; an operator
|
|
21
|
+
* pasting a domain from a UI that preserves entered case can end up with
|
|
22
|
+
* e.g. "HTTPS://App.Example.com")
|
|
23
|
+
* - a trailing slash (browsers never send one in `Origin`, but it's an easy
|
|
24
|
+
* copy/paste mistake when configuring the allowlist)
|
|
25
|
+
* - a bare domain with no scheme (`CORS_ALLOWED_ORIGINS` is operationally a
|
|
26
|
+
* "domain allowlist" — operators reasonably enter "app.example.com"
|
|
27
|
+
* instead of "https://app.example.com", which then never matches a real
|
|
28
|
+
* Origin header and silently locks out that legitimate origin)
|
|
29
|
+
*/
|
|
30
|
+
function normalizeCorsOrigin(value) {
|
|
31
|
+
const trimmed = value.trim().replace(/\/+$/, "");
|
|
32
|
+
const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed);
|
|
33
|
+
return (hasScheme ? trimmed : `https://${trimmed}`).toLowerCase();
|
|
34
|
+
}
|
|
15
35
|
export function getAllowedCorsOrigin(origin, options = {}) {
|
|
16
36
|
if (!origin)
|
|
17
37
|
return null;
|
|
@@ -22,7 +42,10 @@ export function getAllowedCorsOrigin(origin, options = {}) {
|
|
|
22
42
|
return origin;
|
|
23
43
|
const allowedOrigins = options.allowedOrigins ?? readCorsAllowedOrigins();
|
|
24
44
|
if (allowedOrigins.length > 0) {
|
|
25
|
-
|
|
45
|
+
const normalizedOrigin = normalizeCorsOrigin(origin);
|
|
46
|
+
return allowedOrigins.some((allowed) => normalizeCorsOrigin(allowed) === normalizedOrigin)
|
|
47
|
+
? origin
|
|
48
|
+
: null;
|
|
26
49
|
}
|
|
27
50
|
if (options.allowAnyOriginWhenNoAllowlist)
|
|
28
51
|
return origin;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mergeConfig } from "vitest/config";
|
|
1
|
+
import path from "node:path";
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import { defineConfig } from "vitest/config";
|
|
5
4
|
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
// Keep tests independent from vite.config.ts: the production config starts
|
|
6
|
+
// Nitro/Vite watchers and evaluates browser-targeted CommonJS SSR modules.
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: {
|
|
10
|
+
"@": path.resolve(__dirname, "./app"),
|
|
11
|
+
"@shared": path.resolve(__dirname, "./shared"),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveBuilderGatewayAuth, getBuilderProxyOrigin, } from "../server/credential-provider.js";
|
|
1
|
+
import { resolveBuilderGatewayAuth, getBuilderProxyOrigin, recordBuilderGatewayAuthFailure, } from "../server/credential-provider.js";
|
|
2
2
|
function describeError(err) {
|
|
3
3
|
if (!(err instanceof Error))
|
|
4
4
|
return String(err);
|
|
@@ -64,6 +64,17 @@ export async function transcribeWithBuilder(opts) {
|
|
|
64
64
|
}
|
|
65
65
|
if (!res.ok) {
|
|
66
66
|
const text = await res.text().catch(() => "");
|
|
67
|
+
// The chat path records this so a rejected credential is not retried for
|
|
68
|
+
// BUILDER_AUTH_FAILURE_TTL_MS; transcription never did, so one bad
|
|
69
|
+
// credential re-sent the same doomed request on every attempt -- prod
|
|
70
|
+
// logged 24 identical `Missing Authentication header` 401s in a day off a
|
|
71
|
+
// single unusable credential, with nothing to stop the next one.
|
|
72
|
+
if (res.status === 401 || res.status === 403) {
|
|
73
|
+
await recordBuilderGatewayAuthFailure({
|
|
74
|
+
status: res.status,
|
|
75
|
+
message: text,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
67
78
|
throw new Error(`Builder transcription failed (${res.status} ${res.statusText}): ${text}`);
|
|
68
79
|
}
|
|
69
80
|
return (await res.json());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.161.
|
|
3
|
+
"version": "0.161.17",
|
|
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": {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mergeConfig } from "vitest/config";
|
|
1
|
+
import path from "node:path";
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import { defineConfig } from "vitest/config";
|
|
5
4
|
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
// Keep tests independent from vite.config.ts: the production config starts
|
|
6
|
+
// Nitro/Vite watchers and evaluates browser-targeted CommonJS SSR modules.
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: {
|
|
10
|
+
"@": path.resolve(__dirname, "./app"),
|
|
11
|
+
"@shared": path.resolve(__dirname, "./shared"),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|