@agent-native/core 0.212.1 → 0.213.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.
Files changed (84) hide show
  1. package/dist/a2a/anthropic-managed-agents.js +1 -0
  2. package/dist/a2a/caller-auth.js +7 -2
  3. package/dist/a2a/client.d.ts +1 -0
  4. package/dist/a2a/client.js +27 -0
  5. package/dist/a2a/handlers.js +15 -3
  6. package/dist/a2a/organization-identity.d.ts +4 -1
  7. package/dist/a2a/organization-identity.js +3 -1
  8. package/dist/a2a/server.d.ts +6 -5
  9. package/dist/a2a/server.js +79 -6
  10. package/dist/a2a-claims.d.ts +1 -0
  11. package/dist/a2a-claims.js +1 -0
  12. package/dist/agent/actions/manage-provider-key-policy.js +4 -2
  13. package/dist/agent/app-model-defaults.js +2 -10
  14. package/dist/agent/loop-settings.js +2 -10
  15. package/dist/audit/actions/export-audit-events.js +1 -0
  16. package/dist/audit/attribution.d.ts +5 -4
  17. package/dist/audit/attribution.js +2 -1
  18. package/dist/audit/index.d.ts +1 -1
  19. package/dist/audit/ocsf.js +1 -0
  20. package/dist/audit/read-scope.js +2 -12
  21. package/dist/audit/record.js +1 -0
  22. package/dist/audit/store.js +12 -3
  23. package/dist/audit/types.d.ts +4 -0
  24. package/dist/automation/index.d.ts +1 -1
  25. package/dist/automations/service.js +3 -10
  26. package/dist/client/org/hooks.d.ts +3 -0
  27. package/dist/client/org/hooks.js +12 -0
  28. package/dist/connections/catalog.d.ts +1 -1
  29. package/dist/connections/catalog.js +7 -1
  30. package/dist/credentials/index.js +18 -2
  31. package/dist/db/schema-snapshot.generated.js +5 -2
  32. package/dist/feature-flags/a2a-action-route.js +1 -0
  33. package/dist/file-upload/storage-settings.js +2 -9
  34. package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
  35. package/dist/jobs/tools.js +2 -12
  36. package/dist/mcp/actions/service-token-access.js +15 -11
  37. package/dist/mcp/credential-issuance.js +9 -2
  38. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  39. package/dist/notifications/routes.d.ts +3 -3
  40. package/dist/observability/routes.d.ts +1 -1
  41. package/dist/org/actions.d.ts +1 -1
  42. package/dist/org/actions.js +3 -7
  43. package/dist/org/app-roles.js +10 -1
  44. package/dist/org/context.d.ts +1 -0
  45. package/dist/org/context.js +122 -24
  46. package/dist/org/federation.d.ts +1 -1
  47. package/dist/org/federation.js +2 -2
  48. package/dist/org/handlers.d.ts +4 -0
  49. package/dist/org/handlers.js +140 -44
  50. package/dist/org/index.d.ts +2 -1
  51. package/dist/org/membership.d.ts +6 -4
  52. package/dist/org/membership.js +7 -5
  53. package/dist/org/migrations.js +6 -0
  54. package/dist/org/plugin.d.ts +1 -0
  55. package/dist/org/plugin.js +9 -1
  56. package/dist/org/private-icon-handlers.js +4 -10
  57. package/dist/org/types.d.ts +2 -0
  58. package/dist/org/workspace-app-access.js +62 -14
  59. package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
  60. package/dist/provider-api/actions/provider-api.d.ts +3 -3
  61. package/dist/secrets/routes.d.ts +10 -10
  62. package/dist/server/action-routes.d.ts +1 -0
  63. package/dist/server/action-routes.js +13 -1
  64. package/dist/server/agent-chat/prompt-resources.js +1 -1
  65. package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
  66. package/dist/server/index.d.ts +1 -0
  67. package/dist/server/index.js +1 -0
  68. package/dist/server/org-admin.js +3 -2
  69. package/dist/server/personal-provider-key-holders.d.ts +1 -1
  70. package/dist/server/personal-provider-key-holders.js +7 -2
  71. package/dist/server/personal-provider-key-policy.d.ts +2 -0
  72. package/dist/server/personal-provider-key-policy.js +21 -5
  73. package/dist/server/request-context.d.ts +2 -0
  74. package/dist/server/request-context.js +7 -0
  75. package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
  76. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -13
  77. package/dist/triggers/actions/manage-automation.d.ts +5 -5
  78. package/dist/triggers/routes.js +2 -9
  79. package/dist/usage/alerts-store.js +2 -9
  80. package/dist/usage/metrics-store.js +2 -9
  81. package/dist/workspace-connections/actions/list-workspace-user-groups.d.ts +1 -1
  82. package/dist/workspace-connections/groups.js +2 -11
  83. package/package.json +3 -3
  84. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -13
