@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.
@@ -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,6 +1,6 @@
1
1
  export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
2
- error: string;
3
2
  ok?: undefined;
3
+ error: string;
4
4
  } | {
5
5
  error?: undefined;
6
6
  ok: boolean;
@@ -42,8 +42,8 @@ declare const _default: import("../../action.js").ActionDefinition<{
42
42
  url: string;
43
43
  id: string;
44
44
  provider: string;
45
- error?: undefined;
46
45
  configured?: undefined;
46
+ error?: undefined;
47
47
  } | {
48
48
  url?: undefined;
49
49
  id?: undefined;
@@ -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
  }>>;
@@ -64,6 +64,6 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
64
64
  message?: undefined;
65
65
  summary?: undefined;
66
66
  spans?: undefined;
67
- error?: undefined;
68
67
  ok: boolean;
68
+ error?: undefined;
69
69
  }>>;
@@ -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
- const signingSecret = readDeployCredentialEnv("A2A_SECRET")?.trim();
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, undefined, {
247
+ const token = await signA2AToken(email, normalizedOrgDomain, orgSecret, {
233
248
  expiresIn: "1m",
234
- preferGlobalSecret: true,
249
+ preferGlobalSecret: false,
235
250
  audience,
236
251
  extraClaims: {
237
252
  jti: randomUUID(),
@@ -2,6 +2,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
2
2
  error: string;
3
3
  ok?: undefined;
4
4
  } | {
5
- error?: undefined;
6
5
  ok: boolean;
6
+ error?: undefined;
7
7
  }>>;
@@ -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;
@@ -66,8 +66,8 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
66
66
  error: any;
67
67
  code: any;
68
68
  } | {
69
- error?: undefined;
70
69
  errorCode?: undefined;
70
+ error?: undefined;
71
71
  code?: undefined;
72
72
  ok: boolean;
73
73
  key: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.212.0",
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.0",
731
- "@agent-native/recap-cli": "^0.5.79"
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",