@agent-native/core 0.157.24 → 0.157.27
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/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/server/identity-sso.js +40 -37
- package/dist/server/realtime-token.d.ts +1 -1
- package/package.json +1 -1
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
-
error?: undefined;
|
|
66
65
|
states: {
|
|
67
66
|
clientId: number;
|
|
68
67
|
state: string;
|
|
69
68
|
}[];
|
|
69
|
+
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
-
error?: undefined;
|
|
81
80
|
users: {
|
|
82
81
|
clientId: number;
|
|
83
82
|
lastSeen: number;
|
|
84
83
|
}[];
|
|
84
|
+
error?: undefined;
|
|
85
85
|
}>>;
|
|
@@ -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;
|
|
@@ -17,11 +17,11 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
17
17
|
id?: undefined;
|
|
18
18
|
provider?: undefined;
|
|
19
19
|
} | {
|
|
20
|
-
error?: undefined;
|
|
21
20
|
configured?: undefined;
|
|
22
21
|
connectPath?: undefined;
|
|
23
22
|
url: string;
|
|
24
23
|
id: string;
|
|
25
24
|
provider: string;
|
|
25
|
+
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export default _default;
|
|
@@ -329,12 +329,49 @@ function safeRequestReturnPath(event) {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
export async function handleIdentitySso(event, subpath) {
|
|
332
|
-
const hub = resolveIdentityHubUrl(event);
|
|
333
|
-
if (!hub)
|
|
334
|
-
return new Response("Not found", { status: 404 });
|
|
335
332
|
const method = getMethod(event);
|
|
336
333
|
const sub = ("/" + subpath.replace(/^\/+/, "").replace(/\/+$/, "")).replace(/^\/$/, "");
|
|
337
334
|
const loginPath = SIGN_IN_ENTRY_PATH;
|
|
335
|
+
// Dispatch is the identity authority, so it has no SSO hub for the
|
|
336
|
+
// browser to federate to. Its authenticated desktop completion page still
|
|
337
|
+
// lives on this route and must be reachable after ordinary sign-in.
|
|
338
|
+
if (sub === "/desktop-complete") {
|
|
339
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
340
|
+
return new Response("Method not allowed", { status: 405 });
|
|
341
|
+
}
|
|
342
|
+
let nonce = "";
|
|
343
|
+
try {
|
|
344
|
+
nonce =
|
|
345
|
+
new URL(requestUrl(event), "http://an.invalid").searchParams.get("nonce") || "";
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
return new Response("Invalid completion request", { status: 400 });
|
|
349
|
+
}
|
|
350
|
+
if (!DESKTOP_COMPLETION_NONCE.test(nonce)) {
|
|
351
|
+
return new Response("Invalid completion request", { status: 400 });
|
|
352
|
+
}
|
|
353
|
+
const current = await getSession(event).catch((error) => {
|
|
354
|
+
void error;
|
|
355
|
+
return null;
|
|
356
|
+
});
|
|
357
|
+
if (!current?.email) {
|
|
358
|
+
return new Response("Authentication required", { status: 401 });
|
|
359
|
+
}
|
|
360
|
+
return new Response('<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8">' +
|
|
361
|
+
'<meta name="viewport" content="width=device-width,initial-scale=1">' +
|
|
362
|
+
"<title>Signed in</title></head><body>Signed in. You can close this window.</body></html>", {
|
|
363
|
+
status: 200,
|
|
364
|
+
headers: {
|
|
365
|
+
"Cache-Control": "no-store",
|
|
366
|
+
"Content-Security-Policy": "default-src 'none'; style-src 'none'",
|
|
367
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
368
|
+
"Referrer-Policy": "no-referrer",
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
const hub = resolveIdentityHubUrl(event);
|
|
373
|
+
if (!hub)
|
|
374
|
+
return new Response("Not found", { status: 404 });
|
|
338
375
|
if (sub === "/login") {
|
|
339
376
|
if (method !== "GET" && method !== "HEAD") {
|
|
340
377
|
return new Response("Method not allowed", { status: 405 });
|
|
@@ -437,40 +474,6 @@ export async function handleIdentitySso(event, subpath) {
|
|
|
437
474
|
}
|
|
438
475
|
return redirect(event, safeReturnPath(stateResult.returnPath));
|
|
439
476
|
}
|
|
440
|
-
if (sub === "/desktop-complete") {
|
|
441
|
-
if (method !== "GET" && method !== "HEAD") {
|
|
442
|
-
return new Response("Method not allowed", { status: 405 });
|
|
443
|
-
}
|
|
444
|
-
let nonce = "";
|
|
445
|
-
try {
|
|
446
|
-
nonce =
|
|
447
|
-
new URL(requestUrl(event), "http://an.invalid").searchParams.get("nonce") || "";
|
|
448
|
-
}
|
|
449
|
-
catch {
|
|
450
|
-
return new Response("Invalid completion request", { status: 400 });
|
|
451
|
-
}
|
|
452
|
-
if (!DESKTOP_COMPLETION_NONCE.test(nonce)) {
|
|
453
|
-
return new Response("Invalid completion request", { status: 400 });
|
|
454
|
-
}
|
|
455
|
-
const current = await getSession(event).catch((error) => {
|
|
456
|
-
void error;
|
|
457
|
-
return null;
|
|
458
|
-
});
|
|
459
|
-
if (!current?.email) {
|
|
460
|
-
return new Response("Authentication required", { status: 401 });
|
|
461
|
-
}
|
|
462
|
-
return new Response('<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8">' +
|
|
463
|
-
'<meta name="viewport" content="width=device-width,initial-scale=1">' +
|
|
464
|
-
"<title>Signed in</title></head><body>Signed in. You can close this window.</body></html>", {
|
|
465
|
-
status: 200,
|
|
466
|
-
headers: {
|
|
467
|
-
"Cache-Control": "no-store",
|
|
468
|
-
"Content-Security-Policy": "default-src 'none'; style-src 'none'",
|
|
469
|
-
"Content-Type": "text/html; charset=utf-8",
|
|
470
|
-
"Referrer-Policy": "no-referrer",
|
|
471
|
-
},
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
477
|
return new Response("Not found", { status: 404 });
|
|
475
478
|
}
|
|
476
479
|
export function isIdentitySsoBypassPath(p) {
|
|
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
error?: undefined;
|
|
29
30
|
token: string;
|
|
30
31
|
expiresAt: string;
|
|
31
32
|
ttlSeconds: number;
|
|
32
|
-
error?: undefined;
|
|
33
33
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.157.
|
|
3
|
+
"version": "0.157.27",
|
|
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": {
|