@@ -67,6 +67,7 @@ declare const _default: import("../../action.js").ActionDefinition<{
67
67
  triggerType: "event" | "manual" | "schedule" | "webhook";
68
68
  body: string;
69
69
  }, {
70
+ deleted?: undefined;
70
71
  created: boolean;
71
72
  resourceId: string;
72
73
  name: string;
@@ -87,26 +88,25 @@ declare const _default: import("../../action.js").ActionDefinition<{
87
88
  executionCwd: string;
88
89
  mcpTools: string[];
89
90
  webhookPath: string;
90
- deleted?: undefined;
91
91
  updated?: undefined;
92
92
  changed?: undefined;
93
93
  previouslyEnabled?: undefined;
94
94
  requestedEnabled?: undefined;
95
95
  } | {
96
+ scope?: undefined;
97
+ enabled?: undefined;
98
+ nextRun?: undefined;
96
99
  created?: undefined;
97
100
  deleted: boolean;
98
101
  resourceId: string;
99
102
  name: string;
100
103
  updated?: undefined;
101
- scope?: undefined;
102
104
  triggerType?: undefined;
103
105
  event?: undefined;
104
106
  schedule?: undefined;
105
107
  timezone?: undefined;
106
108
  condition?: undefined;
107
109
  body?: undefined;
108
- enabled?: undefined;
109
- nextRun?: undefined;
110
110
  createdBy?: undefined;
111
111
  model?: undefined;
112
112
  reasoningEffort?: undefined;
@@ -119,8 +119,8 @@ declare const _default: import("../../action.js").ActionDefinition<{
119
119
  requestedEnabled?: undefined;
120
120
  webhookPath?: undefined;
121
121
  } | {
122
- created?: undefined;
123
122
  deleted?: undefined;
123
+ created?: undefined;
124
124
  updated: boolean;
125
125
  resourceId: string;
126
126
  name: string;
@@ -2,7 +2,6 @@ import { randomUUID } from "node:crypto";
2
2
  import { defineEventHandler, getRequestHeader, getMethod, setResponseStatus, } from "h3";
3
3
  import { AutomationConnectorError, readBoundedRequestBody, } from "../automation/index.js";
4
4
  import { canUpdateAutomationResource } from "../automations/service.js";
5
- import { getDbExec } from "../db/client.js";
6
5
  import { dispatchPendingIntegrationTask } from "../integrations/integration-durable-dispatch.js";
7
6
  import { insertPendingTask, isDuplicateEventError, } from "../integrations/pending-tasks-store.js";
8
7
  import { RESUME_AUTOMATION_PATCH } from "../jobs/automation-outcome.js";
@@ -13,6 +12,7 @@ import { getOrgContext } from "../org/context.js";
13
12
  import { organizationIdFromResourceOwner, organizationResourceOwner, resourceGetByPath, resourceListAllOwners, resourcePut, SHARED_OWNER, } from "../resources/store.js";
14
13
  import { getSession } from "../server/auth.js";
15
14
  import { readBody } from "../server/h3-helpers.js";
15
+ import { readOrgMemberRole } from "../server/personal-provider-key-policy.js";
16
16
  import { refreshEventSubscriptions } from "./dispatcher.js";
17
17
  import { findAutomationWebhookTarget, readAutomationWebhookPath, } from "./webhook-store.js";
18
18
  import { AUTOMATION_WEBHOOK_MAX_BODY_BYTES, AUTOMATION_WEBHOOK_PLATFORM, isAutomationWebhookToken, } from "./webhook.js";
@@ -113,14 +113,7 @@ async function currentUserCanUpdateAutomation(event, userEmail, resource, meta)
113
113
  if (!orgId)
114
114
  return false;
115
115
  try {
116
- const { rows } = await getDbExec().execute({
117
- sql: `SELECT role FROM org_members
118
- WHERE org_id = ? AND LOWER(email) = ?
119
- AND federation_removal_pending_at IS NULL
120
- LIMIT 1`,
121
- args: [orgId, userEmail.toLowerCase()],
122
- });
123
- const role = String(rows[0]?.role ?? "").toLowerCase();
116
+ const role = await readOrgMemberRole(orgId, userEmail);
124
117
  return role === "owner" || role === "admin";
125
118
  }
126
119
  catch {
@@ -3,6 +3,7 @@ import { ensureColumnExists, ensureIndexExists, ensureTableExists, } from "../db
3
3
  import { defineStore } from "../db/store-registry.js";
4
4
  import { fromMigrationEntries } from "../db/versioned-store-migrations.js";
5
5
  import { deleteNotification, notifyWithDelivery, } from "../notifications/index.js";
6
+ import { readOrgMemberRole } from "../server/personal-provider-key-policy.js";
6
7
  import { ForbiddenError } from "../sharing/access.js";
7
8
  import { USAGE_ALERT_MIGRATIONS, USAGE_ALERT_MIGRATIONS_TABLE, } from "./migrations.js";
8
9
  import { builderCreditsFromCostCents } from "./store.js";
@@ -141,15 +142,7 @@ async function resolveScope(scope, access) {
141
142
  const orgId = access.orgId?.trim() || null;
142
143
  let role = null;
143
144
  if (orgId) {
144
- const result = await getDbExec().execute({
145
- sql: `SELECT role FROM org_members
146
- WHERE org_id = ? AND LOWER(email) = ?
147
- AND federation_removal_pending_at IS NULL
148
- LIMIT 1`,
149
- args: [orgId, ownerEmail],
150
- });
151
- const candidate = result.rows[0]?.role;
152
- role = typeof candidate === "string" ? candidate : null;
145
+ role = await readOrgMemberRole(orgId, ownerEmail);
153
146
  }
154
147
  const canManage = scope === "user" || role === "owner" || role === "admin";
155
148
  if (scope === "workspace" && !canManage) {
@@ -1,5 +1,6 @@
1
1
  import { getAppConfig } from "../app-config/index.js";
2
2
  import { getDbExec } from "../db/client.js";
3
+ import { readOrgMemberRole } from "../server/personal-provider-key-policy.js";
3
4
  import { splitAgentChatContextFromMessage } from "../shared/agent-chat-context.js";
4
5
  import { ForbiddenError } from "../sharing/access.js";
5
6
  import { isSelfScopedUsageRead, usageOrgScope } from "./org-scope.js";
@@ -110,15 +111,7 @@ async function listOrgMembers(orgId) {
110
111
  async function getOrgRole(orgId, ownerEmail) {
111
112
  if (!orgId)
112
113
  return null;
113
- const result = await getDbExec().execute({
114
- sql: `SELECT role FROM org_members
115
- WHERE org_id = ? AND LOWER(email) = ?
116
- AND federation_removal_pending_at IS NULL
117
- LIMIT 1`,
118
- args: [orgId, ownerEmail],
119
- });
120
- const role = result.rows[0]?.role;
121
- return typeof role === "string" ? role : null;
114
+ return readOrgMemberRole(orgId, ownerEmail);
122
115
  }
123
116
  export async function canViewWorkspaceUsage(input) {
124
117
  const role = await getOrgRole(input.orgId?.trim() || null, normalizeEmail(input.ownerEmail));
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("../../action.js").ActionDefinition<Record<string, never>, {
2
- memberEmails: any[];
3
2
  id: string;
4
3
  orgId: string;
5
4
  name: string;
6
5
  createdByEmail: string;
7
6
  createdAt: string;
8
7
  updatedAt: string;
8
+ memberEmails: any[];
9
9
  }[]>;
10
10
  export default _default;
@@ -4,6 +4,7 @@ import { ensureIndexExists, ensureTableExists } from "../db/ddl-guard.js";
4
4
  import { defineStore } from "../db/store-registry.js";
5
5
  import { fromMigrationEntries } from "../db/versioned-store-migrations.js";
6
6
  import { isOrgMember } from "../org/membership.js";
7
+ import { readOrgMemberRole } from "../server/personal-provider-key-policy.js";
7
8
  import { getRequestOrgId, getRequestUserEmail, } from "../server/request-context.js";
8
9
  import { WORKSPACE_CONNECTIONS_MIGRATIONS, WORKSPACE_CONNECTIONS_MIGRATIONS_TABLE, } from "./migrations.js";
9
10
  export function workspaceUserGroupsTable() {
@@ -216,17 +217,7 @@ export async function workspaceUserGroupRole(orgId, userEmail) {
216
217
  if (!normalizedOrgId || !normalizedEmail) {
217
218
  return null;
218
219
  }
219
- const { rows } = await getDbExec().execute({
220
- sql: `SELECT role FROM org_members
221
- WHERE org_id = ? AND LOWER(email) = ?
222
- AND federation_removal_pending_at IS NULL
223
- LIMIT 1`,
224
- args: [normalizedOrgId, normalizedEmail],
225
- });
226
- const role = String(rows[0]?.role ?? "");
227
- return role === "owner" || role === "admin" || role === "member"
228
- ? role
229
- : null;
220
+ return readOrgMemberRole(normalizedOrgId, normalizedEmail);
230
221
  }
231
222
  export async function upsertWorkspaceUserGroup(input) {
232
223
  const requestScope = requireWorkspaceUserGroupScope();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.212.1",
3
+ "version": "0.213.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.1",
731
- "@agent-native/recap-cli": "^0.5.80"
730
+ "@agent-native/recap-cli": "^0.5.82",
731
+ "@agent-native/agentkit": "^0.213.1"
732
732
  },
733
733
  "devDependencies": {
734
734
  "@ai-sdk/anthropic": "^3.0.71",
@@ -144,14 +144,17 @@ The framework supports two credential scopes:
144
144
  | Secret | Scope | How it is set |
145
145
  | --- | --- | --- |
146
146
  | `A2A_SECRET` | User identity across a deployment | env var, **never auto-generated** |
147
- | org `a2a_secret` | Organization principal only | auto-generated on org creation; Team page UI |
147
+ | org `a2a_secret` | Organization principal, with optional current-member delegation | auto-generated on org creation; Team page UI |
148
148
 
149
- An org-secret JWT proves only that the caller holds the organization's shared
150
- credential. Its `sub` or email claims are ignored; do not use it to read
149
+ An ordinary org-secret JWT proves only that the caller holds the organization's
150
+ shared credential. Its `sub` or email claims are ignored; do not use it to read
151
151
  person-owned data, claim a user's task, invoke a user-scoped action, or carry a
152
- human approval. Organization-scoped operations can run with this principal.
153
- Use an `A2A_SECRET`-signed user identity for user-owned operations and
154
- approval continuations. MCP applies the same distinction.
152
+ human approval. A separate `agent-native-org-member-delegation` assertion may
153
+ carry the identity of any current receiver-org member to a caller holding that
154
+ shared secret, but only when the receiver's owner enables the setting, the org
155
+ secret differs from `A2A_SECRET`, and the audience and short expiry verify. The
156
+ receiver checks the live roster, and delegated org actions are always capped at
157
+ `member`. MCP requests remain organization-scoped.
155
158
 
156
159
  Organization IDs are local to each app's database. For calls to a peer app,
157
160
  bind the token to the trusted `org_domain` and the peer's canonical audience;
@@ -161,16 +164,16 @@ ID. An ID-only token is valid only when both sides intentionally share the same
161
164
  local organization ID, such as a credential scoped to one local database.
162
165
 
163
166
  The org secret is managed at **Team page → A2A secret** (owner only), where it
164
- can be revealed, copied, regenerated, and pushed to discovered peers. It is a
165
- fallback for organization-scoped calls, not a fallback user identity.
167
+ can be revealed, copied, regenerated, and pushed to discovered peers. Its
168
+ member-identity delegation setting is owner-only and defaults off.
166
169
 
167
170
  `A2A_SECRET` is the deploy-level path. `workspace-deploy` refuses a production
168
171
  workspace deploy without it and prints the generator command. Peers that must
169
- trust user identity assertions need the *same* value on both sides. Keep it
170
- different from every org `a2a_secret`; a shared value cannot distinguish a
171
- user assertion from an organization credential. An org secret equal to
172
- `A2A_SECRET`, or a user token signed only with the org secret, is verified as an
173
- organization principal and reaches the caller as the typed
172
+ trust deployment-secret user assertions need the *same* value on both sides.
173
+ Keep it different from every org `a2a_secret`; a shared value cannot
174
+ distinguish a deployment user assertion from an organization credential. An
175
+ org secret equal to `A2A_SECRET` is verified as an organization principal and
176
+ reaches the caller as the typed
174
177
  `permanent_precondition` error ("no verified user"): an admin/ops fix, never a
175
178
  retry. Mismatched `A2A_SECRET` values are rejected with `401`
176
179
  (`a2a_auth_rejected`).