@agent-native/core 0.210.2 → 0.211.0

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 (68) hide show
  1. package/dist/action.d.ts +8 -0
  2. package/dist/action.js +17 -0
  3. package/dist/agent/production-agent.js +11 -20
  4. package/dist/automation/index.d.ts +1 -1
  5. package/dist/client/chat/agentkit-protocol.js +48 -5
  6. package/dist/client/chat/runtime.d.ts +2 -0
  7. package/dist/client/chat/runtime.js +6 -1
  8. package/dist/client/hooks/index.d.ts +1 -1
  9. package/dist/client/hooks/index.js +1 -1
  10. package/dist/client/resources/mcp-integration-logos.js +4 -0
  11. package/dist/client/session-identity.d.ts +8 -0
  12. package/dist/client/session-identity.js +13 -0
  13. package/dist/client/use-action.d.ts +14 -0
  14. package/dist/client/use-action.js +117 -28
  15. package/dist/client/use-session.js +2 -0
  16. package/dist/collab/routes.d.ts +1 -1
  17. package/dist/deploy/build.js +24 -3
  18. package/dist/mcp/actions/revoke-org-service-token.js +5 -1
  19. package/dist/mcp/build-server.js +18 -2
  20. package/dist/mcp/execute-action-call.js +8 -17
  21. package/dist/notifications/routes.d.ts +1 -1
  22. package/dist/observability/routes.d.ts +4 -4
  23. package/dist/org/actions/set-app-member-roles.js +4 -0
  24. package/dist/org/actions/set-app-permission-roles.js +4 -0
  25. package/dist/org/actions/set-workspace-app-access.js +4 -0
  26. package/dist/org/handlers.d.ts +1 -1
  27. package/dist/org/index.d.ts +1 -1
  28. package/dist/progress/routes.d.ts +1 -1
  29. package/dist/provider-api/actions/custom-provider-registration.d.ts +17 -17
  30. package/dist/provider-api/actions/provider-api.d.ts +11 -11
  31. package/dist/review/suggestions/actions.d.ts +1 -0
  32. package/dist/review/suggestions/actions.js +54 -42
  33. package/dist/secrets/actions/delete-api-key.js +4 -0
  34. package/dist/secrets/routes.d.ts +6 -6
  35. package/dist/server/action-approval.d.ts +15 -0
  36. package/dist/server/action-approval.js +39 -0
  37. package/dist/server/action-routes.js +33 -28
  38. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  39. package/dist/server/agent-engine-default-model-route.d.ts +1 -1
  40. package/dist/server/agent-engine-ollama-models-route.d.ts +2 -2
  41. package/dist/server/better-auth-instance.d.ts +6 -0
  42. package/dist/server/better-auth-instance.js +22 -12
  43. package/dist/server/edge.d.ts +1 -0
  44. package/dist/server/edge.js +1 -0
  45. package/dist/server/realtime-token.d.ts +1 -1
  46. package/dist/server/workspace-provider-oauth.js +1 -0
  47. package/dist/shared/action-error-codes.d.ts +5 -0
  48. package/dist/shared/action-error-codes.js +5 -0
  49. package/dist/shared/index.d.ts +1 -0
  50. package/dist/shared/index.js +1 -0
  51. package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +5 -3
  52. package/dist/templates/default/.agents/skills/actions/references/action-fields.md +5 -3
  53. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +105 -33
  54. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +128 -74
  55. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +39 -11
  56. package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +5 -3
  57. package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +5 -3
  58. package/dist/triggers/actions/manage-automation.d.ts +3 -3
  59. package/dist/vite/client.js +2 -1
  60. package/docs/content/actions-access-control.mdx +3 -3
  61. package/package.json +3 -3
  62. package/src/templates/chat/.agents/skills/actions/references/action-fields.md +5 -3
  63. package/src/templates/default/.agents/skills/actions/references/action-fields.md +5 -3
  64. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +105 -33
  65. package/src/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +128 -74
  66. package/src/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +39 -11
  67. package/src/templates/headless/.agents/skills/actions/references/action-fields.md +5 -3
  68. package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +5 -3
@@ -95,9 +95,9 @@ MCP clients see no `outputSchema` by default. Set `mcpOutputSchema: true` (requi
95
95
 
96
96
  `authorize` decides whether the caller may run the action at all. It wraps
97
97
  `run`, so it holds at **all six dispatch sites** — agent tool, HTTP, frontend
98
- hook, MCP, A2A, CLI — unlike `needsApproval`, which is honoured only in the
99
- agent loop. Use `authorize` for "not everyone may do this"; use `needsApproval`
100
- to ask a human to bless one call a permitted caller is already allowed to make.
98
+ hook, MCP, A2A, CLI. Use `authorize` for "not everyone may do this"; use
99
+ `needsApproval` to ask a human to bless one call a permitted caller is already
100
+ allowed to make.
101
101
 
102
102
  ```ts
103
103
  import { coachAccess } from "../lib/access.js"; // defineAppRoles(...)
@@ -140,4 +140,6 @@ export default defineAction({
140
140
 
141
141
  When the gate is truthy and the call isn't yet approved, the loop emits an `approval_required` event and **stops the turn — `run()` never executes**. A predicate gates conditionally (e.g. only external recipients) and **fails closed**: a throw is treated as "approval required". It receives its own copy of the prepared snapshot of the validated arguments, defaults applied, and the approval binds to the snapshot's hash, so an approved call runs only with the arguments that were approved (a Date binds by its time). The human approves via the chat UI's Approve affordance, which re-issues the turn with the call's `approvalKey`, and only then does the action run.
142
142
 
143
+ Approval is given in the app, so HTTP never grants it. The HTTP action route and the generated Workers entry run a gated call only for the proven app UI (a frontend call from the signed-in user, same origin, holding the short-lived UI capability; `isProvenUiRequest`, the proof `uiOnly` uses) or the app's MCP directory widget. Every other HTTP caller (bearer or API key, MCP OAuth token, org service token, A2A, extension iframe, mobile app) gets `409 approval_required`, and a service identity can never approve. The shared client presents the capability with every write from a signed-in session (minted once per user, reused for nine minutes, never for reads or public pages), so a gated button works on its first request. A call without proof gets `403 ui_capability_required`; the client then re-mints and retries once, which is only the fallback for an expired or rejected capability. Every surface evaluates the gate through `preparedCallNeedsApproval`, so a throwing predicate asks there too. A caller that must run unattended needs a different action, never a bypass of the gate.
144
+
143
145
  **Keep approvals rare** — the default is off and almost every action should leave it off. The canonical example is Mail's `send-email` (`needsApproval: true`). See the `security` skill and the Human Approval doc.