@agent-native/core 0.137.4 → 0.137.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/clips/app/components/library/library-layout.tsx +95 -17
- package/corpus/templates/clips/app/components/library/space-card.tsx +136 -66
- package/corpus/templates/clips/app/components/library/space-dialogs.tsx +144 -0
- package/corpus/templates/clips/app/hooks/use-library.ts +2 -2
- package/corpus/templates/clips/app/i18n/en-US.ts +13 -0
- package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +6 -2
- package/corpus/templates/clips/changelog/2026-08-04-signing-out-now-takes-effect-immediately-after-verifying-a-n.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +1 -1
- package/corpus/templates/clips/desktop/src/components/MediaDeviceRow.tsx +106 -87
- package/corpus/templates/clips/desktop/src/styles.css +19 -1
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +7 -0
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +103 -49
- package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +4 -0
- package/corpus/templates/design/app/components/design/multi-screen/paint-suppression.ts +85 -0
- package/corpus/templates/design/changelog/2026-08-03-zoom-screen-blink.md +6 -0
- package/dist/agent/run-store.js +18 -0
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.js +35 -13
- package/dist/server/better-auth-instance.d.ts +1 -0
- package/dist/server/realtime-token.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent/run-store.js
CHANGED
|
@@ -1168,6 +1168,24 @@ export async function reconcileTerminalRunFromEvents(runId) {
|
|
|
1168
1168
|
const client = getDbExec();
|
|
1169
1169
|
const errorCode = errorCodeForTerminalEvent(latest.event);
|
|
1170
1170
|
const errorDetail = errorDetailForTerminalEvent(latest.event);
|
|
1171
|
+
// A row already holding the reconciled values is converged, and saying
|
|
1172
|
+
// otherwise is not cosmetic: the UPDATE below still matches such a row and
|
|
1173
|
+
// SQL counts an unchanged rewrite as affected, so `rowsAffected` reports
|
|
1174
|
+
// "repaired" on every call. `getRunByThread` re-reads and re-reconciles on
|
|
1175
|
+
// that answer, so a settled errored/stale_run row recurses forever and pins
|
|
1176
|
+
// the event loop instead of returning. Converged must read as no work done.
|
|
1177
|
+
const { rows: currentRows } = await client.execute({
|
|
1178
|
+
sql: `SELECT status, error_code, terminal_reason, completed_at FROM agent_runs WHERE id = ?`,
|
|
1179
|
+
args: [runId],
|
|
1180
|
+
});
|
|
1181
|
+
const current = currentRows[0];
|
|
1182
|
+
if (current &&
|
|
1183
|
+
current.status === status &&
|
|
1184
|
+
(current.error_code ?? null) === (errorCode ?? null) &&
|
|
1185
|
+
(current.terminal_reason ?? null) === terminalReason &&
|
|
1186
|
+
current.completed_at != null) {
|
|
1187
|
+
return false;
|
|
1188
|
+
}
|
|
1171
1189
|
const { rowsAffected } = await client.execute({
|
|
1172
1190
|
sql: `UPDATE agent_runs
|
|
1173
1191
|
SET status = ?,
|
|
@@ -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
|
-
ok?: undefined;
|
|
17
16
|
error: string;
|
|
17
|
+
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
14
|
count: number;
|
|
15
15
|
updated?: undefined;
|
|
16
|
-
error?: undefined;
|
|
17
16
|
ok?: undefined;
|
|
17
|
+
error?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
count?: undefined;
|
|
20
20
|
updated: number;
|
|
21
|
-
error?: undefined;
|
|
22
21
|
ok?: undefined;
|
|
22
|
+
error?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
count?: undefined;
|
|
25
25
|
updated?: undefined;
|
|
@@ -28,7 +28,7 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
|
|
|
28
28
|
} | {
|
|
29
29
|
count?: undefined;
|
|
30
30
|
updated?: undefined;
|
|
31
|
-
error?: undefined;
|
|
32
31
|
ok: boolean;
|
|
32
|
+
error?: undefined;
|
|
33
33
|
}>>;
|
|
34
34
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -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,37 +34,37 @@ 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
|
+
error?: undefined;
|
|
40
41
|
ok: boolean;
|
|
41
42
|
status: string;
|
|
42
|
-
error?: undefined;
|
|
43
43
|
} | {
|
|
44
|
+
ok?: undefined;
|
|
44
45
|
error: string;
|
|
45
46
|
removed?: undefined;
|
|
46
|
-
ok?: undefined;
|
|
47
47
|
} | {
|
|
48
|
+
error?: undefined;
|
|
48
49
|
ok: boolean;
|
|
49
50
|
removed: boolean;
|
|
50
|
-
error?: undefined;
|
|
51
51
|
}>>;
|
|
52
52
|
/**
|
|
53
53
|
* POST /_agent-native/secrets/:key/test — validate an optional candidate value
|
|
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
|
+
error?: undefined;
|
|
61
62
|
ok: boolean;
|
|
62
63
|
note?: undefined;
|
|
63
|
-
error?: undefined;
|
|
64
64
|
} | {
|
|
65
|
+
error?: undefined;
|
|
65
66
|
ok: boolean;
|
|
66
67
|
note: string;
|
|
67
|
-
error?: undefined;
|
|
68
68
|
} | {
|
|
69
69
|
note?: undefined;
|
|
70
70
|
ok: boolean;
|
|
@@ -95,12 +95,12 @@ export interface AdHocSecretPayload {
|
|
|
95
95
|
export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
|
|
96
96
|
error: string;
|
|
97
97
|
} | {
|
|
98
|
+
error?: undefined;
|
|
98
99
|
ok: boolean;
|
|
99
100
|
key: string;
|
|
100
|
-
error?: undefined;
|
|
101
101
|
} | {
|
|
102
|
+
error?: undefined;
|
|
102
103
|
ok: boolean;
|
|
103
104
|
removed: boolean;
|
|
104
|
-
error?: undefined;
|
|
105
105
|
}>>;
|
|
106
106
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -27,11 +27,11 @@ 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 {};
|
|
37
37
|
//# sourceMappingURL=agent-engine-api-key-route.d.ts.map
|
package/dist/server/auth.js
CHANGED
|
@@ -389,18 +389,18 @@ async function readDesktopSsoSafely(event) {
|
|
|
389
389
|
* user. Returns undefined if no session cookie was minted (the common
|
|
390
390
|
* case — Better Auth's reset doesn't auto-sign-in by default).
|
|
391
391
|
*/
|
|
392
|
+
function getSetCookieHeaders(headers) {
|
|
393
|
+
const responseHeaders = headers;
|
|
394
|
+
return typeof responseHeaders.getSetCookie === "function"
|
|
395
|
+
? responseHeaders.getSetCookie()
|
|
396
|
+
: (responseHeaders.get("set-cookie") ?? "")
|
|
397
|
+
.split(/,(?=[^;]+=)/)
|
|
398
|
+
.map((value) => value.trim())
|
|
399
|
+
.filter(Boolean);
|
|
400
|
+
}
|
|
392
401
|
function extractSessionTokenFromSetCookies(response) {
|
|
393
402
|
try {
|
|
394
|
-
|
|
395
|
-
// when available (Node 20+ / undici), else fall back to comma split.
|
|
396
|
-
const headers = response.headers;
|
|
397
|
-
const setCookies = typeof headers.getSetCookie === "function"
|
|
398
|
-
? headers.getSetCookie()
|
|
399
|
-
: (headers.get("set-cookie") ?? "")
|
|
400
|
-
.split(/,(?=[^;]+=)/)
|
|
401
|
-
.map((s) => s.trim())
|
|
402
|
-
.filter(Boolean);
|
|
403
|
-
for (const sc of setCookies) {
|
|
403
|
+
for (const sc of getSetCookieHeaders(response.headers)) {
|
|
404
404
|
// Better Auth's session cookie name is configurable but defaults to
|
|
405
405
|
// `<prefix>.session_token`. Match either the Better Auth default or
|
|
406
406
|
// our COOKIE_NAME (`an_session`) on the same line.
|
|
@@ -414,6 +414,16 @@ function extractSessionTokenFromSetCookies(response) {
|
|
|
414
414
|
}
|
|
415
415
|
return undefined;
|
|
416
416
|
}
|
|
417
|
+
function forwardBetterAuthSetCookies(event, result) {
|
|
418
|
+
if (!result || typeof result !== "object")
|
|
419
|
+
return;
|
|
420
|
+
const headers = result.headers;
|
|
421
|
+
if (!headers || typeof headers.get !== "function")
|
|
422
|
+
return;
|
|
423
|
+
for (const cookie of getSetCookieHeaders(headers)) {
|
|
424
|
+
event.res?.headers?.append("set-cookie", cookie);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
417
427
|
// ---------------------------------------------------------------------------
|
|
418
428
|
// ACCESS_TOKEN resolution
|
|
419
429
|
// ---------------------------------------------------------------------------
|
|
@@ -2762,7 +2772,11 @@ async function mountBetterAuthRoutes(app, options) {
|
|
|
2762
2772
|
clearFrameworkSessionCookies(event);
|
|
2763
2773
|
optOutOfAuthDisabledSession(event);
|
|
2764
2774
|
try {
|
|
2765
|
-
await auth.api.signOut({
|
|
2775
|
+
const result = await auth.api.signOut({
|
|
2776
|
+
headers: event.headers,
|
|
2777
|
+
returnHeaders: true,
|
|
2778
|
+
});
|
|
2779
|
+
forwardBetterAuthSetCookies(event, result);
|
|
2766
2780
|
}
|
|
2767
2781
|
catch {
|
|
2768
2782
|
// Ignore if no Better Auth session
|
|
@@ -2826,7 +2840,11 @@ async function mountBetterAuthRoutes(app, options) {
|
|
|
2826
2840
|
clearFrameworkSessionCookies(event);
|
|
2827
2841
|
optOutOfAuthDisabledSession(event);
|
|
2828
2842
|
try {
|
|
2829
|
-
await auth.api.signOut({
|
|
2843
|
+
const result = await auth.api.signOut({
|
|
2844
|
+
headers: event.headers,
|
|
2845
|
+
returnHeaders: true,
|
|
2846
|
+
});
|
|
2847
|
+
forwardBetterAuthSetCookies(event, result);
|
|
2830
2848
|
}
|
|
2831
2849
|
catch {
|
|
2832
2850
|
// Ignore — sessions are already gone in DB.
|
|
@@ -2981,7 +2999,11 @@ function mountAuthFallbackRoutes(app) {
|
|
|
2981
2999
|
optOutOfAuthDisabledSession(event);
|
|
2982
3000
|
try {
|
|
2983
3001
|
const auth = await getBetterAuth();
|
|
2984
|
-
await auth.api.signOut({
|
|
3002
|
+
const result = await auth.api.signOut({
|
|
3003
|
+
headers: event.headers,
|
|
3004
|
+
returnHeaders: true,
|
|
3005
|
+
});
|
|
3006
|
+
forwardBetterAuthSetCookies(event, result);
|
|
2985
3007
|
}
|
|
2986
3008
|
catch {
|
|
2987
3009
|
// Ignore if Better Auth is still unavailable
|
|
@@ -26,9 +26,9 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
-
error?: undefined;
|
|
30
29
|
token: string;
|
|
31
30
|
expiresAt: string;
|
|
32
31
|
ttlSeconds: number;
|
|
32
|
+
error?: undefined;
|
|
33
33
|
}>>;
|
|
34
34
|
//# sourceMappingURL=realtime-token.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.137.
|
|
3
|
+
"version": "0.137.6",
|
|
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": {
|