@agent-native/core 0.212.0 → 0.212.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/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/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +1 -1
- package/dist/org/handlers.js +2 -0
- package/dist/org/workspace-app-access-outcome.d.ts +1 -1
- package/dist/org/workspace-app-access.js +18 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +3 -3
|
@@ -38,19 +38,19 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
38
38
|
error: string;
|
|
39
39
|
states?: undefined;
|
|
40
40
|
} | {
|
|
41
|
-
error?: undefined;
|
|
42
41
|
states: {
|
|
43
42
|
clientId: number;
|
|
44
43
|
state: string;
|
|
45
44
|
}[];
|
|
45
|
+
error?: undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
48
48
|
error: string;
|
|
49
49
|
users?: undefined;
|
|
50
50
|
} | {
|
|
51
|
-
error?: undefined;
|
|
52
51
|
users: {
|
|
53
52
|
clientId: number;
|
|
54
53
|
lastSeen: number;
|
|
55
54
|
}[];
|
|
55
|
+
error?: undefined;
|
|
56
56
|
}>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
2
|
-
error?: undefined;
|
|
3
2
|
count: number;
|
|
3
|
+
error?: undefined;
|
|
4
4
|
ok?: undefined;
|
|
5
5
|
updated?: undefined;
|
|
6
6
|
} | {
|
|
7
|
-
error?: undefined;
|
|
8
7
|
count?: undefined;
|
|
9
8
|
updated: number;
|
|
9
|
+
error?: undefined;
|
|
10
10
|
ok?: undefined;
|
|
11
11
|
} | {
|
|
12
12
|
count?: undefined;
|
|
@@ -14,8 +14,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
|
|
|
14
14
|
ok?: undefined;
|
|
15
15
|
updated?: undefined;
|
|
16
16
|
} | {
|
|
17
|
-
error?: undefined;
|
|
18
17
|
count?: undefined;
|
|
19
18
|
ok: boolean;
|
|
19
|
+
error?: undefined;
|
|
20
20
|
updated?: undefined;
|
|
21
21
|
}>>;
|
package/dist/org/handlers.js
CHANGED
|
@@ -1625,6 +1625,7 @@ export const setA2ASecretHandler = defineEventHandler(async (event) => {
|
|
|
1625
1625
|
sql: `UPDATE organizations SET a2a_secret = ? WHERE id = ?`,
|
|
1626
1626
|
args: [secret, ctx.orgId],
|
|
1627
1627
|
});
|
|
1628
|
+
invalidateMemberOrgCaches();
|
|
1628
1629
|
return { a2aSecret: secret, previousSecret };
|
|
1629
1630
|
});
|
|
1630
1631
|
/**
|
|
@@ -1904,5 +1905,6 @@ export const receiveA2ASecretHandler = defineEventHandler(async (event) => {
|
|
|
1904
1905
|
sql: `UPDATE organizations SET a2a_secret = ? WHERE id = ?`,
|
|
1905
1906
|
args: [newSecret, localOrgId],
|
|
1906
1907
|
});
|
|
1908
|
+
invalidateMemberOrgCaches();
|
|
1907
1909
|
return { ok: true, orgId: localOrgId };
|
|
1908
1910
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WORKSPACE_APP_ACCESS_UNAVAILABLE: "unavailable";
|
|
2
2
|
export declare const WORKSPACE_APP_ACCESS_UNAVAILABLE_MESSAGE = "Workspace app access is temporarily unavailable.";
|
|
3
|
-
export type WorkspaceAppAccessUnavailableReason = "directory-url-invalid" | "org-domain-lookup-failed" | "org-domain-missing" | "a2a-secret-missing" | "token-signing-failed" | "registry-timeout" | "registry-fetch-failed" | "registry-http-error" | "registry-malformed-response" | "claim-http-error" | "claim-malformed-response";
|
|
3
|
+
export type WorkspaceAppAccessUnavailableReason = "directory-url-invalid" | "org-domain-lookup-failed" | "org-a2a-secret-lookup-failed" | "org-domain-missing" | "a2a-secret-missing" | "token-signing-failed" | "registry-timeout" | "registry-fetch-failed" | "registry-http-error" | "registry-malformed-response" | "claim-http-error" | "claim-malformed-response";
|
|
4
4
|
/**
|
|
5
5
|
* The access check could not reach a verdict. Distinct from `false`: the
|
|
6
6
|
* caller is not refused, the answer is unknown, and `reason` says which step
|
|
@@ -211,6 +211,17 @@ async function cachedOrgDomain(orgId) {
|
|
|
211
211
|
rememberWorkspaceAccess(key, domain, generation);
|
|
212
212
|
return domain;
|
|
213
213
|
}
|
|
214
|
+
async function cachedOrgA2ASecret(orgId) {
|
|
215
|
+
const key = `a2a-secret:${orgId}`;
|
|
216
|
+
const cached = getCachedWorkspaceAccess(key);
|
|
217
|
+
if (cached !== undefined)
|
|
218
|
+
return cached;
|
|
219
|
+
const generation = workspaceAccessGenerationNow();
|
|
220
|
+
const { getOrgA2ASecret } = await import("./context.js");
|
|
221
|
+
const secret = await getOrgA2ASecret(orgId);
|
|
222
|
+
rememberWorkspaceAccess(key, secret, generation);
|
|
223
|
+
return secret;
|
|
224
|
+
}
|
|
214
225
|
async function resolveHostedWorkspaceAppAuth(configuredDirectory, context, email) {
|
|
215
226
|
const url = workspaceAppsActionUrl(configuredDirectory);
|
|
216
227
|
if (!url)
|
|
@@ -224,14 +235,18 @@ async function resolveHostedWorkspaceAppAuth(configuredDirectory, context, email
|
|
|
224
235
|
if (orgId && !normalizedOrgDomain) {
|
|
225
236
|
return workspaceAppAccessUnavailable("org-domain-missing", { audience });
|
|
226
237
|
}
|
|
227
|
-
|
|
238
|
+
stage = "org-a2a-secret-lookup-failed";
|
|
239
|
+
const orgSecret = orgId
|
|
240
|
+
? (await cachedOrgA2ASecret(orgId))?.trim() || undefined
|
|
241
|
+
: undefined;
|
|
242
|
+
const signingSecret = orgSecret || readDeployCredentialEnv("A2A_SECRET")?.trim();
|
|
228
243
|
if (!signingSecret) {
|
|
229
244
|
return workspaceAppAccessUnavailable("a2a-secret-missing", { audience });
|
|
230
245
|
}
|
|
231
246
|
stage = "token-signing-failed";
|
|
232
|
-
const token = await signA2AToken(email, normalizedOrgDomain,
|
|
247
|
+
const token = await signA2AToken(email, normalizedOrgDomain, orgSecret, {
|
|
233
248
|
expiresIn: "1m",
|
|
234
|
-
preferGlobalSecret:
|
|
249
|
+
preferGlobalSecret: false,
|
|
235
250
|
audience,
|
|
236
251
|
extraClaims: {
|
|
237
252
|
jti: randomUUID(),
|
|
@@ -39,8 +39,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
39
39
|
error: string;
|
|
40
40
|
}>;
|
|
41
41
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
42
|
-
ok?: undefined;
|
|
43
42
|
error: string;
|
|
43
|
+
ok?: undefined;
|
|
44
44
|
} | {
|
|
45
45
|
error?: undefined;
|
|
46
46
|
ok: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.212.
|
|
3
|
+
"version": "0.212.1",
|
|
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": {
|
|
@@ -727,8 +727,8 @@
|
|
|
727
727
|
"yaml": "^2.9.0",
|
|
728
728
|
"yjs": "^13.6.33",
|
|
729
729
|
"zod": "^4.3.6",
|
|
730
|
-
"@agent-native/agentkit": "^0.212.
|
|
731
|
-
"@agent-native/recap-cli": "^0.5.
|
|
730
|
+
"@agent-native/agentkit": "^0.212.1",
|
|
731
|
+
"@agent-native/recap-cli": "^0.5.80"
|
|
732
732
|
},
|
|
733
733
|
"devDependencies": {
|
|
734
734
|
"@ai-sdk/anthropic": "^3.0.71",
|